Skip to content

Commit

Permalink
Add new ReadConfigAction auth action for reading config (#837)
Browse files Browse the repository at this point in the history
* Add ReadConfigAction

* Use ReadConfigAction instead of ListRepositoriesAction for reading config

* Add auth:ReadConfig to authorization.md
  • Loading branch information
daniel-shuy committed Oct 20, 2020
1 parent 99e1bd1 commit 8527b2a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
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

0 comments on commit 8527b2a

Please sign in to comment.