Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-Reload for SecretsManager & ParameterStore property sources #536

Merged
merged 22 commits into from
Oct 19, 2022

Conversation

maciejwalkowiak
Copy link
Contributor

@maciejwalkowiak maciejwalkowiak commented Oct 14, 2022

Auto-reloading SecretsManager & ParameterStore property source inspired by Spring Cloud Kubernetes implementation.

Turned off by default.

TODO: tests for autoconfigurations, update samples & reference docs.

@github-actions github-actions bot added component: core Core functionality related issue component: secrets-manager Secrets Manager integration related issue labels Oct 14, 2022
@github-actions github-actions bot added the component: parameter-store Parameter Store integration related issue label Oct 14, 2022
@maciejwalkowiak maciejwalkowiak changed the title Auto-Reload for SecretsManager property source Auto-Reload for SecretsManager & ParameterStore property sources Oct 14, 2022
@NestedConfigurationProperty
private ReloadProperties reload = new ReloadProperties();

private boolean monitored;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this should be moved to ReloadProperties.

@maciejwalkowiak maciejwalkowiak marked this pull request as draft October 14, 2022 21:55
@github-actions github-actions bot added the type: documentation Documentation or Samples related issue label Oct 16, 2022
@maciejwalkowiak maciejwalkowiak marked this pull request as ready for review October 16, 2022 20:30
@maciejwalkowiak
Copy link
Contributor Author

@MatejNedic docs are pending but other than that ready for review. Depending on how goes with spring-cloud/spring-cloud-commons#1156 maybe there will be a space for improvements in the future.

@maciejwalkowiak maciejwalkowiak added this to the 3.0.0 M3 milestone Oct 16, 2022
@maciejwalkowiak maciejwalkowiak removed the component: core Core functionality related issue label Oct 16, 2022
@github-actions github-actions bot added the component: core Core functionality related issue label Oct 17, 2022
@maciejwalkowiak
Copy link
Contributor Author

@MatejNedic reference docs added.

@maciejwalkowiak
Copy link
Contributor Author

Fixes #377

Copy link
Member

@MatejNedic MatejNedic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.
I have left a few comments.

@@ -234,7 +324,8 @@ private static void putParameter(LocalStackContainer localstack, String paramete
}
}

@SpringBootApplication
@SpringBootConfiguration
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason for removing SpringBootApplication and replacing it with these 2 annotations?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To disable component scanning as it was picking up configuration classes declared in the same package in other tests.

@AutoConfigureAfter({ InfoEndpointAutoConfiguration.class, RefreshEndpointAutoConfiguration.class,
RefreshAutoConfiguration.class })
@ConditionalOnProperty(value = ParameterStoreProperties.CONFIG_PREFIX + ".reload.strategy")
public class ParameterStoreReloadAutoConfiguration {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ConditionalOnBean(ContextRefresher.class)

@maciejwalkowiak
Copy link
Contributor Author

@MatejNedic thanks for a review. Changes applied.

@sonarcloud
Copy link

sonarcloud bot commented Oct 19, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug C 2 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 1 Security Hotspot
Code Smell A 6 Code Smells

87.7% 87.7% Coverage
0.0% 0.0% Duplication

@maciejwalkowiak maciejwalkowiak merged commit 6a7eb27 into main Oct 19, 2022
@maciejwalkowiak maciejwalkowiak deleted the secretsmanager-reload branch October 19, 2022 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: core Core functionality related issue component: parameter-store Parameter Store integration related issue component: secrets-manager Secrets Manager integration related issue type: documentation Documentation or Samples related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants