Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle Azure URLs for chinacloud #7520

Merged
merged 4 commits into from
Mar 11, 2024
Merged

Handle Azure URLs for chinacloud #7520

merged 4 commits into from
Mar 11, 2024

Conversation

itaiad200
Copy link
Contributor

closes #7518

@itaiad200 itaiad200 added the include-changelog PR description should be included in next release changelog label Feb 27, 2024
Copy link

E2E Test Results - DynamoDB Local - Local Block Adapter

10 passed

Copy link
Member

@N-o-Z N-o-Z left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good. Two thing I think we should verify before merging:

  1. Are pre-signed urls supported in this domain
  2. If so, does it use the same format as in the microsoft.net domain

@itaiad200
Copy link
Contributor Author

Good Catch @N-o-Z. We build Azure clients using hardcoded string here, so we'll need to accept the url for it to work properly.

@itaiad200 itaiad200 marked this pull request as draft February 27, 2024 17:18
@N-o-Z
Copy link
Member

N-o-Z commented Feb 27, 2024

Good Catch @N-o-Z. We build Azure clients using hardcoded string here, so we'll need to accept the url for it to work properly.

Note that it is also used in the client cache

@itaiad200 itaiad200 requested a review from N-o-Z March 7, 2024 22:55
@itaiad200 itaiad200 marked this pull request as ready for review March 7, 2024 22:55
Copy link

github-actions bot commented Mar 7, 2024

♻️ PR Preview 9852415 has been successfully destroyed since this PR has been closed.

🤖 By surge-preview

Copy link
Member

@N-o-Z N-o-Z left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, but I'd like to suggest a different approach

@@ -29,14 +29,16 @@ const (
// more the 5000 different accounts, which is highly unlikely
udcCacheSize = 5000

BlobEndpointFormat = "https://%s.blob.core.windows.net/"
BlobEndpointGeneralFormat = "https://%s.blob.core.windows.net/"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
BlobEndpointGeneralFormat = "https://%s.blob.core.windows.net/"
BlobEndpointGlobalFormat = "https://%s.blob.core.windows.net/"

)

type Adapter struct {
clientCache *ClientCache
preSignedExpiry time.Duration
disablePreSigned bool
disablePreSignedUI bool
chinaCloud bool
Copy link
Member

@N-o-Z N-o-Z Mar 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My suggestion is to not use a boolean but rather allow providing a custom domain with the default being the global Azure blob domain. In addition we might want to log a warning when using a custom domain

@N-o-Z
Copy link
Member

N-o-Z commented Mar 8, 2024

@itaiad200 another thing I forgot!
If I'm not mistaken there are some validations for the namespace in the GUI, we probably need to adapt those as well

@itaiad200
Copy link
Contributor Author

@itaiad200 another thing I forgot! If I'm not mistaken there are some validations for the namespace in the GUI, we probably need to adapt those as well

Thanks @N-o-Z . I took these into account. It's dynamically read through ValidityRegex & ImportValidityRegex. Made more changes to address it more specifically and block other domains. PTAL

@itaiad200 itaiad200 requested a review from N-o-Z March 10, 2024 08:38
@itaiad200
Copy link
Contributor Author

Docs Preview fails due to unrelated error in one of the deps
image

@itaiad200 itaiad200 merged commit c057290 into master Mar 11, 2024
35 of 36 checks passed
@itaiad200 itaiad200 deleted the 7518-azure-url branch March 11, 2024 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
include-changelog PR description should be included in next release changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Azure Blob Storage other than default Azure Cloud
2 participants