Skip to content

Commit

Permalink
Export storage trait
Browse files Browse the repository at this point in the history
  • Loading branch information
augustuswm committed Feb 22, 2024
1 parent d13e79a commit e19446c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions v-api/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ use crate::{

static UNLIMITED: i64 = 9999999;

pub trait Storage:
pub trait VApiStorage:
ApiUserStore<ApiPermission>
+ ApiKeyStore<ApiPermission>
+ ApiUserProviderStore
Expand All @@ -75,7 +75,7 @@ pub trait Storage:
+ 'static
{
}
impl<T> Storage for T where
impl<T> VApiStorage for T where
T: ApiUserStore<ApiPermission>
+ ApiKeyStore<ApiPermission>
+ ApiUserProviderStore
Expand All @@ -95,7 +95,7 @@ impl<T> Storage for T where

pub struct VContext<T> {
public_url: String,
storage: Arc<dyn Storage>,
storage: Arc<dyn VApiStorage>,
unauthenticated_caller: ApiCaller,
registration_caller: ApiCaller,
jwt: JwtContext,
Expand Down Expand Up @@ -229,7 +229,7 @@ where
{
pub async fn new(
public_url: String,
storage: Arc<dyn Storage>,
storage: Arc<dyn VApiStorage>,
jwt: JwtConfig,
keys: Vec<AsymmetricKey>,
) -> Result<Self, AppError> {
Expand Down Expand Up @@ -287,7 +287,7 @@ where
}
}

pub fn set_storage(&mut self, storage: Arc<dyn Storage>) {
pub fn set_storage(&mut self, storage: Arc<dyn VApiStorage>) {
self.storage = storage;
}

Expand Down
2 changes: 1 addition & 1 deletion v-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub mod permissions;
mod secrets;
mod util;

pub use context::{ApiContext, SecretContext, VContext};
pub use context::{ApiContext, SecretContext, VContext, VApiStorage};
pub use util::response;

type ApiCaller = Caller<ApiPermission>;
Expand Down

0 comments on commit e19446c

Please sign in to comment.