-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat(proxy): bind static credentials to provider endpoints #2510
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
Open
johntmyers
wants to merge
41
commits into
main
Choose a base branch
from
fix/static-credential-endpoint-binding
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
9159d64
feat(proxy): bind static credentials to provider endpoints
johntmyers f88cb6a
test(e2e): verify static credential endpoint isolation
johntmyers eea4a8f
docs(provider): explain static credential endpoint binding
johntmyers 15c4318
fix(e2e): use valid endpoint isolation fixtures
johntmyers 29397ac
docs(provider): explain static credential endpoint binding
johntmyers b369444
fix(credentials): preserve binding identity across rotations
johntmyers 1e9b2f9
fix(proxy): enforce bindings across request lifecycle
johntmyers da55766
fix(proxy): close credential relay gaps
johntmyers 30ed029
docs(credentials): clarify binding failure behavior
johntmyers d6bf3b3
fix(credentials): hash selected provider profile scope
johntmyers ae41043
fix(proxy): resolve credentials after request admission
johntmyers 340330a
docs(credentials): clarify binding failure diagnostics
johntmyers d88eb41
fix(proxy): align single-route credential denials
johntmyers b80d802
fix(credentials): harden endpoint-bound rotation
johntmyers 1364019
fix(credentials): enforce identity and authority binding
johntmyers 2b40ebb
fix(credentials): snapshot provider environment atomically
johntmyers 795430f
test(e2e): include authority port in query proxy requests
johntmyers dc83a25
fix(credentials): close credential revocation gaps
johntmyers 5259626
docs(proxy): explain authority mismatch diagnostics
johntmyers 80e1940
fix(credentials): enforce binding lifecycle invariants
johntmyers 7365c5c
fix(provider): reject credential config collisions
johntmyers b67ff11
fix(network): capture credential scope atomically
johntmyers 6e3d5fc
fix(network): distinguish origin and absolute targets
johntmyers 08becd9
fix(provider): isolate endpointless profile credentials
johntmyers 3e2a0a0
fix(network): normalize IPv6 request authorities
johntmyers aeb5238
docs(credentials): clarify endpointless profile isolation
johntmyers e02c5c8
feat(policy): bind endpointless provider credentials
johntmyers b8d754c
fix(credentials): use current GCP placeholder revision
johntmyers ed48716
docs(providers): explain policy credential bindings
johntmyers 85db9dc
test(credentials): cover endpointless fail-closed invariant
johntmyers c126cf9
test(policy): expect ambiguity rejection at creation
johntmyers b42e2a6
test(server): authenticate rebased policy requests
johntmyers c9b8565
refactor(proxy): share credential mismatch finding builder
johntmyers 7c83f1c
test(credentials): cover malformed binding metadata
johntmyers cbf45cb
test(credentials): verify multi-key endpoint isolation
johntmyers 0773f7d
test(e2e): cover same-host credential path denial
johntmyers 43365e1
docs(credentials): document serialized refresh contract
johntmyers d35f122
refactor(proxy): consolidate L7 log formatting
johntmyers a3a153b
perf(credentials): precompile endpoint binding patterns
johntmyers 23474ee
perf(credentials): share identity epoch revisions
johntmyers 7a0ce2b
test(proxy): require explicit request default ports
johntmyers 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| // SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| //! Canonical provider endpoint path matching shared by policy and runtime code. | ||
|
|
||
| /// A compiled provider endpoint path pattern. | ||
| /// | ||
| /// Invalid glob syntax retains the existing fail-closed behavior: it matches | ||
| /// only when the request path is exactly equal to the configured pattern. | ||
| #[derive(Debug, Clone)] | ||
| pub struct EndpointPathPattern { | ||
| source: String, | ||
| kind: EndpointPathPatternKind, | ||
| } | ||
|
|
||
| #[derive(Debug, Clone)] | ||
| enum EndpointPathPatternKind { | ||
| Any, | ||
| Subtree(String), | ||
| Glob(glob::Pattern), | ||
| Invalid, | ||
| } | ||
|
|
||
| impl EndpointPathPattern { | ||
| #[must_use] | ||
| pub fn new(pattern: &str) -> Self { | ||
| let kind = if pattern.is_empty() || pattern == "**" || pattern == "/**" { | ||
| EndpointPathPatternKind::Any | ||
| } else if let Some(prefix) = pattern.strip_suffix("/**") { | ||
| EndpointPathPatternKind::Subtree(prefix.to_string()) | ||
| } else { | ||
| glob::Pattern::new(pattern).map_or( | ||
| EndpointPathPatternKind::Invalid, | ||
| EndpointPathPatternKind::Glob, | ||
| ) | ||
| }; | ||
| Self { | ||
| source: pattern.to_string(), | ||
| kind, | ||
| } | ||
| } | ||
|
|
||
| #[must_use] | ||
| pub fn matches(&self, path: &str) -> bool { | ||
| if self.source == path { | ||
| return true; | ||
| } | ||
| match &self.kind { | ||
| EndpointPathPatternKind::Any => true, | ||
| EndpointPathPatternKind::Subtree(prefix) => { | ||
| path == prefix | ||
| || path | ||
| .strip_prefix(prefix) | ||
| .is_some_and(|suffix| suffix.starts_with('/')) | ||
| } | ||
| EndpointPathPatternKind::Glob(pattern) => pattern.matches(path), | ||
| EndpointPathPatternKind::Invalid => false, | ||
| } | ||
| } | ||
| } | ||
|
|
||
| /// Return whether `path` is selected by a provider endpoint path pattern. | ||
| /// | ||
| /// Empty paths and `**` match every request path. A trailing `/**` matches the | ||
| /// named path itself and every descendant. Other patterns use glob semantics. | ||
| #[must_use] | ||
| pub fn matches(pattern: &str, path: &str) -> bool { | ||
| EndpointPathPattern::new(pattern).matches(path) | ||
| } | ||
|
|
||
| #[cfg(test)] | ||
| mod tests { | ||
| use super::{EndpointPathPattern, matches}; | ||
|
|
||
| #[test] | ||
| fn matches_canonical_endpoint_patterns() { | ||
| assert!(matches("", "/v1/messages")); | ||
| assert!(matches("/**", "/v1/messages")); | ||
| assert!(matches("/v1/**", "/v1")); | ||
| assert!(matches("/v1/**", "/v1/messages")); | ||
| assert!(matches("/v*/messages", "/v1/messages")); | ||
| assert!(matches("/v1/*", "/v1/chat/messages")); | ||
| assert!(!matches("/v1/**", "/v2/messages")); | ||
| assert!(!matches("/v1/*/messages", "/v1/chat/completions")); | ||
| } | ||
|
|
||
| #[test] | ||
| fn compiled_patterns_preserve_canonical_matching() { | ||
| let subtree = EndpointPathPattern::new("/v1/**"); | ||
| assert!(subtree.matches("/v1")); | ||
| assert!(subtree.matches("/v1/chat/messages")); | ||
| assert!(!subtree.matches("/v2/messages")); | ||
|
|
||
| let glob = EndpointPathPattern::new("/v*/messages"); | ||
| assert!(glob.matches("/v1/messages")); | ||
| assert!(!glob.matches("/v1/completions")); | ||
|
|
||
| let invalid = EndpointPathPattern::new("["); | ||
| assert!(invalid.matches("[")); | ||
| assert!(!invalid.matches("/v1/messages")); | ||
| } | ||
| } | ||
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
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.