Skip to content

Commit

Permalink
Merge pull request #22397 from danielmast/jwt-test-security-get-claim…
Browse files Browse the repository at this point in the history
…-names

Return claim names for JWT test security
  • Loading branch information
sberyozkin authored Dec 20, 2021
2 parents 6f2a8f0 + d98d0e7 commit 60373a0
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package io.quarkus.test.security.jwt;

import java.lang.annotation.Annotation;
import java.util.Arrays;
import java.util.Collections;
import java.util.Set;
import java.util.stream.Collectors;

import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Produces;
Expand Down Expand Up @@ -55,7 +58,10 @@ public <T> T getClaim(String claimName) {

@Override
public Set<String> getClaimNames() {
return null;
if (jwtSecurity != null && jwtSecurity.claims() != null) {
return Arrays.stream(jwtSecurity.claims()).map(Claim::key).collect(Collectors.toSet());
}
return Collections.emptySet();
}

});
Expand Down

0 comments on commit 60373a0

Please sign in to comment.