Fixed priorities and OpenID issues
This commit is contained in:
@@ -2,7 +2,7 @@ module main
|
|||||||
|
|
||||||
go 1.16
|
go 1.16
|
||||||
|
|
||||||
replace github.com/shuffle/shuffle-shared => ../../../shuffle-shared
|
//replace github.com/shuffle/shuffle-shared => ../../../shuffle-shared
|
||||||
|
|
||||||
//replace github.com/frikky/kin-openapi => ../../../../git/kin-openapi
|
//replace github.com/frikky/kin-openapi => ../../../../git/kin-openapi
|
||||||
//replace github.com/frikky/go-elasticsearch => ../../../../git/go-elasticsearch
|
//replace github.com/frikky/go-elasticsearch => ../../../../git/go-elasticsearch
|
||||||
@@ -24,7 +24,7 @@ require (
|
|||||||
github.com/h2non/filetype v1.1.3
|
github.com/h2non/filetype v1.1.3
|
||||||
github.com/nirasan/go-oauth-pkce-code-verifier v0.0.0-20170819232839-0fbfe93532da // indirect
|
github.com/nirasan/go-oauth-pkce-code-verifier v0.0.0-20170819232839-0fbfe93532da // indirect
|
||||||
github.com/satori/go.uuid v1.2.0
|
github.com/satori/go.uuid v1.2.0
|
||||||
github.com/shuffle/shuffle-shared v0.2.44
|
github.com/shuffle/shuffle-shared v0.2.46
|
||||||
go4.org v0.0.0-20201209231011-d4a079459e60 // indirect
|
go4.org v0.0.0-20201209231011-d4a079459e60 // indirect
|
||||||
golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce
|
golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce
|
||||||
google.golang.org/api v0.65.0
|
google.golang.org/api v0.65.0
|
||||||
|
|||||||
+15
-3
@@ -1041,7 +1041,7 @@ func handleInfo(resp http.ResponseWriter, request *http.Request) {
|
|||||||
orgPriorities := org.Priorities
|
orgPriorities := org.Priorities
|
||||||
if len(org.Priorities) < 5 {
|
if len(org.Priorities) < 5 {
|
||||||
log.Printf("[WARNING] Should find and add priorities as length is less than 5 for org %s", userInfo.ActiveOrg.Id)
|
log.Printf("[WARNING] Should find and add priorities as length is less than 5 for org %s", userInfo.ActiveOrg.Id)
|
||||||
newPriorities, err := shuffle.GetPriorities(ctx, org)
|
newPriorities, err := shuffle.GetPriorities(ctx, userInfo, org)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("[WARNING] Failed getting new priorities for org %s: %s", org.Id, err)
|
log.Printf("[WARNING] Failed getting new priorities for org %s: %s", org.Id, err)
|
||||||
//orgPriorities = []shuffle.Priority{}
|
//orgPriorities = []shuffle.Priority{}
|
||||||
@@ -1247,7 +1247,6 @@ func checkAdminLogin(resp http.ResponseWriter, request *http.Request) {
|
|||||||
|
|
||||||
// Should run calculations
|
// Should run calculations
|
||||||
if len(org.SSOConfig.OpenIdAuthorization) > 0 {
|
if len(org.SSOConfig.OpenIdAuthorization) > 0 {
|
||||||
log.Printf("[DEBUG] Found OpenID url (PKCE!!). Extra redirect check: %s", request.URL.String())
|
|
||||||
baseSSOUrl = org.SSOConfig.OpenIdAuthorization
|
baseSSOUrl = org.SSOConfig.OpenIdAuthorization
|
||||||
|
|
||||||
codeChallenge := uuid.NewV4().String()
|
codeChallenge := uuid.NewV4().String()
|
||||||
@@ -1276,7 +1275,20 @@ func checkAdminLogin(resp http.ResponseWriter, request *http.Request) {
|
|||||||
|
|
||||||
//log.Printf("[DEBUG] Got challenge value %s (POST state)", codeChallenge)
|
//log.Printf("[DEBUG] Got challenge value %s (POST state)", codeChallenge)
|
||||||
|
|
||||||
|
if len(org.SSOConfig.OpenIdClientSecret) > 0 {
|
||||||
|
|
||||||
|
//baseSSOUrl += fmt.Sprintf("?client_id=%s&response_type=code&scope=openid&redirect_uri=%s&state=%s&client_secret=%s", org.SSOConfig.OpenIdClientId, redirectUrl, state, org.SSOConfig.OpenIdClientSecret)
|
||||||
|
state := base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("org=%s&redirect=%s&challenge=%s", org.Id, redirectUrl, org.SSOConfig.OpenIdClientSecret)))
|
||||||
|
log.Printf("URL: %s", redirectUrl)
|
||||||
|
|
||||||
|
baseSSOUrl += fmt.Sprintf("?client_id=%s&response_type=id_token&scope=openid&redirect_uri=%s&state=%s&response_mode=form_post&nonce=%s", org.SSOConfig.OpenIdClientId, redirectUrl, state, state)
|
||||||
|
//baseSSOUrl += fmt.Sprintf("&client_secret=%s", org.SSOConfig.OpenIdClientSecret)
|
||||||
|
log.Printf("[DEBUG] Found OpenID url (client secret). Extra redirect check: %s - %s", request.URL.String(), baseSSOUrl)
|
||||||
|
} else {
|
||||||
|
log.Printf("[DEBUG] Found OpenID url (PKCE!!). Extra redirect check: %s", request.URL.String())
|
||||||
baseSSOUrl += fmt.Sprintf("?client_id=%s&response_type=code&scope=openid&redirect_uri=%s&state=%s&code_challenge_method=S256&code_challenge=%s", org.SSOConfig.OpenIdClientId, redirectUrl, state, codeChallenge)
|
baseSSOUrl += fmt.Sprintf("?client_id=%s&response_type=code&scope=openid&redirect_uri=%s&state=%s&code_challenge_method=S256&code_challenge=%s", org.SSOConfig.OpenIdClientId, redirectUrl, state, codeChallenge)
|
||||||
|
}
|
||||||
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6065,7 +6077,7 @@ func initHandlers() {
|
|||||||
r.HandleFunc("/api/v1/get_docker_image", getDockerImage).Methods("POST", "OPTIONS")
|
r.HandleFunc("/api/v1/get_docker_image", getDockerImage).Methods("POST", "OPTIONS")
|
||||||
r.HandleFunc("/api/v1/migrate_database", migrateDatabase).Methods("POST", "OPTIONS")
|
r.HandleFunc("/api/v1/migrate_database", migrateDatabase).Methods("POST", "OPTIONS")
|
||||||
r.HandleFunc("/api/v1/login_sso", shuffle.HandleSSO).Methods("GET", "POST", "OPTIONS")
|
r.HandleFunc("/api/v1/login_sso", shuffle.HandleSSO).Methods("GET", "POST", "OPTIONS")
|
||||||
r.HandleFunc("/api/v1/login_openid", shuffle.HandleOpenId).Methods("GET", "OPTIONS")
|
r.HandleFunc("/api/v1/login_openid", shuffle.HandleOpenId).Methods("GET", "POST", "OPTIONS")
|
||||||
|
|
||||||
// Important for email, IDS etc. Create this by:
|
// Important for email, IDS etc. Create this by:
|
||||||
// PS: For cloud, this has to use cloud storage.
|
// PS: For cloud, this has to use cloud storage.
|
||||||
|
|||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
version: '3'
|
version: '3'
|
||||||
services:
|
services:
|
||||||
frontend:
|
frontend:
|
||||||
#build: ./frontend
|
build: ./frontend
|
||||||
image: ghcr.io/frikky/shuffle-frontend:nightly
|
image: ghcr.io/frikky/shuffle-frontend:nightly
|
||||||
container_name: shuffle-frontend
|
container_name: shuffle-frontend
|
||||||
hostname: shuffle-frontend
|
hostname: shuffle-frontend
|
||||||
@@ -16,7 +16,7 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- backend
|
- backend
|
||||||
backend:
|
backend:
|
||||||
#build: ./backend
|
build: ./backend
|
||||||
image: ghcr.io/frikky/shuffle-backend:nightly
|
image: ghcr.io/frikky/shuffle-backend:nightly
|
||||||
container_name: shuffle-backend
|
container_name: shuffle-backend
|
||||||
hostname: ${BACKEND_HOSTNAME}
|
hostname: ${BACKEND_HOSTNAME}
|
||||||
|
|||||||
@@ -1607,7 +1607,7 @@ const Framework = (props) => {
|
|||||||
/>
|
/>
|
||||||
:
|
:
|
||||||
<div>
|
<div>
|
||||||
Coming in 1.0.0. <a style={{ textDecoration: "none", color: "#f85a3e" }} href="https://shuffler.io/register" target="_blank">Register for Shuffle cloud</a> to try an early version now.
|
Coming soon. <a style={{ textDecoration: "none", color: "#f85a3e" }} href="https://shuffler.io/register" target="_blank">Register for Shuffle cloud</a> to try an early version now.
|
||||||
</div>
|
</div>
|
||||||
: null}
|
: null}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -105,6 +105,14 @@ const OrgHeader = (props) => {
|
|||||||
? ""
|
? ""
|
||||||
: selectedOrganization.sso_config.client_id
|
: selectedOrganization.sso_config.client_id
|
||||||
);
|
);
|
||||||
|
const [openidClientSecret, setOpenidClientSecret] = React.useState(
|
||||||
|
selectedOrganization.sso_config === undefined
|
||||||
|
? ""
|
||||||
|
: selectedOrganization.sso_config.client_secret === undefined ||
|
||||||
|
selectedOrganization.sso_config.client_secret.length === 0
|
||||||
|
? ""
|
||||||
|
: selectedOrganization.sso_config.client_secret
|
||||||
|
);
|
||||||
const [openidAuthorization, setOpenidAuthorization] = React.useState(
|
const [openidAuthorization, setOpenidAuthorization] = React.useState(
|
||||||
selectedOrganization.sso_config === undefined
|
selectedOrganization.sso_config === undefined
|
||||||
? ""
|
? ""
|
||||||
@@ -242,6 +250,7 @@ const OrgHeader = (props) => {
|
|||||||
sso_entrypoint: ssoEntrypoint,
|
sso_entrypoint: ssoEntrypoint,
|
||||||
sso_certificate: ssoCertificate,
|
sso_certificate: ssoCertificate,
|
||||||
client_id: openidClientId,
|
client_id: openidClientId,
|
||||||
|
client_secret: openidClientSecret,
|
||||||
openid_authorization: openidAuthorization,
|
openid_authorization: openidAuthorization,
|
||||||
openid_token: openidToken,
|
openid_token: openidToken,
|
||||||
}
|
}
|
||||||
@@ -439,6 +448,240 @@ const OrgHeader = (props) => {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
|
</Grid>
|
||||||
|
{isCloud ? null :
|
||||||
|
<Grid item xs={12} style={{marginTop: 50 }}>
|
||||||
|
<Typography variant="h4" style={{textAlign: "center",}}>OpenID connect</Typography>
|
||||||
|
<Grid container style={{marginTop: 10, }}>
|
||||||
|
<Grid item xs={6} style={{}}>
|
||||||
|
<span>
|
||||||
|
<Typography>Client ID</Typography>
|
||||||
|
<TextField
|
||||||
|
required
|
||||||
|
style={{
|
||||||
|
flex: "1",
|
||||||
|
marginTop: "5px",
|
||||||
|
marginRight: "15px",
|
||||||
|
backgroundColor: theme.palette.inputColor,
|
||||||
|
}}
|
||||||
|
fullWidth={true}
|
||||||
|
type="name"
|
||||||
|
multiline={true}
|
||||||
|
rows={2}
|
||||||
|
disabled={
|
||||||
|
selectedOrganization.manager_orgs !== undefined &&
|
||||||
|
selectedOrganization.manager_orgs !== null &&
|
||||||
|
selectedOrganization.manager_orgs.length > 0
|
||||||
|
}
|
||||||
|
id="outlined-with-placeholder"
|
||||||
|
margin="normal"
|
||||||
|
variant="outlined"
|
||||||
|
placeholder="The OpenID client ID from the identity provider"
|
||||||
|
value={openidClientId}
|
||||||
|
onChange={(e) => {
|
||||||
|
setOpenidClientId(e.target.value);
|
||||||
|
}}
|
||||||
|
InputProps={{
|
||||||
|
classes: {
|
||||||
|
notchedOutline: classes.notchedOutline,
|
||||||
|
},
|
||||||
|
style: {
|
||||||
|
color: "white",
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={6} style={{}}>
|
||||||
|
<span>
|
||||||
|
<Typography>Client Secret (optional)</Typography>
|
||||||
|
<TextField
|
||||||
|
required
|
||||||
|
style={{
|
||||||
|
flex: "1",
|
||||||
|
marginTop: "5px",
|
||||||
|
marginRight: "15px",
|
||||||
|
backgroundColor: theme.palette.inputColor,
|
||||||
|
}}
|
||||||
|
fullWidth={true}
|
||||||
|
type="name"
|
||||||
|
multiline={true}
|
||||||
|
rows={2}
|
||||||
|
disabled={
|
||||||
|
selectedOrganization.manager_orgs !== undefined &&
|
||||||
|
selectedOrganization.manager_orgs !== null &&
|
||||||
|
selectedOrganization.manager_orgs.length > 0
|
||||||
|
}
|
||||||
|
id="outlined-with-placeholder"
|
||||||
|
margin="normal"
|
||||||
|
variant="outlined"
|
||||||
|
placeholder="The OpenID client secret - DONT use this if dealing with implicit auth / PKCE"
|
||||||
|
value={openidClientSecret}
|
||||||
|
onChange={(e) => {
|
||||||
|
setOpenidClientSecret(e.target.value);
|
||||||
|
}}
|
||||||
|
InputProps={{
|
||||||
|
classes: {
|
||||||
|
notchedOutline: classes.notchedOutline,
|
||||||
|
},
|
||||||
|
style: {
|
||||||
|
color: "white",
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
<Grid container style={{marginTop: 10, }}>
|
||||||
|
<Grid item xs={6} style={{}}>
|
||||||
|
<span>
|
||||||
|
<Typography>Authorization URL</Typography>
|
||||||
|
<TextField
|
||||||
|
required
|
||||||
|
style={{
|
||||||
|
flex: "1",
|
||||||
|
marginTop: "5px",
|
||||||
|
marginRight: "15px",
|
||||||
|
backgroundColor: theme.palette.inputColor,
|
||||||
|
}}
|
||||||
|
fullWidth={true}
|
||||||
|
type="name"
|
||||||
|
id="outlined-with-placeholder"
|
||||||
|
margin="normal"
|
||||||
|
variant="outlined"
|
||||||
|
multiline={true}
|
||||||
|
rows={2}
|
||||||
|
placeholder="The OpenID authorization URL (usually ends with /authorize)"
|
||||||
|
value={openidAuthorization}
|
||||||
|
onChange={(e) => {
|
||||||
|
setOpenidAuthorization(e.target.value)
|
||||||
|
}}
|
||||||
|
InputProps={{
|
||||||
|
classes: {
|
||||||
|
notchedOutline: classes.notchedOutline,
|
||||||
|
},
|
||||||
|
style: {
|
||||||
|
color: "white",
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={6} style={{}}>
|
||||||
|
<span>
|
||||||
|
<Typography>Token URL</Typography>
|
||||||
|
<TextField
|
||||||
|
required
|
||||||
|
style={{
|
||||||
|
flex: "1",
|
||||||
|
marginTop: "5px",
|
||||||
|
marginRight: "15px",
|
||||||
|
backgroundColor: theme.palette.inputColor,
|
||||||
|
}}
|
||||||
|
fullWidth={true}
|
||||||
|
type="name"
|
||||||
|
id="outlined-with-placeholder"
|
||||||
|
margin="normal"
|
||||||
|
variant="outlined"
|
||||||
|
multiline={true}
|
||||||
|
rows={2}
|
||||||
|
placeholder="The OpenID token URL (usually ends with /token)"
|
||||||
|
value={openidToken}
|
||||||
|
onChange={(e) => {
|
||||||
|
setOpenidToken(e.target.value)
|
||||||
|
}}
|
||||||
|
InputProps={{
|
||||||
|
classes: {
|
||||||
|
notchedOutline: classes.notchedOutline,
|
||||||
|
},
|
||||||
|
style: {
|
||||||
|
color: "white",
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
}
|
||||||
|
{/*isCloud ? null : */}
|
||||||
|
<Grid item xs={12} style={{marginTop: 50,}}>
|
||||||
|
<Typography variant="h4" style={{textAlign: "center",}}>SAML SSO (v1.1)</Typography>
|
||||||
|
<Grid container style={{marginTop: 10, }}>
|
||||||
|
<Grid item xs={6} style={{}}>
|
||||||
|
<span>
|
||||||
|
<Typography>SSO Entrypoint (IdP)</Typography>
|
||||||
|
<TextField
|
||||||
|
required
|
||||||
|
style={{
|
||||||
|
flex: "1",
|
||||||
|
marginTop: "5px",
|
||||||
|
marginRight: "15px",
|
||||||
|
backgroundColor: theme.palette.inputColor,
|
||||||
|
}}
|
||||||
|
fullWidth={true}
|
||||||
|
type="name"
|
||||||
|
multiline={true}
|
||||||
|
rows={2}
|
||||||
|
disabled={
|
||||||
|
selectedOrganization.manager_orgs !== undefined &&
|
||||||
|
selectedOrganization.manager_orgs !== null &&
|
||||||
|
selectedOrganization.manager_orgs.length > 0
|
||||||
|
}
|
||||||
|
id="outlined-with-placeholder"
|
||||||
|
margin="normal"
|
||||||
|
variant="outlined"
|
||||||
|
placeholder="The entrypoint URL from your provider"
|
||||||
|
value={ssoEntrypoint}
|
||||||
|
onChange={(e) => {
|
||||||
|
setSsoEntrypoint(e.target.value);
|
||||||
|
}}
|
||||||
|
InputProps={{
|
||||||
|
classes: {
|
||||||
|
notchedOutline: classes.notchedOutline,
|
||||||
|
},
|
||||||
|
style: {
|
||||||
|
color: "white",
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={6} style={{}}>
|
||||||
|
<span>
|
||||||
|
<Typography>SSO Certificate (X509)</Typography>
|
||||||
|
<TextField
|
||||||
|
required
|
||||||
|
style={{
|
||||||
|
flex: "1",
|
||||||
|
marginTop: "5px",
|
||||||
|
marginRight: "15px",
|
||||||
|
backgroundColor: theme.palette.inputColor,
|
||||||
|
}}
|
||||||
|
fullWidth={true}
|
||||||
|
type="name"
|
||||||
|
id="outlined-with-placeholder"
|
||||||
|
margin="normal"
|
||||||
|
variant="outlined"
|
||||||
|
multiline={true}
|
||||||
|
rows={2}
|
||||||
|
placeholder="The X509 certificate to use"
|
||||||
|
value={ssoCertificate}
|
||||||
|
onChange={(e) => {
|
||||||
|
setSsoCertificate(e.target.value);
|
||||||
|
}}
|
||||||
|
InputProps={{
|
||||||
|
classes: {
|
||||||
|
notchedOutline: classes.notchedOutline,
|
||||||
|
},
|
||||||
|
style: {
|
||||||
|
color: "white",
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
{isCloud ? null : (
|
{isCloud ? null : (
|
||||||
<Grid item xs={6} style={{}}>
|
<Grid item xs={6} style={{}}>
|
||||||
@@ -576,199 +819,10 @@ const OrgHeader = (props) => {
|
|||||||
</span>
|
</span>
|
||||||
</Grid>
|
</Grid>
|
||||||
)}
|
)}
|
||||||
{isCloud ? null :
|
|
||||||
<Grid item xs={12} style={{marginTop: 50 }}>
|
<div style={{ margin: "auto", textalign: "center", marginTop: 15, marginBottom: 15, }}>
|
||||||
<Typography variant="h4" style={{textAlign: "center",}}>OpenID connect</Typography>
|
{orgSaveButton}
|
||||||
<Grid container style={{marginTop: 10, }}>
|
</div>
|
||||||
<Grid item xs={4} style={{}}>
|
|
||||||
<span>
|
|
||||||
<Typography>Client ID</Typography>
|
|
||||||
<TextField
|
|
||||||
required
|
|
||||||
style={{
|
|
||||||
flex: "1",
|
|
||||||
marginTop: "5px",
|
|
||||||
marginRight: "15px",
|
|
||||||
backgroundColor: theme.palette.inputColor,
|
|
||||||
}}
|
|
||||||
fullWidth={true}
|
|
||||||
type="name"
|
|
||||||
multiline={true}
|
|
||||||
rows={2}
|
|
||||||
disabled={
|
|
||||||
selectedOrganization.manager_orgs !== undefined &&
|
|
||||||
selectedOrganization.manager_orgs !== null &&
|
|
||||||
selectedOrganization.manager_orgs.length > 0
|
|
||||||
}
|
|
||||||
id="outlined-with-placeholder"
|
|
||||||
margin="normal"
|
|
||||||
variant="outlined"
|
|
||||||
placeholder="The OpenID client ID from the identity provider"
|
|
||||||
value={openidClientId}
|
|
||||||
onChange={(e) => {
|
|
||||||
setOpenidClientId(e.target.value);
|
|
||||||
}}
|
|
||||||
InputProps={{
|
|
||||||
classes: {
|
|
||||||
notchedOutline: classes.notchedOutline,
|
|
||||||
},
|
|
||||||
style: {
|
|
||||||
color: "white",
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={4} style={{}}>
|
|
||||||
<span>
|
|
||||||
<Typography>Authorization URL</Typography>
|
|
||||||
<TextField
|
|
||||||
required
|
|
||||||
style={{
|
|
||||||
flex: "1",
|
|
||||||
marginTop: "5px",
|
|
||||||
marginRight: "15px",
|
|
||||||
backgroundColor: theme.palette.inputColor,
|
|
||||||
}}
|
|
||||||
fullWidth={true}
|
|
||||||
type="name"
|
|
||||||
id="outlined-with-placeholder"
|
|
||||||
margin="normal"
|
|
||||||
variant="outlined"
|
|
||||||
multiline={true}
|
|
||||||
rows={2}
|
|
||||||
placeholder="The OpenID authorization URL (usually ends with /authorize)"
|
|
||||||
value={openidAuthorization}
|
|
||||||
onChange={(e) => {
|
|
||||||
setOpenidAuthorization(e.target.value)
|
|
||||||
}}
|
|
||||||
InputProps={{
|
|
||||||
classes: {
|
|
||||||
notchedOutline: classes.notchedOutline,
|
|
||||||
},
|
|
||||||
style: {
|
|
||||||
color: "white",
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={4} style={{}}>
|
|
||||||
<span>
|
|
||||||
<Typography>Token URL</Typography>
|
|
||||||
<TextField
|
|
||||||
required
|
|
||||||
style={{
|
|
||||||
flex: "1",
|
|
||||||
marginTop: "5px",
|
|
||||||
marginRight: "15px",
|
|
||||||
backgroundColor: theme.palette.inputColor,
|
|
||||||
}}
|
|
||||||
fullWidth={true}
|
|
||||||
type="name"
|
|
||||||
id="outlined-with-placeholder"
|
|
||||||
margin="normal"
|
|
||||||
variant="outlined"
|
|
||||||
multiline={true}
|
|
||||||
rows={2}
|
|
||||||
placeholder="The OpenID token URL (usually ends with /token)"
|
|
||||||
value={openidToken}
|
|
||||||
onChange={(e) => {
|
|
||||||
setOpenidToken(e.target.value)
|
|
||||||
}}
|
|
||||||
InputProps={{
|
|
||||||
classes: {
|
|
||||||
notchedOutline: classes.notchedOutline,
|
|
||||||
},
|
|
||||||
style: {
|
|
||||||
color: "white",
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
|
||||||
}
|
|
||||||
{/*isCloud ? null : */}
|
|
||||||
<Grid item xs={12} style={{marginTop: 50,}}>
|
|
||||||
<Typography variant="h4" style={{textAlign: "center",}}>SAML SSO (v1.1)</Typography>
|
|
||||||
<Grid container style={{marginTop: 10, }}>
|
|
||||||
<Grid item xs={6} style={{}}>
|
|
||||||
<span>
|
|
||||||
<Typography>SSO Entrypoint (IdP)</Typography>
|
|
||||||
<TextField
|
|
||||||
required
|
|
||||||
style={{
|
|
||||||
flex: "1",
|
|
||||||
marginTop: "5px",
|
|
||||||
marginRight: "15px",
|
|
||||||
backgroundColor: theme.palette.inputColor,
|
|
||||||
}}
|
|
||||||
fullWidth={true}
|
|
||||||
type="name"
|
|
||||||
multiline={true}
|
|
||||||
rows={2}
|
|
||||||
disabled={
|
|
||||||
selectedOrganization.manager_orgs !== undefined &&
|
|
||||||
selectedOrganization.manager_orgs !== null &&
|
|
||||||
selectedOrganization.manager_orgs.length > 0
|
|
||||||
}
|
|
||||||
id="outlined-with-placeholder"
|
|
||||||
margin="normal"
|
|
||||||
variant="outlined"
|
|
||||||
placeholder="The entrypoint URL from your provider"
|
|
||||||
value={ssoEntrypoint}
|
|
||||||
onChange={(e) => {
|
|
||||||
setSsoEntrypoint(e.target.value);
|
|
||||||
}}
|
|
||||||
InputProps={{
|
|
||||||
classes: {
|
|
||||||
notchedOutline: classes.notchedOutline,
|
|
||||||
},
|
|
||||||
style: {
|
|
||||||
color: "white",
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={6} style={{}}>
|
|
||||||
<span>
|
|
||||||
<Typography>SSO Certificate (X509)</Typography>
|
|
||||||
<TextField
|
|
||||||
required
|
|
||||||
style={{
|
|
||||||
flex: "1",
|
|
||||||
marginTop: "5px",
|
|
||||||
marginRight: "15px",
|
|
||||||
backgroundColor: theme.palette.inputColor,
|
|
||||||
}}
|
|
||||||
fullWidth={true}
|
|
||||||
type="name"
|
|
||||||
id="outlined-with-placeholder"
|
|
||||||
margin="normal"
|
|
||||||
variant="outlined"
|
|
||||||
multiline={true}
|
|
||||||
rows={2}
|
|
||||||
placeholder="The X509 certificate to use"
|
|
||||||
value={ssoCertificate}
|
|
||||||
onChange={(e) => {
|
|
||||||
setSsoCertificate(e.target.value);
|
|
||||||
}}
|
|
||||||
InputProps={{
|
|
||||||
classes: {
|
|
||||||
notchedOutline: classes.notchedOutline,
|
|
||||||
},
|
|
||||||
style: {
|
|
||||||
color: "white",
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
|
||||||
{/*
|
{/*
|
||||||
<span style={{textAlign: "center"}}>
|
<span style={{textAlign: "center"}}>
|
||||||
{expanded ?
|
{expanded ?
|
||||||
|
|||||||
@@ -2488,9 +2488,6 @@ const ParsedAction = (props) => {
|
|||||||
onChange={selectedNameChange}
|
onChange={selectedNameChange}
|
||||||
onBlur={(e) => {
|
onBlur={(e) => {
|
||||||
const name = e.target.value;
|
const name = e.target.value;
|
||||||
console.log("CHANGED FROM2: ", baselabel);
|
|
||||||
console.log("CHANGED TO: ", name);
|
|
||||||
|
|
||||||
const parsedBaseLabel = "$"+baselabel.toLowerCase().replaceAll(" ", "_")
|
const parsedBaseLabel = "$"+baselabel.toLowerCase().replaceAll(" ", "_")
|
||||||
const newname = "$"+name.toLowerCase().replaceAll(" ", "_")
|
const newname = "$"+name.toLowerCase().replaceAll(" ", "_")
|
||||||
|
|
||||||
@@ -2508,13 +2505,10 @@ const ParsedAction = (props) => {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("PARAM: ", param)
|
|
||||||
|
|
||||||
// Should have a smarter way of discovering node names
|
// Should have a smarter way of discovering node names
|
||||||
// Do regex?
|
// Do regex?
|
||||||
// Finding index(es) and replacing at the location
|
// Finding index(es) and replacing at the location
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var cnt = -1
|
var cnt = -1
|
||||||
var previous = 0
|
var previous = 0
|
||||||
@@ -2536,20 +2530,17 @@ const ParsedAction = (props) => {
|
|||||||
// Check location:
|
// Check location:
|
||||||
// If it's a-zA-Z_ then don't replace
|
// If it's a-zA-Z_ then don't replace
|
||||||
if (param.value.length > foundindex+parsedBaseLabel.length) {
|
if (param.value.length > foundindex+parsedBaseLabel.length) {
|
||||||
console.log("Validate length if valid key if it's valid - don't replace if it is: ", param.value[foundindex+parsedBaseLabel.length])
|
|
||||||
const regex = /[a-zA-Z0-9_]/g;
|
const regex = /[a-zA-Z0-9_]/g;
|
||||||
const match = param.value[foundindex+parsedBaseLabel.length].match(regex);
|
const match = param.value[foundindex+parsedBaseLabel.length].match(regex);
|
||||||
if (match !== null) {
|
if (match !== null) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("Matching: ", match)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("Found: ", foundindex)
|
|
||||||
console.log("Old found: ", workflow.actions[key].parameters[subkey].value)
|
console.log("Old found: ", workflow.actions[key].parameters[subkey].value)
|
||||||
const extralength = newname.length-parsedBaseLabel.length
|
const extralength = newname.length-parsedBaseLabel.length
|
||||||
param.value = param.value.substring(0, foundindex) + newname + param.value.substring(foundindex-extralength+newname.length, param.value.length)
|
param.value = param.value.substring(0, foundindex) + newname + param.value.substring(foundindex-extralength+newname.length, param.value.length)
|
||||||
|
|
||||||
console.log("New: ", workflow.actions[key].parameters[subkey].value)
|
console.log("New: ", workflow.actions[key].parameters[subkey].value)
|
||||||
} else {
|
} else {
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -1151,6 +1151,7 @@ const Dashboard = (props) => {
|
|||||||
return response.json();
|
return response.json();
|
||||||
})
|
})
|
||||||
.then((responseJson) => {
|
.then((responseJson) => {
|
||||||
|
// Matching workflows with usecases
|
||||||
if (responseJson.success !== false) {
|
if (responseJson.success !== false) {
|
||||||
if (workflows !== undefined && workflows !== null && workflows.length > 0) {
|
if (workflows !== undefined && workflows !== null && workflows.length > 0) {
|
||||||
var categorydata = responseJson
|
var categorydata = responseJson
|
||||||
|
|||||||
Reference in New Issue
Block a user