Services providing allowedOrigins may make Gateway fail
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 92
- Forks
- 81
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 46
Description
Describe the bug
Original conversation: https://github.com/zowe/api-layer/pull/4718#discussion_r3673842302
with corsEnabled true in Gateway, there is nothing to prevent an error in Gateway if a service provides * as allowedOrigin.
It's relatively low risk since it's not recommended to set *, but Gateway under this scenario uses allowedOrigin instead of allowedOriginPattern.
Expected behavior
If the service provides * it should use allowedOriginPattern.
Contributor guide
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.
Research direction
Start by tracing the Gateway's CORS handling for service-provided allowedOrigin and allowedOriginPattern values. Reproduce the case where a service returns * with corsEnabled true, then verify that Gateway uses the pattern field and no longer fails.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, security
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100