Skip to content

Commit

Permalink
Revert "Revert "Inject AsmSecretStore""
Browse files Browse the repository at this point in the history
  • Loading branch information
lesters authored Oct 1, 2024
1 parent 314f172 commit 208f7f2
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.model.container.xml;

import ai.vespa.secret.config.aws.AsmSecretConfig;
import com.yahoo.container.bundle.BundleInstantiationSpecification;
import com.yahoo.osgi.provider.model.ComponentModel;
import com.yahoo.vespa.model.container.component.SimpleComponent;

import java.net.URI;

/**
* @author lesters
*/
public class CloudAsmSecrets extends SimpleComponent implements AsmSecretConfig.Producer {

private static final String CLASS = "ai.vespa.secret.aws.AsmSecretStore";
private static final String BUNDLE = "jdisc-cloud-aws";

private final URI ztsUri;

public CloudAsmSecrets(URI ztsUri) {
super(new ComponentModel(BundleInstantiationSpecification.fromStrings(CLASS, CLASS, BUNDLE)));
this.ztsUri = ztsUri;
}

@Override
public void getConfig(AsmSecretConfig.Builder builder) {
builder.ztsUri(ztsUri.toString());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ private void addSecrets(ApplicationContainerCluster cluster, Element spec, Deplo
secretsConfig.addSecret(key, name, vault);
}
cluster.addComponent(secretsConfig);
cluster.addComponent(new CloudAsmSecrets(deployState.getProperties().ztsUrl()));
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

@ExportPackage
package ai.vespa.secret.config.aws;

import com.yahoo.osgi.annotation.ExportPackage;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Config for AsmSecretStore

package=ai.vespa.secret.aws
package=ai.vespa.secret.config.aws

ztsUri string
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package ai.vespa.secret.aws;

import ai.vespa.secret.config.aws.AsmSecretConfig;
import ai.vespa.secret.internal.TypedSecretStore;
import ai.vespa.secret.model.Key;
import ai.vespa.secret.model.Role;
Expand Down

0 comments on commit 208f7f2

Please sign in to comment.