Skip to content

Commit

Permalink
Releasing version 1.3.0
Browse files Browse the repository at this point in the history
Releasing version 1.3.0
  • Loading branch information
dshelbyo authored Nov 1, 2018
2 parents a580a62 + 862eaca commit 21b957b
Show file tree
Hide file tree
Showing 135 changed files with 2,822 additions and 575 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,24 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
### Added
- N/A

## 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.
- Support for tagging of File Systems, Mount Targets, and Snapshots in the File Storage service.
- Support for nested compartments in the Identity service
- The region can be passed in via `SimpleAuthenticationDetailsProvider` and from config file using `ConfigFileAuthenticationDetailsProvider`

### Changed
- Passphrases are now passed as `char[]` instead of as `String`
- Optional headers that, when present, have to be signed are now included in the signature
- Attempts to parse the body only for responses that have Content-Type set to application/json; otherwise, it bails out and raises a generic `BmcException`

### Deprecated
- Methods accepting passphrases as `String` are deprecated; use `char[]` instead

### Notes
- The version is bumped to 1.3.0 due to breaking changes in previous release.

## 1.2.49 - 2018-10-18
### Added
- Support for cost tracking tags in the Identity 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.2.49</version>
<version>1.3.0</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.2.49</version>
<version>1.3.0</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.2.49</version>
<version>1.3.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
5 changes: 3 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.2.49</version>
<version>1.3.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand All @@ -14,11 +14,12 @@
<description>This project contains the SDK used for Oracle Cloud Infrastructure Audit Service</description>
<url>https://docs.us-phoenix-1.oraclecloud.com/Content/API/SDKDocs/javasdk.htm</url>


<dependencies>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-common</artifactId>
<version>1.2.49</version>
<version>1.3.0</version>
</dependency>
</dependencies>

Expand Down
2 changes: 1 addition & 1 deletion bmc-audit/src/main/java/com/oracle/bmc/audit/Audit.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public interface Audit extends AutoCloseable {
* {@link #setRegion(Region) setRegion}.
* <p>
* If no known Region could be determined, it will create an endpoint based on the
* default endpoint format ({@link Region#formatDefaultRegionEndpoint(Service, String)}
* default endpoint format ({@link com.oracle.bmc.Region#formatDefaultRegionEndpoint(Service, String)}
* and then call {@link #setEndpoint(String) setEndpoint}.
* @param regionId The public region ID.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public interface AuditAsync extends AutoCloseable {
* {@link #setRegion(Region) setRegion}.
* <p>
* If no known Region could be determined, it will create an endpoint based on the
* default endpoint format ({@link Region#formatDefaultRegionEndpoint(Service, String)}
* default endpoint format ({@link com.oracle.bmc.Region#formatDefaultRegionEndpoint(Service, String)}
* and then call {@link #setEndpoint(String) setEndpoint}.
* @param regionId The public region ID.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public static Builder builder() {

/**
* Builder class for this client. The "authenticationDetailsProvider" is required and must be passed to the
* {@link #build(AbstractAuthenticationDetailsProvider)} or {@link #buildAsync(AbstractAuthenticationDetailsProvider)} method.
* {@link #build(AbstractAuthenticationDetailsProvider)} method.
*/
public static class Builder
extends com.oracle.bmc.common.RegionalClientBuilder<Builder, AuditAsyncClient> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public static Builder builder() {

/**
* Builder class for this client. The "authenticationDetailsProvider" is required and must be passed to the
* {@link #build(AbstractAuthenticationDetailsProvider)} or {@link #buildAsync(AbstractAuthenticationDetailsProvider)} method.
* {@link #build(AbstractAuthenticationDetailsProvider)} method.
*/
public static class Builder
extends com.oracle.bmc.common.RegionalClientBuilder<Builder, AuditClient> {
Expand Down
32 changes: 16 additions & 16 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.2.49</version>
<version>1.3.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>oci-java-sdk-bom</artifactId>
Expand All @@ -19,88 +19,88 @@
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-common</artifactId>
<version>1.2.49</version>
<version>1.3.0</version>
<optional>false</optional>
</dependency>
<!-- Service modules, alpha sorted -->
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-audit</artifactId>
<version>1.2.49</version>
<version>1.3.0</version>
<optional>false</optional>
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-containerengine</artifactId>
<version>1.2.49</version>
<version>1.3.0</version>
<optional>false</optional>
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-core</artifactId>
<version>1.2.49</version>
<version>1.3.0</version>
<optional>false</optional>
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-database</artifactId>
<version>1.2.49</version>
<version>1.3.0</version>
<optional>false</optional>
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-dns</artifactId>
<version>1.2.49</version>
<version>1.3.0</version>
<optional>false</optional>
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-email</artifactId>
<version>1.2.49</version>
<version>1.3.0</version>
<optional>false</optional>
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-filestorage</artifactId>
<version>1.2.49</version>
<version>1.3.0</version>
<optional>false</optional>
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-identity</artifactId>
<version>1.2.49</version>
<version>1.3.0</version>
<optional>false</optional>
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-loadbalancer</artifactId>
<version>1.2.49</version>
<version>1.3.0</version>
<optional>false</optional>
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-objectstorage</artifactId>
<version>1.2.49</version>
<version>1.3.0</version>
<optional>false</optional>
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-resourcesearch</artifactId>
<optional>false</optional>
<version>1.2.49</version>
<version>1.3.0</version>
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<optional>false</optional>
<artifactId>oci-java-sdk-addons-apache</artifactId>
<version>1.2.49</version>
<version>1.3.0</version>
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-keymanagement</artifactId>
<version>1.2.49</version>
<version>1.3.0</version>
<optional>false</optional>
</dependency>
</dependencies>
</dependencyManagement>
</project>
</project>
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.2.49</version>
<version>1.3.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ public InputStream getPrivateKey() {
return new ByteArrayInputStream(sessionKeySupplier.getPrivateKeyBytes());
}

@Override
@Deprecated
@Override
public String getPassPhrase() {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,20 @@
import com.google.common.base.Preconditions;
import com.google.common.base.Supplier;
import com.oracle.bmc.ConfigFileReader;
import com.oracle.bmc.Region;
import com.oracle.bmc.ConfigFileReader.ConfigFile;

import lombok.ToString;
import lombok.extern.slf4j.Slf4j;

/**
* Implementation of {@link AuthenticationDetailsProvider} that uses a standard
* OCI configuration file as an input.
*/
@ToString
public class ConfigFileAuthenticationDetailsProvider implements AuthenticationDetailsProvider {
@Slf4j
public class ConfigFileAuthenticationDetailsProvider
implements AuthenticationDetailsProvider, RegionProvider {

private final SimpleAuthenticationDetailsProvider delegate;

Expand Down Expand Up @@ -72,12 +76,29 @@ public ConfigFileAuthenticationDetailsProvider(ConfigFile configFile) {

Supplier<InputStream> privateKeySupplier = new SimplePrivateKeySupplier(pemFilePath);

// region is optional, for backwards compatibility, if region is not known, log an error and continue.
// the same file may be used by other tools, where the region can be a newly launched region value
// that is not supported by the SDK yet.
Region region = null;
String regionId = configFile.get("region");
if (regionId != null) {
try {
region = Region.fromRegionId(regionId);
} catch (IllegalArgumentException e) {
LOG.warn(
"Found regionId '{}' in config file, but not supported by this version of the SDK, continuing without region",
regionId,
e);
}
}

SimpleAuthenticationDetailsProvider.SimpleAuthenticationDetailsProviderBuilder builder =
SimpleAuthenticationDetailsProvider.builder()
.fingerprint(fingerprint)
.privateKeySupplier(privateKeySupplier)
.tenantId(tenantId)
.userId(userId);
.userId(userId)
.region(region);
if (passPhrase != null) {
builder = builder.passphraseCharacters(passPhrase.toCharArray());
}
Expand Down Expand Up @@ -119,4 +140,9 @@ public InputStream getPrivateKey() {
public String getKeyId() {
return this.delegate.getKeyId();
}

@Override
public Region getRegion() {
return this.delegate.getRegion();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
import com.oracle.bmc.Region;
import com.oracle.bmc.auth.internal.FederationClient;
import com.oracle.bmc.auth.internal.X509FederationClient;
import com.oracle.bmc.http.ClientConfigurator;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
Expand All @@ -19,11 +16,10 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashSet;
import java.util.Set;

/**
* Implementation of {@link BasicAuthenticationDetailsProvider} that integrates
* with service-to-service authentication endpoints to generate service tokens
* with instance principal authentication endpoints to generate service tokens
* used for actual signing.
* <p>
* Also uses {@link AuthCachingPolicy} to disable caching (as the values for signing requests
Expand All @@ -45,7 +41,7 @@ private InstancePrincipalsAuthenticationDetailsProvider(
}

/**
* Creates a new S2SAuthenticationDetailsProviderBuilder.
* Creates a new InstancePrincipalsAuthenticationDetailsProviderBuilder.
* @return A new builder instance.
*/
public static InstancePrincipalsAuthenticationDetailsProviderBuilder builder() {
Expand Down Expand Up @@ -88,7 +84,14 @@ public static class InstancePrincipalsAuthenticationDetailsProviderBuilder
*/
private static final String METADATA_SERVICE_BASE_URL = "http://169.254.169.254/opc/v1/";

/**
* The federation endpoint url.
*/
private String federationEndpoint;

/**
* The leaf certificate.
*/
private X509CertificateSupplier leafCertificateSupplier;

/**
Expand Down Expand Up @@ -142,7 +145,7 @@ public InstancePrincipalsAuthenticationDetailsProvider build() {
new URLBasedX509CertificateSupplier(
new URL(METADATA_SERVICE_BASE_URL + "identity/cert.pem"),
new URL(METADATA_SERVICE_BASE_URL + "identity/key.pem"),
null);
(char[]) null);
}

if (intermediateCertificateSuppliers == null) {
Expand All @@ -154,7 +157,7 @@ public InstancePrincipalsAuthenticationDetailsProvider build() {
METADATA_SERVICE_BASE_URL
+ "identity/intermediate.pem"),
null,
null));
(char[]) null));
}

SessionKeySupplier sessionKeySupplierToUse =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.nio.charset.StandardCharsets;

import com.google.common.base.Supplier;
import com.oracle.bmc.Region;

import lombok.Builder;
import lombok.Getter;
Expand All @@ -17,7 +18,7 @@
*/
@Builder
public class SimpleAuthenticationDetailsProvider extends CustomerAuthenticationDetailsProvider
implements AuthenticationDetailsProvider {
implements AuthenticationDetailsProvider, RegionProvider {
@Getter(onMethod = @__({@Override}))
private final String tenantId;

Expand All @@ -35,6 +36,9 @@ public class SimpleAuthenticationDetailsProvider extends CustomerAuthenticationD
*/
private final Supplier<InputStream> privateKeySupplier;

@Getter(onMethod = @__({@Override}))
private final Region region;

/**
* Get the input stream with the private key. Note that this stream may be read multiple times.
* @return input stream with private key
Expand Down
Loading

0 comments on commit 21b957b

Please sign in to comment.