Skip to content

Commit

Permalink
Get hubId from backends config service (#10 #41).
Browse files Browse the repository at this point in the history
  • Loading branch information
chenkins committed Jan 10, 2024
1 parent 363ae87 commit 50d7781
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ public class BackendsConfigResource {
public BackendsConfigDto getBackendsConfig() {
return new BackendsConfigDto(Settings.get().hubId, backendsConfig.backends().stream()
// TODO https://github.com/chenkins/cipherduck-hub/issues/41 hard-coded cryptomatorvaults
.map(b -> new StorageConfigDto(b, new VaultJWEBackendDto(b.jwe(), cipherduckConfig.authEndpoint(), cipherduckConfig.tokenEndpoint(), cipherduckConfig.keycloakClientIdCryptomator(), "cryptomatorvaults")))
.map(b -> new StorageConfigDto(b, new VaultJWEBackendDto(b.jwe(),
cipherduckConfig.authEndpoint(),
cipherduckConfig.tokenEndpoint(),
cipherduckConfig.keycloakClientIdCryptomator(),
"cryptomatorvaults",
Settings.get().hubId
)))
.collect(Collectors.toList()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public record VaultJWEBackendDto(
Optional<String> password) implements VaultJWEBackend {


public VaultJWEBackendDto(VaultJWEBackend s, final String oAuthAuthorizationUrl, final String oAuthTokenUrl, final String oAuthClientId, final String oAuthTokenExchangeAudience) {
public VaultJWEBackendDto(VaultJWEBackend s, final String oAuthAuthorizationUrl, final String oAuthTokenUrl, final String oAuthClientId, final String oAuthTokenExchangeAudience, final String hubId) {
this(s.authorization(),
s.oauthRedirectUrl(),
s.usernameConfigurable(),
Expand All @@ -94,7 +94,7 @@ public VaultJWEBackendDto(VaultJWEBackend s, final String oAuthAuthorizationUrl,
s.stsRoleArn(),
s.stsRoleArn2(),
s.stsDurationSeconds(),
s.parentUUID(),
Optional.of(hubId),
Optional.of(oAuthTokenExchangeAudience),
s.username(),
s.password());
Expand Down
1 change: 0 additions & 1 deletion frontend/src/components/CreateVaultS3.vue
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,6 @@ async function createVault() {
config["jwe"]["defaultPath"] = config["bucketPrefix"] + vaultId;
config["jwe"]["uuid"] = vaultId;
config["jwe"]["parentUUID"] = hubId;
config["jwe"]["nickname"] = vaultName.value;
if(isPermanent.value){
Expand Down

0 comments on commit 50d7781

Please sign in to comment.