-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat(gateway): add WebSocket and gRPC protocol processors #88
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
Merged
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
ac5a682
docs(config): document allowed_origins and websocket.idle_timeout_sec…
OliverWolffGIP fee2b91
docs(architecture): add gRPC trailers-only rejection mapping and WS/g…
OliverWolffGIP f96ee67
docs: add WS/gRPC ADRs, plan-05 rationale, LogRecords, and README sweep
OliverWolffGIP c7bb534
refactor(edge): remove orphaned JAX-RS GatewayExceptionMapper
OliverWolffGIP 66605a1
docs(plan): record verify-green-while-errored finding (build-wrapper,…
OliverWolffGIP 84be633
feat(integration-tests): in-repo Quarkus gRPC echo upstream (delivera…
OliverWolffGIP 76ad275
test(integration-tests): unit-test the gRPC echo service (deliverable 9)
OliverWolffGIP 223a51c
feat(gateway): add WebSocket configuration model and fail-closed vali…
OliverWolffGIP 6b371b9
feat(gateway): serve WebSocket routes with opaque relay and Origin gate
OliverWolffGIP 0c368d5
feat(gateway): add gRPC ProtocolProcessor with forced-h2 upstream, tr…
OliverWolffGIP d8ee7e6
docs(user): add operator guide for WebSocket and gRPC protocol routes
OliverWolffGIP 21eeaa5
docs(development): add contributor guide for the ProtocolProcessor SP…
OliverWolffGIP 800595d
test(integration-tests): WebSocket proxy IT + test routes (deliverabl…
OliverWolffGIP dabcc44
test(integration-tests): gRPC proxy IT + test routes (deliverable 11)
OliverWolffGIP 675d76b
test(integration-tests): rework gRPC routes to bare-service-path mode…
OliverWolffGIP e7b7b7d
test(integration-tests): give the bearer gRPC route a distinct Secure…
OliverWolffGIP 3ac1254
feat(benchmarks): add k6 WebSocket + gRPC aspects and APISIX parity r…
OliverWolffGIP 95da672
test(benchmarks): assert ws + grpc aspects render in the comparison s…
OliverWolffGIP 212c985
fix(integration-tests): skip javadoc jar for IT coordinator (delivera…
OliverWolffGIP fd49487
style: apply OpenRewrite pre-commit auto-fixes to plan-authored WS/gR…
OliverWolffGIP 4ccbd8a
fix(integration-tests): give WS/gRPC endpoints a resolvable public au…
OliverWolffGIP d05cc76
fix(config): exempt gRPC routes from anchor-namespace containment
OliverWolffGIP cb4b0f9
fix(review): apply PR #88 review and sonar triage fixes
OliverWolffGIP cd3cc6f
fix(gateway): preserve stage-0 security headers on WebSocket handshak…
OliverWolffGIP f0206e3
fix(integration-tests): scope log chmod 0777 to a dedicated subdirectory
OliverWolffGIP 195a2ec
chore(simplify): hoist RouteTable locals in RouteRuntimeAssemblerTest
OliverWolffGIP fbf4cdf
fix(gateway): honor route upstream.path in forward-URI reconstruction
OliverWolffGIP 535244a
fix(review): apply round-2 review and sonar triage fixes
OliverWolffGIP File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
55 changes: 55 additions & 0 deletions
55
api-sheriff/src/main/java/de/cuioss/sheriff/api/config/model/WebSocketConfig.java
This file contains hidden or 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,55 @@ | ||
| /* | ||
| * Copyright © 2022 CUI-OpenSource-Software (info@cuioss.de) | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package de.cuioss.sheriff.api.config.model; | ||
|
|
||
| import java.util.List; | ||
| import java.util.Objects; | ||
| import java.util.Optional; | ||
|
|
||
| import lombok.Builder; | ||
|
|
||
| /** | ||
| * The per-route {@code websocket} block carried by a {@code protocol: websocket} | ||
| * route. | ||
| * <p> | ||
| * {@code allowedOrigins} is a fail-closed, deny-by-default allowlist of exact-match | ||
| * {@code Origin} strings (scheme + host + port, no wildcards); an absent or empty | ||
| * allowlist on a bearer WebSocket route rejects the upgrade at boot — there is no | ||
| * "any origin" default. Host matching is case-insensitive; the effective allowlist | ||
| * is lower-cased once, at route-table assembly. {@code idleTimeoutSeconds} bounds an | ||
| * established relay ("idle" = no frame in either direction, ping/pong counting as | ||
| * activity); it defaults to {@code 300} when absent, applied at resolution. | ||
| * | ||
| * @param allowedOrigins the exact-match, case-insensitive-host origin allowlist, | ||
| * empty when none is declared | ||
| * @param idleTimeoutSeconds the per-route idle timeout in seconds, empty when the | ||
| * default applies | ||
| * @author API Sheriff Team | ||
| * @since 1.0 | ||
| */ | ||
| @Builder | ||
| public record WebSocketConfig(List<String> allowedOrigins, Optional<Integer> idleTimeoutSeconds) { | ||
|
|
||
| /** | ||
| * Canonical constructor defensively copying {@code allowedOrigins} into an | ||
| * unmodifiable copy, normalizing an absent list to empty and an absent | ||
| * {@code idleTimeoutSeconds} to {@link Optional#empty()}. | ||
| */ | ||
| public WebSocketConfig { | ||
| allowedOrigins = allowedOrigins == null ? List.of() : List.copyOf(allowedOrigins); | ||
| idleTimeoutSeconds = Objects.requireNonNullElse(idleTimeoutSeconds, Optional.empty()); | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.