Skip to content

fix(flags): skip issuer iframe for board-choice flags#1

Merged
tomcasaburi merged 1 commit into
masterfrom
codex/fix/flag-verification-scope
Jun 8, 2026
Merged

fix(flags): skip issuer iframe for board-choice flags#1
tomcasaburi merged 1 commit into
masterfrom
codex/fix/flag-verification-scope

Conversation

@tomcasaburi

@tomcasaburi tomcasaburi commented Jun 8, 2026

Copy link
Copy Markdown
Member

Summary

  • accept valid /pol/ memeflags and /mlp/ pony flags without opening the issuer iframe
  • keep issuer verification for country flags only
  • update README guidance and challenge tests for board-choice flags

Verification

  • yarn test
  • yarn type-check
  • yarn build
  • yarn format:check

Note

Medium Risk
Changes publication-time challenge behavior for memeflags and pony flags (immediate allow vs prior signed assertion flow); country issuer verification path is unchanged but clients relying on challenge-emitted pol/pony data must use flair-only rendering.

Overview
Board-choice /pol/ and /mlp/ flags no longer go through the issuer iframe or signed comment["5chan"] path. After family allow-list and parsing checks, getChallenge returns immediate success for non-country requests; only country flags still require a community signer, lazy iframe URL, and POST …/challenge/verify.

README now separates issuer-verified country flags (immutable namespace + flair mirror) from memeflags/pony (clients publish normal flair; challenge only validates allowed family and known code).

Tests were updated to expect { success: true } without fetch for pol/pony, and issuer mismatch coverage targets country verification only.

Reviewed by Cursor Bugbot for commit 824287e. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • New Features

    • Added conditional issuer verification: country flags require verification, while board-choice and pony flags are now accepted without issuer iframe interaction.
  • Documentation

    • Clarified flag-challenge behavior across different profiles, detailing which flag types require issuer verification and how each type is validated.

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fa847a67-46f6-4fbd-8e40-164fa29e2134

📥 Commits

Reviewing files that changed from the base of the PR and between a6e31dd and 824287e.

📒 Files selected for processing (3)
  • README.md
  • src/index.ts
  • tests/challenge.test.ts

📝 Walkthrough

Walkthrough

This PR implements a dual-path flag verification system. Country flags (issued by flags.5chan.app) require issuer iframe verification, while /pol/ memeflags and /mlp/ pony flags are validated without issuer verification. The change adds a type gate, updates the control flow to skip verification for non-country flags, and adds test coverage for both paths.

Changes

Country vs Board-Choice Flag Verification Paths

Layer / File(s) Summary
Documentation of dual verification flows
README.md
README clarifies that flags.5chan.app issues country flags through issuer verification, while /pol/ and /mlp/ flags are board-choice flairs validated without issuer iframe. Expands explanation of country flag outputs (immutable client-namespace data and community flair mirror) and clarifies why non-country flags skip the verification round trip.
Issuer verification gate and control flow
src/index.ts
Introduces requiresIssuerVerification helper function to classify flag types; adds early-return path in getChallenge to log and allow non-country flags without triggering signer checks, iframe generation, or CBOR verification round trip.
Test coverage for non-issuer and issuer verification
tests/challenge.test.ts
Adds tests verifying memeflags are accepted without fetch calls (no issuer iframe), pony flags accepted without issuer iframe or community signer, and country flag verification rejection when returned flag type/code mismatches requested flag.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Flags fly free in paths twin-split,
Country codes through iframe drift,
Memes and ponies skip the dance,
Board choice flairs need just a glance.
Two flows now, one blessed gate,
Verification meets its fate. 🚩

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: introducing logic to skip issuer iframe verification for board-choice flags (memeflags and pony flags) while retaining it for country flags.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix/flag-verification-scope

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@tomcasaburi tomcasaburi merged commit 63332bc into master Jun 8, 2026
4 checks passed
@tomcasaburi tomcasaburi deleted the codex/fix/flag-verification-scope branch June 8, 2026 07:07
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.

1 participant