public class Secrets extends TaskclusterRequestHandler
The secrets service provides a simple key/value store for small bits of secret data. Access is limited by scopes, so values can be considered secret from those who do not have the relevant scopes.
Secrets also have an expiration date, and once a secret has expired it can no longer be read. This is useful for short-term secrets such as a temporary service credential or a one-time signing key.
Modifier and Type | Field and Description |
---|---|
protected static String |
defaultBaseURL |
Constructor and Description |
---|
Secrets() |
Secrets(Credentials credentials) |
Secrets(Credentials credentials,
String baseURL) |
Secrets(String baseURL) |
Secrets(String clientId,
String accessToken) |
Secrets(String clientId,
String accessToken,
String certificate) |
Modifier and Type | Method and Description |
---|---|
CallSummary<EmptyPayload,Secret> |
get(String name)
Read the secret associated with some key.
|
CallSummary<EmptyPayload,SecretsList> |
list()
List the names of all secrets.
|
CallSummary<EmptyPayload,EmptyPayload> |
ping()
Respond without doing anything.
|
CallSummary<EmptyPayload,EmptyPayload> |
remove(String name)
Delete the secret associated with some key.
|
CallSummary<Secret,EmptyPayload> |
set(String name,
Secret payload)
Set the secret associated with some key.
|
apiCall, setBaseURL, uriEncode
protected static final String defaultBaseURL
public Secrets(Credentials credentials)
public Secrets(Credentials credentials, String baseURL)
public Secrets(String baseURL)
public Secrets()
public CallSummary<EmptyPayload,EmptyPayload> ping() throws APICallFailure
Respond without doing anything. This endpoint is used to check that the service is up.
APICallFailure
public CallSummary<Secret,EmptyPayload> set(String name, Secret payload) throws APICallFailure
Set the secret associated with some key. If the secret already exists, it is updated instead.
Required scopes: secrets:set:
APICallFailure
public CallSummary<EmptyPayload,EmptyPayload> remove(String name) throws APICallFailure
Delete the secret associated with some key.
Required scopes: secrets:set:
APICallFailure
public CallSummary<EmptyPayload,Secret> get(String name) throws APICallFailure
Read the secret associated with some key. If the secret has recently expired, the response code 410 is returned. If the caller lacks the scope necessary to get the secret, the call will fail with a 403 code regardless of whether the secret exists.
Required scopes: secrets:get:
APICallFailure
public CallSummary<EmptyPayload,SecretsList> list() throws APICallFailure
List the names of all secrets.
By default this end-point will try to return up to 1000 secret names in one request. But it may return less, even if more tasks are available. It may also return a continuationToken
even though there are no more results. However, you can only be sure to have seen all results if you keep calling listTaskGroup
with the last continuationToken
until you get a result without a continuationToken
.
If you are not interested in listing all the members at once, you may use the query-string option limit
to return fewer.
APICallFailure
Copyright © 2014–2018 Mozilla. All rights reserved.