[ARVADOS-WORKBENCH2] updated: 1.3.1-447-g0209f5e7

Git user git at public.curoverse.com
Mon May 13 16:50:22 UTC 2019


Summary of changes:
 src/common/config.ts              |  2 +-
 src/views/workbench/fed-login.tsx | 31 +++++++++++++++++++++++--------
 2 files changed, 24 insertions(+), 9 deletions(-)

       via  0209f5e7f2ec688f545f5025bafee2f2ea90a71b (commit)
      from  ccf093578f01b3d8ac0c421f85063939b3cd271d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 0209f5e7f2ec688f545f5025bafee2f2ea90a71b
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date:   Mon May 13 12:29:04 2019 -0400

    15064: create iframes that load /fedtoken with salted token
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>

diff --git a/src/common/config.ts b/src/common/config.ts
index 7abff5da..71b7774c 100644
--- a/src/common/config.ts
+++ b/src/common/config.ts
@@ -137,4 +137,4 @@ const getDefaultConfig = (): ConfigJSON => ({
 });
 
 export const DISCOVERY_URL = 'discovery/v1/apis/arvados/v1/rest';
-export const getDiscoveryURL = (apiHost: string) => `${window.location.protocol}//${apiHost}/${DISCOVERY_URL}`;
+export const getDiscoveryURL = (apiHost: string) => `${window.location.protocol}//${apiHost}/${DISCOVERY_URL}?nocache=${(new Date()).getTime()}`;
diff --git a/src/views/workbench/fed-login.tsx b/src/views/workbench/fed-login.tsx
index 0e9b5308..399b419e 100644
--- a/src/views/workbench/fed-login.tsx
+++ b/src/views/workbench/fed-login.tsx
@@ -6,26 +6,41 @@ import * as React from 'react';
 import { connect } from 'react-redux';
 import { RootState } from '~/store/store';
 import { AuthState } from '~/store/auth/auth-reducer';
+import { User } from "~/models/user";
 import { getSaltedToken } from '~/store/auth/auth-action-session';
+import { Config } from '~/common/config';
 
 export interface FedLoginProps {
-    auth: AuthState;
+    user?: User;
+    apiToken?: string;
+    homeCluster: string;
+    remoteHostsConfig: { [key: string]: Config };
 }
 
-const mapStateToProps = ({ auth }: RootState) => ({ auth });
+const mapStateToProps = ({ auth }: RootState) => ({
+    user: auth.user,
+    apiToken: auth.apiToken,
+    remoteHostsConfig: auth.remoteHostsConfig,
+    homeCluster: auth.homeCluster,
+});
 
 export const FedLogin = connect(mapStateToProps)(
     class extends React.Component<FedLoginProps> {
         render() {
-            const auth = this.props.auth;
-            const remoteHostsConfig = auth.remoteHostsConfig;
-            if (!auth.user || !auth.user.uuid.startsWith(auth.homeCluster)) {
+            const { apiToken, user, homeCluster, remoteHostsConfig } = this.props;
+            if (!apiToken || !user || !user.uuid.startsWith(homeCluster)) {
                 return <></>;
             }
-            return <div>
+            const [, tokenUuid, token] = apiToken.split("/");
+            return <div id={"fedtoken-iframe-div"}>
                 {Object.keys(remoteHostsConfig)
-                    .filter((k) => k !== auth.homeCluster)
-                    .map((k) => <iframe key={k} src={"https://" + remoteHostsConfig[k].workbench2Url} style={{ visibility: "hidden" }} />)}
+                    .map((k) => k !== homeCluster &&
+                        <iframe key={k} src={`${remoteHostsConfig[k].workbench2Url}/fedtoken?api_token=${getSaltedToken(k, tokenUuid, token)}`} style={{
+                            height: 0,
+                            width: 0,
+                            visibility: "hidden"
+                        }}
+                        />)}
             </div>;
         }
     });

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list