Revanth14 commented on code in PR #2018:
URL: https://github.com/apache/iceberg-go/pull/2018#discussion_r4047300235


##########
io/gocloud/azure/azure_test.go:
##########
@@ -23,39 +23,61 @@ import (
        "net/url"
        "testing"
 
+       "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+       "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake"
+       "github.com/Azure/azure-sdk-for-go/sdk/azidentity"
+       icebergio "github.com/apache/iceberg-go/io"
        "github.com/apache/iceberg-go/io/gocloud/blobfs"
        "github.com/stretchr/testify/assert"
        "github.com/stretchr/testify/require"
        "gocloud.dev/blob"
        "gocloud.dev/blob/memblob"
 )
 
+func TestProductionAzureCredentialFactories(t *testing.T) {
+       factories := productionAzureCredentialFactories()
+
+       t.Run("default credential", func(t *testing.T) {
+               // Avoid inheriting credential selection or loading credentials 
from the environment.
+               t.Setenv("AZURE_TOKEN_CREDENTIALS", "dev")

Review Comment:
   Thanks for reviewing! I checked our pinned `azidentity v1.14.1`, and it 
[does read 
`AZURE_TOKEN_CREDENTIALS`](https://github.com/Azure/azure-sdk-for-go/blob/sdk/azidentity/v1.14.1/sdk/azidentity/default_azure_credential.go#L98-L119).
 Setting it to `dev` excludes environment, workload identity, and managed 
identity credentials, and overrides any inherited value. I’ve expanded the 
comment to clarify that.
   
   The factory returns `azcore.TokenCredential`, so `IsType` checks that our 
production wrapper constructs the intended credential type. The routing tests 
inject replacements and wouldn’t catch incorrect production wiring; non-nil 
checks wouldn’t catch that either.
   
   I’d prefer to keep this small wiring check. It only constructs 
credentials,there’s no token acquisition or storage IO.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to