@globus/sdk 3.0.0-alpha.1 → 3.0.0-alpha.11
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 +6 -1
- 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 +7 -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 +6 -1
- 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 +7 -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,43 +1,60 @@
|
|
|
1
|
-
var _AuthorizationManager_instances, _AuthorizationManager_transport,
|
|
1
|
+
var _AuthorizationManager_instances, _AuthorizationManager_transport, _AuthorizationManager_authenticated, _AuthorizationManager_checkAuthorizationState, _AuthorizationManager_bootstrapFromStorageState, _AuthorizationManager_emitAuthenticatedState, _AuthorizationManager_buildTransport;
|
|
2
2
|
import { __awaiter, __classPrivateFieldGet, __classPrivateFieldSet } from "tslib";
|
|
3
|
-
import { getAuthorizationEndpoint, getTokenEndpoint, isGlobusAuthTokenResponse,
|
|
3
|
+
import { getAuthorizationEndpoint, getTokenEndpoint, isGlobusAuthTokenResponse, } from '../../services/auth/index.js';
|
|
4
4
|
import { createStorage, getStorage } from '../storage/index.js';
|
|
5
5
|
import { log } from '../logger.js';
|
|
6
6
|
import { Event } from './Event.js';
|
|
7
7
|
import { RedirectTransport } from './RedirectTransport.js';
|
|
8
|
+
import { TokenLookup } from './TokenLookup.js';
|
|
9
|
+
import { isConsentRequiredError, isAuthorizationRequirementsError, } from '../errors.js';
|
|
8
10
|
/**
|
|
9
11
|
* @experimental
|
|
10
12
|
*/
|
|
11
13
|
export class AuthorizationManager {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
/**
|
|
15
|
+
* The `AuthorizationManager` is consdiered `authenticated` if it has a valid Globus Auth token.
|
|
16
|
+
* It does not necessarily mean that it has a valid token for a specific resource server.
|
|
17
|
+
*/
|
|
18
|
+
get authenticated() {
|
|
19
|
+
return __classPrivateFieldGet(this, _AuthorizationManager_authenticated, "f");
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Set the authenticated state and emit the `authenticated` event.
|
|
23
|
+
*/
|
|
24
|
+
set authenticated(value) {
|
|
25
|
+
__classPrivateFieldSet(this, _AuthorizationManager_authenticated, value, "f");
|
|
26
|
+
__classPrivateFieldGet(this, _AuthorizationManager_instances, "m", _AuthorizationManager_emitAuthenticatedState).call(this);
|
|
20
27
|
}
|
|
21
28
|
constructor(configuration) {
|
|
22
29
|
_AuthorizationManager_instances.add(this);
|
|
23
30
|
_AuthorizationManager_transport.set(this, void 0);
|
|
24
|
-
|
|
25
|
-
this.authenticated = false;
|
|
31
|
+
_AuthorizationManager_authenticated.set(this, false);
|
|
26
32
|
this.events = {
|
|
27
33
|
/**
|
|
28
34
|
* Emitted when the authenticated state changes.
|
|
35
|
+
* @event AuthorizationManager.events#authenticated
|
|
36
|
+
* @type {object}
|
|
37
|
+
* @property {boolean} isAuthenticated - Whether the `AuthorizationManager` is authenticated.
|
|
38
|
+
* @property {TokenResponse} [token] - The token response if the `AuthorizationManager` is authenticated.
|
|
29
39
|
*/
|
|
30
40
|
authenticated: new Event('authenticated'),
|
|
31
41
|
/**
|
|
32
42
|
* Emitted when the user revokes their authentication.
|
|
43
|
+
* @event AuthorizationManager.events#revoke
|
|
33
44
|
*/
|
|
34
45
|
revoke: new Event('revoke'),
|
|
35
46
|
};
|
|
47
|
+
/**
|
|
48
|
+
* Add a Globus Auth token response to storage, if `other_tokens` are present they are also added.
|
|
49
|
+
* This method is mostly used internally by the `AuthorizationManager`, but can be used by downstream
|
|
50
|
+
* consumers to add tokens to storage if necessary.
|
|
51
|
+
*/
|
|
36
52
|
this.addTokenResponse = (token) => {
|
|
37
|
-
getStorage().set(`${
|
|
53
|
+
getStorage().set(`${this.configuration.client_id}:${token.resource_server}`, token);
|
|
38
54
|
if ('other_tokens' in token) {
|
|
39
55
|
token.other_tokens.forEach(this.addTokenResponse);
|
|
40
56
|
}
|
|
57
|
+
__classPrivateFieldGet(this, _AuthorizationManager_instances, "m", _AuthorizationManager_checkAuthorizationState).call(this);
|
|
41
58
|
};
|
|
42
59
|
/**
|
|
43
60
|
* @todo Add support for passing in an alternative storage mechanism.
|
|
@@ -46,7 +63,14 @@ export class AuthorizationManager {
|
|
|
46
63
|
if (!configuration.client_id) {
|
|
47
64
|
throw new Error('You must provide a `client_id` for your application.');
|
|
48
65
|
}
|
|
49
|
-
|
|
66
|
+
this.configuration = Object.assign(Object.assign({}, configuration), {
|
|
67
|
+
/**
|
|
68
|
+
* Inject the `openid`, `profile`, `email`, and `offline_access` scopes by default.
|
|
69
|
+
*/
|
|
70
|
+
requested_scopes: `${configuration.requested_scopes} openid profile email offline_access` });
|
|
71
|
+
this.tokens = new TokenLookup({
|
|
72
|
+
manager: this,
|
|
73
|
+
});
|
|
50
74
|
this.startSilentRenew();
|
|
51
75
|
}
|
|
52
76
|
startSilentRenew() {
|
|
@@ -58,45 +82,89 @@ export class AuthorizationManager {
|
|
|
58
82
|
return this.getGlobusAuthToken() !== null;
|
|
59
83
|
}
|
|
60
84
|
getGlobusAuthToken() {
|
|
61
|
-
const entry = getStorage().get(`${
|
|
85
|
+
const entry = getStorage().get(`${this.configuration.client_id}:auth.globus.org`);
|
|
62
86
|
return entry ? JSON.parse(entry) : null;
|
|
63
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* Reset the authenticated state and clear all tokens from storage.
|
|
90
|
+
* This method **does not** emit the `revoke` event. If you need to emit the `revoke` event, use the `AuthorizationManager.revoke` method.
|
|
91
|
+
*/
|
|
64
92
|
reset() {
|
|
65
|
-
|
|
93
|
+
/**
|
|
94
|
+
* @todo This should be made specific to the keys generated by the `AuthorizationManager`.
|
|
95
|
+
*/
|
|
66
96
|
getStorage().clear();
|
|
97
|
+
this.authenticated = false;
|
|
67
98
|
}
|
|
68
|
-
|
|
99
|
+
/**
|
|
100
|
+
* Initiate the login process by redirecting to the Globus Auth login page.
|
|
101
|
+
*/
|
|
102
|
+
login() {
|
|
69
103
|
this.reset();
|
|
104
|
+
/**
|
|
105
|
+
* In the future, it's possible that we may want to support different types of transports.
|
|
106
|
+
*/
|
|
70
107
|
const transport = __classPrivateFieldGet(this, _AuthorizationManager_instances, "m", _AuthorizationManager_buildTransport).call(this);
|
|
71
108
|
transport.send();
|
|
72
109
|
}
|
|
73
110
|
handleCodeRedirect() {
|
|
74
111
|
return __awaiter(this, void 0, void 0, function* () {
|
|
112
|
+
log('debug', 'AuthorizationManager.handleCodeRedirect');
|
|
75
113
|
const response = yield __classPrivateFieldGet(this, _AuthorizationManager_instances, "m", _AuthorizationManager_buildTransport).call(this).getToken();
|
|
76
114
|
if (isGlobusAuthTokenResponse(response)) {
|
|
115
|
+
log('debug', `AuthorizationManager.handleCodeRedirect | response=${JSON.stringify(response)}`);
|
|
77
116
|
this.addTokenResponse(response);
|
|
78
|
-
this.authenticated = true;
|
|
79
|
-
yield __classPrivateFieldGet(this, _AuthorizationManager_instances, "m", _AuthorizationManager_emitAuthenticatedState).call(this);
|
|
80
117
|
}
|
|
81
118
|
});
|
|
82
119
|
}
|
|
120
|
+
handleErrorResponse(response, execute = true) {
|
|
121
|
+
log('debug', `AuthorizationManager.handleErrorResponse | response=${JSON.stringify(response)} execute=${execute}`);
|
|
122
|
+
let handler = () => { };
|
|
123
|
+
if (isAuthorizationRequirementsError(response)) {
|
|
124
|
+
log('debug', 'AuthorizationManager.handleErrorResponse | error=AuthorizationRequirementsError');
|
|
125
|
+
handler = () => this.handleAuthorizationRequirementsError(response);
|
|
126
|
+
}
|
|
127
|
+
if (isConsentRequiredError(response)) {
|
|
128
|
+
log('debug', 'AuthorizationManager.handleErrorResponse | error=ConsentRequiredError');
|
|
129
|
+
handler = () => this.handleConsentRequiredError(response);
|
|
130
|
+
}
|
|
131
|
+
if ('code' in response && response['code'] === 'AuthenticationFailed') {
|
|
132
|
+
log('debug', 'AuthorizationManager.handleErrorResponse | error=AuthenticationFailed');
|
|
133
|
+
handler = () => this.revoke();
|
|
134
|
+
}
|
|
135
|
+
return execute === true ? handler() : handler;
|
|
136
|
+
}
|
|
83
137
|
/**
|
|
84
|
-
*
|
|
138
|
+
* Process a well-formed Authorization Requirements error response from a Globus service
|
|
139
|
+
* and redirect the user to the Globus Auth login page with the necessary parameters.
|
|
140
|
+
*/
|
|
141
|
+
handleAuthorizationRequirementsError(response) {
|
|
142
|
+
__classPrivateFieldSet(this, _AuthorizationManager_transport, __classPrivateFieldGet(this, _AuthorizationManager_instances, "m", _AuthorizationManager_buildTransport).call(this, {
|
|
143
|
+
params: {
|
|
144
|
+
session_message: response.authorization_parameters.session_message,
|
|
145
|
+
session_required_identities: response.authorization_parameters.session_required_identities.join(','),
|
|
146
|
+
session_required_mfa: response.authorization_parameters.session_required_mfa,
|
|
147
|
+
session_required_single_domain: response.authorization_parameters.session_required_single_domain.join(','),
|
|
148
|
+
prompt: 'login',
|
|
149
|
+
},
|
|
150
|
+
}), "f");
|
|
151
|
+
__classPrivateFieldGet(this, _AuthorizationManager_transport, "f").send();
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Process a well-formed `ConsentRequired` error response from a Globus service
|
|
155
|
+
* and redirect the user to the Globus Auth login page with the necessary parameters.
|
|
85
156
|
*/
|
|
86
|
-
// handleErrorResponse(response: { code: string }) {
|
|
87
|
-
// if (response.code === 'ConsentRequired') {
|
|
88
|
-
// this.handleConsentRequiredError(response);
|
|
89
|
-
// }
|
|
90
|
-
// if (response.code === 'AuthenticationFailed') {
|
|
91
|
-
// this.revoke();
|
|
92
|
-
// }
|
|
93
|
-
// }
|
|
94
157
|
handleConsentRequiredError(response) {
|
|
95
158
|
__classPrivateFieldSet(this, _AuthorizationManager_transport, __classPrivateFieldGet(this, _AuthorizationManager_instances, "m", _AuthorizationManager_buildTransport).call(this, {
|
|
96
159
|
requested_scopes: response.required_scopes.join(' '),
|
|
97
160
|
}), "f");
|
|
98
161
|
__classPrivateFieldGet(this, _AuthorizationManager_transport, "f").send();
|
|
99
162
|
}
|
|
163
|
+
/**
|
|
164
|
+
* Call `AuthroizationManager.reset` and emit the `revoke` event.
|
|
165
|
+
* @emits AuthorizationManager.events#revoke
|
|
166
|
+
* @see AuthorizationManager.reset
|
|
167
|
+
*/
|
|
100
168
|
revoke() {
|
|
101
169
|
return __awaiter(this, void 0, void 0, function* () {
|
|
102
170
|
this.reset();
|
|
@@ -104,18 +172,19 @@ export class AuthorizationManager {
|
|
|
104
172
|
});
|
|
105
173
|
}
|
|
106
174
|
}
|
|
107
|
-
_AuthorizationManager_transport = new WeakMap(),
|
|
175
|
+
_AuthorizationManager_transport = new WeakMap(), _AuthorizationManager_authenticated = new WeakMap(), _AuthorizationManager_instances = new WeakSet(), _AuthorizationManager_checkAuthorizationState = function _AuthorizationManager_checkAuthorizationState() {
|
|
176
|
+
log('debug', 'AuthorizationManager.#checkAuthorizationState');
|
|
177
|
+
if (this.hasGlobusAuthToken()) {
|
|
178
|
+
this.authenticated = true;
|
|
179
|
+
}
|
|
180
|
+
}, _AuthorizationManager_bootstrapFromStorageState = function _AuthorizationManager_bootstrapFromStorageState() {
|
|
108
181
|
return __awaiter(this, void 0, void 0, function* () {
|
|
109
182
|
log('debug', 'AuthorizationManager.bootstrapFromStorageState');
|
|
110
|
-
|
|
111
|
-
log('debug', 'AuthorizationManager.bootstrapFromStorageState: hasGlobusAuthToken');
|
|
112
|
-
this.authenticated = true;
|
|
113
|
-
yield __classPrivateFieldGet(this, _AuthorizationManager_instances, "m", _AuthorizationManager_emitAuthenticatedState).call(this);
|
|
114
|
-
}
|
|
183
|
+
__classPrivateFieldGet(this, _AuthorizationManager_instances, "m", _AuthorizationManager_checkAuthorizationState).call(this);
|
|
115
184
|
});
|
|
116
185
|
}, _AuthorizationManager_emitAuthenticatedState = function _AuthorizationManager_emitAuthenticatedState() {
|
|
117
|
-
var _a;
|
|
118
186
|
return __awaiter(this, void 0, void 0, function* () {
|
|
187
|
+
var _a;
|
|
119
188
|
const isAuthenticated = this.authenticated;
|
|
120
189
|
const token = (_a = this.getGlobusAuthToken()) !== null && _a !== void 0 ? _a : undefined;
|
|
121
190
|
yield this.events.authenticated.dispatch({
|
|
@@ -124,6 +193,6 @@ _AuthorizationManager_transport = new WeakMap(), _AuthorizationManager_configura
|
|
|
124
193
|
});
|
|
125
194
|
});
|
|
126
195
|
}, _AuthorizationManager_buildTransport = function _AuthorizationManager_buildTransport(overrides) {
|
|
127
|
-
return new RedirectTransport(Object.assign({ client_id:
|
|
196
|
+
return new RedirectTransport(Object.assign({ client_id: this.configuration.client_id, authorization_endpoint: getAuthorizationEndpoint(), token_endpoint: getTokenEndpoint(), redirect_uri: this.configuration.redirect_uri, requested_scopes: this.configuration.requested_scopes }, overrides));
|
|
128
197
|
};
|
|
129
198
|
//# sourceMappingURL=AuthorizationManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthorizationManager.js","sourceRoot":"","sources":["../../../../../src/lib/core/authorization/AuthorizationManager.ts"],"names":[],"mappings":";;AAEA,OAAO,EAGL,wBAAwB,EACxB,gBAAgB,EAChB,yBAAyB,
|
|
1
|
+
{"version":3,"file":"AuthorizationManager.js","sourceRoot":"","sources":["../../../../../src/lib/core/authorization/AuthorizationManager.ts"],"names":[],"mappings":";;AAEA,OAAO,EAGL,wBAAwB,EACxB,gBAAgB,EAChB,yBAAyB,GAC1B,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAEnC,OAAO,EAAE,KAAK,EAAE,MAAM,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B,EAAE,mCAAI,SAAS,CAAC;QACrD,MAAM,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC;YACvC,eAAe;YACf,KAAK;SACN,CAAC,CAAC;IACL,CAAC;wFAce,SAAuE;IACrF,OAAO,IAAI,iBAAiB,iBAC1B,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,SAAS,EACvC,sBAAsB,EAAE,wBAAwB,EAAE,EAClD,cAAc,EAAE,gBAAgB,EAAE,EAClC,YAAY,EAAE,IAAI,CAAC,aAAa,CAAC,YAAY,EAC7C,gBAAgB,EAAE,IAAI,CAAC,aAAa,CAAC,gBAAgB,IAClD,SAAS,EACZ,CAAC;AACL,CAAC"}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @todo It would be nice to not `| any` here, but ideally callers do not need to
|
|
3
|
+
* fully type the payload to attach listeners.
|
|
4
|
+
*/
|
|
5
|
+
type ListenerCallback<P> = (payload?: P | any) => Promise<void> | void;
|
|
2
6
|
export declare class Event<EventName extends string, Payload extends unknown> {
|
|
3
7
|
#private;
|
|
4
8
|
readonly name: EventName;
|
|
5
9
|
constructor(name: EventName);
|
|
6
10
|
addListener(callback: ListenerCallback<Payload>): () => void;
|
|
7
11
|
removeListener(callback: ListenerCallback<Payload>): void;
|
|
12
|
+
clearListeners(): void;
|
|
8
13
|
dispatch(payload?: Payload): Promise<void>;
|
|
9
14
|
}
|
|
10
15
|
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,
|
|
1
|
+
{"version":3,"file":"Event.d.ts","sourceRoot":"","sources":["../../../../../src/lib/core/authorization/Event.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,KAAK,gBAAgB,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AAEvE,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"}
|
|
@@ -12,6 +12,9 @@ export class Event {
|
|
|
12
12
|
removeListener(callback) {
|
|
13
13
|
__classPrivateFieldSet(this, _Event_callbacks, __classPrivateFieldGet(this, _Event_callbacks, "f").filter((cb) => cb !== callback), "f");
|
|
14
14
|
}
|
|
15
|
+
clearListeners() {
|
|
16
|
+
__classPrivateFieldSet(this, _Event_callbacks, [], "f");
|
|
17
|
+
}
|
|
15
18
|
dispatch(payload) {
|
|
16
19
|
return __awaiter(this, void 0, void 0, function* () {
|
|
17
20
|
yield Promise.all(__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":";;
|
|
1
|
+
{"version":3,"file":"Event.js","sourceRoot":"","sources":["../../../../../src/lib/core/authorization/Event.ts"],"names":[],"mappings":";;AAMA,MAAM,OAAO,KAAK;IAGhB,YAAqB,IAAe;QAAf,SAAI,GAAJ,IAAI,CAAW;QAFpC,2BAA0C,EAAE,EAAC;IAEN,CAAC;IAExC,WAAW,CAAC,QAAmC;QAC7C,uBAAA,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,uBAAA,IAAI,oBAAc,uBAAA,IAAI,wBAAW,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,QAAQ,CAAC,MAAA,CAAC;IACpE,CAAC;IAED,cAAc;QACZ,uBAAA,IAAI,oBAAc,EAAE,MAAA,CAAC;IACvB,CAAC;IAEK,QAAQ,CAAC,OAAiB;;YAC9B,MAAM,OAAO,CAAC,GAAG,CAAC,uBAAA,IAAI,wBAAW,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC1E,CAAC;KAAA;CACF"}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import type IConfig from 'js-pkce/dist/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,13 +1,16 @@
|
|
|
1
|
-
var _RedirectTransport_pkce;
|
|
2
|
-
import { __awaiter, __classPrivateFieldGet, __classPrivateFieldSet } from "tslib";
|
|
1
|
+
var _RedirectTransport_pkce, _RedirectTransport_params;
|
|
2
|
+
import { __awaiter, __classPrivateFieldGet, __classPrivateFieldSet, __rest } from "tslib";
|
|
3
3
|
import PKCE from 'js-pkce';
|
|
4
4
|
export class RedirectTransport {
|
|
5
5
|
constructor(options) {
|
|
6
6
|
_RedirectTransport_pkce.set(this, void 0);
|
|
7
|
-
|
|
7
|
+
_RedirectTransport_params.set(this, {});
|
|
8
|
+
const { params } = options, config = __rest(options, ["params"]);
|
|
9
|
+
__classPrivateFieldSet(this, _RedirectTransport_pkce, new PKCE(Object.assign({}, config)), "f");
|
|
10
|
+
__classPrivateFieldSet(this, _RedirectTransport_params, Object.assign({}, params), "f");
|
|
8
11
|
}
|
|
9
12
|
send() {
|
|
10
|
-
window.location.replace(__classPrivateFieldGet(this, _RedirectTransport_pkce, "f").authorizeUrl());
|
|
13
|
+
window.location.replace(__classPrivateFieldGet(this, _RedirectTransport_pkce, "f").authorizeUrl(__classPrivateFieldGet(this, _RedirectTransport_params, "f")));
|
|
11
14
|
}
|
|
12
15
|
getToken() {
|
|
13
16
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -30,5 +33,5 @@ export class RedirectTransport {
|
|
|
30
33
|
});
|
|
31
34
|
}
|
|
32
35
|
}
|
|
33
|
-
_RedirectTransport_pkce = new WeakMap();
|
|
36
|
+
_RedirectTransport_pkce = new WeakMap(), _RedirectTransport_params = new WeakMap();
|
|
34
37
|
//# sourceMappingURL=RedirectTransport.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RedirectTransport.js","sourceRoot":"","sources":["../../../../../src/lib/core/authorization/RedirectTransport.ts"],"names":[],"mappings":";;AAAA,OAAO,IAAI,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"RedirectTransport.js","sourceRoot":"","sources":["../../../../../src/lib/core/authorization/RedirectTransport.ts"],"names":[],"mappings":";;AAAA,OAAO,IAAI,MAAM,SAAS,CAAC;AAI3B,MAAM,OAAO,iBAAiB;IAK5B,YACE,OAKC;QAVH,0CAAY;QAEZ,oCAAmB,EAAE,EAAC;QAUpB,MAAM,EAAE,MAAM,KAAgB,OAAO,EAAlB,MAAM,UAAK,OAAO,EAA/B,UAAqB,CAAU,CAAC;QACtC,uBAAA,IAAI,2BAAS,IAAI,IAAI,mBAChB,MAAM,EACT,MAAA,CAAC;QACH,uBAAA,IAAI,+CACC,MAAM,OACV,CAAC;IACJ,CAAC;IAED,IAAI;QACF,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,uBAAA,IAAI,+BAAM,CAAC,YAAY,CAAC,uBAAA,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,uBAAA,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"}
|
|
@@ -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,27 @@
|
|
|
1
|
+
var _TokenLookup_instances, _TokenLookup_manager, _TokenLookup_getTokenForService;
|
|
2
|
+
import { __classPrivateFieldGet, __classPrivateFieldSet } from "tslib";
|
|
3
|
+
import { getStorage } from '../storage/index.js';
|
|
4
|
+
import { CONFIG } from '../../services/auth/index.js';
|
|
5
|
+
export class TokenLookup {
|
|
6
|
+
constructor(options) {
|
|
7
|
+
_TokenLookup_instances.add(this);
|
|
8
|
+
_TokenLookup_manager.set(this, void 0);
|
|
9
|
+
__classPrivateFieldSet(this, _TokenLookup_manager, options.manager, "f");
|
|
10
|
+
}
|
|
11
|
+
get auth() {
|
|
12
|
+
return __classPrivateFieldGet(this, _TokenLookup_instances, "m", _TokenLookup_getTokenForService).call(this, 'AUTH');
|
|
13
|
+
}
|
|
14
|
+
get transfer() {
|
|
15
|
+
return __classPrivateFieldGet(this, _TokenLookup_instances, "m", _TokenLookup_getTokenForService).call(this, 'TRANSFER');
|
|
16
|
+
}
|
|
17
|
+
get flows() {
|
|
18
|
+
return __classPrivateFieldGet(this, _TokenLookup_instances, "m", _TokenLookup_getTokenForService).call(this, 'FLOWS');
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
_TokenLookup_manager = new WeakMap(), _TokenLookup_instances = new WeakSet(), _TokenLookup_getTokenForService = function _TokenLookup_getTokenForService(service) {
|
|
22
|
+
var _a;
|
|
23
|
+
const resourceServer = (_a = CONFIG.RESOURCE_SERVERS) === null || _a === void 0 ? void 0 : _a[service];
|
|
24
|
+
const raw = getStorage().get(`${__classPrivateFieldGet(this, _TokenLookup_manager, "f").configuration.client_id}:${resourceServer}`) || 'null';
|
|
25
|
+
return JSON.parse(raw);
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=TokenLookup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TokenLookup.js","sourceRoot":"","sources":["../../../../../src/lib/core/authorization/TokenLookup.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAS,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAK7D,MAAM,OAAO,WAAW;IAGtB,YAAY,OAA0C;;QAFtD,uCAA+B;QAG7B,uBAAA,IAAI,wBAAY,OAAO,CAAC,OAAO,MAAA,CAAC;IAClC,CAAC;IASD,IAAI,IAAI;QACN,OAAO,uBAAA,IAAI,+DAAoB,MAAxB,IAAI,EAAqB,MAAM,CAAC,CAAC;IAC1C,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,uBAAA,IAAI,+DAAoB,MAAxB,IAAI,EAAqB,UAAU,CAAC,CAAC;IAC9C,CAAC;IAED,IAAI,KAAK;QACP,OAAO,uBAAA,IAAI,+DAAoB,MAAxB,IAAI,EAAqB,OAAO,CAAC,CAAC;IAC3C,CAAC;CACF;yJAlBqB,OAAwD;;IAC1E,MAAM,cAAc,GAAG,MAAA,MAAM,CAAC,gBAAgB,0CAAG,OAAO,CAAC,CAAC;IAC1D,MAAM,GAAG,GACP,UAAU,EAAE,CAAC,GAAG,CAAC,GAAG,uBAAA,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"}
|
|
@@ -9,7 +9,8 @@ function isValidToken(check) {
|
|
|
9
9
|
* @returns The token string for the given scope or null if no token is found.
|
|
10
10
|
*/
|
|
11
11
|
export function getTokenForScope(scope) {
|
|
12
|
-
const
|
|
12
|
+
const storageValue = getStorage().get(scope);
|
|
13
|
+
const token = storageValue ? JSON.parse(storageValue) : null;
|
|
13
14
|
if (!token || !isValidToken(token)) {
|
|
14
15
|
return null;
|
|
15
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../../../src/lib/core/authorization/tokens.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;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,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,MAAM,
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../../../src/lib/core/authorization/tokens.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;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,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,MAAM,YAAY,GAAG,UAAU,EAAE,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"}
|
package/esm/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/esm/lib/core/errors.js
CHANGED
|
@@ -6,4 +6,19 @@ export class EnvironmentConfigurationError extends Error {
|
|
|
6
6
|
this.message = `Invalid configuration value provided for ${variable} (${value}).`;
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
+
export function isErrorWellFormed(test) {
|
|
10
|
+
return typeof test === 'object' && test !== null && 'code' in test && 'message' in test;
|
|
11
|
+
}
|
|
12
|
+
export function isConsentRequiredError(test) {
|
|
13
|
+
return (isErrorWellFormed(test) &&
|
|
14
|
+
test.code === 'ConsentRequired' &&
|
|
15
|
+
'required_scopes' in test &&
|
|
16
|
+
Array.isArray(test.required_scopes));
|
|
17
|
+
}
|
|
18
|
+
export function isAuthorizationRequirementsError(test) {
|
|
19
|
+
return (isErrorWellFormed(test) &&
|
|
20
|
+
'authorization_parameters' in test &&
|
|
21
|
+
typeof test.authorization_parameters === 'object' &&
|
|
22
|
+
test.authorization_parameters !== null);
|
|
23
|
+
}
|
|
9
24
|
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../src/lib/core/errors.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,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"}
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../src/lib/core/errors.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,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;AAOD,MAAM,UAAU,iBAAiB,CAAC,IAAa;IAC7C,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,SAAS,IAAI,IAAI,CAAC;AAC1F,CAAC;AAQD,MAAM,UAAU,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;AAYD,MAAM,UAAU,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"}
|
package/esm/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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../../../../src/lib/core/global.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAwBlD;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;CAOf,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAE3E,wBAAgB,cAAc,IAAI,WAAW,CAM5C;AAED,eAAO,MAAM,QAAQ;;;;;;;CAOpB,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,MAAM,OAAO,QAAQ,CAAC;AAE5C,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAO/E,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,UAAU
|
|
1
|
+
{"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../../../../src/lib/core/global.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAwBlD;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;CAOf,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAE3E,wBAAgB,cAAc,IAAI,WAAW,CAM5C;AAED,eAAO,MAAM,QAAQ;;;;;;;CAOpB,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,MAAM,OAAO,QAAQ,CAAC;AAE5C,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAO/E,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,UAAU;;;;;;;;;;;;;;;;;;;;;;;EAqBjD;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAQtC;AAED;;GAEG;AACH,wBAAgB,cAAc,kBAM7B;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,GAAE,WAA8B,sBAE3F;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,GAAE,WAA8B,sBAG9F"}
|
|
@@ -2,13 +2,13 @@ var _LocalStorage_storage;
|
|
|
2
2
|
import { __classPrivateFieldGet } from "tslib";
|
|
3
3
|
export class LocalStorage {
|
|
4
4
|
constructor() {
|
|
5
|
-
_LocalStorage_storage.set(this,
|
|
5
|
+
_LocalStorage_storage.set(this, globalThis.localStorage);
|
|
6
6
|
}
|
|
7
7
|
get(key) {
|
|
8
8
|
return __classPrivateFieldGet(this, _LocalStorage_storage, "f").getItem(key);
|
|
9
9
|
}
|
|
10
10
|
set(key, value) {
|
|
11
|
-
__classPrivateFieldGet(this, _LocalStorage_storage, "f").setItem(key, JSON.stringify(value));
|
|
11
|
+
__classPrivateFieldGet(this, _LocalStorage_storage, "f").setItem(key, typeof value !== 'string' ? JSON.stringify(value) : value);
|
|
12
12
|
}
|
|
13
13
|
remove(key) {
|
|
14
14
|
__classPrivateFieldGet(this, _LocalStorage_storage, "f").removeItem(key);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-storage.js","sourceRoot":"","sources":["../../../../../src/lib/core/storage/local-storage.ts"],"names":[],"mappings":";;AAEA,MAAM,OAAO,YAAY;IAAzB;QACE,gCAAW,
|
|
1
|
+
{"version":3,"file":"local-storage.js","sourceRoot":"","sources":["../../../../../src/lib/core/storage/local-storage.ts"],"names":[],"mappings":";;AAEA,MAAM,OAAO,YAAY;IAAzB;QACE,gCAAW,UAAU,CAAC,YAAY,EAAC;IAiBrC,CAAC;IAfC,GAAG,CAAC,GAAW;QACb,OAAO,uBAAA,IAAI,6BAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACpC,CAAC;IAED,GAAG,CAAC,GAAW,EAAE,KAAc;QAC7B,uBAAA,IAAI,6BAAS,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IACxF,CAAC;IAED,MAAM,CAAC,GAAW;QAChB,uBAAA,IAAI,6BAAS,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC;IAED,KAAK;QACH,uBAAA,IAAI,6BAAS,CAAC,KAAK,EAAE,CAAC;IACxB,CAAC;CACF"}
|
|
@@ -2,7 +2,7 @@ import { StorageSystem } from './index.js';
|
|
|
2
2
|
export declare class MemoryStorage implements StorageSystem {
|
|
3
3
|
#private;
|
|
4
4
|
get(key: string): string | null;
|
|
5
|
-
set(key: string, value:
|
|
5
|
+
set(key: string, value: unknown): void;
|
|
6
6
|
remove(key: string): void;
|
|
7
7
|
clear(): void;
|
|
8
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../../../../src/lib/core/storage/memory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,qBAAa,aAAc,YAAW,aAAa;;IAGjD,GAAG,CAAC,GAAG,EAAE,MAAM;IAIf,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../../../../src/lib/core/storage/memory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,qBAAa,aAAc,YAAW,aAAa;;IAGjD,GAAG,CAAC,GAAG,EAAE,MAAM;IAIf,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO;IAI/B,MAAM,CAAC,GAAG,EAAE,MAAM;IAIlB,KAAK;CAGN"}
|
|
@@ -5,10 +5,10 @@ export class MemoryStorage {
|
|
|
5
5
|
_MemoryStorage_storage.set(this, {});
|
|
6
6
|
}
|
|
7
7
|
get(key) {
|
|
8
|
-
return __classPrivateFieldGet(this, _MemoryStorage_storage, "f")[key];
|
|
8
|
+
return __classPrivateFieldGet(this, _MemoryStorage_storage, "f")[key] !== undefined ? __classPrivateFieldGet(this, _MemoryStorage_storage, "f")[key] : null;
|
|
9
9
|
}
|
|
10
10
|
set(key, value) {
|
|
11
|
-
__classPrivateFieldGet(this, _MemoryStorage_storage, "f")[key] = value;
|
|
11
|
+
__classPrivateFieldGet(this, _MemoryStorage_storage, "f")[key] = typeof value !== 'string' ? JSON.stringify(value) : value;
|
|
12
12
|
}
|
|
13
13
|
remove(key) {
|
|
14
14
|
delete __classPrivateFieldGet(this, _MemoryStorage_storage, "f")[key];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.js","sourceRoot":"","sources":["../../../../../src/lib/core/storage/memory.ts"],"names":[],"mappings":";;AAEA,MAAM,OAAO,aAAa;IAA1B;QACE,iCAA0C,EAAE,EAAC;IAiB/C,CAAC;IAfC,GAAG,CAAC,GAAW;QACb,OAAO,uBAAA,IAAI,8BAAS,CAAC,GAAG,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"memory.js","sourceRoot":"","sources":["../../../../../src/lib/core/storage/memory.ts"],"names":[],"mappings":";;AAEA,MAAM,OAAO,aAAa;IAA1B;QACE,iCAA0C,EAAE,EAAC;IAiB/C,CAAC;IAfC,GAAG,CAAC,GAAW;QACb,OAAO,uBAAA,IAAI,8BAAS,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,uBAAA,IAAI,8BAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACtE,CAAC;IAED,GAAG,CAAC,GAAW,EAAE,KAAc;QAC7B,uBAAA,IAAI,8BAAS,CAAC,GAAG,CAAC,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACjF,CAAC;IAED,MAAM,CAAC,GAAW;QAChB,OAAO,uBAAA,IAAI,8BAAS,CAAC,GAAG,CAAC,CAAC;IAC5B,CAAC;IAED,KAAK;QACH,uBAAA,IAAI,0BAAY,EAAE,MAAA,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description A wrapper around the Globus Auth service.
|
|
3
|
-
* @group Service
|
|
4
|
-
* @see [Globus Auth API Documentation](https://docs.globus.org/api/auth/)
|
|
5
|
-
* @module
|
|
6
|
-
*/
|
|
7
|
-
import type ITokenResponse from 'js-pkce/dist/ITokenResponse';
|
|
8
1
|
import * as AUTH from './config.js';
|
|
9
2
|
/**
|
|
10
3
|
* @private
|
|
@@ -15,15 +8,20 @@ export declare function getAuthorizationEndpoint(): string;
|
|
|
15
8
|
export declare function getTokenEndpoint(): string;
|
|
16
9
|
export * as identities from './service/identities.js';
|
|
17
10
|
export * as oauth2 from './service/oauth2/index.js';
|
|
18
|
-
export type Token =
|
|
11
|
+
export type Token = {
|
|
12
|
+
access_token: string;
|
|
13
|
+
scope: string;
|
|
14
|
+
expires_in: number;
|
|
15
|
+
token_type: string;
|
|
19
16
|
resource_server: string;
|
|
20
|
-
|
|
17
|
+
refresh_token?: string;
|
|
21
18
|
};
|
|
22
19
|
/**
|
|
23
20
|
* @see https://docs.globus.org/api/auth/reference/#authorization_code_grant_preferred
|
|
24
21
|
*/
|
|
25
22
|
export type TokenResponse = Token & {
|
|
26
23
|
state: string;
|
|
24
|
+
id_token?: string;
|
|
27
25
|
other_tokens: Token[];
|
|
28
26
|
};
|
|
29
27
|
export declare function isGlobusAuthTokenResponse(check: unknown): check is TokenResponse;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/services/auth/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/services/auth/index.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AAEpC;;;GAGG;AACH,eAAO,MAAM,MAAM,aAAO,CAAC;AAE3B,wBAAgB,wBAAwB,WAEvC;AAED,wBAAgB,gBAAgB,WAE/B;AAED,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AAEpD,MAAM,MAAM,KAAK,GAAG;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AACF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,KAAK,EAAE,CAAC;CACvB,CAAC;AAEF,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAEhF"}
|