-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Feature/oauth copyfromurl #22086
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
Merged
jaschrep-msft
merged 54 commits into
Azure:main
from
jaschrep-msft:feature/oauth-copyfromurl
Jun 25, 2021
Merged
Feature/oauth copyfromurl #22086
Changes from all commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
768e313
Set up STG78 branch (#21634)
gapra-msft 8b49136
Generated off latest version of blob swagger (#21644)
gapra-msft c3e5fc4
swagger generation and public API overloads
jaschrep-msft ed377e4
blob clients obey new generation
jaschrep-msft 306acdf
Merge branch 'master' into feature/storage/stg78
gapra-msft 82904ac
minor changes to bearer token logic
jaschrep-msft ebd52d1
TEST WORKING
jaschrep-msft 5bb508b
extra testing
jaschrep-msft d64132f
ported oauthcopy source to blobs
jaschrep-msft 4711efa
options API changes and docstrings
jaschrep-msft 6270d52
Merge branch 'master' into feature/storage/stg78
gapra-msft 2226236
fixed constructor issues
jaschrep-msft 8cfa81a
fix missed source auth misses
jaschrep-msft b6779b1
script tags on pom
jaschrep-msft 085fda9
removes arg checks in option model constructors
jaschrep-msft 1374413
pom fix
jaschrep-msft 89826c8
fix misnamed page blob tests
jaschrep-msft 43d46f2
Test fixes
jaschrep-msft 04f9c6a
fixed pom script comment
jaschrep-msft 1c6158f
Merge branch 'feature/storage/stg78' of https://github.com/Azure/azur…
jaschrep-msft 19c392e
downgrade some depenency verions
jaschrep-msft 6f13ab6
rerecord sas tests
jaschrep-msft f0294a2
snippets and checkstyle
jaschrep-msft 897ae48
rerecorded tests
jaschrep-msft 3879ac2
test fixes
jaschrep-msft 1d60ba2
rerecorded versioning tests
jaschrep-msft c411cfe
HttpAuthorization added to core-experimental
jaschrep-msft 66b7a9e
refactored options type names
jaschrep-msft c4ea5bf
Reenabled quick query parquet support (#21785)
gapra-msft ef6f758
reidentified samples for options class name change
jaschrep-msft cf6093a
Implemented Immutable Storage with Versioning (#21718)
gapra-msft a13f37f
File listing v2 (#21720)
jaschrep-msft c4d4bb5
Merge branch 'feature/storage/stg78' of https://github.com/Azure/azur…
jaschrep-msft 6e5131a
Merge branch 'main' into feature/storage/stg78
kasobol-msft 2286afe
Fix test.
kasobol-msft f49f0c6
Merge branch 'main' into feature/storage/stg78
kasobol-msft 384197a
remove HttpAuthorization in prep for merge
jaschrep-msft 65aeed9
Merge branch 'feature/storage/stg78' of https://github.com/Azure/azur…
jaschrep-msft 7ac2712
fix build from merge
jaschrep-msft c389932
fix pom versioning CI issues
jaschrep-msft 91f080d
snippet line length
jaschrep-msft 766dd27
fix merge error with immutable versioning
jaschrep-msft 878a744
PR feedback
jaschrep-msft 1cf3251
Minor cleanup
jaschrep-msft f9123f3
generator cleanup and regeneration
jaschrep-msft 3d0a6d0
Keep files-shares tests dependent on latest blob
jaschrep-msft d8ff27d
test refactor/rerecord
jaschrep-msft fc4da4c
deleted old tests that were copied instead of moved
jaschrep-msft 549e052
min service version reformat
jaschrep-msft 6e00427
import cleanup
jaschrep-msft 3bb23cd
Merge remote-tracking branch 'upstream/main' into feature/oauth-copyf…
kasobol-msft a17a7d3
post-merge.
kasobol-msft b871246
getOauthToken refactor
jaschrep-msft a1f402e
reformatting
jaschrep-msft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
121 changes: 121 additions & 0 deletions
121
...lob/src/main/java/com/azure/storage/blob/options/AppendBlobAppendBlockFromUrlOptions.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,121 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| package com.azure.storage.blob.options; | ||
|
|
||
| import com.azure.core.annotation.Fluent; | ||
| import com.azure.core.experimental.http.HttpAuthorization; | ||
| import com.azure.core.util.CoreUtils; | ||
| import com.azure.storage.blob.models.AppendBlobRequestConditions; | ||
| import com.azure.storage.blob.models.BlobRange; | ||
| import com.azure.storage.blob.models.BlobRequestConditions; | ||
|
|
||
| /** | ||
| * Extended options that may be passed when appending a block from a source URL. | ||
| */ | ||
| @Fluent | ||
| public class AppendBlobAppendBlockFromUrlOptions { | ||
| private final String sourceUrl; | ||
| private BlobRange sourceRange; | ||
| private byte[] sourceContentMd5; | ||
| private AppendBlobRequestConditions destinationRequestConditions; | ||
| private BlobRequestConditions sourceRequestConditions; | ||
| private HttpAuthorization sourceAuthorization; | ||
|
|
||
| /** | ||
| * @param sourceUrl The source URL to copy from. URLs outside of Azure may only be copied to block blobs. | ||
| */ | ||
| public AppendBlobAppendBlockFromUrlOptions(String sourceUrl) { | ||
| this.sourceUrl = sourceUrl; | ||
| } | ||
|
|
||
| /** | ||
| * @return Source URL to copy from. | ||
| */ | ||
| public String getSourceUrl() { | ||
| return sourceUrl; | ||
| } | ||
|
|
||
| /** | ||
| * @return Range of bytes to read from the source. | ||
| */ | ||
| public BlobRange getSourceRange() { | ||
| return sourceRange; | ||
| } | ||
|
|
||
| /** | ||
| * @param sourceRange Range of bytes to read from the source. | ||
| * @return The updated options. | ||
| */ | ||
| public AppendBlobAppendBlockFromUrlOptions setSourceRange(BlobRange sourceRange) { | ||
| this.sourceRange = sourceRange; | ||
| return this; | ||
| } | ||
|
|
||
| /** | ||
| * @return MD5 of the source content to be appended. | ||
| */ | ||
| public byte[] getSourceContentMd5() { | ||
| return CoreUtils.clone(sourceContentMd5); | ||
| } | ||
|
|
||
| /** | ||
| * @param sourceContentMd5 MD5 of the source content to be appended. | ||
| * @return The updated options. | ||
| */ | ||
| public AppendBlobAppendBlockFromUrlOptions setSourceContentMd5(byte[] sourceContentMd5) { | ||
| this.sourceContentMd5 = CoreUtils.clone(sourceContentMd5); | ||
| return this; | ||
| } | ||
|
|
||
| /** | ||
| * @return {@link AppendBlobRequestConditions} for writing to destination. | ||
| */ | ||
| public AppendBlobRequestConditions getDestinationRequestConditions() { | ||
| return destinationRequestConditions; | ||
| } | ||
|
|
||
| /** | ||
| * @param destinationRequestConditions {@link AppendBlobRequestConditions} for writing to destination. | ||
| * @return The updated options. | ||
| */ | ||
| public AppendBlobAppendBlockFromUrlOptions setDestinationRequestConditions(AppendBlobRequestConditions destinationRequestConditions) { | ||
| this.destinationRequestConditions = destinationRequestConditions; | ||
| return this; | ||
| } | ||
|
|
||
| /** | ||
| * @return {@link BlobRequestConditions} for accessing source. | ||
| */ | ||
| public BlobRequestConditions getSourceRequestConditions() { | ||
| return sourceRequestConditions; | ||
| } | ||
|
|
||
| /** | ||
| * @param sourceRequestConditions {@link BlobRequestConditions} for accessing source. | ||
| * @return The updated options. | ||
| */ | ||
| public AppendBlobAppendBlockFromUrlOptions setSourceRequestConditions(BlobRequestConditions sourceRequestConditions) { | ||
| this.sourceRequestConditions = sourceRequestConditions; | ||
| return this; | ||
| } | ||
|
|
||
| /** | ||
| * @return auth header for accessing source. | ||
| */ | ||
| public HttpAuthorization getSourceAuthorization() { | ||
| return sourceAuthorization; | ||
| } | ||
|
|
||
| /** | ||
| * Sets "Authorization" header for accessing source URL. Currently only "Bearer" authentication is accepted by | ||
| * Storage. | ||
| * | ||
| * @param sourceAuthorization auth header for accessing source. | ||
| * @return The updated options. | ||
| */ | ||
| public AppendBlobAppendBlockFromUrlOptions setSourceAuthorization(HttpAuthorization sourceAuthorization) { | ||
| this.sourceAuthorization = sourceAuthorization; | ||
| return this; | ||
| } | ||
| } |
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
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
130 changes: 130 additions & 0 deletions
130
...-blob/src/main/java/com/azure/storage/blob/options/BlockBlobStageBlockFromUrlOptions.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,130 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| package com.azure.storage.blob.options; | ||
|
|
||
| import com.azure.core.annotation.Fluent; | ||
| import com.azure.core.experimental.http.HttpAuthorization; | ||
| import com.azure.core.util.CoreUtils; | ||
| import com.azure.storage.blob.models.BlobRange; | ||
| import com.azure.storage.blob.models.BlobRequestConditions; | ||
|
|
||
| /** | ||
| * Extended options that may be passed when staging a block from a source URL. | ||
| */ | ||
| @Fluent | ||
| public class BlockBlobStageBlockFromUrlOptions { | ||
| private final String base64BlockId; | ||
| private final String sourceUrl; | ||
| private BlobRange sourceRange; | ||
| private byte[] sourceContentMd5; | ||
| private String leaseId; | ||
| private BlobRequestConditions sourceRequestConditions; | ||
| private HttpAuthorization sourceAuthorization; | ||
|
|
||
| /** | ||
| * @param base64BlockId The block ID to assign the new block. | ||
| * @param sourceUrl The source URL to copy from. URLs outside of Azure may only be copied to block blobs. | ||
| */ | ||
| public BlockBlobStageBlockFromUrlOptions(String base64BlockId, String sourceUrl) { | ||
| this.base64BlockId = base64BlockId; | ||
| this.sourceUrl = sourceUrl; | ||
| } | ||
|
|
||
| /** | ||
| * @return The block ID to assign the new block. | ||
| */ | ||
| public String getBase64BlockId() { | ||
| return base64BlockId; | ||
| } | ||
|
|
||
| /** | ||
| * @return The source URL to upload from. | ||
| */ | ||
| public String getSourceUrl() { | ||
| return sourceUrl; | ||
| } | ||
|
|
||
| /** | ||
| * @return Range of bytes to read from the source. | ||
| */ | ||
| public BlobRange getSourceRange() { | ||
| return sourceRange; | ||
| } | ||
|
|
||
| /** | ||
| * @param sourceRange Range of bytes to read from the source. | ||
| * @return The updated options. | ||
| */ | ||
| public BlockBlobStageBlockFromUrlOptions setSourceRange(BlobRange sourceRange) { | ||
| this.sourceRange = sourceRange; | ||
| return this; | ||
| } | ||
|
|
||
| /** | ||
| * @return MD5 of the source content. | ||
| */ | ||
| public byte[] getSourceContentMd5() { | ||
| return CoreUtils.clone(sourceContentMd5); | ||
| } | ||
|
|
||
| /** | ||
| * @param sourceContentMd5 MD5 of the source content. | ||
| * @return The updated options. | ||
| */ | ||
| public BlockBlobStageBlockFromUrlOptions setSourceContentMd5(byte[] sourceContentMd5) { | ||
| this.sourceContentMd5 = CoreUtils.clone(sourceContentMd5); | ||
| return this; | ||
| } | ||
|
|
||
| /** | ||
| * @return Lease ID for accessing source content. | ||
| */ | ||
| public String getLeaseId() { | ||
| return leaseId; | ||
| } | ||
|
|
||
| /** | ||
| * @param leaseId Lease ID for accessing source content. | ||
| * @return The updated options. | ||
| */ | ||
| public BlockBlobStageBlockFromUrlOptions setLeaseId(String leaseId) { | ||
| this.leaseId = leaseId; | ||
| return this; | ||
| } | ||
|
|
||
| /** | ||
| * @return {@link BlobRequestConditions} for accessing source content. | ||
| */ | ||
| public BlobRequestConditions getSourceRequestConditions() { | ||
| return sourceRequestConditions; | ||
| } | ||
|
|
||
| /** | ||
| * @param sourceRequestConditions {@link BlobRequestConditions} for accessing source content. | ||
| * @return The updated options. | ||
| */ | ||
| public BlockBlobStageBlockFromUrlOptions setSourceRequestConditions(BlobRequestConditions sourceRequestConditions) { | ||
| this.sourceRequestConditions = sourceRequestConditions; | ||
| return this; | ||
| } | ||
|
|
||
| /** | ||
| * @return auth header to access source. | ||
| */ | ||
| public HttpAuthorization getSourceAuthorization() { | ||
| return sourceAuthorization; | ||
| } | ||
|
|
||
| /** | ||
| * Sets "Authorization" header for accessing source URL. Currently only "Bearer" authentication is accepted by | ||
| * Storage. | ||
| * | ||
| * @param sourceAuthorization auth header to access source. | ||
| * @return The updated options. | ||
| */ | ||
| public BlockBlobStageBlockFromUrlOptions setSourceAuthorization(HttpAuthorization sourceAuthorization) { | ||
|
jaschrep-msft marked this conversation as resolved.
|
||
| this.sourceAuthorization = sourceAuthorization; | ||
| return this; | ||
| } | ||
| } | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.