Skip to content

Commit f56ddb0

Browse files
committed
code cleanup
1 parent 2b0a653 commit f56ddb0

File tree

5 files changed

+6
-17
lines changed

5 files changed

+6
-17
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
<groupId>org.apache.maven.plugins</groupId>
4444
<artifactId>maven-compiler-plugin</artifactId>
4545
<configuration>
46-
<source>17</source>
47-
<target>17</target>
46+
<source>21</source>
47+
<target>21</target>
4848
<parameters>true</parameters>
4949
</configuration>
5050
</plugin>

src/main/java/ch/ethz/seb/sps/server/weblayer/WebConfig.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ public class WebConfig implements WebMvcConfigurer {
4747
API.HEALTH_ENDPOINT + "/",
4848
API.GUI_REDIRECT_ENDPOINT,
4949
API.OAUTH_JWTTOKEN_ENDPOINT + "/**",
50-
"/swagger-ui/**",
51-
"/v3/api-docs/**",
52-
"/api-docs/**"
5350
};
5451

5552
/** Used to get real remote IP address by using "X-Forwarded-For" and "X-Forwarded-Proto" header.

src/main/java/ch/ethz/seb/sps/server/weblayer/oauth/authserver/OAuth2ClientCredentialsGrantProvider.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@
3636
public class OAuth2ClientCredentialsGrantProvider implements AuthenticationProvider {
3737

3838
private static final Logger logger = LoggerFactory.getLogger(OAuth2ClientCredentialsGrantProvider.class);
39-
private static final String ERROR_URI = "https://datatracker.ietf.org/doc/html/rfc6749#section-5.2";
40-
41-
39+
4240
private final OAuth2AuthorizationService authorizationService;
4341
private OAuth2TokenGenerator<? extends OAuth2Token> tokenGenerator;
4442
private Consumer<OAuth2ClientCredentialsAuthenticationContext> authenticationValidator = new OAuth2ClientCredentialsAuthenticationValidator();
@@ -68,7 +66,7 @@ public Authentication authenticate(Authentication authentication) throws Authent
6866
} else {
6967
OAuth2ClientCredentialsAuthenticationContext authenticationContext = OAuth2ClientCredentialsAuthenticationContext.with(clientCredentialsAuthentication).registeredClient(registeredClient).build();
7068
this.authenticationValidator.accept(authenticationContext);
71-
Set<String> authorizedScopes = new LinkedHashSet(clientCredentialsAuthentication.getScopes());
69+
Set<String> authorizedScopes = new LinkedHashSet<>(clientCredentialsAuthentication.getScopes());
7270
authorizedScopes.add(API.SEB_API_SCOPE_NAME);
7371
if (logger.isTraceEnabled()) {
7472
logger.trace("Validated token request parameters");

src/main/java/ch/ethz/seb/sps/server/weblayer/oauth/authserver/RegisteredGuiClient.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,9 @@ public RegisteredGuiClient(
3636
@Value("${sps.api.admin.gui.clientId}") final String clientId,
3737
@Value("${sps.api.admin.gui.clientSecret}") final String clientSecret,
3838
@Value("${sps.api.admin.accessTokenValiditySeconds:3600}") final Integer accessTokenValiditySeconds,
39-
@Value("${sps.api.admin.refreshTokenValiditySeconds:-1}") final Integer refreshTokenValiditySeconds) {
39+
@Value("${sps.api.admin.refreshTokenValiditySeconds:86400}") final Integer refreshTokenValiditySeconds) {
4040

41-
Duration refreshTokenValDuration = (refreshTokenValiditySeconds == null || refreshTokenValiditySeconds.longValue() < 0)
42-
? Duration.of(1, YEARS)
43-
: Duration.of(refreshTokenValiditySeconds, SECONDS);
41+
final Duration refreshTokenValDuration = Duration.of(refreshTokenValiditySeconds, SECONDS);
4442

4543
client = RegisteredClient
4644
.withId(clientId)

src/main/java/ch/ethz/seb/sps/server/weblayer/oauth/resserver/SEBClientResourceServerConfig.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,8 @@ public class SEBClientResourceServerConfig {
4242

4343
@Autowired
4444
private JwtDecoder jwtDecoder;
45-
@Value("${server.error.path}")
46-
private String errorPath;
4745
@Value("${sps.api.session.endpoint}")
4846
private String sessionAPIEndpoint;
49-
@Value("${sps.http.redirect}")
50-
private String unauthorizedRedirect;
5147

5248
@Bean
5349
@Order(2)

0 commit comments

Comments
 (0)