Skip to content

Commit

Permalink
Add Azure SAS token validation
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
  • Loading branch information
pditommaso committed Oct 27, 2022
1 parent cbc10df commit e2244b4
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ class AzFileSystemProvider extends FileSystemProvider {

@Memoized
protected BlobServiceClient createBlobServiceWithToken(String accountName, String sasToken) {
if( !sasToken )
throw new IllegalArgumentException("Missing Azure blob SAS token")
if( sasToken.length()<100 )
throw new IllegalArgumentException("Invalid Azure blob SAS token -- offending value: $sasToken")
log.debug "Creating Azure blob storage client -- accountName: $accountName; sasToken: ${sasToken?.substring(0,10)}.."

final endpoint = String.format(Locale.ROOT, "https://%s.blob.core.windows.net", accountName);
Expand Down

0 comments on commit e2244b4

Please sign in to comment.