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
diff --git a/alts/src/main/java/io/grpc/alts/internal/AltsAuthContext.java b/alts/src/main/java/io/grpc/alts/internal/AltsAuthContext.java
index b35d4fa..6ec7410 100644
--- a/alts/src/main/java/io/grpc/alts/internal/AltsAuthContext.java
+++ b/alts/src/main/java/io/grpc/alts/internal/AltsAuthContext.java
@@ -34,7 +34,7 @@
.setPeerServiceAccount(result.getPeerIdentity().getServiceAccount())
.setLocalServiceAccount(result.getLocalIdentity().getServiceAccount())
.setPeerRpcVersions(result.getPeerRpcVersions())
- .putAllPeerAttributes(result.getPeerIdentity().getAttributes())
+ .putAllPeerAttributes(result.getPeerIdentity().getAttributesMap())
.build();
}
diff --git a/xds/src/main/java/io/grpc/xds/internal/rbac/engine/AuthorizationEngine.java b/xds/src/main/java/io/grpc/xds/internal/rbac/engine/AuthorizationEngine.java
index a7e09b0..9ed4399 100644
--- a/xds/src/main/java/io/grpc/xds/internal/rbac/engine/AuthorizationEngine.java
+++ b/xds/src/main/java/io/grpc/xds/internal/rbac/engine/AuthorizationEngine.java
@@ -85,7 +85,7 @@
*/
public AuthorizationEngine(RBAC rbacPolicy) {
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());
}
allowEngine = (rbacPolicy.getAction() == Action.ALLOW)
@@ -108,12 +108,12 @@
"Invalid RBAC list, "
+ "must provide a RBAC with DENY action followed by a RBAC with ALLOW action. ");
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());
}
denyEngine = new RbacEngine(Action.DENY, ImmutableMap.copyOf(denyConditions));
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());
}
allowEngine = new RbacEngine(Action.ALLOW, ImmutableMap.copyOf(allowConditions));