feat(content): superuser export endpoint for the Photon migration - #998
Merged
Conversation
Photon (the new backend) has no access to this database, so the one-time user migration cannot read MySQL directly. This adds a read-only bulk export it can consume over HTTP instead. GET /migration/photon-user-export/ returns every user with the exact fields Photon's import needs — name, email, gender, allergy, image, the flags, and the bio (description, gitHub_link, linkedIn_link). Password hashes and auth tokens are left out on purpose: Photon sets its own placeholder password and users authenticate via Feide afterwards, so no secret leaves this system. Gated on is_admin_user (HS/Index) AND is_superuser. It exposes every member's name, email and bio in one response, so it is meant to be short-lived — remove it once the migration is done. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jul 22, 2026
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.
Hvorfor
Photon (den nye backenden) skal migrere over alle brukere, men har ingen tilgang til denne databasen — verken MySQL-tilkobling eller SSH. I stedet for å åpne databasen utad, gir dette et read-only endepunkt Photon kan lese over HTTP.
Hva
GET /migration/photon-user-export/returnerer alle brukere med nøyaktig de feltene Photon-importen trenger:user_id,first_name,last_name,email,gender,allergy,imageis_superuser,is_active,allows_photo_by_default,accepts_event_rules,created_at,updated_atdescription,gitHub_link,linkedIn_linkIngen hemmeligheter forlater systemet. Passordhasher og auth-tokens er bevisst utelatt — Photon setter sitt eget plassholderpassord, og brukere logger inn via Feide etterpå.
Sikkerhet
Låst bak
is_admin_user(HS/Index) ogis_superuser. Endepunktet eksponerer navn, e-post og bio for alle medlemmer i én respons, så det er ment å være kortlevd — det bør fjernes så snart migreringen er ferdig. Egen PR følger for det.Verifisert
black --checkgrøntflake8grønt (F401 på barrel-__init__.pyer allerede unntatt isetup.cfg)User- ogUserBio-modellene;created_at/updated_atfraBaseModelbio-relasjonen (related_name="bio") brukt viaselect_related— én spørring, ingen N+1Kunne ikke kjøre full Django-test lokalt (krever Docker Compose-stacken); CI kjører den.
🤖 Generated with Claude Code