Skip to content

Commit 8531c4b

Browse files
committed
fix(providers): enforce placement using existing credential metadata
Signed-off-by: John Myers <[email protected]>
1 parent 3cc8d7e commit 8531c4b

35 files changed

Lines changed: 1984 additions & 2443 deletions

File tree

‎crates/openshell-core/README.md‎

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,18 @@ behavior here, then consume it from the gateway, sandbox, and router.
6060

6161
## Static Credential Resolution
6262

63-
Static credential bindings carry both an endpoint boundary and a placement
64-
boundary. `provider_credentials` compiles them together and preserves placement
65-
when creating a request-scoped resolver. Request rewriting supplies the actual
66-
header name, query key, or path slot before resolving each reference. Missing or
67-
unsupported placement fails closed.
68-
69-
Header placement authorizes a header name independently of authentication
70-
scheme. Basic authentication applies the same check before resolving decoded
71-
references. Body and WebSocket rewriting cannot override a credential's declared
72-
placement. Signing-only material uses the supervisor's trusted signing path.
73-
74-
Placement changes are authorization changes: retained references and stable
75-
handles must not retain access to the previous placement.
63+
Static credential bindings retain endpoint authorization. The gateway includes
64+
static `ProviderProfileCredential` auth metadata in the existing runtime
65+
credential map under `static-env:<ENV_KEY>`. Provider state extracts those entries
66+
before storing dynamic token grants and compiles placement locally alongside the
67+
matching static binding. Missing metadata preserves legacy endpoint-scoped
68+
substitution; malformed reserved metadata fails closed atomically.
69+
70+
Request rewriting supplies the actual header name, query key, or path slot.
71+
Header authorization is independent of authentication scheme, including Basic.
72+
Explicit body/WebSocket rewrite policies and trusted signing retain their
73+
existing permissions. Existing placeholder and stable-handle derivation remain
74+
unchanged. Protobuf message shapes and service interfaces remain unchanged.
7675

7776
## Middleware Contracts
7877

‎crates/openshell-core/src/grpc_client.rs‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,7 +1317,6 @@ pub async fn fetch_provider_environment_with_stable_placeholders(
13171317
.get_sandbox_provider_environment(GetSandboxProviderEnvironmentRequest {
13181318
sandbox_id: sandbox_id.to_string(),
13191319
supports_static_credential_bindings: true,
1320-
supports_static_credential_placement: true,
13211320
supports_stable_placeholder_environment_keys: true,
13221321
})
13231322
.await
@@ -1387,13 +1386,6 @@ mod provider_environment_tests {
13871386
path: "/v1/**".to_string(),
13881387
}],
13891388
credential_identity: "provider:TOKEN".to_string(),
1390-
placement: Some(crate::proto::StaticCredentialPlacement {
1391-
location: Some(
1392-
crate::proto::static_credential_placement::Location::HeaderName(
1393-
"authorization".into(),
1394-
),
1395-
),
1396-
}),
13971389
..Default::default()
13981390
},
13991391
)]),

0 commit comments

Comments
 (0)