@globus/sdk 3.0.0-alpha.3 → 3.0.0-alpha.5

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.
Files changed (32) hide show
  1. package/cjs/lib/core/authorization/AuthorizationManager.d.ts +56 -8
  2. package/cjs/lib/core/authorization/AuthorizationManager.d.ts.map +1 -1
  3. package/cjs/lib/core/authorization/AuthorizationManager.js +80 -28
  4. package/cjs/lib/core/authorization/AuthorizationManager.js.map +1 -1
  5. package/cjs/lib/core/authorization/RedirectTransport.d.ts +7 -1
  6. package/cjs/lib/core/authorization/RedirectTransport.d.ts.map +1 -1
  7. package/cjs/lib/core/authorization/RedirectTransport.js +7 -4
  8. package/cjs/lib/core/authorization/RedirectTransport.js.map +1 -1
  9. package/cjs/lib/core/authorization/TokenLookup.d.ts +12 -0
  10. package/cjs/lib/core/authorization/TokenLookup.d.ts.map +1 -0
  11. package/cjs/lib/core/authorization/TokenLookup.js +31 -0
  12. package/cjs/lib/core/authorization/TokenLookup.js.map +1 -0
  13. package/cjs/lib/services/transfer/service/file-operations.d.ts +1 -1
  14. package/cjs/lib/services/transfer/service/file-operations.d.ts.map +1 -1
  15. package/cjs/lib/services/transfer/service/file-operations.js.map +1 -1
  16. package/esm/lib/core/authorization/AuthorizationManager.d.ts +56 -8
  17. package/esm/lib/core/authorization/AuthorizationManager.d.ts.map +1 -1
  18. package/esm/lib/core/authorization/AuthorizationManager.js +77 -28
  19. package/esm/lib/core/authorization/AuthorizationManager.js.map +1 -1
  20. package/esm/lib/core/authorization/RedirectTransport.d.ts +7 -1
  21. package/esm/lib/core/authorization/RedirectTransport.d.ts.map +1 -1
  22. package/esm/lib/core/authorization/RedirectTransport.js +8 -5
  23. package/esm/lib/core/authorization/RedirectTransport.js.map +1 -1
  24. package/esm/lib/core/authorization/TokenLookup.d.ts +12 -0
  25. package/esm/lib/core/authorization/TokenLookup.d.ts.map +1 -0
  26. package/esm/lib/core/authorization/TokenLookup.js +27 -0
  27. package/esm/lib/core/authorization/TokenLookup.js.map +1 -0
  28. package/esm/lib/services/transfer/service/file-operations.d.ts +1 -1
  29. package/esm/lib/services/transfer/service/file-operations.d.ts.map +1 -1
  30. package/esm/lib/services/transfer/service/file-operations.js.map +1 -1
  31. package/package.json +1 -1
  32. package/umd/globus.production.js +1 -1
@@ -1,24 +1,58 @@
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
5
  export type AuthorizationManagerConfiguration = {
6
6
  client_id: IConfig['client_id'];
7
7
  requested_scopes: IConfig['requested_scopes'];
8
8
  redirect_uri: IConfig['redirect_uri'];
9
9
  };
10
+ export type WellFormedError = {
11
+ code: string;
12
+ message: string;
13
+ };
14
+ export declare function isErrorWellFormed(error: unknown): error is WellFormedError;
15
+ export type ConsentRequiredError = {
16
+ code: 'ConsentRequired';
17
+ required_scopes: string[];
18
+ [key: string]: unknown;
19
+ };
20
+ export declare function isConsentRequiredError(error: unknown): error is ConsentRequiredError;
21
+ type AuthorizationRequirementsError = {
22
+ authorization_parameters: {
23
+ session_message: string;
24
+ session_required_identities: string[];
25
+ session_required_mfa: boolean;
26
+ session_required_single_domain: string[];
27
+ };
28
+ [key: string]: unknown;
29
+ };
30
+ export declare function isAuthorizationRequirementsError(error: unknown): error is AuthorizationRequirementsError;
10
31
  /**
11
32
  * @experimental
12
33
  */
13
34
  export declare class AuthorizationManager {
14
35
  #private;
15
- authenticated: boolean;
16
- getTokenForService(service: Extract<Service, 'AUTH' | 'TRANSFER' | 'FLOWS'>): any;
36
+ configuration: AuthorizationManagerConfiguration;
37
+ /**
38
+ * The `AuthorizationManager` is consdiered `authenticated` if it has a valid Globus Auth token.
39
+ * It does not necessarily mean that it has a valid token for a specific resource server.
40
+ */
41
+ get authenticated(): boolean;
42
+ /**
43
+ * Set the authenticated state and emit the `authenticated` event.
44
+ */
45
+ set authenticated(value: boolean);
46
+ tokens: TokenLookup;
17
47
  events: {
18
48
  /**
19
49
  * Emitted when the authenticated state changes.
20
50
  */
21
51
  authenticated: Event<"authenticated", {
52
+ /**
53
+ * Whether the `AuthorizationManager` is authenticated.
54
+ * @see {@link AuthorizationManager.authenticated}
55
+ */
22
56
  isAuthenticated: boolean;
23
57
  token?: TokenResponse | undefined;
24
58
  }>;
@@ -31,17 +65,31 @@ export declare class AuthorizationManager {
31
65
  startSilentRenew(): void;
32
66
  hasGlobusAuthToken(): boolean;
33
67
  getGlobusAuthToken(): any;
68
+ /**
69
+ * Reset the authenticated state and clear all tokens from storage.
70
+ */
34
71
  reset(): void;
35
- redirect(): void;
72
+ /**
73
+ * Initiate the login process by redirecting to the Globus Auth login page.
74
+ */
75
+ login(): void;
36
76
  handleCodeRedirect(): Promise<void>;
37
77
  /**
38
78
  * @todo
39
79
  */
40
- handleConsentRequiredError(response: {
41
- code: 'ConsentRequired';
42
- required_scopes: string[];
43
- }): void;
80
+ handleErrorResponse(response: {
81
+ code: unknown;
82
+ required_scopes?: unknown;
83
+ }, execute?: boolean): void | (() => void);
84
+ handleAuthorizationRequirementsError(response: AuthorizationRequirementsError): void;
85
+ handleConsentRequiredError(response: ConsentRequiredError): void;
86
+ /**
87
+ * Add a Globus Auth token response to storage, if `other_tokens` are present they are also added.
88
+ * This method is mostly used internally by the `AuthorizationManager`, but can be used by downstream
89
+ * consumers to add tokens to storage if necessary.
90
+ */
44
91
  addTokenResponse: (token: Token | TokenResponse) => void;
45
92
  revoke(): Promise<void>;
46
93
  }
94
+ export {};
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,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kB;IAsBlB;;OAEG;IACH,KAAK;IAmBL;;OAEG;IACH,KAAK;IASC,kBAAkB;IAQxB;;OAEG;IACH,mBAAmB,CAAC,QAAQ,EAAE;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,eAAe,CAAC,EAAE,OAAO,CAAA;KAAE,EAAE,OAAO,UAAO;IAiB1F,oCAAoC,CAAC,QAAQ,EAAE,8BAA8B;IAe7E,0BAA0B,CAAC,QAAQ,EAAE,oBAAoB;IAOzD;;;;OAIG;IACH,gBAAgB,UAAW,KAAK,GAAG,aAAa,UAK9C;IAEI,MAAM;CAIb"}
@@ -1,31 +1,48 @@
1
1
  "use strict";
2
- var _AuthorizationManager_instances, _AuthorizationManager_transport, _AuthorizationManager_configuration, _AuthorizationManager_bootstrapFromStorageState, _AuthorizationManager_emitAuthenticatedState, _AuthorizationManager_buildTransport;
2
+ var _AuthorizationManager_instances, _AuthorizationManager_transport, _AuthorizationManager_authenticated, _AuthorizationManager_bootstrapFromStorageState, _AuthorizationManager_emitAuthenticatedState, _AuthorizationManager_buildTransport;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.AuthorizationManager = void 0;
4
+ exports.AuthorizationManager = exports.isAuthorizationRequirementsError = exports.isConsentRequiredError = exports.isErrorWellFormed = void 0;
5
5
  const tslib_1 = require("tslib");
6
6
  const index_js_1 = require("../../services/auth/index.js");
7
7
  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
+ function isErrorWellFormed(error) {
13
+ return typeof error === 'object' && error !== null && 'code' in error && 'message' in error;
14
+ }
15
+ exports.isErrorWellFormed = isErrorWellFormed;
16
+ function isConsentRequiredError(error) {
17
+ return isErrorWellFormed(error) && error.code === 'ConsentRequired' && 'required_scopes' in error;
18
+ }
19
+ exports.isConsentRequiredError = isConsentRequiredError;
20
+ function isAuthorizationRequirementsError(error) {
21
+ return isErrorWellFormed(error) && 'authorization_parameters' in error;
22
+ }
23
+ exports.isAuthorizationRequirementsError = isAuthorizationRequirementsError;
11
24
  /**
12
25
  * @experimental
13
26
  */
14
27
  class AuthorizationManager {
15
- getTokenForService(service) {
16
- var _a;
17
- const resourceServer = (_a = index_js_1.CONFIG.RESOURCE_SERVERS) === null || _a === void 0 ? void 0 : _a[service];
18
- if (!resourceServer) {
19
- throw new Error(`No resource server found for service: ${service}`);
20
- }
21
- const raw = (0, index_js_2.getStorage)().get(`${tslib_1.__classPrivateFieldGet(this, _AuthorizationManager_configuration, "f").client_id}:${resourceServer}`) || '{}';
22
- return JSON.parse(raw).access_token;
28
+ /**
29
+ * The `AuthorizationManager` is consdiered `authenticated` if it has a valid Globus Auth token.
30
+ * It does not necessarily mean that it has a valid token for a specific resource server.
31
+ */
32
+ get authenticated() {
33
+ return tslib_1.__classPrivateFieldGet(this, _AuthorizationManager_authenticated, "f");
34
+ }
35
+ /**
36
+ * Set the authenticated state and emit the `authenticated` event.
37
+ */
38
+ set authenticated(value) {
39
+ tslib_1.__classPrivateFieldSet(this, _AuthorizationManager_authenticated, value, "f");
40
+ tslib_1.__classPrivateFieldGet(this, _AuthorizationManager_instances, "m", _AuthorizationManager_emitAuthenticatedState).call(this);
23
41
  }
24
42
  constructor(configuration) {
25
43
  _AuthorizationManager_instances.add(this);
26
44
  _AuthorizationManager_transport.set(this, void 0);
27
- _AuthorizationManager_configuration.set(this, void 0);
28
- this.authenticated = false;
45
+ _AuthorizationManager_authenticated.set(this, false);
29
46
  this.events = {
30
47
  /**
31
48
  * Emitted when the authenticated state changes.
@@ -36,8 +53,13 @@ class AuthorizationManager {
36
53
  */
37
54
  revoke: new Event_js_1.Event('revoke'),
38
55
  };
56
+ /**
57
+ * Add a Globus Auth token response to storage, if `other_tokens` are present they are also added.
58
+ * This method is mostly used internally by the `AuthorizationManager`, but can be used by downstream
59
+ * consumers to add tokens to storage if necessary.
60
+ */
39
61
  this.addTokenResponse = (token) => {
40
- (0, index_js_2.getStorage)().set(`${tslib_1.__classPrivateFieldGet(this, _AuthorizationManager_configuration, "f").client_id}:${token.resource_server}`, token);
62
+ (0, index_js_2.getStorage)().set(`${this.configuration.client_id}:${token.resource_server}`, token);
41
63
  if ('other_tokens' in token) {
42
64
  token.other_tokens.forEach(this.addTokenResponse);
43
65
  }
@@ -49,7 +71,10 @@ class AuthorizationManager {
49
71
  if (!configuration.client_id) {
50
72
  throw new Error('You must provide a `client_id` for your application.');
51
73
  }
52
- tslib_1.__classPrivateFieldSet(this, _AuthorizationManager_configuration, Object.assign({}, configuration), "f");
74
+ this.configuration = Object.assign({}, configuration);
75
+ this.tokens = new TokenLookup_js_1.TokenLookup({
76
+ manager: this,
77
+ });
53
78
  this.startSilentRenew();
54
79
  }
55
80
  startSilentRenew() {
@@ -61,15 +86,27 @@ class AuthorizationManager {
61
86
  return this.getGlobusAuthToken() !== null;
62
87
  }
63
88
  getGlobusAuthToken() {
64
- const entry = (0, index_js_2.getStorage)().get(`${tslib_1.__classPrivateFieldGet(this, _AuthorizationManager_configuration, "f").client_id}:auth.globus.org`);
89
+ const entry = (0, index_js_2.getStorage)().get(`${this.configuration.client_id}:auth.globus.org`);
65
90
  return entry ? JSON.parse(entry) : null;
66
91
  }
92
+ /**
93
+ * Reset the authenticated state and clear all tokens from storage.
94
+ */
67
95
  reset() {
68
96
  this.authenticated = false;
97
+ /**
98
+ * @todo This should be made specific to the keys generated by the `AuthorizationManager`.
99
+ */
69
100
  (0, index_js_2.getStorage)().clear();
70
101
  }
71
- redirect() {
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
  }
@@ -79,21 +116,37 @@ class AuthorizationManager {
79
116
  if ((0, index_js_1.isGlobusAuthTokenResponse)(response)) {
80
117
  this.addTokenResponse(response);
81
118
  this.authenticated = true;
82
- yield tslib_1.__classPrivateFieldGet(this, _AuthorizationManager_instances, "m", _AuthorizationManager_emitAuthenticatedState).call(this);
83
119
  }
84
120
  });
85
121
  }
86
122
  /**
87
123
  * @todo
88
124
  */
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
- // }
125
+ handleErrorResponse(response, execute = true) {
126
+ let handler = () => { };
127
+ if (isAuthorizationRequirementsError(response)) {
128
+ handler = () => this.handleAuthorizationRequirementsError(response);
129
+ }
130
+ if (isConsentRequiredError(response)) {
131
+ handler = () => this.handleConsentRequiredError(response);
132
+ }
133
+ if (response.code === 'AuthenticationFailed') {
134
+ this.revoke();
135
+ }
136
+ return execute ? handler() : handler;
137
+ }
138
+ handleAuthorizationRequirementsError(response) {
139
+ tslib_1.__classPrivateFieldSet(this, _AuthorizationManager_transport, tslib_1.__classPrivateFieldGet(this, _AuthorizationManager_instances, "m", _AuthorizationManager_buildTransport).call(this, {
140
+ params: {
141
+ session_message: response.authorization_parameters.session_message,
142
+ session_required_identities: response.authorization_parameters.session_required_identities.join(','),
143
+ session_required_mfa: response.authorization_parameters.session_required_mfa,
144
+ session_required_single_domain: response.authorization_parameters.session_required_single_domain.join(','),
145
+ prompt: 'login',
146
+ },
147
+ }), "f");
148
+ tslib_1.__classPrivateFieldGet(this, _AuthorizationManager_transport, "f").send();
149
+ }
97
150
  handleConsentRequiredError(response) {
98
151
  tslib_1.__classPrivateFieldSet(this, _AuthorizationManager_transport, tslib_1.__classPrivateFieldGet(this, _AuthorizationManager_instances, "m", _AuthorizationManager_buildTransport).call(this, {
99
152
  requested_scopes: response.required_scopes.join(' '),
@@ -108,13 +161,12 @@ class AuthorizationManager {
108
161
  }
109
162
  }
110
163
  exports.AuthorizationManager = AuthorizationManager;
111
- _AuthorizationManager_transport = new WeakMap(), _AuthorizationManager_configuration = new WeakMap(), _AuthorizationManager_instances = new WeakSet(), _AuthorizationManager_bootstrapFromStorageState = function _AuthorizationManager_bootstrapFromStorageState() {
164
+ _AuthorizationManager_transport = new WeakMap(), _AuthorizationManager_authenticated = new WeakMap(), _AuthorizationManager_instances = new WeakSet(), _AuthorizationManager_bootstrapFromStorageState = function _AuthorizationManager_bootstrapFromStorageState() {
112
165
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
113
166
  (0, logger_js_1.log)('debug', 'AuthorizationManager.bootstrapFromStorageState');
114
167
  if (this.hasGlobusAuthToken()) {
115
168
  (0, logger_js_1.log)('debug', 'AuthorizationManager.bootstrapFromStorageState: hasGlobusAuthToken');
116
169
  this.authenticated = true;
117
- yield tslib_1.__classPrivateFieldGet(this, _AuthorizationManager_instances, "m", _AuthorizationManager_emitAuthenticatedState).call(this);
118
170
  }
119
171
  });
120
172
  }, _AuthorizationManager_emitAuthenticatedState = function _AuthorizationManager_emitAuthenticatedState() {
@@ -128,6 +180,6 @@ _AuthorizationManager_transport = new WeakMap(), _AuthorizationManager_configura
128
180
  });
129
181
  });
130
182
  }, _AuthorizationManager_buildTransport = function _AuthorizationManager_buildTransport(overrides) {
131
- return new RedirectTransport_js_1.RedirectTransport(Object.assign({ client_id: tslib_1.__classPrivateFieldGet(this, _AuthorizationManager_configuration, "f").client_id, authorization_endpoint: (0, index_js_1.getAuthorizationEndpoint)(), token_endpoint: (0, index_js_1.getTokenEndpoint)(), redirect_uri: tslib_1.__classPrivateFieldGet(this, _AuthorizationManager_configuration, "f").redirect_uri, requested_scopes: tslib_1.__classPrivateFieldGet(this, _AuthorizationManager_configuration, "f").requested_scopes }, overrides));
183
+ 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
184
  };
133
185
  //# sourceMappingURL=AuthorizationManager.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AuthorizationManager.js","sourceRoot":"","sources":["../../../../../src/lib/core/authorization/AuthorizationManager.ts"],"names":[],"mappings":";;;;;AAEA,2DAOsC;AAEtC,kDAAgE;AAChE,4CAAmC;AAGnC,yCAAmC;AACnC,iEAA2D;AAQ3D;;GAEG;AACH,MAAa,oBAAoB;IAO/B,kBAAkB,CAAC,OAAwD;;QACzE,MAAM,cAAc,GAAG,MAAA,iBAAM,CAAC,gBAAgB,0CAAG,OAAO,CAAC,CAAC;QAC1D,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,yCAAyC,OAAO,EAAE,CAAC,CAAC;QACtE,CAAC;QACD,MAAM,GAAG,GAAG,IAAA,qBAAU,GAAE,CAAC,GAAG,CAAC,GAAG,+BAAA,IAAI,2CAAe,CAAC,SAAS,IAAI,cAAc,EAAE,CAAC,IAAI,IAAI,CAAC;QAC3F,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,YAAY,CAAC;IACtC,CAAC;IAmBD,YAAY,aAAgD;;QAhC5D,kDAA+B;QAE/B,sDAAkD;QAElD,kBAAa,GAAG,KAAK,CAAC;QAWtB,WAAM,GAAG;YACP;;eAEG;YACH,aAAa,EAAE,IAAI,gBAAK,CAMtB,eAAe,CAAC;YAClB;;eAEG;YACH,MAAM,EAAE,IAAI,gBAAK,CAAC,QAAQ,CAAC;SAC5B,CAAC;QAmGF,qBAAgB,GAAG,CAAC,KAA4B,EAAE,EAAE;YAClD,IAAA,qBAAU,GAAE,CAAC,GAAG,CAAC,GAAG,+BAAA,IAAI,2CAAe,CAAC,SAAS,IAAI,KAAK,CAAC,eAAe,EAAE,EAAE,KAAK,CAAC,CAAC;YACrF,IAAI,cAAc,IA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MAAM,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC;YACvC,eAAe;YACf,KAAK;SACN,CAAC,CAAC;;wFAQW,SAA4B;IAC1C,OAAO,IAAI,wCAAiB,iBAC1B,SAAS,EAAE,+BAAA,IAAI,2CAAe,CAAC,SAAS,EACxC,sBAAsB,EAAE,IAAA,mCAAwB,GAAE,EAClD,cAAc,EAAE,IAAA,2BAAgB,GAAE,EAClC,YAAY,EAAE,+BAAA,IAAI,2CAAe,CAAC,YAAY,EAC9C,gBAAgB,EAAE,+BAAA,IAAI,2CAAe,CAAC,gBAAgB,IACnD,SAAS,EACZ,CAAC;AACL,CAAC"}
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+C;AAa/C,SAAgB,iBAAiB,CAAC,KAAc;IAC9C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,IAAI,KAAK,IAAI,SAAS,IAAI,KAAK,CAAC;AAC9F,CAAC;AAFD,8CAEC;AAQD,SAAgB,sBAAsB,CAAC,KAAc;IACnD,OAAO,iBAAiB,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,iBAAiB,IAAI,iBAAiB,IAAI,KAAK,CAAC;AACpG,CAAC;AAFD,wDAEC;AAYD,SAAgB,gCAAgC,CAC9C,KAAc;IAEd,OAAO,iBAAiB,CAAC,KAAK,CAAC,IAAI,0BAA0B,IAAI,KAAK,CAAC;AACzE,CAAC;AAJD,4EAIC;AAED;;GAEG;AACH,MAAa,oBAAoB;IAO/B;;;OAGG;IACH,IAAI,aAAa;QACf,OAAO,+BAAA,IAAI,2CAAe,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,IAAI,aAAa,CAAC,K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AAC,OAAO,EAAE,gDAAgD,CAAC,CAAC;QAC/D,IAAI,IAAI,CAAC,kBAAkB,EAAE,EAAE,CAAC;YAC9B,IAAA,eAAG,EAAC,OAAO,EAAE,oEAAoE,CAAC,CAAC;YACnF,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC5B,CAAC;IACH,CAAC;;;;QAGC,MAAM,eAAe,GAAG,IAAI,CAAC,aAAa,CAAC;QAC3C,MAAM,KAAK,GAAG,MAAA,IAAI,CAAC,kBAAkB,EAAE,mCAAI,SAAS,CAAC;QACrD,MAAM,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC;YACvC,eAAe;YACf,KAAK;SACN,CAAC,CAAC;;wFAcW,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"}
@@ -1,7 +1,13 @@
1
1
  import type IConfig from 'js-pkce/dist/IConfig';
2
+ import 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;;gBAGhB,OAAO,EAAE,OAAO;IAM5B,IAAI;IAIE,QAAQ;CAiBf"}
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,OAAO,MAAM,sBAAsB,CAAC;AAE3C,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
- tslib_1.__classPrivateFieldSet(this, _RedirectTransport_pkce, new js_pkce_1.default(Object.assign({}, options)), "f");
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;AAG3B,MAAa,iBAAiB;IAG5B,YAAY,OAAgB;QAF5B,0CAAY;QAGV,+BAAA,IAAI,2BAAS,IAAI,iBAAI,mBAChB,OAAO,EACV,MAAA,CAAC;IACL,CAAC;IAED,IAAI;QACF,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,+BAAA,IAAI,+BAAM,CAAC,YAAY,EAAE,CAAC,CAAC;IACrD,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,CA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U,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';
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,qBAAqB,CAAC;AAGpD,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 storage_1 = require("../storage");
7
+ const auth_1 = require("../../services/auth");
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 = auth_1.CONFIG.RESOURCE_SERVERS) === null || _a === void 0 ? void 0 : _a[service];
28
+ const raw = (0, storage_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,wCAAwC;AACxC,8CAAoD;AAKpD,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,aAAM,CAAC,gBAAgB,0CAAG,OAAO,CAAC,CAAC;IAC1D,MAAM,GAAG,GACP,IAAA,oBAAU,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"}
@@ -42,7 +42,7 @@ export type DirectoryListingError = {
42
42
  /**
43
43
  * @see https://docs.globus.org/api/transfer/file_operations/#errors
44
44
  */
45
- code: 'NotSupported' | 'ClientError.NotFound' | 'EndpointError' | string;
45
+ code: 'NotSupported' | 'ClientError.NotFound' | 'EndpointError' | 'ExternalError.DirListingFailed.LoginFailed' | string;
46
46
  message: string;
47
47
  request_id: string;
48
48
  resource: string;
@@ -1 +1 @@
1
- {"version":3,"file":"file-operations.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/services/transfer/service/file-operations.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAgC,MAAM,gBAAgB,CAAC;AAEtF;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,KAAK,GAAG,MAAM,GAAG,iBAAiB,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC;IACrF,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,WAAW,C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;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM;aAwBN,KAAK,QAAQ,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC;;;;;;kGAE5D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,OAAO;aAwBP,KAAK,QAAQ,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,EAAE,WAAW,CAAC;;;;;;kGAE7D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"file-operations.js","sourceRoot":"","sources":["../../../../../../src/lib/services/transfer/service/file-operations.ts"],"names":[],"mappings":";;;AAAA,+CAA+D;AAC/D,4CAAoD;AACpD,4CAA0C;AAuD1C;;;;;GAKG;AACU,QAAA,EAAE,GAAG,UAChB,YAAY,EACZ,OAAQ,EACR,UAAW;IAEX,OAAO,IAAA,0BAAc,EACnB;QACE,OAAO,EAAE,cAAE;QACX,KAAK,EAAE,kBAAM,CAAC,GAAG;QACjB,IAAI,EAAE,6BAA6B,YAAY,KAAK;KACrD,EACD,OAAO,EACP,UAAU,CACX,CAAC;AACJ,CAKC,CAAC;AAEF;;;;;GAKG;AACU,QAAA,KAAK,GAAG,UAAU,YAAY,EAAE,OAAO,EAAE,UAAW;IAC/D,MAAM,qBAAqB,GAAG;QAC5B,OAAO,kBACL,SAAS,EAAE,OAAO,IACf,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,CACpB;QACD,OAAO,kCACF,IAAA,gCAAoB,EAAC,wBAAY,CAAC,IAAI,CAAC,GACvC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,CACpB;KACF,CAAC;IACF,OAAO,IAAA,0BAAc,EACnB;QACE,OAAO,EAAE,cAAE;QACX,KAAK,EAAE,kBAAM,CAAC,GAAG;QACjB,IAAI,EAAE,6BAA6B,YAAY,QAAQ;QACvD,MAAM,EAAE,wBAAY,CAAC,IAAI;KAC1B,EACD,qBAAqB,EACrB,UAAU,CACX,CAAC;AACJ,CAKC,CAAC;AAEF;;;;;;;GAOG;AACU,QAAA,MAAM,GAAG,UAAU,YAAY,EAAE,OAAO,EAAE,UAAW;IAChE,MAAM,qBAAqB,GAAG;QAC5B,OAAO,kBACL,SAAS,EAAE,QAAQ,IAChB,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,CACpB;QACD,OAAO,kCACF,IAAA,gCAAoB,EAAC,wBAAY,CAAC,IAAI,CAAC,GACvC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,CACpB;KACF,CAAC;IACF,OAAO,IAAA,0BAAc,EACnB;QACE,OAAO,EAAE,cAAE;QACX,KAAK,EAAE,kBAAM,CAAC,GAAG;QACjB,IAAI,EAAE,6BAA6B,YAAY,SAAS;QACxD,MAAM,EAAE,wBAAY,CAAC,IAAI;KAC1B,EACD,qBAAqB,EACrB,UAAU,CACX,CAAC;AACJ,CAKC,CAAC;AAEF;;;;;GAKG;AACU,QAAA,OAAO,GAAG,UAAU,YAAY,EAAE,OAAO,EAAE,UAAW;IACjE,MAAM,qBAAqB,GAAG;QAC5B,OAAO,kBACL,SAAS,EAAE,SAAS,IACjB,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,CACpB;QACD,OAAO,kCACF,IAAA,gCAAoB,EAAC,wBAAY,CAAC,IAAI,CAAC,GACvC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,CACpB;KACF,CAAC;IACF,OAAO,IAAA,0BAAc,EACnB;QACE,OAAO,EAAE,cAAE;QACX,KAAK,EAAE,kBAAM,CAAC,GAAG;QACjB,IAAI,EAAE,6BAA6B,YAAY,UAAU;QACzD,MAAM,EAAE,wBAAY,CAAC,IAAI;KAC1B,EACD,qBAAqB,EACrB,UAAU,CACX,CAAC;AACJ,CAKC,CAAC"}
1
+ {"version":3,"file":"file-operations.js","sourceRoot":"","sources":["../../../../../../src/lib/services/transfer/service/file-operations.ts"],"names":[],"mappings":";;;AAAA,+CAA+D;AAC/D,4CAAoD;AACpD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C,GAAG;QACjB,IAAI,EAAE,6BAA6B,YAAY,SAAS;QACxD,MAAM,EAAE,wBAAY,CAAC,IAAI;KAC1B,EACD,qBAAqB,EACrB,UAAU,CACX,CAAC;AACJ,CAKC,CAAC;AAEF;;;;;GAKG;AACU,QAAA,OAAO,GAAG,UAAU,YAAY,EAAE,OAAO,EAAE,UAAW;IACjE,MAAM,qBAAqB,GAAG;QAC5B,OAAO,kBACL,SAAS,EAAE,SAAS,IACjB,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,CACpB;QACD,OAAO,kCACF,IAAA,gCAAoB,EAAC,wBAAY,CAAC,IAAI,CAAC,GACvC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,CACpB;KACF,CAAC;IACF,OAAO,IAAA,0BAAc,EACnB;QACE,OAAO,EAAE,cAAE;QACX,KAAK,EAAE,kBAAM,CAAC,GAAG;QACjB,IAAI,EAAE,6BAA6B,YAAY,UAAU;QACzD,MAAM,EAAE,wBAAY,CAAC,IAAI;KAC1B,EACD,qBAAqB,EACrB,UAAU,CACX,CAAC;AACJ,CAKC,CAAC"}
@@ -1,24 +1,58 @@
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
5
  export type AuthorizationManagerConfiguration = {
6
6
  client_id: IConfig['client_id'];
7
7
  requested_scopes: IConfig['requested_scopes'];
8
8
  redirect_uri: IConfig['redirect_uri'];
9
9
  };
10
+ export type WellFormedError = {
11
+ code: string;
12
+ message: string;
13
+ };
14
+ export declare function isErrorWellFormed(error: unknown): error is WellFormedError;
15
+ export type ConsentRequiredError = {
16
+ code: 'ConsentRequired';
17
+ required_scopes: string[];
18
+ [key: string]: unknown;
19
+ };
20
+ export declare function isConsentRequiredError(error: unknown): error is ConsentRequiredError;
21
+ type AuthorizationRequirementsError = {
22
+ authorization_parameters: {
23
+ session_message: string;
24
+ session_required_identities: string[];
25
+ session_required_mfa: boolean;
26
+ session_required_single_domain: string[];
27
+ };
28
+ [key: string]: unknown;
29
+ };
30
+ export declare function isAuthorizationRequirementsError(error: unknown): error is AuthorizationRequirementsError;
10
31
  /**
11
32
  * @experimental
12
33
  */
13
34
  export declare class AuthorizationManager {
14
35
  #private;
15
- authenticated: boolean;
16
- getTokenForService(service: Extract<Service, 'AUTH' | 'TRANSFER' | 'FLOWS'>): any;
36
+ configuration: AuthorizationManagerConfiguration;
37
+ /**
38
+ * The `AuthorizationManager` is consdiered `authenticated` if it has a valid Globus Auth token.
39
+ * It does not necessarily mean that it has a valid token for a specific resource server.
40
+ */
41
+ get authenticated(): boolean;
42
+ /**
43
+ * Set the authenticated state and emit the `authenticated` event.
44
+ */
45
+ set authenticated(value: boolean);
46
+ tokens: TokenLookup;
17
47
  events: {
18
48
  /**
19
49
  * Emitted when the authenticated state changes.
20
50
  */
21
51
  authenticated: Event<"authenticated", {
52
+ /**
53
+ * Whether the `AuthorizationManager` is authenticated.
54
+ * @see {@link AuthorizationManager.authenticated}
55
+ */
22
56
  isAuthenticated: boolean;
23
57
  token?: TokenResponse | undefined;
24
58
  }>;
@@ -31,17 +65,31 @@ export declare class AuthorizationManager {
31
65
  startSilentRenew(): void;
32
66
  hasGlobusAuthToken(): boolean;
33
67
  getGlobusAuthToken(): any;
68
+ /**
69
+ * Reset the authenticated state and clear all tokens from storage.
70
+ */
34
71
  reset(): void;
35
- redirect(): void;
72
+ /**
73
+ * Initiate the login process by redirecting to the Globus Auth login page.
74
+ */
75
+ login(): void;
36
76
  handleCodeRedirect(): Promise<void>;
37
77
  /**
38
78
  * @todo
39
79
  */
40
- handleConsentRequiredError(response: {
41
- code: 'ConsentRequired';
42
- required_scopes: string[];
43
- }): void;
80
+ handleErrorResponse(response: {
81
+ code: unknown;
82
+ required_scopes?: unknown;
83
+ }, execute?: boolean): void | (() => void);
84
+ handleAuthorizationRequirementsError(response: AuthorizationRequirementsError): void;
85
+ handleConsentRequiredError(response: ConsentRequiredError): void;
86
+ /**
87
+ * Add a Globus Auth token response to storage, if `other_tokens` are present they are also added.
88
+ * This method is mostly used internally by the `AuthorizationManager`, but can be used by downstream
89
+ * consumers to add tokens to storage if necessary.
90
+ */
44
91
  addTokenResponse: (token: Token | TokenResponse) => void;
45
92
  revoke(): Promise<void>;
46
93
  }
94
+ export {};
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,EAKd,MAAM,8BAA8B,CAAC;AAItC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAGnC,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;;IAK/B,aAAa,UAAS;IAEtB,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC;IAS3E,MAAM;QACJ;;WAEG;;6BAIkB,OAAO;;;QAI5B;;WAEG;;MAEH;gBAEU,aAAa,EAAE,iCAAiC;IAc5D,gBAAgB;IAMhB,kBAAkB;IAIlB,kBAAkB;IAuBlB,KAAK;IAgBL,QAAQ;IAMF,kBAAkB;IASxB;;OAEG;IAUH,0BAA0B,CAAC,QAAQ,EAAE;QAAE,IAAI,EAAE,iBAAiB,CAAC;QAAC,eAAe,EAAE,MAAM,EAAE,CAAA;KAAE;IAO3F,gBAAgB,UAAW,KAAK,GAAG,aAAa,UAK9C;IAEI,MAAM;CAIb"}
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,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,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe,CAE1E;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,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,oBAAoB,CAEpF;AAED,KAAK,8BAA8B,GAAG;IACpC,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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