Skip to content

fix(auth): require secret for internal service mode - #12

Open
PranavaKCode wants to merge 4 commits into
mainfrom
support-internal-service-token-11
Open

fix(auth): require secret for internal service mode#12
PranavaKCode wants to merge 4 commits into
mainfrom
support-internal-service-token-11

Conversation

@PranavaKCode

@PranavaKCode PranavaKCode commented Aug 4, 2026

Copy link
Copy Markdown

Description

  • reads MANTIS_INTERNAL_SERVICE_SECRET into the SDK configuration
  • sends X-Internal-Secret with the existing internal-service marker and user ID
  • fails before any network request when internal-user mode lacks the required secret
  • redacts the internal secret from debug transport logs
  • documents and tests the authenticated internal-service contract

Motivation and context

MantisAPI PR #2442 replaced the spoofable marker-only bypass with an authenticated X-Internal-Secret contract. SDK callers using MANTIS_INTERNAL_USER_ID must send that same provisioned secret or their requests fall through to browser authentication.

Fixes #11.

This is intentionally fail-closed: the SDK accepts a provisioned secret but never derives or logs it. Cookie authentication is unchanged.

How has this been tested?

  • python -m ruff check .
  • uv run --with pytest --with pytest-asyncio pytest -q (71 tests passed)
  • focused coverage verifies the valid three-header set, missing-secret failure, environment loading, and debug-log redaction
  • git diff --check

Screenshots (if appropriate):

Not applicable; this is an SDK authentication contract change.

Types of changes

  • ✅ Bug fix (non-breaking change which fixes an issue)
  • ✅ Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project. [REQUIRED]
  • Ran ruff check. There are no style warnings. [REQUIRED]
  • Ran pytest. All new and existing tests passed. [REQUIRED]
  • Recorded a video walkthrough showing the platform changes, testing used to verify the fix, and a brief review of the code changes made in this PR. [REQUIRED]
  • My change requires a change to the documentation and I have updated it accordingly.
  • I have added tests to cover my changes.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0e7fe789ee

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread mantis_sdk/_http.py Outdated
@PranavaKCode PranavaKCode changed the title fix(auth): require token for internal service mode fix(auth): require secret for internal service mode Aug 7, 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.

Support authenticated internal-service requests

1 participant