Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cmd/platform/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ const (
pingcli platform export --services pingone-platform --pingone-client-environment-id 3cf2... --pingone-worker-client-id a719... --pingone-worker-client-secret ey..... --pingone-region-code EU

Export configuration-as-code packages for PingFederate, specifying the PingFederate connection details using basic authentication.
pingcli platform export --service pingfederate --pingfederate-username administrator --pingfederate-password 2FederateM0re
pingcli platform export --services pingfederate --pingfederate-authentication-type basicAuth --pingfederate-username administrator --pingfederate-password 2FederateM0re --pingfederate-https-host https://pingfederate-admin.bxretail.org

Export configuration-as-code packages for PingFederate, specifying the PingFederate connection details using OAuth 2.0 client credentials.
pingcli platform export --service pingfederate --pingfederate-client-id clientID --pingfederate-client-secret clientSecret --pingfederate-token-url https://pingfederate.example.com/as/token.oauth2
pingcli platform export --services pingfederate --pingfederate-authentication-type clientCredentialsAuth --pingfederate-client-id clientID --pingfederate-client-secret clientSecret --pingfederate-token-url https://pingfederate-admin.bxretail.org/as/token.oauth2

Export configuration-as-code packages for PingFederate, specifying optional connection properties
pingcli platform export --service pingfederate --x-bypass-external-validation=false --ca-certificate-pem-files "/path/to/cert.pem,/path/to/cert2.pem" --insecure-trust-all-tls=false`
pingcli platform export --services pingfederate --x-bypass-external-validation=false --ca-certificate-pem-files "/path/to/cert.pem,/path/to/cert2.pem" --insecure-trust-all-tls=false`
)

func NewExportCommand() *cobra.Command {
Expand Down
4 changes: 2 additions & 2 deletions cmd/request/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ const (
pingcli request --service pingone environments

Send a custom API request to the configured PingOne tenant, making a GET request to retrieve JSON configuration for a specific environment.
pingcli request --service pingone --http-method GET environments/$MY_ENVIRONMENT_ID
pingcli request --service pingone --http-method GET --output-format json environments/$MY_ENVIRONMENT_ID

Send a custom API request to the configured PingOne tenant, making a POST request to create a new environment with raw JSON data.
Send a custom API request to the configured PingOne tenant, making a POST request to create a new environment using raw JSON data.
pingcli request --service pingone --http-method POST --data '{"name": "My environment"}' environments

Send a custom API request to the configured PingOne tenant, making a POST request to create a new environment with JSON data sourced from a file.
Expand Down
2 changes: 1 addition & 1 deletion internal/configuration/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func initConfigProfileOption() {
Flag: &pflag.Flag{
Name: cobraParamName,
Shorthand: "p",
Usage: "The name of the profile to update. E.g. `myAwesomeProfile`",
Usage: "The name of the profile to update. Example: `myAwesomeProfile`",
Value: cobraValue,
DefValue: "The active profile",
},
Expand Down
8 changes: 4 additions & 4 deletions internal/configuration/platform/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func initFormatOption() {
Flag: &pflag.Flag{
Name: cobraParamName,
Shorthand: "f",
Usage: fmt.Sprintf("Specifies the export format. E.g. `HCL`.\nOptions are: [%s].", strings.Join(customtypes.ExportFormatValidValues(), ", ")),
Usage: fmt.Sprintf("Specifies the export format.\nOptions are: %s.\nExample: `%s`", strings.Join(customtypes.ExportFormatValidValues(), ", "), string(customtypes.ENUM_EXPORT_FORMAT_HCL)),
Value: cobraValue,
DefValue: customtypes.ENUM_EXPORT_FORMAT_HCL,
},
Expand All @@ -56,7 +56,7 @@ func initServicesOption() {
Flag: &pflag.Flag{
Name: cobraParamName,
Shorthand: "s",
Usage: fmt.Sprintf("Specifies the service(s) to export. Accepts a comma-separated string to delimit multiple services. Options are: [%s].", strings.Join(customtypes.ExportServicesValidValues(), ", ")),
Usage: fmt.Sprintf("Specifies the service(s) to export. Accepts a comma-separated string to delimit multiple services.\nOptions are: %s.\nExample: `%s,%s,%s`", strings.Join(customtypes.ExportServicesValidValues(), ", "), string(customtypes.ENUM_EXPORT_SERVICE_PINGONE_SSO), string(customtypes.ENUM_EXPORT_SERVICE_PINGONE_MFA), string(customtypes.ENUM_EXPORT_SERVICE_PINGFEDERATE)),
Value: cobraValue,
DefValue: strings.Join(customtypes.ExportServicesValidValues(), ", "),
},
Expand All @@ -79,7 +79,7 @@ func initOutputDirectoryOption() {
Flag: &pflag.Flag{
Name: cobraParamName,
Shorthand: "d",
Usage: "Specifies the output directory for export.",
Usage: "Specifies the output directory for export. Example: `$HOME/pingcli-export`",
Value: cobraValue,
DefValue: "$(pwd)/export",
},
Expand Down Expand Up @@ -142,7 +142,7 @@ func initPingOneEnvironmentIDOption() {
EnvVar: envVar,
Flag: &pflag.Flag{
Name: cobraParamName,
Usage: "The ID of the PingOne environment to export.",
Usage: "The ID of the PingOne environment to export. Must be a valid PingOne UUID.",
Value: cobraValue,
DefValue: "",
},
Expand Down
6 changes: 3 additions & 3 deletions internal/configuration/request/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func initDataOption() {
EnvVar: envVar,
Flag: &pflag.Flag{
Name: cobraParamName,
Usage: "The data to send in the request. Use prefix '@' to specify data file path instead of raw data. (e.g. @data.json)",
Usage: "The data to send in the request. Use prefix '@' to specify data file path instead of raw data. Example: `@data.json`",
Value: cobraValue,
DefValue: "",
},
Expand All @@ -53,7 +53,7 @@ func initHTTPMethodOption() {
Flag: &pflag.Flag{
Name: cobraParamName,
Shorthand: "m",
Usage: fmt.Sprintf("The HTTP method to use for the request. Options are: %s.", strings.Join(customtypes.HTTPMethodValidValues(), ", ")),
Usage: fmt.Sprintf("The HTTP method to use for the request.\nOptions are: %s.\nExample: `%s`", strings.Join(customtypes.HTTPMethodValidValues(), ", "), string(customtypes.ENUM_HTTP_METHOD_POST)),
Value: cobraValue,
DefValue: customtypes.ENUM_HTTP_METHOD_GET,
},
Expand All @@ -76,7 +76,7 @@ func initServiceOption() {
Flag: &pflag.Flag{
Name: cobraParamName,
Shorthand: "s",
Usage: fmt.Sprintf("The Ping service (configured in the active profile) to send the custom request to. Options are: %s. Also configurable via environment variable %s.", strings.Join(customtypes.RequestServiceValidValues(), ", "), envVar),
Usage: fmt.Sprintf("The Ping service (configured in the active profile) to send the custom request to.\nOptions are: %s.\nExample: `%s`", strings.Join(customtypes.RequestServiceValidValues(), ", "), string(customtypes.ENUM_REQUEST_SERVICE_PINGONE)),
Value: cobraValue,
DefValue: "",
},
Expand Down
4 changes: 2 additions & 2 deletions internal/configuration/root/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func initConfigOption() {
Flag: &pflag.Flag{
Name: cobraParamName,
Shorthand: "C",
Usage: "The relative or full path to a custom Ping CLI configuration file.",
Usage: "The relative or full path to a custom Ping CLI configuration file. Example: `$HOME/.pingcli/config.yaml`",
Value: cobraValue,
DefValue: "\"$HOME/.pingcli/config.yaml\"",
},
Expand All @@ -96,7 +96,7 @@ func initOutputFormatOption() {
Flag: &pflag.Flag{
Name: cobraParamName,
Shorthand: "O",
Usage: fmt.Sprintf("Specify the console output format. Options are: %s", strings.Join(customtypes.OutputFormatValidValues(), ", ")),
Usage: fmt.Sprintf("Specify the console output format.\nOptions are: %s.\nExample: `%s`", strings.Join(customtypes.OutputFormatValidValues(), ", "), string(customtypes.ENUM_OUTPUT_FORMAT_JSON)),
Value: cobraValue,
DefValue: customtypes.ENUM_OUTPUT_FORMAT_TEXT,
},
Expand Down
14 changes: 7 additions & 7 deletions internal/configuration/services/pingfederate.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func initHTTPSHostOption() {
EnvVar: envVar,
Flag: &pflag.Flag{
Name: cobraParamName,
Usage: "The PingFederate HTTPS host used to communicate with PingFederate's admin API.",
Usage: "The PingFederate HTTPS host used to communicate with PingFederate's admin API.\nExample: `https://pingfederate-admin.bxretail.org`",
Value: cobraValue,
DefValue: "",
},
Expand All @@ -60,7 +60,7 @@ func initAdminAPIPathOption() {
EnvVar: envVar,
Flag: &pflag.Flag{
Name: cobraParamName,
Usage: "The PingFederate API URL path used to communicate with PingFederate's admin API.",
Usage: "The PingFederate API URL path used to communicate with PingFederate's admin API.\nExample: `/pf-admin-api/v1`",
Value: cobraValue,
DefValue: "/pf-admin-api/v1",
},
Expand Down Expand Up @@ -104,7 +104,7 @@ func initCACertificatePemFilesOption() {
EnvVar: envVar,
Flag: &pflag.Flag{
Name: cobraParamName,
Usage: "Relative or full paths to PEM-encoded certificate files to be trusted as root CAs when connecting to the PingFederate server over HTTPS. Accepts a comma-separated string to delimit multiple PEM files.",
Usage: "Relative or full paths to PEM-encoded certificate files to be trusted as root CAs when connecting to the PingFederate server over HTTPS.\nAccepts a comma-separated string to delimit multiple PEM files.",
Value: cobraValue,
DefValue: "[]",
},
Expand All @@ -126,7 +126,7 @@ func initInsecureTrustAllTLSOption() {
EnvVar: envVar,
Flag: &pflag.Flag{
Name: cobraParamName,
Usage: "Trust any certificate when connecting to the PingFederate server admin API. This is insecure and should not be enabled outside of testing.",
Usage: "Trust any certificate when connecting to the PingFederate server admin API.\nThis is insecure and should not be enabled outside of testing.",
Value: cobraValue,
DefValue: "false",
},
Expand All @@ -148,7 +148,7 @@ func initUsernameOption() {
EnvVar: envVar,
Flag: &pflag.Flag{
Name: cobraParamName,
Usage: "The PingFederate username used to authenticate to the PingFederate admin API when using basic authentication.",
Usage: "The PingFederate username used to authenticate to the PingFederate admin API when using basic authentication. Example: `administrator`",
Value: cobraValue,
DefValue: "",
},
Expand Down Expand Up @@ -280,7 +280,7 @@ func initScopesOption() {
EnvVar: envVar,
Flag: &pflag.Flag{
Name: cobraParamName,
Usage: "The PingFederate OAuth scopes used to authenticate to the PingFederate admin API when using the OAuth 2.0 client credentials grant type. Accepts a comma-separated string to delimit multiple scopes.",
Usage: "The PingFederate OAuth scopes used to authenticate to the PingFederate admin API when using the OAuth 2.0 client credentials grant type.\nAccepts a comma-separated string to delimit multiple scopes.\nExample: `openid,profile`",
Value: cobraValue,
DefValue: "[]",
},
Expand All @@ -302,7 +302,7 @@ func initPingFederateAuthenticationTypeOption() {
EnvVar: envVar,
Flag: &pflag.Flag{
Name: cobraParamName,
Usage: fmt.Sprintf("The authentication type to use when connecting to the PingFederate admin API. Options are: %s.", strings.Join(customtypes.PingFederateAuthenticationTypeValidValues(), ", ")),
Usage: fmt.Sprintf("The authentication type to use when connecting to the PingFederate admin API.\nOptions are: %s.\nExample: `%s`", strings.Join(customtypes.PingFederateAuthenticationTypeValidValues(), ", "), string(customtypes.ENUM_PINGFEDERATE_AUTHENTICATION_TYPE_BASIC)),
Value: cobraValue,
DefValue: "",
},
Expand Down
4 changes: 2 additions & 2 deletions internal/configuration/services/pingone.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func initPingOneAuthenticationTypeOption() {
EnvVar: envVar,
Flag: &pflag.Flag{
Name: cobraParamName,
Usage: fmt.Sprintf("The authentication type to use to authenticate to the PingOne management API. Options are: %s.", strings.Join(customtypes.PingOneAuthenticationTypeValidValues(), ", ")),
Usage: fmt.Sprintf("The authentication type to use to authenticate to the PingOne management API.\nOptions are: %s.\nExample: `%s`", strings.Join(customtypes.PingOneAuthenticationTypeValidValues(), ", "), string(customtypes.ENUM_PINGONE_AUTHENTICATION_TYPE_WORKER)),
Value: cobraValue,
DefValue: customtypes.ENUM_PINGONE_AUTHENTICATION_TYPE_WORKER,
},
Expand All @@ -119,7 +119,7 @@ func initRegionCodeOption() {
EnvVar: envVar,
Flag: &pflag.Flag{
Name: cobraParamName,
Usage: fmt.Sprintf("The region code of the PingOne tenant. Options are: %s.", strings.Join(customtypes.PingOneRegionCodeValidValues(), ", ")),
Usage: fmt.Sprintf("The region code of the PingOne tenant.\nOptions are: %s.\nExample: `%s`", strings.Join(customtypes.PingOneRegionCodeValidValues(), ", "), string(customtypes.ENUM_PINGONE_REGION_CODE_NA)),
Value: cobraValue,
DefValue: "",
},
Expand Down