Compare commits

..

3 Commits

Author SHA1 Message Date
a128e4a597 Auto-publish releases to Gitea
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2025-10-28 10:06:55 +01:00
96f3773375 Remove useless dependency 2025-10-28 09:59:07 +01:00
5db16c2355 Make clients list file configurable 2025-10-28 09:56:52 +01:00
5 changed files with 66 additions and 7 deletions

View File

@@ -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: {}

1
Cargo.lock generated
View File

@@ -595,7 +595,6 @@ dependencies = [
"clap",
"digest",
"env_logger",
"futures-util",
"include_dir",
"jwt-simple",
"lazy-regex",

View File

@@ -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"

View File

@@ -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 {

View File

@@ -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) {