@prove-identity/prove-auth 2.7.0 → 2.7.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.
- package/README.md +35 -0
- package/build/lib/proveauth/internal/auth-session.d.ts +0 -1
- package/build/lib/proveauth/internal/auth-session.js +0 -3
- package/build/lib/proveauth/internal/device-universal-redirect-steps.js +2 -2
- package/build/lib/proveauth/internal/main-authenticator.js +0 -3
- package/build/lib/proveauth/internal/mobile-instantlink-step.js +5 -3
- package/build/lib/proveauth/version.d.ts +1 -1
- package/build/lib/proveauth/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,3 +15,38 @@ This SDK provides JavaScript client API to the Prove's authentication platform P
|
|
|
15
15
|
- Build the sdk first, then build the sample code:
|
|
16
16
|
- Build SDK web bundle - `npm run clean && npm run build && npm run bundle-dev`
|
|
17
17
|
- Build and start sample code - `cd samples/basic; npm run build && npm run serve`
|
|
18
|
+
|
|
19
|
+
## Running Unit Tests
|
|
20
|
+
|
|
21
|
+
This project provides several options for running unit tests. Follow these instructions to execute the tests:
|
|
22
|
+
|
|
23
|
+
### Standard Test Run
|
|
24
|
+
|
|
25
|
+
To run the standard test suite:
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
npm test
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
This command will execute all unit tests and display the results in your default web browser.
|
|
32
|
+
|
|
33
|
+
### Running Tests with Node
|
|
34
|
+
|
|
35
|
+
If you need to run tests in a Node.js environment:
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
npm run test-with-node
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
This command will execute all unit tests and display the results in your terminal.
|
|
42
|
+
|
|
43
|
+
### Using the Test Runner
|
|
44
|
+
|
|
45
|
+
To run integration tests using Test Runner:
|
|
46
|
+
|
|
47
|
+
npm run test-runner
|
|
48
|
+
|
|
49
|
+
This command uses Test Runner client to execute integration tests enabled for the Web SDK.
|
|
50
|
+
Execution of integration tests depends on the Test Runner server components, which are part of
|
|
51
|
+
(Garfield backend service)[https://gitlab.com/prove-identity/prove-auth/garfield], and must be
|
|
52
|
+
started in advance using `make test-localhost-up` command in that repo.
|
|
@@ -21,7 +21,6 @@ export default class AuthSession implements AuthSessionIntegration {
|
|
|
21
21
|
backendOriginOverride?: string;
|
|
22
22
|
get namespace(): string;
|
|
23
23
|
get backendOrigin(): string;
|
|
24
|
-
set backendOrigin(backendOrigin: string);
|
|
25
24
|
get authId(): string;
|
|
26
25
|
get challenge(): string;
|
|
27
26
|
get next(): string;
|
|
@@ -16,9 +16,6 @@ class AuthSession {
|
|
|
16
16
|
var _a;
|
|
17
17
|
return this.backendOriginOverride || ((_a = this.claims) === null || _a === void 0 ? void 0 : _a.auth.endp);
|
|
18
18
|
}
|
|
19
|
-
set backendOrigin(backendOrigin) {
|
|
20
|
-
this.backendOriginOverride = backendOrigin;
|
|
21
|
-
}
|
|
22
19
|
get authId() {
|
|
23
20
|
var _a;
|
|
24
21
|
return (_a = this.claims) === null || _a === void 0 ? void 0 : _a.auth.id;
|
|
@@ -11,8 +11,8 @@ class DeviceUniversalRedirectBaseStep {
|
|
|
11
11
|
}
|
|
12
12
|
execute(session) {
|
|
13
13
|
return new Promise((resolve, reject) => {
|
|
14
|
-
var _a, _b, _c;
|
|
15
|
-
let redirectUrl = (_c = (_b = (_a = session.claims) === null || _a === void 0 ? void 0 : _a.auth.subs.dev) === null ||
|
|
14
|
+
var _a, _b, _c, _d, _e, _f;
|
|
15
|
+
let redirectUrl = (_f = (_e = (_d = (_c = (_b = (_a = session.claims) === null || _a === void 0 ? void 0 : _a.auth) === null || _b === void 0 ? void 0 : _b.subs) === null || _c === void 0 ? void 0 : _c.dev) === null || _d === void 0 ? void 0 : _d.auths) === null || _e === void 0 ? void 0 : _e.unvsl) === null || _f === void 0 ? void 0 : _f.ftu;
|
|
16
16
|
if (typeof redirectUrl != 'undefined' && redirectUrl) {
|
|
17
17
|
redirectUrl += `?authId=${session.authId}`;
|
|
18
18
|
let upkNext = '';
|
|
@@ -52,9 +52,6 @@ class MainAuthenticator {
|
|
|
52
52
|
}
|
|
53
53
|
try {
|
|
54
54
|
const session = new auth_session_1.default(this.settings, this.platform, authToken);
|
|
55
|
-
if (this.settings.upkEnabled) {
|
|
56
|
-
session.backendOriginOverride = this.platform.getOrigin();
|
|
57
|
-
}
|
|
58
55
|
const processing = this.process(session);
|
|
59
56
|
onCancel(() => processing.cancel());
|
|
60
57
|
processing
|
|
@@ -95,11 +95,13 @@ class MobileInstantLinkStep extends auth_status_actions_1.AuthStatusActions {
|
|
|
95
95
|
'/v1/client/mobile/instantlink/finish?token=' +
|
|
96
96
|
encodeURIComponent(session.authToken) +
|
|
97
97
|
'&vfp=test-vfp', {
|
|
98
|
-
mode: 'cors',
|
|
98
|
+
mode: 'no-cors',
|
|
99
99
|
method: 'GET',
|
|
100
100
|
})
|
|
101
|
-
.
|
|
102
|
-
.
|
|
101
|
+
.catch((e) => {
|
|
102
|
+
this.log.error('Calling AuthFinish in test mode has failed: ', auth_error_1.default.extractMessage(e));
|
|
103
|
+
})
|
|
104
|
+
.finally(resolve);
|
|
103
105
|
}, SIMULATED_LINK_CLICK_DELAY);
|
|
104
106
|
}
|
|
105
107
|
else {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.USER_AGENT_VERSIONS = exports.API_CONTRACT_VERSION = exports.VERSION = void 0;
|
|
4
|
-
exports.VERSION = '2.7.
|
|
4
|
+
exports.VERSION = '2.7.1';
|
|
5
5
|
exports.API_CONTRACT_VERSION = '2.8.0';
|
|
6
6
|
exports.USER_AGENT_VERSIONS = `ProveAuth/${exports.VERSION} Contract/${exports.API_CONTRACT_VERSION} WEB/1`;
|