feat(etl): index oauth_redirect_uris on developer app create/update (parity 5E)#252
Open
raymondjacobson wants to merge 1 commit intoetl/parity-5c-comment-threading-auditfrom
Open
Conversation
…parity 5E) Stack 5E. Picks up apps#13863. Adds the oauth_redirect_uris table from apps' SQLAlchemy model and wires create/update of redirect_uris into the developer_app handlers. Migration 0025: - oauth_redirect_uris (id, client_id varchar(255), redirect_uri text, created_at) with index on client_id. extractRedirectURIs() validates the metadata.redirect_uris field per apps: - must be a list - each entry must be a string under MAX_REDIRECT_URI_LENGTH (2000) - list capped at MAX_REDIRECT_URIS (50) - explicit null treated as "clear all" - missing key treated as "no change" replaceRedirectURIs() implements apps' delete-then-insert pattern. Wired into developer_app_create (writes if non-empty list provided) and developer_app_update (writes when key is present, including the explicit- null clear case). Note: developer_app_update has a pre-existing bug where its second INSERT violates UNIQUE(address) — out of scope for this PR. Test for the update flow covers the redirect-uris helper directly via replaceRedirectURIs. Tests: - TestExtractRedirectURIs (6 sub-cases) - TestDeveloperAppCreate_IndexesRedirectURIs - TestReplaceRedirectURIs_DeletesAndInserts Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Stack 5E. Picks up apps#13863. Adds the `oauth_redirect_uris` table from apps' SQLAlchemy model and wires `redirect_uris` indexing into developer_app create/update handlers.
Migration 0025:
`extractRedirectURIs()` validates the `metadata.redirect_uris` field per apps:
`replaceRedirectURIs()` implements apps' delete-then-insert pattern.
Wired into `developer_app_create` (writes if non-empty list) and `developer_app_update` (writes when key is present, including the explicit-null clear case).
Note: pre-existing developer_app_update bug
`developer_app_update` has a pre-existing bug — its INSERT-of-a-new-row pattern violates `UNIQUE(address)` constraint (the schema has both `PRIMARY KEY (address, txhash)` AND `UNIQUE (address)` which are incompatible with versioning). Out of scope for this PR. The update test covers `replaceRedirectURIs` directly via the helper rather than going through the broken handler path.
Stack context
Stacked on #251 (5C — comment threading). Last PR in the parity stack.
Test plan
🤖 Generated with Claude Code