diff options
| author | benj <benj@rse8.com> | 2022-12-21 16:23:12 -0800 |
|---|---|---|
| committer | benj <benj@rse8.com> | 2022-12-21 16:23:12 -0800 |
| commit | de6339da72af1d61ca5908b780977e2b037ce014 (patch) | |
| tree | 96add0e538cef4b6b5912492c28a3d5e9ed25cbe /crates/secd/tests/authn_integration.rs | |
| parent | a734a77520a3f9f0061e44c4fac6c42801730496 (diff) | |
| download | secdiam-de6339da72af1d61ca5908b780977e2b037ce014.tar secdiam-de6339da72af1d61ca5908b780977e2b037ce014.tar.gz secdiam-de6339da72af1d61ca5908b780977e2b037ce014.tar.bz2 secdiam-de6339da72af1d61ca5908b780977e2b037ce014.tar.lz secdiam-de6339da72af1d61ca5908b780977e2b037ce014.tar.xz secdiam-de6339da72af1d61ca5908b780977e2b037ce014.tar.zst secdiam-de6339da72af1d61ca5908b780977e2b037ce014.zip | |
some cleanup
Diffstat (limited to '')
| -rw-r--r-- | crates/secd/tests/authn_integration.rs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/crates/secd/tests/authn_integration.rs b/crates/secd/tests/authn_integration.rs new file mode 100644 index 0000000..d823d5a --- /dev/null +++ b/crates/secd/tests/authn_integration.rs @@ -0,0 +1,35 @@ +#[cfg(test)] +mod test { + use std::error::Error; + + use secd::{AuthEmail, AuthStore, Secd}; + + #[tokio::test] + async fn email_authentication_int() -> Result<(), Box<dyn Error>> { + let secd = Secd::init(AuthStore::Sqlite, None, AuthEmail::LocalStub, None, None).await?; + let v_id = secd.create_validation_request_email("b@g.com").await?; + + // TODO: in memory mailbox backed by sqlite which just throws them in temporarily... + // and then I can grab it? + + // Things to test + // 1. after exchanging the session, I cannot get it again + // 1. a validation can only be used once + // 1. a session can be used to retrieve identity information + assert_eq!(1, 2); + Ok(()) + } + + #[tokio::test] + async fn oauth_authentication_int() -> Result<(), Box<dyn Error>> { + let secd = Secd::init(AuthStore::Sqlite, None, AuthEmail::LocalStub, None, None).await?; + + // Things to test + // 1. after exchanging the session, I cannot get it again + // 1. a validation can only be used once + // 1. a session can be used to retrieve identity information + // 1. an oauth session links with an existing emails session + assert_eq!(1, 2); + Ok(()) + } +} |
