Skip to content

Commit

Permalink
v1.0.1 Release (#211)
Browse files Browse the repository at this point in the history
* Bump version 1.0.0-release -> 1.0.1-release

* Add support for PodFqdn for Identity authn (#210)
  • Loading branch information
infamousjoeg authored Aug 29, 2023
1 parent eb52ffd commit adc16a5
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
15 changes: 14 additions & 1 deletion cmd/logon.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,22 @@ func startAuthIdentity(c pasapi.Client, username string) (*responses.Authenticat
}

// Start authentication
response, err := identity.StartAuthentication(c, startAuth)
response, err := identity.StartAuthentication(c, startAuth, "")
if err != nil {
return nil, fmt.Errorf("Failed to start authentication. %s", err)
}
if response.Success != true {
return nil, fmt.Errorf("%s %s", identityUnsuccessfulResponse, *response.Message)
}
if response.Result.PodFqdn != "" {
response, err = identity.StartAuthentication(c, startAuth, response.Result.PodFqdn)
if err != nil {
return nil, fmt.Errorf("Failed to start authentication. %s", err)
}
if response.Success != true {
return nil, fmt.Errorf("%s %s", identityUnsuccessfulResponse, *response.Message)
}
}

return response, nil
}
Expand Down Expand Up @@ -148,6 +157,10 @@ var logonCmd = &cobra.Command{
if err != nil {
log.Fatalf("Failed to get tenant ID. %s", err)
}
if Verbose {
prettyprint.PrintColor("cyan", fmt.Sprintf("Tenant ID: %s", c.TenantID))
prettyprint.PrintColor("cyan", fmt.Sprintf("Base URL: %s", c.BaseURL))
}
}

// Get password from environment variable PAS_PASSWORD
Expand Down
10 changes: 8 additions & 2 deletions pkg/cybr/identity/startauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,15 @@ import (
"github.com/infamousjoeg/cybr-cli/pkg/cybr/identity/responses"
)

var identityTenant string

// StartAuthentication starts the authentication process
func StartAuthentication(c api.Client, req requests.StartAuthentication) (*responses.Authentication, error) {
identityTenant := fmt.Sprintf("https://%s.id.cyberark.cloud", req.TenantID)
func StartAuthentication(c api.Client, req requests.StartAuthentication, podFqdn string) (*responses.Authentication, error) {
if podFqdn == "" {
identityTenant = fmt.Sprintf("https://%s.id.cyberark.cloud", req.TenantID)
} else {
identityTenant = fmt.Sprintf("https://%s", podFqdn)
}
url := fmt.Sprintf("%s/Security/StartAuthentication", identityTenant)

headers := http.Header{}
Expand Down
2 changes: 1 addition & 1 deletion release.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "1.0.0-release",
"version": "1.0.1-release",
"go_version": "1.17.2"
}

0 comments on commit adc16a5

Please sign in to comment.