Skip to content

Commit

Permalink
Consider devops request as authorized if no subjects are expected
Browse files Browse the repository at this point in the history
Signed-off-by: Yannic Klem <Yannic.Klem@bosch.io>
  • Loading branch information
Yannic92 committed Feb 15, 2022
1 parent bdf7fb6 commit e0c5589
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ private Route handleAuthenticationTry(final Try<AuthenticationResult> authentica
} else {
final List<String> authorizationSubjectIds =
authenticationResult.getAuthorizationContext().getAuthorizationSubjectIds();
final boolean isAuthorized = authorizationSubjectIds.stream().anyMatch(expectedSubjects::contains);
final boolean isAuthorized = expectedSubjects.isEmpty() || authorizationSubjectIds.stream().anyMatch(expectedSubjects::contains);
if (isAuthorized) {
LOGGER.info("DevOps Oauth authentication was successful.");
return inner;
Expand Down

0 comments on commit e0c5589

Please sign in to comment.