1 package com.atlassian.asap.core.server.jersey;
2
3 import com.google.common.collect.ImmutableSet;
4
5 import java.util.Set;
6
7
8
9
10
11 public class JerseyRequestAuthorizerFactory {
12
13
14
15
16
17
18
19 public JerseyRequestAuthorizer create(JwtAuth jwtAuth) {
20 Set<String> authorizedIssuers = ImmutableSet.copyOf(jwtAuth.authorizedIssuers());
21 Set<String> authorizedSubjects = ImmutableSet.copyOf(jwtAuth.authorizedSubjects());
22 return new WhitelistJerseyRequestAuthorizer(
23 authorizedSubjects,
24 authorizedIssuers.isEmpty() ? authorizedSubjects : authorizedIssuers);
25 }
26 }