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

add permission checks to api endpoints #243

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

mikemrm
Copy link
Contributor

@mikemrm mikemrm commented Jan 26, 2024

This adds permission checks to api endpoints.

The following permissions-api policy actions are now required:

  • iam_issuer_create
  • iam_issuer_update
  • iam_issuer_delete
  • iam_issuer_get
  • iam_oauthclient_create
  • iam_oauthclient_delete
  • iam_oauthclient_get

README.md Fixed Show fixed Hide fixed
README.md Fixed Show fixed Hide fixed
README.md Fixed Show fixed Hide fixed
README.md Fixed Show fixed Hide fixed
README.md Fixed Show fixed Hide fixed
README.md Fixed Show fixed Hide fixed
README.md Fixed Show fixed Hide fixed
README.md Dismissed Show dismissed Hide dismissed
@mikemrm mikemrm force-pushed the add-permissions-checks branch 3 times, most recently from 488518b to d0ad47f Compare January 26, 2024 21:45
@mikemrm mikemrm marked this pull request as ready for review January 29, 2024 14:34
@mikemrm mikemrm requested review from a team as code owners January 29, 2024 14:34
Copy link
Contributor

@jnschaeffer jnschaeffer left a comment

Choose a reason for hiding this comment

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

Looks like it should work, some minor changes.

cmd/serve.go Outdated
@@ -72,6 +73,14 @@ func serve(ctx context.Context) {
defer auditCloseFn() //nolint:errcheck // Not needed to check returned error.
}

perms, err := permissions.New(config.Config.Permissions,
permissions.WithLogger(logger),
permissions.WithDefaultChecker(permissions.DefaultAllowChecker),
Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably make this configurable (with the default deny checker as the default).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed I see what you're saying. Let me see about adding this configuration into the permissions library as I think that would be a much needed improvement to that and simplify these downstream app integrations.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've created this ability in this PR for permissions-api: infratographer/permissions-api#217

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good! We can probably just remove this line then.

internal/api/httpsrv/handler_issuer.go Show resolved Hide resolved
internal/api/httpsrv/handler_issuer.go Show resolved Hide resolved
@mikemrm mikemrm force-pushed the add-permissions-checks branch 2 times, most recently from 748f78d to 4e6f2be Compare February 5, 2024 21:31
chart/identity-api/templates/configMap.yaml Outdated Show resolved Hide resolved
chart/identity-api/values.yaml Outdated Show resolved Hide resolved
This adds permission checks to api endpoints.

The following permissions-api policy actions are now required:

- iam_issuer_create
- iam_issuer_update
- iam_issuer_delete
- iam_issuer_get
- iam_oauthclient_create
- iam_oauthclient_delete
- iam_oauthclient_get

Signed-off-by: Mike Mason <[email protected]>
@mikemrm mikemrm merged commit 741164f into infratographer:main Feb 7, 2024
21 checks passed
@mikemrm mikemrm deleted the add-permissions-checks branch February 7, 2024 15:34
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.

2 participants