blob: 82792ea48a1dbecceea21899d8fcb72bab08dbf6 [file] [log] [blame]
Oleksiy Petrenko95664c02018-04-19 17:05:16 +03001from barbicanv1.common import send, get_by_name_or_uuid
2from barbicanv1.secrets import secret_list, RESOURCE_LIST_KEY
3
4
5@get_by_name_or_uuid(secret_list, RESOURCE_LIST_KEY)
6@send('get')
7def secret_acl_get(secret_uuid, **kwargs):
Vasyl Saienko1e36a462018-06-01 12:46:18 +03008 url = '/secrets/{}/acl'.format(secret_uuid)
Oleksiy Petrenko95664c02018-04-19 17:05:16 +03009 return url, {}
10
11
12@get_by_name_or_uuid(secret_list, RESOURCE_LIST_KEY)
13@send('put')
14def secret_acl_put(secret_uuid, **kwargs):
Vasyl Saienko1e36a462018-06-01 12:46:18 +030015 url = '/secrets/{}/acl'.format(secret_uuid)
Oleksiy Petrenko95664c02018-04-19 17:05:16 +030016 json = {
17 'read': kwargs,
18 }
19 return url, {'json': json}
20
21
22@get_by_name_or_uuid(secret_list, RESOURCE_LIST_KEY)
23@send('patch')
24def secret_acl_patch(secret_uuid, **kwargs):
Vasyl Saienko1e36a462018-06-01 12:46:18 +030025 url = '/secrets/{}/acl'.format(secret_uuid)
Oleksiy Petrenko95664c02018-04-19 17:05:16 +030026 json = {
27 'read': kwargs,
28 }
29 return url, {'json': json}
30
31
32@get_by_name_or_uuid(secret_list, RESOURCE_LIST_KEY)
33@send('delete')
34def secret_acl_delete(secret_uuid, **kwargs):
Vasyl Saienko1e36a462018-06-01 12:46:18 +030035 url = '/secrets/{}/acl'.format(secret_uuid)
Oleksiy Petrenko95664c02018-04-19 17:05:16 +030036 return url, {}