mirror of https://github.com/grpc/grpc-java.git
alts: migrate java proto map getter from get<field> to get<field>Map (#7522)
Migrate java proto map getter from get to getMap. This is part of a set of changes to java proto map API described here: go/java-proto-maplike More information: go/java-proto-maplike-getFooMap
This commit is contained in:
parent
42555a86cd
commit
67b54608da
|
|
@ -34,7 +34,7 @@ public final class AltsAuthContext {
|
||||||
.setPeerServiceAccount(result.getPeerIdentity().getServiceAccount())
|
.setPeerServiceAccount(result.getPeerIdentity().getServiceAccount())
|
||||||
.setLocalServiceAccount(result.getLocalIdentity().getServiceAccount())
|
.setLocalServiceAccount(result.getLocalIdentity().getServiceAccount())
|
||||||
.setPeerRpcVersions(result.getPeerRpcVersions())
|
.setPeerRpcVersions(result.getPeerRpcVersions())
|
||||||
.putAllPeerAttributes(result.getPeerIdentity().getAttributes())
|
.putAllPeerAttributes(result.getPeerIdentity().getAttributesMap())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ public class AuthorizationEngine {
|
||||||
*/
|
*/
|
||||||
public AuthorizationEngine(RBAC rbacPolicy) {
|
public AuthorizationEngine(RBAC rbacPolicy) {
|
||||||
Map<String, Expr> conditions = new LinkedHashMap<>();
|
Map<String, Expr> conditions = new LinkedHashMap<>();
|
||||||
for (Map.Entry<String, Policy> policy: rbacPolicy.getPolicies().entrySet()) {
|
for (Map.Entry<String, Policy> policy: rbacPolicy.getPoliciesMap().entrySet()) {
|
||||||
conditions.put(policy.getKey(), policy.getValue().getCondition());
|
conditions.put(policy.getKey(), policy.getValue().getCondition());
|
||||||
}
|
}
|
||||||
allowEngine = (rbacPolicy.getAction() == Action.ALLOW)
|
allowEngine = (rbacPolicy.getAction() == Action.ALLOW)
|
||||||
|
|
@ -108,12 +108,12 @@ public class AuthorizationEngine {
|
||||||
"Invalid RBAC list, "
|
"Invalid RBAC list, "
|
||||||
+ "must provide a RBAC with DENY action followed by a RBAC with ALLOW action. ");
|
+ "must provide a RBAC with DENY action followed by a RBAC with ALLOW action. ");
|
||||||
Map<String, Expr> denyConditions = new LinkedHashMap<>();
|
Map<String, Expr> denyConditions = new LinkedHashMap<>();
|
||||||
for (Map.Entry<String, Policy> policy: denyPolicy.getPolicies().entrySet()) {
|
for (Map.Entry<String, Policy> policy: denyPolicy.getPoliciesMap().entrySet()) {
|
||||||
denyConditions.put(policy.getKey(), policy.getValue().getCondition());
|
denyConditions.put(policy.getKey(), policy.getValue().getCondition());
|
||||||
}
|
}
|
||||||
denyEngine = new RbacEngine(Action.DENY, ImmutableMap.copyOf(denyConditions));
|
denyEngine = new RbacEngine(Action.DENY, ImmutableMap.copyOf(denyConditions));
|
||||||
Map<String, Expr> allowConditions = new LinkedHashMap<>();
|
Map<String, Expr> allowConditions = new LinkedHashMap<>();
|
||||||
for (Map.Entry<String, Policy> policy: allowPolicy.getPolicies().entrySet()) {
|
for (Map.Entry<String, Policy> policy: allowPolicy.getPoliciesMap().entrySet()) {
|
||||||
allowConditions.put(policy.getKey(), policy.getValue().getCondition());
|
allowConditions.put(policy.getKey(), policy.getValue().getCondition());
|
||||||
}
|
}
|
||||||
allowEngine = new RbacEngine(Action.ALLOW, ImmutableMap.copyOf(allowConditions));
|
allowEngine = new RbacEngine(Action.ALLOW, ImmutableMap.copyOf(allowConditions));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue