Skip to content

Commit

Permalink
ONYX-14719: Refactor authn-k8s-client to be authentication flow generic
Browse files Browse the repository at this point in the history
  • Loading branch information
tzheleznyak authored Dec 23, 2021
1 parent 89545e7 commit b5ff748
Show file tree
Hide file tree
Showing 21 changed files with 1,260 additions and 1,260 deletions.
14 changes: 7 additions & 7 deletions cmd/authenticator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ package main
import (
"context"
"fmt"
"github.com/cyberark/conjur-authn-k8s-client/pkg/authenticator"
"github.com/cyberark/conjur-authn-k8s-client/pkg/authenticator/config"
"os"
"time"

"github.com/cenkalti/backoff"

"github.com/cyberark/conjur-authn-k8s-client/pkg/authenticator"
authnConfig "github.com/cyberark/conjur-authn-k8s-client/pkg/authenticator/config"
"github.com/cyberark/conjur-authn-k8s-client/pkg/log"
"github.com/cyberark/secrets-provider-for-k8s/pkg/trace"
)
Expand All @@ -19,7 +19,7 @@ func main() {

var err error

config, err := authnConfig.NewFromEnv()
config, err := config.NewConfigFromEnv()
if err != nil {
printErrorAndExit(log.CAKC018)
}
Expand All @@ -28,7 +28,7 @@ func main() {
defer tracer.Shutdown(context.Background())

// Create new Authenticator
authn, err := authenticator.New(*config)
authn, err := authenticator.NewAuthenticator(config)
if err != nil {
printErrorAndExit(log.CAKC019)
}
Expand All @@ -48,14 +48,14 @@ func main() {
return log.RecordedError(log.CAKC016)
}

if authn.Config.ContainerMode == "init" {
if config.GetContainerMode() == "init" {
os.Exit(0)
}

log.Info(log.CAKC047, authn.Config.TokenRefreshTimeout)
log.Info(log.CAKC047, config.GetTokenTimeout())

fmt.Println()
time.Sleep(authn.Config.TokenRefreshTimeout)
time.Sleep(config.GetTokenTimeout())

// Reset exponential backoff
expBackoff.Reset()
Expand Down
Loading

0 comments on commit b5ff748

Please sign in to comment.