public static class ContainerRegistryAuthSupplier.Builder extends Object
The access tokens returned by the ContainerRegistryAuthSupplier are scoped to
devstorage.read_write by default, these can be customized with withScopes(Collection).
The default value for the minimum expiry time of an access token is one minute. When the ContainerRegistryAuthSupplier is asked for a RegistryAuth, it will check if the existing AccessToken for the GoogleCredentials expires within this amount of time. If it does, then the AccessToken is refreshed before being returned.
| Constructor and Description |
|---|
Builder(com.google.auth.oauth2.GoogleCredentials credentials) |
| Modifier and Type | Method and Description |
|---|---|
ContainerRegistryAuthSupplier |
build() |
ContainerRegistryAuthSupplier.Builder |
withMinimumExpiry(long duration,
TimeUnit timeUnit)
Changes the minimum expiry time used to refresh AccessTokens before they expire.
|
ContainerRegistryAuthSupplier.Builder |
withScopes(Collection<String> scopes)
Changes the scopes
used in fetching AccessTokens.
|
public ContainerRegistryAuthSupplier.Builder withScopes(Collection<String> scopes)
The default is devstorage.read_write, which allows pulling and pushing of images. To allow the application using ContainerRegistryAuthSupplier to pull but not push images, change the scope to contain only devstorage.read_only. only
public ContainerRegistryAuthSupplier.Builder withMinimumExpiry(long duration, TimeUnit timeUnit)
public ContainerRegistryAuthSupplier build()
Copyright © 2018. All rights reserved.