@aristid/leav-types 1.11.0-c60c0d53 → 1.12.0-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { type IQueryInfos } from './queryInfos';
|
|
2
|
+
import { type IRecord } from './record';
|
|
3
|
+
import type jwt from 'jsonwebtoken';
|
|
1
4
|
export declare const ACCESS_TOKEN_COOKIE_NAME = "accessToken";
|
|
2
5
|
export declare const REFRESH_TOKEN_COOKIE_NAME = "refreshToken";
|
|
3
6
|
export declare const API_KEY_PARAM_NAME = "key";
|
|
@@ -5,3 +8,4 @@ export interface ITokenUserData {
|
|
|
5
8
|
userId: string;
|
|
6
9
|
groupsId: string[];
|
|
7
10
|
}
|
|
11
|
+
export type AuthPostOidcLoginCallback = (user: IRecord, decodedAccessToken: jwt.JwtPayload, ctx: IQueryInfos) => Promise<void>;
|
|
@@ -2,6 +2,7 @@ import { type IActionsListFunction } from './actionsList';
|
|
|
2
2
|
import { type IAppGraphQLSchema } from './graphql';
|
|
3
3
|
import { type PermissionTypes } from './permissions';
|
|
4
4
|
import { type PluginRegisterRoute } from './endpoint';
|
|
5
|
+
import { type AuthPostOidcLoginCallback } from './auth';
|
|
5
6
|
export interface IExtensionPoints {
|
|
6
7
|
[name: string]: (...args: any[]) => void;
|
|
7
8
|
}
|
|
@@ -28,4 +29,10 @@ export interface IExtensionPointsFunctions extends IExtensionPoints {
|
|
|
28
29
|
* @param {PluginRegisterRoute[]} routes - list of routes to register
|
|
29
30
|
*/
|
|
30
31
|
registerRoutes: (routes: PluginRegisterRoute[]) => void;
|
|
32
|
+
/**
|
|
33
|
+
* Method to register a callback to be executed after a successful OIDC login.
|
|
34
|
+
*
|
|
35
|
+
* Useful to change user settings or to log some information after the user is authenticated but before the session is created.
|
|
36
|
+
*/
|
|
37
|
+
registerAuthPostOidcLoginCallback: (callback: AuthPostOidcLoginCallback) => void;
|
|
31
38
|
}
|
|
@@ -16,6 +16,7 @@ import { type IGraphqlAppModule } from 'app/graphql/graphqlApp';
|
|
|
16
16
|
import { type IServerRouteAppModule } from 'interface/server';
|
|
17
17
|
import { type GetSystemQueryContext } from 'utils/helpers/getSystemQueryContext';
|
|
18
18
|
import { type ISessionRepo } from '../../infra/session/sessionRepo';
|
|
19
|
+
import { type IExtensionPoints } from '../../_types/extensionPoints';
|
|
19
20
|
export interface IAuthApp extends IGraphqlAppModule, IServerRouteAppModule {
|
|
20
21
|
validateRequestToken(params: {
|
|
21
22
|
apiKey?: string;
|
|
@@ -23,6 +24,7 @@ export interface IAuthApp extends IGraphqlAppModule, IServerRouteAppModule {
|
|
|
23
24
|
cookies?: {};
|
|
24
25
|
}, res: Response<unknown>): Promise<ITokenUserData>;
|
|
25
26
|
authenticateWithOIDCService(req: IRequestWithContext, res: Response<unknown>): Promise<void | Response>;
|
|
27
|
+
extensionPoints?: IExtensionPoints;
|
|
26
28
|
}
|
|
27
29
|
export interface IAuthAppDeps {
|
|
28
30
|
'core.domain.value': IValueDomain;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aristid/leav-types",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.0-1",
|
|
4
4
|
"description": "Shared Leav types",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"tscheck": "",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"license": "LGPL3",
|
|
15
15
|
"repository": "https://github.com/leav-solutions/leav-engine",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@leav/utils": "1.
|
|
17
|
+
"@leav/utils": "1.12.0-1",
|
|
18
18
|
"@types/amqplib": "0.10.8",
|
|
19
19
|
"@types/express": "5.0.6",
|
|
20
20
|
"@types/jest": "29.5.14",
|