@jbrowse/plugin-authentication 2.11.2 → 2.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DropboxOAuthModel/DropboxIcon.js +1 -1
- package/dist/DropboxOAuthModel/configSchema.d.ts +2 -6
- package/dist/DropboxOAuthModel/model.d.ts +24 -129
- package/dist/DropboxOAuthModel/util.js +1 -2
- package/dist/ExternalTokenModel/model.d.ts +17 -49
- package/dist/GoogleDriveOAuthModel/GoogleDriveIcon.js +1 -1
- package/dist/GoogleDriveOAuthModel/configSchema.d.ts +2 -6
- package/dist/GoogleDriveOAuthModel/model.d.ts +19 -23
- package/dist/GoogleDriveOAuthModel/model.js +1 -1
- package/dist/GoogleDriveOAuthModel/util.js +1 -2
- package/dist/HTTPBasicModel/HTTPBasicLoginForm.js +1 -2
- package/dist/HTTPBasicModel/model.d.ts +20 -71
- package/dist/OAuthModel/configSchema.d.ts +1 -3
- package/dist/OAuthModel/model.d.ts +21 -98
- package/dist/OAuthModel/util.js +4 -5
- package/dist/index.d.ts +69 -294
- package/dist/util.js +2 -3
- package/esm/DropboxOAuthModel/configSchema.d.ts +2 -6
- package/esm/DropboxOAuthModel/model.d.ts +24 -129
- package/esm/ExternalTokenModel/model.d.ts +17 -49
- package/esm/GoogleDriveOAuthModel/configSchema.d.ts +2 -6
- package/esm/GoogleDriveOAuthModel/model.d.ts +19 -23
- package/esm/HTTPBasicModel/model.d.ts +20 -71
- package/esm/OAuthModel/configSchema.d.ts +1 -3
- package/esm/OAuthModel/model.d.ts +21 -98
- package/esm/index.d.ts +69 -294
- package/package.json +2 -2
|
@@ -1,79 +1,10 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { UriLocation } from '@jbrowse/core/util';
|
|
3
2
|
import { Instance } from 'mobx-state-tree';
|
|
3
|
+
import { OAuthInternetAccountConfigModel } from './configSchema';
|
|
4
4
|
/**
|
|
5
5
|
* #stateModel OAuthInternetAccount
|
|
6
6
|
*/
|
|
7
|
-
declare const stateModelFactory: (configSchema: import("
|
|
8
|
-
tokenType: {
|
|
9
|
-
description: string;
|
|
10
|
-
type: string;
|
|
11
|
-
defaultValue: string;
|
|
12
|
-
};
|
|
13
|
-
authEndpoint: {
|
|
14
|
-
description: string;
|
|
15
|
-
type: string;
|
|
16
|
-
defaultValue: string;
|
|
17
|
-
};
|
|
18
|
-
tokenEndpoint: {
|
|
19
|
-
description: string;
|
|
20
|
-
type: string;
|
|
21
|
-
defaultValue: string;
|
|
22
|
-
};
|
|
23
|
-
needsPKCE: {
|
|
24
|
-
description: string;
|
|
25
|
-
type: string;
|
|
26
|
-
defaultValue: boolean;
|
|
27
|
-
};
|
|
28
|
-
clientId: {
|
|
29
|
-
description: string; /**
|
|
30
|
-
* #getter
|
|
31
|
-
*/
|
|
32
|
-
type: string;
|
|
33
|
-
defaultValue: string;
|
|
34
|
-
};
|
|
35
|
-
scopes: {
|
|
36
|
-
description: string;
|
|
37
|
-
type: string;
|
|
38
|
-
defaultValue: string;
|
|
39
|
-
};
|
|
40
|
-
state: {
|
|
41
|
-
description: string;
|
|
42
|
-
type: string;
|
|
43
|
-
defaultValue: string;
|
|
44
|
-
};
|
|
45
|
-
responseType: {
|
|
46
|
-
description: string;
|
|
47
|
-
type: string;
|
|
48
|
-
defaultValue: string;
|
|
49
|
-
};
|
|
50
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
51
|
-
name: {
|
|
52
|
-
description: string;
|
|
53
|
-
type: string;
|
|
54
|
-
defaultValue: string;
|
|
55
|
-
};
|
|
56
|
-
description: {
|
|
57
|
-
description: string;
|
|
58
|
-
type: string;
|
|
59
|
-
defaultValue: string;
|
|
60
|
-
};
|
|
61
|
-
authHeader: {
|
|
62
|
-
description: string;
|
|
63
|
-
type: string;
|
|
64
|
-
defaultValue: string;
|
|
65
|
-
};
|
|
66
|
-
tokenType: {
|
|
67
|
-
description: string;
|
|
68
|
-
type: string;
|
|
69
|
-
defaultValue: string;
|
|
70
|
-
};
|
|
71
|
-
domains: {
|
|
72
|
-
description: string;
|
|
73
|
-
type: string;
|
|
74
|
-
defaultValue: never[];
|
|
75
|
-
};
|
|
76
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "internetAccountId">>, undefined>>) => import("mobx-state-tree").IModelType<{
|
|
7
|
+
declare const stateModelFactory: (configSchema: OAuthInternetAccountConfigModel) => import("mobx-state-tree").IModelType<{
|
|
77
8
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
78
9
|
type: import("mobx-state-tree").ISimpleType<string>;
|
|
79
10
|
configuration: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
@@ -98,9 +29,7 @@ declare const stateModelFactory: (configSchema: import("@jbrowse/core/configurat
|
|
|
98
29
|
defaultValue: string;
|
|
99
30
|
};
|
|
100
31
|
domains: {
|
|
101
|
-
description: string;
|
|
102
|
-
* #getter
|
|
103
|
-
*/
|
|
32
|
+
description: string;
|
|
104
33
|
type: string;
|
|
105
34
|
defaultValue: never[];
|
|
106
35
|
};
|
|
@@ -135,9 +64,7 @@ declare const stateModelFactory: (configSchema: import("@jbrowse/core/configurat
|
|
|
135
64
|
defaultValue: boolean;
|
|
136
65
|
};
|
|
137
66
|
clientId: {
|
|
138
|
-
description: string;
|
|
139
|
-
* #getter
|
|
140
|
-
*/
|
|
67
|
+
description: string;
|
|
141
68
|
type: string;
|
|
142
69
|
defaultValue: string;
|
|
143
70
|
};
|
|
@@ -186,13 +113,9 @@ declare const stateModelFactory: (configSchema: import("@jbrowse/core/configurat
|
|
|
186
113
|
}, {
|
|
187
114
|
readonly name: string;
|
|
188
115
|
readonly description: string;
|
|
189
|
-
readonly internetAccountId: string;
|
|
190
|
-
* #getter
|
|
191
|
-
*/
|
|
116
|
+
readonly internetAccountId: string;
|
|
192
117
|
readonly authHeader: string;
|
|
193
|
-
readonly tokenType: string;
|
|
194
|
-
* #getter
|
|
195
|
-
*/
|
|
118
|
+
readonly tokenType: string;
|
|
196
119
|
readonly domains: string[];
|
|
197
120
|
readonly toggleContents: import("react").ReactNode;
|
|
198
121
|
readonly SelectorComponent: import("@jbrowse/core/util").AnyReactComponentType | undefined;
|
|
@@ -207,23 +130,23 @@ declare const stateModelFactory: (configSchema: import("@jbrowse/core/configurat
|
|
|
207
130
|
retrieveToken(): string | null;
|
|
208
131
|
validateToken(token: string, _loc: UriLocation): Promise<string>;
|
|
209
132
|
} & {
|
|
210
|
-
getToken(location?: UriLocation
|
|
133
|
+
getToken(location?: UriLocation): Promise<string>;
|
|
211
134
|
} & {
|
|
212
135
|
addAuthHeaderToInit(init: RequestInit | undefined, token: string): {
|
|
213
136
|
headers: Headers;
|
|
214
|
-
body?: BodyInit | null
|
|
215
|
-
cache?: RequestCache
|
|
216
|
-
credentials?: RequestCredentials
|
|
217
|
-
integrity?: string
|
|
218
|
-
keepalive?: boolean
|
|
219
|
-
method?: string
|
|
220
|
-
mode?: RequestMode
|
|
221
|
-
priority?: RequestPriority
|
|
222
|
-
redirect?: RequestRedirect
|
|
223
|
-
referrer?: string
|
|
224
|
-
referrerPolicy?: ReferrerPolicy
|
|
225
|
-
signal?: AbortSignal | null
|
|
226
|
-
window?: null
|
|
137
|
+
body?: BodyInit | null;
|
|
138
|
+
cache?: RequestCache;
|
|
139
|
+
credentials?: RequestCredentials;
|
|
140
|
+
integrity?: string;
|
|
141
|
+
keepalive?: boolean;
|
|
142
|
+
method?: string;
|
|
143
|
+
mode?: RequestMode;
|
|
144
|
+
priority?: RequestPriority;
|
|
145
|
+
redirect?: RequestRedirect;
|
|
146
|
+
referrer?: string;
|
|
147
|
+
referrerPolicy?: ReferrerPolicy;
|
|
148
|
+
signal?: AbortSignal | null;
|
|
149
|
+
window?: null;
|
|
227
150
|
};
|
|
228
151
|
getPreAuthorizationInformation(location: UriLocation): Promise<{
|
|
229
152
|
internetAccountType: string;
|
|
@@ -233,7 +156,7 @@ declare const stateModelFactory: (configSchema: import("@jbrowse/core/configurat
|
|
|
233
156
|
};
|
|
234
157
|
}>;
|
|
235
158
|
} & {
|
|
236
|
-
getFetcher(loc?: UriLocation
|
|
159
|
+
getFetcher(loc?: UriLocation): (input: RequestInfo, init?: RequestInit) => Promise<Response>;
|
|
237
160
|
} & {
|
|
238
161
|
openLocation(location: UriLocation): import("@jbrowse/core/util/io").RemoteFileWithRangeCache;
|
|
239
162
|
} & {
|
package/dist/OAuthModel/util.js
CHANGED
|
@@ -23,17 +23,18 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
26
|
+
exports.fixup = fixup;
|
|
27
|
+
exports.generateChallenge = generateChallenge;
|
|
28
|
+
exports.processError = processError;
|
|
29
|
+
exports.processTokenResponse = processTokenResponse;
|
|
27
30
|
function fixup(buf) {
|
|
28
31
|
return buf.replaceAll('+', '-').replaceAll('/', '_').replaceAll('=', '');
|
|
29
32
|
}
|
|
30
|
-
exports.fixup = fixup;
|
|
31
33
|
async function generateChallenge(val) {
|
|
32
34
|
const sha256 = await Promise.resolve().then(() => __importStar(require('crypto-js/sha256'))).then(f => f.default);
|
|
33
35
|
const Base64 = await Promise.resolve().then(() => __importStar(require('crypto-js/enc-base64')));
|
|
34
36
|
return fixup(Base64.stringify(sha256(val)));
|
|
35
37
|
}
|
|
36
|
-
exports.generateChallenge = generateChallenge;
|
|
37
38
|
// if response is JSON, checks if it needs to remove tokens in error, or just plain throw
|
|
38
39
|
function processError(text, invalidErrorCb) {
|
|
39
40
|
var _a;
|
|
@@ -49,11 +50,9 @@ function processError(text, invalidErrorCb) {
|
|
|
49
50
|
}
|
|
50
51
|
return text;
|
|
51
52
|
}
|
|
52
|
-
exports.processError = processError;
|
|
53
53
|
function processTokenResponse(data, storeRefreshTokenCb) {
|
|
54
54
|
if (data.refresh_token) {
|
|
55
55
|
storeRefreshTokenCb(data.refresh_token);
|
|
56
56
|
}
|
|
57
57
|
return data.access_token;
|
|
58
58
|
}
|
|
59
|
-
exports.processTokenResponse = processTokenResponse;
|