Skip to content

Commit ff5762b

Browse files
authored
Merge pull request #75 from oracle/release_2018-08-23
Releasing version 1.2.45
2 parents af1f7a2 + 824a924 commit ff5762b

File tree

138 files changed

+15314
-658
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+15314
-658
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
1313
### Added
1414
- N/A
1515

16+
## 1.2.45 - 2018-08-23
17+
### Added
18+
- Support for fault domains in the Identity service
19+
- Support for Autonomous Data Warehouse and Autonomous Transaction Processing in the Database service
20+
- Support for resizing an offline volume in the Block Storage service
21+
1622
## 1.2.44 - 2018-08-09
1723
### Added
1824
- Support for fault domains in the Compute service

bmc-addons/bmc-apache-connector-provider/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ The oci-java-sdk-addons-apache is an optional add-on to the OCI Java SDK. It le
66

77
The add-on provides two features:
88

9-
* **Connection pooling**. A detailed explantation can be found [here](https://hc.apache.org/httpcomponents-client-ga/tutorial/html/connmgmt.html)
9+
* **Connection pooling**. A detailed explanation can be found [here](https://hc.apache.org/httpcomponents-client-ga/tutorial/html/connmgmt.html)
1010
* **HTTP(S) proxy support**.
1111

12-
Note: The `ApacheConnectorProvider` buffers requests into memory and can impact memory utilization of your application. This increased use of memory is especially relavent when using`ObjectStorageClient` to upload large objects to the Object Storage service.
12+
Note: The `ApacheConnectorProvider` buffers requests into memory and can impact memory utilization of your application. This increased use of memory is especially relevant when using`ObjectStorageClient` to upload large objects to the Object Storage service.
1313

1414
## Installation
1515
1. The OCI Java SDK must be installed and configured before installing the add-on. See [the documentation](https://docs.us-phoenix-1.oraclecloud.com/Content/API/SDKDocs/javasdk.htm) for details.

bmc-addons/bmc-apache-connector-provider/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.oracle.oci.sdk</groupId>
77
<artifactId>oci-java-sdk-addons</artifactId>
8-
<version>1.2.44</version>
8+
<version>1.2.45</version>
99
<relativePath>../pom.xml</relativePath>
1010
</parent>
1111

@@ -37,7 +37,7 @@
3737
<dependency>
3838
<groupId>com.oracle.oci.sdk</groupId>
3939
<artifactId>oci-java-sdk-common</artifactId>
40-
<version>1.2.44</version>
40+
<version>1.2.45</version>
4141
</dependency>
4242
</dependencies>
4343
</project>

bmc-addons/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.oracle.oci.sdk</groupId>
77
<artifactId>oci-java-sdk</artifactId>
8-
<version>1.2.44</version>
8+
<version>1.2.45</version>
99
<relativePath>../pom.xml</relativePath>
1010
</parent>
1111

bmc-audit/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.oracle.oci.sdk</groupId>
77
<artifactId>oci-java-sdk</artifactId>
8-
<version>1.2.44</version>
8+
<version>1.2.45</version>
99
<relativePath>../pom.xml</relativePath>
1010
</parent>
1111

@@ -18,7 +18,7 @@
1818
<dependency>
1919
<groupId>com.oracle.oci.sdk</groupId>
2020
<artifactId>oci-java-sdk-common</artifactId>
21-
<version>1.2.44</version>
21+
<version>1.2.45</version>
2222
</dependency>
2323
</dependencies>
2424

bmc-bom/pom.xml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.oracle.oci.sdk</groupId>
77
<artifactId>oci-java-sdk</artifactId>
8-
<version>1.2.44</version>
8+
<version>1.2.45</version>
99
<relativePath>../pom.xml</relativePath>
1010
</parent>
1111
<artifactId>oci-java-sdk-bom</artifactId>
@@ -19,82 +19,82 @@
1919
<dependency>
2020
<groupId>com.oracle.oci.sdk</groupId>
2121
<artifactId>oci-java-sdk-common</artifactId>
22-
<version>1.2.44</version>
22+
<version>1.2.45</version>
2323
<optional>false</optional>
2424
</dependency>
2525
<!-- Service modules, alpha sorted -->
2626
<dependency>
2727
<groupId>com.oracle.oci.sdk</groupId>
2828
<artifactId>oci-java-sdk-audit</artifactId>
29-
<version>1.2.44</version>
29+
<version>1.2.45</version>
3030
<optional>false</optional>
3131
</dependency>
3232
<dependency>
3333
<groupId>com.oracle.oci.sdk</groupId>
3434
<artifactId>oci-java-sdk-containerengine</artifactId>
35-
<version>1.2.44</version>
35+
<version>1.2.45</version>
3636
<optional>false</optional>
3737
</dependency>
3838
<dependency>
3939
<groupId>com.oracle.oci.sdk</groupId>
4040
<artifactId>oci-java-sdk-core</artifactId>
41-
<version>1.2.44</version>
41+
<version>1.2.45</version>
4242
<optional>false</optional>
4343
</dependency>
4444
<dependency>
4545
<groupId>com.oracle.oci.sdk</groupId>
4646
<artifactId>oci-java-sdk-database</artifactId>
47-
<version>1.2.44</version>
47+
<version>1.2.45</version>
4848
<optional>false</optional>
4949
</dependency>
5050
<dependency>
5151
<groupId>com.oracle.oci.sdk</groupId>
5252
<artifactId>oci-java-sdk-dns</artifactId>
53-
<version>1.2.44</version>
53+
<version>1.2.45</version>
5454
<optional>false</optional>
5555
</dependency>
5656
<dependency>
5757
<groupId>com.oracle.oci.sdk</groupId>
5858
<artifactId>oci-java-sdk-email</artifactId>
59-
<version>1.2.44</version>
59+
<version>1.2.45</version>
6060
<optional>false</optional>
6161
</dependency>
6262
<dependency>
6363
<groupId>com.oracle.oci.sdk</groupId>
6464
<artifactId>oci-java-sdk-filestorage</artifactId>
65-
<version>1.2.44</version>
65+
<version>1.2.45</version>
6666
<optional>false</optional>
6767
</dependency>
6868
<dependency>
6969
<groupId>com.oracle.oci.sdk</groupId>
7070
<artifactId>oci-java-sdk-identity</artifactId>
71-
<version>1.2.44</version>
71+
<version>1.2.45</version>
7272
<optional>false</optional>
7373
</dependency>
7474
<dependency>
7575
<groupId>com.oracle.oci.sdk</groupId>
7676
<artifactId>oci-java-sdk-loadbalancer</artifactId>
77-
<version>1.2.44</version>
77+
<version>1.2.45</version>
7878
<optional>false</optional>
7979
</dependency>
8080
<dependency>
8181
<groupId>com.oracle.oci.sdk</groupId>
8282
<artifactId>oci-java-sdk-objectstorage</artifactId>
83-
<version>1.2.44</version>
83+
<version>1.2.45</version>
8484
<optional>false</optional>
8585
<type>pom</type>
8686
</dependency>
8787
<dependency>
8888
<groupId>com.oracle.oci.sdk</groupId>
8989
<artifactId>oci-java-sdk-resourcesearch</artifactId>
9090
<optional>false</optional>
91-
<version>1.2.44</version>
91+
<version>1.2.45</version>
9292
</dependency>
9393
<dependency>
9494
<groupId>com.oracle.oci.sdk</groupId>
9595
<optional>false</optional>
9696
<artifactId>oci-java-sdk-addons-apache</artifactId>
97-
<version>1.2.44</version>
97+
<version>1.2.45</version>
9898
</dependency>
9999
</dependencies>
100100
</dependencyManagement>

bmc-common/pom.xml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.oracle.oci.sdk</groupId>
77
<artifactId>oci-java-sdk</artifactId>
8-
<version>1.2.44</version>
8+
<version>1.2.45</version>
99
<relativePath>../pom.xml</relativePath>
1010
</parent>
1111

@@ -15,10 +15,7 @@
1515
<url>https://docs.us-phoenix-1.oraclecloud.com/Content/API/SDKDocs/javasdk.htm</url>
1616

1717
<properties>
18-
<!-- To allow for encrypted PEM (PBKDF-OpenSSL), we need to use a version before 1.53. >= 1.53 introduced
19-
a breaking change. http://bouncy-castle.1462172.n4.nabble.com/Issues-when-migrating-to-1-53-td4657955.html
20-
https://github.com/box/box-java-sdk/issues/168 Has not been fixed as of 1.55. -->
21-
<bouncycastle.version>1.52</bouncycastle.version>
18+
<bouncycastle.version>1.60</bouncycastle.version>
2219
</properties>
2320

2421
<build>

bmc-common/src/main/java/com/oracle/bmc/http/internal/RestClient.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import lombok.RequiredArgsConstructor;
1313
import lombok.Value;
1414
import lombok.extern.slf4j.Slf4j;
15+
import org.apache.commons.lang3.StringUtils;
1516

1617
import javax.annotation.Nullable;
1718
import javax.ws.rs.ProcessingException;
@@ -151,7 +152,9 @@ private Object attemptToSerialize(@Nullable Object body) {
151152
try {
152153
return (body instanceof String || body instanceof InputStream)
153154
? body
154-
: RestClientFactory.getObjectMapper().writeValueAsString(body);
155+
: (body != null)
156+
? RestClientFactory.getObjectMapper().writeValueAsString(body)
157+
: StringUtils.EMPTY;
155158
} catch (JsonProcessingException e) {
156159
throw new IllegalArgumentException("Unable to process JSON body", e);
157160
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/**
2+
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
3+
*/
4+
package com.oracle.bmc.http.signing.internal;
5+
6+
import com.google.common.base.Throwables;
7+
import lombok.extern.slf4j.Slf4j;
8+
9+
import java.security.Provider;
10+
import java.security.Security;
11+
12+
@Slf4j
13+
class BouncyCastleHelper {
14+
private final boolean isProviderInstalled;
15+
private final Provider bouncyCastleProvider;
16+
17+
private BouncyCastleHelper() {
18+
isProviderInstalled =
19+
Security.getProvider("BC") != null || Security.getProvider("BCFIPS") != null;
20+
try {
21+
bouncyCastleProvider = (Provider) getBouncyCastleProviderClass().newInstance();
22+
} catch (InstantiationException | IllegalAccessException ex) {
23+
LOG.error("Failed to instantiate provider", ex);
24+
throw Throwables.propagate(ex);
25+
}
26+
}
27+
28+
private static class Holder {
29+
private static final BouncyCastleHelper INSTANCE = new BouncyCastleHelper();
30+
}
31+
32+
static BouncyCastleHelper getInstance() {
33+
return Holder.INSTANCE;
34+
}
35+
36+
boolean isProviderInstalled() {
37+
return isProviderInstalled;
38+
}
39+
40+
Provider getBouncyCastleProvider() {
41+
return bouncyCastleProvider;
42+
}
43+
44+
private static Class getBouncyCastleProviderClass() {
45+
LOG.debug("Trying to get BouncyCastleProvider");
46+
try {
47+
return Class.forName("org.bouncycastle.jce.provider.BouncyCastleProvider");
48+
} catch (ClassNotFoundException e) {
49+
LOG.info("Did not find BouncyCastleProvider");
50+
}
51+
52+
LOG.debug("Trying to get BouncyCastleFipsProvider");
53+
try {
54+
return Class.forName("org.bouncycastle.jcajce.provider.BouncyCastleFipsProvider");
55+
} catch (ClassNotFoundException e) {
56+
LOG.info("Did not find BouncyCastleFipsProvider");
57+
}
58+
59+
throw new IllegalStateException("No matching BouncyCastle provider found.");
60+
}
61+
}

bmc-common/src/main/java/com/oracle/bmc/http/signing/internal/PEMFileRSAPrivateKeySupplier.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import java.io.IOException;
77
import java.io.InputStream;
88
import java.io.InputStreamReader;
9+
import java.security.Provider;
10+
import java.security.Security;
911
import java.security.interfaces.RSAPrivateKey;
1012

1113
import javax.annotation.Nonnull;
@@ -72,8 +74,22 @@ public PEMFileRSAPrivateKeySupplier(
7274
Preconditions.checkNotNull(
7375
passphraseCharacters, "The provided private key requires a passphrase");
7476

77+
JcePEMDecryptorProviderBuilder decryptorProviderBuilder =
78+
new JcePEMDecryptorProviderBuilder();
79+
80+
// If either of BouncyCastle or BouncyCastleFIPS provider is installed, then irrespective of the
81+
// version of the library used, decryption of passphrase protected PEM files are supported. Else,
82+
// for versions of BouncyCastle > 1.52 (or BC-FIPS), need to add the provider to be able to read
83+
// passphrase protected PEM files. Adding the provider to the PEMDecryptorProvider instead of
84+
// modifying the application's security environment (by calling Security.addProvider) to maintain
85+
// backward compatibility. Details at https://github.com/bcgit/bc-java/issues/156
86+
if (!BouncyCastleHelper.getInstance().isProviderInstalled()) {
87+
decryptorProviderBuilder.setProvider(
88+
BouncyCastleHelper.getInstance().getBouncyCastleProvider());
89+
}
90+
7591
PEMDecryptorProvider decProv =
76-
new JcePEMDecryptorProviderBuilder().build(passphraseCharacters);
92+
decryptorProviderBuilder.build(passphraseCharacters);
7793
try {
7894
keyInfo =
7995
((PEMEncryptedKeyPair) object)

0 commit comments

Comments
 (0)