Skip to content

Commit 30ee5a6

Browse files
committed
fmt
1 parent 35fc6de commit 30ee5a6

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

acceptance/notify/slack.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import (
55
"strings"
66
"time"
77

8+
"github.com/databricks/databricks-sdk-go/common/environment"
89
"github.com/databricks/databricks-sdk-go/openapi/code"
910
"github.com/databrickslabs/sandbox/acceptance/ecosystem"
1011
"github.com/databrickslabs/sandbox/go-libs/slack"
11-
"github.com/databricks/databricks-sdk-go/common/environment"
1212
)
1313

1414
type Notification struct {

acceptance/notify/slack_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ package notify_test
33
import (
44
"testing"
55

6+
"github.com/databricks/databricks-sdk-go/common/environment"
67
"github.com/databrickslabs/sandbox/acceptance/ecosystem"
78
"github.com/databrickslabs/sandbox/acceptance/notify"
89
"github.com/databrickslabs/sandbox/go-libs/fixtures"
910
"github.com/databrickslabs/sandbox/go-libs/slack"
10-
"github.com/databricks/databricks-sdk-go/common/environment"
1111
)
1212

1313
func TestMessageDryRun(t *testing.T) {

acceptance/testenv/githubOidc.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ import (
1010

1111
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
1212
"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
13+
"github.com/databricks/databricks-sdk-go/common/environment"
1314
"github.com/databricks/databricks-sdk-go/config"
15+
"github.com/databricks/databricks-sdk-go/config/credentials"
1416
"github.com/sethvargo/go-githubactions"
1517
"golang.org/x/oauth2"
1618
"golang.org/x/oauth2/clientcredentials"
17-
"github.com/databricks/databricks-sdk-go/common/environment"
18-
"github.com/databricks/databricks-sdk-go/config/credentials"
1919
)
2020

2121
func NewWithGitHubOIDC(a *githubactions.Action, vaultURI string) *vaultEnv {
@@ -64,11 +64,11 @@ func (c *ghOidcCreds) Name() string {
6464
}
6565

6666
type credentialsProviderFunc struct {
67-
setHeadersFunc func(r *http.Request) error
67+
setHeadersFunc func(r *http.Request) error
6868
}
6969

7070
func (cpf *credentialsProviderFunc) SetHeaders(r *http.Request) error {
71-
return cpf.setHeadersFunc(r)
71+
return cpf.setHeadersFunc(r)
7272
}
7373

7474
// Configure implements credentials provider for Databricks SDK
@@ -81,8 +81,8 @@ func (c *ghOidcCreds) Configure(ctx context.Context, cfg *config.Config) (creden
8181
setHeadersFunc: func(r *http.Request) error {
8282
token, err := ts.Token()
8383
if err != nil {
84-
return fmt.Errorf("token: %w", err)
85-
}
84+
return fmt.Errorf("token: %w", err)
85+
}
8686
token.SetAuthHeader(r)
8787
return nil
8888
},
@@ -107,16 +107,16 @@ func (c *ghOidcCreds) GetToken(ctx context.Context, options policy.TokenRequestO
107107
}
108108

109109
func (c *ghOidcCreds) SetHeaders(r *http.Request) error {
110-
env := environment.GetEnvironmentForHostname(r.Host)
111-
azureManagementURL := env.AzureResourceManagerEndpoint()
112-
token, err := c.GetToken(r.Context(), policy.TokenRequestOptions{
113-
Scopes: []string{azureManagementURL + "/.default"},
114-
})
115-
if err != nil {
116-
return fmt.Errorf("token: %w", err)
117-
}
118-
r.Header.Set("Authorization", "Bearer "+token.Token)
119-
return nil
110+
env := environment.GetEnvironmentForHostname(r.Host)
111+
azureManagementURL := env.AzureResourceManagerEndpoint()
112+
token, err := c.GetToken(r.Context(), policy.TokenRequestOptions{
113+
Scopes: []string{azureManagementURL + "/.default"},
114+
})
115+
if err != nil {
116+
return fmt.Errorf("token: %w", err)
117+
}
118+
r.Header.Set("Authorization", "Bearer "+token.Token)
119+
return nil
120120
}
121121

122122
type msiToken struct {

acceptance/testenv/loaded.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ import (
1111
"time"
1212

1313
"github.com/databricks/databricks-sdk-go/apierr"
14+
"github.com/databricks/databricks-sdk-go/common/environment"
1415
"github.com/databricks/databricks-sdk-go/config"
1516
"github.com/databricks/databricks-sdk-go/logger"
1617
"github.com/databrickslabs/sandbox/acceptance/redaction"
1718
"github.com/databrickslabs/sandbox/go-libs/env"
18-
"github.com/databricks/databricks-sdk-go/common/environment"
1919
)
2020

2121
type loadedEnv struct {

0 commit comments

Comments
 (0)