Compare commits

..

1 Commits

Author SHA1 Message Date
b6c5a50148 feat: Default access policy one factor if no rules
All checks were successful
Build and deploy / build (push) Successful in 10m7s
2025-12-23 03:23:43 +01:00
2 changed files with 8 additions and 25 deletions

View File

@@ -6,23 +6,9 @@ group "default" {
} }
target "docker-metadata-action" {} target "docker-metadata-action" {}
target "cache" {
cache-from = [
{
type = "gha",
}
]
cache-to = [
{
type = "gha",
mode = "max"
}
]
}
target "authelia-controller" { target "authelia-controller" {
inherits = ["docker-metadata-action", "cache"] inherits = ["docker-metadata-action"]
context = "./" context = "./"
dockerfile = "Dockerfile" dockerfile = "Dockerfile"
tags = [for tag in target.docker-metadata-action.tags : "${TAG_BASE}:${tag}"] tags = [for tag in target.docker-metadata-action.tags : "${TAG_BASE}:${tag}"]
@@ -30,7 +16,6 @@ target "authelia-controller" {
} }
target "manifests" { target "manifests" {
inherits = ["cache"]
context = "./" context = "./"
dockerfile = "Dockerfile" dockerfile = "Dockerfile"
target = "manifests" target = "manifests"

View File

@@ -45,11 +45,11 @@ pub struct AccessControlRuleSpec {
#[derive(Serialize, Deserialize, Clone, Debug, Hash)] #[derive(Serialize, Deserialize, Clone, Debug, Hash)]
struct AccessControl { struct AccessControl {
rules: Vec<AccessControlRuleSpec>, rules: Vec<AccessControlRuleSpec>,
default_policy: AccessPolicy,
} }
#[derive(Serialize, Deserialize, Clone, Debug, Hash)] #[derive(Serialize, Deserialize, Clone, Debug, Hash)]
struct TopLevel { struct TopLevel {
default_policy: AccessPolicy,
access_control: AccessControl, access_control: AccessControl,
} }
@@ -68,15 +68,13 @@ impl AccessControlRule {
.collect(); .collect();
let top = TopLevel { let top = TopLevel {
access_control: AccessControl { // TODO: Make sure configurable?
// TODO: Make sure configurable? default_policy: if rules.is_empty() {
default_policy: if rules.is_empty() { AccessPolicy::OneFactor
AccessPolicy::OneFactor } else {
} else { AccessPolicy::Deny
AccessPolicy::Deny
},
rules,
}, },
access_control: AccessControl { rules },
}; };
let contents = BTreeMap::from([( let contents = BTreeMap::from([(