FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat: add IAM Conditions support by frankyn · Pull Request #120 · googleapis/java-storage · GitHub

feat: add IAM Conditions support - #120

Merged
frankyn merged 18 commits into
masterfrom
iam-conditions-support
Feb 28, 2020
Merged

feat: add IAM Conditions support#120
frankyn merged 18 commits into
masterfrom
iam-conditions-support

Conversation

frankyn commented Feb 6, 2020
edited
Loading

Copy link
Copy Markdown
Contributor

Add IAM Conditions Support.

Depends on:
googleapis/java-core#110

Pending Review List:

googlebot added the cla: yes This human has signed the Contributor License Agreement. label Feb 6, 2020

jkwlui left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

elharo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Mostly nits, but snapshot dependencies are a hard no.

Bindings apiBinding = new Bindings();
apiBinding.setRole(binding.getRole());
apiBinding.setMembers(new ArrayList<>(binding.getMembers()));
if (null != binding.getCondition()) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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


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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

public void testBucketPolicy() {
testBucketPolicyRequesterPays(true);
testBucketPolicyRequesterPays(false);
// testBucketPolicyV3RequesterPays(true);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

don't comment out code

}

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Or two helper methods


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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

i++ is more common

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>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

No snapshot dependencies.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Doing it temporary until dependency PR is merged/released.

frankyn requested review from elharo and removed request for chingor13 February 26, 2020 23:13
}

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Or two helper methods

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>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I'm doing this only for development*

frankyn requested a review from elharo February 27, 2020 19:40

codecov Bot commented Feb 27, 2020
edited
Loading

Copy link
Copy Markdown

Codecov Report

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

@@             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.

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.

frankyn added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 28, 2020
yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 28, 2020
frankyn merged commit 8256f6d into master Feb 28, 2020
frankyn deleted the iam-conditions-support branch February 28, 2020 21:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL