Search in sources :

Example 1 with YamlPropertySourceLoader

use of io.micronaut.context.env.yaml.YamlPropertySourceLoader in project micronaut-gcp by micronaut-projects.

the class LocalFileResourceLoader method main.

public static void main(String[] args) {
    YamlPropertySourceLoader loader = new YamlPropertySourceLoader();
    try {
        String contents = LocalFileResourceLoader.loadSecret("first-gcp-project", "application");
        AccessSecretVersionResponse response = AccessSecretVersionResponse.newBuilder().setName("foo").setPayload(SecretPayload.newBuilder().setData(ByteString.copyFrom(contents.getBytes())).build()).build();
        loader.read("foo", contents.getBytes());
        loader.read("foo", response.getPayload().getData().toByteArray());
    } catch (IOException e) {
        e.printStackTrace();
    }
}
Also used : YamlPropertySourceLoader(io.micronaut.context.env.yaml.YamlPropertySourceLoader) ByteString(com.google.protobuf.ByteString) IOException(java.io.IOException) AccessSecretVersionResponse(com.google.cloud.secretmanager.v1.AccessSecretVersionResponse)

Aggregations

AccessSecretVersionResponse (com.google.cloud.secretmanager.v1.AccessSecretVersionResponse)1 ByteString (com.google.protobuf.ByteString)1 YamlPropertySourceLoader (io.micronaut.context.env.yaml.YamlPropertySourceLoader)1 IOException (java.io.IOException)1