-
Notifications
You must be signed in to change notification settings - Fork 248
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
Feature/sas token final #13140
Feature/sas token final #13140
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My apologies for all the conflicts with your old branch! Thanks a lot for this contribution, this looks great.
@gregsmi Looks like the scopes we currently have set are insufficient for reading the storage account keys. Do you know best practice permissions for creating SAS tokens?
|
ah yes - the identity used to create the SAS token needs to have a control plane role on the Storage Account - Owner, Contributor, or (most specific) Storage Account Key Operator Service Role... Is that a manageable role to configure for testing or should I try to explore alternatives in the generation? |
Thanks! This is totally fine, I'll just configure the SP that we use for the inter-cloud tests with the key operator role and re-run the tests. |
Note this PR replaces the previous Feature/sas token merge because the original PR branch got jacked up beyond repair. All the comments on the earlier PR are responded to there and addressed in the code for this one.
This PR is to enable
hail-az/https
Azure file references to contain SAS tokens to enable bearer-auth style file access to Azure storage. Basic summary of the changes:AzureAsyncFS
url parsing function to look for and separate out a SAS-token-like query string. Note: made fairly specific to SAS tokens - generic detection of query string syntax interferes with glob support and '?' characters in file namesgenerate_sas_token
convenience function toAzureAsyncFS
. Adds new azure-mgmt-storage package requirement.AzureAsyncFS
to use(account, container, credential)
tuple as internalBlobServiceClient
cache keyAzureAsyncFSURL
andAzureFileListEntry
to track the token separately from the name, and extend the base classes to allow returning url with or without a tokenRouterFS.ls
function and associated listfiles function to allow for trailing query strings during path traversalAsyncFS.open_from
function to handle query-string urls in zero-length caseLocalAsyncFSURL.__str__
no longer returns 'file:' prefix. Done to makestr()
output be appropriate for input tofs
functions across all subclassesInputResource
to not include the SAS token as part of the destination file nameinter_cloud/test_fs.py
to generically use query-string-friendly file path building functions to respect the new model, where it is no longer safe to extend URLs by just appending new segments with+ "/"
because there may be a query string, and added'sas/azure-https'
test case to the fixture. Running tests for the SAS case requires some new test variables to allow the test code to generate SAS tokens (build.yaml/test_hail_python_fs
):