dh-auth-library 1.2.1 → 1.2.4
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.
- package/README.md +14 -1
- package/dist/auth/api/index.d.ts +1 -1
- package/dist/auth/getLoginHandler.d.ts +1 -1
- package/dist/auth/getSessionHandler.d.ts +2 -0
- package/dist/auth/index.d.ts +1 -0
- package/dist/auth/loginhandlers/adLoginHandler.d.ts +1 -1
- package/dist/auth/loginhandlers/digidGemachtigdeLoginHandler.d.ts +1 -1
- package/dist/auth/loginhandlers/digidLoginHandler.d.ts +1 -1
- package/dist/auth/loginhandlers/eHerkenningBewindvoerderLoginHandler.d.ts +1 -1
- package/dist/auth/loginhandlers/eHerkenningLoginHandler.d.ts +1 -1
- package/dist/auth/loginhandlers/localhostLoginHandler.d.ts +1 -1
- package/dist/auth/sessionHandler.d.ts +1 -1
- package/dist/constants/index.d.ts +0 -1
- package/dist/index.cjs.js +3 -3
- package/dist/index.es.js +3 -3
- package/package.json +57 -55
- package/dist/auth/api/sessionHandlerResolvers.d.ts +0 -3
- /package/dist/{constants → auth}/loginHandler.d.ts +0 -0
package/README.md
CHANGED
|
@@ -6,6 +6,18 @@ it is published an npm package too and should be imported like that
|
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
+
## How to use this library
|
|
10
|
+
|
|
11
|
+
Install with npm or pnpm
|
|
12
|
+
|
|
13
|
+
npm install dh-auth-library
|
|
14
|
+
|
|
15
|
+
OR
|
|
16
|
+
|
|
17
|
+
pnpm add dh-auth-library
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
9
21
|
## 📦 Purpose
|
|
10
22
|
|
|
11
23
|
Within DenHaag we will have several different repositories which will all have to use certain
|
|
@@ -20,7 +32,7 @@ will take care of all login logic and even maintains the sessions during the tes
|
|
|
20
32
|
|
|
21
33
|
packages/
|
|
22
34
|
├── auth/ # Contains all classes for handling login and sessions
|
|
23
|
-
├── constants/ # Constains
|
|
35
|
+
├── constants/ # Constains AuthType and TestProfile
|
|
24
36
|
|
|
25
37
|
---
|
|
26
38
|
|
|
@@ -33,6 +45,7 @@ Has the authentication logic for api calls for nl-portal
|
|
|
33
45
|
# loginhandlers
|
|
34
46
|
|
|
35
47
|
Has all the login handlers that are needed for the nl-portal-playwright-libraries
|
|
48
|
+
The interface LoginHandler is used by the implementation
|
|
36
49
|
|
|
37
50
|
# pages
|
|
38
51
|
|
package/dist/auth/api/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './apiTokenHelper';
|
|
2
|
-
export * from '
|
|
2
|
+
export * from '../getSessionHandler';
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { getLoginHandler } from './getLoginHandler';
|
|
2
2
|
export { createSessionHandler, MAX_SESSION_TIME_IN_MINUTES } from './sessionHandler';
|
|
3
|
+
export { type LoginHandler } from './loginHandler';
|
|
3
4
|
export * from './api/index';
|
|
4
5
|
export * from './loginhandlers/index';
|
|
5
6
|
export * from './pages/index';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Page } from '@playwright/test';
|
|
2
2
|
import { Account } from 'nl-portal-playwright-libraries';
|
|
3
|
-
import { LoginHandler } from '
|
|
3
|
+
import { LoginHandler } from '../loginHandler';
|
|
4
4
|
export declare class ADLoginHandler implements LoginHandler {
|
|
5
5
|
loginAndCreateSessionStorage(page: Page, account: Account, file: string): Promise<void>;
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Page } from '@playwright/test';
|
|
2
2
|
import { Account } from 'nl-portal-playwright-libraries';
|
|
3
|
-
import { LoginHandler } from '
|
|
3
|
+
import { LoginHandler } from '../loginHandler';
|
|
4
4
|
export declare class DigidGemachtigdeLoginHandler implements LoginHandler {
|
|
5
5
|
loginAndCreateSessionStorage(page: Page, account: Account, file: string): Promise<void>;
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Page } from '@playwright/test';
|
|
2
2
|
import { Account } from 'nl-portal-playwright-libraries';
|
|
3
|
-
import { LoginHandler } from '
|
|
3
|
+
import { LoginHandler } from '../loginHandler';
|
|
4
4
|
export declare class DigidLoginHandler implements LoginHandler {
|
|
5
5
|
loginAndCreateSessionStorage(page: Page, account: Account, file: string): Promise<void>;
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Page } from '@playwright/test';
|
|
2
2
|
import { Account } from 'nl-portal-playwright-libraries';
|
|
3
|
-
import { LoginHandler } from '
|
|
3
|
+
import { LoginHandler } from '../loginHandler';
|
|
4
4
|
export declare class EHerkenningBewindvoerderLoginHandler implements LoginHandler {
|
|
5
5
|
loginAndCreateSessionStorage(page: Page, account: Account, file: string): Promise<void>;
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Page } from '@playwright/test';
|
|
2
2
|
import { Account } from 'nl-portal-playwright-libraries';
|
|
3
|
-
import { LoginHandler } from '
|
|
3
|
+
import { LoginHandler } from '../loginHandler';
|
|
4
4
|
export declare class EHerkenningLoginHandler implements LoginHandler {
|
|
5
5
|
loginAndCreateSessionStorage(page: Page, account: Account, file: string): Promise<void>;
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Page } from '@playwright/test';
|
|
2
2
|
import { Account } from 'nl-portal-playwright-libraries';
|
|
3
|
-
import { LoginHandler } from '
|
|
3
|
+
import { LoginHandler } from '../loginHandler';
|
|
4
4
|
export declare class LocalhostLoginHandler implements LoginHandler {
|
|
5
5
|
loginAndCreateSessionStorage(page: Page, account: Account, file: string): Promise<void>;
|
|
6
6
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Account, SessionHandler } from 'nl-portal-playwright-libraries';
|
|
2
|
-
import { LoginHandler } from '
|
|
2
|
+
import { LoginHandler } from './loginHandler';
|
|
3
3
|
import { AuthType } from '../constants';
|
|
4
4
|
export declare const MAX_SESSION_TIME_IN_MINUTES = 10;
|
|
5
5
|
/**
|
package/dist/index.cjs.js
CHANGED
|
@@ -539,9 +539,9 @@ function getApiTokenFromSession(baseTest, handler) {
|
|
|
539
539
|
});
|
|
540
540
|
}
|
|
541
541
|
//#endregion
|
|
542
|
-
//#region src/auth/
|
|
543
|
-
function getSessionHandler(
|
|
544
|
-
return createSessionHandler(authType, account, getLoginHandler(authType));
|
|
542
|
+
//#region src/auth/getSessionHandler.ts
|
|
543
|
+
function getSessionHandler(testProfile) {
|
|
544
|
+
return createSessionHandler(testProfile.authType, testProfile.account, getLoginHandler(testProfile.authType));
|
|
545
545
|
}
|
|
546
546
|
//#endregion
|
|
547
547
|
exports.ADLoginHandler = ADLoginHandler;
|
package/dist/index.es.js
CHANGED
|
@@ -515,9 +515,9 @@ function getApiTokenFromSession(baseTest, handler) {
|
|
|
515
515
|
});
|
|
516
516
|
}
|
|
517
517
|
//#endregion
|
|
518
|
-
//#region src/auth/
|
|
519
|
-
function getSessionHandler(
|
|
520
|
-
return createSessionHandler(authType, account, getLoginHandler(authType));
|
|
518
|
+
//#region src/auth/getSessionHandler.ts
|
|
519
|
+
function getSessionHandler(testProfile) {
|
|
520
|
+
return createSessionHandler(testProfile.authType, testProfile.account, getLoginHandler(testProfile.authType));
|
|
521
521
|
}
|
|
522
522
|
//#endregion
|
|
523
523
|
export { ADLoginHandler, ADLoginPage, DigidGemachtigdeLoginHandler, DigidLoginHandler, DigidLoginPage, EHerkenningBewindvoerderLoginHandler, EHerkenningLoginHandler, EHerkenningLoginPage, LocalhostLoginHandler, LoginOverzichtPage, MAX_SESSION_TIME_IN_MINUTES, SessionFileHelper, createSessionHandler, getApiTokenFromSession, getLoginHandler, getSessionHandler };
|
package/package.json
CHANGED
|
@@ -1,55 +1,57 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "dh-auth-library",
|
|
3
|
+
"version": "1.2.4",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "git+https://github.com/Gemeente-DenHaag/dh-auth-library.git"
|
|
7
|
+
},
|
|
8
|
+
"packageManager": "pnpm@11.5.2",
|
|
9
|
+
"description": "Authentication package for all types of login on DH applications",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"main": "dist/index.cjs.js",
|
|
12
|
+
"module": "dist/index.es.js",
|
|
13
|
+
"types": "dist/index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.es.js",
|
|
18
|
+
"require": "./dist/index.cjs.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "vite build && tsc -p tsconfig.build.json",
|
|
26
|
+
"prepublishOnly": "pnpm build",
|
|
27
|
+
"lint": "eslint ."
|
|
28
|
+
},
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=22",
|
|
31
|
+
"pnpm": "^11"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"@playwright/test": ">=1.60.0"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@eslint/js": "10.0.1",
|
|
38
|
+
"@playwright/test": "^1.61.1",
|
|
39
|
+
"@types/node": "^25.9.4",
|
|
40
|
+
"eslint": "^10.5.0",
|
|
41
|
+
"typescript": "^6.0.3",
|
|
42
|
+
"typescript-eslint": "8.60.1",
|
|
43
|
+
"vite": "^8.1.0",
|
|
44
|
+
"vite-tsconfig-paths": "^6.1.1"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"nl-portal-playwright-libraries": "^1.1.3",
|
|
48
|
+
"totp-generator": "^2.0.1"
|
|
49
|
+
},
|
|
50
|
+
"keywords": [
|
|
51
|
+
"playwright",
|
|
52
|
+
"testing",
|
|
53
|
+
"automation",
|
|
54
|
+
"e2e",
|
|
55
|
+
"dh-auth"
|
|
56
|
+
]
|
|
57
|
+
}
|
|
File without changes
|