Skip to content

Commit

Permalink
Pass relative servicenow API paths in BPI environment
Browse files Browse the repository at this point in the history
  • Loading branch information
kthomas committed Dec 5, 2022
1 parent f2f38c7 commit bac8b31
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions prvd/baseline/stack/stack_start.go
Original file line number Diff line number Diff line change
Expand Up @@ -922,10 +922,6 @@ func containerEnvironmentFactory(listenPort *int) []string {
fmt.Sprintf("VAULT_API_SCHEME=%s", vaultAPIScheme),
fmt.Sprintf("VAULT_REFRESH_TOKEN=%s", vaultRefreshToken),
fmt.Sprintf("VAULT_SEAL_UNSEAL_KEY=%s", vaultSealUnsealKey),

"SERVICENOW_LIST_SCHEMAS_API_PATH=api/x_prot9_provide/setup_configuration/ListSchemas",
"SERVICENOW_SCHEMA_DETAILS_API_PATH=api/x_prot9_provide/setup_configuration/GetSchemaDetails",
"SERVICENOW_HEALTHCHECK_API_PATH=api/now/branding",
} {
env = append(env, envvar)
}
Expand All @@ -934,6 +930,12 @@ func containerEnvironmentFactory(listenPort *int) []string {
env = append(env, fmt.Sprintf("PORT=%d", *listenPort))
}

if serviceNowAPIHost != "" {
env = append(env, "SERVICENOW_HEALTHCHECK_API_PATH=api/now/branding")
env = append(env, "SERVICENOW_LIST_SCHEMAS_API_PATH=setup_configuration/ListSchemas")
env = append(env, "SERVICENOW_SCHEMA_DETAILS_API_PATH=setup_configuration/GetSchemaDetails")
}

return env
}

Expand Down Expand Up @@ -1847,7 +1849,7 @@ func initSORFlags() {

startBaselineStackCmd.Flags().StringVar(&serviceNowAPIHost, "servicenow-api-host", "", "hostname of the ServiceNow service")
startBaselineStackCmd.Flags().StringVar(&serviceNowAPIScheme, "servicenow-api-scheme", "https", "protocol scheme of the ServiceNow service")
startBaselineStackCmd.Flags().StringVar(&serviceNowAPIPath, "servicenow-api-path", "api/now/table", "base path of the ServiceNow API")
// startBaselineStackCmd.Flags().StringVar(&serviceNowAPIPath, "servicenow-api-path", "api/now/table", "base path of the ServiceNow API")
startBaselineStackCmd.Flags().StringVar(&serviceNowAPIUsername, "servicenow-api-username", "", "username to use for basic authorization against the ServiceNow API")
startBaselineStackCmd.Flags().StringVar(&serviceNowAPIPassword, "servicenow-api-password", "", "password to use for basic authorization against the ServiceNow API")
}

0 comments on commit bac8b31

Please sign in to comment.