Compare commits
5 Commits
4deb1a5536
...
20251028
| Author | SHA1 | Date | |
|---|---|---|---|
| a128e4a597 | |||
| 96f3773375 | |||
| 5db16c2355 | |||
| e93e3f4d9c | |||
| 5abe3bfbd5 |
49
.drone.yml
49
.drone.yml
@@ -4,10 +4,57 @@ type: docker
|
||||
name: default
|
||||
|
||||
steps:
|
||||
- name: cargo_check
|
||||
# Code quality
|
||||
- name: code_quality
|
||||
image: rust
|
||||
volumes:
|
||||
- name: rust_registry
|
||||
path: /usr/local/cargo/registry
|
||||
commands:
|
||||
- rustup component add clippy
|
||||
- cargo clippy -- -D warnings
|
||||
- cargo test
|
||||
|
||||
# Build source code
|
||||
- name: compile
|
||||
image: rust
|
||||
depends_on:
|
||||
- code_quality
|
||||
when:
|
||||
event:
|
||||
- tag
|
||||
volumes:
|
||||
- name: rust_registry
|
||||
path: /usr/local/cargo/registry
|
||||
- name: releases
|
||||
path: /tmp/releases
|
||||
commands:
|
||||
- cargo build --release
|
||||
- ls -lah target/release/basic-oidc
|
||||
- cp target/release/basic-oidc /tmp/releases
|
||||
|
||||
# Auto-release to Gitea
|
||||
- name: gitea_release
|
||||
image: plugins/gitea-release
|
||||
depends_on:
|
||||
- compile
|
||||
when:
|
||||
event:
|
||||
- tag
|
||||
volumes:
|
||||
- name: releases
|
||||
path: /tmp/releases
|
||||
environment:
|
||||
PLUGIN_API_KEY:
|
||||
from_secret: GITEA_API_KEY # needs permission write:repository
|
||||
settings:
|
||||
base_url: https://gitea.communiquons.org
|
||||
files:
|
||||
- /tmp/releases/basic-oidc
|
||||
checksum: sha512
|
||||
|
||||
volumes:
|
||||
- name: rust_registry
|
||||
temp: { }
|
||||
- name: releases
|
||||
temp: {}
|
||||
39
Cargo.lock
generated
39
Cargo.lock
generated
@@ -568,9 +568,9 @@ checksum = "89e25b6adfb930f02d1981565a6e5d9c547ac15a96606256d3b59040e5cd4ca3"
|
||||
|
||||
[[package]]
|
||||
name = "base64urlsafedata"
|
||||
version = "0.5.2"
|
||||
version = "0.5.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e5913e643e4dfb43d5908e9e6f1386f8e0dfde086ecef124a6450c6195d89160"
|
||||
checksum = "215ee31f8a88f588c349ce2d20108b2ed96089b96b9c2b03775dc35dd72938e8"
|
||||
dependencies = [
|
||||
"base64 0.21.7",
|
||||
"pastey",
|
||||
@@ -595,7 +595,6 @@ dependencies = [
|
||||
"clap",
|
||||
"digest",
|
||||
"env_logger",
|
||||
"futures-util",
|
||||
"include_dir",
|
||||
"jwt-simple",
|
||||
"lazy-regex",
|
||||
@@ -943,6 +942,12 @@ version = "0.8.21"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
|
||||
|
||||
[[package]]
|
||||
name = "crunchy"
|
||||
version = "0.2.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5"
|
||||
|
||||
[[package]]
|
||||
name = "crypto-bigint"
|
||||
version = "0.5.5"
|
||||
@@ -1393,9 +1398,13 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "half"
|
||||
version = "1.8.3"
|
||||
version = "2.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403"
|
||||
checksum = "459196ed295495a68f7d7fe1d84f6c4b7ff0e21fe3017b2f283c6fac3ad803c9"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"crunchy",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hashbrown"
|
||||
@@ -2804,9 +2813,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "serde_cbor_2"
|
||||
version = "0.12.0-dev"
|
||||
version = "0.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b46d75f449e01f1eddbe9b00f432d616fbbd899b809c837d0fbc380496a0dd55"
|
||||
checksum = "34aec2709de9078e077090abd848e967abab63c9fb3fdb5d4799ad359d8d482c"
|
||||
dependencies = [
|
||||
"half",
|
||||
"serde",
|
||||
@@ -3507,9 +3516,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "webauthn-attestation-ca"
|
||||
version = "0.5.2"
|
||||
version = "0.5.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "384e43534efe4e8f56c4eb1615a27e24d2ff29281385c843cf9f16ac1077dbdc"
|
||||
checksum = "f77a2892ec44032e6c48dad9aad1b05fada09c346ada11d8d32db119b4b4f205"
|
||||
dependencies = [
|
||||
"base64urlsafedata",
|
||||
"openssl",
|
||||
@@ -3521,9 +3530,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "webauthn-rs"
|
||||
version = "0.5.2"
|
||||
version = "0.5.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ed1f861a94557baeb0cf711e3e55d623c46b68f4aab7aa932562f785b8b5f1ab"
|
||||
checksum = "eb7c3a2f9c8bddd524e47bbd427bcf3a28aa074de55d74470b42a91a41937b8e"
|
||||
dependencies = [
|
||||
"base64urlsafedata",
|
||||
"serde",
|
||||
@@ -3535,9 +3544,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "webauthn-rs-core"
|
||||
version = "0.5.2"
|
||||
version = "0.5.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "269c210cd5f183aaca860bb5733187d1dd110ebed54640f8fc1aca31a04aa4dc"
|
||||
checksum = "19f1d80f3146382529fe70a3ab5d0feb2413a015204ed7843f9377cd39357fc4"
|
||||
dependencies = [
|
||||
"base64 0.21.7",
|
||||
"base64urlsafedata",
|
||||
@@ -3562,9 +3571,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "webauthn-rs-proto"
|
||||
version = "0.5.2"
|
||||
version = "0.5.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "144dbee9abb4bfad78fd283a2613f0312a0ed5955051b7864cfc98679112ae60"
|
||||
checksum = "9e786894f89facb9aaf1c5f6559670236723c98382e045521c76f3d5ca5047bd"
|
||||
dependencies = [
|
||||
"base64 0.21.7",
|
||||
"base64urlsafedata",
|
||||
|
||||
@@ -22,7 +22,6 @@ bcrypt = "0.17.1"
|
||||
uuid = { version = "1.18.1", features = ["v4"] }
|
||||
mime_guess = "2.0.5"
|
||||
askama = "0.14.0"
|
||||
futures-util = "0.3.31"
|
||||
urlencoding = "2.1.3"
|
||||
rand = "0.9.2"
|
||||
base64 = "0.22.1"
|
||||
@@ -33,7 +32,7 @@ lazy-regex = "3.4.1"
|
||||
totp_rfc6238 = "0.6.1"
|
||||
base32 = "0.5.1"
|
||||
qrcode-generator = "5.0.0"
|
||||
webauthn-rs = { version = "0.5.2", features = ["danger-allow-state-serialisation"] }
|
||||
webauthn-rs = { version = "0.5.3", features = ["danger-allow-state-serialisation"] }
|
||||
url = "2.5.7"
|
||||
light-openid = { version = "1.0.4", features = ["crypto-wrapper"] }
|
||||
bincode = "2.0.1"
|
||||
|
||||
@@ -18,6 +18,14 @@ pub struct AppConfig {
|
||||
#[clap(short, long, env)]
|
||||
pub storage_path: String,
|
||||
|
||||
/// Overwrite clients list file path, if the file is not to be found in storage path
|
||||
#[clap(long, env)]
|
||||
pub clients_list_file_path: Option<String>,
|
||||
|
||||
/// Overwrite providers list file path, if the file is not to be found in storage path
|
||||
#[clap(long, env)]
|
||||
pub providers_list_file_path: Option<String>,
|
||||
|
||||
/// App token token
|
||||
#[clap(short, long, env, default_value = "")]
|
||||
pub token_key: String,
|
||||
@@ -32,7 +40,7 @@ pub struct AppConfig {
|
||||
|
||||
/// IP location service API
|
||||
///
|
||||
/// Up instance of IP location service : https://gitlab.com/pierre42100/iplocationserver
|
||||
/// Operating instance of IP location service : https://gitlab.com/pierre42100/iplocationserver
|
||||
///
|
||||
/// Example: "https://api.geoip.rs"
|
||||
#[arg(long, short, env)]
|
||||
@@ -71,11 +79,17 @@ impl AppConfig {
|
||||
}
|
||||
|
||||
pub fn clients_file(&self) -> PathBuf {
|
||||
self.storage_path().join(CLIENTS_LIST_FILE)
|
||||
match &self.clients_list_file_path {
|
||||
None => self.storage_path().join(CLIENTS_LIST_FILE),
|
||||
Some(p) => Path::new(p).to_path_buf(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn providers_file(&self) -> PathBuf {
|
||||
self.storage_path().join(PROVIDERS_LIST_FILE)
|
||||
match &self.providers_list_file_path {
|
||||
None => self.storage_path().join(PROVIDERS_LIST_FILE),
|
||||
Some(p) => Path::new(p).to_path_buf(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn full_url(&self, uri: &str) -> String {
|
||||
|
||||
@@ -125,7 +125,7 @@ impl Client {
|
||||
|
||||
pub type ClientManager = EntityManager<Client>;
|
||||
|
||||
impl EntityManager<Client> {
|
||||
impl ClientManager {
|
||||
pub fn find_by_id(&self, u: &ClientID) -> Option<Client> {
|
||||
for entry in self.iter() {
|
||||
if entry.id.eq(u) {
|
||||
|
||||
Reference in New Issue
Block a user