|
| 1 | +package org.springframework.security.config.annotation.web.configurers.oauth2.resourceserver; |
| 2 | + |
| 3 | +import org.springframework.security.config.annotation.web.HttpSecurityBuilder; |
| 4 | +import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer; |
| 5 | +import org.springframework.security.oauth2.jose.jws.JwsAlgorithms; |
| 6 | +import org.springframework.security.oauth2.jwt.JwtDecoder; |
| 7 | +import org.springframework.security.oauth2.jwt.JwtVerifier; |
| 8 | + |
| 9 | +import javax.crypto.SecretKey; |
| 10 | +import java.security.PublicKey; |
| 11 | +import java.time.Duration; |
| 12 | +import java.time.temporal.ChronoUnit; |
| 13 | + |
| 14 | +public class OAuth2ResourceServerConfigurer<B extends HttpSecurityBuilder<B>> extends |
| 15 | + AbstractHttpConfigurer<JwtVerifierConfigurer<B>, B> { |
| 16 | + |
| 17 | + public BearerConfigurer bearer() {} |
| 18 | + |
| 19 | + public class BearerConfigurer { |
| 20 | + public BearerConfigurer inBody() {} |
| 21 | + |
| 22 | + public BearerConfigurer inHeader() {} |
| 23 | + |
| 24 | + public BearerConfigurer inQuery() {} |
| 25 | + |
| 26 | + public OAuth2ResourceServerConfigurer<B> and() {} |
| 27 | + } |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + public JwtConfigurer jwt() {} |
| 32 | + |
| 33 | + public class JwtConfigurer { |
| 34 | + public JwtDecoderConfigurer decoder() {} |
| 35 | + |
| 36 | + public JwtConfigurer decoder(JwtDecoder jwtDecoder) {} |
| 37 | + |
| 38 | + public JwtVerifierConfigurer verifier() {} |
| 39 | + |
| 40 | + public JwtVerifier verifier(JwtVerifier jwtVerifier) {} |
| 41 | + |
| 42 | + public OAuth2ResourceServerConfigurer<B> and() {} |
| 43 | + } |
| 44 | + |
| 45 | + public class JwtDecoderConfigurer { |
| 46 | + public JwtDecoderConfigurer rs256() {} |
| 47 | + |
| 48 | + public JwtDecoderConfigurer algorithm(JwsAlgorithms algorithm) {} |
| 49 | + |
| 50 | + public JwkSetConfigurer jwkSet() {} |
| 51 | + |
| 52 | + public JwtConfigurer and() {} |
| 53 | + } |
| 54 | + |
| 55 | + public class JwtVerifierConfigurer { |
| 56 | + public AudiencesConfigurer audiences() {} |
| 57 | + |
| 58 | + public IssuersConfigurer issuers() {} |
| 59 | + |
| 60 | + public JwtVerifierConfigurer clockSkew(Integer skew, ChronoUnit unit) {} |
| 61 | + |
| 62 | + public JwtVerifierConfigurer clockSkew(Duration skew) {} |
| 63 | + |
| 64 | + public JwtVerifierConfigurer additional(JwtVerifier verifier) {} |
| 65 | + |
| 66 | + public JwtConfigurer and() {} |
| 67 | + } |
| 68 | + |
| 69 | + public class AudiencesConfigurer { |
| 70 | + public AudiencesConfigurer audience() {} |
| 71 | + |
| 72 | + public JwtVerifierConfigurer and() {} |
| 73 | + } |
| 74 | + |
| 75 | + public class IssuersConfigurer { |
| 76 | + public IssuersConfigurer issuer() {} |
| 77 | + |
| 78 | + public JwtVerifierConfigurer and() {} |
| 79 | + } |
| 80 | + |
| 81 | + public class JwkSetConfigurer { |
| 82 | + public RemoteJwkSetConfigurer remote(String location) {} |
| 83 | + |
| 84 | + public LocalKeystoreJwkSetConfigurer keystore(String location) {} |
| 85 | + |
| 86 | + public JwkSetConfigurer key(String location) {} |
| 87 | + |
| 88 | + public JwkSetConfigurer key(PublicKey key) {} |
| 89 | + |
| 90 | + public JwkSetConfigurer key(SecretKey key) {} |
| 91 | + |
| 92 | + public JwtDecoderConfigurer and() {} |
| 93 | + } |
| 94 | + |
| 95 | + public class RemoteJwkSetConfigurer { |
| 96 | + public RemoteJwkSetConfigurer connectionTimeout(Integer timeout, ChronoUnit unit) {} |
| 97 | + |
| 98 | + public RemoteJwkSetConfigurer connectionTimeout(Duration timeout) {} |
| 99 | + |
| 100 | + public RemoteJwkSetConfigurer readTimeout(Integer timeout, ChronoUnit unit) {} |
| 101 | + |
| 102 | + public RemoteJwkSetConfigurer readTimeout(Duration timeout) {} |
| 103 | + |
| 104 | + public JwtDecoderConfigurer and() {} |
| 105 | + } |
| 106 | + |
| 107 | + public class LocalKeystoreJwkSetConfigurer { |
| 108 | + public LocalKeystoreJwkSetConfigurer password(String keystorePassword) {} |
| 109 | + |
| 110 | + public LocalKeyJwkSetConfigurer alias(String alias) {} |
| 111 | + } |
| 112 | + |
| 113 | + public class LocalKeyJwkSetConfigurer { |
| 114 | + public LocalKeyJwkSetConfigurer password(String password) {} |
| 115 | + |
| 116 | + public JwtDecoderConfigurer and() {} |
| 117 | + } |
| 118 | + |
| 119 | + |
| 120 | + |
| 121 | + public OpaqueConfigurer opaque() {} |
| 122 | + |
| 123 | + public class OpaqueConfigurer { |
| 124 | + public TokenEndpointConfigurer tokenEndpoint(String location) {} |
| 125 | + |
| 126 | + public OAuth2ResourceServerConfigurer<B> and() {} |
| 127 | + } |
| 128 | + |
| 129 | + public class TokenEndpointConfigurer { |
| 130 | + public TokenEndpointConfigurer connectionTimeout(Integer timeout, ChronoUnit unit) {} |
| 131 | + |
| 132 | + public TokenEndpointConfigurer connectionTimeout(Duration timeout) {} |
| 133 | + |
| 134 | + public TokenEndpointConfigurer readTimeout(Integer timeout, ChronoUnit unit) {} |
| 135 | + |
| 136 | + public TokenEndpointConfigurer readTimeout(Duration timeout) {} |
| 137 | + |
| 138 | + public OpaqueConfigurer and() {} |
| 139 | + } |
| 140 | +} |
0 commit comments