Repository navigation
feat: require the code of conduct for oauth apps - #171
Merged
Merged
Conversation
jaspermayone
added this pull request to stack #173
October 9, 2026 16:33
jaspermayone
force-pushed
the
feature-coc-app-gate
branch
from
October 9, 2026 17:22
fd6534d to
dc70205
Compare
jaspermayone
force-pushed
the
feature-coc-app-gate
branch
from
October 9, 2026 17:32
401d556 to
1b7c931
Compare
jaspermayone
marked this pull request as ready for review
October 9, 2026 17:59
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
Every OAuth app now requires the code of conduct. A superadmin can opt out one app, one user, or both.
Changes
oauth_applications.requires_code_of_conduct(defaulttrue): opts out one app.users.code_of_conduct_exempt(defaultfalse): opts out one user. Exempt users are also left out ofUser.code_of_conduct_pending, so nobody asks them to accept.AppAccess.explainrefuses a user withoutslack_coc_accepted_atwhen the app requires the code of conduct. Every endpoint asksAppAccess, so this covers authorize, token exchange, refresh, introspection, userinfo and the directory.GET /oauth/authorize, a user who only lacks the acceptance goes to/slack. After they accept, they go back to the authorize URL./slackwhen the reason is the code of conduct.RevokeLostAppAccessJobfor the user.RevokeLostAppAccessJob.:accepted_code_of_conductfor OAuth specs.Rollout
The requirement starts when this deploys. Users who have not accepted lose app access at once, and their existing tokens stop working. Opt out the apps or users that must keep working before you deploy, or right after.
Test plan
bundle exec rspecbin/rubocopThis PR has a migration.