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 new ReadConfigAction auth action for reading config #837

Merged
merged 3 commits into from
Oct 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions api/api_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -2230,9 +2230,7 @@ func (c *Controller) ConfigGetConfigHandler() configop.GetConfigHandler {
return configop.GetConfigHandlerFunc(func(params configop.GetConfigParams, user *models.User) middleware.Responder {
deps, err := c.setupRequest(user, params.HTTPRequest, []permissions.Permission{
{
// Should use repository creation permission but it is coupled to a repo id
// TODO(#764): Add a new action for reading configs?
Action: permissions.ListRepositoriesAction,
Action: permissions.ReadConfigAction,
Resource: permissions.All,
},
})
Expand Down
1 change: 1 addition & 0 deletions docs/reference/authorization.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ For the full list of actions and their required permissions see the following ta
|List Group Policies |`auth:ReadGroup` |`arn:lakefs:auth:::group/{groupId}` |GET /auth/groups/{groupId}/policies |- |
|Attach Policy To Group |`auth:AttachPolicy` |`arn:lakefs:auth:::group/{groupId}` |PUT /auth/groups/{groupId}/policies/{policyId} |- |
|Detach Policy From Group |`auth:DetachPolicy` |`arn:lakefs:auth:::group/{groupId}` |DELETE /auth/groups/{groupId}/policies/{policyId} |- |
|List Config |`auth:ReadConfig` |`*` |GET /config |- |


### Preconfigured Policies
Expand Down
1 change: 1 addition & 0 deletions permissions/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const (
CreateCredentialsAction = "auth:CreateCredentials"
DeleteCredentialsAction = "auth:DeleteCredentials"
ListCredentialsAction = "auth:ListCredentials"
ReadConfigAction = "auth:ReadConfig"
)

var serviceSet = map[string]struct{}{
Expand Down