Skip to content

Commit 60aea17

Browse files
committed
Replace DisableCLIAuthFlow with CLIAuthFlow
Signed-off-by: Jan-Otto Kröpke <[email protected]>
1 parent 57a45bb commit 60aea17

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

core/auth/auth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func DefaultAuth(cfg *config.Configuration) (rt http.RoundTripper, err error) {
9393
rt, err = TokenAuth(cfg)
9494
if err != nil {
9595
tokenFlowErr := err
96-
if cfg.DisableCLIAuthFlow {
96+
if !cfg.CLIAuthFlow {
9797
err = errors.New("CLI flow disabled")
9898
} else {
9999
// Stackit CLI flow

core/auth/auth_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,10 @@ func TestSetupAuth(t *testing.T) {
195195
isValid: true,
196196
},
197197
{
198-
desc: "cli auth",
199-
config: nil,
198+
desc: "cli auth",
199+
config: &config.Configuration{
200+
CLIAuthFlow: true,
201+
},
200202
setCredentialsFilePathToken: false,
201203
setCLIToken: true,
202204
isValid: true,

core/config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ type Configuration struct {
9090
CredentialsFilePath string `json:"credentialsFilePath,omitempty"`
9191
TokenCustomUrl string `json:"tokenCustomUrl,omitempty"`
9292
Region string `json:"region,omitempty"`
93-
DisableCLIAuthFlow bool `json:"disableCLIAuthFlow,omitempty"` // Should be set to true, if called by STACKIT CLI to avoid infinite loops.
93+
CLIAuthFlow bool `json:"cliAuthFlow,omitempty"`
9494
CustomAuth http.RoundTripper
9595
Servers ServerConfigurations
9696
OperationServers map[string]ServerConfigurations

0 commit comments

Comments
 (0)