-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Fix Azure filesystem hierarchical namespaces check #20897
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
charlesjmorgan
requested review from
dain,
wendigo,
losipiuk,
findepi,
findinpath and
ebyhr
March 1, 2024 04:35
findinpath
approved these changes
Mar 1, 2024
Tested locally successfully |
dain
approved these changes
Mar 4, 2024
...no-filesystem-azure/src/test/java/io/trino/filesystem/azure/AbstractTestAzureFileSystem.java
Show resolved
Hide resolved
...no-filesystem-azure/src/test/java/io/trino/filesystem/azure/AbstractTestAzureFileSystem.java
Outdated
Show resolved
Hide resolved
This dependency is needed in Azure scenarios which require OAuth2.
Co-authored-by: Charles Morgan <charles.morgan@starburstdata.com>
The method previously used to check if hierarchical namespaces are enabled for an Azure storage account was not available when doing authentication with service tokens (in OAuth2.0 scenarios). This change uses a generic strategy to check whether a storage account has HNS enabled independently of the authentication method. Co-authored-by: Marius Grama <findinpath@gmail.com>
Co-authored-by: Marius Grama <findinpath@gmail.com>
charlesjmorgan
force-pushed
the
cm/fix-azure-hns-check
branch
from
March 4, 2024 22:53
cdafe84
to
ba9181e
Compare
FYI I created https://feedback.azure.com/d365community/idea/bd29191f-ebdb-ee11-a73d-0022484c4e0d in order to request that they add OAuth based access token support to the Get account information endpoint |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The hierarchical namespaces check in the native Azure filesystem is not compatible with authentication via OAuth tokens. The existing check uses the "Get Account Information" blob service account REST API endpoint. As stated in the documentation for this endpoint, it does not support OAuth based access token authentication:
https://learn.microsoft.com/en-us/rest/api/storageservices/get-account-information?tabs=shared-access-signatures#authorization
In order to fix the Azure filesystem OAuth integration we have figured out an alternate method of checking if hierarchical namespaces are enabled for an account using other apis made available in the azure-sdk-for-java. The method used in this PR checks if the root directory exists on the account. If it exists, then HNS is enabled for the account, if it does not exist then HNS is not enabled for the account.
An issue has been opened in the azure-sdk-for-java repo in order to get feedback on this approach and to see if they are planning to add support for OAuth token based authentication to the "Get Account Information" API. Azure/azure-sdk-for-java#38912
Additionally, as part of these changes I have refactored some of the testing infrastructure for the Azure filesystem in order to support tests using OAuth. All that needs to be done is to add the env variables/secrets to CI. #18998
Additional context and related issues
Release notes
(X) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text: