-
Notifications
You must be signed in to change notification settings - Fork 2.2k
create session #48639
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
base: bifrost-base
Are you sure you want to change the base?
create session #48639
Changes from all commits
4c94ea6
d561535
1020227
1d905f0
9f8e365
e63fe17
3e2fb11
3968a0e
09dcce6
bea226b
e0b4440
0a3570e
6a026f3
f6ca3e8
a1bdf3a
7309432
9aa9bab
8a620a1
925c44b
798b821
ced6225
a93e06a
301189a
9c3b2e3
0e5a6b0
4cc43cf
b3a5774
4c87689
7e5b122
18a4f67
05e4b8f
a988a18
1762ea3
c2c10a5
9e5404a
a147cc7
e7c047e
fc6ee15
e157d96
cba8194
83e5710
13e26be
605a9cb
08edd49
9fffc0a
f1de7cd
270ade3
f15f2ae
58a1417
7e49d4e
dda8123
5acd00f
63698f8
52a3fe2
82599ee
ff40db4
0af3885
04d232c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,6 +31,9 @@ | |
| import com.azure.storage.blob.implementation.models.FilterBlobSegment; | ||
| import com.azure.storage.blob.implementation.models.ListBlobsFlatSegmentResponse; | ||
| import com.azure.storage.blob.implementation.models.ListBlobsHierarchySegmentResponse; | ||
| import com.azure.storage.blob.implementation.models.AuthenticationType; | ||
| import com.azure.storage.blob.implementation.models.CreateSessionConfiguration; | ||
| import com.azure.storage.blob.implementation.models.CreateSessionResponse; | ||
| import com.azure.storage.blob.implementation.util.BlobConstants; | ||
| import com.azure.storage.blob.implementation.util.BlobSasImplUtil; | ||
| import com.azure.storage.blob.implementation.util.ModelHelper; | ||
|
|
@@ -1509,4 +1512,37 @@ public String generateSas(BlobServiceSasSignatureValues blobServiceSasSignatureV | |
| .generateSas(SasImplUtils.extractSharedKeyCredential(getHttpPipeline()), stringToSignHandler, context); | ||
| } | ||
|
|
||
| /** | ||
| * Creates a session scoped to this container. The session provides temporary credentials (a session token and | ||
| * session key) that can be used to sign subsequent requests using the Shared Key protocol. | ||
| * | ||
| * @return The {@link CreateSessionResponse} with session credentials. | ||
| */ | ||
| @ServiceMethod(returns = ReturnType.SINGLE) | ||
| CreateSessionResponse createSession() { | ||
| return createSessionWithResponse(null, Context.NONE).getValue(); | ||
|
Comment on lines
+1521
to
+1523
|
||
| } | ||
|
|
||
| /** | ||
| * Creates a session scoped to this container. The session provides temporary credentials (a session token and | ||
| * session key) that can be used to sign subsequent requests using the Shared Key protocol. | ||
| * | ||
| * @param timeout An optional timeout value beyond which a {@link RuntimeException} will be raised. | ||
| * @param context Additional context that is passed through the Http pipeline during the service call. | ||
| * @return A {@link Response} containing the {@link CreateSessionResponse}. | ||
| */ | ||
| @ServiceMethod(returns = ReturnType.SINGLE) | ||
| Response<CreateSessionResponse> createSessionWithResponse(Duration timeout, Context context) { | ||
| Context finalContext = context == null ? Context.NONE : context; | ||
| CreateSessionConfiguration config | ||
| = new CreateSessionConfiguration().setAuthenticationType(AuthenticationType.HMAC); | ||
|
|
||
| Callable<Response<CreateSessionResponse>> operation = () -> { | ||
| Response<CreateSessionResponse> response = this.azureBlobStorage.getContainers() | ||
| .createSessionWithResponse(containerName, config, null, null, finalContext); | ||
| return new SimpleResponse<>(response, response.getValue()); | ||
| }; | ||
|
|
||
| return sendRequest(operation, timeout, BlobStorageException.class); | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.