Skip to content
Open
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
2 changes: 2 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,8 @@ func (c *Config) IsAccountClient() bool {
accountsPrefixes := []string{
"https://accounts.",
"https://accounts-dod.",
"accounts.",
"accounts-dod.",
}
for _, prefix := range accountsPrefixes {
if strings.HasPrefix(c.Host, prefix) {
Expand Down
16 changes: 16 additions & 0 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,22 @@ func TestIsAccountClient_AwsAccount(t *testing.T) {
assert.True(t, c.IsAccountClient())
}

func TestIsAccountClient_WithoutHTTPSInHost_AWSAccount(t *testing.T) {
c := &Config{
Host: "accounts.cloud.databricks.com",
AccountID: "123e4567-e89b-12d3-a456-426614174000",
}
assert.True(t, c.IsAccountClient())
}

func TestIsAccountClient_WithoutHTTPSInHost_AwsDodAccount(t *testing.T) {
c := &Config{
Host: "accounts-dod.cloud.databricks.us",
AccountID: "123e4567-e89b-12d3-a456-426614174000",
}
assert.True(t, c.IsAccountClient())
}

func TestIsAccountClient_AwsDodAccount(t *testing.T) {
c := &Config{
Host: "https://accounts-dod.cloud.databricks.us",
Expand Down
Loading