Skip to content

Commit

Permalink
Fix RBAC to action-alias help and match api.
Browse files Browse the repository at this point in the history
  • Loading branch information
nzlosh committed Dec 21, 2023
1 parent d940fd6 commit 6b95e99
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ Fixed
* For "local-shell-script" runner, on readonly filesystems, don't attempt to run chmod +x on script_action. Fixes #5591
Contributed by @jk464

* Fixed RBAC support to action-alias help and match end point. #6022
Contributed by @nzlosh

Added
~~~~~
* Move `git clone` to `user_home/.st2packs` #5845
Expand Down
4 changes: 2 additions & 2 deletions st2api/st2api/controllers/v1/actionalias.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def get_one(self, ref_or_id, requester_user):
ref_or_id, requester_user=requester_user, permission_type=permission_type
)

def match(self, action_alias_match_api):
def match(self, action_alias_match_api, requester_user):
"""
Find a matching action alias.
Expand All @@ -99,7 +99,7 @@ def match(self, action_alias_match_api):
"representation": format_["representation"],
}

def help(self, filter, pack, limit, offset, **kwargs):
def help(self, filter, pack, limit, offset, requester_user, **kwargs):
"""
Get available help strings for action aliases.
Expand Down
10 changes: 10 additions & 0 deletions st2common/st2common/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,11 @@ paths:
description: Object containing the format to be matched.
schema:
$ref: '#/definitions/ActionAliasMatchRequest'
x-parameters:
- name: user
in: context
x-as: requester_user
description: User performing the operation.
responses:
'200':
description: Action alias match pattern
Expand Down Expand Up @@ -840,6 +845,11 @@ paths:
description: Number of actions alias to offset
type: integer
default: 0
x-parameters:
- name: user
in: context
x-as: requester_user
description: User performing the operation.
responses:
'200':
description: Action alias match pattern
Expand Down
10 changes: 10 additions & 0 deletions st2common/st2common/openapi.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,11 @@ paths:
description: Object containing the format to be matched.
schema:
$ref: '#/definitions/ActionAliasMatchRequest'
x-parameters:
- name: user
in: context
x-as: requester_user
description: User performing the operation.
responses:
'200':
description: Action alias match pattern
Expand Down Expand Up @@ -836,6 +841,11 @@ paths:
description: Number of actions alias to offset
type: integer
default: 0
x-parameters:
- name: user
in: context
x-as: requester_user
description: User performing the operation.
responses:
'200':
description: Action alias match pattern
Expand Down

0 comments on commit 6b95e99

Please sign in to comment.