@@ -37,7 +37,7 @@ public enum DeploymentType implements Function<Settings, Optional<AuthorizationP
37
37
* Usage: Choose this deployment type when your software solutions are hosted and managed within your organization's physical infrastructure.
38
38
* - Authentication: Uses username and password for access.
39
39
* - Configuration: Requires USER (username) and PASSWORD (password).
40
- * If not provided, it falls back to default values or empty credentials.
40
+ * If not provided, it falls back to default values or empty credentials.
41
41
*/
42
42
ON_PREMISES {
43
43
@ Override
@@ -47,7 +47,7 @@ public Optional<AuthorizationProvider> apply(Settings settings) {
47
47
String password = settings .get (List .of (OracleNoSQLConfigurations .PASSWORD .get (), Configurations .PASSWORD .get ()))
48
48
.map (Object ::toString ).orElse (null );
49
49
if (user != null && password != null ) {
50
- return Optional .of (new StoreAccessTokenProvider (user , password .toCharArray ()));
50
+ return Optional .of (new StoreAccessTokenProvider (user , password .toCharArray ()));
51
51
} else {
52
52
return Optional .of (new StoreAccessTokenProvider ());
53
53
}
@@ -67,18 +67,18 @@ public Optional<AuthorizationProvider> apply(Settings settings) {
67
67
char [] password = settings .get (List .of (OracleNoSQLConfigurations .PASSWORD .get (), Configurations .PASSWORD .get ()))
68
68
.map (Object ::toString ).map (String ::toCharArray ).orElse (new char [0 ]);
69
69
String tenantId = settings .get (OracleNoSQLConfigurations .TENANT , String .class ).orElse (null );
70
- String fingerprint = settings .get (OracleNoSQLConfigurations .FINGERPRINT , String .class ).orElse (null );
70
+ String fingerprint = settings .get (OracleNoSQLConfigurations .FINGERPRINT , String .class ).orElse (null );
71
71
String privateKey = settings .get (OracleNoSQLConfigurations .PRIVATE_KEY , String .class ).orElse (null );
72
72
String profileName = settings .get (OracleNoSQLConfigurations .PROFILE_NAME , String .class ).orElse (null );
73
73
String configFile = settings .get (OracleNoSQLConfigurations .CONFIG_FILE , String .class ).orElse (null );
74
74
75
- if (user != null && tenantId != null && fingerprint != null && privateKey != null ) {
75
+ if (user != null && tenantId != null && fingerprint != null && privateKey != null ) {
76
76
return Optional .of (new SignatureProvider (tenantId , user , fingerprint , new File (privateKey ), password ));
77
77
}
78
78
try {
79
- if (profileName != null && configFile != null ) {
79
+ if (profileName != null && configFile != null ) {
80
80
return Optional .of (new SignatureProvider (configFile , profileName ));
81
- } else if (profileName != null ) {
81
+ } else if (profileName != null ) {
82
82
return Optional .of (new SignatureProvider (profileName ));
83
83
}
84
84
return Optional .of (new SignatureProvider ());
@@ -125,14 +125,24 @@ public Optional<AuthorizationProvider> apply(Settings settings) {
125
125
126
126
String profileName = settings .get (OracleNoSQLConfigurations .PROFILE_NAME , String .class ).orElse (null );
127
127
String configFile = settings .get (OracleNoSQLConfigurations .CONFIG_FILE , String .class ).orElse (null );
128
- if (profileName != null && configFile != null ) {
128
+ if (profileName != null && configFile != null ) {
129
129
return Optional .of (SignatureProvider .createWithSessionToken (configFile , profileName ));
130
- } else if (profileName != null ) {
130
+ } else if (profileName != null ) {
131
131
return Optional .of (SignatureProvider .createWithSessionToken (profileName ));
132
- } else {
132
+ } else {
133
133
return Optional .of (SignatureProvider .createWithSessionToken ());
134
134
}
135
135
}
136
+ },
137
+
138
+ /**
139
+ * Represents a "Cloud" deployment using OKE workload identity for authentication and authorization.
140
+ */
141
+ CLOUD_OKE_WORKLOAD_IDENTITY {
142
+ @ Override
143
+ public Optional <AuthorizationProvider > apply (Settings settings ) {
144
+ return Optional .of (SignatureProvider .createWithOkeWorkloadIdentity ());
145
+ }
136
146
};
137
147
138
148
@@ -142,12 +152,11 @@ public Optional<AuthorizationProvider> apply(Settings settings) {
142
152
*
143
153
* @param value the string representation of the deployment type (case-insensitive)
144
154
* @return the corresponding {@link DeploymentType} enum value, or {@link DeploymentType#ON_PREMISES}
145
- * if the input is invalid or null
146
- *
155
+ * if the input is invalid or null
147
156
*/
148
157
public static DeploymentType parse (String value ) {
149
158
try {
150
- if (value == null ) {
159
+ if (value == null ) {
151
160
return DeploymentType .ON_PREMISES ;
152
161
}
153
162
return DeploymentType .valueOf (value .toUpperCase ());
0 commit comments