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

feat: implement access Policy public API #1998

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

roaminggypsy
Copy link
Contributor

No description provided.

@wfa-reviewable
Copy link

This change is Reviewable

Copy link
Member

@SanjayVas SanjayVas left a comment

Choose a reason for hiding this comment

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

Reviewed 5 of 10 files at r1, 5 of 5 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @roaminggypsy)


src/main/kotlin/org/wfanet/measurement/access/service/Errors.kt line 326 at r2 (raw file):

  ServiceException(
    Errors.Reason.POLICY_ALREADY_EXISTS,
    "Policy $name already exists",

This shouldn't take the name as you can get an ALREADY_EXISTS for other reasons, such as a policy (with possibly a different name) already existing for the specified protected resource. The backend doesn't have a great way to distinguish which case it is, so we can't either.

Copy link
Contributor Author

@roaminggypsy roaminggypsy left a comment

Choose a reason for hiding this comment

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

Reviewable status: 7 of 10 files reviewed, 1 unresolved discussion (waiting on @SanjayVas)


src/main/kotlin/org/wfanet/measurement/access/service/Errors.kt line 326 at r2 (raw file):

Previously, SanjayVas (Sanjay Vasandani) wrote…

This shouldn't take the name as you can get an ALREADY_EXISTS for other reasons, such as a policy (with possibly a different name) already existing for the specified protected resource. The backend doesn't have a great way to distinguish which case it is, so we can't either.

Ohhh okay. I was thinking about the inconsistency in RoleAlreadyExists and PrincipalAlreadyExists. The principal one does not take name as a param, but the role one does.

Copy link
Member

@SanjayVas SanjayVas left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @roaminggypsy)


src/main/kotlin/org/wfanet/measurement/access/service/Errors.kt line 326 at r2 (raw file):

Previously, roaminggypsy (Lin) wrote…

Ohhh okay. I was thinking about the inconsistency in RoleAlreadyExists and PrincipalAlreadyExists. The principal one does not take name as a param, but the role one does.

The Role one actually has the same problem, I just didn't catch it in previous code review. The only ALREADY_EXISTS error where we know the cause for sure is POLICY_BINDING_MEMBERSHIP_ALREADY_EXISTS.

Copy link
Contributor Author

@roaminggypsy roaminggypsy left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @roaminggypsy)


src/main/kotlin/org/wfanet/measurement/access/service/Errors.kt line 326 at r2 (raw file):

Previously, SanjayVas (Sanjay Vasandani) wrote…

The Role one actually has the same problem, I just didn't catch it in previous code review. The only ALREADY_EXISTS error where we know the cause for sure is POLICY_BINDING_MEMBERSHIP_ALREADY_EXISTS.

Got it I will fix that in another PR.

@roaminggypsy roaminggypsy force-pushed the roaminggypsy-policy-api branch from 904026e to 9dc99e1 Compare January 14, 2025 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants