Fail to hande event LeaseListener when using spring config import
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
Research direction
Start with CustomLeasingHandlerConfig, SecretLeaseContainer, and SecretLeaseEventPublisher, then reproduce the behavior using bootstrap.yml and the shown spring.config.import entries. Compare the specific vault://s3/... and vault://secret/... imports with vault://; done means a listener registered on SecretLeaseContainer receives lease events while the specific secret engines remain configured.
Written by the indexing model from the issue text.
Description
Describe the bug
I cannot subscribe to a event LeaseListener from SecretLeaseContainer since Im loading vault properties with spring cloud config.
When Spring cloud vault emit the event about lease, my handler is not executed, the listeners of the class SecretLeaseEventPublisher does not contains my subscription.
Spring boot : 2.6.7
Spring Cloud : 2021.0.1
I have added the dependency spring-cloud-starter-bootstrap, and i use bootstrap.yml file for spring cloud vault configuration
Sample
The class with the subscription
@Slf4j
@Configuration
public class CustomLeasingHandlerConfig {
@Autowired
private SecretLeaseContainer leaseContainer;
@PostConstruct
private void postConstruct() {
leaseContainer.addLeaseListener( (event) -> {
log.info("Event lease listener source : {} and event class : {}",event.getSource(), event.getClass());
});
}
This does not work (my listener is never executed)
The application configuration
spring:
config:
import:
- vault://s3/3000922?prefix=s.
- vault://secret/app/dev/test
If I remove this configuration, i don't have any problems.
For example, this is working but i couldn't add specific vault secret engine as the last configuration :
The application configuration
spring:
config:
import:
- vault://
Is the spring config compatible with spring cloud vault module about the management of SecretLeaseContainer and listeners?
It's like if i couldn't use the same secretleasecontainer in my config and spring cloud Config
- Dominant language
- Java
- Stars
- 291
- Forks
- 152
- Avg merge
- 11h 24m
- Merged PRs (30d)
- 3
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from spring-cloud/spring-cloud-vault
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
spring-cloud/spring-cloud-vault#958 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
spring-cloud/spring-cloud-vault#940 · 1 reaction ·
All issues in spring-cloud/spring-cloud-vault
Similar issues
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
inu-appcenter/memorIN-backend#288 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
frontend maui-pilot pilot-ask question
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
area/plugin
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
kestra-io/plugin-kestra#190 ·