GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: add IAM Conditions support by frankyn · Pull Request #120 · googleapis/java-storage

This repository was archived by the owner on Sep 25, 2026. It is now read-only.

Conversation

@frankyn

@frankyn frankyn commented Feb 6, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Add IAM Conditions Support.

Depends on:
googleapis/java-core#110

Pending Review List:

  • @jkwlui (IAM Conditions Review)
  • @JesseLovelace (Java + Storage Review)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Frank Natividad
Add IAM Conditions support
187e98c
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Feb 6, 2020
@frankyn
frankyn requested review from JesseLovelace, chingor13 and jkwlui February 6, 2020 18:38
Frank Natividad added 3 commits February 6, 2020 10:41
Frank Natividad
format
ef9a53d
Frank Natividad
wip
f7e1609
Frank Natividad
set version in mock policies
1160ad5
This was referenced Feb 7, 2020
Iam condition samples googleapis/google-cloud-java#7127
Closed
Iam condition samples googleapis/google-cloud-java#7128
Closed
jkwlui
jkwlui approved these changes Feb 11, 2020
View reviewed changes

@jkwlui jkwlui left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Surface looks good. LGTM!
I'll let @chingor13 and others review Java aspects.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
elharo
elharo suggested changes Feb 11, 2020
View reviewed changes

@elharo elharo left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Mostly nits, but snapshot dependencies are a hard no.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread google-cloud-storage/src/main/java/com/google/cloud/storage/PolicyHelper.java Outdated
Bindings apiBinding = new Bindings();
apiBinding.setRole(binding.getRole());
apiBinding.setMembers(new ArrayList<>(binding.getMembers()));
if (null != binding.getCondition()) {

@elharo elharo Feb 11, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

no reason to put null first; it's a leftover convention from C that doesn't make sense in Java

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread google-cloud-storage/src/test/java/com/google/cloud/storage/PolicyHelperTest.java Outdated

assertEquals(libPolicy, actualLibPolicy);
assertTrue(new ApiPolicyMatcher(apiPolicy).matches(actualApiPolicy));
// Policy actualLibPolicy = PolicyHelper.convertFromApiPolicy(apiPolicy);

@elharo elharo Feb 11, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

delete it if it isn't relevant. or fix it if it is.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITStorageTest.java Outdated
public void testBucketPolicy() {
testBucketPolicyRequesterPays(true);
testBucketPolicyRequesterPays(false);
// testBucketPolicyV3RequesterPays(true);

@elharo elharo Feb 11, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

don't comment out code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITStorageTest.java Outdated
}

private void testBucketPolicyV3RequesterPays(boolean requesterPays) {
if (requesterPays) {

@elharo elharo Feb 11, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Conditionals around asserts are a code smell. This should be two tests, one with and one without requesterPays.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@elharo elharo Feb 27, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Or two helper methods

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITStorageTest.java Outdated

// Remove a member
List<com.google.cloud.Binding> updatedBindings = new ArrayList(updatedPolicy.getBindingsList());
for (int i = 0; i < updatedBindings.size(); ++i) {

@elharo elharo Feb 11, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

i++ is more common

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pom.xml Outdated
<github.global.server>github</github.global.server>
<site.installationModule>google-cloud-storage-parent</site.installationModule>
<google.core.version>1.91.3</google.core.version>
<google.core.version>1.92.3-SNAPSHOT</google.core.version>

@elharo elharo Feb 11, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

No snapshot dependencies.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@frankyn frankyn Feb 26, 2020

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Doing it temporary until dependency PR is merged/released.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Frank Natividad
wip
938c9fe
@frankyn
frankyn requested review from elharo and removed request for chingor13 February 26, 2020 23:13
Frank Natividad added 5 commits February 26, 2020 15:13
Frank Natividad
address comments
d7a4077
Frank Natividad
Merge branch 'master' into iam-conditions-support
f2013df
Frank Natividad
fix pom.
8ad5043
Frank Natividad
revert http-client-bom
6284c40
Frank Natividad
address feedback
7117481
elharo
elharo suggested changes Feb 27, 2020
View reviewed changes
Comment thread google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITStorageTest.java Outdated
}

private void testBucketPolicyV3RequesterPays(boolean requesterPays) {
if (requesterPays) {

@elharo elharo Feb 27, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Or two helper methods

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pom.xml Outdated
<github.global.server>github</github.global.server>
<site.installationModule>google-cloud-storage-parent</site.installationModule>
<google.core.version>1.92.5</google.core.version>
<google.core.version>1.92.6-SNAPSHOT</google.core.version>

@elharo elharo Feb 27, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

hard veto on this; we must not depend on snapshots. If this means we have to wait for a release of google core so be it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@frankyn frankyn Feb 27, 2020

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I'm doing this only for development*

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Frank Natividad
address integration tests feedback
8606ab7
@frankyn
frankyn requested a review from elharo February 27, 2020 19:40
JesseLovelace
JesseLovelace approved these changes Feb 27, 2020
View reviewed changes
Frank Natividad added 3 commits February 27, 2020 13:53
Frank Natividad
Merge branch 'master' into iam-conditions-support
cd2ead7
Frank Natividad
update core
3941f5c
Frank Natividad
lint
1dd8343
@codecov

codecov Bot commented Feb 27, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

Merging #120 into master will increase coverage by 0.06%.
The diff coverage is 44.73%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #120      +/-   ##
============================================
+ Coverage      63.4%   63.46%   +0.06%     
  Complexity      537      537              
============================================
  Files            30       30              
  Lines          4752     4752              
  Branches        427      427              
============================================
+ Hits           3013     3016       +3     
+ Misses         1579     1576       -3     
  Partials        160      160
Impacted Files Coverage Δ Complexity Δ
...rc/main/java/com/google/cloud/storage/Storage.java 80.57% <0%> (ø) 0 <0> (ø) ⬇️
...om/google/cloud/storage/spi/v1/HttpStorageRpc.java 1.63% <0%> (ø) 1 <0> (ø) ⬇️
...va/com/google/cloud/storage/spi/v1/StorageRpc.java 64.86% <100%> (ø) 0 <0> (ø) ⬇️
...in/java/com/google/cloud/storage/PolicyHelper.java 64.86% <55.55%> (ø) 5 <2> (ø) ⬇️
...gle/cloud/storage/testing/RemoteStorageHelper.java 64.46% <0%> (+2.47%) 9% <0%> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2627a93...900a991. Read the comment docs.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Frank Natividad added 2 commits February 27, 2020 14:36
Frank Natividad
Merge branch 'master' into iam-conditions-support
1bd1916
Frank Natividad
clean up ubla
cff4242
Frank Natividad added 2 commits February 27, 2020 20:09
Frank Natividad
format
95a17db
Frank Natividad
Merge branch 'master' into iam-conditions-support
900a991
@frankyn

frankyn commented Feb 28, 2020

Copy link
Copy Markdown
Contributor Author

@elharo could you help cut a release for libraries-bom, @chingor13 released google-cloud-bom which updated java-core dependency to latest release which has IAM Conditions support.

It's blocking the Linkage Monitor.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@frankyn frankyn added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 28, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 28, 2020
elharo
elharo approved these changes Feb 28, 2020
View reviewed changes
@frankyn
frankyn merged commit 8256f6d into master Feb 28, 2020
@frankyn
frankyn deleted the iam-conditions-support branch February 28, 2020 21:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

3 more reviewers
@elharo elharo elharo approved these changes
@jkwlui jkwlui jkwlui approved these changes
@JesseLovelace JesseLovelace JesseLovelace approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@frankyn @elharo @jkwlui @JesseLovelace @googlebot @yoshi-kokoro
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.