Skip to content

Commit bdf47fb

Browse files
committed
Make path to oslcOAuthStore.xml configurable via ENV var.
1 parent fe040a5 commit bdf47fb

File tree

4 files changed

+32
-0
lines changed

4 files changed

+32
-0
lines changed

src/server-am/src/main/java/co/oslc/refimpl/am/gen/auth/AuthenticationApplication.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,15 @@ public class AuthenticationApplication implements Application {
7676
private AuthenticationApplication() {
7777
// Start of user code constructor_init
7878
// End of user code
79+
var AUTH_VAR = "OAUTH_STORE_FILE";
80+
final Map<String, String> env = System.getenv();
7981
oslcConsumerStoreFilename= "./oslcOAuthStore.xml";
82+
if (env.containsKey(AUTH_VAR)) {
83+
oslcConsumerStoreFilename = env.get(AUTH_VAR);
84+
log.debug("ENV variable '{}' found", AUTH_VAR);
85+
} else {
86+
log.debug("ENV variable '{}' not defined", AUTH_VAR);
87+
}
8088
oauth1TokenToApplicationConnector = new LRUCache<String, String>(2000);
8189
// Start of user code constructor_finalize
8290
// End of user code

src/server-cm/src/main/java/co/oslc/refimpl/cm/gen/auth/AuthenticationApplication.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,15 @@ public class AuthenticationApplication implements Application {
7676
private AuthenticationApplication() {
7777
// Start of user code constructor_init
7878
// End of user code
79+
var AUTH_VAR = "OAUTH_STORE_FILE";
80+
final Map<String, String> env = System.getenv();
7981
oslcConsumerStoreFilename= "./oslcOAuthStore.xml";
82+
if (env.containsKey(AUTH_VAR)) {
83+
oslcConsumerStoreFilename = env.get(AUTH_VAR);
84+
log.debug("ENV variable '{}' found", AUTH_VAR);
85+
} else {
86+
log.debug("ENV variable '{}' not defined", AUTH_VAR);
87+
}
8088
oauth1TokenToApplicationConnector = new LRUCache<String, String>(2000);
8189
// Start of user code constructor_finalize
8290
// End of user code

src/server-qm/src/main/java/co/oslc/refimpl/qm/gen/auth/AuthenticationApplication.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,15 @@ public class AuthenticationApplication implements Application {
7676
private AuthenticationApplication() {
7777
// Start of user code constructor_init
7878
// End of user code
79+
var AUTH_VAR = "OAUTH_STORE_FILE";
80+
final Map<String, String> env = System.getenv();
7981
oslcConsumerStoreFilename= "./oslcOAuthStore.xml";
82+
if (env.containsKey(AUTH_VAR)) {
83+
oslcConsumerStoreFilename = env.get(AUTH_VAR);
84+
log.debug("ENV variable '{}' found", AUTH_VAR);
85+
} else {
86+
log.debug("ENV variable '{}' not defined", AUTH_VAR);
87+
}
8088
oauth1TokenToApplicationConnector = new LRUCache<String, String>(2000);
8189
// Start of user code constructor_finalize
8290
// End of user code

src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/auth/AuthenticationApplication.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,15 @@ public class AuthenticationApplication implements Application {
7676
private AuthenticationApplication() {
7777
// Start of user code constructor_init
7878
// End of user code
79+
var AUTH_VAR = "OAUTH_STORE_FILE";
80+
final Map<String, String> env = System.getenv();
7981
oslcConsumerStoreFilename= "./oslcOAuthStore.xml";
82+
if (env.containsKey(AUTH_VAR)) {
83+
oslcConsumerStoreFilename = env.get(AUTH_VAR);
84+
log.debug("ENV variable '{}' found", AUTH_VAR);
85+
} else {
86+
log.debug("ENV variable '{}' not defined", AUTH_VAR);
87+
}
8088
oauth1TokenToApplicationConnector = new LRUCache<String, String>(2000);
8189
// Start of user code constructor_finalize
8290
// End of user code

0 commit comments

Comments
 (0)