mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-13 22:52:22 +00:00
Move nextcloud_login to frontend crate
This commit is contained in:
22
Cargo.lock
generated
22
Cargo.lock
generated
@@ -3012,7 +3012,6 @@ dependencies = [
|
|||||||
"rustical_carddav",
|
"rustical_carddav",
|
||||||
"rustical_dav",
|
"rustical_dav",
|
||||||
"rustical_frontend",
|
"rustical_frontend",
|
||||||
"rustical_nextcloud_login",
|
|
||||||
"rustical_store",
|
"rustical_store",
|
||||||
"rustical_store_sqlite",
|
"rustical_store_sqlite",
|
||||||
"serde",
|
"serde",
|
||||||
@@ -3105,30 +3104,13 @@ dependencies = [
|
|||||||
"actix-web",
|
"actix-web",
|
||||||
"askama",
|
"askama",
|
||||||
"askama_web",
|
"askama_web",
|
||||||
"futures-core",
|
|
||||||
"hex",
|
|
||||||
"mime_guess",
|
|
||||||
"openidconnect",
|
|
||||||
"reqwest",
|
|
||||||
"rust-embed",
|
|
||||||
"rustical_store",
|
|
||||||
"serde",
|
|
||||||
"thiserror 2.0.12",
|
|
||||||
"tokio",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "rustical_nextcloud_login"
|
|
||||||
version = "0.1.0"
|
|
||||||
dependencies = [
|
|
||||||
"actix-session",
|
|
||||||
"actix-web",
|
|
||||||
"askama",
|
|
||||||
"chrono",
|
"chrono",
|
||||||
"futures-core",
|
"futures-core",
|
||||||
"hex",
|
"hex",
|
||||||
"mime_guess",
|
"mime_guess",
|
||||||
|
"openidconnect",
|
||||||
"rand 0.8.5",
|
"rand 0.8.5",
|
||||||
|
"reqwest",
|
||||||
"rust-embed",
|
"rust-embed",
|
||||||
"rustical_store",
|
"rustical_store",
|
||||||
"serde",
|
"serde",
|
||||||
|
|||||||
@@ -94,7 +94,6 @@ rustical_caldav = { path = "./crates/caldav/" }
|
|||||||
rustical_carddav = { path = "./crates/carddav/" }
|
rustical_carddav = { path = "./crates/carddav/" }
|
||||||
rustical_frontend = { path = "./crates/frontend/" }
|
rustical_frontend = { path = "./crates/frontend/" }
|
||||||
rustical_xml = { path = "./crates/xml/" }
|
rustical_xml = { path = "./crates/xml/" }
|
||||||
rustical_nextcloud_login = { path = "./crates/nextcloud_login/" }
|
|
||||||
chrono-tz = "0.10"
|
chrono-tz = "0.10"
|
||||||
rand = "0.8"
|
rand = "0.8"
|
||||||
argon2 = "0.5"
|
argon2 = "0.5"
|
||||||
@@ -152,5 +151,4 @@ pbkdf2.workspace = true
|
|||||||
password-hash.workspace = true
|
password-hash.workspace = true
|
||||||
reqwest.workspace = true
|
reqwest.workspace = true
|
||||||
rustical_dav.workspace = true
|
rustical_dav.workspace = true
|
||||||
rustical_nextcloud_login.workspace = true
|
|
||||||
quick-xml.workspace = true
|
quick-xml.workspace = true
|
||||||
|
|||||||
@@ -21,3 +21,6 @@ futures-core.workspace = true
|
|||||||
hex.workspace = true
|
hex.workspace = true
|
||||||
mime_guess.workspace = true
|
mime_guess.workspace = true
|
||||||
reqwest.workspace = true
|
reqwest.workspace = true
|
||||||
|
rand.workspace = true
|
||||||
|
chrono.workspace = true
|
||||||
|
uuid.workspace = true
|
||||||
|
|||||||
@@ -17,6 +17,6 @@
|
|||||||
{% if let Some(OidcProviderData {name, redirect_url}) = oidc_data %}
|
{% if let Some(OidcProviderData {name, redirect_url}) = oidc_data %}
|
||||||
<a href="{{ redirect_url }}">Login with {{ name }}</a>
|
<a href="{{ redirect_url }}">Login with {{ name }}</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% endblock %}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ use std::sync::Arc;
|
|||||||
|
|
||||||
mod assets;
|
mod assets;
|
||||||
mod config;
|
mod config;
|
||||||
|
pub mod nextcloud_login;
|
||||||
mod oidc;
|
mod oidc;
|
||||||
mod routes;
|
mod routes;
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
use actix_web::{
|
use actix_web::{
|
||||||
|
HttpRequest, HttpResponse, Responder,
|
||||||
http::header::{self},
|
http::header::{self},
|
||||||
web::{self, Data, Form, Html, Json, Path, ServiceConfig},
|
web::{self, Data, Form, Html, Json, Path, ServiceConfig},
|
||||||
HttpRequest, HttpResponse, Responder,
|
|
||||||
};
|
};
|
||||||
use askama::Template;
|
use askama::Template;
|
||||||
use chrono::{DateTime, Duration, Utc};
|
use chrono::{DateTime, Duration, Utc};
|
||||||
use rand::{distributions::Alphanumeric, Rng};
|
use rand::{Rng, distributions::Alphanumeric};
|
||||||
use rustical_store::auth::{AuthenticationMiddleware, AuthenticationProvider, User};
|
use rustical_store::auth::{AuthenticationMiddleware, AuthenticationProvider, User};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::{collections::HashMap, sync::Arc};
|
use std::{collections::HashMap, sync::Arc};
|
||||||
@@ -141,7 +141,7 @@ fn generate_app_token() -> String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Template)]
|
#[derive(Template)]
|
||||||
#[template(path = "pages/nextcloud_login_form.html")]
|
#[template(path = "pages/nextcloud_login/form.html")]
|
||||||
struct NextcloudLoginPage {
|
struct NextcloudLoginPage {
|
||||||
username: String,
|
username: String,
|
||||||
app_name: String,
|
app_name: String,
|
||||||
@@ -176,7 +176,7 @@ struct NextcloudAuthorizeForm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Template)]
|
#[derive(Template)]
|
||||||
#[template(path = "pages/nextcloud_login_success.html")]
|
#[template(path = "pages/nextcloud_login/success.html")]
|
||||||
struct NextcloudLoginSuccessPage {
|
struct NextcloudLoginSuccessPage {
|
||||||
app_name: String,
|
app_name: String,
|
||||||
}
|
}
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
[package]
|
|
||||||
name = "rustical_nextcloud_login"
|
|
||||||
version.workspace = true
|
|
||||||
edition.workspace = true
|
|
||||||
description.workspace = true
|
|
||||||
repository.workspace = true
|
|
||||||
publish = false
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
askama.workspace = true
|
|
||||||
actix-session = { workspace = true }
|
|
||||||
serde = { workspace = true }
|
|
||||||
thiserror = { workspace = true }
|
|
||||||
tokio = { workspace = true }
|
|
||||||
actix-web = { workspace = true }
|
|
||||||
rustical_store = { workspace = true }
|
|
||||||
rust-embed.workspace = true
|
|
||||||
futures-core.workspace = true
|
|
||||||
hex.workspace = true
|
|
||||||
mime_guess.workspace = true
|
|
||||||
rand.workspace = true
|
|
||||||
uuid.workspace = true
|
|
||||||
chrono.workspace = true
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
[general]
|
|
||||||
dirs = ["public/templates"]
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<title>{% block title %}RustiCal{% endblock %}</title>
|
|
||||||
{% block imports %}{% endblock %}
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<div id="app">
|
|
||||||
{% block content %}<p>Placeholder</p>{% endblock %}
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
use super::{AuthenticationProvider, User};
|
use super::AuthenticationProvider;
|
||||||
use actix_session::Session;
|
use actix_session::Session;
|
||||||
use actix_web::{
|
use actix_web::{
|
||||||
FromRequest, HttpMessage,
|
FromRequest, HttpMessage,
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
use actix_web::body::MessageBody;
|
use actix_web::body::MessageBody;
|
||||||
use actix_web::dev::{ServiceFactory, ServiceRequest, ServiceResponse};
|
use actix_web::dev::{ServiceFactory, ServiceRequest, ServiceResponse};
|
||||||
use actix_web::middleware::NormalizePath;
|
use actix_web::middleware::NormalizePath;
|
||||||
use actix_web::{web, App};
|
use actix_web::{App, web};
|
||||||
use rustical_caldav::caldav_service;
|
use rustical_caldav::caldav_service;
|
||||||
use rustical_carddav::carddav_service;
|
use rustical_carddav::carddav_service;
|
||||||
use rustical_frontend::{configure_frontend, FrontendConfig};
|
use rustical_frontend::nextcloud_login::{NextcloudFlows, configure_nextcloud_login};
|
||||||
use rustical_nextcloud_login::{configure_nextcloud_login, NextcloudFlows};
|
use rustical_frontend::{FrontendConfig, configure_frontend};
|
||||||
use rustical_store::auth::AuthenticationProvider;
|
use rustical_store::auth::AuthenticationProvider;
|
||||||
use rustical_store::{AddressbookStore, CalendarStore, SubscriptionStore};
|
use rustical_store::{AddressbookStore, CalendarStore, SubscriptionStore};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ use config::{DataStoreConfig, SqliteDataStoreConfig};
|
|||||||
use figment::Figment;
|
use figment::Figment;
|
||||||
use figment::providers::{Env, Format, Toml};
|
use figment::providers::{Env, Format, Toml};
|
||||||
use rustical_dav::push::push_notifier;
|
use rustical_dav::push::push_notifier;
|
||||||
use rustical_nextcloud_login::NextcloudFlows;
|
use rustical_frontend::nextcloud_login::NextcloudFlows;
|
||||||
use rustical_store::auth::TomlPrincipalStore;
|
use rustical_store::auth::TomlPrincipalStore;
|
||||||
use rustical_store::{AddressbookStore, CalendarStore, CollectionOperation, SubscriptionStore};
|
use rustical_store::{AddressbookStore, CalendarStore, CollectionOperation, SubscriptionStore};
|
||||||
use rustical_store_sqlite::addressbook_store::SqliteAddressbookStore;
|
use rustical_store_sqlite::addressbook_store::SqliteAddressbookStore;
|
||||||
@@ -131,7 +131,7 @@ mod tests {
|
|||||||
use anyhow::anyhow;
|
use anyhow::anyhow;
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use rustical_frontend::FrontendConfig;
|
use rustical_frontend::FrontendConfig;
|
||||||
use rustical_nextcloud_login::NextcloudFlows;
|
use rustical_frontend::nextcloud_login::NextcloudFlows;
|
||||||
use rustical_store::auth::AuthenticationProvider;
|
use rustical_store::auth::AuthenticationProvider;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user