From 36535deba96b19cf0af3fe56763f982fc6ae3fc0 Mon Sep 17 00:00:00 2001 From: Vika Date: Fri, 15 Jul 2022 00:33:49 +0300 Subject: Add enum for requests that the authorization endpoint may encounter Really, it should be `Either` but either serde or axum got iffy about me deserializing it from a form. Not sure which one. --- kittybox-rs/indieauth/src/lib.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/kittybox-rs/indieauth/src/lib.rs b/kittybox-rs/indieauth/src/lib.rs index 3575132..9408eb6 100644 --- a/kittybox-rs/indieauth/src/lib.rs +++ b/kittybox-rs/indieauth/src/lib.rs @@ -156,6 +156,13 @@ pub enum GrantResponse { } } +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RequestMaybeAuthorizationEndpoint { + Authorization(AuthorizationRequest), + Grant(GrantRequest) +} + #[derive(Debug, Serialize, Deserialize)] pub struct TokenIntrospectionRequest { pub token: String @@ -250,7 +257,7 @@ pub struct TokenRevocationRequest { pub token: String } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Debug, Clone, Copy, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] #[serde(tag = "error")] pub enum IndieAuthError { -- cgit 1.4.1