Disallow LDAP bind if trap is set; support setting trap from user form
This commit is contained in:
@@ -10,8 +10,8 @@
|
||||
*/
|
||||
const Middleware = [
|
||||
"auth:Utility",
|
||||
"Traps",
|
||||
"auth:TrustTokenUtility",
|
||||
"Traps",
|
||||
"SAMLUtility",
|
||||
|
||||
// 'MiddlewareName',
|
||||
|
||||
@@ -48,6 +48,10 @@ class TrapUtility {
|
||||
else if ( this.user ) return this.user.trap
|
||||
}
|
||||
|
||||
trap_exists(name) {
|
||||
return !!this.configs[name]
|
||||
}
|
||||
|
||||
config() {
|
||||
return this.configs[this.get_trap()]
|
||||
}
|
||||
|
||||
@@ -8,6 +8,12 @@ const auth_routes = {
|
||||
get: {
|
||||
'/mfa/enable/date': ['middleware::auth:UserOnly', 'controller::api:v1:Auth.get_mfa_enable_date'],
|
||||
|
||||
'/traps': [
|
||||
'middleware::auth:APIRoute',
|
||||
['middleware::api:Permission', { check: 'v1:auth:traps:list'}],
|
||||
'controller::api:v1:Auth.get_traps',
|
||||
],
|
||||
|
||||
'/roles': [
|
||||
'middleware::auth:APIRoute',
|
||||
['middleware::api:Permission', { check: 'v1:auth:roles:list' }],
|
||||
|
||||
Reference in New Issue
Block a user