mitreid-connect
公開メンバ関数 | 非公開メンバ関数 | 全メンバ一覧
org.mitre.uma.service.impl.MatchAllClaimsOnAnyPolicy クラス
org.mitre.uma.service.impl.MatchAllClaimsOnAnyPolicy の継承関係図
Inheritance graph
org.mitre.uma.service.impl.MatchAllClaimsOnAnyPolicy 連携図
Collaboration graph

公開メンバ関数

ClaimProcessingResult claimsAreSatisfied (ResourceSet rs, PermissionTicket ticket)
 

非公開メンバ関数

Collection< ClaimcheckIndividualClaims (Collection< Claim > claimsRequired, Collection< Claim > claimsSupplied)
 

詳解

Tests if all the claims in the required set have a matching value in the supplied set.

著者
jricher

関数詳解

◆ checkIndividualClaims()

Collection<Claim> org.mitre.uma.service.impl.MatchAllClaimsOnAnyPolicy.checkIndividualClaims ( Collection< Claim claimsRequired,
Collection< Claim claimsSupplied 
)
inlineprivate
61  {
62 
63  Collection<Claim> claimsUnmatched = new HashSet<>(claimsRequired);
64 
65  // see if each of the required claims has a counterpart in the supplied claims set
66  for (Claim required : claimsRequired) {
67  for (Claim supplied : claimsSupplied) {
68 
69  if (required.getIssuer().containsAll(supplied.getIssuer())) {
70  // it's from the right issuer
71 
72  if (required.getName().equals(supplied.getName()) &&
73  required.getValue().equals(supplied.getValue())) {
74 
75  // the claim matched, pull it from the set
76  claimsUnmatched.remove(required);
77 
78  }
79 
80  }
81  }
82  }
83 
84  // if there's anything left then the claims aren't satisfied, return the leftovers
85  return claimsUnmatched;
86 
87  }

◆ claimsAreSatisfied()

ClaimProcessingResult org.mitre.uma.service.impl.MatchAllClaimsOnAnyPolicy.claimsAreSatisfied ( ResourceSet  rs,
PermissionTicket  ticket 
)
inline

org.mitre.uma.service.ClaimsProcessingServiceを実装しています。

44  {
45  Collection<Claim> allUnmatched = new HashSet<>();
46  for (Policy policy : rs.getPolicies()) {
47  Collection<Claim> unmatched = checkIndividualClaims(policy.getClaimsRequired(), ticket.getClaimsSupplied());
48  if (unmatched.isEmpty()) {
49  // we found something that's satisfied the claims, let's go with it!
50  return new ClaimProcessingResult(policy);
51  } else {
52  // otherwise add it to the stack to send back
53  allUnmatched.addAll(unmatched);
54  }
55  }
56 
57  // otherwise, tell the caller that we'll need some set of these fulfilled somehow
58  return new ClaimProcessingResult(allUnmatched);
59  }
Collection< Claim > checkIndividualClaims(Collection< Claim > claimsRequired, Collection< Claim > claimsSupplied)
Definition: MatchAllClaimsOnAnyPolicy.java:61

このクラス詳解は次のファイルから抽出されました: