Skip to content

Support opt-in active OAuth v2 reinstallation - #190

Open
dblock wants to merge 1 commit into
slack-ruby:masterfrom
dblock:feature/oauth-v2-reinstall
Open

dblock wants to merge 1 commit into
slack-ruby:masterfrom
dblock:feature/oauth-v2-reinstall

Conversation

@dblock

@dblock dblock commented Oct 25, 2026

Copy link
Copy Markdown
Collaborator

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 :reinstalled with OAuth state through Service#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.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dblock
dblock force-pushed the feature/oauth-v2-reinstall branch from 1fbfb74 to 1fa953e Compare October 25, 2026 20:27
@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Danger Report

No issues found.

View run

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant