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 http endpoint to list permissions #5571

Merged
merged 7 commits into from
Feb 15, 2023
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
654 changes: 397 additions & 257 deletions protogen/gen/ocis/services/settings/v0/settings.pb.go

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions protogen/gen/ocis/services/settings/v0/settings.pb.micro.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

99 changes: 99 additions & 0 deletions protogen/gen/ocis/services/settings/v0/settings.pb.web.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 51 additions & 0 deletions protogen/gen/ocis/services/settings/v0/settings.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,38 @@
]
}
},
"/api/v0/settings/permissions-list": {
"post": {
"operationId": "PermissionService_ListPermissions",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v0ListPermissionsResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/v0ListPermissionsRequest"
}
}
],
"tags": [
"PermissionService"
]
}
},
"/api/v0/settings/permissions-list-by-resource": {
"post": {
"operationId": "PermissionService_ListPermissionsByResource",
Expand Down Expand Up @@ -857,6 +889,25 @@
}
}
},
"v0ListPermissionsRequest": {
"type": "object",
"properties": {
"accountUuid": {
"type": "string"
}
}
},
"v0ListPermissionsResponse": {
"type": "object",
"properties": {
"permissions": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"v0ListRoleAssignmentsRequest": {
"type": "object",
"properties": {
Expand Down
14 changes: 14 additions & 0 deletions protogen/proto/ocis/services/settings/v0/settings.proto
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ service RoleService {
}

service PermissionService {
rpc ListPermissions(ListPermissionsRequest) returns (ListPermissionsResponse) {
option (google.api.http) = {
post: "/api/v0/settings/permissions-list",
body: "*"
};
}
rpc ListPermissionsByResource(ListPermissionsByResourceRequest) returns (ListPermissionsByResourceResponse) {
option (google.api.http) = {
post: "/api/v0/settings/permissions-list-by-resource",
Expand Down Expand Up @@ -240,6 +246,14 @@ message RemoveRoleFromUserRequest {
// requests and responses for permissions
// ---

message ListPermissionsRequest {
string account_uuid = 1;
}

message ListPermissionsResponse {
repeated string permissions = 1;
}

message ListPermissionsByResourceRequest {
ocis.messages.settings.v0.Resource resource = 1;
}
Expand Down
30 changes: 30 additions & 0 deletions services/graph/mocks/permissions.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions services/graph/pkg/service/v0/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ type Publisher interface {

// Permissions is the interface used to access the permissions service
type Permissions interface {
ListPermissions(ctx context.Context, req *settingssvc.ListPermissionsRequest, opts ...client.CallOption) (*settingssvc.ListPermissionsResponse, error)
GetPermissionByID(ctx context.Context, request *settingssvc.GetPermissionByIDRequest, opts ...client.CallOption) (*settingssvc.GetPermissionByIDResponse, error)
ListPermissionsByResource(ctx context.Context, in *settingssvc.ListPermissionsByResourceRequest, opts ...client.CallOption) (*settingssvc.ListPermissionsByResourceResponse, error)
}
Expand Down
Loading