-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Registration workflow make it work (#63)
Registration workflow make it work
- Loading branch information
1 parent
b33a428
commit 03a7841
Showing
87 changed files
with
2,990 additions
and
2,202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,12 @@ | ||
{ | ||
"name": "MetaSecret", | ||
|
||
"build": { | ||
"dockerfile": "Dockerfile", | ||
"context": ".." | ||
}, | ||
|
||
"workspaceFolder": "/meta-secret", | ||
"workspaceMount": "source=${localWorkspaceFolder},target=/meta-secret,type=bind,consistency=cached", | ||
|
||
"workspaceMount": "source=${localWorkspaceFolder},target=/meta-secret,type=bind", | ||
"features": { | ||
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {} | ||
} | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
#[cfg(test)] | ||
pub mod fixture { | ||
use crate::meta_tests::fixture_util::fixture::states::{BaseState, EmptyState, ExtendedState}; | ||
use crate::node::app::meta_app::meta_client_service::fixture::MetaClientServiceFixture; | ||
use crate::node::common::model::device::device_creds::fixture::DeviceCredentialsFixture; | ||
use crate::node::common::model::user::user_creds::fixture::UserCredentialsFixture; | ||
use crate::node::db::objects::global_index::fixture::ServerPersistentGlobalIndexFixture; | ||
use crate::node::db::objects::persistent_object::fixture::PersistentObjectFixture; | ||
use crate::node::db::repo::persistent_credentials::fixture::PersistentCredentialsFixture; | ||
use crate::node::server::server_app::fixture::{ServerAppFixture, ServerDataTransferFixture}; | ||
|
||
pub struct FixtureRegistry<S> { | ||
pub state: S, | ||
} | ||
|
||
impl FixtureRegistry<BaseState> { | ||
pub fn empty() -> FixtureRegistry<EmptyState> { | ||
let p_obj = PersistentObjectFixture::generate(); | ||
let device_creds = DeviceCredentialsFixture::generate(); | ||
let user_creds = UserCredentialsFixture::from(&device_creds); | ||
|
||
FixtureRegistry { state: EmptyState { p_obj, device_creds, user_creds } } | ||
} | ||
|
||
pub async fn base() -> anyhow::Result<FixtureRegistry<BaseState>> { | ||
let empty = FixtureRegistry::empty(); | ||
let p_creds = PersistentCredentialsFixture::init(&empty.state).await?; | ||
let server_p_gi = ServerPersistentGlobalIndexFixture::from(&empty); | ||
|
||
let base = BaseState { | ||
empty: empty.state, | ||
p_creds, | ||
server_p_gi, | ||
server_dt: ServerDataTransferFixture::generate() | ||
}; | ||
|
||
Ok(FixtureRegistry { state: base }) | ||
} | ||
|
||
//SyncGatewayFixture | ||
pub async fn extended() -> anyhow::Result<FixtureRegistry<ExtendedState>> { | ||
let base = FixtureRegistry::base().await?; | ||
|
||
let server_app = ServerAppFixture::try_from(&base)?; | ||
let meta_client_service = MetaClientServiceFixture::from(&base); | ||
|
||
let state = ExtendedState { base: base.state, server_app, meta_client_service }; | ||
Ok(FixtureRegistry { state }) | ||
} | ||
} | ||
|
||
pub mod states { | ||
use crate::node::app::meta_app::meta_client_service::fixture::MetaClientServiceFixture; | ||
use crate::node::common::model::device::device_creds::fixture::DeviceCredentialsFixture; | ||
use crate::node::common::model::user::user_creds::fixture::UserCredentialsFixture; | ||
use crate::node::db::objects::global_index::fixture::ServerPersistentGlobalIndexFixture; | ||
use crate::node::db::objects::persistent_object::fixture::PersistentObjectFixture; | ||
use crate::node::db::repo::persistent_credentials::fixture::PersistentCredentialsFixture; | ||
use crate::node::server::server_app::fixture::{ServerAppFixture, ServerDataTransferFixture}; | ||
|
||
pub enum Fixture { | ||
Empty(EmptyState), | ||
Base(BaseState), | ||
Extended(ExtendedState), | ||
} | ||
|
||
pub struct EmptyState { | ||
pub device_creds: DeviceCredentialsFixture, | ||
pub user_creds: UserCredentialsFixture, | ||
|
||
pub p_obj: PersistentObjectFixture, | ||
} | ||
|
||
pub struct BaseState { | ||
pub empty: EmptyState, | ||
|
||
pub p_creds: PersistentCredentialsFixture, | ||
pub server_p_gi: ServerPersistentGlobalIndexFixture, | ||
|
||
pub server_dt: ServerDataTransferFixture, | ||
} | ||
|
||
pub struct ExtendedState { | ||
pub base: BaseState, | ||
pub server_app: ServerAppFixture, | ||
pub meta_client_service: MetaClientServiceFixture, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
pub mod action; | ||
pub mod fixture; | ||
use tracing::Level; | ||
|
||
pub mod spec; | ||
pub mod fixture_util; | ||
|
||
pub fn setup_tracing() -> anyhow::Result<()> { | ||
tracing_subscriber::fmt() | ||
.with_max_level(Level::DEBUG) | ||
.without_time() | ||
.compact() | ||
.pretty() | ||
.init(); | ||
Ok(()) | ||
} |
Oops, something went wrong.