Skip to main content

nominal_api/conjure/endpoints/usercreation/api/
internal_user_creation_service.rs

1use conjure_http::endpoint;
2/// Internal service responsible for handling creation of new users.
3#[conjure_http::conjure_endpoints(
4    name = "InternalUserCreationService",
5    use_legacy_error_serialization
6)]
7pub trait InternalUserCreationService {
8    /// Ensures that the user corresponding to the auth header provided exists in the database.
9    /// Will do nothing if the user already exists.
10    #[endpoint(
11        method = PUT,
12        path = "/user-creation/v1/database",
13        name = "ensureDatabaseUserExists"
14    )]
15    fn ensure_database_user_exists(
16        &self,
17        #[auth]
18        auth_: conjure_object::BearerToken,
19    ) -> Result<(), conjure_http::private::Error>;
20}
21/// Internal service responsible for handling creation of new users.
22#[conjure_http::conjure_endpoints(
23    name = "InternalUserCreationService",
24    use_legacy_error_serialization
25)]
26pub trait AsyncInternalUserCreationService {
27    /// Ensures that the user corresponding to the auth header provided exists in the database.
28    /// Will do nothing if the user already exists.
29    #[endpoint(
30        method = PUT,
31        path = "/user-creation/v1/database",
32        name = "ensureDatabaseUserExists"
33    )]
34    async fn ensure_database_user_exists(
35        &self,
36        #[auth]
37        auth_: conjure_object::BearerToken,
38    ) -> Result<(), conjure_http::private::Error>;
39}
40/// Internal service responsible for handling creation of new users.
41#[conjure_http::conjure_endpoints(
42    name = "InternalUserCreationService",
43    use_legacy_error_serialization,
44    local
45)]
46pub trait LocalAsyncInternalUserCreationService {
47    /// Ensures that the user corresponding to the auth header provided exists in the database.
48    /// Will do nothing if the user already exists.
49    #[endpoint(
50        method = PUT,
51        path = "/user-creation/v1/database",
52        name = "ensureDatabaseUserExists"
53    )]
54    async fn ensure_database_user_exists(
55        &self,
56        #[auth]
57        auth_: conjure_object::BearerToken,
58    ) -> Result<(), conjure_http::private::Error>;
59}