Skip to content

Commit

Permalink
Rename to az_tenant_id at all places.
Browse files Browse the repository at this point in the history
Signed-off-by: DylanGuedes <[email protected]>
  • Loading branch information
DylanGuedes committed Jan 14, 2025
1 parent dd80a98 commit 8760e12
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re
## Unreleased
- [#38](https://github.com/thanos-io/objstore/pull/38) GCS: Upgrade cloud.google.com/go/storage version to `v1.43.0`.
- [#145](https://github.com/thanos-io/objstore/pull/145) Include content length in the response of Get and GetRange.
- [#157](https://github.com/thanos-io/objstore/pull/157) Azure: Add `tenant_id`, `client_id` and `client_secret` configs.
- [#157](https://github.com/thanos-io/objstore/pull/157) Azure: Add `az_tenant_id`, `client_id` and `client_secret` configs.

### Fixed
- [#153](https://github.com/thanos-io/objstore/pull/153) Metrics: Fix `objstore_bucket_operation_duration_seconds_*` for `get` and `get_range` operations.
Expand Down
6 changes: 3 additions & 3 deletions providers/azure/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var DefaultConfig = Config{
type Config struct {
ClientID string `yaml:"client_id"`
ClientSecret string `yaml:"client_secret"`
TenantID string `yaml:"tenant_id"`
AzTenantID string `yaml:"az_tenant_id"`
StorageAccountName string `yaml:"storage_account"`
StorageAccountKey string `yaml:"storage_account_key"`
StorageConnectionString string `yaml:"storage_connection_string"`
Expand Down Expand Up @@ -91,8 +91,8 @@ func (conf *Config) validate() error {
errMsg = append(errMsg, "user_assigned_id cannot be set when using client_id authentication")
}

if (conf.TenantID != "" || conf.ClientSecret != "" || conf.ClientID != "") && (conf.TenantID == "" || conf.ClientSecret == "" || conf.ClientID == "") {
errMsg = append(errMsg, "tenant_id, client_id, and client_secret must be set together")
if (conf.AzTenantID != "" || conf.ClientSecret != "" || conf.ClientID != "") && (conf.AzTenantID == "" || conf.ClientSecret == "" || conf.ClientID == "") {
errMsg = append(errMsg, "az_tenant_id, client_id, and client_secret must be set together")
}

if conf.StorageAccountKey != "" && conf.StorageConnectionString != "" {
Expand Down
6 changes: 3 additions & 3 deletions providers/azure/azure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,18 +145,18 @@ container: "MyContainer"`),
wantFailValidate: true,
},
{
name: "Valid TenantID, ClientID, ClientSecret",
name: "Valid AzTenantID, ClientID, ClientSecret",
config: []byte(`storage_account: "myAccount"
storage_account_key: ""
tenant_id: "1234-56578678-655"
az_tenant_id: "1234-56578678-655"
client_id: "1234-56578678-655"
client_secret: "1234-56578678-655"
container: "MyContainer"`),
wantFailParse: false,
wantFailValidate: false,
},
{
name: "Valid ClientID and ClientSecret but missing TenantID",
name: "Valid ClientID and ClientSecret but missing AzTenantID",
config: []byte(`storage_account: "myAccount"
storage_account_key: ""
client_id: "1234-56578678-655"
Expand Down
4 changes: 2 additions & 2 deletions providers/azure/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ func getContainerClient(conf Config, wrapRoundtripper func(http.RoundTripper) ht
}

func getTokenCredential(conf Config) (azcore.TokenCredential, error) {
if conf.ClientSecret != "" && conf.TenantID != "" && conf.ClientID != "" {
return azidentity.NewClientSecretCredential(conf.TenantID, conf.ClientID, conf.ClientSecret, &azidentity.ClientSecretCredentialOptions{})
if conf.ClientSecret != "" && conf.AzTenantID != "" && conf.ClientID != "" {
return azidentity.NewClientSecretCredential(conf.AzTenantID, conf.ClientID, conf.ClientSecret, &azidentity.ClientSecretCredentialOptions{})
}

if conf.UserAssignedID == "" {
Expand Down

0 comments on commit 8760e12

Please sign in to comment.