MCPcopy
hub / github.com/docker/docker-py / get

Method get

docker/credentials/store.py:26–44  ·  view source on GitHub ↗

Retrieve credentials for `server`. If no credentials are found, a `StoreError` will be raised.

(self, server)

Source from the content-addressed store, hash-verified

24 )
25
26 def get(self, server):
27 """ Retrieve credentials for `server`. If no credentials are found,
28 a `StoreError` will be raised.
29 """
30 if not isinstance(server, bytes):
31 server = server.encode('utf-8')
32 data = self._execute('get', server)
33 result = json.loads(data.decode('utf-8'))
34
35 # docker-credential-pass will return an object for inexistent servers
36 # whereas other helpers will exit with returncode != 0. For
37 # consistency, if no significant data is returned,
38 # raise CredentialsNotFound
39 if result['Username'] == '' and result['Secret'] == '':
40 raise errors.CredentialsNotFound(
41 f'No matching credentials in {self.program}'
42 )
43
44 return result
45
46 def store(self, server, username, secret):
47 """ Store credentials for `server`. Raises a `StoreError` if an error

Callers 15

mainFunction · 0.45
parse_authMethod · 0.45
load_configMethod · 0.45
authsMethod · 0.45
creds_storeMethod · 0.45
cred_helpersMethod · 0.45
get_credential_storeMethod · 0.45
__init__Method · 0.45
container_specMethod · 0.45
resourcesMethod · 0.45

Calls 1

_executeMethod · 0.95

Tested by 1