Skip to content
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/oauth copyfromurl #22086

Merged
merged 54 commits into from
Jun 25, 2021
Merged
Show file tree
Hide file tree
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 May 18, 2021
8b49136
Generated off latest version of blob swagger (#21644)
gapra-msft May 19, 2021
c3e5fc4
swagger generation and public API overloads
jaschrep-msft May 26, 2021
ed377e4
blob clients obey new generation
jaschrep-msft Jun 1, 2021
306acdf
Merge branch 'master' into feature/storage/stg78
gapra-msft Jun 1, 2021
82904ac
minor changes to bearer token logic
jaschrep-msft Jun 1, 2021
ebd52d1
TEST WORKING
jaschrep-msft Jun 2, 2021
5bb508b
extra testing
jaschrep-msft Jun 2, 2021
d64132f
ported oauthcopy source to blobs
jaschrep-msft Jun 3, 2021
4711efa
options API changes and docstrings
jaschrep-msft Jun 4, 2021
6270d52
Merge branch 'master' into feature/storage/stg78
gapra-msft Jun 4, 2021
2226236
fixed constructor issues
jaschrep-msft Jun 4, 2021
8cfa81a
fix missed source auth misses
jaschrep-msft Jun 4, 2021
b6779b1
script tags on pom
jaschrep-msft Jun 7, 2021
085fda9
removes arg checks in option model constructors
jaschrep-msft Jun 7, 2021
1374413
pom fix
jaschrep-msft Jun 7, 2021
89826c8
fix misnamed page blob tests
jaschrep-msft Jun 8, 2021
43d46f2
Test fixes
jaschrep-msft Jun 8, 2021
04f9c6a
fixed pom script comment
jaschrep-msft Jun 8, 2021
1c6158f
Merge branch 'feature/storage/stg78' of https://github.com/Azure/azur…
jaschrep-msft Jun 8, 2021
19c392e
downgrade some depenency verions
jaschrep-msft Jun 8, 2021
6f13ab6
rerecord sas tests
jaschrep-msft Jun 8, 2021
f0294a2
snippets and checkstyle
jaschrep-msft Jun 8, 2021
897ae48
rerecorded tests
jaschrep-msft Jun 9, 2021
3879ac2
test fixes
jaschrep-msft Jun 9, 2021
1d60ba2
rerecorded versioning tests
jaschrep-msft Jun 9, 2021
c411cfe
HttpAuthorization added to core-experimental
jaschrep-msft Jun 15, 2021
66b7a9e
refactored options type names
jaschrep-msft Jun 16, 2021
c4ea5bf
Reenabled quick query parquet support (#21785)
gapra-msft Jun 16, 2021
ef6f758
reidentified samples for options class name change
jaschrep-msft Jun 16, 2021
cf6093a
Implemented Immutable Storage with Versioning (#21718)
gapra-msft Jun 17, 2021
a13f37f
File listing v2 (#21720)
jaschrep-msft Jun 17, 2021
c4d4bb5
Merge branch 'feature/storage/stg78' of https://github.com/Azure/azur…
jaschrep-msft Jun 17, 2021
6e5131a
Merge branch 'main' into feature/storage/stg78
kasobol-msft Jun 18, 2021
2286afe
Fix test.
kasobol-msft Jun 18, 2021
f49f0c6
Merge branch 'main' into feature/storage/stg78
kasobol-msft Jun 18, 2021
384197a
remove HttpAuthorization in prep for merge
jaschrep-msft Jun 18, 2021
65aeed9
Merge branch 'feature/storage/stg78' of https://github.com/Azure/azur…
jaschrep-msft Jun 18, 2021
7ac2712
fix build from merge
jaschrep-msft Jun 18, 2021
c389932
fix pom versioning CI issues
jaschrep-msft Jun 18, 2021
91f080d
snippet line length
jaschrep-msft Jun 18, 2021
766dd27
fix merge error with immutable versioning
jaschrep-msft Jun 18, 2021
878a744
PR feedback
jaschrep-msft Jun 18, 2021
1cf3251
Minor cleanup
jaschrep-msft Jun 21, 2021
f9123f3
generator cleanup and regeneration
jaschrep-msft Jun 21, 2021
3d0a6d0
Keep files-shares tests dependent on latest blob
jaschrep-msft Jun 21, 2021
d8ff27d
test refactor/rerecord
jaschrep-msft Jun 23, 2021
fc4da4c
deleted old tests that were copied instead of moved
jaschrep-msft Jun 23, 2021
549e052
min service version reformat
jaschrep-msft Jun 23, 2021
6e00427
import cleanup
jaschrep-msft Jun 23, 2021
3bb23cd
Merge remote-tracking branch 'upstream/main' into feature/oauth-copyf…
kasobol-msft Jun 24, 2021
a17a7d3
post-merge.
kasobol-msft Jun 24, 2021
b871246
getOauthToken refactor
jaschrep-msft Jun 24, 2021
a1f402e
reformatting
jaschrep-msft Jun 24, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions sdk/storage/azure-storage-blob/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@
<artifactId>azure-core</artifactId>
<version>1.17.0</version> <!-- {x-version-update;com.azure:azure-core;dependency} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-experimental</artifactId>
<version>1.0.0-beta.15</version> <!-- {x-version-update;com.azure:azure-core-experimental;current} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-http-netty</artifactId>
Expand Down
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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package com.azure.storage.blob.options;

import com.azure.core.annotation.Fluent;
import com.azure.core.experimental.http.HttpAuthorization;
import com.azure.core.http.RequestConditions;
import com.azure.storage.blob.models.AccessTier;
import com.azure.storage.blob.models.BlobImmutabilityPolicy;
Expand All @@ -23,6 +24,7 @@ public class BlobCopyFromUrlOptions {
private AccessTier tier;
private RequestConditions sourceRequestConditions;
private BlobRequestConditions destinationRequestConditions;
private HttpAuthorization sourceAuthorization;
private BlobImmutabilityPolicy immutabilityPolicy;
private Boolean legalHold;

Expand Down Expand Up @@ -122,6 +124,25 @@ public BlobCopyFromUrlOptions setDestinationRequestConditions(BlobRequestConditi
return this;
}

/**
* @return auth header for access to 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 access to source.
jaschrep-msft marked this conversation as resolved.
Show resolved Hide resolved
* @return The updated options.
*/
public BlobCopyFromUrlOptions setSourceAuthorization(HttpAuthorization sourceAuthorization) {
this.sourceAuthorization = sourceAuthorization;
return this;
}

/**
* @return {@link BlobImmutabilityPolicy}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package com.azure.storage.blob.options;

import com.azure.core.util.CoreUtils;
import com.azure.core.experimental.http.HttpAuthorization;
import com.azure.storage.blob.models.AccessTier;
import com.azure.storage.blob.models.BlobHttpHeaders;
import com.azure.storage.blob.models.BlobRequestConditions;
Expand All @@ -23,6 +24,7 @@ public class BlobUploadFromUrlOptions {
private BlobRequestConditions destinationRequestConditions;
private BlobRequestConditions sourceRequestConditions;
private Boolean copySourceBlobProperties;
private HttpAuthorization sourceAuthorization;

/**
* @param sourceUrl The source URL to upload from.
Expand Down Expand Up @@ -159,4 +161,23 @@ public BlobUploadFromUrlOptions setCopySourceBlobProperties(Boolean copySourceBl
this.copySourceBlobProperties = copySourceBlobProperties;
return this;
}

/**
* @return auth header for access to 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 access to source.
* @return The updated options.
*/
public BlobUploadFromUrlOptions setSourceAuthorization(HttpAuthorization sourceAuthorization) {
this.sourceAuthorization = sourceAuthorization;
return this;
}
}
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.
Show resolved Hide resolved
this.sourceAuthorization = sourceAuthorization;
return this;
}
}
Loading