Skip to main content

nominal_api/conjure/endpoints/authorization/
internal_api_key_service.rs

1use conjure_http::endpoint;
2/// This internal-only service manages long lived api keys.e
3#[conjure_http::conjure_endpoints(
4    name = "InternalApiKeyService",
5    use_legacy_error_serialization
6)]
7pub trait InternalApiKeyService {
8    /// Get a Nominal-issued access token from a long-lived API key. Callers should verify that
9    /// their api key is formatted properly (i.e. prefixed with "nominal_api_key") before calling this endpoint.
10    #[endpoint(
11        method = POST,
12        path = "/api-key-internal/v1/access-token",
13        name = "getAccessTokenFromApiKeyValue",
14        produces = conjure_http::server::StdResponseSerializer
15    )]
16    fn get_access_token_from_api_key_value(
17        &self,
18        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
19        request: super::super::super::objects::authorization::GetAccessTokenFromApiKeyRequest,
20    ) -> Result<
21        super::super::super::objects::authorization::GetAccessTokenResponse,
22        conjure_http::private::Error,
23    >;
24}
25/// This internal-only service manages long lived api keys.e
26#[conjure_http::conjure_endpoints(
27    name = "InternalApiKeyService",
28    use_legacy_error_serialization
29)]
30pub trait AsyncInternalApiKeyService {
31    /// Get a Nominal-issued access token from a long-lived API key. Callers should verify that
32    /// their api key is formatted properly (i.e. prefixed with "nominal_api_key") before calling this endpoint.
33    #[endpoint(
34        method = POST,
35        path = "/api-key-internal/v1/access-token",
36        name = "getAccessTokenFromApiKeyValue",
37        produces = conjure_http::server::StdResponseSerializer
38    )]
39    async fn get_access_token_from_api_key_value(
40        &self,
41        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
42        request: super::super::super::objects::authorization::GetAccessTokenFromApiKeyRequest,
43    ) -> Result<
44        super::super::super::objects::authorization::GetAccessTokenResponse,
45        conjure_http::private::Error,
46    >;
47}
48/// This internal-only service manages long lived api keys.e
49#[conjure_http::conjure_endpoints(
50    name = "InternalApiKeyService",
51    use_legacy_error_serialization,
52    local
53)]
54pub trait LocalAsyncInternalApiKeyService {
55    /// Get a Nominal-issued access token from a long-lived API key. Callers should verify that
56    /// their api key is formatted properly (i.e. prefixed with "nominal_api_key") before calling this endpoint.
57    #[endpoint(
58        method = POST,
59        path = "/api-key-internal/v1/access-token",
60        name = "getAccessTokenFromApiKeyValue",
61        produces = conjure_http::server::StdResponseSerializer
62    )]
63    async fn get_access_token_from_api_key_value(
64        &self,
65        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
66        request: super::super::super::objects::authorization::GetAccessTokenFromApiKeyRequest,
67    ) -> Result<
68        super::super::super::objects::authorization::GetAccessTokenResponse,
69        conjure_http::private::Error,
70    >;
71}