Caches credentials for Docker registries and provides a means to check the credentials against the registry.
More...
Caches credentials for Docker registries and provides a means to check the credentials against the registry.
◆ AddAnonymous() [1/2]
Specifies that you want to use anonymous access to the indicated registry.
- Parameters
-
registry | The name of the registry, as used in image names. |
- Exceptions
-
ArgumentException | The input is null or empty. |
◆ AddAnonymous() [2/2]
void DockerSdk.Registries.RegistryAccess.AddAnonymous |
( |
string |
registry | ) |
|
Specifies that you want to use anonymous access to the indicated registry.
- Parameters
-
registry | The name of the registry, as used in image names. |
- Exceptions
-
◆ AddBasicAuth() [1/2]
void DockerSdk.Registries.RegistryAccess.AddBasicAuth |
( |
RegistryReference |
registry, |
|
|
string |
username, |
|
|
string |
password |
|
) |
| |
|
inline |
Specifies that you want to use basic authentication for access to the indicated registry.
- Parameters
-
registry | The name of the registry, as used in image names. |
username | The username to use for the registry. |
password | The password to use for the registry. |
- Exceptions
-
ArgumentException | One or more of the inputs are null or the empty string. |
◆ AddBasicAuth() [2/2]
void DockerSdk.Registries.RegistryAccess.AddBasicAuth |
( |
string |
registry, |
|
|
string |
username, |
|
|
string |
password |
|
) |
| |
Specifies that you want to use basic authentication for access to the indicated registry.
- Parameters
-
registry | The name of the registry, as used in image names. |
username | The username to use for the registry. |
password | The password to use for the registry. |
- Exceptions
-
◆ AddIdentityToken() [1/2]
void DockerSdk.Registries.RegistryAccess.AddIdentityToken |
( |
RegistryReference |
registry, |
|
|
string |
identityToken |
|
) |
| |
|
inline |
Specifies that you want to use an identity token for authenticating with the indicated registry.
- Parameters
-
registry | The name of the registry, as used in image names. |
identityToken | An identity token granted by the registry. |
- Exceptions
-
ArgumentException | One or more of the inputs are null or the empty string. |
◆ AddIdentityToken() [2/2]
void DockerSdk.Registries.RegistryAccess.AddIdentityToken |
( |
string |
registry, |
|
|
string |
identityToken |
|
) |
| |
Specifies that you want to use an identity token for authenticating with the indicated registry.
- Parameters
-
registry | The name of the registry, as used in image names. |
identityToken | An identity token granted by the registry. |
- Exceptions
-
ArgumentException | One or more of the inputs are null or the empty string. |
MalformedReferenceException | The input is not a well-formed registry access reference. |
◆ CheckAuthenticationAsync() [1/2]
async Task<bool> DockerSdk.Registries.RegistryAccess.CheckAuthenticationAsync |
( |
RegistryReference |
registry, |
|
|
CancellationToken |
ct = default |
|
) |
| |
|
inline |
Tests whether the client can authenticate with the indicated registry.
- Parameters
-
- Returns
Use the various Add
* methods to supply authentication instructions. If no such instructions are provided, this method will try anonymous access.
- Exceptions
-
ArgumentException | The input is null or empty. |
System.Net.Http.HttpRequestException | The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation, or timeout. |
◆ CheckAuthenticationAsync() [2/2]
Task<bool> DockerSdk.Registries.RegistryAccess.CheckAuthenticationAsync |
( |
string |
registry, |
|
|
CancellationToken |
ct = default |
|
) |
| |
Tests whether the client can authenticate with the indicated registry.
- Parameters
-
- Returns
Use the various Add
* methods to supply authentication instructions. If no such instructions are provided, this method will try anonymous access.
- Exceptions
-
ArgumentException | The input is null or empty. |
MalformedReferenceException | The input is not a well-formed registry access reference. |
System.Net.Http.HttpRequestException | The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation, or timeout. |
◆ Clear()
void DockerSdk.Registries.RegistryAccess.Clear |
( |
| ) |
|
|
inline |
Removes all custom registry entries.
◆ GetRegistryName()
RegistryReference DockerSdk.Registries.RegistryAccess.GetRegistryName |
( |
string |
imageName | ) |
|
Parses an image's name to determine which registry the image is associated with.
- Parameters
-
imageName | The name of image. (Not the ID.) |
- Returns
- A reference to the registry.
- Exceptions
-
◆ Remove() [1/2]
Removes an entry from the cache.
- Parameters
-
registry | The host name of the registry to remove. |
- Returns
- True if the entry was removed, or false if the entry was not present.
This method is equivalent to docker logout
.
- Exceptions
-
ArgumentException | The input is null. |
◆ Remove() [2/2]
bool DockerSdk.Registries.RegistryAccess.Remove |
( |
string |
registry | ) |
|
Removes an entry from the cache.
- Parameters
-
registry | The host name of the registry to remove. |
- Returns
- True if the entry was removed, or false if the entry was not present.
This method is equivalent to docker logout
.
- Exceptions
-
ArgumentException | The input is null or empty. |
◆ Registries
Gets the Docker registries that have cache entries.
The documentation for this class was generated from the following file:
- Registries/RegistryAccess.cs