[ARVADOS-WORKBENCH2] updated: 1.4.1-331-geda123a5
Git user
git at public.arvados.org
Tue Apr 28 18:25:10 UTC 2020
Summary of changes:
src/common/config.ts | 4 ++--
src/views/login-panel/login-panel.tsx | 32 ++++++++++++++++++--------------
2 files changed, 20 insertions(+), 16 deletions(-)
via eda123a54c6727b509c5ceed77b0168073c16a50 (commit)
from 1866fb495c300387c2549cbf21a7f8206224314a (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 eda123a54c6727b509c5ceed77b0168073c16a50
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date: Tue Apr 28 15:24:34 2020 -0300
16212: Uses exported Login.Endpoint config to show login form or button.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>
diff --git a/src/common/config.ts b/src/common/config.ts
index f9fb9f6a..fb1a3a86 100644
--- a/src/common/config.ts
+++ b/src/common/config.ts
@@ -58,7 +58,7 @@ export interface ClusterConfigJSON {
};
Login: {
LoginCluster: string;
- PAM: boolean;
+ Endpoint: string;
};
Collections: {
ForwardSlashNameSubstitution: string;
@@ -188,7 +188,7 @@ export const mockClusterConfigJSON = (config: Partial<ClusterConfigJSON>): Clust
},
Login: {
LoginCluster: "",
- PAM: false,
+ Endpoint: "login",
},
Collections: {
ForwardSlashNameSubstitution: "",
diff --git a/src/views/login-panel/login-panel.tsx b/src/views/login-panel/login-panel.tsx
index 25fee7eb..27d28213 100644
--- a/src/views/login-panel/login-panel.tsx
+++ b/src/views/login-panel/login-panel.tsx
@@ -49,7 +49,7 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
}
});
-const doPAMLogin = (url: string) => (username: string, password: string) => {
+const doFormLogin = (url: string) => (username: string, password: string) => {
const formData = [];
formData.push('username='+encodeURIComponent(username));
formData.push('password='+encodeURIComponent(password));
@@ -66,7 +66,7 @@ type LoginPanelProps = DispatchProp<any> & WithStyles<CssRules> & {
localCluster: string,
loginCluster: string,
welcomePage: string,
- pamLogin: boolean,
+ loginEndpoint: string,
};
export const LoginPanel = withStyles(styles)(
@@ -76,9 +76,9 @@ export const LoginPanel = withStyles(styles)(
localCluster: state.auth.localCluster,
loginCluster: state.auth.loginCluster,
welcomePage: state.auth.config.clusterConfig.Workbench.WelcomePageHTML,
- pamLogin: state.auth.remoteHostsConfig[state.auth.loginCluster || state.auth.homeCluster] &&
- state.auth.remoteHostsConfig[state.auth.loginCluster || state.auth.homeCluster].clusterConfig.Login.PAM || false,
- }))(({ classes, dispatch, remoteHosts, homeCluster, localCluster, loginCluster, welcomePage, pamLogin }: LoginPanelProps) => {
+ loginEndpoint: state.auth.remoteHostsConfig[state.auth.loginCluster || state.auth.homeCluster] &&
+ state.auth.remoteHostsConfig[state.auth.loginCluster || state.auth.homeCluster].clusterConfig.Login.Endpoint || 'login',
+ }))(({ classes, dispatch, remoteHosts, homeCluster, localCluster, loginCluster, welcomePage, loginEndpoint }: LoginPanelProps) => {
const loginBtnLabel = `Log in${(localCluster !== homeCluster && loginCluster !== homeCluster) ? " to "+localCluster+" with user from "+homeCluster : ''}`;
return (<Grid container justify="center" alignItems="center"
@@ -98,19 +98,23 @@ export const LoginPanel = withStyles(styles)(
</Select>
</Typography>}
- {pamLogin
+ {loginEndpoint === 'authenticate'
? <Typography component="div">
<LoginForm dispatch={dispatch}
loginLabel={loginBtnLabel}
- handleSubmit={doPAMLogin(`https://${remoteHosts[loginCluster || homeCluster]}`)}/>
+ handleSubmit={doFormLogin(`https://${remoteHosts[loginCluster || homeCluster]}`)}/>
</Typography>
- : <Typography component="div" align="right">
- <Button variant="contained" color="primary" style={{ margin: "1em" }}
- className={classes.button}
- onClick={() => dispatch(login(localCluster, homeCluster, loginCluster, remoteHosts))}>
- {loginBtnLabel}
- </Button>
- </Typography>}
+ : loginEndpoint === 'login'
+ ? <Typography component="div" align="right">
+ <Button variant="contained" color="primary" style={{ margin: "1em" }}
+ className={classes.button}
+ onClick={() => dispatch(login(localCluster, homeCluster, loginCluster, remoteHosts))}>
+ {loginBtnLabel}
+ </Button>
+ </Typography>
+ : <Typography component="div">
+ <div style={{ color: "#f22" }}>Error: Configured authentication endpoint "{loginEndpoint}" unknown. Please contact the site admin.</div>
+ </Typography>}
</Grid>
</Grid >);}
));
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list