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: add gccl-invocation-id interceptor #1309

Merged
merged 26 commits into from Apr 1, 2022
Merged

Conversation

frankyn
Copy link
Member

@frankyn frankyn commented Mar 25, 2022

Joint effort with @BenWhitehead who is the author of the original design, thank you Ben!

  • Ensure the tests and linter pass
  • Add option to disable the invocation id
  • Make sure this header isn't passed in for signed URLs
  • Appropriate docs were updated (if necessary)

@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/java-storage API. label Mar 26, 2022
@BenWhitehead BenWhitehead changed the title feat: Invocation id interceptor fix: add gccl-invocation-id interceptor Mar 28, 2022
BenWhitehead and others added 4 commits March 28, 2022 16:08
…e clear themselves

Also fixed a typo which meant that the v4 url wasn't being tested, however now the v4 url is failing to validate and I'm not sure how to fix the url.
HttpRpcContext testContext = new HttpRpcContext(testUUIDSupplier);
testContext.newInvocationId();
assertEquals(testUUIDSupplier.get(), testContext.getInvocationId());
UUID uuid = UUID.fromString("28220dff-1e8b-4770-9e10-022c2a99d8f3");
Copy link
Member Author

Choose a reason for hiding this comment

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

per-discussion with @BenWhitehead: the test prior was using the supplier instance "testUUIDSupplier.get()" caused a mutation to the state of the Supplier but passes because there is only one UUID. Instead we should not test the Supplier<> and only test HttpRpcContext(), hence the update relies on testContext rather than accessing Supplier<> directly.

@frankyn frankyn marked this pull request as ready for review March 28, 2022 21:22
@frankyn frankyn requested review from a team as code owners March 28, 2022 21:22
Copy link
Collaborator

@BenWhitehead BenWhitehead left a comment

Choose a reason for hiding this comment

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

We also need to add the following to private Builder(StorageOptions options) so we ensure we carry through any value set previously.

      this.storageIncludeInvocationId = options.includeInvocationId;

@BenWhitehead BenWhitehead added the owlbot:run Add this label to trigger the Owlbot post processor. label Apr 1, 2022
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Apr 1, 2022
@BenWhitehead BenWhitehead merged commit 335c267 into main Apr 1, 2022
@BenWhitehead BenWhitehead deleted the invocation-id-interceptor branch April 1, 2022 21:32
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants