-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: make version header to all endpoints accessible (#1422)
- Loading branch information
Showing
13 changed files
with
109 additions
and
72 deletions.
There are no files selected for viewing
21 changes: 0 additions & 21 deletions
21
...matievlaanderen/ldes/server/admin/rest/versioning/AdminVersionHeaderControllerAdvice.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...be/vlaanderen/informatievlaanderen/ldes/server/domain/versioning/VersionHeaderFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package be.vlaanderen.informatievlaanderen.ldes.server.domain.versioning; | ||
|
||
import jakarta.servlet.*; | ||
import jakarta.servlet.http.HttpServletResponse; | ||
|
||
import java.io.IOException; | ||
|
||
public class VersionHeaderFilter implements Filter { | ||
private static final String APP_VERSION_HEADER_KEY = "X-App-Version"; | ||
private final String appVersion; | ||
|
||
public VersionHeaderFilter(String appVersion) { | ||
this.appVersion = appVersion; | ||
} | ||
|
||
@Override | ||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { | ||
if (response instanceof HttpServletResponse httpResponse) { | ||
httpResponse.setHeader(APP_VERSION_HEADER_KEY, appVersion); | ||
} | ||
chain.doFilter(request, response); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...anderen/informatievlaanderen/ldes/server/domain/versioning/VersionHeaderFilterConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package be.vlaanderen.informatievlaanderen.ldes.server.domain.versioning; | ||
|
||
import org.springframework.boot.info.BuildProperties; | ||
import org.springframework.boot.web.servlet.FilterRegistrationBean; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
public class VersionHeaderFilterConfig { | ||
|
||
@Bean | ||
public FilterRegistrationBean<VersionHeaderFilter> registerVersionHeaderFilter(BuildProperties buildProperties) { | ||
FilterRegistrationBean<VersionHeaderFilter> filterRegistrationBean = new FilterRegistrationBean<>(); | ||
filterRegistrationBean.setFilter(new VersionHeaderFilter(buildProperties.getVersion())); | ||
filterRegistrationBean.addUrlPatterns("/*"); | ||
return filterRegistrationBean; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 0 additions & 21 deletions
21
...deren/informatievlaanderen/ldes/server/rest/versioning/VersionHeaderControllerAdvice.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
...-postgres/postgres-pagination-repository/src/test/resources/application-postgres-test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
spring: | ||
liquibase: | ||
change-log: classpath:/db/changelog/master.xml | ||
change-log: classpath:/db/changelog/master.xml | ||
zonky: | ||
test: | ||
database: | ||
postgres: | ||
docker: | ||
image: postgres:14-alpine |
Oops, something went wrong.