Skip to content

Commit

Permalink
Return claim names for JWT test security
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmast committed Dec 20, 2021
1 parent 26f0b9b commit d98d0e7
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 d98d0e7

Please sign in to comment.