Repository navigation
feat(market): allow verified email identities to administer markets - #3860
Merged
Merged
Conversation
MARKET_ADMIN_EMAILS complements MARKET_ADMIN_GITHUB_IDS so an operator can review MiniApp and skin submissions when signing in with a code-verified email identity instead of GitHub. Emails come from email_identities, so an unverified public profile address can never grant admin.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MARKET_ADMIN_EMAILSso operators who sign in with a code-verified email identity can administer the MiniApp market without a GitHub account.AuthService::is_adminonly matchesMARKET_ADMIN_GITHUB_IDSand additionally requiresgithub_id > 0, so email-code identities (alwaysgithub_id = 0) can never reach the review queues even when the deployment wants them to.Type and Areas
Type: Feature
Areas: Rust services (
miniapp-market-service), deploy templateMotivation / Impact
Self-hosted market operators often sign in with the email one-time code (
email_identities) rather than linking GitHub. The skin market already delegates its admin decision to the MiniApp market'sGET /api/v1/me(isAdmin), so one identity check fixes both review queues.is_adminnow delegates tois_admin_identity(config, github_id, email): a verified email match grants admin the same way a configured GitHub ID does.Only addresses recorded in
email_identitiesare considered, and those rows are created exclusively after a one-time code is verified, so a public GitHub profile email can never grant admin. Comparison is case-insensitive and trimmed. The parser also drops entries without@.Verification
cargo test --release -p openbitfun-miniapp-market-service --lib— passed (60 tests, including newconfig::tests::admin_emails_*andauth::tests::administrators_are_matched_by_github_id_or_verified_email)cargo fmt --check— no diff in the touched filesGET /api/v1/mereturnsisAdmin: truefor a configured verified-email identity, and both/miniapp/api/v1/admin/submissionsand/skin/api/v1/admin/submissionsreturn 200 for it, while a non-configured email identity still reportsisAdmin: falseandbobleer's GitHub admin is unchanged. Skin market image was not rebuilt; it picked the flag up through/api/v1/me.AI-assisted change; testing level: fully tested (unit tests + manual deployment check).
Reviewer Notes
Deployment: set
MARKET_ADMIN_EMAILSin the market environment, e.g.MARKET_ADMIN_EMAILS=admin@example.com,second@example.com. Empty/unset keeps the previous GitHub-only behaviour. No migration and no schema change, so rollback is simply unsetting the variable.Known boundary (unchanged by this PR): the review-approval path checks the submission's
submitter_github_idagainstadmin_github_ids(aroundroutes.rs:1647). An email administrator publishing a new release of a listing owned by another account therefore takes the non-admin branch and can hitrelease_conflict. Review actions themselves are unaffected; extending that check to email identities would be a separate change.Checklist
market.env.exampleand the market server README; no UI strings changed.)Generated with OpenBitFun