finilize tests

This commit is contained in:
am0o0
2024-07-13 18:00:50 +02:00
parent 0d0dc5158c
commit 71e1d63953
73 changed files with 1652 additions and 136 deletions

View File

@@ -0,0 +1,24 @@
edges
| JwtNoVerifier.java:43:28:43:55 | getParameter(...) : String | JwtNoVerifier.java:44:39:44:47 | JwtToken2 : String |
| JwtNoVerifier.java:44:39:44:47 | JwtToken2 : String | JwtNoVerifier.java:73:38:73:55 | token : String |
| JwtNoVerifier.java:73:38:73:55 | token : String | JwtNoVerifier.java:74:37:74:41 | token : String |
| JwtNoVerifier.java:74:26:74:42 | decode(...) : DecodedJWT | JwtNoVerifier.java:75:28:75:30 | jwt : DecodedJWT |
| JwtNoVerifier.java:74:37:74:41 | token : String | JwtNoVerifier.java:74:26:74:42 | decode(...) : DecodedJWT |
| JwtNoVerifier.java:75:16:75:31 | of(...) : Optional [<element>] : DecodedJWT | JwtNoVerifier.java:75:37:75:40 | item : DecodedJWT |
| JwtNoVerifier.java:75:28:75:30 | jwt : DecodedJWT | JwtNoVerifier.java:75:16:75:31 | of(...) : Optional [<element>] : DecodedJWT |
| JwtNoVerifier.java:75:37:75:40 | item : DecodedJWT | JwtNoVerifier.java:75:45:75:48 | item : DecodedJWT |
| JwtNoVerifier.java:75:45:75:48 | item : DecodedJWT | JwtNoVerifier.java:75:45:75:69 | getClaim(...) |
nodes
| JwtNoVerifier.java:43:28:43:55 | getParameter(...) : String | semmle.label | getParameter(...) : String |
| JwtNoVerifier.java:44:39:44:47 | JwtToken2 : String | semmle.label | JwtToken2 : String |
| JwtNoVerifier.java:73:38:73:55 | token : String | semmle.label | token : String |
| JwtNoVerifier.java:74:26:74:42 | decode(...) : DecodedJWT | semmle.label | decode(...) : DecodedJWT |
| JwtNoVerifier.java:74:37:74:41 | token : String | semmle.label | token : String |
| JwtNoVerifier.java:75:16:75:31 | of(...) : Optional [<element>] : DecodedJWT | semmle.label | of(...) : Optional [<element>] : DecodedJWT |
| JwtNoVerifier.java:75:28:75:30 | jwt : DecodedJWT | semmle.label | jwt : DecodedJWT |
| JwtNoVerifier.java:75:37:75:40 | item : DecodedJWT | semmle.label | item : DecodedJWT |
| JwtNoVerifier.java:75:45:75:48 | item : DecodedJWT | semmle.label | item : DecodedJWT |
| JwtNoVerifier.java:75:45:75:69 | getClaim(...) | semmle.label | getClaim(...) |
subpaths
#select
| JwtNoVerifier.java:75:45:75:69 | getClaim(...) | JwtNoVerifier.java:43:28:43:55 | getParameter(...) : String | JwtNoVerifier.java:75:45:75:69 | getClaim(...) | This parses a $@, but the signature is not verified. | JwtNoVerifier.java:43:28:43:55 | getParameter(...) | JWT |

View File

@@ -0,0 +1,121 @@
import java.io.*;
import java.security.NoSuchAlgorithmException;
import java.util.Objects;
import java.util.Optional;
import javax.crypto.KeyGenerator;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import com.auth0.jwt.JWT;
import com.auth0.jwt.JWTVerifier;
import com.auth0.jwt.algorithms.Algorithm;
import com.auth0.jwt.exceptions.JWTVerificationException;
import com.auth0.jwt.interfaces.DecodedJWT;
@WebServlet(description = "", displayName = "", largeIcon = "", name = "JwtTest1", smallIcon = "", urlPatterns = {}, value = "/Auth", initParams = {}, asyncSupported = false, loadOnStartup = 0)
public class JwtNoVerifier extends HttpServlet {
public void doPost(HttpServletRequest request, HttpServletResponse response) {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
// OK: first decode without signature verification
// and then verify with signature verification
String JwtToken1 = request.getParameter("JWT1");
String userName = decodeToken(JwtToken1);
verifyToken(JwtToken1, "A Securely generated Key");
if (Objects.equals(userName, "Admin")) {
out.println("<html><body>");
out.println("<h1>" + "heyyy Admin" + "</h1>");
out.println("</body></html>");
}
out.println("<html><body>");
out.println("<h1>" + "heyyy Nobody" + "</h1>");
out.println("</body></html>");
}
public void doGet(HttpServletRequest request, HttpServletResponse response) {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
// NOT OK: only decode, no verification
String JwtToken2 = request.getParameter("JWT2");
String userName = decodeToken(JwtToken2);
if (Objects.equals(userName, "Admin")) {
out.println("<html><body>");
out.println("<h1>" + "heyyy Admin" + "</h1>");
out.println("</body></html>");
}
// OK: no clue of the use of unsafe decoded JWT return value
JwtToken2 = request.getParameter("JWT2");
JWT.decode(JwtToken2);
out.println("<html><body>");
out.println("<h1>" + "heyyy Nobody" + "</h1>");
out.println("</body></html>");
}
public static boolean verifyToken(final String token, final String key) {
try {
JWTVerifier verifier = JWT.require(Algorithm.HMAC256(key)).build();
verifier.verify(token);
return true;
} catch (JWTVerificationException e) {
System.out.printf("jwt decode fail, token: %s", e);
}
return false;
}
public static String decodeToken(final String token) {
DecodedJWT jwt = JWT.decode(token);
return Optional.of(jwt).map(item -> item.getClaim("userName").asString()).orElse("");
}
private static String getSecureRandomKey() throws NoSuchAlgorithmException {
KeyGenerator keyGen = KeyGenerator.getInstance("AES");
keyGen.init(256); // for example
return keyGen.generateKey().toString();
}
static final String JWT_KEY = "KEY";
public static void NoNeedForTest(HttpServletRequest request) {
// constant key
String JwtToken3 = request.getParameter("JWT3");
verifyToken(JwtToken3, JWT_KEY);
// none algorithm
String JwtToken4 = request.getParameter("JWT4");
try {
verifyTokenNoneAlg(JwtToken4, getSecureRandomKey());
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException(e);
}
}
public static String generateToken(final String userName, final String key) {
try {
return JWT.create().withClaim("userName", userName).sign(Algorithm.HMAC256(key));
} catch (IllegalArgumentException e) {
System.out.printf("JWTToken generate fail %s", e);
}
return "";
}
public static boolean verifyTokenNoneAlg(final String token, final String key) {
try {
JWTVerifier verifier = JWT.require(Algorithm.none()).build();
verifier.verify(token);
return true;
} catch (JWTVerificationException e) {
System.out.printf("jwt decode fail, token: %s", e);
}
return false;
}
}

View File

@@ -1,92 +0,0 @@
package com.example.JwtTest;
import java.io.*;
import java.security.NoSuchAlgorithmException;
import java.util.Objects;
import java.util.Optional;
import com.auth0.jwt.JWT;
import com.auth0.jwt.JWTVerifier;
import com.auth0.jwt.algorithms.Algorithm;
import com.auth0.jwt.exceptions.JWTCreationException;
import com.auth0.jwt.exceptions.JWTVerificationException;
import com.auth0.jwt.interfaces.DecodedJWT;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class Test extends HttpServlet {
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
try {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
// OK: first decode without signature verification
// and then verify with signature verification
String JwtToken1 = request.getParameter("JWT1");
String userName = decodeToken(JwtToken1);
verifyToken(JwtToken1, "A Securely generated Key");
if (Objects.equals(userName, "Admin")) {
out.println("<html><body>");
out.println("<h1>" + "heyyy Admin" + "</h1>");
out.println("</body></html>");
}
out.println("<html><body>");
out.println("<h1>" + "heyyy Nobody" + "</h1>");
out.println("</body></html>");
} catch (Exception e) {
// TODO: handle exception
}
}
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
// NOT OK: only decode, no verification
String JwtToken2 = request.getParameter("JWT2");
String userName = decodeToken(JwtToken2);
if (Objects.equals(userName, "Admin")) {
out.println("<html><body>");
out.println("<h1>" + "heyyy Admin" + "</h1>");
out.println("</body></html>");
}
// OK: no clue of the use of unsafe decoded JWT return value
JwtToken2 = request.getParameter("JWT2");
JWT.decode(JwtToken2);
out.println("<html><body>");
out.println("<h1>" + "heyyy Nobody" + "</h1>");
out.println("</body></html>");
}
public static boolean verifyToken(final String token, final String key) {
try {
JWTVerifier verifier = JWT.require(Algorithm.HMAC256(key)).build();
verifier.verify(token);
return true;
} catch (JWTVerificationException e) {
System.out.printf("jwt decode fail, token: %s", e);
}
return false;
}
public static String decodeToken(final String token) {
DecodedJWT jwt = JWT.decode(token);
return Optional.of(jwt).map(item -> item.getClaim("userName").asString()).orElse("");
}
private static String getSecureRandomKey() throws NoSuchAlgorithmException {
KeyGenerator keyGen = KeyGenerator.getInstance("AES");
keyGen.init(256); // for example
return keyGen.generateKey().toString();
}
static final String JWT_KEY = "KEY";
}

View File

@@ -1 +1 @@
//semmle-extractor-options: --javac-args -cp ${testdir}/../../../../stubs/auth0-jwt-4.4.0/:${testdir}/../../../../stubs/javax-servlet-2.5/
//semmle-extractor-options: --javac-args -cp ${testdir}/../../../stubs/auth0-java-jwt-4.4.0:${testdir}/../../../stubs/javax.servlet-api-4.0.1

View File

@@ -1,43 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>JwtTest</artifactId>
<version>1.0-SNAPSHOT</version>
<name>JwtTest</name>
<packaging>war</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
<junit.version>5.9.2</junit.version>
</properties>
<dependencies>
<dependency>
<groupId>com.auth0</groupId>
<artifactId>java-jwt</artifactId>
<version>4.4.0</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.2</version>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1,17 @@
// Generated automatically from com.auth0.jwt.JWT for testing purposes
package com.auth0.jwt;
import com.auth0.jwt.JWTCreator;
import com.auth0.jwt.algorithms.Algorithm;
import com.auth0.jwt.interfaces.DecodedJWT;
import com.auth0.jwt.interfaces.Verification;
public class JWT
{
public DecodedJWT decodeJwt(String p0){ return null; }
public JWT(){}
public static DecodedJWT decode(String p0){ return null; }
public static JWTCreator.Builder create(){ return null; }
public static Verification require(Algorithm p0){ return null; }
}

View File

@@ -0,0 +1,46 @@
// Generated automatically from com.auth0.jwt.JWTCreator for testing purposes
package com.auth0.jwt;
import com.auth0.jwt.algorithms.Algorithm;
import java.time.Instant;
import java.util.Date;
import java.util.List;
import java.util.Map;
public class JWTCreator
{
protected JWTCreator() {}
static public class Builder
{
public JWTCreator.Builder withArrayClaim(String p0, Integer[] p1){ return null; }
public JWTCreator.Builder withArrayClaim(String p0, Long[] p1){ return null; }
public JWTCreator.Builder withArrayClaim(String p0, String[] p1){ return null; }
public JWTCreator.Builder withAudience(String... p0){ return null; }
public JWTCreator.Builder withClaim(String p0, Boolean p1){ return null; }
public JWTCreator.Builder withClaim(String p0, Date p1){ return null; }
public JWTCreator.Builder withClaim(String p0, Double p1){ return null; }
public JWTCreator.Builder withClaim(String p0, Instant p1){ return null; }
public JWTCreator.Builder withClaim(String p0, Integer p1){ return null; }
public JWTCreator.Builder withClaim(String p0, List<? extends Object> p1){ return null; }
public JWTCreator.Builder withClaim(String p0, Long p1){ return null; }
public JWTCreator.Builder withClaim(String p0, Map<String, ? extends Object> p1){ return null; }
public JWTCreator.Builder withClaim(String p0, String p1){ return null; }
public JWTCreator.Builder withExpiresAt(Date p0){ return null; }
public JWTCreator.Builder withExpiresAt(Instant p0){ return null; }
public JWTCreator.Builder withHeader(Map<String, Object> p0){ return null; }
public JWTCreator.Builder withHeader(String p0){ return null; }
public JWTCreator.Builder withIssuedAt(Date p0){ return null; }
public JWTCreator.Builder withIssuedAt(Instant p0){ return null; }
public JWTCreator.Builder withIssuer(String p0){ return null; }
public JWTCreator.Builder withJWTId(String p0){ return null; }
public JWTCreator.Builder withKeyId(String p0){ return null; }
public JWTCreator.Builder withNotBefore(Date p0){ return null; }
public JWTCreator.Builder withNotBefore(Instant p0){ return null; }
public JWTCreator.Builder withNullClaim(String p0){ return null; }
public JWTCreator.Builder withPayload(Map<String, ? extends Object> p0){ return null; }
public JWTCreator.Builder withPayload(String p0){ return null; }
public JWTCreator.Builder withSubject(String p0){ return null; }
public String sign(Algorithm p0){ return null; }
}
}

View File

@@ -0,0 +1,12 @@
// Generated automatically from com.auth0.jwt.JWTVerifier for testing purposes
package com.auth0.jwt;
import com.auth0.jwt.interfaces.DecodedJWT;
public class JWTVerifier implements com.auth0.jwt.interfaces.JWTVerifier
{
protected JWTVerifier() {}
public DecodedJWT verify(DecodedJWT p0){ return null; }
public DecodedJWT verify(String p0){ return null; }
}

View File

@@ -0,0 +1,50 @@
// Generated automatically from com.auth0.jwt.algorithms.Algorithm for testing purposes
package com.auth0.jwt.algorithms;
import com.auth0.jwt.interfaces.DecodedJWT;
import com.auth0.jwt.interfaces.ECDSAKeyProvider;
import com.auth0.jwt.interfaces.RSAKeyProvider;
import java.security.interfaces.ECKey;
import java.security.interfaces.ECPrivateKey;
import java.security.interfaces.ECPublicKey;
import java.security.interfaces.RSAKey;
import java.security.interfaces.RSAPrivateKey;
import java.security.interfaces.RSAPublicKey;
abstract public class Algorithm
{
protected Algorithm() {}
protected Algorithm(String p0, String p1){}
public String getName(){ return null; }
public String getSigningKeyId(){ return null; }
public String toString(){ return null; }
public abstract byte[] sign(byte[] p0);
public abstract void verify(DecodedJWT p0);
public byte[] sign(byte[] p0, byte[] p1){ return null; }
public static Algorithm ECDSA256(ECDSAKeyProvider p0){ return null; }
public static Algorithm ECDSA256(ECKey p0){ return null; }
public static Algorithm ECDSA256(ECPublicKey p0, ECPrivateKey p1){ return null; }
public static Algorithm ECDSA384(ECDSAKeyProvider p0){ return null; }
public static Algorithm ECDSA384(ECKey p0){ return null; }
public static Algorithm ECDSA384(ECPublicKey p0, ECPrivateKey p1){ return null; }
public static Algorithm ECDSA512(ECDSAKeyProvider p0){ return null; }
public static Algorithm ECDSA512(ECKey p0){ return null; }
public static Algorithm ECDSA512(ECPublicKey p0, ECPrivateKey p1){ return null; }
public static Algorithm HMAC256(String p0){ return null; }
public static Algorithm HMAC256(byte[] p0){ return null; }
public static Algorithm HMAC384(String p0){ return null; }
public static Algorithm HMAC384(byte[] p0){ return null; }
public static Algorithm HMAC512(String p0){ return null; }
public static Algorithm HMAC512(byte[] p0){ return null; }
public static Algorithm RSA256(RSAKey p0){ return null; }
public static Algorithm RSA256(RSAKeyProvider p0){ return null; }
public static Algorithm RSA256(RSAPublicKey p0, RSAPrivateKey p1){ return null; }
public static Algorithm RSA384(RSAKey p0){ return null; }
public static Algorithm RSA384(RSAKeyProvider p0){ return null; }
public static Algorithm RSA384(RSAPublicKey p0, RSAPrivateKey p1){ return null; }
public static Algorithm RSA512(RSAKey p0){ return null; }
public static Algorithm RSA512(RSAKeyProvider p0){ return null; }
public static Algorithm RSA512(RSAPublicKey p0, RSAPrivateKey p1){ return null; }
public static Algorithm none(){ return null; }
}

View File

@@ -0,0 +1,15 @@
// Generated automatically from com.auth0.jwt.exceptions.JWTVerificationException for testing purposes
package com.auth0.jwt.exceptions;
public class JWTCreationException extends RuntimeException {
protected JWTCreationException() {
}
public JWTCreationException(String p0) {
}
public JWTCreationException(String p0, Throwable p1) {
}
}

View File

@@ -0,0 +1,11 @@
// Generated automatically from com.auth0.jwt.exceptions.JWTVerificationException for testing purposes
package com.auth0.jwt.exceptions;
public class JWTVerificationException extends RuntimeException
{
protected JWTVerificationException() {}
public JWTVerificationException(String p0){}
public JWTVerificationException(String p0, Throwable p1){}
}

View File

@@ -0,0 +1,25 @@
// Generated automatically from com.auth0.jwt.interfaces.Claim for testing purposes
package com.auth0.jwt.interfaces;
import java.time.Instant;
import java.util.Date;
import java.util.List;
import java.util.Map;
public interface Claim
{
<T> T as(java.lang.Class<T> p0);
<T> T[] asArray(java.lang.Class<T> p0);
<T> java.util.List<T> asList(java.lang.Class<T> p0);
Boolean asBoolean();
Date asDate();
Double asDouble();
Integer asInt();
Long asLong();
Map<String, Object> asMap();
String asString();
boolean isMissing();
boolean isNull();
default Instant asInstant(){ return null; }
}

View File

@@ -0,0 +1,14 @@
// Generated automatically from com.auth0.jwt.interfaces.DecodedJWT for testing purposes
package com.auth0.jwt.interfaces;
import com.auth0.jwt.interfaces.Header;
import com.auth0.jwt.interfaces.Payload;
public interface DecodedJWT extends Header, Payload
{
String getHeader();
String getPayload();
String getSignature();
String getToken();
}

View File

@@ -0,0 +1,13 @@
// Generated automatically from com.auth0.jwt.interfaces.ECDSAKeyProvider for testing purposes
package com.auth0.jwt.interfaces;
import com.auth0.jwt.interfaces.KeyProvider;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.interfaces.ECPrivateKey;
import java.security.interfaces.ECPublicKey;
public interface ECDSAKeyProvider extends KeyProvider<ECPublicKey, ECPrivateKey>
{
}

View File

@@ -0,0 +1,14 @@
// Generated automatically from com.auth0.jwt.interfaces.Header for testing purposes
package com.auth0.jwt.interfaces;
import com.auth0.jwt.interfaces.Claim;
public interface Header
{
Claim getHeaderClaim(String p0);
String getAlgorithm();
String getContentType();
String getKeyId();
String getType();
}

View File

@@ -0,0 +1,11 @@
// Generated automatically from com.auth0.jwt.interfaces.JWTVerifier for testing purposes
package com.auth0.jwt.interfaces;
import com.auth0.jwt.interfaces.DecodedJWT;
public interface JWTVerifier
{
DecodedJWT verify(DecodedJWT p0);
DecodedJWT verify(String p0);
}

View File

@@ -0,0 +1,13 @@
// Generated automatically from com.auth0.jwt.interfaces.KeyProvider for testing purposes
package com.auth0.jwt.interfaces;
import java.security.PrivateKey;
import java.security.PublicKey;
interface KeyProvider<U extends PublicKey, R extends PrivateKey>
{
R getPrivateKey();
String getPrivateKeyId();
U getPublicKeyById(String p0);
}

View File

@@ -0,0 +1,25 @@
// Generated automatically from com.auth0.jwt.interfaces.Payload for testing purposes
package com.auth0.jwt.interfaces;
import com.auth0.jwt.interfaces.Claim;
import java.time.Instant;
import java.util.Date;
import java.util.List;
import java.util.Map;
public interface Payload
{
Claim getClaim(String p0);
Date getExpiresAt();
Date getIssuedAt();
Date getNotBefore();
List<String> getAudience();
Map<String, Claim> getClaims();
String getId();
String getIssuer();
String getSubject();
default Instant getExpiresAtAsInstant(){ return null; }
default Instant getIssuedAtAsInstant(){ return null; }
default Instant getNotBeforeAsInstant(){ return null; }
}

View File

@@ -0,0 +1,13 @@
// Generated automatically from com.auth0.jwt.interfaces.RSAKeyProvider for testing purposes
package com.auth0.jwt.interfaces;
import com.auth0.jwt.interfaces.KeyProvider;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.interfaces.RSAPrivateKey;
import java.security.interfaces.RSAPublicKey;
public interface RSAKeyProvider extends KeyProvider<RSAPublicKey, RSAPrivateKey>
{
}

View File

@@ -0,0 +1,38 @@
// Generated automatically from com.auth0.jwt.interfaces.Verification for testing purposes
package com.auth0.jwt.interfaces;
import com.auth0.jwt.interfaces.Claim;
import com.auth0.jwt.interfaces.DecodedJWT;
import java.time.Instant;
import java.util.Date;
import java.util.function.BiPredicate;
public interface Verification
{
Verification acceptExpiresAt(long p0);
Verification acceptIssuedAt(long p0);
Verification acceptLeeway(long p0);
Verification acceptNotBefore(long p0);
Verification ignoreIssuedAt();
Verification withAnyOfAudience(String... p0);
Verification withArrayClaim(String p0, Integer... p1);
Verification withArrayClaim(String p0, Long... p1);
Verification withArrayClaim(String p0, String... p1);
Verification withAudience(String... p0);
Verification withClaim(String p0, BiPredicate<Claim, DecodedJWT> p1);
Verification withClaim(String p0, Boolean p1);
Verification withClaim(String p0, Date p1);
Verification withClaim(String p0, Double p1);
Verification withClaim(String p0, Integer p1);
Verification withClaim(String p0, Long p1);
Verification withClaim(String p0, String p1);
Verification withClaimPresence(String p0);
Verification withIssuer(String... p0);
Verification withJWTId(String p0);
Verification withNullClaim(String p0);
Verification withSubject(String p0);
com.auth0.jwt.JWTVerifier build();
default Verification withClaim(String p0, Instant p1){ return null; }
default Verification withIssuer(String p0){ return null; }
}

View File

@@ -0,0 +1,11 @@
// Generated automatically from com.github.luben.zstd.BufferPool for testing purposes
package com.github.luben.zstd;
import java.nio.ByteBuffer;
public interface BufferPool
{
ByteBuffer get(int p0);
void release(ByteBuffer p0);
}

View File

@@ -0,0 +1,26 @@
// Generated automatically from javax.crypto.KeyGenerator for testing purposes
package javax.crypto;
import java.security.Provider;
import java.security.SecureRandom;
import java.security.spec.AlgorithmParameterSpec;
import javax.crypto.KeyGeneratorSpi;
import javax.crypto.SecretKey;
public class KeyGenerator
{
protected KeyGenerator() {}
protected KeyGenerator(KeyGeneratorSpi p0, Provider p1, String p2){}
public final Provider getProvider(){ return null; }
public final SecretKey generateKey(){ return null; }
public final String getAlgorithm(){ return null; }
public final void init(AlgorithmParameterSpec p0){}
public final void init(AlgorithmParameterSpec p0, SecureRandom p1){}
public final void init(SecureRandom p0){}
public final void init(int p0){}
public final void init(int p0, SecureRandom p1){}
public static KeyGenerator getInstance(String p0){ return null; }
public static KeyGenerator getInstance(String p0, Provider p1){ return null; }
public static KeyGenerator getInstance(String p0, String p1){ return null; }
}

View File

@@ -0,0 +1,16 @@
// Generated automatically from javax.crypto.KeyGeneratorSpi for testing purposes
package javax.crypto;
import java.security.SecureRandom;
import java.security.spec.AlgorithmParameterSpec;
import javax.crypto.SecretKey;
abstract public class KeyGeneratorSpi
{
protected abstract SecretKey engineGenerateKey();
protected abstract void engineInit(AlgorithmParameterSpec p0, SecureRandom p1);
protected abstract void engineInit(SecureRandom p0);
protected abstract void engineInit(int p0, SecureRandom p1);
public KeyGeneratorSpi(){}
}

View File

@@ -0,0 +1,11 @@
// Generated automatically from javax.crypto.SecretKey for testing purposes
package javax.crypto;
import java.security.Key;
import javax.security.auth.Destroyable;
public interface SecretKey extends Destroyable, Key
{
static long serialVersionUID = 0;
}

View File

@@ -0,0 +1,10 @@
// Generated automatically from javax.security.auth.Destroyable for testing purposes
package javax.security.auth;
public interface Destroyable
{
default boolean isDestroyed(){ return false; }
default void destroy(){}
}

View File

@@ -0,0 +1,31 @@
// Generated automatically from javax.servlet.AsyncContext for testing purposes
package javax.servlet;
import javax.servlet.AsyncListener;
import javax.servlet.ServletContext;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
public interface AsyncContext
{
<T extends AsyncListener> T createListener(java.lang.Class<T> p0);
ServletRequest getRequest();
ServletResponse getResponse();
boolean hasOriginalRequestAndResponse();
long getTimeout();
static String ASYNC_CONTEXT_PATH = null;
static String ASYNC_MAPPING = null;
static String ASYNC_PATH_INFO = null;
static String ASYNC_QUERY_STRING = null;
static String ASYNC_REQUEST_URI = null;
static String ASYNC_SERVLET_PATH = null;
void addListener(AsyncListener p0);
void addListener(AsyncListener p0, ServletRequest p1, ServletResponse p2);
void complete();
void dispatch();
void dispatch(ServletContext p0, String p1);
void dispatch(String p0);
void setTimeout(long p0);
void start(Runnable p0);
}

View File

@@ -0,0 +1,20 @@
// Generated automatically from javax.servlet.AsyncEvent for testing purposes
package javax.servlet;
import javax.servlet.AsyncContext;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
public class AsyncEvent
{
protected AsyncEvent() {}
public AsyncContext getAsyncContext(){ return null; }
public AsyncEvent(AsyncContext p0){}
public AsyncEvent(AsyncContext p0, ServletRequest p1, ServletResponse p2){}
public AsyncEvent(AsyncContext p0, ServletRequest p1, ServletResponse p2, Throwable p3){}
public AsyncEvent(AsyncContext p0, Throwable p1){}
public ServletRequest getSuppliedRequest(){ return null; }
public ServletResponse getSuppliedResponse(){ return null; }
public Throwable getThrowable(){ return null; }
}

View File

@@ -0,0 +1,14 @@
// Generated automatically from javax.servlet.AsyncListener for testing purposes
package javax.servlet;
import java.util.EventListener;
import javax.servlet.AsyncEvent;
public interface AsyncListener extends EventListener
{
void onComplete(AsyncEvent p0);
void onError(AsyncEvent p0);
void onStartAsync(AsyncEvent p0);
void onTimeout(AsyncEvent p0);
}

View File

@@ -0,0 +1,10 @@
// Generated automatically from javax.servlet.DispatcherType for testing purposes
package javax.servlet;
public enum DispatcherType
{
ASYNC, ERROR, FORWARD, INCLUDE, REQUEST;
private DispatcherType() {}
}

View File

@@ -0,0 +1,15 @@
// Generated automatically from javax.servlet.Filter for testing purposes
package javax.servlet;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
public interface Filter
{
default void destroy(){}
default void init(FilterConfig p0){}
void doFilter(ServletRequest p0, ServletResponse p1, FilterChain p2);
}

View File

@@ -0,0 +1,11 @@
// Generated automatically from javax.servlet.FilterChain for testing purposes
package javax.servlet;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
public interface FilterChain
{
void doFilter(ServletRequest p0, ServletResponse p1);
}

View File

@@ -0,0 +1,14 @@
// Generated automatically from javax.servlet.FilterConfig for testing purposes
package javax.servlet;
import java.util.Enumeration;
import javax.servlet.ServletContext;
public interface FilterConfig
{
Enumeration<String> getInitParameterNames();
ServletContext getServletContext();
String getFilterName();
String getInitParameter(String p0);
}

View File

@@ -0,0 +1,19 @@
// Generated automatically from javax.servlet.FilterRegistration for testing purposes
package javax.servlet;
import java.util.Collection;
import java.util.EnumSet;
import javax.servlet.DispatcherType;
import javax.servlet.Registration;
public interface FilterRegistration extends Registration
{
Collection<String> getServletNameMappings();
Collection<String> getUrlPatternMappings();
static public interface Dynamic extends FilterRegistration, Registration.Dynamic
{
}
void addMappingForServletNames(EnumSet<DispatcherType> p0, boolean p1, String... p2);
void addMappingForUrlPatterns(EnumSet<DispatcherType> p0, boolean p1, String... p2);
}

View File

@@ -0,0 +1,28 @@
// Generated automatically from javax.servlet.GenericServlet for testing purposes
package javax.servlet;
import java.io.Serializable;
import java.util.Enumeration;
import javax.servlet.Servlet;
import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
abstract public class GenericServlet implements Serializable, Servlet, ServletConfig
{
public Enumeration<String> getInitParameterNames(){ return null; }
public GenericServlet(){}
public ServletConfig getServletConfig(){ return null; }
public ServletContext getServletContext(){ return null; }
public String getInitParameter(String p0){ return null; }
public String getServletInfo(){ return null; }
public String getServletName(){ return null; }
public abstract void service(ServletRequest p0, ServletResponse p1);
public void destroy(){}
public void init(){}
public void init(ServletConfig p0){}
public void log(String p0){}
public void log(String p0, Throwable p1){}
}

View File

@@ -0,0 +1,16 @@
// Generated automatically from javax.servlet.HttpConstraintElement for testing purposes
package javax.servlet;
import javax.servlet.annotation.ServletSecurity;
public class HttpConstraintElement
{
public HttpConstraintElement(){}
public HttpConstraintElement(ServletSecurity.EmptyRoleSemantic p0){}
public HttpConstraintElement(ServletSecurity.EmptyRoleSemantic p0, ServletSecurity.TransportGuarantee p1, String... p2){}
public HttpConstraintElement(ServletSecurity.TransportGuarantee p0, String... p1){}
public ServletSecurity.EmptyRoleSemantic getEmptyRoleSemantic(){ return null; }
public ServletSecurity.TransportGuarantee getTransportGuarantee(){ return null; }
public String[] getRolesAllowed(){ return null; }
}

View File

@@ -0,0 +1,13 @@
// Generated automatically from javax.servlet.HttpMethodConstraintElement for testing purposes
package javax.servlet;
import javax.servlet.HttpConstraintElement;
public class HttpMethodConstraintElement extends HttpConstraintElement
{
protected HttpMethodConstraintElement() {}
public HttpMethodConstraintElement(String p0){}
public HttpMethodConstraintElement(String p0, HttpConstraintElement p1){}
public String getMethodName(){ return null; }
}

View File

@@ -0,0 +1,17 @@
// Generated automatically from javax.servlet.MultipartConfigElement for testing purposes
package javax.servlet;
import javax.servlet.annotation.MultipartConfig;
public class MultipartConfigElement
{
protected MultipartConfigElement() {}
public MultipartConfigElement(MultipartConfig p0){}
public MultipartConfigElement(String p0){}
public MultipartConfigElement(String p0, long p1, long p2, int p3){}
public String getLocation(){ return null; }
public int getFileSizeThreshold(){ return 0; }
public long getMaxFileSize(){ return 0; }
public long getMaxRequestSize(){ return 0; }
}

View File

@@ -0,0 +1,12 @@
// Generated automatically from javax.servlet.ReadListener for testing purposes
package javax.servlet;
import java.util.EventListener;
public interface ReadListener extends EventListener
{
void onAllDataRead();
void onDataAvailable();
void onError(Throwable p0);
}

View File

@@ -0,0 +1,20 @@
// Generated automatically from javax.servlet.Registration for testing purposes
package javax.servlet;
import java.util.Map;
import java.util.Set;
public interface Registration
{
Map<String, String> getInitParameters();
Set<String> setInitParameters(Map<String, String> p0);
String getClassName();
String getInitParameter(String p0);
String getName();
boolean setInitParameter(String p0, String p1);
static public interface Dynamic extends Registration
{
void setAsyncSupported(boolean p0);
}
}

View File

@@ -0,0 +1,30 @@
// Generated automatically from javax.servlet.RequestDispatcher for testing purposes
package javax.servlet;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
public interface RequestDispatcher
{
static String ERROR_EXCEPTION = null;
static String ERROR_EXCEPTION_TYPE = null;
static String ERROR_MESSAGE = null;
static String ERROR_REQUEST_URI = null;
static String ERROR_SERVLET_NAME = null;
static String ERROR_STATUS_CODE = null;
static String FORWARD_CONTEXT_PATH = null;
static String FORWARD_MAPPING = null;
static String FORWARD_PATH_INFO = null;
static String FORWARD_QUERY_STRING = null;
static String FORWARD_REQUEST_URI = null;
static String FORWARD_SERVLET_PATH = null;
static String INCLUDE_CONTEXT_PATH = null;
static String INCLUDE_MAPPING = null;
static String INCLUDE_PATH_INFO = null;
static String INCLUDE_QUERY_STRING = null;
static String INCLUDE_REQUEST_URI = null;
static String INCLUDE_SERVLET_PATH = null;
void forward(ServletRequest p0, ServletResponse p1);
void include(ServletRequest p0, ServletResponse p1);
}

View File

@@ -0,0 +1,16 @@
// Generated automatically from javax.servlet.Servlet for testing purposes
package javax.servlet;
import javax.servlet.ServletConfig;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
public interface Servlet
{
ServletConfig getServletConfig();
String getServletInfo();
void destroy();
void init(ServletConfig p0);
void service(ServletRequest p0, ServletResponse p1);
}

View File

@@ -0,0 +1,14 @@
// Generated automatically from javax.servlet.ServletConfig for testing purposes
package javax.servlet;
import java.util.Enumeration;
import javax.servlet.ServletContext;
public interface ServletConfig
{
Enumeration<String> getInitParameterNames();
ServletContext getServletContext();
String getInitParameter(String p0);
String getServletName();
}

View File

@@ -0,0 +1,83 @@
// Generated automatically from javax.servlet.ServletContext for testing purposes
package javax.servlet;
import java.io.InputStream;
import java.net.URL;
import java.util.Enumeration;
import java.util.EventListener;
import java.util.Map;
import java.util.Set;
import javax.servlet.Filter;
import javax.servlet.FilterRegistration;
import javax.servlet.RequestDispatcher;
import javax.servlet.Servlet;
import javax.servlet.ServletRegistration;
import javax.servlet.SessionCookieConfig;
import javax.servlet.SessionTrackingMode;
import javax.servlet.descriptor.JspConfigDescriptor;
public interface ServletContext
{
<T extends EventListener> T createListener(java.lang.Class<T> p0);
<T extends EventListener> void addListener(T p0);
<T extends Filter> T createFilter(java.lang.Class<T> p0);
<T extends Servlet> T createServlet(java.lang.Class<T> p0);
ClassLoader getClassLoader();
Enumeration<Servlet> getServlets();
Enumeration<String> getAttributeNames();
Enumeration<String> getInitParameterNames();
Enumeration<String> getServletNames();
FilterRegistration getFilterRegistration(String p0);
FilterRegistration.Dynamic addFilter(String p0, Class<? extends Filter> p1);
FilterRegistration.Dynamic addFilter(String p0, Filter p1);
FilterRegistration.Dynamic addFilter(String p0, String p1);
InputStream getResourceAsStream(String p0);
JspConfigDescriptor getJspConfigDescriptor();
Map<String, ? extends FilterRegistration> getFilterRegistrations();
Map<String, ? extends ServletRegistration> getServletRegistrations();
Object getAttribute(String p0);
RequestDispatcher getNamedDispatcher(String p0);
RequestDispatcher getRequestDispatcher(String p0);
Servlet getServlet(String p0);
ServletContext getContext(String p0);
ServletRegistration getServletRegistration(String p0);
ServletRegistration.Dynamic addJspFile(String p0, String p1);
ServletRegistration.Dynamic addServlet(String p0, Class<? extends Servlet> p1);
ServletRegistration.Dynamic addServlet(String p0, Servlet p1);
ServletRegistration.Dynamic addServlet(String p0, String p1);
SessionCookieConfig getSessionCookieConfig();
Set<SessionTrackingMode> getDefaultSessionTrackingModes();
Set<SessionTrackingMode> getEffectiveSessionTrackingModes();
Set<String> getResourcePaths(String p0);
String getContextPath();
String getInitParameter(String p0);
String getMimeType(String p0);
String getRealPath(String p0);
String getRequestCharacterEncoding();
String getResponseCharacterEncoding();
String getServerInfo();
String getServletContextName();
String getVirtualServerName();
URL getResource(String p0);
boolean setInitParameter(String p0, String p1);
int getEffectiveMajorVersion();
int getEffectiveMinorVersion();
int getMajorVersion();
int getMinorVersion();
int getSessionTimeout();
static String ORDERED_LIBS = null;
static String TEMPDIR = null;
void addListener(Class<? extends EventListener> p0);
void addListener(String p0);
void declareRoles(String... p0);
void log(Exception p0, String p1);
void log(String p0);
void log(String p0, Throwable p1);
void removeAttribute(String p0);
void setAttribute(String p0, Object p1);
void setRequestCharacterEncoding(String p0);
void setResponseCharacterEncoding(String p0);
void setSessionTimeout(int p0);
void setSessionTrackingModes(Set<SessionTrackingMode> p0);
}

View File

@@ -0,0 +1,15 @@
// Generated automatically from javax.servlet.ServletInputStream for testing purposes
package javax.servlet;
import java.io.InputStream;
import javax.servlet.ReadListener;
abstract public class ServletInputStream extends InputStream
{
protected ServletInputStream(){}
public abstract boolean isFinished();
public abstract boolean isReady();
public abstract void setReadListener(ReadListener p0);
public int readLine(byte[] p0, int p1, int p2){ return 0; }
}

View File

@@ -0,0 +1,28 @@
// Generated automatically from javax.servlet.ServletOutputStream for testing purposes
package javax.servlet;
import java.io.OutputStream;
import javax.servlet.WriteListener;
abstract public class ServletOutputStream extends OutputStream
{
protected ServletOutputStream(){}
public abstract boolean isReady();
public abstract void setWriteListener(WriteListener p0);
public void print(String p0){}
public void print(boolean p0){}
public void print(char p0){}
public void print(double p0){}
public void print(float p0){}
public void print(int p0){}
public void print(long p0){}
public void println(){}
public void println(String p0){}
public void println(boolean p0){}
public void println(char p0){}
public void println(double p0){}
public void println(float p0){}
public void println(int p0){}
public void println(long p0){}
}

View File

@@ -0,0 +1,23 @@
// Generated automatically from javax.servlet.ServletRegistration for testing purposes
package javax.servlet;
import java.util.Collection;
import java.util.Set;
import javax.servlet.MultipartConfigElement;
import javax.servlet.Registration;
import javax.servlet.ServletSecurityElement;
public interface ServletRegistration extends Registration
{
Collection<String> getMappings();
Set<String> addMapping(String... p0);
String getRunAsRole();
static public interface Dynamic extends Registration.Dynamic, ServletRegistration
{
Set<String> setServletSecurity(ServletSecurityElement p0);
void setLoadOnStartup(int p0);
void setMultipartConfig(MultipartConfigElement p0);
void setRunAsRole(String p0);
}
}

View File

@@ -0,0 +1,55 @@
// Generated automatically from javax.servlet.ServletRequest for testing purposes
package javax.servlet;
import java.io.BufferedReader;
import java.util.Enumeration;
import java.util.Locale;
import java.util.Map;
import javax.servlet.AsyncContext;
import javax.servlet.DispatcherType;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.ServletInputStream;
import javax.servlet.ServletResponse;
public interface ServletRequest
{
AsyncContext getAsyncContext();
AsyncContext startAsync();
AsyncContext startAsync(ServletRequest p0, ServletResponse p1);
BufferedReader getReader();
DispatcherType getDispatcherType();
Enumeration<Locale> getLocales();
Enumeration<String> getAttributeNames();
Enumeration<String> getParameterNames();
Locale getLocale();
Map<String, String[]> getParameterMap();
Object getAttribute(String p0);
RequestDispatcher getRequestDispatcher(String p0);
ServletContext getServletContext();
ServletInputStream getInputStream();
String getCharacterEncoding();
String getContentType();
String getLocalAddr();
String getLocalName();
String getParameter(String p0);
String getProtocol();
String getRealPath(String p0);
String getRemoteAddr();
String getRemoteHost();
String getScheme();
String getServerName();
String[] getParameterValues(String p0);
boolean isAsyncStarted();
boolean isAsyncSupported();
boolean isSecure();
int getContentLength();
int getLocalPort();
int getRemotePort();
int getServerPort();
long getContentLengthLong();
void removeAttribute(String p0);
void setAttribute(String p0, Object p1);
void setCharacterEncoding(String p0);
}

View File

@@ -0,0 +1,27 @@
// Generated automatically from javax.servlet.ServletResponse for testing purposes
package javax.servlet;
import java.io.PrintWriter;
import java.util.Locale;
import javax.servlet.ServletOutputStream;
public interface ServletResponse
{
Locale getLocale();
PrintWriter getWriter();
ServletOutputStream getOutputStream();
String getCharacterEncoding();
String getContentType();
boolean isCommitted();
int getBufferSize();
void flushBuffer();
void reset();
void resetBuffer();
void setBufferSize(int p0);
void setCharacterEncoding(String p0);
void setContentLength(int p0);
void setContentLengthLong(long p0);
void setContentType(String p0);
void setLocale(Locale p0);
}

View File

@@ -0,0 +1,19 @@
// Generated automatically from javax.servlet.ServletSecurityElement for testing purposes
package javax.servlet;
import java.util.Collection;
import javax.servlet.HttpConstraintElement;
import javax.servlet.HttpMethodConstraintElement;
import javax.servlet.annotation.ServletSecurity;
public class ServletSecurityElement extends HttpConstraintElement
{
public Collection<HttpMethodConstraintElement> getHttpMethodConstraints(){ return null; }
public Collection<String> getMethodNames(){ return null; }
public ServletSecurityElement(){}
public ServletSecurityElement(Collection<HttpMethodConstraintElement> p0){}
public ServletSecurityElement(HttpConstraintElement p0){}
public ServletSecurityElement(HttpConstraintElement p0, Collection<HttpMethodConstraintElement> p1){}
public ServletSecurityElement(ServletSecurity p0){}
}

View File

@@ -0,0 +1,22 @@
// Generated automatically from javax.servlet.SessionCookieConfig for testing purposes
package javax.servlet;
public interface SessionCookieConfig
{
String getComment();
String getDomain();
String getName();
String getPath();
boolean isHttpOnly();
boolean isSecure();
int getMaxAge();
void setComment(String p0);
void setDomain(String p0);
void setHttpOnly(boolean p0);
void setMaxAge(int p0);
void setName(String p0);
void setPath(String p0);
void setSecure(boolean p0);
}

View File

@@ -0,0 +1,10 @@
// Generated automatically from javax.servlet.SessionTrackingMode for testing purposes
package javax.servlet;
public enum SessionTrackingMode
{
COOKIE, SSL, URL;
private SessionTrackingMode() {}
}

View File

@@ -0,0 +1,11 @@
// Generated automatically from javax.servlet.WriteListener for testing purposes
package javax.servlet;
import java.util.EventListener;
public interface WriteListener extends EventListener
{
void onError(Throwable p0);
void onWritePossible();
}

View File

@@ -0,0 +1,18 @@
// Generated automatically from javax.servlet.annotation.HttpConstraint for testing purposes
package javax.servlet.annotation;
import java.lang.annotation.Annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import javax.servlet.annotation.ServletSecurity;
@Documented
@Retention(value=java.lang.annotation.RetentionPolicy.RUNTIME)
public @interface HttpConstraint
{
ServletSecurity.EmptyRoleSemantic value();
ServletSecurity.TransportGuarantee transportGuarantee();
String[] rolesAllowed();
}

View File

@@ -0,0 +1,19 @@
// Generated automatically from javax.servlet.annotation.HttpMethodConstraint for testing purposes
package javax.servlet.annotation;
import java.lang.annotation.Annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import javax.servlet.annotation.ServletSecurity;
@Documented
@Retention(value=java.lang.annotation.RetentionPolicy.RUNTIME)
public @interface HttpMethodConstraint
{
ServletSecurity.EmptyRoleSemantic emptyRoleSemantic();
ServletSecurity.TransportGuarantee transportGuarantee();
String value();
String[] rolesAllowed();
}

View File

@@ -0,0 +1,19 @@
// Generated automatically from javax.servlet.annotation.MultipartConfig for testing purposes
package javax.servlet.annotation;
import java.lang.annotation.Annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(value=java.lang.annotation.RetentionPolicy.RUNTIME)
@Target(value={java.lang.annotation.ElementType.TYPE})
public @interface MultipartConfig
{
String location();
int fileSizeThreshold();
long maxFileSize();
long maxRequestSize();
}

View File

@@ -0,0 +1,33 @@
// Generated automatically from javax.servlet.annotation.ServletSecurity for testing purposes
package javax.servlet.annotation;
import java.lang.annotation.Annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.servlet.annotation.HttpConstraint;
import javax.servlet.annotation.HttpMethodConstraint;
@Documented
@Inherited
@Retention(value=java.lang.annotation.RetentionPolicy.RUNTIME)
@Target(value={java.lang.annotation.ElementType.TYPE})
public @interface ServletSecurity
{
HttpConstraint value();
HttpMethodConstraint[] httpMethodConstraints();
static public enum EmptyRoleSemantic
{
DENY, PERMIT;
private EmptyRoleSemantic() {}
}
static public enum TransportGuarantee
{
CONFIDENTIAL, NONE;
private TransportGuarantee() {}
}
}

View File

@@ -0,0 +1,20 @@
// Generated automatically from javax.servlet.annotation.WebInitParam for testing purposes
package javax.servlet.annotation;
import java.lang.annotation.Annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Documented
@Retention(value=java.lang.annotation.RetentionPolicy.RUNTIME)
@Target(value={java.lang.annotation.ElementType.TYPE})
public @interface WebInitParam
{
String description();
String name();
String value();
}

View File

@@ -0,0 +1,28 @@
// Generated automatically from javax.servlet.annotation.WebServlet for testing purposes
package javax.servlet.annotation;
import java.lang.annotation.Annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.servlet.annotation.WebInitParam;
@Documented
@Retention(value=java.lang.annotation.RetentionPolicy.RUNTIME)
@Target(value={java.lang.annotation.ElementType.TYPE})
public @interface WebServlet
{
String description();
String displayName();
String largeIcon();
String name();
String smallIcon();
String[] urlPatterns();
String[] value();
WebInitParam[] initParams();
boolean asyncSupported();
int loadOnStartup();
}

View File

@@ -0,0 +1,13 @@
// Generated automatically from javax.servlet.descriptor.JspConfigDescriptor for testing purposes
package javax.servlet.descriptor;
import java.util.Collection;
import javax.servlet.descriptor.JspPropertyGroupDescriptor;
import javax.servlet.descriptor.TaglibDescriptor;
public interface JspConfigDescriptor
{
Collection<JspPropertyGroupDescriptor> getJspPropertyGroups();
Collection<TaglibDescriptor> getTaglibs();
}

View File

@@ -0,0 +1,21 @@
// Generated automatically from javax.servlet.descriptor.JspPropertyGroupDescriptor for testing purposes
package javax.servlet.descriptor;
import java.util.Collection;
public interface JspPropertyGroupDescriptor
{
Collection<String> getIncludeCodas();
Collection<String> getIncludePreludes();
Collection<String> getUrlPatterns();
String getBuffer();
String getDefaultContentType();
String getDeferredSyntaxAllowedAsLiteral();
String getElIgnored();
String getErrorOnUndeclaredNamespace();
String getIsXml();
String getPageEncoding();
String getScriptingInvalid();
String getTrimDirectiveWhitespaces();
}

View File

@@ -0,0 +1,10 @@
// Generated automatically from javax.servlet.descriptor.TaglibDescriptor for testing purposes
package javax.servlet.descriptor;
public interface TaglibDescriptor
{
String getTaglibLocation();
String getTaglibURI();
}

View File

@@ -0,0 +1,29 @@
// Generated automatically from javax.servlet.http.Cookie for testing purposes
package javax.servlet.http;
import java.io.Serializable;
public class Cookie implements Cloneable, Serializable
{
protected Cookie() {}
public Cookie(String p0, String p1){}
public Object clone(){ return null; }
public String getComment(){ return null; }
public String getDomain(){ return null; }
public String getName(){ return null; }
public String getPath(){ return null; }
public String getValue(){ return null; }
public boolean getSecure(){ return false; }
public boolean isHttpOnly(){ return false; }
public int getMaxAge(){ return 0; }
public int getVersion(){ return 0; }
public void setComment(String p0){}
public void setDomain(String p0){}
public void setHttpOnly(boolean p0){}
public void setMaxAge(int p0){}
public void setPath(String p0){}
public void setSecure(boolean p0){}
public void setValue(String p0){}
public void setVersion(int p0){}
}

View File

@@ -0,0 +1,46 @@
// Generated automatically from javax.servlet.http.HttpServlet for testing purposes
package javax.servlet.http;
import javax.servlet.GenericServlet;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
abstract public class HttpServlet extends GenericServlet {
protected long getLastModified(HttpServletRequest p0) {
return 0;
}
protected void doDelete(HttpServletRequest p0, HttpServletResponse p1) {
}
protected void doGet(HttpServletRequest p0, HttpServletResponse p1) throws IOException {
}
protected void doHead(HttpServletRequest p0, HttpServletResponse p1) {
}
protected void doOptions(HttpServletRequest p0, HttpServletResponse p1) {
}
protected void doPost(HttpServletRequest p0, HttpServletResponse p1) throws IOException {
}
protected void doPut(HttpServletRequest p0, HttpServletResponse p1) {
}
protected void doTrace(HttpServletRequest p0, HttpServletResponse p1) {
}
protected void service(HttpServletRequest p0, HttpServletResponse p1) {
}
public HttpServlet() {
}
public void service(ServletRequest p0, ServletResponse p1) {
}
}

View File

@@ -0,0 +1,13 @@
// Generated automatically from javax.servlet.http.HttpServletMapping for testing purposes
package javax.servlet.http;
import javax.servlet.http.MappingMatch;
public interface HttpServletMapping
{
MappingMatch getMappingMatch();
String getMatchValue();
String getPattern();
String getServletName();
}

View File

@@ -0,0 +1,60 @@
// Generated automatically from javax.servlet.http.HttpServletRequest for testing purposes
package javax.servlet.http;
import java.security.Principal;
import java.util.Collection;
import java.util.Enumeration;
import java.util.Map;
import javax.servlet.ServletRequest;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletMapping;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpUpgradeHandler;
import javax.servlet.http.Part;
import javax.servlet.http.PushBuilder;
public interface HttpServletRequest extends ServletRequest
{
<T extends HttpUpgradeHandler> T upgrade(java.lang.Class<T> p0);
Collection<Part> getParts();
Cookie[] getCookies();
Enumeration<String> getHeaderNames();
Enumeration<String> getHeaders(String p0);
HttpSession getSession();
HttpSession getSession(boolean p0);
Part getPart(String p0);
Principal getUserPrincipal();
String changeSessionId();
String getAuthType();
String getContextPath();
String getHeader(String p0);
String getMethod();
String getPathInfo();
String getPathTranslated();
String getQueryString();
String getRemoteUser();
String getRequestURI();
String getRequestedSessionId();
String getServletPath();
StringBuffer getRequestURL();
boolean authenticate(HttpServletResponse p0);
boolean isRequestedSessionIdFromCookie();
boolean isRequestedSessionIdFromURL();
boolean isRequestedSessionIdFromUrl();
boolean isRequestedSessionIdValid();
boolean isUserInRole(String p0);
default HttpServletMapping getHttpServletMapping(){ return null; }
default Map<String, String> getTrailerFields(){ return null; }
default PushBuilder newPushBuilder(){ return null; }
default boolean isTrailerFieldsReady(){ return false; }
int getIntHeader(String p0);
long getDateHeader(String p0);
static String BASIC_AUTH = null;
static String CLIENT_CERT_AUTH = null;
static String DIGEST_AUTH = null;
static String FORM_AUTH = null;
void login(String p0, String p1);
void logout();
}

View File

@@ -0,0 +1,77 @@
// Generated automatically from javax.servlet.http.HttpServletResponse for testing purposes
package javax.servlet.http;
import java.util.Collection;
import java.util.Map;
import java.util.function.Supplier;
import javax.servlet.ServletResponse;
import javax.servlet.http.Cookie;
public interface HttpServletResponse extends ServletResponse
{
Collection<String> getHeaderNames();
Collection<String> getHeaders(String p0);
String encodeRedirectURL(String p0);
String encodeRedirectUrl(String p0);
String encodeURL(String p0);
String encodeUrl(String p0);
String getHeader(String p0);
boolean containsHeader(String p0);
default Supplier<Map<String, String>> getTrailerFields(){ return null; }
default void setTrailerFields(Supplier<Map<String, String>> p0){}
int getStatus();
static int SC_ACCEPTED = 0;
static int SC_BAD_GATEWAY = 0;
static int SC_BAD_REQUEST = 0;
static int SC_CONFLICT = 0;
static int SC_CONTINUE = 0;
static int SC_CREATED = 0;
static int SC_EXPECTATION_FAILED = 0;
static int SC_FORBIDDEN = 0;
static int SC_FOUND = 0;
static int SC_GATEWAY_TIMEOUT = 0;
static int SC_GONE = 0;
static int SC_HTTP_VERSION_NOT_SUPPORTED = 0;
static int SC_INTERNAL_SERVER_ERROR = 0;
static int SC_LENGTH_REQUIRED = 0;
static int SC_METHOD_NOT_ALLOWED = 0;
static int SC_MOVED_PERMANENTLY = 0;
static int SC_MOVED_TEMPORARILY = 0;
static int SC_MULTIPLE_CHOICES = 0;
static int SC_NON_AUTHORITATIVE_INFORMATION = 0;
static int SC_NOT_ACCEPTABLE = 0;
static int SC_NOT_FOUND = 0;
static int SC_NOT_IMPLEMENTED = 0;
static int SC_NOT_MODIFIED = 0;
static int SC_NO_CONTENT = 0;
static int SC_OK = 0;
static int SC_PARTIAL_CONTENT = 0;
static int SC_PAYMENT_REQUIRED = 0;
static int SC_PRECONDITION_FAILED = 0;
static int SC_PROXY_AUTHENTICATION_REQUIRED = 0;
static int SC_REQUESTED_RANGE_NOT_SATISFIABLE = 0;
static int SC_REQUEST_ENTITY_TOO_LARGE = 0;
static int SC_REQUEST_TIMEOUT = 0;
static int SC_REQUEST_URI_TOO_LONG = 0;
static int SC_RESET_CONTENT = 0;
static int SC_SEE_OTHER = 0;
static int SC_SERVICE_UNAVAILABLE = 0;
static int SC_SWITCHING_PROTOCOLS = 0;
static int SC_TEMPORARY_REDIRECT = 0;
static int SC_UNAUTHORIZED = 0;
static int SC_UNSUPPORTED_MEDIA_TYPE = 0;
static int SC_USE_PROXY = 0;
void addCookie(Cookie p0);
void addDateHeader(String p0, long p1);
void addHeader(String p0, String p1);
void addIntHeader(String p0, int p1);
void sendError(int p0);
void sendError(int p0, String p1);
void sendRedirect(String p0);
void setDateHeader(String p0, long p1);
void setHeader(String p0, String p1);
void setIntHeader(String p0, int p1);
void setStatus(int p0);
void setStatus(int p0, String p1);
}

View File

@@ -0,0 +1,28 @@
// Generated automatically from javax.servlet.http.HttpSession for testing purposes
package javax.servlet.http;
import java.util.Enumeration;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpSessionContext;
public interface HttpSession
{
Enumeration<String> getAttributeNames();
HttpSessionContext getSessionContext();
Object getAttribute(String p0);
Object getValue(String p0);
ServletContext getServletContext();
String getId();
String[] getValueNames();
boolean isNew();
int getMaxInactiveInterval();
long getCreationTime();
long getLastAccessedTime();
void invalidate();
void putValue(String p0, Object p1);
void removeAttribute(String p0);
void removeValue(String p0);
void setAttribute(String p0, Object p1);
void setMaxInactiveInterval(int p0);
}

View File

@@ -0,0 +1,12 @@
// Generated automatically from javax.servlet.http.HttpSessionContext for testing purposes
package javax.servlet.http;
import java.util.Enumeration;
import javax.servlet.http.HttpSession;
public interface HttpSessionContext
{
Enumeration<String> getIds();
HttpSession getSession(String p0);
}

View File

@@ -0,0 +1,11 @@
// Generated automatically from javax.servlet.http.HttpUpgradeHandler for testing purposes
package javax.servlet.http;
import javax.servlet.http.WebConnection;
public interface HttpUpgradeHandler
{
void destroy();
void init(WebConnection p0);
}

View File

@@ -0,0 +1,10 @@
// Generated automatically from javax.servlet.http.MappingMatch for testing purposes
package javax.servlet.http;
public enum MappingMatch
{
CONTEXT_ROOT, DEFAULT, EXACT, EXTENSION, PATH;
private MappingMatch() {}
}

View File

@@ -0,0 +1,20 @@
// Generated automatically from javax.servlet.http.Part for testing purposes
package javax.servlet.http;
import java.io.InputStream;
import java.util.Collection;
public interface Part
{
Collection<String> getHeaderNames();
Collection<String> getHeaders(String p0);
InputStream getInputStream();
String getContentType();
String getHeader(String p0);
String getName();
String getSubmittedFileName();
long getSize();
void delete();
void write(String p0);
}

View File

@@ -0,0 +1,23 @@
// Generated automatically from javax.servlet.http.PushBuilder for testing purposes
package javax.servlet.http;
import java.util.Set;
public interface PushBuilder
{
PushBuilder addHeader(String p0, String p1);
PushBuilder method(String p0);
PushBuilder path(String p0);
PushBuilder queryString(String p0);
PushBuilder removeHeader(String p0);
PushBuilder sessionId(String p0);
PushBuilder setHeader(String p0, String p1);
Set<String> getHeaderNames();
String getHeader(String p0);
String getMethod();
String getPath();
String getQueryString();
String getSessionId();
void push();
}

View File

@@ -0,0 +1,12 @@
// Generated automatically from javax.servlet.http.WebConnection for testing purposes
package javax.servlet.http;
import javax.servlet.ServletInputStream;
import javax.servlet.ServletOutputStream;
public interface WebConnection extends AutoCloseable
{
ServletInputStream getInputStream();
ServletOutputStream getOutputStream();
}