Skip to content

Commit 3ed8dde

Browse files
authored
Merge branch 'main' into aniravk/ReEncrypt-feature
2 parents dc29afb + bb898d1 commit 3ed8dde

File tree

7 files changed

+27
-11
lines changed

7 files changed

+27
-11
lines changed

cfn/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ Resources:
189189
"arn:aws:secretsmanager:us-west-2:${AWS::AccountId}:secret:Maven-GPG-Keys-CI-Credentials-eBrSNB",
190190
"arn:aws:secretsmanager:us-west-2:${AWS::AccountId}:secret:Github/aws-crypto-tools-ci-bot-AGUB3U",
191191
"arn:aws:secretsmanager:us-west-2:${AWS::AccountId}:secret:Sonatype-User-Token-zK61bM",
192+
"arn:aws:secretsmanager:us-west-2:${AWS::AccountId}:secret:Sonatype-Central-Portal-XrYUs2",
192193
"arn:aws:secretsmanager:us-west-2:${AWS::AccountId}:secret:Maven-GPG-Keys-Release-haLIjZ",
193194
"arn:aws:secretsmanager:us-west-2:${AWS::AccountId}:secret:Maven-GPG-Keys-Release-Credentials-WgJanS"
194195
],

codebuild/release/release-prod.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ env:
1010
secrets-manager:
1111
GPG_KEY: Maven-GPG-Keys-Release-Credentials:Keyname
1212
GPG_PASS: Maven-GPG-Keys-Release-Credentials:Passphrase
13-
SONA_USERNAME: Sonatype-User-Token:username
14-
SONA_PASSWORD: Sonatype-User-Token:password
13+
SONA_USERNAME: Sonatype-Central-Portal:Username
14+
SONA_PASSWORD: Sonatype-Central-Portal:Password
1515

1616
phases:
1717
install:

codebuild/release/settings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ SPDX-License-Identifier: Apache-2.0
1313
<password>${codeartifact.token}</password>
1414
</server>
1515
<server>
16-
<id>sonatype-nexus-staging</id>
16+
<id>central</id>
1717
<username>${sonatype.username}</username>
1818
<password>${sonatype.password}</password>
1919
</server>

pom.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
</developers>
3434

3535
<scm>
36-
<url>https://github.com/aws/amazon-s3-encryption-client.git</url>
36+
<url>https://github.com/aws/amazon-s3-encryption-client-java.git</url>
3737
</scm>
3838

3939
<properties>
@@ -308,8 +308,8 @@
308308

309309
<distributionManagement>
310310
<snapshotRepository>
311-
<id>sonatype-nexus-staging</id>
312-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
311+
<id>central</id>
312+
<url>https://ossrh-staging-api.central.sonatype.com/content/repositories/snapshots</url>
313313
</snapshotRepository>
314314
</distributionManagement>
315315

@@ -336,13 +336,13 @@
336336
</executions>
337337
</plugin>
338338
<plugin>
339-
<groupId>org.sonatype.plugins</groupId>
340-
<artifactId>nexus-staging-maven-plugin</artifactId>
341-
<version>1.6.13</version>
339+
<groupId>org.sonatype.central</groupId>
340+
<artifactId>central-publishing-maven-plugin</artifactId>
341+
<version>0.7.0</version>
342342
<extensions>true</extensions>
343343
<configuration>
344-
<serverId>sonatype-nexus-staging</serverId>
345-
<nexusUrl>https://aws.oss.sonatype.org</nexusUrl>
344+
<publishingServerId>central</publishingServerId>
345+
<autoPublish>true</autoPublish>
346346
</configuration>
347347
</plugin>
348348
</plugins>

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
package software.amazon.encryption.s3;
44

55
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
6+
import org.apache.commons.logging.LogFactory;
67
import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
78
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
89
import software.amazon.awssdk.awscore.exception.AwsServiceException;
@@ -71,6 +72,7 @@
7172
import software.amazon.encryption.s3.materials.PartialRsaKeyPair;
7273
import software.amazon.encryption.s3.materials.RawKeyring;
7374
import software.amazon.encryption.s3.materials.RsaKeyring;
75+
import software.amazon.encryption.s3.materials.S3Keyring;
7476

7577
import javax.crypto.SecretKey;
7678
import java.io.IOException;
@@ -1186,6 +1188,12 @@ public S3EncryptionClient build() {
11861188
if (!onlyOneNonNull(_cryptoMaterialsManager, _keyring, _aesKey, _rsaKeyPair, _kmsKeyId)) {
11871189
throw new S3EncryptionClientException("Exactly one must be set of: crypto materials manager, keyring, AES key, RSA key pair, KMS key id");
11881190
}
1191+
if (_enableLegacyWrappingAlgorithms && _keyring !=null) {
1192+
S3Keyring keyring = (S3Keyring) _keyring;
1193+
if (!keyring.areLegacyWrappingAlgorithmsEnabled()) {
1194+
LogFactory.getLog(getClass()).warn("enableLegacyWrappingAlgorithms is set on the client, but is not set on the keyring provided. In order to enable legacy wrapping algorithms, set enableLegacyWrappingAlgorithms to true in the keyring's builder.");
1195+
}
1196+
}
11891197

11901198
if (_bufferSize >= 0) {
11911199
if (_enableDelayedAuthenticationMode) {

src/main/java/software/amazon/encryption/s3/materials/S3Keyring.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ protected S3Keyring(Builder<?, ?> builder) {
3030
_dataKeyGenerator = builder._dataKeyGenerator;
3131
}
3232

33+
/**
34+
* @return true if legacy wrapping algorithms are enabled, false otherwise
35+
*/
36+
public boolean areLegacyWrappingAlgorithmsEnabled() { return _enableLegacyWrappingAlgorithms;}
37+
3338
/**
3439
* Generates a data key using the provided EncryptionMaterials and the configured DataKeyGenerator.
3540
* <p>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242

4343
import static org.junit.jupiter.api.Assertions.assertEquals;
4444
import static org.junit.jupiter.api.Assertions.assertThrows;
45+
4546
import static software.amazon.encryption.s3.S3EncryptionClient.withAdditionalConfiguration;
4647
import static software.amazon.encryption.s3.utils.S3EncryptionClientTestResources.BUCKET;
4748
import static software.amazon.encryption.s3.utils.S3EncryptionClientTestResources.KMS_KEY_ID;
@@ -965,4 +966,5 @@ public void nullMaterialDescriptionV3() {
965966
v3Client.close();
966967

967968
}
969+
968970
}

0 commit comments

Comments
 (0)