Oleksiy Petrenko | 95664c0 | 2018-04-19 17:05:16 +0300 | [diff] [blame] | 1 | from barbicanv1.common import send, get_by_name_or_uuid |
| 2 | from barbicanv1.secrets import secret_list, RESOURCE_LIST_KEY |
| 3 | |
| 4 | |
| 5 | @get_by_name_or_uuid(secret_list, RESOURCE_LIST_KEY) |
| 6 | @send('get') |
| 7 | def secret_acl_get(secret_uuid, **kwargs): |
Vasyl Saienko | 1e36a46 | 2018-06-01 12:46:18 +0300 | [diff] [blame] | 8 | url = '/secrets/{}/acl'.format(secret_uuid) |
Oleksiy Petrenko | 95664c0 | 2018-04-19 17:05:16 +0300 | [diff] [blame] | 9 | return url, {} |
| 10 | |
| 11 | |
| 12 | @get_by_name_or_uuid(secret_list, RESOURCE_LIST_KEY) |
| 13 | @send('put') |
| 14 | def secret_acl_put(secret_uuid, **kwargs): |
Vasyl Saienko | 1e36a46 | 2018-06-01 12:46:18 +0300 | [diff] [blame] | 15 | url = '/secrets/{}/acl'.format(secret_uuid) |
Oleksiy Petrenko | 95664c0 | 2018-04-19 17:05:16 +0300 | [diff] [blame] | 16 | 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') |
| 24 | def secret_acl_patch(secret_uuid, **kwargs): |
Vasyl Saienko | 1e36a46 | 2018-06-01 12:46:18 +0300 | [diff] [blame] | 25 | url = '/secrets/{}/acl'.format(secret_uuid) |
Oleksiy Petrenko | 95664c0 | 2018-04-19 17:05:16 +0300 | [diff] [blame] | 26 | 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') |
| 34 | def secret_acl_delete(secret_uuid, **kwargs): |
Vasyl Saienko | 1e36a46 | 2018-06-01 12:46:18 +0300 | [diff] [blame] | 35 | url = '/secrets/{}/acl'.format(secret_uuid) |
Oleksiy Petrenko | 95664c0 | 2018-04-19 17:05:16 +0300 | [diff] [blame] | 36 | return url, {} |