nominal-api 0.1240.0

API bindings for the Nominal platform
Documentation
use conjure_http::endpoint;
/// Cluster-internal endpoint that mints short-lived access tokens for a
/// preconfigured sandbox workspace + sandbox user. The intended caller is an
/// in-cluster integration test Job; access is gated by a shared-secret header
/// and a NetworkPolicy that restricts the source pods.
///
/// This service must not be exposed via the public ingress.
#[conjure_http::conjure_client(name = "InternalSandboxTokenService")]
pub trait InternalSandboxTokenService<
    #[response_body]
    I: Iterator<
            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
        >,
> {
    /// Issue a Nominal-signed bearer token bound to the configured sandbox
    /// user + org. The TTL is capped at 1 hour server-side regardless of the
    /// requested value. The shared-secret header must match the value
    /// configured on gatekeeper or the call is rejected.
    #[endpoint(
        method = POST,
        path = "/sandbox-token-internal/v1/issue",
        name = "issueSandboxToken",
        accept = conjure_http::client::StdResponseDeserializer
    )]
    fn issue_sandbox_token(
        &self,
        #[body(serializer = conjure_http::client::StdRequestSerializer)]
        request: &super::super::super::objects::authorization::IssueSandboxTokenRequest,
        #[header(
            name = "X-Nominal-Sandbox-Shared-Secret",
            encoder = conjure_http::client::conjure::PlainEncoder
        )]
        shared_secret: &str,
    ) -> Result<
        super::super::super::objects::authorization::IssueSandboxTokenResponse,
        conjure_http::private::Error,
    >;
}
/// Cluster-internal endpoint that mints short-lived access tokens for a
/// preconfigured sandbox workspace + sandbox user. The intended caller is an
/// in-cluster integration test Job; access is gated by a shared-secret header
/// and a NetworkPolicy that restricts the source pods.
///
/// This service must not be exposed via the public ingress.
#[conjure_http::conjure_client(name = "InternalSandboxTokenService")]
pub trait AsyncInternalSandboxTokenService<
    #[response_body]
    I: conjure_http::private::Stream<
            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
        >,
> {
    /// Issue a Nominal-signed bearer token bound to the configured sandbox
    /// user + org. The TTL is capped at 1 hour server-side regardless of the
    /// requested value. The shared-secret header must match the value
    /// configured on gatekeeper or the call is rejected.
    #[endpoint(
        method = POST,
        path = "/sandbox-token-internal/v1/issue",
        name = "issueSandboxToken",
        accept = conjure_http::client::StdResponseDeserializer
    )]
    async fn issue_sandbox_token(
        &self,
        #[body(serializer = conjure_http::client::StdRequestSerializer)]
        request: &super::super::super::objects::authorization::IssueSandboxTokenRequest,
        #[header(
            name = "X-Nominal-Sandbox-Shared-Secret",
            encoder = conjure_http::client::conjure::PlainEncoder
        )]
        shared_secret: &str,
    ) -> Result<
        super::super::super::objects::authorization::IssueSandboxTokenResponse,
        conjure_http::private::Error,
    >;
}
/// Cluster-internal endpoint that mints short-lived access tokens for a
/// preconfigured sandbox workspace + sandbox user. The intended caller is an
/// in-cluster integration test Job; access is gated by a shared-secret header
/// and a NetworkPolicy that restricts the source pods.
///
/// This service must not be exposed via the public ingress.
#[conjure_http::conjure_client(name = "InternalSandboxTokenService", local)]
pub trait LocalAsyncInternalSandboxTokenService<
    #[response_body]
    I: conjure_http::private::Stream<
            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
        >,
> {
    /// Issue a Nominal-signed bearer token bound to the configured sandbox
    /// user + org. The TTL is capped at 1 hour server-side regardless of the
    /// requested value. The shared-secret header must match the value
    /// configured on gatekeeper or the call is rejected.
    #[endpoint(
        method = POST,
        path = "/sandbox-token-internal/v1/issue",
        name = "issueSandboxToken",
        accept = conjure_http::client::StdResponseDeserializer
    )]
    async fn issue_sandbox_token(
        &self,
        #[body(serializer = conjure_http::client::StdRequestSerializer)]
        request: &super::super::super::objects::authorization::IssueSandboxTokenRequest,
        #[header(
            name = "X-Nominal-Sandbox-Shared-Secret",
            encoder = conjure_http::client::conjure::PlainEncoder
        )]
        shared_secret: &str,
    ) -> Result<
        super::super::super::objects::authorization::IssueSandboxTokenResponse,
        conjure_http::private::Error,
    >;
}