-
Notifications
You must be signed in to change notification settings - Fork 8
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
headers filters - custom service configuration should override default headers configuration (#120) #142
Conversation
Custom service header mappings not applied due to Spring Boot not correctly parsing `Service.headers: Optional<HeaderMappings>`. Apparently using `Optional` for `@ConfigurationProperties` is ok for scalars but not for nested objects. So a service header definitions like ``` datafeeder: target: ${georchestra.gateway.services.datafeeder.target} headers: json-user: true json-organization: true ``` Wouldn't get the json-user and json-organization request headers applied to downstream services.
Note the build failure:
is unrelated and seems to be there since a while ago |
yes we noticed it, we might just deactivate for now and revisit later (from what I investigated it fails because it relies on the console container output, so if something changes in the way the console is logging, then the test fails). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @groldan for completing the PR ! Looks good to me overall, I had just few comments reviewing it
gateway/src/main/java/org/georchestra/gateway/model/GeorchestraOrganizations.java
Show resolved
Hide resolved
gateway/src/main/java/org/georchestra/gateway/model/GeorchestraUsers.java
Show resolved
Hide resolved
gateway/src/main/java/org/georchestra/gateway/filter/global/ResolveTargetGlobalFilter.java
Show resolved
Hide resolved
...ain/java/org/georchestra/gateway/filter/headers/providers/JsonPayloadHeadersContributor.java
Show resolved
Hide resolved
Check the account creation onto the LDAP instead of parsing the console output.
added a commit to deactivate it. Reading the output, it seems that the issue is console-side. |
Note: with a console docker image compiled with georchestra/georchestra#4332 the test passes.
With georchestra/georchestra#4332 we could reactivate the test. |
Fixes #120
Fix custom service header mappings not being applied
Custom service header mappings not applied due to Spring Boot not correctly parsing
Service.headers: Optional<HeaderMappings>
.Apparently using
Optional
for@ConfigurationProperties
is ok for scalars but not for nested objects.So a service header definitions like
Wouldn't get the json-user and json-organization request headers applied to downstream services.