Skip to content

feat(evaluators): DO NOT MERGE Test end to end#221

Open
namrataghadi-galileo wants to merge 46 commits into
mainfrom
test-end-to-end
Open

feat(evaluators): DO NOT MERGE Test end to end#221
namrataghadi-galileo wants to merge 46 commits into
mainfrom
test-end-to-end

Conversation

@namrataghadi-galileo
Copy link
Copy Markdown
Contributor

test luna and agent control end to end in galileo cluster

namrataghadi-galileo and others added 30 commits May 6, 2026 12:47
Mirrors #204's bindings migration: replaces require_admin_key and
router-level require_api_key with require_operation(CONTROLS_*) on
every protected route on /controls and on /control-templates/render.
Both routers now mount with the non-validating
get_api_key_from_header so the framework owns authentication and
authorization, with the extractor attached purely so the generated
OpenAPI advertises X-API-Key.

GET /controls/schema is intentionally left without a
require_operation dependency: it returns a static model schema with
no tenant state and routing it through the framework would force the
upstream provider to handle a meta-only operation that has no
permission semantics.

POST /controls/validate and POST /control-templates/render are wired
to CONTROLS_CREATE rather than CONTROLS_READ. Both exercise the
authoring materialization path and exist to support the create / set-
data flow; a caller who cannot create controls has no use for the
result. Backwards-incompatible for OSS deployments that previously
called these routes with non-admin keys; deployments that want the
old behavior can override with
HeaderAuthProvider(operation_access={...}).

Storage namespace continues to come from get_namespace_key, matching
the bindings migration in #204. The unified principal-derived cutover
across /controls, /policies, /agents, and /evaluation is a follow-up.
…utes

Move auth-framework rationale on /controls/schema, /controls/validate,
and /control-templates/render from route docstrings into normal code
comments. The docstrings flow into the generated TypeScript SDK as
public API documentation, so internal terminology like
``require_operation`` and "upstream authorizer" should not appear
there. Function-level comments preserve the rationale for readers of
the source.

Also remove the skipped placeholder test for the project-scoped
credential deny scenario; that scenario depends on a deployment-side
provider configuration that is not part of the OSS server, so
tracking it as a permanent skipped test in this repo was the wrong
home for it.

Regenerate the TypeScript SDK to drop the leaked rationale lines.
Add explicit none, api_key, and jwt runtime auth modes, including a generic no-auth provider.

Move controls, bindings, policies, agents, and evaluation storage lookups onto principal namespace scoping.

Cover auth mode selection and principal namespace isolation with server tests.
…stream

The default forward set (X-API-Key, Authorization, Cookie) only covers
credential headers Agent Control itself reads. Deployments whose
upstream authenticates against a different header name (e.g., a
deployer-specific API-key header) had no way to surface that
credential through HttpUpstreamAuthProvider — the inbound header
reached AC but never crossed the upstream call.

Add an extra_forward_headers config field on HttpUpstreamConfig
(defaulting to the empty tuple) that operators populate via the new
AGENT_CONTROL_AUTH_UPSTREAM_EXTRA_FORWARD_HEADERS env var (comma-
separated). The provider's _forward_headers iterates over the union
of the default set and the extras, deduplicating case-insensitively
so a duplicate name (cross-set or within extras) does not produce two
copies on the wire.

Tests:
- forwards a configured extra header alongside defaults
- default forward set unchanged when extras are empty
- extras dedupe against defaults case-insensitively
- _parse_extra_forward_headers parametric: None / empty / single /
  multiple / whitespace / empty-entries / case-folded duplicates
- configure_auth_from_env threads the parsed tuple onto the provider

Lint clean, typecheck clean, full server suite (747) green.
Mirrors #204's bindings migration: replaces require_admin_key and
router-level require_api_key with require_operation(CONTROLS_*) on
every protected route on /controls and on /control-templates/render.
Both routers now mount with the non-validating
get_api_key_from_header so the framework owns authentication and
authorization, with the extractor attached purely so the generated
OpenAPI advertises X-API-Key.

GET /controls/schema is intentionally left without a
require_operation dependency: it returns a static model schema with
no tenant state and routing it through the framework would force the
upstream provider to handle a meta-only operation that has no
permission semantics.

POST /controls/validate and POST /control-templates/render are wired
to CONTROLS_CREATE rather than CONTROLS_READ. Both exercise the
authoring materialization path and exist to support the create / set-
data flow; a caller who cannot create controls has no use for the
result. Backwards-incompatible for OSS deployments that previously
called these routes with non-admin keys; deployments that want the
old behavior can override with
HeaderAuthProvider(operation_access={...}).

Storage namespace continues to come from get_namespace_key, matching
the bindings migration in #204. The unified principal-derived cutover
across /controls, /policies, /agents, and /evaluation is a follow-up.
…utes

Move auth-framework rationale on /controls/schema, /controls/validate,
and /control-templates/render from route docstrings into normal code
comments. The docstrings flow into the generated TypeScript SDK as
public API documentation, so internal terminology like
``require_operation`` and "upstream authorizer" should not appear
there. Function-level comments preserve the rationale for readers of
the source.

Also remove the skipped placeholder test for the project-scoped
credential deny scenario; that scenario depends on a deployment-side
provider configuration that is not part of the OSS server, so
tracking it as a permanent skipped test in this repo was the wrong
home for it.

Regenerate the TypeScript SDK to drop the leaked rationale lines.
Add explicit none, api_key, and jwt runtime auth modes, including a generic no-auth provider.

Move controls, bindings, policies, agents, and evaluation storage lookups onto principal namespace scoping.

Cover auth mode selection and principal namespace isolation with server tests.
…stream

The default forward set (X-API-Key, Authorization, Cookie) only covers
credential headers Agent Control itself reads. Deployments whose
upstream authenticates against a different header name (e.g., a
deployer-specific API-key header) had no way to surface that
credential through HttpUpstreamAuthProvider — the inbound header
reached AC but never crossed the upstream call.

Add an extra_forward_headers config field on HttpUpstreamConfig
(defaulting to the empty tuple) that operators populate via the new
AGENT_CONTROL_AUTH_UPSTREAM_EXTRA_FORWARD_HEADERS env var (comma-
separated). The provider's _forward_headers iterates over the union
of the default set and the extras, deduplicating case-insensitively
so a duplicate name (cross-set or within extras) does not produce two
copies on the wire.

Tests:
- forwards a configured extra header alongside defaults
- default forward set unchanged when extras are empty
- extras dedupe against defaults case-insensitively
- _parse_extra_forward_headers parametric: None / empty / single /
  multiple / whitespace / empty-entries / case-folded duplicates
- configure_auth_from_env threads the parsed tuple onto the provider

Lint clean, typecheck clean, full server suite (747) green.
Exchange target-bound runtime tokens for evaluation requests when configured, cache them per target, and retry once after a 401.

Keep no-auth and API-key runtime flows on the existing request-auth path when token exchange is unavailable or disabled.
Default stays X-API-Key; pass api_key_header=... or set
AGENT_CONTROL_API_KEY_HEADER to override when the upstream auth
expects a different header.
@namrataghadi-galileo namrataghadi-galileo changed the title feat(evaluators): Test end to end feat(evaluators): DO NOT MERGE Test end to end May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants