summaryrefslogtreecommitdiffstats
path: root/rust/fatcat-api-spec/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rust/fatcat-api-spec/src/lib.rs')
-rw-r--r--rust/fatcat-api-spec/src/lib.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/rust/fatcat-api-spec/src/lib.rs b/rust/fatcat-api-spec/src/lib.rs
index c6126c9c..c89dc90c 100644
--- a/rust/fatcat-api-spec/src/lib.rs
+++ b/rust/fatcat-api-spec/src/lib.rs
@@ -349,6 +349,24 @@ pub enum UpdateCreatorResponse {
}
#[derive(Debug, PartialEq)]
+pub enum AuthOidcResponse {
+ /// Found
+ Found(models::AuthOidcResult),
+ /// Created
+ Created(models::AuthOidcResult),
+ /// Bad Request
+ BadRequest(models::ErrorResponse),
+ /// Not Authorized
+ NotAuthorized { body: models::ErrorResponse, www_authenticate: String },
+ /// Forbidden
+ Forbidden(models::ErrorResponse),
+ /// Conflict
+ Conflict(models::ErrorResponse),
+ /// Generic Error
+ GenericError(models::ErrorResponse),
+}
+
+#[derive(Debug, PartialEq)]
pub enum GetEditorResponse {
/// Found
Found(models::Editor),
@@ -1281,6 +1299,8 @@ pub trait Api {
fn update_creator(&self, ident: String, entity: models::CreatorEntity, editgroup_id: Option<String>, context: &Context) -> Box<Future<Item = UpdateCreatorResponse, Error = ApiError> + Send>;
+ fn auth_oidc(&self, oidc_params: models::AuthOidc, context: &Context) -> Box<Future<Item = AuthOidcResponse, Error = ApiError> + Send>;
+
fn get_editor(&self, editor_id: String, context: &Context) -> Box<Future<Item = GetEditorResponse, Error = ApiError> + Send>;
fn get_editor_changelog(&self, editor_id: String, context: &Context) -> Box<Future<Item = GetEditorChangelogResponse, Error = ApiError> + Send>;
@@ -1527,6 +1547,8 @@ pub trait ApiNoContext {
fn update_creator(&self, ident: String, entity: models::CreatorEntity, editgroup_id: Option<String>) -> Box<Future<Item = UpdateCreatorResponse, Error = ApiError> + Send>;
+ fn auth_oidc(&self, oidc_params: models::AuthOidc) -> Box<Future<Item = AuthOidcResponse, Error = ApiError> + Send>;
+
fn get_editor(&self, editor_id: String) -> Box<Future<Item = GetEditorResponse, Error = ApiError> + Send>;
fn get_editor_changelog(&self, editor_id: String) -> Box<Future<Item = GetEditorChangelogResponse, Error = ApiError> + Send>;
@@ -1810,6 +1832,10 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> {
self.api().update_creator(ident, entity, editgroup_id, &self.context())
}
+ fn auth_oidc(&self, oidc_params: models::AuthOidc) -> Box<Future<Item = AuthOidcResponse, Error = ApiError> + Send> {
+ self.api().auth_oidc(oidc_params, &self.context())
+ }
+
fn get_editor(&self, editor_id: String) -> Box<Future<Item = GetEditorResponse, Error = ApiError> + Send> {
self.api().get_editor(editor_id, &self.context())
}