Repository navigation
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
dblock
force-pushed
the
feature/oauth-v2-reinstall
branch
from
October 25, 2026 20:27
1fbfb74 to
1fa953e
Compare
Danger ReportNo issues found. |
This branch has not been deployed
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
Addresses #139 for stateless OAuth v2 applications. Add
config.allow_reinstall, default false. When explicitly enabled and both the stored and incoming authorization are OAuth v2, update the existing active installation credentials and emit:reinstalledwith OAuth state throughService#reinstall!. Do not create a second record or fire the create/start lifecycle, preventing duplicate workers.Keep default active-install rejection and active OAuth v1/version-migration rejection. New and previously inactive installations retain their normal startup lifecycle. Move the duplicate guard before OAuth attribute writes so rejected registrations no longer partially modify stored authorization metadata. Document the option, lifecycle contract, stateless-only restriction, and callback.
Legacy RTM reinstall/restart is deliberately not implemented here: its connection lifecycle remains a separate concern. Applications must opt in only when credential updates do not require a running worker to restart.
Validation
API and service specs pass under both Mongoid 9.1 and Active Record 8.1 on Ruby 4/Grape 4: 76 examples, 0 failures each. Focused RuboCop passes. Regressions cover token refresh without duplicate records/workers, callback state, rejection without metadata writes, legacy/version-migration protection, and unchanged new/inactive startup behavior.
Authored by Copilot (AI), on behalf of @dblock.