Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
### Added
- N/A

## 1.3.1 - 2018-11-15
### Added
- Support for VCN transit routing in the Networking service

### Changed
- Bouncy Castle jar is no longer bundled within the shaded distribution `oci-java-sdk-shaded-full` and now must be included in the CLASSPATH.

## 1.3.0 - 2018-11-01
### Added
- Support for modifying the route table, DHCP options, and security lists associated with a subnet in the Networking service.
Expand Down
4 changes: 2 additions & 2 deletions bmc-addons/bmc-apache-connector-provider/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-addons</artifactId>
<version>1.3.0</version>
<version>1.3.1</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down Expand Up @@ -37,7 +37,7 @@
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-common</artifactId>
<version>1.3.0</version>
<version>1.3.1</version>
</dependency>
</dependencies>
</project>
2 changes: 1 addition & 1 deletion bmc-addons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk</artifactId>
<version>1.3.0</version>
<version>1.3.1</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
4 changes: 2 additions & 2 deletions bmc-audit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk</artifactId>
<version>1.3.0</version>
<version>1.3.1</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand All @@ -19,7 +19,7 @@
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-common</artifactId>
<version>1.3.0</version>
<version>1.3.1</version>
</dependency>
</dependencies>

Expand Down
30 changes: 15 additions & 15 deletions bmc-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk</artifactId>
<version>1.3.0</version>
<version>1.3.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>oci-java-sdk-bom</artifactId>
Expand All @@ -19,86 +19,86 @@
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-common</artifactId>
<version>1.3.0</version>
<version>1.3.1</version>
<optional>false</optional>
</dependency>
<!-- Service modules, alpha sorted -->
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-audit</artifactId>
<version>1.3.0</version>
<version>1.3.1</version>
<optional>false</optional>
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-containerengine</artifactId>
<version>1.3.0</version>
<version>1.3.1</version>
<optional>false</optional>
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-core</artifactId>
<version>1.3.0</version>
<version>1.3.1</version>
<optional>false</optional>
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-database</artifactId>
<version>1.3.0</version>
<version>1.3.1</version>
<optional>false</optional>
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-dns</artifactId>
<version>1.3.0</version>
<version>1.3.1</version>
<optional>false</optional>
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-email</artifactId>
<version>1.3.0</version>
<version>1.3.1</version>
<optional>false</optional>
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-filestorage</artifactId>
<version>1.3.0</version>
<version>1.3.1</version>
<optional>false</optional>
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-identity</artifactId>
<version>1.3.0</version>
<version>1.3.1</version>
<optional>false</optional>
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-loadbalancer</artifactId>
<version>1.3.0</version>
<version>1.3.1</version>
<optional>false</optional>
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-objectstorage</artifactId>
<version>1.3.0</version>
<version>1.3.1</version>
<optional>false</optional>
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-resourcesearch</artifactId>
<optional>false</optional>
<version>1.3.0</version>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<optional>false</optional>
<artifactId>oci-java-sdk-addons-apache</artifactId>
<version>1.3.0</version>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-keymanagement</artifactId>
<version>1.3.0</version>
<version>1.3.1</version>
<optional>false</optional>
</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion bmc-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk</artifactId>
<version>1.3.0</version>
<version>1.3.1</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
10 changes: 10 additions & 0 deletions bmc-common/src/main/java/com/oracle/bmc/Services.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ public static Service create(final String serviceName, final String serviceEndpo
.build();
}

/**
* Get Service instance based on service name.
*
* @param serviceName service name should be UPPER CASE.
* @return service instance
*/
public static Service getServiceByName(final String serviceName) {
return SERVICE_CACHE.get(serviceName);
}

@Builder(builderClassName = "ServiceBuilder", builderMethodName = "serviceBuilder")
private static synchronized Service create(
final String serviceName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import java.security.NoSuchAlgorithmException;
import java.security.interfaces.RSAPrivateKey;
import java.security.interfaces.RSAPublicKey;
import java.util.Arrays;
import java.util.Set;

/**
Expand Down Expand Up @@ -125,15 +124,22 @@ protected static class CachingSessionKeySupplier implements SessionKeySupplier {

protected CachingSessionKeySupplier(final SessionKeySupplier delegate) {
this.delegate = delegate;
this.setPrivateKeyBytes(delegate.getPrivateKey());
this.setPrivateKeyBytes((RSAPrivateKey) delegate.getKeyPair().getPrivate());
}

@Override
public KeyPair getKeyPair() {
return delegate.getKeyPair();
}

@Override
@Deprecated
public synchronized RSAPublicKey getPublicKey() {
return delegate.getPublicKey();
}

@Override
@Deprecated
public synchronized RSAPrivateKey getPrivateKey() {
return delegate.getPrivateKey();
}
Expand All @@ -145,7 +151,7 @@ public synchronized void refreshKeys() {

// private keys can be refreshed asynchronously, always update first
protected synchronized byte[] getPrivateKeyBytes() {
setPrivateKeyBytes(this.getPrivateKey());
setPrivateKeyBytes((RSAPrivateKey) this.getKeyPair().getPrivate());
return this.privateKeyBytes;
}

Expand Down Expand Up @@ -181,20 +187,29 @@ protected SessionKeySupplierImpl() {
this.keyPair = GENERATOR.generateKeyPair();
}

@Override
public KeyPair getKeyPair() {
return keyPair;
}

/**
* Gets the public key
* @return the public key, not null
* @deprecated use getKeyPair() instead
*/
@Override
@Deprecated
public RSAPublicKey getPublicKey() {
return (RSAPublicKey) keyPair.getPublic();
}

/**
* Gets the private key
* @return the private key, not null
* @deprecated use getKeyPair() instead
*/
@Override
@Deprecated
public RSAPrivateKey getPrivateKey() {
return (RSAPrivateKey) keyPair.getPrivate();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/
package com.oracle.bmc.auth;

import java.security.KeyPair;
import java.security.interfaces.RSAPrivateKey;
import java.security.interfaces.RSAPublicKey;

Expand All @@ -14,16 +15,26 @@
*/
public interface SessionKeySupplier {

/**
* Returns the current RSA key pair.
* @return The RSA key pair.
*/
KeyPair getKeyPair();

/**
* Gets the public key
* @return the public key, not null
* @deprecated use getKeyPair instead
*/
@Deprecated
RSAPublicKey getPublicKey();

/**
* Gets the private key
* @return the private key, not null
* @deprecated use getKeyPair instead
*/
@Deprecated
RSAPrivateKey getPrivateKey();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
package com.oracle.bmc.auth;

import java.io.InputStream;
import java.nio.charset.StandardCharsets;

import com.google.common.base.Supplier;
import com.oracle.bmc.Region;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import com.oracle.bmc.util.StreamUtils;

import javax.security.auth.Refreshable;
import java.io.*;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.math.BigInteger;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.security.KeyFactory;
import java.security.MessageDigest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@
import com.oracle.bmc.http.internal.RestClientFactory;
import com.oracle.bmc.http.internal.RestClientFactoryBuilder;
import com.oracle.bmc.http.signing.RequestSigner;
import com.oracle.bmc.http.signing.SigningStrategy;
import com.oracle.bmc.http.signing.internal.Constants;
import com.oracle.bmc.http.signing.internal.KeySupplier;
import com.oracle.bmc.http.signing.internal.RequestSignerImpl;

import java.security.cert.X509Certificate;
import java.security.interfaces.RSAPrivateKey;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;

Expand Down Expand Up @@ -119,7 +121,9 @@ private static RestClient createRestClient(

RestClientFactory restClientFactory =
RestClientFactoryBuilder.builder().clientConfigurator(clientConfigurator).build();
RestClient restClient = restClientFactory.create(requestSigner);
RestClient restClient =
restClientFactory.create(
requestSigner, Collections.<SigningStrategy, RequestSigner>emptyMap());
restClient.setEndpoint(endpoint);
return restClient;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ boolean isValid() {
Optional<RSAPublicKey> jwkRsa = AuthUtils.toPublicKeyFromJson(jwk);
if (jwkRsa.isPresent()
&& isEqualPublicKey(
jwkRsa.get(), sessionKeySupplier.getPublicKey())) {
jwkRsa.get(),
(RSAPublicKey)
sessionKeySupplier.getKeyPair().getPublic())) {

LOG.debug(
"Security token is still valid. Public key matches with the JWK.");
Expand Down
Loading