Skip to content

Commit f457f8e

Browse files
stache3000purejava
authored andcommitted
Add 2 environments variables to set the EU servers URLs (api.bitwarden.eu & identiy.bitwarden.eu)
1 parent a16abc4 commit f457f8e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/main/java/org/purejava/integrations/keychain/BitwardenAccess.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,20 @@ public class BitwardenAccess implements KeychainAccessProvider {
2727
private final String apiUrl = "https://api.bitwarden.com";
2828
private final String identityUrl = "https://identity.bitwarden.com";
2929
private final String APP_NAME = "Cryptomator";
30+
private final String envApiUrl;
31+
private final String envIdentityUrl;
3032

3133
public BitwardenAccess() {
3234
this.accessToken = System.getenv("BITWARDEN_ACCESS_TOKEN");
3335
this.boID = System.getenv("BITWARDEN_ORGANIZATION_ID");
3436
this.stateFile = System.getenv("BITWARDEN_STATE_FILE");
37+
this.envApiUrl = System.getenv("BITWARDEN_API_URL");
38+
this.envIdentityUrl = System.getenv("BITWARDEN_IDENTITY_URL");
39+
40+
if (isEnvVarValid(envApiUrl) && isEnvVarValid(envIdentityUrl)) {
41+
this.apiUrl = envApiUrl;
42+
this.identityUrl = envIdentityUrl;
43+
}
3544

3645
if (isEnvVarValid(accessToken) && isEnvVarValid(boID)) {
3746
try {

0 commit comments

Comments
 (0)