Skip to content

fix: low-batch hardening and behavior consistency#3220

Merged
crivetimihai merged 13 commits intomainfrom
low-batch-1
Feb 24, 2026
Merged

fix: low-batch hardening and behavior consistency#3220
crivetimihai merged 13 commits intomainfrom
low-batch-1

Conversation

@crivetimihai
Copy link
Copy Markdown
Member

fix: low-batch hardening and behavior consistency

  • L-01: proxy-auth trust now requires explicit dangerous acknowledgement when client auth is disabled
  • L-02: unauthenticated admin behavior is explicit and warning-backed when AUTH_REQUIRED is disabled
  • L-03: OAuth state handling and gateway lookup behavior are aligned for consistent responses
  • L-05: OAuth state validation flow is tightened before downstream processing
  • L-07: docs/auth token validation paths are consistent with revocation and user-state checks
  • L-08: SSO admin preservation behavior is aligned with configured policy and role-sync rules
  • L-09: SSO issuer allowlist enforcement is active and normalized for comparisons
  • L-10: crypto/security documentation is aligned with runtime implementation behavior
  • L-11: SSO nonce-protection documentation is aligned with actual behavior
  • L-12: SSO team mapping is applied during login flows with regression coverage
  • L-15: tool cache auth-sensitive hydration is type-safe and avoids unsafe payload assumptions
  • L-16: token usage-limit enforcement path is active with deny-path coverage
  • L-17: debug console logging cleanup and frontend test alignment for admin UI scripts

  - L-01: proxy-auth trust now requires explicit dangerous acknowledgement when client auth is disabled
  - L-02: unauthenticated admin behavior is explicit and warning-backed when AUTH_REQUIRED is disabled
  - L-03: OAuth state handling and gateway lookup behavior are aligned for consistent responses
  - L-05: OAuth state validation flow is tightened before downstream processing
  - L-07: docs/auth token validation paths are consistent with revocation and user-state checks
  - L-08: SSO admin preservation behavior is aligned with configured policy and role-sync rules
  - L-09: SSO issuer allowlist enforcement is active and normalized for comparisons
  - L-10: crypto/security documentation is aligned with runtime implementation behavior
  - L-11: SSO nonce-protection documentation is aligned with actual behavior
  - L-12: SSO team mapping is applied during login flows with regression coverage
  - L-15: tool cache auth-sensitive hydration is type-safe and avoids unsafe payload assumptions
  - L-16: token usage-limit enforcement path is active with deny-path coverage
  - L-17: debug console logging cleanup and frontend test alignment for admin UI scripts

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
@crivetimihai crivetimihai added this to the Release 1.0.0-GA milestone Feb 24, 2026
@crivetimihai crivetimihai self-assigned this Feb 24, 2026
@crivetimihai crivetimihai added security Improves security revisit Revisit this PR at a later date to address further issues, or if problems arise. labels Feb 24, 2026
@crivetimihai crivetimihai marked this pull request as ready for review February 24, 2026 12:10
crivetimihai and others added 12 commits February 24, 2026 13:03
- Rate-limit proxy auth trust warning to log once per process
- Replace unnecessary db.commit() with db.rollback() in read-only
  _check_usage_limits path
- Use HTTPException directly for SSO preserve-admin enforcement
  instead of ValueError control flow; re-raise HTTPException before
  generic handler so 401 is no longer swallowed into 500
- Document TRUST_PROXY_AUTH_DANGEROUSLY and ALLOW_UNAUTHENTICATED_ADMIN
  in .env.example with DANGER warnings
- Warn when blank issuer bypasses SSO_ISSUERS allowlist
- Preserve original console.log/debug on window before override
- Add plugin_context_table/plugin_global_context to anonymous context

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
The target was defined twice — an older version without the
COMMITLINT_ENFORCED toggle and the newer toggleable version.
Remove the old definition and co-locate all commitlint-only variables
with the surviving target, following the Makefile's convention of
defining variables near the targets that use them.

Signed-off-by: Jonathan Springer <jps@s390x.com>
tests/e2e/test_entra_id_integration.py requires external Entra ID
configuration and is not suitable for the default `make test` and
`make test-altk` runs.

Signed-off-by: Jonathan Springer <jps@s390x.com>
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
@crivetimihai crivetimihai merged commit c5958b6 into main Feb 24, 2026
1 check passed
@crivetimihai crivetimihai deleted the low-batch-1 branch February 24, 2026 17:20
vishu-bh pushed a commit that referenced this pull request Feb 25, 2026
* fix: low-batch hardening and behavior consistency

  - L-01: proxy-auth trust now requires explicit dangerous acknowledgement when client auth is disabled
  - L-02: unauthenticated admin behavior is explicit and warning-backed when AUTH_REQUIRED is disabled
  - L-03: OAuth state handling and gateway lookup behavior are aligned for consistent responses
  - L-05: OAuth state validation flow is tightened before downstream processing
  - L-07: docs/auth token validation paths are consistent with revocation and user-state checks
  - L-08: SSO admin preservation behavior is aligned with configured policy and role-sync rules
  - L-09: SSO issuer allowlist enforcement is active and normalized for comparisons
  - L-10: crypto/security documentation is aligned with runtime implementation behavior
  - L-11: SSO nonce-protection documentation is aligned with actual behavior
  - L-12: SSO team mapping is applied during login flows with regression coverage
  - L-15: tool cache auth-sensitive hydration is type-safe and avoids unsafe payload assumptions
  - L-16: token usage-limit enforcement path is active with deny-path coverage
  - L-17: debug console logging cleanup and frontend test alignment for admin UI scripts

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* fix: address code review findings from low-batch hardening

- Rate-limit proxy auth trust warning to log once per process
- Replace unnecessary db.commit() with db.rollback() in read-only
  _check_usage_limits path
- Use HTTPException directly for SSO preserve-admin enforcement
  instead of ValueError control flow; re-raise HTTPException before
  generic handler so 401 is no longer swallowed into 500
- Document TRUST_PROXY_AUTH_DANGEROUSLY and ALLOW_UNAUTHENTICATED_ADMIN
  in .env.example with DANGER warnings
- Warn when blank issuer bypasses SSO_ISSUERS allowlist
- Preserve original console.log/debug on window before override
- Add plugin_context_table/plugin_global_context to anonymous context

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Fix locust test auth

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Disable OBS

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* chore: remove duplicate linting-workflow-commitlint target from Makefile

The target was defined twice — an older version without the
COMMITLINT_ENFORCED toggle and the newer toggleable version.
Remove the old definition and co-locate all commitlint-only variables
with the surviving target, following the Makefile's convention of
defining variables near the targets that use them.

Signed-off-by: Jonathan Springer <jps@s390x.com>

* chore: exclude Entra ID e2e tests from default test targets

tests/e2e/test_entra_id_integration.py requires external Entra ID
configuration and is not suitable for the default `make test` and
`make test-altk` runs.

Signed-off-by: Jonathan Springer <jps@s390x.com>

* MCP_REQUIRE_AUTH now inherits AUTH_REQUIRED when unset

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* MCP_REQUIRE_AUTH now inherits AUTH_REQUIRED when unset - tests

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* MCP_REQUIRE_AUTH now inherits AUTH_REQUIRED when unset - tests

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* MCP_REQUIRE_AUTH now inherits AUTH_REQUIRED when unset - tests

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* MCP_REQUIRE_AUTH now inherits AUTH_REQUIRED when unset - tests

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* MCP_REQUIRE_AUTH now inherits AUTH_REQUIRED when unset - fix ui

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* linter updates

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

---------

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: Jonathan Springer <jps@s390x.com>
Co-authored-by: Jonathan Springer <jps@s390x.com>
vishu-bh pushed a commit that referenced this pull request Feb 25, 2026
* fix: low-batch hardening and behavior consistency

  - L-01: proxy-auth trust now requires explicit dangerous acknowledgement when client auth is disabled
  - L-02: unauthenticated admin behavior is explicit and warning-backed when AUTH_REQUIRED is disabled
  - L-03: OAuth state handling and gateway lookup behavior are aligned for consistent responses
  - L-05: OAuth state validation flow is tightened before downstream processing
  - L-07: docs/auth token validation paths are consistent with revocation and user-state checks
  - L-08: SSO admin preservation behavior is aligned with configured policy and role-sync rules
  - L-09: SSO issuer allowlist enforcement is active and normalized for comparisons
  - L-10: crypto/security documentation is aligned with runtime implementation behavior
  - L-11: SSO nonce-protection documentation is aligned with actual behavior
  - L-12: SSO team mapping is applied during login flows with regression coverage
  - L-15: tool cache auth-sensitive hydration is type-safe and avoids unsafe payload assumptions
  - L-16: token usage-limit enforcement path is active with deny-path coverage
  - L-17: debug console logging cleanup and frontend test alignment for admin UI scripts

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* fix: address code review findings from low-batch hardening

- Rate-limit proxy auth trust warning to log once per process
- Replace unnecessary db.commit() with db.rollback() in read-only
  _check_usage_limits path
- Use HTTPException directly for SSO preserve-admin enforcement
  instead of ValueError control flow; re-raise HTTPException before
  generic handler so 401 is no longer swallowed into 500
- Document TRUST_PROXY_AUTH_DANGEROUSLY and ALLOW_UNAUTHENTICATED_ADMIN
  in .env.example with DANGER warnings
- Warn when blank issuer bypasses SSO_ISSUERS allowlist
- Preserve original console.log/debug on window before override
- Add plugin_context_table/plugin_global_context to anonymous context

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Fix locust test auth

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Disable OBS

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* chore: remove duplicate linting-workflow-commitlint target from Makefile

The target was defined twice — an older version without the
COMMITLINT_ENFORCED toggle and the newer toggleable version.
Remove the old definition and co-locate all commitlint-only variables
with the surviving target, following the Makefile's convention of
defining variables near the targets that use them.

Signed-off-by: Jonathan Springer <jps@s390x.com>

* chore: exclude Entra ID e2e tests from default test targets

tests/e2e/test_entra_id_integration.py requires external Entra ID
configuration and is not suitable for the default `make test` and
`make test-altk` runs.

Signed-off-by: Jonathan Springer <jps@s390x.com>

* MCP_REQUIRE_AUTH now inherits AUTH_REQUIRED when unset

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* MCP_REQUIRE_AUTH now inherits AUTH_REQUIRED when unset - tests

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* MCP_REQUIRE_AUTH now inherits AUTH_REQUIRED when unset - tests

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* MCP_REQUIRE_AUTH now inherits AUTH_REQUIRED when unset - tests

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* MCP_REQUIRE_AUTH now inherits AUTH_REQUIRED when unset - tests

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* MCP_REQUIRE_AUTH now inherits AUTH_REQUIRED when unset - fix ui

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* linter updates

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

---------

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: Jonathan Springer <jps@s390x.com>
Co-authored-by: Jonathan Springer <jps@s390x.com>
MohanLaksh pushed a commit that referenced this pull request Mar 12, 2026
* fix: low-batch hardening and behavior consistency

  - L-01: proxy-auth trust now requires explicit dangerous acknowledgement when client auth is disabled
  - L-02: unauthenticated admin behavior is explicit and warning-backed when AUTH_REQUIRED is disabled
  - L-03: OAuth state handling and gateway lookup behavior are aligned for consistent responses
  - L-05: OAuth state validation flow is tightened before downstream processing
  - L-07: docs/auth token validation paths are consistent with revocation and user-state checks
  - L-08: SSO admin preservation behavior is aligned with configured policy and role-sync rules
  - L-09: SSO issuer allowlist enforcement is active and normalized for comparisons
  - L-10: crypto/security documentation is aligned with runtime implementation behavior
  - L-11: SSO nonce-protection documentation is aligned with actual behavior
  - L-12: SSO team mapping is applied during login flows with regression coverage
  - L-15: tool cache auth-sensitive hydration is type-safe and avoids unsafe payload assumptions
  - L-16: token usage-limit enforcement path is active with deny-path coverage
  - L-17: debug console logging cleanup and frontend test alignment for admin UI scripts

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* fix: address code review findings from low-batch hardening

- Rate-limit proxy auth trust warning to log once per process
- Replace unnecessary db.commit() with db.rollback() in read-only
  _check_usage_limits path
- Use HTTPException directly for SSO preserve-admin enforcement
  instead of ValueError control flow; re-raise HTTPException before
  generic handler so 401 is no longer swallowed into 500
- Document TRUST_PROXY_AUTH_DANGEROUSLY and ALLOW_UNAUTHENTICATED_ADMIN
  in .env.example with DANGER warnings
- Warn when blank issuer bypasses SSO_ISSUERS allowlist
- Preserve original console.log/debug on window before override
- Add plugin_context_table/plugin_global_context to anonymous context

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Fix locust test auth

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Disable OBS

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* chore: remove duplicate linting-workflow-commitlint target from Makefile

The target was defined twice — an older version without the
COMMITLINT_ENFORCED toggle and the newer toggleable version.
Remove the old definition and co-locate all commitlint-only variables
with the surviving target, following the Makefile's convention of
defining variables near the targets that use them.

Signed-off-by: Jonathan Springer <jps@s390x.com>

* chore: exclude Entra ID e2e tests from default test targets

tests/e2e/test_entra_id_integration.py requires external Entra ID
configuration and is not suitable for the default `make test` and
`make test-altk` runs.

Signed-off-by: Jonathan Springer <jps@s390x.com>

* MCP_REQUIRE_AUTH now inherits AUTH_REQUIRED when unset

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* MCP_REQUIRE_AUTH now inherits AUTH_REQUIRED when unset - tests

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* MCP_REQUIRE_AUTH now inherits AUTH_REQUIRED when unset - tests

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* MCP_REQUIRE_AUTH now inherits AUTH_REQUIRED when unset - tests

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* MCP_REQUIRE_AUTH now inherits AUTH_REQUIRED when unset - tests

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* MCP_REQUIRE_AUTH now inherits AUTH_REQUIRED when unset - fix ui

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* linter updates

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

---------

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: Jonathan Springer <jps@s390x.com>
Co-authored-by: Jonathan Springer <jps@s390x.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

revisit Revisit this PR at a later date to address further issues, or if problems arise. security Improves security

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants