mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-13 14:42:30 +00:00
Move oidc to dedicated crate
This commit is contained in:
17
Cargo.lock
generated
17
Cargo.lock
generated
@@ -3037,6 +3037,7 @@ dependencies = [
|
||||
"rustical_dav",
|
||||
"rustical_dav_push",
|
||||
"rustical_frontend",
|
||||
"rustical_oidc",
|
||||
"rustical_store",
|
||||
"rustical_store_sqlite",
|
||||
"serde",
|
||||
@@ -3157,10 +3158,9 @@ dependencies = [
|
||||
"futures-core",
|
||||
"hex",
|
||||
"mime_guess",
|
||||
"openidconnect",
|
||||
"rand 0.8.5",
|
||||
"reqwest",
|
||||
"rust-embed",
|
||||
"rustical_oidc",
|
||||
"rustical_store",
|
||||
"serde",
|
||||
"thiserror 2.0.12",
|
||||
@@ -3170,6 +3170,19 @@ dependencies = [
|
||||
"uuid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustical_oidc"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"actix-session",
|
||||
"actix-web",
|
||||
"openidconnect",
|
||||
"reqwest",
|
||||
"rustical_store",
|
||||
"serde",
|
||||
"thiserror 2.0.12",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustical_store"
|
||||
version = "0.1.0"
|
||||
|
||||
@@ -95,6 +95,7 @@ rustical_caldav = { path = "./crates/caldav/" }
|
||||
rustical_carddav = { path = "./crates/carddav/" }
|
||||
rustical_frontend = { path = "./crates/frontend/" }
|
||||
rustical_xml = { path = "./crates/xml/" }
|
||||
rustical_oidc = { path = "./crates/oidc/" }
|
||||
chrono-tz = "0.10"
|
||||
chrono-humanize = "0.2"
|
||||
rand = "0.8"
|
||||
@@ -157,4 +158,5 @@ password-hash.workspace = true
|
||||
reqwest.workspace = true
|
||||
rustical_dav.workspace = true
|
||||
rustical_dav_push.workspace = true
|
||||
rustical_oidc.workspace = true
|
||||
quick-xml.workspace = true
|
||||
|
||||
@@ -7,7 +7,6 @@ repository.workspace = true
|
||||
publish = false
|
||||
|
||||
[dependencies]
|
||||
openidconnect.workspace = true
|
||||
askama.workspace = true
|
||||
askama_web.workspace = true
|
||||
actix-session = { workspace = true }
|
||||
@@ -20,10 +19,10 @@ rust-embed.workspace = true
|
||||
futures-core.workspace = true
|
||||
hex.workspace = true
|
||||
mime_guess.workspace = true
|
||||
reqwest.workspace = true
|
||||
rand.workspace = true
|
||||
chrono.workspace = true
|
||||
chrono-humanize.workspace = true
|
||||
uuid.workspace = true
|
||||
url.workspace = true
|
||||
tracing.workspace = true
|
||||
rustical_oidc.workspace = true
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
pub use crate::oidc::OidcConfig;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
fn default_true() -> bool {
|
||||
|
||||
@@ -14,13 +14,13 @@ use actix_web::{
|
||||
use askama::Template;
|
||||
use askama_web::WebTemplate;
|
||||
use assets::{Assets, EmbedService};
|
||||
use oidc::configure_oidc;
|
||||
use rand::{Rng, distributions::Alphanumeric};
|
||||
use routes::{
|
||||
addressbook::{route_addressbook, route_addressbook_restore},
|
||||
calendar::{route_calendar, route_calendar_restore},
|
||||
login::{route_get_login, route_post_login, route_post_logout},
|
||||
};
|
||||
use rustical_oidc::{OidcConfig, configure_oidc};
|
||||
use rustical_store::{
|
||||
Addressbook, AddressbookStore, Calendar, CalendarStore,
|
||||
auth::{AuthenticationMiddleware, AuthenticationProvider, User},
|
||||
@@ -31,13 +31,12 @@ use std::sync::Arc;
|
||||
mod assets;
|
||||
mod config;
|
||||
pub mod nextcloud_login;
|
||||
mod oidc;
|
||||
mod routes;
|
||||
|
||||
pub const ROUTE_NAME_HOME: &str = "frontend_home";
|
||||
pub const ROUTE_USER_NAMED: &str = "frontend_user_named";
|
||||
|
||||
pub use config::{FrontendConfig, OidcConfig};
|
||||
pub use config::FrontendConfig;
|
||||
|
||||
pub fn generate_app_token() -> String {
|
||||
rand::thread_rng()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::{FrontendConfig, OidcConfig, oidc::ROUTE_NAME_OIDC_LOGIN};
|
||||
use crate::{FrontendConfig, OidcConfig};
|
||||
use actix_session::Session;
|
||||
use actix_web::{
|
||||
HttpRequest, HttpResponse, Responder,
|
||||
@@ -7,6 +7,7 @@ use actix_web::{
|
||||
};
|
||||
use askama::Template;
|
||||
use askama_web::WebTemplate;
|
||||
use rustical_oidc::ROUTE_NAME_OIDC_LOGIN;
|
||||
use rustical_store::auth::AuthenticationProvider;
|
||||
use serde::Deserialize;
|
||||
use tracing::instrument;
|
||||
|
||||
16
crates/oidc/Cargo.toml
Normal file
16
crates/oidc/Cargo.toml
Normal file
@@ -0,0 +1,16 @@
|
||||
[package]
|
||||
name = "rustical_oidc"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
description.workspace = true
|
||||
repository.workspace = true
|
||||
|
||||
[dependencies]
|
||||
openidconnect.workspace = true
|
||||
serde = { workspace = true }
|
||||
reqwest.workspace = true
|
||||
# TODO: Remove this dependency
|
||||
rustical_store = { workspace = true }
|
||||
actix-web = { workspace = true }
|
||||
actix-session = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
@@ -5,7 +5,8 @@ use actix_web::{App, web};
|
||||
use rustical_caldav::caldav_service;
|
||||
use rustical_carddav::carddav_service;
|
||||
use rustical_frontend::nextcloud_login::{NextcloudFlows, configure_nextcloud_login};
|
||||
use rustical_frontend::{FrontendConfig, OidcConfig, configure_frontend};
|
||||
use rustical_frontend::{FrontendConfig, configure_frontend};
|
||||
use rustical_oidc::OidcConfig;
|
||||
use rustical_store::auth::AuthenticationProvider;
|
||||
use rustical_store::{AddressbookStore, CalendarStore, SubscriptionStore};
|
||||
use std::sync::Arc;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
use rustical_frontend::{FrontendConfig, OidcConfig};
|
||||
use rustical_frontend::FrontendConfig;
|
||||
use rustical_oidc::OidcConfig;
|
||||
use rustical_store::auth::TomlUserStoreConfig;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user