Skip to content

chore: migrate OAuth services admin DDP methods to REST#40737

Draft
ggazzo wants to merge 1 commit into
developfrom
chore/ddp-migrate-batch7-oauth
Draft

chore: migrate OAuth services admin DDP methods to REST#40737
ggazzo wants to merge 1 commit into
developfrom
chore/ddp-migrate-batch7-oauth

Conversation

@ggazzo
Copy link
Copy Markdown
Member

@ggazzo ggazzo commented May 29, 2026

Summary

Continues the DDP→REST sweep (#40659, #40711, #40675, #40724, #40728, #40734, #40736). This batch migrates the three OAuth services admin DDP methods that backed the Admin → OAuth settings group. DDP methods stay registered for external SDK/mobile clients with deprecation logs pointing at the new routes.

Endpoints

DDP method REST endpoint Notes
addOAuthService POST /v1/settings.addCustomOAuth already exists, DDP now logs deprecation
removeOAuthService POST /v1/settings.removeCustomOAuth (new) add-oauth-service perm + twoFactorRequired
refreshOAuthService POST /v1/settings.refreshOAuthServices (new) add-oauth-service perm + twoFactorRequired

Implementation

  • removeOAuthServiceMethod + refreshOAuthServiceMethod extracted from the DDP method files into exported functions, reused by both DDP entrypoints (now thin + deprecation-logged) and the REST handlers.
  • Same add-oauth-service permission check + twoFactorRequired gate as the existing settings.addCustomOAuth endpoint.

Client changes

OAuthGroupPage.tsx swapped from three useMethod hooks to three useEndpoint hooks. addOAuthService now sends { name }; removeOAuthService now sends { name }.

Test plan

  • CI green (lint + typecheck)
  • Admin → OAuth → Add custom OAuth → fill name → modal closes, settings group appears
  • Admin → OAuth → Remove custom OAuth (confirm danger modal) → settings group disappears, settings rows deleted
  • Admin → OAuth → Refresh OAuth services → toast OK, login page reflects updated providers
  • Hit endpoints with curl and confirm 401/403 without the add-oauth-service perm, 2FA prompt without a valid 2FA challenge

🤖 Generated with Claude Code

Added two new REST endpoints completing the Custom OAuth admin surface:

- POST /v1/settings.removeCustomOAuth        (removeOAuthService)
- POST /v1/settings.refreshOAuthServices     (refreshOAuthService)

addOAuthService was already covered by the existing
POST /v1/settings.addCustomOAuth; its DDP method now also logs a
deprecation pointing there.

Method bodies extracted into the existing
apps/meteor/app/lib/server/methods/{remove,refresh}OAuthService.ts as
shared functions reused by both DDP entrypoints (now thin +
deprecation-logged) and the new REST handlers. Same add-oauth-service
permission + twoFactorRequired gates preserved.

Client OAuthGroupPage swapped from three useMethod hooks to three
useEndpoint hooks. addOAuthService now sends { name }, removeOAuthService
now sends { name }.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot Bot commented May 29, 2026

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 29, 2026

🦋 Changeset detected

Latest commit: 55c0318

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@rocket.chat/meteor Minor
@rocket.chat/rest-typings Minor
@rocket.chat/core-typings Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 29, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bce29c0a-65ad-4b47-af0c-bec046b04bea

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 29, 2026

Codecov Report

❌ Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.71%. Comparing base (b92bcc7) to head (55c0318).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #40737      +/-   ##
===========================================
- Coverage    69.76%   69.71%   -0.05%     
===========================================
  Files         3327     3327              
  Lines       123134   123134              
  Branches     21963    21951      -12     
===========================================
- Hits         85902    85844      -58     
- Misses       33873    33926      +53     
- Partials      3359     3364       +5     
Flag Coverage Δ
e2e 59.31% <0.00%> (-0.07%) ⬇️
e2e-api 46.15% <ø> (+0.02%) ⬆️
unit 70.44% <ø> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ggazzo ggazzo added this to the 8.6.0 milestone May 29, 2026
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