GithubHelp home page GithubHelp logo

Comments (9)

ojecborec avatar ojecborec commented on June 25, 2024 1

Sorry for not replying earlier. I'm going to work on PR. Just need more time.

from spring-cloud-config.

ryanjbaxter avatar ryanjbaxter commented on June 25, 2024

So you are basically asking if no label is provided in the request and no default label is set via a property you don't want to supply a version in GetSecretValueRequest? What happens is label is null?

from spring-cloud-config.

ojecborec avatar ojecborec commented on June 25, 2024

What I'm asking for is when label is provided as part of request such as

GET /foo/test/foo-1.0.0 HTP/1.1

do not forward that label to AWS Secrets Manager

.versionStage(label)

Whether it is going to be configurable or by extending the repository class.

from spring-cloud-config.

ryanjbaxter avatar ryanjbaxter commented on June 25, 2024

I am not sure why you would supply a label and not want to use it...

But you should be able to provide and use your own AwsSecretsManagerEnvironmentRepository

from spring-cloud-config.

ojecborec avatar ojecborec commented on June 25, 2024

The way AwsSecretsManagerEnvironmentRepository is created at the moment is by calling AwsSecretsManagerEnvironmentRepositoryFactory.build() method which has hardcoded

return new AwsSecretsManagerEnvironmentRepository(...)

This method depends on AwsClientBuilderConfigurer.configureClientBuilder(...) static method as well which is not visible outside of org.springframework.cloud.config.server.environment package.

So in order to do what you're suggesting (if I want to leverage existing process) I need to

  1. Make a copy of AwsClientBuilderConfigurer.
  2. Make a copy of AwsSecretsManagerEnvironmentRepositoryFactory. Use copy of AwsClientBuilderConfigurer. Change new AwsSecretsManagerEnvironmentRepository to new FooAwsSecretsManagerEnvironmentRepository.
  3. Make a copy of AwsSecretsManagerEnvironmentRepository and delete .versionStage(label).

This is not ideal and I'm looking for better option.

The reason why I supply label is that I want to use it when reading properties from Git repository but want to ignore it when reading secrets from Secrets Manager as

  1. I'm only interested in valid / up-to-date secrets such as database passwords etc. When rolling back my application from version 2.0 to previous version 1.0 it makes no sense to use password labeled as 1.0 which is not valid anymore (because it has changed since then due to rotation etc).
  2. Limitation of AWS Secrets Manager. Having 100 applications each one deployed with a different version I'm able to create as many Git tags as required. However when labeling global secrets such as /secret/application/ I'm limited to 20 labels.

from spring-cloud-config.

ryanjbaxter avatar ryanjbaxter commented on June 25, 2024

AwsSecretsManagerEnvironmentRepositoryFactory should only be used if there isn't already a bean of type AwsSecretsManagerEnvironmentRespository
https://github.com/spring-cloud/spring-cloud-config/blob/4.0.x/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/config/EnvironmentRepositoryConfiguration.java#L444

If you create your own bean of type AwsSecretsManagerEnvironmentRespository you should be able to customize it how you please.

If you want to make things easier, any PRs would be welcome to enhance the code.

from spring-cloud-config.

spring-cloud-issues avatar spring-cloud-issues commented on June 25, 2024

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

from spring-cloud-config.

ojecborec avatar ojecborec commented on June 25, 2024

Let me know what do you this of this idea #2357.

from spring-cloud-config.

ojecborec avatar ojecborec commented on June 25, 2024

Closing due to #2358.

from spring-cloud-config.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.