-
Notifications
You must be signed in to change notification settings - Fork 5
EVEREST-526: Add support for authentication #193
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## main #193 +/- ##
=====================================
Coverage 5.02% 5.02%
=====================================
Files 13 13
Lines 3005 3005
=====================================
Hits 151 151
Misses 2827 2827
Partials 27 27
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
import ( | ||
"context" | ||
|
||
"github.com/percona/percona-everest-cli/pkg/cache" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
File is not gci
-ed with --skip-generated -s standard -s default -s prefix(github.com/percona/percona-everest-cli) (gci)
|
||
"github.com/percona/percona-everest-cli/pkg/cache" | ||
"github.com/zitadel/oidc/v2/pkg/oidc" | ||
"go.uber.org/zap" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
File is not gci
-ed with --skip-generated -s standard -s default -s prefix(github.com/percona/percona-everest-cli) (gci)
@@ -25,6 +25,9 @@ import ( | |||
"net/http" | |||
|
|||
"github.com/percona/percona-everest-backend/client" | |||
"github.com/percona/percona-everest-cli/pkg/cache" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
File is not gci
-ed with --skip-generated -s standard -s default -s prefix(github.com/percona/percona-everest-cli) (gci)
if cred != nil { | ||
cl := oauth2.NewClient(ctx, oauth2.StaticTokenSource(&oauth2.Token{ | ||
AccessToken: cred.AccessToken, | ||
// TODO: do we need to refresh token? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
pkg/everest/client/client.go:60: Line contains TODO/BUG/FIXME: "TODO: do we need to refresh token?" (godox)
} | ||
|
||
cacheDir := path.Join(homeDir, ".everest") | ||
if err := os.MkdirAll(cacheDir, 0700); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
File is not gofumpt
-ed (gofumpt)
|
||
type ( | ||
// LoginConfig stores configuration for the versions command. | ||
LoginConfig struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
type name will be used as login.LoginConfig by other packages, and that stutters; consider calling this Config (golint)
return nil, err | ||
} | ||
|
||
cacheData, err := os.ReadFile(cacheFile) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
G304: Potential file inclusion via variable (gosec)
} | ||
|
||
// Run runs the login command. | ||
func (l *Login) Run(ctx context.Context) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶(*Login).Run
- ctx
is unused (unparam)
} | ||
|
||
if c.Credentials == nil { | ||
return nil, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
return both the nil
error and invalid value: use a sentinel error instead (nilnil)
|
||
token, ok := c.Credentials[issuer] | ||
if !ok { | ||
return nil, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
return both the nil
error and invalid value: use a sentinel error instead (nilnil)
CHANGE DESCRIPTION
Problem:
EVEREST-526
Short explanation of the problem.
Related pull requests
Cause:
Short explanation of the root cause of the issue if applicable.
Solution:
everestctl login
commandCHECKLIST
Jira
Tests