Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update grpc handling of IAM Policy etag to account for base64 encoding #2499

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

BenWhitehead
Copy link
Collaborator

Etags returned by the JSON api are base64 encoded, and IAM Policy is currently modeled around this for its public api. Update GrpcConversions to base64 decode/encode appropriately.

@BenWhitehead BenWhitehead added the owlbot:ignore instruct owl-bot to ignore a PR label Apr 17, 2024
@BenWhitehead BenWhitehead requested a review from a team as a code owner April 17, 2024 21:40
@product-auto-label product-auto-label bot added size: s Pull request size is small. api: storage Issues related to the googleapis/java-storage API. labels Apr 17, 2024
@BenWhitehead BenWhitehead force-pushed the enable-grpc-retry-conformance-tests branch from 03e6c1a to 0612172 Compare April 17, 2024 22:14
@@ -1058,7 +1065,7 @@ private Policy policyDecode(com.google.iam.v1.Policy from) {
Policy.Builder to = Policy.newBuilder();
ByteString etag = from.getEtag();
if (!etag.isEmpty()) {
to.setEtag(etag.toStringUtf8());
to.setEtag(byteStringB64StringCodec.encode(etag));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is very subtle how hasn't this come up before?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think setIamPolicy so far has been exclusively used in json or grpc, and not yet mixed. With the conformance tests we did get mixing, because the policy is resolved in setup via json the modified via grpc.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

subtle; thanks!

Base automatically changed from enable-grpc-retry-conformance-tests to main April 17, 2024 22:48
…coding

Etags returned by the JSON api are base64 encoded, and IAM Policy is currently modeled around this for its public api. Update GrpcConversions to base64 decode/encode appropriately.
@BenWhitehead BenWhitehead merged commit 032f2f2 into main Apr 17, 2024
22 checks passed
@BenWhitehead BenWhitehead deleted the fix-iampolicy-b64 branch April 17, 2024 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/java-storage API. owlbot:ignore instruct owl-bot to ignore a PR size: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants