feat(auth): support deriving roles from the IDP

Closes HP-352.
This commit is contained in:
Aarnav Tale
2026-06-20 11:53:09 -04:00
parent 96f2721272
commit 0c4d175eb7
13 changed files with 252 additions and 8 deletions
+26
View File
@@ -423,6 +423,32 @@ in {
default = false;
description = "Whether to use PKCE when authenticating users.";
};
default_role = mkOption {
type = types.enum [
"admin"
"network_admin"
"it_admin"
"auditor"
"viewer"
"member"
];
default = "member";
description = ''
Role assigned to newly created OIDC users after the first owner is bootstrapped.
The owner role is reserved for the first-login bootstrap.
'';
};
role_claim = mkOption {
type = types.nullOr types.str;
default = null;
description = ''
Optional OIDC claim containing the Headplane role to assign to newly created users.
A valid role claim takes precedence over default_role.
'';
example = "headplane_role";
};
};
};
default = {};