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

Set gateway allowed headers and allowed methods in config template #377

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
121 changes: 120 additions & 1 deletion pkg/cc/config/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,23 @@ api:
console:
gateway:
listen_address: "0.0.0.0:8080"
allowed_headers:
- "Authorization"
- "Content-Type"
- "If-Match"
- "If-None-Match"
- "Depth"
allowed_methods:
- "GET"
- "POST"
- "HEAD"
- "DELETE"
- "PUT"
- "PATCH"
- "PROFIND"
- "MKCOL"
- "COPY"
- "MOVE"
Comment on lines +159 to +163
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't expose any endpoints that respond to these methods, do we? Why allow them by default?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I asked to expose ALL settings that are by default set by the service-host, as it is not clear what disappears when you set just one. Ideally service-host, would not set any defaults but only provide the means to set them, in which case the service needs to set/define what it needs based on its usage.

allowed_origins:
- http://localhost
- http://localhost:*
Expand Down Expand Up @@ -172,7 +189,24 @@ api:
tls_ca_cert_path: '${TOPAZ_CERTS_DIR}/grpc-ca.crt'
gateway:
listen_address: "0.0.0.0:9393"
# if not specified, the allowed_origins includes localhost by default
allowed_headers:
- "Authorization"
- "Content-Type"
- "If-Match"
- "If-None-Match"
- "Depth"
allowed_methods:
- "GET"
- "POST"
- "HEAD"
- "DELETE"
- "PUT"
- "PATCH"
- "PROFIND"
- "MKCOL"
- "COPY"
- "MOVE"
# if not specified, the allowed_origins includes localhost by default
allowed_origins:
- http://localhost
- http://localhost:*
Expand Down Expand Up @@ -200,6 +234,23 @@ api:
tls_ca_cert_path: '${TOPAZ_CERTS_DIR}/grpc-ca.crt'
gateway:
listen_address: "0.0.0.0:9393"
allowed_headers:
- "Authorization"
- "Content-Type"
- "If-Match"
- "If-None-Match"
- "Depth"
allowed_methods:
- "GET"
- "POST"
- "HEAD"
- "DELETE"
- "PUT"
- "PATCH"
- "PROFIND"
- "MKCOL"
- "COPY"
- "MOVE"
allowed_origins:
- http://localhost
- http://localhost:*
Expand All @@ -225,6 +276,23 @@ api:
tls_ca_cert_path: '${TOPAZ_CERTS_DIR}/grpc-ca.crt'
gateway:
listen_address: "0.0.0.0:9393"
allowed_headers:
- "Authorization"
- "Content-Type"
- "If-Match"
- "If-None-Match"
- "Depth"
allowed_methods:
- "GET"
- "POST"
- "HEAD"
- "DELETE"
- "PUT"
- "PATCH"
- "PROFIND"
- "MKCOL"
- "COPY"
- "MOVE"
allowed_origins:
- http://localhost
- http://localhost:*
Expand All @@ -250,6 +318,23 @@ api:
tls_ca_cert_path: '${TOPAZ_CERTS_DIR}/grpc-ca.crt'
gateway:
listen_address: "0.0.0.0:9393"
allowed_headers:
- "Authorization"
- "Content-Type"
- "If-Match"
- "If-None-Match"
- "Depth"
allowed_methods:
- "GET"
- "POST"
- "HEAD"
- "DELETE"
- "PUT"
- "PATCH"
- "PROFIND"
- "MKCOL"
- "COPY"
- "MOVE"
allowed_origins:
- http://localhost
- http://localhost:*
Expand All @@ -275,6 +360,23 @@ api:
tls_ca_cert_path: '${TOPAZ_CERTS_DIR}/grpc-ca.crt'
gateway:
listen_address: "0.0.0.0:9393"
allowed_headers:
- "Authorization"
- "Content-Type"
- "If-Match"
- "If-None-Match"
- "Depth"
allowed_methods:
- "GET"
- "POST"
- "HEAD"
- "DELETE"
- "PUT"
- "PATCH"
- "PROFIND"
- "MKCOL"
- "COPY"
- "MOVE"
allowed_origins:
- http://localhost
- http://localhost:*
Expand Down Expand Up @@ -304,6 +406,23 @@ api:
tls_ca_cert_path: '${TOPAZ_CERTS_DIR}/grpc-ca.crt'
gateway:
listen_address: "0.0.0.0:8383"
allowed_headers:
- "Authorization"
- "Content-Type"
- "If-Match"
- "If-None-Match"
- "Depth"
allowed_methods:
- "GET"
- "POST"
- "HEAD"
- "DELETE"
- "PUT"
- "PATCH"
- "PROFIND"
- "MKCOL"
- "COPY"
- "MOVE"
allowed_origins:
- http://localhost
- http://localhost:*
Expand Down