新增 _FINALLY_WORK_SCOPE 最终权限处理器

This commit is contained in:
click33
2024-08-20 17:34:18 +08:00
parent 0ca8a1ab2d
commit 1bc59dc14c
3 changed files with 59 additions and 2 deletions

View File

@@ -111,5 +111,10 @@ public class SaOAuth2Consts {
/** 表示请求没有得到任何有效处理 {msg: "not handle"} */
public static final String NOT_HANDLE = "{\"msg\": \"not handle\"}";
/**
* 最终权限处理器标识符:在所有权限处理器执行之后,执行此 scope 标识符代表的权限处理器
*/
public static final String _FINALLY_WORK_SCOPE = "_FINALLY_WORK_SCOPE";
}

View File

@@ -16,6 +16,7 @@
package cn.dev33.satoken.oauth2.strategy;
import cn.dev33.satoken.SaManager;
import cn.dev33.satoken.oauth2.consts.SaOAuth2Consts;
import cn.dev33.satoken.oauth2.function.strategy.*;
import cn.dev33.satoken.oauth2.scope.CommonScope;
import cn.dev33.satoken.oauth2.scope.handler.OidcScopeHandler;
@@ -92,6 +93,10 @@ public final class SaOAuth2Strategy {
}
}
}
SaOAuth2ScopeHandlerInterface finallyWorkScopeHandler = scopeHandlerMap.get(SaOAuth2Consts._FINALLY_WORK_SCOPE);
if(finallyWorkScopeHandler != null) {
finallyWorkScopeHandler.workAccessToken(at);
}
};
/**
@@ -106,6 +111,10 @@ public final class SaOAuth2Strategy {
}
}
}
SaOAuth2ScopeHandlerInterface finallyWorkScopeHandler = scopeHandlerMap.get(SaOAuth2Consts._FINALLY_WORK_SCOPE);
if(finallyWorkScopeHandler != null) {
finallyWorkScopeHandler.workClientToken(ct);
}
};
/**