Skip to content

Restrict wildcard pattern support for configuration files #21217

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

Closed
philwebb opened this issue Apr 28, 2020 · 6 comments
Closed

Restrict wildcard pattern support for configuration files #21217

philwebb opened this issue Apr 28, 2020 · 6 comments
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@philwebb
Copy link
Member

Issue #19909 has introduced a PathMatchingResourcePatternResolver to ConfigFileApplicationListener to support wildcard imports. We should consider if we still want to do this after we look at #19990.

We also need to address #21168 (comment)

@philwebb philwebb added for: team-meeting An issue we'd like to discuss as a team to make progress status: waiting-for-triage An issue we've not yet triaged labels Apr 28, 2020
@philwebb philwebb added this to the 2.3.x milestone Apr 28, 2020
@wilkinsona wilkinsona added for: team-attention An issue we'd like other members of the team to review and removed for: team-meeting An issue we'd like to discuss as a team to make progress labels Apr 29, 2020
@wilkinsona wilkinsona modified the milestones: 2.3.x, 2.3.0, 2.3.0.RC1 Apr 29, 2020
@mbhave mbhave changed the title Consider if we really want to scan paths to find application config Restrict wildcard pattern support for configuration files Apr 30, 2020
@mbhave mbhave removed for: team-attention An issue we'd like other members of the team to review status: waiting-for-triage An issue we've not yet triaged labels Apr 30, 2020
@mbhave mbhave closed this as completed in 8ec16bd Apr 30, 2020
@mbhave mbhave added the type: enhancement A general enhancement label Apr 30, 2020
@vkochnev
Copy link

vkochnev commented May 5, 2020

@philwebb, I can see that the team decided to restrict wildcards in spring.config.location. Have you discussed how my "shared configuration" case can be addressed?

@philwebb
Copy link
Member Author

philwebb commented May 5, 2020

@vkochnev I think I'd recommend looking into using the EnvironmentPostProcessor interface to add a property source that contains the values you need. The ConfigFileApplicationListener is really designed to pick up user configuration, I think it might be problematic to try and have it also pickup properties contributed by starters.

Other than the additional complexity, the main reason we didn't want to add classpath:* to the ConfigFileApplicationListener is ordering the files are processed is hard to determine. If two jars happen to provide application.properties files with the same value, it will be very difficult to know which will win. That might not be a problem in your situation, but we've found those ordering issues to be very problematic for users and a common source of bugs.

@philwebb
Copy link
Member Author

philwebb commented May 5, 2020

Reopening to address 8ec16bd#commitcomment-38955589

@philwebb philwebb reopened this May 5, 2020
@philwebb philwebb self-assigned this May 5, 2020
@vkochnev
Copy link

vkochnev commented May 5, 2020

@philwebb thanks, I'll look into it. I understand the importance of ordering.

@mbhave
Copy link
Contributor

mbhave commented May 5, 2020

@philwebb I think we should create a new issue for #21217 (comment) since this one has already gone into RC1.

@philwebb
Copy link
Member Author

philwebb commented May 5, 2020

@mbhave Whoops, I missed that. I guess it's basically a polishing commit so I'll leave it on this issue.

@philwebb philwebb reopened this May 7, 2020
@philwebb philwebb closed this as completed May 7, 2020
philwebb added a commit that referenced this issue May 7, 2020
Remove the recently added slash restriction since Spring Cloud
Config Server needs to support names with slashes.

See gh-21217
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

4 participants