Skip to content

Commit d8c5243

Browse files
committed
fix cache for passport and cached_roles
1 parent 731654b commit d8c5243

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

OpenFlow/src/Auth.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export class Auth {
6868
if (type == "userroles") cache_seconds = Config.cleanacl_credential_cache_seconds;
6969
if (type == "mq") cache_seconds = Config.mq_credential_cache_seconds;
7070
if (type == "mqe") cache_seconds = Config.mq_credential_cache_seconds;
71+
if (type == "password") cache_seconds = Config.cleanacl_credential_cache_seconds;
7172
if (seconds < cache_seconds) {
7273
Logger.instanse.silly("Return user " + res.user.username + " from cache");
7374
return res.user;
@@ -76,6 +77,7 @@ export class Auth {
7677
return null;
7778
}
7879
public static async clearCache(reason: string) {
80+
DBHelper.cached_roles = [];
7981
if (this.authorizationCache == null || this.authorizationCache == {}) {
8082
if (Config.log_cache) Logger.instanse.debug("clearCache called, but cache was empty, reason: " + reason);
8183
return;
@@ -102,8 +104,10 @@ export class Auth {
102104
if (res.type == "grafana") cache_seconds = Config.grafana_credential_cache_seconds;
103105
if (res.type == "dashboard") cache_seconds = Config.dashboard_credential_cache_seconds;
104106
if (res.type == "cleanacl") cache_seconds = Config.cleanacl_credential_cache_seconds;
107+
if (res.type == "userroles") cache_seconds = Config.cleanacl_credential_cache_seconds;
105108
if (res.type == "mq") cache_seconds = Config.mq_credential_cache_seconds;
106109
if (res.type == "mqe") cache_seconds = Config.mq_credential_cache_seconds;
110+
if (res.type == "password") cache_seconds = Config.cleanacl_credential_cache_seconds;
107111
if (seconds >= cache_seconds) {
108112
this.RemoveUser(key, res.type);
109113
}

0 commit comments

Comments
 (0)