-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from dpastoor/tn-add-auth-licensing
- Loading branch information
Showing
21 changed files
with
862 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,61 @@ | ||
# (W)ork(b)ench (I)nstaller | ||
|
||
A hacking project done at Posit Workweek 2022 with the solutions | ||
engineering team. | ||
## Functionality | ||
- Verify Workbench is installed & output version | ||
- Ask which languages will be used | ||
- R is required | ||
- Scan and output of found R installations | ||
- If no /opt/R locations found, tell user about the Posit Installation recommendations | ||
- Python is optional | ||
- Scan and output of found Python installations | ||
- If no /opt/python locations found, tell user about the Posit Installation recommendations | ||
- Ask if Jupyter should be installed | ||
- Ask which Python location Jupyter should be installed into | ||
- Install jupyter, jupyterlab, rsp_jupyter, rsconnect_jupyter and workbench_jupyterlab | ||
- Install and enable Jupyter Notebook extensions | ||
- Ask if SSL should be setup | ||
- Ask for cert location | ||
- Ask for cert key location | ||
- Ask for desired authentication method | ||
- Current choices are: | ||
- SAML | ||
- Ask for IdP metadata URL | ||
- Ask for IdP username attribute (default provided) | ||
- Link to IdP setup in Admin guide provided | ||
- OIDC | ||
- Link to IdP setup in Admin guide provided | ||
- Ask for IdP client-id | ||
- Ask for IdP client-secret | ||
- Ask for IdP issuer URL | ||
- Ask for IdP username claim (default provided) | ||
- AD/LDAP | ||
- Provide links to support articles for integrating Active Directory for the operating systems below (detected automatically) | ||
- Ubuntu | ||
- RHEL | ||
- PAM | ||
- Provide link for PAM customization | ||
- Other | ||
- Provide link for other authentication methods | ||
- Ask for Workbench license key | ||
- Activate Workbench | ||
|
||
Let's make configuring workbench easier :-) | ||
|
||
## Assumptions | ||
- Single server | ||
- SQLite database | ||
- Workbench has already been installed | ||
- R has already been installed | ||
- Python has already been installed | ||
- Internet access (online installation) | ||
|
||
## TODO | ||
- Display progress for command outputs | ||
- Present user at the end with all known configuration info | ||
- Write out configuration files | ||
- Verify SSL certs | ||
- Install Workbench from WBI | ||
- Present possible R versions and allow user to install from WBI | ||
- Present possible Python versions and allow user to install from WBI | ||
- Provide a branch for HA setup | ||
- PostgreSQL details | ||
- NFS details |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,92 @@ | ||
package authentication | ||
|
||
import ( | ||
"errors" | ||
"fmt" | ||
|
||
"github.com/AlecAivazis/survey/v2" | ||
"github.com/dpastoor/wbi/internal/config" | ||
) | ||
|
||
// Run functions and store values in the OIDCConfig | ||
func HandleOIDCConfig(OIDCConfig *config.OIDCConfig) error { | ||
OIDCConfig.AuthOpenID = 1 | ||
|
||
ClientID, err := PromptOIDCClientID() | ||
OIDCConfig.ClientID = ClientID | ||
if err != nil { | ||
return fmt.Errorf("PromptOIDCClientID: %w", err) | ||
} | ||
|
||
ClientSecret, err := PromptOIDCClientSecret() | ||
OIDCConfig.ClientSecret = ClientSecret | ||
if err != nil { | ||
return fmt.Errorf("PromptOIDCClientSecret: %w", err) | ||
} | ||
|
||
AuthOpenIDIssuer, err := PromptOIDCIssuerURL() | ||
OIDCConfig.AuthOpenIDIssuer = AuthOpenIDIssuer | ||
if err != nil { | ||
return fmt.Errorf("PromptOIDCIssuerURL: %w", err) | ||
} | ||
|
||
AuthOpenIDUsernameClaim, err := PromptOIDCUsernameClaim() | ||
OIDCConfig.AuthOpenIDUsernameClaim = AuthOpenIDUsernameClaim | ||
if err != nil { | ||
return fmt.Errorf("PromptOIDCUsernameClaim: %w", err) | ||
} | ||
return nil | ||
} | ||
|
||
// Prompt asking users to provide a client-id for OIDC | ||
func PromptOIDCClientID() (string, error) { | ||
name := "" | ||
prompt := &survey.Input{ | ||
Message: "OpenID Connect IdP provided client-id:", | ||
} | ||
err := survey.AskOne(prompt, &name) | ||
if err != nil { | ||
return "", errors.New("there was an issue with the OIDC client-id prompt") | ||
} | ||
return name, nil | ||
} | ||
|
||
// Prompt asking users to provide a client-secret for OIDC | ||
func PromptOIDCClientSecret() (string, error) { | ||
name := "" | ||
prompt := &survey.Input{ | ||
Message: "OpenID Connect IdP provided client-secret:", | ||
} | ||
err := survey.AskOne(prompt, &name) | ||
if err != nil { | ||
return "", errors.New("there was an issue with the OIDC client-secret prompt") | ||
} | ||
return name, nil | ||
} | ||
|
||
// Prompt asking users to provide an issuer URL for OIDC | ||
func PromptOIDCIssuerURL() (string, error) { | ||
name := "" | ||
prompt := &survey.Input{ | ||
Message: "OpenID Connect IdP provided issuer URL:", | ||
} | ||
err := survey.AskOne(prompt, &name) | ||
if err != nil { | ||
return "", errors.New("there was an issue with the OIDC IdP issuer URL prompt") | ||
} | ||
return name, nil | ||
} | ||
|
||
// Prompt asking users to provide a username claim for OIDC | ||
func PromptOIDCUsernameClaim() (string, error) { | ||
name := "preferred_username" | ||
prompt := &survey.Input{ | ||
Message: "OpenID Connect IdP provided username claim:", | ||
Default: "preferred_username", | ||
} | ||
err := survey.AskOne(prompt, &name) | ||
if err != nil { | ||
return "", errors.New("there was an issue with the OIDC IdP username claim prompt") | ||
} | ||
return name, nil | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.