Skip to content

Commit a2f600b

Browse files
committed
docs: ehance types of deploy
Signed-off-by: Otavio Santana <[email protected]>
1 parent 4007f65 commit a2f600b

File tree

1 file changed

+28
-1
lines changed
  • jnosql-nosql-oracle/src/main/java/org/eclipse/jnosql/databases/oracle/communication

1 file changed

+28
-1
lines changed

jnosql-nosql-oracle/src/main/java/org/eclipse/jnosql/databases/oracle/communication/DeploymentType.java

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import org.eclipse.jnosql.communication.Configurations;
2121
import org.eclipse.jnosql.communication.Settings;
2222

23+
import java.io.File;
2324
import java.io.IOException;
2425
import java.util.List;
2526
import java.util.Optional;
@@ -69,14 +70,40 @@ public Optional<AuthorizationProvider> apply(Settings settings) {
6970
if(user != null && password.length > 0 && tenantId != null && fingerprint != null && privateKey != null) {
7071
return Optional.of(new SignatureProvider(tenantId, user, fingerprint, privateKey, password));
7172
}
72-
7373
try {
7474
return Optional.of(new SignatureProvider());
7575
} catch (IOException e) {
7676
throw new OracleNoSQLException("Error to load configuration to Oracle Cloud at Oracle NoSQL", e);
7777
}
7878

7979
}
80+
},
81+
/**
82+
* Represents a "Cloud" deployment using resource principal for authentication and authorization.
83+
*/
84+
CLOUD_INSTANCE_PRINCIPAL {
85+
@Override
86+
public Optional<AuthorizationProvider> apply(Settings settings) {
87+
return Optional.of(SignatureProvider.createWithInstancePrincipal());
88+
}
89+
},
90+
/**
91+
* Represents a "Cloud" deployment using resource principal for authentication and authorization.
92+
*/
93+
CLOUD_RESOURCE_PRINCIPAL {
94+
@Override
95+
public Optional<AuthorizationProvider> apply(Settings settings) {
96+
return Optional.of(SignatureProvider.createWithResourcePrincipal());
97+
}
98+
},
99+
/**
100+
* Represents a "Cloud" deployment using instance principal for delegation with an OBO token.
101+
*/
102+
CLOUD_INSTANCE_OBO_USER {
103+
@Override
104+
public Optional<AuthorizationProvider> apply(Settings settings) {
105+
return Optional.of(SignatureProvider.createWithInstancePrincipalForDelegation(new File(System.getenv("OCI_obo_token_path"))));
106+
}
80107
};
81108

82109

0 commit comments

Comments
 (0)