Skip to content
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

make cors configurable #418

Merged
merged 1 commit into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion changelog.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ and this project adheres to https://semver.org/spec/v2.0.0.html[semantic version
* https://github.com/PacoVK/tapir/issues/408[#408 - Add Azure containerapps example]
* https://github.com/PacoVK/tapir/issues/414[#414 - Introduce Elasticsearch authentication configuration]


=== changed

* https://github.com/PacoVK/tapir/issues/406[#406 - Make CORS configurable]

== 0.7.1

=== fixes
Expand Down
1 change: 1 addition & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ You can configure Tapir passing the following environment variables:
| AUTH_TOKEN_ATTRIBUTE_FAMILY_NAME | The attribute name in the token where the family name is placed in | X | family_name |
| AUTH_TOKEN_ATTRIBUTE_PREFERRED_USERNAME | The attribute name in the token where the preferred username is placed in | X | preferred_username |
| END_SESSION_PATH | IDP end session path, will be used to logout | X | /protocol/openid-connect/logout |
| CORS_ORIGINS | Configure CORS origins | X | * |

:information_source: A note on the GPG configuration. Quarkus (and therefore Tapir) is based on [Smallrye microprofile](https://smallrye.io/smallrye-config/2.9.1/config/indexed-properties/) and supports indexed properties. Hence, you can add one or more key specifying indexed properties. See example below for passing two GPG keys (**Mind the two subsequent underscores after the index**):
```
Expand Down
7 changes: 6 additions & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ registry:
password: ${TAPIR_ADMIN_PASSWORD:default}
hostname: ${REGISTRY_HOSTNAME:localhost}
port: ${REGISTRY_PORT:443}
cors:
origins: ${CORS_ORIGINS:*}
auth:
provider: ${AUTH_PROVIDER}
endpoint: ${AUTH_ENDPOINT:http://localhost:8089/realms/tapir}
Expand Down Expand Up @@ -140,7 +142,10 @@ quarkus:
allow-forwarded: true
enable-forwarded-host: ${registry.proxy.enabled}
forwarded-host-header: ${registry.proxy.forwarded-header}
cors: true
cors:
origins: ${registry.cors.origins}
methods: "*"
headers: "*"

"%dev":
registry:
Expand Down