diff --git a/giterated-models/src/authenticated.rs b/giterated-models/src/authenticated.rs index 4a10a85..9989e3e 100644 --- a/giterated-models/src/authenticated.rs +++ b/giterated-models/src/authenticated.rs @@ -25,7 +25,7 @@ impl AsRef for UserAuthenticationToken { } #[derive(Clone, Debug, Hash, PartialEq, Eq, Serialize, Deserialize)] -pub struct InstanceSignature(Vec); +pub struct InstanceSignature(pub Vec); impl AsRef<[u8]> for InstanceSignature { fn as_ref(&self) -> &[u8] { diff --git a/giterated-protocol/src/lib.rs b/giterated-protocol/src/lib.rs index 2b3f8b7..bf27728 100644 --- a/giterated-protocol/src/lib.rs +++ b/giterated-protocol/src/lib.rs @@ -5,7 +5,10 @@ use std::fmt::Debug; use std::str::FromStr; use std::{fmt::Display, sync::Arc}; -use giterated_stack::models::{Error, GiteratedObject, GiteratedOperation, Instance, User}; +use giterated_stack::models::{ + Error, GiteratedObject, GiteratedOperation, Instance, InstanceSignature, User, + UserAuthenticationToken, +}; use rsa::pkcs1::DecodeRsaPrivateKey; use rsa::pkcs1v15::SigningKey; use rsa::sha2::Sha256; @@ -114,37 +117,6 @@ impl AuthenticationSourceProvider for InstanceAuthenticator { } } -#[repr(transparent)] -#[derive(Clone, Debug, Hash, PartialEq, Eq, Serialize, Deserialize)] -pub struct UserAuthenticationToken(String); - -impl From for UserAuthenticationToken { - fn from(value: String) -> Self { - Self(value) - } -} - -impl ToString for UserAuthenticationToken { - fn to_string(&self) -> String { - self.0.clone() - } -} - -impl AsRef for UserAuthenticationToken { - fn as_ref(&self) -> &str { - &self.0 - } -} - -#[derive(Clone, Debug, Hash, PartialEq, Eq, Serialize, Deserialize)] -pub struct InstanceSignature(Vec); - -impl AsRef<[u8]> for InstanceSignature { - fn as_ref(&self) -> &[u8] { - &self.0 - } -} - #[derive(Clone, Debug, Hash, PartialEq, Eq, Serialize, Deserialize)] pub enum AuthenticationSource { User { diff --git a/giterated-stack/src/lib.rs b/giterated-stack/src/lib.rs index 12041c9..2a9b493 100644 --- a/giterated-stack/src/lib.rs +++ b/giterated-stack/src/lib.rs @@ -16,6 +16,7 @@ pub mod update; // Temp pub use to figure out what's important pub mod models { pub use anyhow::Error; + pub use giterated_models::authenticated::*; pub use giterated_models::error::{IntoInternalError, OperationError}; pub use giterated_models::instance::Instance; pub use giterated_models::object::GiteratedObject;