Repository navigation
🪪 feat: store each user's identity provider subject as oidc_sub - #305
Open
erick-GeGe wants to merge 1 commit into
Open
erick-GeGe wants to merge 1 commit into
erick-GeGe wants to merge 1 commit into
Conversation
erick-GeGe
force-pushed
the
feat/api-keys-cli
branch
from
September 28, 2026 18:05
a86eb18 to
580d8ea
Compare
erick-GeGe
force-pushed
the
feat/oidc-sub
branch
from
September 28, 2026 18:28
9330b9f to
d4ff5f9
Compare
The subject claim is the one identifier that stays the same for a person across estela, billing and whatever ships next. Nullable until an account is linked, unique so two rows can never claim the same person.
erick-GeGe
force-pushed
the
feat/oidc-sub
branch
from
October 6, 2026 16:16
515e329 to
c292ce2
Compare
joaquingx
approved these changes
Oct 6, 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.
Why
Whatever single sign-on estela ends up with, every product needs one identifier that means the same person everywhere. Billing sums usage by it, and each product finds its own row for a person by it. That identifier is the identity provider's
sub: stable, unique, never reused.Email looks like the obvious key and is the wrong one. People change theirs, and an address freed by a deleted account can be registered by someone else, who would then inherit the old owner's projects.
What
UserProfile.oidc_sub, nullable and unique. Migration0044_userprofile_oidc_sub.Existing accounts are linked by setting their
oidc_subahead of time. The optional OpenID Connect sign-in (a follow-up PR) finds accounts by it, and creates new ones with it.Notes
django_migrationsstill lists0044_apikey_expires_at, recorded before the API key migrations were merged into one. Harmless: Django ignores recorded migrations that no longer exist. This migration has a different name, so it applies normally, and theexpires_atcolumn is already there.makemigrations --checkreports index renames onMeteredUsageRecord. They are not touched here.