Add ListResolvableAliases to the user service (#4609)

* Add ListResolvableAliases to the user service

There are a few non common ways this method uses our ACL
and grant system. A user is able to list resolvable
aliases for another user if they are granted permission
to do so. That means we had to load the grants for
the user being listed for and not the requester when
determining if an alias is able to resolve to a destination
for which the requested user has permission.

Similarly, the grant hash used for the list pagination
is required to be that of the user being listed and not
the requester.
This commit is contained in:
Todd authored and GitHub committed 2024-04-17 08:26:46 -07:00
1 parent 267b8ab972
commit 0d67b86543
26 files changed
+3090 -444

No files matched your search

+87
View File
@@ -5223,6 +5223,53 @@
]
}
},
"/v1/users/{id}:list-resolvable-aliases": {
"get": {
"summary": "Lists all Aliases which point to a resource for which the requester has some permission.",
"operationId": "UserService_ListResolvableAliases",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/controller.api.services.v1.ListResolvableAliasesResponse"
}
},
"default": {
"description": "Returned when there is an error processing the request.",
"schema": {
"$ref": "#/definitions/controller.api.v1.Error"
}
}
},
"parameters": [
{
"name": "id",
"description": "",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "list_token",
"description": "An opaque token used to continue an existing iteration or\nrequest updated items. If not specified, pagination\nwill start from the beginning.",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "page_size",
"description": "The maximum size of a page in this iteration.\nIf unset, the default page size configured will be used.\nIf the page_size is greater than the default page configured,\nan error will be returned.",
"in": "query",
"required": false,
"type": "integer",
"format": "int64"
}
],
"tags": [
"User service"
]
}
},
"/v1/users/{id}:remove-accounts": {
"post": {
"summary": "Removes the specified Accounts from being associated with the provided User.",
@@ -9896,6 +9943,46 @@
}
}
},
"controller.api.services.v1.ListResolvableAliasesResponse": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/controller.api.resources.aliases.v1.Alias"
}
},
"response_type": {
"type": "string",
"description": "The type of response, either \"delta\" or \"complete\".\nDelta signifies that this is part of a paginated result\nor an update to a previously completed pagination.\nComplete signifies that it is the last page."
},
"list_token": {
"type": "string",
"description": "An opaque token used to continue an existing pagination or\nrequest updated items. Use this token in the next list request\nto request the next page."
},
"sort_by": {
"type": "string",
"description": "The name of the field which the items are sorted by."
},
"sort_dir": {
"type": "string",
"description": "The direction of the sort, either \"asc\" or \"desc\"."
},
"removed_ids": {
"type": "array",
"items": {
"type": "string"
},
"description": "A list of item IDs that have been removed since they were returned\nas part of a pagination. This includes aliases which have their\ndestination_id removed or set to a resource for which the requester doesn't\nhave permissions."
},
"est_item_count": {
"type": "integer",
"format": "int64",
"description": "An estimate at the total items available. This may change during pagination."
}
}
},
"controller.api.services.v1.ListRolesResponse": {
"type": "object",
"properties": {