Struct taskcluster::Secrets
source · [−]pub struct Secrets {
pub client: Client,
}
Expand description
Secrets Service
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.
Fields
client: Client
The underlying client used to make API calls for this service.
Implementations
sourceimpl Secrets
impl Secrets
sourcepub fn new<CB: Into<ClientBuilder>>(client_builder: CB) -> Result<Self, Error>
pub fn new<CB: Into<ClientBuilder>>(client_builder: CB) -> Result<Self, Error>
Create a new Secrets instance, based on the given client builder
sourcepub async fn ping(&self) -> Result<(), Error>
pub async fn ping(&self) -> Result<(), Error>
Ping Server
Respond without doing anything. This endpoint is used to check that the service is up.
sourcepub fn ping_signed_url(&self, ttl: Duration) -> Result<String, Error>
pub fn ping_signed_url(&self, ttl: Duration) -> Result<String, Error>
Generate a signed URL for the ping endpoint
sourcepub async fn lbheartbeat(&self) -> Result<(), Error>
pub async fn lbheartbeat(&self) -> Result<(), Error>
Load Balancer Heartbeat
Respond without doing anything. This endpoint is used to check that the service is up.
sourcepub fn lbheartbeat_url(&self) -> Result<String, Error>
pub fn lbheartbeat_url(&self) -> Result<String, Error>
Generate an unsigned URL for the lbheartbeat endpoint
sourcepub fn lbheartbeat_signed_url(&self, ttl: Duration) -> Result<String, Error>
pub fn lbheartbeat_signed_url(&self, ttl: Duration) -> Result<String, Error>
Generate a signed URL for the lbheartbeat endpoint
sourcepub async fn version(&self) -> Result<(), Error>
pub async fn version(&self) -> Result<(), Error>
Taskcluster Version
Respond with the JSON version object. https://github.com/mozilla-services/Dockerflow/blob/main/docs/version_object.md
sourcepub fn version_url(&self) -> Result<String, Error>
pub fn version_url(&self) -> Result<String, Error>
Generate an unsigned URL for the version endpoint
sourcepub fn version_signed_url(&self, ttl: Duration) -> Result<String, Error>
pub fn version_signed_url(&self, ttl: Duration) -> Result<String, Error>
Generate a signed URL for the version endpoint
sourcepub async fn set(&self, name: &str, payload: &Value) -> Result<(), Error>
pub async fn set(&self, name: &str, payload: &Value) -> Result<(), Error>
Set Secret
Set the secret associated with some key. If the secret already exists, it is updated instead.
sourcepub async fn remove(&self, name: &str) -> Result<(), Error>
pub async fn remove(&self, name: &str) -> Result<(), Error>
Delete Secret
Delete the secret associated with some key. It will succeed whether or not the secret exists
sourcepub async fn get(&self, name: &str) -> Result<Value, Error>
pub async fn get(&self, name: &str) -> Result<Value, Error>
Read Secret
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.
sourcepub fn get_url(&self, name: &str) -> Result<String, Error>
pub fn get_url(&self, name: &str) -> Result<String, Error>
Generate an unsigned URL for the get endpoint
sourcepub fn get_signed_url(&self, name: &str, ttl: Duration) -> Result<String, Error>
pub fn get_signed_url(&self, name: &str, ttl: Duration) -> Result<String, Error>
Generate a signed URL for the get endpoint
sourcepub async fn list(
&self,
continuationToken: Option<&str>,
limit: Option<&str>
) -> Result<Value, Error>
pub async fn list(
&self,
continuationToken: Option<&str>,
limit: Option<&str>
) -> Result<Value, Error>
List Secrets
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.
sourcepub fn list_url(
&self,
continuationToken: Option<&str>,
limit: Option<&str>
) -> Result<String, Error>
pub fn list_url(
&self,
continuationToken: Option<&str>,
limit: Option<&str>
) -> Result<String, Error>
Generate an unsigned URL for the list endpoint
sourcepub fn list_signed_url(
&self,
continuationToken: Option<&str>,
limit: Option<&str>,
ttl: Duration
) -> Result<String, Error>
pub fn list_signed_url(
&self,
continuationToken: Option<&str>,
limit: Option<&str>,
ttl: Duration
) -> Result<String, Error>
Generate a signed URL for the list endpoint
sourcepub async fn heartbeat(&self) -> Result<(), Error>
pub async fn heartbeat(&self) -> Result<(), Error>
Heartbeat
Respond with a service heartbeat.
This endpoint is used to check on backing services this service depends on.
sourcepub fn heartbeat_url(&self) -> Result<String, Error>
pub fn heartbeat_url(&self) -> Result<String, Error>
Generate an unsigned URL for the heartbeat endpoint
Auto Trait Implementations
impl !RefUnwindSafe for Secrets
impl Send for Secrets
impl Sync for Secrets
impl Unpin for Secrets
impl !UnwindSafe for Secrets
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more