Retrieve list of privileges to be granted to a plugin. Args: name (string): Name of the remote plugin to examine. The ``:latest`` tag is optional, and is the default if omitted. Returns: A list of dictionaries
(self, name)
| 153 | |
| 154 | @utils.minimum_version('1.25') |
| 155 | def plugin_privileges(self, name): |
| 156 | """ |
| 157 | Retrieve list of privileges to be granted to a plugin. |
| 158 | |
| 159 | Args: |
| 160 | name (string): Name of the remote plugin to examine. The |
| 161 | ``:latest`` tag is optional, and is the default if omitted. |
| 162 | |
| 163 | Returns: |
| 164 | A list of dictionaries representing the plugin's |
| 165 | permissions |
| 166 | |
| 167 | """ |
| 168 | params = { |
| 169 | 'remote': name, |
| 170 | } |
| 171 | |
| 172 | headers = {} |
| 173 | registry, repo_name = auth.resolve_repository_name(name) |
| 174 | header = auth.get_config_header(self, registry) |
| 175 | if header: |
| 176 | headers['X-Registry-Auth'] = header |
| 177 | |
| 178 | url = self._url('/plugins/privileges') |
| 179 | return self._result( |
| 180 | self._get(url, params=params, headers=headers), True |
| 181 | ) |
| 182 | |
| 183 | @utils.minimum_version('1.25') |
| 184 | @utils.check_resource('name') |