Skip to content

fix(cli): reject viewer-null PAT preflight responses#1197

Open
volcano303 wants to merge 1 commit into
entrius:testfrom
volcano303:fix/miner-post-viewer-null-pat
Open

fix(cli): reject viewer-null PAT preflight responses#1197
volcano303 wants to merge 1 commit into
entrius:testfrom
volcano303:fix/miner-post-viewer-null-pat

Conversation

@volcano303
Copy link
Copy Markdown

Summary

  • Reject GraphQL 200 PAT preflight responses when the body contains populated errors, missing/null data, or data.viewer: null.
  • Keep the existing fine-grained PAT permission message for local GraphQL access failures.
  • Add focused CLI regression coverage for valid viewer responses and body-level GraphQL rejections.

Related Issues

Closes #1195

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other (describe below)

Testing

  • Tests added/updated
  • Manually tested

Commands run:

uv run pytest tests/cli/test_miner_commands.py -q
uv run pytest tests/validator/test_pat_handler.py -q
uv run pytest tests/cli/test_miner_commands.py tests/validator/test_pat_handler.py -q
uv run ruff check gittensor/cli/miner_commands/post.py tests/cli/test_miner_commands.py
uv run ruff format --check gittensor/cli/miner_commands/post.py tests/cli/test_miner_commands.py
git diff --check

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Changes are documented (if applicable)

@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gitt miner post local PAT preflight accepts GraphQL viewer:null tokens

1 participant