Skip to content

Improve logon with 2FA (#114) #115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
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
11 changes: 6 additions & 5 deletions pkg/cybr/api/auth_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package api_test

import (
"context"
"strings"
"testing"

Expand All @@ -19,7 +20,7 @@ func TestCyberarkLogonSuccess(t *testing.T) {
Password: password,
}

err := client.Logon(creds)
_, _, err := client.Logon(context.TODO(), creds)
if err != nil {
t.Errorf("Failed to logon. %s", err)
}
Expand All @@ -36,7 +37,7 @@ func TestCyberarkLogonInvalidCreds(t *testing.T) {
Password: password,
}

err := client.Logon(creds)
_, _, err := client.Logon(context.TODO(), creds)
if err == nil {
t.Errorf("Successfully logged in but shouldn't have. %s", err)
}
Expand All @@ -53,7 +54,7 @@ func TestCyberarkLogonInvalidHostName(t *testing.T) {
Password: password,
}

err := client.Logon(creds)
_, _, err := client.Logon(context.TODO(), creds)
if err == nil {
t.Errorf("Successfully logged in but shouldn't have. %s", err)
}
Expand All @@ -70,7 +71,7 @@ func TestLogonInvalidAuthType(t *testing.T) {
Password: password,
}

err := client.Logon(creds)
_, _, err := client.Logon(context.TODO(), creds)
if err == nil {
t.Errorf("Successfully logged in but shouldn't have. %s", err)
}
Expand All @@ -91,7 +92,7 @@ func TestCyberarkLogoffSuccess(t *testing.T) {
Password: password,
}

err := client.Logon(creds)
_, _, err := client.Logon(context.TODO(), creds)
if err != nil {
t.Errorf("Failed to logon. %s", err)
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/cybr/api/client_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package api_test

import (
"context"
"os"
"testing"

Expand All @@ -25,7 +26,7 @@ func defaultPASAPIClient(t *testing.T) (pasapi.Client, error) {
Password: password,
}

err := client.Logon(creds)
_, _, err := client.Logon(context.TODO(), creds)
if err != nil {
t.Errorf("Failed to logon. %s", err)
}
Expand Down
7 changes: 7 additions & 0 deletions pkg/cybr/api/shared/errorreponse.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package shared

//ErrorResponse from logon
type ErrorResponse struct {
ErrorCode string `json:"ErrorCode"`
ErrorMessage string `json:"ErrorMessage"`
}