mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 12:37:20 +00:00
Enhance authentication and authorization components
- Refactored `AppAuth` to introduce `getGuardContextSchema` for improved user context handling. - Updated `Authenticator` to utilize `pickKeys` for user data extraction in JWT generation. - Enhanced `Guard` class to improve permission checks and error handling. - Modified `SystemController` to return context schema alongside permissions in API responses. - Added new `permissions` method in `SystemApi` for fetching permissions. - Improved UI components with additional props and tooltip support for better user experience.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import type { ConfigUpdateResponse } from "modules/server/SystemController";
|
||||
import { ModuleApi } from "./ModuleApi";
|
||||
import type { ModuleConfigs, ModuleKey, ModuleSchemas } from "./ModuleManager";
|
||||
import type { TPermission } from "auth/authorize/Permission";
|
||||
|
||||
export type ApiSchemaResponse = {
|
||||
version: number;
|
||||
@@ -54,4 +55,8 @@ export class SystemApi extends ModuleApi<any> {
|
||||
removeConfig<Module extends ModuleKey>(module: Module, path: string) {
|
||||
return this.delete<ConfigUpdateResponse>(["config", "remove", module, path]);
|
||||
}
|
||||
|
||||
permissions() {
|
||||
return this.get<{ permissions: TPermission[]; context: object }>("permissions");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user