Skip to content

Commit cc9eafc

Browse files
authored
chore: move spec submodule to master, update annotations (#482)
1 parent 1bd8b7a commit cc9eafc

File tree

4 files changed

+30
-30
lines changed

4 files changed

+30
-30
lines changed

src/main/java/software/amazon/encryption/s3/S3EncryptionClient.java

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ public static Consumer<AwsRequestOverrideConfiguration.Builder> withAdditionalCo
210210
.putExecutionAttribute(S3EncryptionClient.CONFIGURATION, multipartConfiguration);
211211
}
212212

213-
//= specification/s3-encryption/client.md#api-operations
213+
//= specification/s3-encryption/client.md#optional-api-operations
214214
//= type=implication
215215
//# ReEncryptInstructionFile MAY be implemented by the S3EC.
216216
/**
@@ -250,7 +250,7 @@ public ReEncryptInstructionFileResponse reEncryptInstructionFile(ReEncryptInstru
250250
final byte[] iv = contentMetadata.contentIv();
251251

252252
//Decrypt the data key using the current keyring
253-
//= specification/s3-encryption/client.md#api-operations
253+
//= specification/s3-encryption/client.md#optional-api-operations
254254
//= type=implication
255255
//# ReEncryptInstructionFile MUST decrypt the instruction file's encrypted data key for the given object using the client's CMM.
256256
DecryptionMaterials decryptedMaterials = this._cryptoMaterialsManager.decryptMaterials(
@@ -271,7 +271,7 @@ public ReEncryptInstructionFileResponse reEncryptInstructionFile(ReEncryptInstru
271271
.build();
272272

273273
//Re-encrypt the data key with the new keyring while preserving other cryptographic parameters
274-
//= specification/s3-encryption/client.md#api-operations
274+
//= specification/s3-encryption/client.md#optional-api-operations
275275
//= type=implication
276276
//# ReEncryptInstructionFile MUST re-encrypt the plaintext data key with a provided keyring.
277277
RawKeyring newKeyring = reEncryptInstructionFileRequest.newKeyring();
@@ -315,7 +315,7 @@ private void enforceRotation(EncryptionMaterials newEncryptionMaterials, GetObje
315315
throw new S3EncryptionClientException("Re-encryption failed due to enforced rotation! Old keyring is still able to decrypt the newly encrypted data key");
316316
}
317317

318-
//= specification/s3-encryption/client.md#api-operations
318+
//= specification/s3-encryption/client.md#required-api-operations
319319
//= type=implication
320320
//# PutObject MUST be implemented by the S3EC.
321321
/**
@@ -355,7 +355,7 @@ public PutObjectResponse putObject(PutObjectRequest putObjectRequest, RequestBod
355355
ExecutorService singleThreadExecutor = Executors.newSingleThreadExecutor();
356356

357357
try {
358-
//= specification/s3-encryption/client.md#api-operations
358+
//= specification/s3-encryption/client.md#required-api-operations
359359
//= type=implication
360360
//# PutObject MUST encrypt its input data before it is uploaded to S3.
361361
CompletableFuture<PutObjectResponse> futurePut = pipeline.putObject(putObjectRequest,
@@ -382,7 +382,7 @@ public PutObjectResponse putObject(PutObjectRequest putObjectRequest, RequestBod
382382

383383
}
384384

385-
//= specification/s3-encryption/client.md#api-operations
385+
//= specification/s3-encryption/client.md#required-api-operations
386386
//= type=implication
387387
//# GetObject MUST be implemented by the S3EC.
388388
/**
@@ -406,7 +406,7 @@ public <T> T getObject(GetObjectRequest getObjectRequest,
406406
ResponseTransformer<GetObjectResponse, T> responseTransformer)
407407
throws AwsServiceException, SdkClientException {
408408

409-
//= specification/s3-encryption/client.md#api-operations
409+
//= specification/s3-encryption/client.md#required-api-operations
410410
//= type=implication
411411
//# GetObject MUST decrypt data received from the S3 server and return it as plaintext.
412412
GetEncryptedObjectPipeline pipeline = GetEncryptedObjectPipeline.builder()
@@ -516,7 +516,7 @@ private <T extends Throwable> T onAbort(UploadObjectObserver observer, T t) {
516516
throw new S3EncryptionClientException(t.getMessage(), t);
517517
}
518518

519-
//= specification/s3-encryption/client.md#api-operations
519+
//= specification/s3-encryption/client.md#required-api-operations
520520
//= type=implication
521521
//# DeleteObject MUST be implemented by the S3EC.
522522
/**
@@ -536,11 +536,11 @@ public DeleteObjectResponse deleteObject(DeleteObjectRequest deleteObjectRequest
536536
.build();
537537

538538
try {
539-
//= specification/s3-encryption/client.md#api-operations
539+
//= specification/s3-encryption/client.md#required-api-operations
540540
//= type=implementation
541541
//# DeleteObject MUST delete the given object key.
542542
DeleteObjectResponse deleteObjectResponse = _wrappedAsyncClient.deleteObject(actualRequest).join();
543-
//= specification/s3-encryption/client.md#api-operations
543+
//= specification/s3-encryption/client.md#required-api-operations
544544
//= type=implementation
545545
//# DeleteObject MUST delete the associated instruction file using the default instruction file suffix.
546546
String instructionObjectKey = deleteObjectRequest.key() + DEFAULT_INSTRUCTION_FILE_SUFFIX;
@@ -557,7 +557,7 @@ public DeleteObjectResponse deleteObject(DeleteObjectRequest deleteObjectRequest
557557
}
558558
}
559559

560-
//= specification/s3-encryption/client.md#api-operations
560+
//= specification/s3-encryption/client.md#required-api-operations
561561
//= type=implication
562562
//# DeleteObjects MUST be implemented by the S3EC.
563563
/**
@@ -576,11 +576,11 @@ public DeleteObjectsResponse deleteObjects(DeleteObjectsRequest deleteObjectsReq
576576
.overrideConfiguration(API_NAME_INTERCEPTOR)
577577
.build();
578578
try {
579-
//= specification/s3-encryption/client.md#api-operations
579+
//= specification/s3-encryption/client.md#required-api-operations
580580
//= type=implementation
581581
//# DeleteObjects MUST delete each of the given objects.
582582
DeleteObjectsResponse deleteObjectsResponse = _wrappedAsyncClient.deleteObjects(actualRequest).join();
583-
//= specification/s3-encryption/client.md#api-operations
583+
//= specification/s3-encryption/client.md#required-api-operations
584584
//= type=implementation
585585
//# DeleteObjects MUST delete each of the corresponding instruction files using the default instruction file suffix.
586586
List<ObjectIdentifier> deleteObjects = instructionFileKeysToDelete(deleteObjectsRequest);
@@ -597,7 +597,7 @@ public DeleteObjectsResponse deleteObjects(DeleteObjectsRequest deleteObjectsReq
597597
}
598598
}
599599

600-
//= specification/s3-encryption/client.md#api-operations
600+
//= specification/s3-encryption/client.md#optional-api-operations
601601
//= type=implication
602602
//# CreateMultipartUpload MAY be implemented by the S3EC.
603603
/**
@@ -621,7 +621,7 @@ public CreateMultipartUploadResponse createMultipartUpload(CreateMultipartUpload
621621
}
622622
}
623623

624-
//= specification/s3-encryption/client.md#api-operations
624+
//= specification/s3-encryption/client.md#optional-api-operations
625625
//= type=implication
626626
//# UploadPart MAY be implemented by the S3EC.
627627
/**
@@ -647,7 +647,7 @@ public UploadPartResponse uploadPart(UploadPartRequest request, RequestBody requ
647647
}
648648
}
649649

650-
//= specification/s3-encryption/client.md#api-operations
650+
//= specification/s3-encryption/client.md#optional-api-operations
651651
//= type=implication
652652
//# CompleteMultipartUpload MAY be implemented by the S3EC.
653653
/**
@@ -667,7 +667,7 @@ public CompleteMultipartUploadResponse completeMultipartUpload(CompleteMultipart
667667
}
668668
}
669669

670-
//= specification/s3-encryption/client.md#api-operations
670+
//= specification/s3-encryption/client.md#optional-api-operations
671671
//= type=implication
672672
//# AbortMultipartUpload MAY be implemented by the S3EC.
673673
/**
@@ -965,7 +965,7 @@ public Builder enableMultipartPutObject(boolean _enableMultipartPutObject) {
965965

966966
//= specification/s3-encryption/client.md#set-buffer-size
967967
//= type=implication
968-
//# The S3EC SHOULD accept a configurable buffer size which refers to the maximum ciphertext length to store in memory when delayed authentication mode is disabled.
968+
//# The S3EC SHOULD accept a configurable buffer size which refers to the maximum ciphertext length in bytes to store in memory when Delayed Authentication mode is disabled.
969969
/**
970970
* Sets the buffer size for safe authentication used when delayed authentication mode is disabled.
971971
* If buffer size is not given during client configuration, default buffer size is set to 64MiB.

src/main/java/software/amazon/encryption/s3/internal/MultipartUploadObjectPipeline.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public CreateMultipartUploadResponse createMultipartUpload(CreateMultipartUpload
7474
.overrideConfiguration(API_NAME_INTERCEPTOR)
7575
.build();
7676

77-
//= specification/s3-encryption/client.md#api-operations
77+
//= specification/s3-encryption/client.md#optional-api-operations
7878
//= type=implication
7979
//# If implemented, CreateMultipartUpload MUST initiate a multipart upload.
8080
CreateMultipartUploadResponse response = _s3AsyncClient.createMultipartUpload(request).join();
@@ -136,19 +136,19 @@ public UploadPartResponse uploadPart(UploadPartRequest request, RequestBody requ
136136
throw new S3EncryptionClientException("No client-side information available on upload ID " + uploadId);
137137
}
138138
final UploadPartResponse response;
139-
//= specification/s3-encryption/client.md#api-operations
139+
//= specification/s3-encryption/client.md#optional-api-operations
140140
//= type=implication
141141
//# Each part MUST be encrypted in sequence.
142142
materials.beginPartUpload(actualRequest.partNumber(), partContentLength);
143-
//= specification/s3-encryption/client.md#api-operations
143+
//= specification/s3-encryption/client.md#optional-api-operations
144144
//= type=implication
145145
//# Each part MUST be encrypted using the same cipher instance for each part.
146146
Cipher cipher = materials.getCipher(materials.getIv());
147147

148148
ExecutorService singleThreadExecutor = Executors.newSingleThreadExecutor();
149149

150150
try {
151-
//= specification/s3-encryption/client.md#api-operations
151+
//= specification/s3-encryption/client.md#optional-api-operations
152152
//= type=implication
153153
//# UploadPart MUST encrypt each part.
154154
final AsyncRequestBody cipherAsyncRequestBody = new CipherAsyncRequestBody(
@@ -170,7 +170,7 @@ public UploadPartResponse uploadPart(UploadPartRequest request, RequestBody requ
170170
}
171171
// Ensures parts are not retried to avoid corrupting ciphertext
172172
AsyncRequestBody noRetryBody = new NoRetriesAsyncRequestBody(cipherAsyncRequestBody);
173-
//= specification/s3-encryption/client.md#api-operations
173+
//= specification/s3-encryption/client.md#optional-api-operations
174174
//= type=implication
175175
response = _s3AsyncClient.uploadPart(actualRequest, noRetryBody).join();
176176
} finally {
@@ -200,7 +200,7 @@ public CompleteMultipartUploadResponse completeMultipartUpload(CompleteMultipart
200200
.overrideConfiguration(API_NAME_INTERCEPTOR)
201201
.build();
202202

203-
//= specification/s3-encryption/client.md#api-operations
203+
//= specification/s3-encryption/client.md#optional-api-operations
204204
//= type=implication
205205
//# CompleteMultipartUpload MUST complete the multipart upload.
206206
CompleteMultipartUploadResponse response = _s3AsyncClient.completeMultipartUpload(actualRequest).join();
@@ -214,7 +214,7 @@ public AbortMultipartUploadResponse abortMultipartUpload(AbortMultipartUploadReq
214214
AbortMultipartUploadRequest actualRequest = request.toBuilder()
215215
.overrideConfiguration(API_NAME_INTERCEPTOR)
216216
.build();
217-
//= specification/s3-encryption/client.md#api-operations
217+
//= specification/s3-encryption/client.md#optional-api-operations
218218
//= type=implication
219219
//# AbortMultipartUpload MUST abort the multipart upload.
220220
return _s3AsyncClient.abortMultipartUpload(actualRequest).join();

src/test/java/software/amazon/encryption/s3/S3EncryptionClientTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,13 @@ public void deleteObjectWithInstructionFileSuccess() {
166166
v3Client.deleteObject(builder -> builder.bucket(BUCKET).key(objectKey));
167167

168168
S3Client s3Client = S3Client.builder().build();
169-
//= specification/s3-encryption/client.md#api-operations
169+
//= specification/s3-encryption/client.md#required-api-operations
170170
//= type=test
171171
//# DeleteObject MUST delete the given object key.
172172
assertThrows(S3Exception.class, () -> s3Client.getObject(builder -> builder
173173
.bucket(BUCKET)
174174
.key(objectKey)));
175-
//= specification/s3-encryption/client.md#api-operations
175+
//= specification/s3-encryption/client.md#required-api-operations
176176
//= type=test
177177
//# DeleteObject MUST delete the associated instruction file using the default instruction file suffix.
178178
assertThrows(S3Exception.class, () -> s3Client.getObject(builder -> builder
@@ -218,13 +218,13 @@ public void deleteObjectsWithInstructionFilesSuccess() {
218218
.delete(builder1 -> builder1.objects(objects)));
219219

220220
S3Client s3Client = S3Client.builder().build();
221-
//= specification/s3-encryption/client.md#api-operations
221+
//= specification/s3-encryption/client.md#required-api-operations
222222
//= type=test
223223
//# DeleteObjects MUST delete each of the given objects.
224224
assertThrows(S3Exception.class, () -> s3Client.getObject(builder -> builder
225225
.bucket(BUCKET)
226226
.key(objectKeys[0])));
227-
//= specification/s3-encryption/client.md#api-operations
227+
//= specification/s3-encryption/client.md#required-api-operations
228228
//= type=test
229229
//# DeleteObjects MUST delete each of the corresponding instruction files using the default instruction file suffix.
230230
assertThrows(S3Exception.class, () -> s3Client.getObject(builder -> builder

0 commit comments

Comments
 (0)