Use secret key when adding allowed process model

This commit is contained in:
mike cullerton 2022-09-30 12:15:04 -04:00
parent 1b25d08a3a
commit ff56ed068d
3 changed files with 9 additions and 2 deletions

View File

@ -2034,10 +2034,16 @@ components:
type: number
example: 1
nullable: true
secret_key:
description: The key of the secret associated with this allowed process path
type: string
example: 2
nullable: true
secret_id:
description: The id of the secret associated with this allowed process path
type: number
example: 2
nullable: true
allowed_relative_path:
description: The allowed process path
type: string

View File

@ -1308,8 +1308,9 @@ def delete_secret(key: str) -> Response:
def add_allowed_process_path(body: dict) -> Response:
"""Get allowed process paths."""
secret = SecretService().get_secret(body["secret_key"])
allowed_process_path = SecretService.add_allowed_process(
body["secret_id"], g.user.id, body["allowed_relative_path"]
secret.id, g.user.id, body["allowed_relative_path"]
)
return Response(
json.dumps(SecretAllowedProcessSchema().dump(allowed_process_path)),

View File

@ -453,7 +453,7 @@ class TestSecretServiceApi(SecretServiceTestHelpers):
process_model_info
)
data = {
"secret_id": test_secret.id,
"secret_key": test_secret.key,
"allowed_relative_path": process_model_relative_path,
}
response: TestResponse = client.post(