Skip to content

Commit

Permalink
complex secret id
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-skoblikov committed Feb 20, 2024
1 parent 5d77ec0 commit f14e630
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/
package io.cloudbeaver.model;

import org.jkiss.code.NotNull;
import org.jkiss.dbeaver.model.meta.Property;
import org.jkiss.dbeaver.model.secret.DBSSecretValue;

Expand All @@ -33,6 +34,10 @@ public String getDisplayName() {

@Property
public String getSecretId() {
return secretValue.getSubjectId();
return buildComplexSecretId(secretValue);
}

public static String buildComplexSecretId(@NotNull DBSSecretValue secretValue) {
return secretValue.getDisplayName() + "_" + secretValue.getSubjectId();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ public WebConnectionInfo initConnection(
}
DBSSecretValue selectedSecret =
allSecrets.stream()
.filter(secret -> selectedSecretId.equals(secret.getSubjectId()))
.filter(secret -> selectedSecretId.equals(WebSecretInfo.buildComplexSecretId(secret)))
.findFirst().orElse(null);
if (selectedSecret == null) {
throw new DBWebException("Secret not found:" + selectedSecretId);
Expand Down

0 comments on commit f14e630

Please sign in to comment.