@deephaven/auth-plugins 0.108.1-beta.6 → 0.109.0
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthPluginParent.d.ts","sourceRoot":"","sources":["../src/AuthPluginParent.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AuthPluginParent.d.ts","sourceRoot":"","sources":["../src/AuthPluginParent.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,UAAU,EAAwB,MAAM,cAAc,CAAC;AA2CrE,QAAA,MAAM,gBAAgB,EAAE,UAIvB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
package/dist/AuthPluginParent.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
2
2
|
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { LOGIN_OPTIONS_REQUEST } from '@deephaven/jsapi-utils';
|
|
5
5
|
import Log from '@deephaven/log';
|
|
6
|
+
import { getWindowParent, requestParentResponse } from '@deephaven/utils';
|
|
6
7
|
import AuthPluginBase from "./AuthPluginBase.js";
|
|
7
8
|
import { UserPermissionsOverrideContext } from "./UserContexts.js";
|
|
8
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthPluginParent.js","names":["React","
|
|
1
|
+
{"version":3,"file":"AuthPluginParent.js","names":["React","LOGIN_OPTIONS_REQUEST","Log","getWindowParent","requestParentResponse","AuthPluginBase","UserPermissionsOverrideContext","jsx","_jsx","log","module","permissionsOverrides","canLogout","isLoginOptions","options","type","getLoginOptions","_getLoginOptions","apply","arguments","_asyncToGenerator","info","response","Error","concat","getWindowAuthProvider","_URLSearchParams$get","URLSearchParams","window","location","search","get","Component","_ref","children","Provider","value","AuthPluginParent","isAvailable"],"sources":["../src/AuthPluginParent.tsx"],"sourcesContent":["import React from 'react';\nimport type { dh } from '@deephaven/jsapi-types';\nimport { LOGIN_OPTIONS_REQUEST } from '@deephaven/jsapi-utils';\nimport Log from '@deephaven/log';\nimport { getWindowParent, requestParentResponse } from '@deephaven/utils';\nimport { type AuthPlugin, type AuthPluginProps } from './AuthPlugin';\nimport AuthPluginBase from './AuthPluginBase';\nimport {\n type UserPermissionsOverride,\n UserPermissionsOverrideContext,\n} from './UserContexts';\n\nconst log = Log.module('AuthPluginParent');\n\nconst permissionsOverrides: UserPermissionsOverride = { canLogout: false };\n\nfunction isLoginOptions(options: unknown): options is dh.LoginCredentials {\n return (\n options != null && typeof (options as dh.LoginCredentials).type === 'string'\n );\n}\n\nasync function getLoginOptions(): Promise<dh.LoginCredentials> {\n log.info('Logging in by delegating to parent window...');\n const response = await requestParentResponse(LOGIN_OPTIONS_REQUEST);\n if (!isLoginOptions(response)) {\n throw new Error(`Unexpected login options response: ${response}`);\n }\n return response;\n}\n\nfunction getWindowAuthProvider(): string {\n return new URLSearchParams(window.location.search).get('authProvider') ?? '';\n}\n\n/**\n * AuthPlugin that tries to delegate to the parent window for authentication. Fails if there is no parent window.\n */\nfunction Component({ children }: AuthPluginProps): JSX.Element {\n return (\n <AuthPluginBase getLoginOptions={getLoginOptions}>\n <UserPermissionsOverrideContext.Provider value={permissionsOverrides}>\n {children}\n </UserPermissionsOverrideContext.Provider>\n </AuthPluginBase>\n );\n}\n\nconst AuthPluginParent: AuthPlugin = {\n Component,\n isAvailable: () =>\n getWindowParent() != null && getWindowAuthProvider() === 'parent',\n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AA6C;EAAA,IAA5C;IAAEC;EAA0B,CAAC,GAAAD,IAAA;EAC9C,oBACEzB,IAAA,CAACH,cAAc;IAACW,eAAe,EAAEA,eAAgB;IAAAkB,QAAA,eAC/C1B,IAAA,CAACF,8BAA8B,CAAC6B,QAAQ;MAACC,KAAK,EAAEzB,oBAAqB;MAAAuB,QAAA,EAClEA;IAAQ,CAC8B;EAAC,CAC5B,CAAC;AAErB;AAEA,IAAMG,gBAA4B,GAAG;EACnCL,SAAS;EACTM,WAAW,EAAEA,CAAA,KACXnC,eAAe,CAAC,CAAC,IAAI,IAAI,IAAIsB,qBAAqB,CAAC,CAAC,KAAK;AAC7D,CAAC;AAED,eAAeY,gBAAgB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deephaven/auth-plugins",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.109.0",
|
|
4
4
|
"description": "Deephaven Auth Plugins",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Deephaven",
|
|
@@ -33,19 +33,19 @@
|
|
|
33
33
|
"build:sass": "sass --embed-sources --load-path=../../node_modules ./src:./dist"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@deephaven/components": "^0.
|
|
37
|
-
"@deephaven/jsapi-bootstrap": "^0.
|
|
38
|
-
"@deephaven/jsapi-components": "^0.
|
|
36
|
+
"@deephaven/components": "^0.109.0",
|
|
37
|
+
"@deephaven/jsapi-bootstrap": "^0.109.0",
|
|
38
|
+
"@deephaven/jsapi-components": "^0.109.0",
|
|
39
39
|
"@deephaven/jsapi-types": "^1.0.0-dev0.37.2",
|
|
40
|
-
"@deephaven/jsapi-utils": "^0.
|
|
41
|
-
"@deephaven/log": "^0.
|
|
42
|
-
"@deephaven/redux": "^0.
|
|
43
|
-
"@deephaven/utils": "^0.
|
|
40
|
+
"@deephaven/jsapi-utils": "^0.109.0",
|
|
41
|
+
"@deephaven/log": "^0.109.0",
|
|
42
|
+
"@deephaven/redux": "^0.109.0",
|
|
43
|
+
"@deephaven/utils": "^0.109.0",
|
|
44
44
|
"classnames": "^2.3.1",
|
|
45
45
|
"js-cookie": "^3.0.5"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@deephaven/test-utils": "^0.
|
|
48
|
+
"@deephaven/test-utils": "^0.109.0",
|
|
49
49
|
"@types/react": "^17.0.2"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"publishConfig": {
|
|
60
60
|
"access": "public"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "8dd24c00fcb5270628e21bb0bca6972db92c2408"
|
|
63
63
|
}
|