-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: user-role-mappings | ||
before: | | ||
<p> | ||
Starting with 5.4.1 it is now possible to dynamically update the roles associated with a user when using header or oidc authMode. | ||
When using this section, all possible roles must be defined, one per line, and any role no longer enabled for the user will be removed. | ||
The rules are evaluated on login, and the user's roles are updated accordingly. | ||
</p> | ||
<p> | ||
Each line is of the format <code>rolename=javascript expression</code>. | ||
The jaascript expression can use two variable, <code>this</code> which allows you to reference any user fields and <code>vals</code> which allows you to access any of the request headers for header auth or the oidc info for oidc auth. | ||
</p> | ||
after: | | ||
<p> | ||
Example: | ||
</p> | ||
<pre><code>[user-role-mappings] | ||
# Everyone is arkimeUser | ||
arkimeUser=true | ||
# userAdmin have -svc extension in userId | ||
userAdmin=this.userId.endsWith('-svc') | ||
# fred and wilma are superAdmin | ||
superAdmin=this.userId === 'fred' || this.userId === 'wilma' | ||
# custom role based on header value | ||
role-special=vals.roles.includes('special') | ||
</code></pre> | ||
settings: | ||
- key: "[role]=" | ||
text: A javascript expression using this for user fields and vals for request headers or oidc info. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters