@globus/sdk 3.0.0-alpha.1 → 3.0.0-alpha.10
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/cjs/lib/core/authorization/AuthorizationManager.d.ts +57 -9
- package/cjs/lib/core/authorization/AuthorizationManager.d.ts.map +1 -1
- package/cjs/lib/core/authorization/AuthorizationManager.js +104 -35
- package/cjs/lib/core/authorization/AuthorizationManager.js.map +1 -1
- package/cjs/lib/core/authorization/Event.d.ts +1 -0
- package/cjs/lib/core/authorization/Event.d.ts.map +1 -1
- package/cjs/lib/core/authorization/Event.js +3 -0
- package/cjs/lib/core/authorization/Event.js.map +1 -1
- package/cjs/lib/core/authorization/RedirectTransport.d.ts +7 -1
- package/cjs/lib/core/authorization/RedirectTransport.d.ts.map +1 -1
- package/cjs/lib/core/authorization/RedirectTransport.js +7 -4
- package/cjs/lib/core/authorization/RedirectTransport.js.map +1 -1
- package/cjs/lib/core/authorization/TokenLookup.d.ts +12 -0
- package/cjs/lib/core/authorization/TokenLookup.d.ts.map +1 -0
- package/cjs/lib/core/authorization/TokenLookup.js +31 -0
- package/cjs/lib/core/authorization/TokenLookup.js.map +1 -0
- package/cjs/lib/core/authorization/tokens.d.ts.map +1 -1
- package/cjs/lib/core/authorization/tokens.js +2 -1
- package/cjs/lib/core/authorization/tokens.js.map +1 -1
- package/cjs/lib/core/errors.d.ts +21 -0
- package/cjs/lib/core/errors.d.ts.map +1 -1
- package/cjs/lib/core/errors.js +19 -1
- package/cjs/lib/core/errors.js.map +1 -1
- package/cjs/lib/core/global.d.ts +1 -0
- package/cjs/lib/core/global.d.ts.map +1 -1
- package/cjs/lib/core/storage/local-storage.js +2 -2
- package/cjs/lib/core/storage/local-storage.js.map +1 -1
- package/cjs/lib/core/storage/memory.d.ts +1 -1
- package/cjs/lib/core/storage/memory.d.ts.map +1 -1
- package/cjs/lib/core/storage/memory.js +2 -2
- package/cjs/lib/core/storage/memory.js.map +1 -1
- package/cjs/lib/services/auth/index.d.ts +7 -9
- package/cjs/lib/services/auth/index.d.ts.map +1 -1
- package/cjs/lib/services/auth/index.js +10 -1
- package/cjs/lib/services/auth/index.js.map +1 -1
- package/cjs/lib/services/globus-connect-server/client.d.ts +58 -58
- package/cjs/lib/services/transfer/service/file-operations.d.ts +1 -1
- package/cjs/lib/services/transfer/service/file-operations.d.ts.map +1 -1
- package/cjs/lib/services/transfer/service/file-operations.js.map +1 -1
- package/esm/lib/core/authorization/AuthorizationManager.d.ts +57 -9
- package/esm/lib/core/authorization/AuthorizationManager.d.ts.map +1 -1
- package/esm/lib/core/authorization/AuthorizationManager.js +105 -36
- package/esm/lib/core/authorization/AuthorizationManager.js.map +1 -1
- package/esm/lib/core/authorization/Event.d.ts +1 -0
- package/esm/lib/core/authorization/Event.d.ts.map +1 -1
- package/esm/lib/core/authorization/Event.js +3 -0
- package/esm/lib/core/authorization/Event.js.map +1 -1
- package/esm/lib/core/authorization/RedirectTransport.d.ts +7 -1
- package/esm/lib/core/authorization/RedirectTransport.d.ts.map +1 -1
- package/esm/lib/core/authorization/RedirectTransport.js +8 -5
- package/esm/lib/core/authorization/RedirectTransport.js.map +1 -1
- package/esm/lib/core/authorization/TokenLookup.d.ts +12 -0
- package/esm/lib/core/authorization/TokenLookup.d.ts.map +1 -0
- package/esm/lib/core/authorization/TokenLookup.js +27 -0
- package/esm/lib/core/authorization/TokenLookup.js.map +1 -0
- package/esm/lib/core/authorization/tokens.d.ts.map +1 -1
- package/esm/lib/core/authorization/tokens.js +2 -1
- package/esm/lib/core/authorization/tokens.js.map +1 -1
- package/esm/lib/core/errors.d.ts +21 -0
- package/esm/lib/core/errors.d.ts.map +1 -1
- package/esm/lib/core/errors.js +15 -0
- package/esm/lib/core/errors.js.map +1 -1
- package/esm/lib/core/global.d.ts +1 -0
- package/esm/lib/core/global.d.ts.map +1 -1
- package/esm/lib/core/storage/local-storage.js +2 -2
- package/esm/lib/core/storage/local-storage.js.map +1 -1
- package/esm/lib/core/storage/memory.d.ts +1 -1
- package/esm/lib/core/storage/memory.d.ts.map +1 -1
- package/esm/lib/core/storage/memory.js +2 -2
- package/esm/lib/core/storage/memory.js.map +1 -1
- package/esm/lib/services/auth/index.d.ts +7 -9
- package/esm/lib/services/auth/index.d.ts.map +1 -1
- package/esm/lib/services/auth/index.js +10 -1
- package/esm/lib/services/auth/index.js.map +1 -1
- package/esm/lib/services/globus-connect-server/client.d.ts +58 -58
- package/esm/lib/services/transfer/service/file-operations.d.ts +1 -1
- package/esm/lib/services/transfer/service/file-operations.d.ts.map +1 -1
- package/esm/lib/services/transfer/service/file-operations.js.map +1 -1
- package/package.json +1 -1
- package/umd/globus.production.js +1 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type IConfig from 'js-pkce/dist/IConfig';
|
|
2
2
|
import { Token, TokenResponse } from '../../services/auth/index.js';
|
|
3
|
-
import { Service } from '../global.js';
|
|
4
3
|
import { Event } from './Event.js';
|
|
4
|
+
import { TokenLookup } from './TokenLookup.js';
|
|
5
|
+
import { AuthorizationRequirementsError, ConsentRequiredError } from '../errors.js';
|
|
5
6
|
export type AuthorizationManagerConfiguration = {
|
|
6
7
|
client_id: IConfig['client_id'];
|
|
7
8
|
requested_scopes: IConfig['requested_scopes'];
|
|
@@ -12,18 +13,36 @@ export type AuthorizationManagerConfiguration = {
|
|
|
12
13
|
*/
|
|
13
14
|
export declare class AuthorizationManager {
|
|
14
15
|
#private;
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
configuration: AuthorizationManagerConfiguration;
|
|
17
|
+
/**
|
|
18
|
+
* The `AuthorizationManager` is consdiered `authenticated` if it has a valid Globus Auth token.
|
|
19
|
+
* It does not necessarily mean that it has a valid token for a specific resource server.
|
|
20
|
+
*/
|
|
21
|
+
get authenticated(): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Set the authenticated state and emit the `authenticated` event.
|
|
24
|
+
*/
|
|
25
|
+
set authenticated(value: boolean);
|
|
26
|
+
tokens: TokenLookup;
|
|
17
27
|
events: {
|
|
18
28
|
/**
|
|
19
29
|
* Emitted when the authenticated state changes.
|
|
30
|
+
* @event AuthorizationManager.events#authenticated
|
|
31
|
+
* @type {object}
|
|
32
|
+
* @property {boolean} isAuthenticated - Whether the `AuthorizationManager` is authenticated.
|
|
33
|
+
* @property {TokenResponse} [token] - The token response if the `AuthorizationManager` is authenticated.
|
|
20
34
|
*/
|
|
21
35
|
authenticated: Event<"authenticated", {
|
|
36
|
+
/**
|
|
37
|
+
* Whether the `AuthorizationManager` is authenticated.
|
|
38
|
+
* @see {@link AuthorizationManager.authenticated}
|
|
39
|
+
*/
|
|
22
40
|
isAuthenticated: boolean;
|
|
23
41
|
token?: TokenResponse | undefined;
|
|
24
42
|
}>;
|
|
25
43
|
/**
|
|
26
44
|
* Emitted when the user revokes their authentication.
|
|
45
|
+
* @event AuthorizationManager.events#revoke
|
|
27
46
|
*/
|
|
28
47
|
revoke: Event<"revoke", unknown>;
|
|
29
48
|
};
|
|
@@ -31,17 +50,46 @@ export declare class AuthorizationManager {
|
|
|
31
50
|
startSilentRenew(): void;
|
|
32
51
|
hasGlobusAuthToken(): boolean;
|
|
33
52
|
getGlobusAuthToken(): any;
|
|
53
|
+
/**
|
|
54
|
+
* Reset the authenticated state and clear all tokens from storage.
|
|
55
|
+
* This method **does not** emit the `revoke` event. If you need to emit the `revoke` event, use the `AuthorizationManager.revoke` method.
|
|
56
|
+
*/
|
|
34
57
|
reset(): void;
|
|
35
|
-
|
|
58
|
+
/**
|
|
59
|
+
* Initiate the login process by redirecting to the Globus Auth login page.
|
|
60
|
+
*/
|
|
61
|
+
login(): void;
|
|
36
62
|
handleCodeRedirect(): Promise<void>;
|
|
37
63
|
/**
|
|
38
|
-
*
|
|
64
|
+
* Handle an error response from a Globus service in the context of this `AuthorizationManager`.
|
|
65
|
+
* This method will introspect the response and attempt to handle any errors that should result
|
|
66
|
+
* in some additional Globus Auth interaction.
|
|
67
|
+
* @param response - The error response from a Globus service.
|
|
68
|
+
* @param execute - Whether to execute the handler immediately or return a function that can be executed later.
|
|
69
|
+
*/
|
|
70
|
+
handleErrorResponse(response: Record<string, unknown>, execute?: true): void;
|
|
71
|
+
handleErrorResponse(response: Record<string, unknown>, execute?: false): () => void;
|
|
72
|
+
/**
|
|
73
|
+
* Process a well-formed Authorization Requirements error response from a Globus service
|
|
74
|
+
* and redirect the user to the Globus Auth login page with the necessary parameters.
|
|
75
|
+
*/
|
|
76
|
+
handleAuthorizationRequirementsError(response: AuthorizationRequirementsError): void;
|
|
77
|
+
/**
|
|
78
|
+
* Process a well-formed `ConsentRequired` error response from a Globus service
|
|
79
|
+
* and redirect the user to the Globus Auth login page with the necessary parameters.
|
|
80
|
+
*/
|
|
81
|
+
handleConsentRequiredError(response: ConsentRequiredError): void;
|
|
82
|
+
/**
|
|
83
|
+
* Add a Globus Auth token response to storage, if `other_tokens` are present they are also added.
|
|
84
|
+
* This method is mostly used internally by the `AuthorizationManager`, but can be used by downstream
|
|
85
|
+
* consumers to add tokens to storage if necessary.
|
|
39
86
|
*/
|
|
40
|
-
handleConsentRequiredError(response: {
|
|
41
|
-
code: 'ConsentRequired';
|
|
42
|
-
required_scopes: string[];
|
|
43
|
-
}): void;
|
|
44
87
|
addTokenResponse: (token: Token | TokenResponse) => void;
|
|
88
|
+
/**
|
|
89
|
+
* Call `AuthroizationManager.reset` and emit the `revoke` event.
|
|
90
|
+
* @emits AuthorizationManager.events#revoke
|
|
91
|
+
* @see AuthorizationManager.reset
|
|
92
|
+
*/
|
|
45
93
|
revoke(): Promise<void>;
|
|
46
94
|
}
|
|
47
95
|
//# sourceMappingURL=AuthorizationManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthorizationManager.d.ts","sourceRoot":"","sources":["../../../../../src/lib/core/authorization/AuthorizationManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EACL,KAAK,EACL,aAAa,
|
|
1
|
+
{"version":3,"file":"AuthorizationManager.d.ts","sourceRoot":"","sources":["../../../../../src/lib/core/authorization/AuthorizationManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EACL,KAAK,EACL,aAAa,EAId,MAAM,8BAA8B,CAAC;AAKtC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAGL,8BAA8B,EAC9B,oBAAoB,EACrB,MAAM,cAAc,CAAC;AAEtB,MAAM,MAAM,iCAAiC,GAAG;IAC9C,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAChC,gBAAgB,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC9C,YAAY,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;CACvC,CAAC;AAEF;;GAEG;AACH,qBAAa,oBAAoB;;IAG/B,aAAa,EAAE,iCAAiC,CAAC;IAIjD;;;OAGG;IACH,IAAI,aAAa,IAOQ,OAAO,CAL/B;IAED;;OAEG;IACH,IAAI,aAAa,CAAC,KAAK,EAAE,OAAO,EAG/B;IAED,MAAM,EAAE,WAAW,CAAC;IAEpB,MAAM;QACJ;;;;;;WAMG;;YAIC;;;eAGG;6BACc,OAAO;;;QAI5B;;;WAGG;;MAEH;gBAEU,aAAa,EAAE,iCAAiC;IAsB5D,gBAAgB;IAMhB,kBAAkB;IAIlB,kBAAkB;IA0BlB;;;OAGG;IACH,KAAK;IAmBL;;OAEG;IACH,KAAK;IASC,kBAAkB;IASxB;;;;;;OAMG;IACH,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI;IAC5E,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,KAAK,GAAG,MAAM,IAAI;IAyBnF;;;OAGG;IACH,oCAAoC,CAAC,QAAQ,EAAE,8BAA8B;IAe7E;;;OAGG;IACH,0BAA0B,CAAC,QAAQ,EAAE,oBAAoB;IAOzD;;;;OAIG;IACH,gBAAgB,UAAW,KAAK,GAAG,aAAa,UAM9C;IAEF;;;;OAIG;IACG,MAAM;CAIb"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var _AuthorizationManager_instances, _AuthorizationManager_transport,
|
|
2
|
+
var _AuthorizationManager_instances, _AuthorizationManager_transport, _AuthorizationManager_authenticated, _AuthorizationManager_checkAuthorizationState, _AuthorizationManager_bootstrapFromStorageState, _AuthorizationManager_emitAuthenticatedState, _AuthorizationManager_buildTransport;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.AuthorizationManager = void 0;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
@@ -8,39 +8,56 @@ const index_js_2 = require("../storage/index.js");
|
|
|
8
8
|
const logger_js_1 = require("../logger.js");
|
|
9
9
|
const Event_js_1 = require("./Event.js");
|
|
10
10
|
const RedirectTransport_js_1 = require("./RedirectTransport.js");
|
|
11
|
+
const TokenLookup_js_1 = require("./TokenLookup.js");
|
|
12
|
+
const errors_js_1 = require("../errors.js");
|
|
11
13
|
/**
|
|
12
14
|
* @experimental
|
|
13
15
|
*/
|
|
14
16
|
class AuthorizationManager {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
/**
|
|
18
|
+
* The `AuthorizationManager` is consdiered `authenticated` if it has a valid Globus Auth token.
|
|
19
|
+
* It does not necessarily mean that it has a valid token for a specific resource server.
|
|
20
|
+
*/
|
|
21
|
+
get authenticated() {
|
|
22
|
+
return tslib_1.__classPrivateFieldGet(this, _AuthorizationManager_authenticated, "f");
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Set the authenticated state and emit the `authenticated` event.
|
|
26
|
+
*/
|
|
27
|
+
set authenticated(value) {
|
|
28
|
+
tslib_1.__classPrivateFieldSet(this, _AuthorizationManager_authenticated, value, "f");
|
|
29
|
+
tslib_1.__classPrivateFieldGet(this, _AuthorizationManager_instances, "m", _AuthorizationManager_emitAuthenticatedState).call(this);
|
|
23
30
|
}
|
|
24
31
|
constructor(configuration) {
|
|
25
32
|
_AuthorizationManager_instances.add(this);
|
|
26
33
|
_AuthorizationManager_transport.set(this, void 0);
|
|
27
|
-
|
|
28
|
-
this.authenticated = false;
|
|
34
|
+
_AuthorizationManager_authenticated.set(this, false);
|
|
29
35
|
this.events = {
|
|
30
36
|
/**
|
|
31
37
|
* Emitted when the authenticated state changes.
|
|
38
|
+
* @event AuthorizationManager.events#authenticated
|
|
39
|
+
* @type {object}
|
|
40
|
+
* @property {boolean} isAuthenticated - Whether the `AuthorizationManager` is authenticated.
|
|
41
|
+
* @property {TokenResponse} [token] - The token response if the `AuthorizationManager` is authenticated.
|
|
32
42
|
*/
|
|
33
43
|
authenticated: new Event_js_1.Event('authenticated'),
|
|
34
44
|
/**
|
|
35
45
|
* Emitted when the user revokes their authentication.
|
|
46
|
+
* @event AuthorizationManager.events#revoke
|
|
36
47
|
*/
|
|
37
48
|
revoke: new Event_js_1.Event('revoke'),
|
|
38
49
|
};
|
|
50
|
+
/**
|
|
51
|
+
* Add a Globus Auth token response to storage, if `other_tokens` are present they are also added.
|
|
52
|
+
* This method is mostly used internally by the `AuthorizationManager`, but can be used by downstream
|
|
53
|
+
* consumers to add tokens to storage if necessary.
|
|
54
|
+
*/
|
|
39
55
|
this.addTokenResponse = (token) => {
|
|
40
|
-
(0, index_js_2.getStorage)().set(`${
|
|
56
|
+
(0, index_js_2.getStorage)().set(`${this.configuration.client_id}:${token.resource_server}`, token);
|
|
41
57
|
if ('other_tokens' in token) {
|
|
42
58
|
token.other_tokens.forEach(this.addTokenResponse);
|
|
43
59
|
}
|
|
60
|
+
tslib_1.__classPrivateFieldGet(this, _AuthorizationManager_instances, "m", _AuthorizationManager_checkAuthorizationState).call(this);
|
|
44
61
|
};
|
|
45
62
|
/**
|
|
46
63
|
* @todo Add support for passing in an alternative storage mechanism.
|
|
@@ -49,7 +66,14 @@ class AuthorizationManager {
|
|
|
49
66
|
if (!configuration.client_id) {
|
|
50
67
|
throw new Error('You must provide a `client_id` for your application.');
|
|
51
68
|
}
|
|
52
|
-
|
|
69
|
+
this.configuration = Object.assign(Object.assign({}, configuration), {
|
|
70
|
+
/**
|
|
71
|
+
* Inject the `openid`, `profile`, `email`, and `offline_access` scopes by default.
|
|
72
|
+
*/
|
|
73
|
+
requested_scopes: `${configuration.requested_scopes} openid profile email offline_access` });
|
|
74
|
+
this.tokens = new TokenLookup_js_1.TokenLookup({
|
|
75
|
+
manager: this,
|
|
76
|
+
});
|
|
53
77
|
this.startSilentRenew();
|
|
54
78
|
}
|
|
55
79
|
startSilentRenew() {
|
|
@@ -61,45 +85,89 @@ class AuthorizationManager {
|
|
|
61
85
|
return this.getGlobusAuthToken() !== null;
|
|
62
86
|
}
|
|
63
87
|
getGlobusAuthToken() {
|
|
64
|
-
const entry = (0, index_js_2.getStorage)().get(`${
|
|
88
|
+
const entry = (0, index_js_2.getStorage)().get(`${this.configuration.client_id}:auth.globus.org`);
|
|
65
89
|
return entry ? JSON.parse(entry) : null;
|
|
66
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* Reset the authenticated state and clear all tokens from storage.
|
|
93
|
+
* This method **does not** emit the `revoke` event. If you need to emit the `revoke` event, use the `AuthorizationManager.revoke` method.
|
|
94
|
+
*/
|
|
67
95
|
reset() {
|
|
68
|
-
|
|
96
|
+
/**
|
|
97
|
+
* @todo This should be made specific to the keys generated by the `AuthorizationManager`.
|
|
98
|
+
*/
|
|
69
99
|
(0, index_js_2.getStorage)().clear();
|
|
100
|
+
this.authenticated = false;
|
|
70
101
|
}
|
|
71
|
-
|
|
102
|
+
/**
|
|
103
|
+
* Initiate the login process by redirecting to the Globus Auth login page.
|
|
104
|
+
*/
|
|
105
|
+
login() {
|
|
72
106
|
this.reset();
|
|
107
|
+
/**
|
|
108
|
+
* In the future, it's possible that we may want to support different types of transports.
|
|
109
|
+
*/
|
|
73
110
|
const transport = tslib_1.__classPrivateFieldGet(this, _AuthorizationManager_instances, "m", _AuthorizationManager_buildTransport).call(this);
|
|
74
111
|
transport.send();
|
|
75
112
|
}
|
|
76
113
|
handleCodeRedirect() {
|
|
77
114
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
115
|
+
(0, logger_js_1.log)('debug', 'AuthorizationManager.handleCodeRedirect');
|
|
78
116
|
const response = yield tslib_1.__classPrivateFieldGet(this, _AuthorizationManager_instances, "m", _AuthorizationManager_buildTransport).call(this).getToken();
|
|
79
117
|
if ((0, index_js_1.isGlobusAuthTokenResponse)(response)) {
|
|
118
|
+
(0, logger_js_1.log)('debug', `AuthorizationManager.handleCodeRedirect | response=${response}`);
|
|
80
119
|
this.addTokenResponse(response);
|
|
81
|
-
this.authenticated = true;
|
|
82
|
-
yield tslib_1.__classPrivateFieldGet(this, _AuthorizationManager_instances, "m", _AuthorizationManager_emitAuthenticatedState).call(this);
|
|
83
120
|
}
|
|
84
121
|
});
|
|
85
122
|
}
|
|
123
|
+
handleErrorResponse(response, execute = true) {
|
|
124
|
+
(0, logger_js_1.log)('debug', `AuthorizationManager.handleErrorResponse | response=${response} execute=${execute}`);
|
|
125
|
+
let handler = () => { };
|
|
126
|
+
if ((0, errors_js_1.isAuthorizationRequirementsError)(response)) {
|
|
127
|
+
(0, logger_js_1.log)('debug', 'AuthorizationManager.handleErrorResponse | error=AuthorizationRequirementsError');
|
|
128
|
+
handler = () => this.handleAuthorizationRequirementsError(response);
|
|
129
|
+
}
|
|
130
|
+
if ((0, errors_js_1.isConsentRequiredError)(response)) {
|
|
131
|
+
(0, logger_js_1.log)('debug', 'AuthorizationManager.handleErrorResponse | error=ConsentRequiredError');
|
|
132
|
+
handler = () => this.handleConsentRequiredError(response);
|
|
133
|
+
}
|
|
134
|
+
if ('code' in response && response['code'] === 'AuthenticationFailed') {
|
|
135
|
+
(0, logger_js_1.log)('debug', 'AuthorizationManager.handleErrorResponse | error=AuthenticationFailed');
|
|
136
|
+
handler = () => this.revoke();
|
|
137
|
+
}
|
|
138
|
+
return execute === true ? handler() : handler;
|
|
139
|
+
}
|
|
86
140
|
/**
|
|
87
|
-
*
|
|
141
|
+
* Process a well-formed Authorization Requirements error response from a Globus service
|
|
142
|
+
* and redirect the user to the Globus Auth login page with the necessary parameters.
|
|
143
|
+
*/
|
|
144
|
+
handleAuthorizationRequirementsError(response) {
|
|
145
|
+
tslib_1.__classPrivateFieldSet(this, _AuthorizationManager_transport, tslib_1.__classPrivateFieldGet(this, _AuthorizationManager_instances, "m", _AuthorizationManager_buildTransport).call(this, {
|
|
146
|
+
params: {
|
|
147
|
+
session_message: response.authorization_parameters.session_message,
|
|
148
|
+
session_required_identities: response.authorization_parameters.session_required_identities.join(','),
|
|
149
|
+
session_required_mfa: response.authorization_parameters.session_required_mfa,
|
|
150
|
+
session_required_single_domain: response.authorization_parameters.session_required_single_domain.join(','),
|
|
151
|
+
prompt: 'login',
|
|
152
|
+
},
|
|
153
|
+
}), "f");
|
|
154
|
+
tslib_1.__classPrivateFieldGet(this, _AuthorizationManager_transport, "f").send();
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Process a well-formed `ConsentRequired` error response from a Globus service
|
|
158
|
+
* and redirect the user to the Globus Auth login page with the necessary parameters.
|
|
88
159
|
*/
|
|
89
|
-
// handleErrorResponse(response: { code: string }) {
|
|
90
|
-
// if (response.code === 'ConsentRequired') {
|
|
91
|
-
// this.handleConsentRequiredError(response);
|
|
92
|
-
// }
|
|
93
|
-
// if (response.code === 'AuthenticationFailed') {
|
|
94
|
-
// this.revoke();
|
|
95
|
-
// }
|
|
96
|
-
// }
|
|
97
160
|
handleConsentRequiredError(response) {
|
|
98
161
|
tslib_1.__classPrivateFieldSet(this, _AuthorizationManager_transport, tslib_1.__classPrivateFieldGet(this, _AuthorizationManager_instances, "m", _AuthorizationManager_buildTransport).call(this, {
|
|
99
162
|
requested_scopes: response.required_scopes.join(' '),
|
|
100
163
|
}), "f");
|
|
101
164
|
tslib_1.__classPrivateFieldGet(this, _AuthorizationManager_transport, "f").send();
|
|
102
165
|
}
|
|
166
|
+
/**
|
|
167
|
+
* Call `AuthroizationManager.reset` and emit the `revoke` event.
|
|
168
|
+
* @emits AuthorizationManager.events#revoke
|
|
169
|
+
* @see AuthorizationManager.reset
|
|
170
|
+
*/
|
|
103
171
|
revoke() {
|
|
104
172
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
105
173
|
this.reset();
|
|
@@ -108,18 +176,19 @@ class AuthorizationManager {
|
|
|
108
176
|
}
|
|
109
177
|
}
|
|
110
178
|
exports.AuthorizationManager = AuthorizationManager;
|
|
111
|
-
_AuthorizationManager_transport = new WeakMap(),
|
|
179
|
+
_AuthorizationManager_transport = new WeakMap(), _AuthorizationManager_authenticated = new WeakMap(), _AuthorizationManager_instances = new WeakSet(), _AuthorizationManager_checkAuthorizationState = function _AuthorizationManager_checkAuthorizationState() {
|
|
180
|
+
(0, logger_js_1.log)('debug', 'AuthorizationManager.#checkAuthorizationState');
|
|
181
|
+
if (this.hasGlobusAuthToken()) {
|
|
182
|
+
this.authenticated = true;
|
|
183
|
+
}
|
|
184
|
+
}, _AuthorizationManager_bootstrapFromStorageState = function _AuthorizationManager_bootstrapFromStorageState() {
|
|
112
185
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
113
186
|
(0, logger_js_1.log)('debug', 'AuthorizationManager.bootstrapFromStorageState');
|
|
114
|
-
|
|
115
|
-
(0, logger_js_1.log)('debug', 'AuthorizationManager.bootstrapFromStorageState: hasGlobusAuthToken');
|
|
116
|
-
this.authenticated = true;
|
|
117
|
-
yield tslib_1.__classPrivateFieldGet(this, _AuthorizationManager_instances, "m", _AuthorizationManager_emitAuthenticatedState).call(this);
|
|
118
|
-
}
|
|
187
|
+
tslib_1.__classPrivateFieldGet(this, _AuthorizationManager_instances, "m", _AuthorizationManager_checkAuthorizationState).call(this);
|
|
119
188
|
});
|
|
120
189
|
}, _AuthorizationManager_emitAuthenticatedState = function _AuthorizationManager_emitAuthenticatedState() {
|
|
121
|
-
var _a;
|
|
122
190
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
191
|
+
var _a;
|
|
123
192
|
const isAuthenticated = this.authenticated;
|
|
124
193
|
const token = (_a = this.getGlobusAuthToken()) !== null && _a !== void 0 ? _a : undefined;
|
|
125
194
|
yield this.events.authenticated.dispatch({
|
|
@@ -128,6 +197,6 @@ _AuthorizationManager_transport = new WeakMap(), _AuthorizationManager_configura
|
|
|
128
197
|
});
|
|
129
198
|
});
|
|
130
199
|
}, _AuthorizationManager_buildTransport = function _AuthorizationManager_buildTransport(overrides) {
|
|
131
|
-
return new RedirectTransport_js_1.RedirectTransport(Object.assign({ client_id:
|
|
200
|
+
return new RedirectTransport_js_1.RedirectTransport(Object.assign({ client_id: this.configuration.client_id, authorization_endpoint: (0, index_js_1.getAuthorizationEndpoint)(), token_endpoint: (0, index_js_1.getTokenEndpoint)(), redirect_uri: this.configuration.redirect_uri, requested_scopes: this.configuration.requested_scopes }, overrides));
|
|
132
201
|
};
|
|
133
202
|
//# sourceMappingURL=AuthorizationManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthorizationManager.js","sourceRoot":"","sources":["../../../../../src/lib/core/authorization/AuthorizationManager.ts"],"names":[],"mappings":";;;;;AAEA,
|
|
1
|
+
{"version":3,"file":"AuthorizationManager.js","sourceRoot":"","sources":["../../../../../src/lib/core/authorization/AuthorizationManager.ts"],"names":[],"mappings":";;;;;AAEA,2DAMsC;AAEtC,kDAAgE;AAChE,4CAAmC;AAEnC,yCAAmC;AACnC,iEAA2D;AAC3D,qDAA+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AAK;SACN,CAAC,CAAC;IACL,CAAC;wFAce,SAAuE;IACrF,OAAO,IAAI,wCAAiB,iBAC1B,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,SAAS,EACvC,sBAAsB,EAAE,IAAA,mCAAwB,GAAE,EAClD,cAAc,EAAE,IAAA,2BAAgB,GAAE,EAClC,YAAY,EAAE,IAAI,CAAC,aAAa,CAAC,YAAY,EAC7C,gBAAgB,EAAE,IAAI,CAAC,aAAa,CAAC,gBAAgB,IAClD,SAAS,EACZ,CAAC;AACL,CAAC"}
|
|
@@ -5,6 +5,7 @@ export declare class Event<EventName extends string, Payload extends unknown> {
|
|
|
5
5
|
constructor(name: EventName);
|
|
6
6
|
addListener(callback: ListenerCallback<Payload>): () => void;
|
|
7
7
|
removeListener(callback: ListenerCallback<Payload>): void;
|
|
8
|
+
clearListeners(): void;
|
|
8
9
|
dispatch(payload?: Payload): Promise<void>;
|
|
9
10
|
}
|
|
10
11
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Event.d.ts","sourceRoot":"","sources":["../../../../../src/lib/core/authorization/Event.ts"],"names":[],"mappings":"AAAA,KAAK,gBAAgB,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,GAAG,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AAE5E,qBAAa,KAAK,CAAC,SAAS,SAAS,MAAM,EAAE,OAAO,SAAS,OAAO;;IAGtD,QAAQ,CAAC,IAAI,EAAE,SAAS;gBAAf,IAAI,EAAE,SAAS;IAEpC,WAAW,CAAC,QAAQ,EAAE,gBAAgB,CAAC,OAAO,CAAC;IAK/C,cAAc,CAAC,QAAQ,EAAE,gBAAgB,CAAC,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Event.d.ts","sourceRoot":"","sources":["../../../../../src/lib/core/authorization/Event.ts"],"names":[],"mappings":"AAAA,KAAK,gBAAgB,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,GAAG,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AAE5E,qBAAa,KAAK,CAAC,SAAS,SAAS,MAAM,EAAE,OAAO,SAAS,OAAO;;IAGtD,QAAQ,CAAC,IAAI,EAAE,SAAS;gBAAf,IAAI,EAAE,SAAS;IAEpC,WAAW,CAAC,QAAQ,EAAE,gBAAgB,CAAC,OAAO,CAAC;IAK/C,cAAc,CAAC,QAAQ,EAAE,gBAAgB,CAAC,OAAO,CAAC;IAIlD,cAAc;IAIR,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO;CAGjC"}
|
|
@@ -15,6 +15,9 @@ class Event {
|
|
|
15
15
|
removeListener(callback) {
|
|
16
16
|
tslib_1.__classPrivateFieldSet(this, _Event_callbacks, tslib_1.__classPrivateFieldGet(this, _Event_callbacks, "f").filter((cb) => cb !== callback), "f");
|
|
17
17
|
}
|
|
18
|
+
clearListeners() {
|
|
19
|
+
tslib_1.__classPrivateFieldSet(this, _Event_callbacks, [], "f");
|
|
20
|
+
}
|
|
18
21
|
dispatch(payload) {
|
|
19
22
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
20
23
|
yield Promise.all(tslib_1.__classPrivateFieldGet(this, _Event_callbacks, "f").map((callback) => callback(payload)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Event.js","sourceRoot":"","sources":["../../../../../src/lib/core/authorization/Event.ts"],"names":[],"mappings":";;;;;AAEA,MAAa,KAAK;IAGhB,YAAqB,IAAe;QAAf,SAAI,GAAJ,IAAI,CAAW;QAFpC,2BAA0C,EAAE,EAAC;IAEN,CAAC;IAExC,WAAW,CAAC,QAAmC;QAC7C,+BAAA,IAAI,wBAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC/B,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC;IAED,cAAc,CAAC,QAAmC;QAChD,+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ist/IConfig';
|
|
2
|
+
import type IObject from 'js-pkce/dist/IObject';
|
|
2
3
|
export declare class RedirectTransport {
|
|
3
4
|
#private;
|
|
4
|
-
constructor(options: IConfig
|
|
5
|
+
constructor(options: IConfig & {
|
|
6
|
+
/**
|
|
7
|
+
* Additional parameters to be included in the query string of the authorization request.
|
|
8
|
+
*/
|
|
9
|
+
params?: IObject;
|
|
10
|
+
});
|
|
5
11
|
send(): void;
|
|
6
12
|
getToken(): Promise<import("js-pkce/dist/ITokenResponse").default | undefined>;
|
|
7
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RedirectTransport.d.ts","sourceRoot":"","sources":["../../../../../src/lib/core/authorization/RedirectTransport.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAEhD,qBAAa,iBAAiB;;
|
|
1
|
+
{"version":3,"file":"RedirectTransport.d.ts","sourceRoot":"","sources":["../../../../../src/lib/core/authorization/RedirectTransport.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAEhD,qBAAa,iBAAiB;;gBAM1B,OAAO,EAAE,OAAO,GAAG;QACjB;;WAEG;QACH,MAAM,CAAC,EAAE,OAAO,CAAC;KAClB;IAWH,IAAI;IAIE,QAAQ;CAiBf"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var _RedirectTransport_pkce;
|
|
2
|
+
var _RedirectTransport_pkce, _RedirectTransport_params;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.RedirectTransport = void 0;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
@@ -7,10 +7,13 @@ const js_pkce_1 = tslib_1.__importDefault(require("js-pkce"));
|
|
|
7
7
|
class RedirectTransport {
|
|
8
8
|
constructor(options) {
|
|
9
9
|
_RedirectTransport_pkce.set(this, void 0);
|
|
10
|
-
|
|
10
|
+
_RedirectTransport_params.set(this, {});
|
|
11
|
+
const { params } = options, config = tslib_1.__rest(options, ["params"]);
|
|
12
|
+
tslib_1.__classPrivateFieldSet(this, _RedirectTransport_pkce, new js_pkce_1.default(Object.assign({}, config)), "f");
|
|
13
|
+
tslib_1.__classPrivateFieldSet(this, _RedirectTransport_params, Object.assign({}, params), "f");
|
|
11
14
|
}
|
|
12
15
|
send() {
|
|
13
|
-
window.location.replace(tslib_1.__classPrivateFieldGet(this, _RedirectTransport_pkce, "f").authorizeUrl());
|
|
16
|
+
window.location.replace(tslib_1.__classPrivateFieldGet(this, _RedirectTransport_pkce, "f").authorizeUrl(tslib_1.__classPrivateFieldGet(this, _RedirectTransport_params, "f")));
|
|
14
17
|
}
|
|
15
18
|
getToken() {
|
|
16
19
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
@@ -34,5 +37,5 @@ class RedirectTransport {
|
|
|
34
37
|
}
|
|
35
38
|
}
|
|
36
39
|
exports.RedirectTransport = RedirectTransport;
|
|
37
|
-
_RedirectTransport_pkce = new WeakMap();
|
|
40
|
+
_RedirectTransport_pkce = new WeakMap(), _RedirectTransport_params = new WeakMap();
|
|
38
41
|
//# sourceMappingURL=RedirectTransport.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RedirectTransport.js","sourceRoot":"","sources":["../../../../../src/lib/core/authorization/RedirectTransport.ts"],"names":[],"mappings":";;;;;AAAA,8DAA2B;
|
|
1
|
+
{"version":3,"file":"RedirectTransport.js","sourceRoot":"","sources":["../../../../../src/lib/core/authorization/RedirectTransport.ts"],"names":[],"mappings":";;;;;AAAA,8DAA2B;AAI3B,MAAa,iBAAiB;IAK5B,YACE,OAKC;QAVH,0CAAY;QAEZ,oCAAmB,EAAE,EAAC;QAUpB,MAAM,EAAE,MAAM,KAAgB,OAAO,EAAlB,MAAM,kBAAK,OAAO,EAA/B,UAAqB,CAAU,CAAC;QACtC,+BAAA,IAAI,2BAAS,IAAI,iBAAI,mBAChB,MAAM,EACT,MAAA,CAAC;QACH,+BAAA,IAAI,+CACC,MAAM,OACV,CAAC;IACJ,CAAC;IAED,IAAI;QACF,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,+BAAA,IAAI,+BAAM,CAAC,YAAY,CAAC,+BAAA,IAAI,iCAAQ,CAAC,CAAC,CAAC;IACjE,CAAC;IAEK,QAAQ;;YACZ,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YAC1C,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YAC/C,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC;gBAAE,OAAO,SAAS,CAAC;YAC1C,MAAM,QAAQ,GAAG,MAAM,+BAAA,IAAI,+BAAM,CAAC,sBAAsB,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;YACzE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YACtB,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YACvB,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;YAC/B;;;eAGG;YACH,cAAc,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;YACxC,cAAc,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;YAChD,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YAC7B,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF;AA3CD,8CA2CC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Token } from '../../services/auth/index.js';
|
|
2
|
+
import { AuthorizationManager } from './AuthorizationManager.js';
|
|
3
|
+
export declare class TokenLookup {
|
|
4
|
+
#private;
|
|
5
|
+
constructor(options: {
|
|
6
|
+
manager: AuthorizationManager;
|
|
7
|
+
});
|
|
8
|
+
get auth(): Token | null;
|
|
9
|
+
get transfer(): Token | null;
|
|
10
|
+
get flows(): Token | null;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=TokenLookup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TokenLookup.d.ts","sourceRoot":"","sources":["../../../../../src/lib/core/authorization/TokenLookup.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAU,MAAM,8BAA8B,CAAC;AAG7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,qBAAa,WAAW;;gBAGV,OAAO,EAAE;QAAE,OAAO,EAAE,oBAAoB,CAAA;KAAE;IAWtD,IAAI,IAAI,IAAI,KAAK,GAAG,IAAI,CAEvB;IAED,IAAI,QAAQ,IAAI,KAAK,GAAG,IAAI,CAE3B;IAED,IAAI,KAAK,IAAI,KAAK,GAAG,IAAI,CAExB;CACF"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _TokenLookup_instances, _TokenLookup_manager, _TokenLookup_getTokenForService;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.TokenLookup = void 0;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const index_js_1 = require("../storage/index.js");
|
|
7
|
+
const index_js_2 = require("../../services/auth/index.js");
|
|
8
|
+
class TokenLookup {
|
|
9
|
+
constructor(options) {
|
|
10
|
+
_TokenLookup_instances.add(this);
|
|
11
|
+
_TokenLookup_manager.set(this, void 0);
|
|
12
|
+
tslib_1.__classPrivateFieldSet(this, _TokenLookup_manager, options.manager, "f");
|
|
13
|
+
}
|
|
14
|
+
get auth() {
|
|
15
|
+
return tslib_1.__classPrivateFieldGet(this, _TokenLookup_instances, "m", _TokenLookup_getTokenForService).call(this, 'AUTH');
|
|
16
|
+
}
|
|
17
|
+
get transfer() {
|
|
18
|
+
return tslib_1.__classPrivateFieldGet(this, _TokenLookup_instances, "m", _TokenLookup_getTokenForService).call(this, 'TRANSFER');
|
|
19
|
+
}
|
|
20
|
+
get flows() {
|
|
21
|
+
return tslib_1.__classPrivateFieldGet(this, _TokenLookup_instances, "m", _TokenLookup_getTokenForService).call(this, 'FLOWS');
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.TokenLookup = TokenLookup;
|
|
25
|
+
_TokenLookup_manager = new WeakMap(), _TokenLookup_instances = new WeakSet(), _TokenLookup_getTokenForService = function _TokenLookup_getTokenForService(service) {
|
|
26
|
+
var _a;
|
|
27
|
+
const resourceServer = (_a = index_js_2.CONFIG.RESOURCE_SERVERS) === null || _a === void 0 ? void 0 : _a[service];
|
|
28
|
+
const raw = (0, index_js_1.getStorage)().get(`${tslib_1.__classPrivateFieldGet(this, _TokenLookup_manager, "f").configuration.client_id}:${resourceServer}`) || 'null';
|
|
29
|
+
return JSON.parse(raw);
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=TokenLookup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TokenLookup.js","sourceRoot":"","sources":["../../../../../src/lib/core/authorization/TokenLookup.ts"],"names":[],"mappings":";;;;;AAAA,kDAAiD;AACjD,2DAA6D;AAK7D,MAAa,WAAW;IAGtB,YAAY,OAA0C;;QAFtD,uCAA+B;QAG7B,+BAAA,IAAI,wBAAY,OAAO,CAAC,OAAO,MAAA,CAAC;IAClC,CAAC;IASD,IAAI,IAAI;QACN,OAAO,+BAAA,IAAI,+DAAoB,MAAxB,IAAI,EAAqB,MAAM,CAAC,CAAC;IAC1C,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,+BAAA,IAAI,+DAAoB,MAAxB,IAAI,EAAqB,UAAU,CAAC,CAAC;IAC9C,CAAC;IAED,IAAI,KAAK;QACP,OAAO,+BAAA,IAAI,+DAAoB,MAAxB,IAAI,EAAqB,OAAO,CAAC,CAAC;IAC3C,CAAC;CACF;AAzBD,kCAyBC;yJAlBqB,OAAwD;;IAC1E,MAAM,cAAc,GAAG,MAAA,iBAAM,CAAC,gBAAgB,0CAAG,OAAO,CAAC,CAAC;IAC1D,MAAM,GAAG,GACP,IAAA,qBAAU,GAAE,CAAC,GAAG,CAAC,GAAG,+BAAA,IAAI,4BAAS,CAAC,aAAa,CAAC,SAAS,IAAI,cAAc,EAAE,CAAC,IAAI,MAAM,CAAC;IAC3F,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../../../../src/lib/core/authorization/tokens.ts"],"names":[],"mappings":"AASA;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../../../../src/lib/core/authorization/tokens.ts"],"names":[],"mappings":"AASA;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,iBAO7C"}
|
|
@@ -12,7 +12,8 @@ function isValidToken(check) {
|
|
|
12
12
|
* @returns The token string for the given scope or null if no token is found.
|
|
13
13
|
*/
|
|
14
14
|
function getTokenForScope(scope) {
|
|
15
|
-
const
|
|
15
|
+
const storageValue = (0, index_js_1.getStorage)().get(scope);
|
|
16
|
+
const token = storageValue ? JSON.parse(storageValue) : null;
|
|
16
17
|
if (!token || !isValidToken(token)) {
|
|
17
18
|
return null;
|
|
18
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../../../src/lib/core/authorization/tokens.ts"],"names":[],"mappings":";;;AAEA,kDAAiD;AAEjD,SAAS,YAAY,CAAC,KAAc;IAClC,MAAM,KAAK,GAAG,KAAc,CAAC;IAC7B,OAAO,OAAO,CAAC,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC;AACzD,CAAC;AAED;;;;GAIG;AACH,SAAgB,gBAAgB,CAAC,KAAa;IAC5C,MAAM,
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../../../src/lib/core/authorization/tokens.ts"],"names":[],"mappings":";;;AAEA,kDAAiD;AAEjD,SAAS,YAAY,CAAC,KAAc;IAClC,MAAM,KAAK,GAAG,KAAc,CAAC;IAC7B,OAAO,OAAO,CAAC,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC;AACzD,CAAC;AAED;;;;GAIG;AACH,SAAgB,gBAAgB,CAAC,KAAa;IAC5C,MAAM,YAAY,GAAG,IAAA,qBAAU,GAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC7C,MAAM,KAAK,GAAG,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC7D,IAAI,CAAC,KAAK,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;QACnC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,GAAG,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC;AACrD,CAAC;AAPD,4CAOC"}
|
package/cjs/lib/core/errors.d.ts
CHANGED
|
@@ -2,4 +2,25 @@ export declare class EnvironmentConfigurationError extends Error {
|
|
|
2
2
|
name: string;
|
|
3
3
|
constructor(variable: string, value: unknown);
|
|
4
4
|
}
|
|
5
|
+
export type WellFormedError = {
|
|
6
|
+
code: string;
|
|
7
|
+
message: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function isErrorWellFormed(test: unknown): test is WellFormedError;
|
|
10
|
+
export type ConsentRequiredError = {
|
|
11
|
+
code: 'ConsentRequired';
|
|
12
|
+
required_scopes: string[];
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
};
|
|
15
|
+
export declare function isConsentRequiredError(test: unknown): test is ConsentRequiredError;
|
|
16
|
+
export type AuthorizationRequirementsError = {
|
|
17
|
+
authorization_parameters: {
|
|
18
|
+
session_message: string;
|
|
19
|
+
session_required_identities: string[];
|
|
20
|
+
session_required_mfa: boolean;
|
|
21
|
+
session_required_single_domain: string[];
|
|
22
|
+
};
|
|
23
|
+
[key: string]: unknown;
|
|
24
|
+
};
|
|
25
|
+
export declare function isAuthorizationRequirementsError(test: unknown): test is AuthorizationRequirementsError;
|
|
5
26
|
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/lib/core/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,6BAA8B,SAAQ,KAAK;IAC7C,IAAI,SAAmC;gBAEpC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO;CAK7C"}
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/lib/core/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,6BAA8B,SAAQ,KAAK;IAC7C,IAAI,SAAmC;gBAEpC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO;CAK7C;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,eAAe,CAExE;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,iBAAiB,CAAC;IACxB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,oBAAoB,CAOlF;AAED,MAAM,MAAM,8BAA8B,GAAG;IAC3C,wBAAwB,EAAE;QACxB,eAAe,EAAE,MAAM,CAAC;QACxB,2BAA2B,EAAE,MAAM,EAAE,CAAC;QACtC,oBAAoB,EAAE,OAAO,CAAC;QAC9B,8BAA8B,EAAE,MAAM,EAAE,CAAC;KAC1C,CAAC;IACF,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF,wBAAgB,gCAAgC,CAC9C,IAAI,EAAE,OAAO,GACZ,IAAI,IAAI,8BAA8B,CAOxC"}
|
package/cjs/lib/core/errors.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EnvironmentConfigurationError = void 0;
|
|
3
|
+
exports.isAuthorizationRequirementsError = exports.isConsentRequiredError = exports.isErrorWellFormed = exports.EnvironmentConfigurationError = void 0;
|
|
4
4
|
class EnvironmentConfigurationError extends Error {
|
|
5
5
|
constructor(variable, value) {
|
|
6
6
|
super();
|
|
@@ -10,4 +10,22 @@ class EnvironmentConfigurationError extends Error {
|
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
exports.EnvironmentConfigurationError = EnvironmentConfigurationError;
|
|
13
|
+
function isErrorWellFormed(test) {
|
|
14
|
+
return typeof test === 'object' && test !== null && 'code' in test && 'message' in test;
|
|
15
|
+
}
|
|
16
|
+
exports.isErrorWellFormed = isErrorWellFormed;
|
|
17
|
+
function isConsentRequiredError(test) {
|
|
18
|
+
return (isErrorWellFormed(test) &&
|
|
19
|
+
test.code === 'ConsentRequired' &&
|
|
20
|
+
'required_scopes' in test &&
|
|
21
|
+
Array.isArray(test.required_scopes));
|
|
22
|
+
}
|
|
23
|
+
exports.isConsentRequiredError = isConsentRequiredError;
|
|
24
|
+
function isAuthorizationRequirementsError(test) {
|
|
25
|
+
return (isErrorWellFormed(test) &&
|
|
26
|
+
'authorization_parameters' in test &&
|
|
27
|
+
typeof test.authorization_parameters === 'object' &&
|
|
28
|
+
test.authorization_parameters !== null);
|
|
29
|
+
}
|
|
30
|
+
exports.isAuthorizationRequirementsError = isAuthorizationRequirementsError;
|
|
13
31
|
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../src/lib/core/errors.ts"],"names":[],"mappings":";;;AAAA,MAAa,6BAA8B,SAAQ,KAAK;IAGtD,YAAY,QAAgB,EAAE,KAAc;QAC1C,KAAK,EAAE,CAAC;QAHD,SAAI,GAAG,+BAA+B,CAAC;QAI9C,4EAA4E;QAC5E,IAAI,CAAC,OAAO,GAAG,4CAA4C,QAAQ,KAAK,KAAK,IAAI,CAAC;IACpF,CAAC;CACF;AARD,sEAQC"}
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../src/lib/core/errors.ts"],"names":[],"mappings":";;;AAAA,MAAa,6BAA8B,SAAQ,KAAK;IAGtD,YAAY,QAAgB,EAAE,KAAc;QAC1C,KAAK,EAAE,CAAC;QAHD,SAAI,GAAG,+BAA+B,CAAC;QAI9C,4EAA4E;QAC5E,IAAI,CAAC,OAAO,GAAG,4CAA4C,QAAQ,KAAK,KAAK,IAAI,CAAC;IACpF,CAAC;CACF;AARD,sEAQC;AAOD,SAAgB,iBAAiB,CAAC,IAAa;IAC7C,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,SAAS,IAAI,IAAI,CAAC;AAC1F,CAAC;AAFD,8CAEC;AAQD,SAAgB,sBAAsB,CAAC,IAAa;IAClD,OAAO,CACL,iBAAiB,CAAC,IAAI,CAAC;QACvB,IAAI,CAAC,IAAI,KAAK,iBAAiB;QAC/B,iBAAiB,IAAI,IAAI;QACzB,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,CACpC,CAAC;AACJ,CAAC;AAPD,wDAOC;AAYD,SAAgB,gCAAgC,CAC9C,IAAa;IAEb,OAAO,CACL,iBAAiB,CAAC,IAAI,CAAC;QACvB,0BAA0B,IAAI,IAAI;QAClC,OAAO,IAAI,CAAC,wBAAwB,KAAK,QAAQ;QACjD,IAAI,CAAC,wBAAwB,KAAK,IAAI,CACvC,CAAC;AACJ,CAAC;AATD,4EASC"}
|
package/cjs/lib/core/global.d.ts
CHANGED
|
@@ -40,6 +40,7 @@ export declare function getSDKOptions(options?: SDKOptions): {
|
|
|
40
40
|
keepalive?: boolean | undefined;
|
|
41
41
|
method?: string | undefined;
|
|
42
42
|
mode?: RequestMode | undefined;
|
|
43
|
+
priority?: RequestPriority | undefined;
|
|
43
44
|
redirect?: RequestRedirect | undefined;
|
|
44
45
|
referrer?: string | undefined;
|
|
45
46
|
referrerPolicy?: ReferrerPolicy | undefined;
|