Issue #6982 : Add SAS token authentication to the Azure VFS plugin - #7936
Merged
Conversation
The Azure connection could authenticate with a storage account key or a managed identity. An account key grants full, non-expiring access to the whole storage account, which rules out Hop for deployments that have to enforce least privilege. Adds "SAS Token" as a third authentication type. A shared access signature is scoped to specific resources and permissions and carries an expiry, and is what Microsoft recommends for application level access to Storage. - AzureMetadataType: new sasToken property, marked password = true so it is encrypted at rest and masked in the UI, matching the account key. - AzureFileProvider: a "SAS Token" branch passing the token to DataLakeServiceClientBuilder.sasToken. The SDK accepts the query string with or without a leading '?', so nothing is normalised here. - AzureMetadataTypeEditor: the new option, plus a password field that is shown only for that authentication type, mirroring the account key field. - Documented the three authentication types, which were previously not described on the Azure VFS page at all. Existing connections are untouched: the constructor still defaults to "Key" and the provider still treats an empty authentication type as "Key".
vbhanuchander-lang
force-pushed
the
azure-sas-token
branch
from
August 13, 2026 11:08
dc9ad51 to
5a05650
Compare
This file contains hidden or 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
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.
Closes #6982.
Why
The Azure connection could authenticate with a storage account key or a managed identity. An
account key grants full, non-expiring access to the entire storage account, which is what #6982
raises: organisations that have to enforce least privilege cannot use it, and a managed identity is
not always available (external orchestration, on-prem Hop, short-lived access handed to a third
party).
A shared access signature is scoped to specific resources and permissions and carries an expiry,
and is what Microsoft recommends for application-level access to Storage.
What changed
AzureMetadataType— newsasTokenproperty,@HopMetadataProperty(password = true)so itis encrypted at rest and masked in the UI, exactly like
storageAccountKey.AzureFileProvider— a"SAS Token"branch that resolves variables, decrypts, and passes thetoken to
DataLakeServiceClientBuilder.sasToken(...), with a clear error when the field is empty.It mirrors the existing
Keybranch.AzureMetadataTypeEditor—"SAS Token"added to the authentication type combo, plus aPasswordTextVarshown only for that type, following the existing show/hide pattern for theaccount key.
added a table covering
Key,Managed IdentityandSAS Token, plus a short SAS section on howto generate one and the expiry caveat.
Two deliberate non-changes:
sasToken(String)states the value "shouldonly be the query parameters (with or without a leading '?') and not a full url", so stripping a
leading
?myself would be redundant. I verifiedsasToken(java.lang.String)exists onDataLakeServiceClientBuilderin the version we depend on (azure-storage-file-datalake12.20.0)rather than assuming it.
hop-config.jsonpath is untouched. That path only hasaccount/keyand noauthentication type, so adding SAS there is a separate change to
AzureConfigand the optionsdialog. Happy to follow up if you'd like it there too.
Backward compatibility
Existing connections keep working unchanged. The
AzureMetadataTypeconstructor still defaultsauthenticationTypeto"Key", and the provider still treats an empty authentication type as"Key".keyAuthenticationRemainsTheDefaultpins both.Testing
New
AzureSasTokenAuthenticationTest(4 tests):sasTokenIsStoredOnTheConnectionMetadatasasTokenIsMarkedAsAPasswordpassword = trueis present — the option is pointless if the token lands in metadata in clear textstorageAccountKeyRemainsAPasswordkeyAuthenticationRemainsTheDefaultKeyand carries no SAS tokenmvn test -pl plugins/tech/azure→ 91 tests, 0 failures.spotless:checkandapache-rat:checkare clean on the module.I could not exercise a live SAS handshake without an Azure account, so the credential path itself is
covered by the empty-token guard and by mirroring the key branch; if you have a storage account
handy, a manual check against a real signature would be worth doing before merge.
🤖 AI-assisted changes — generated with Claude Code (Opus 5) and reviewed by me before submitting.