Skip to content

fix: normalize OAuth app redirect URI list parsing#41562

Open
AlgoArtist06 wants to merge 2 commits into
RocketChat:developfrom
AlgoArtist06:fix/39762-parse-uri-list-array
Open

fix: normalize OAuth app redirect URI list parsing#41562
AlgoArtist06 wants to merge 2 commits into
RocketChat:developfrom
AlgoArtist06:fix/39762-parse-uri-list-array

Conversation

@AlgoArtist06

@AlgoArtist06 AlgoArtist06 commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Proposed changes (including videos or screenshots)

parseUriList had an inconsistent contract. It short-circuited and returned the raw, untrimmed input whenever the value contained no , or \n, and otherwise returned a trimmed, comma-joined string:

export const parseUriList = (userUri: string) => {
	if (userUri.indexOf('\n') < 0 && userUri.indexOf(',') < 0) {
		return userUri;                 // <-- not trimmed
	}
	...
	return uriList.join(','); // TODO: This is a hack because the original code was returning a string or an array of strings
};

That short-circuit is a real user-facing bug, not just a typing wart. The returned value is persisted as IOAuthApps.redirectUri and later compared with strict equality against the redirect_uri the client sends:

// apps/meteor/server/oauth2-server/oauth.ts
const redirectUris: string[] = client.redirectUri.split(',');
if (typeof req.query.redirect_uri === 'string' && !redirectUris.includes(req.query.redirect_uri)) {
	return res.redirect('/oauth/error/invalid_redirect_uri');
}

So an OAuth app whose Redirect URI was saved with a stray leading/trailing space (trivially easy to introduce by copy/paste into the admin textarea) stored "http://localhost:3000 ", never matched "http://localhost:3000", and failed every authorization with invalid_redirect_uri. Configuring two or more URIs happened to work, because only the multi-entry path trimmed.

Changes

  • parseUriList now has one consistent contract: it always returns the trimmed, non-empty entries as string[], for empty, single, and multiple inputs alike. The TODO hack is gone.
  • addOAuthApp / updateOAuthApp join the parsed entries when persisting, and now validate on entry count (redirectUris.length === 0) instead of on the character length of the joined string.
  • addOAuthApp validates before building the document rather than after, so no partially-built application object is constructed on the invalid path.

Deliberate deviation from the issue

The issue also suggests migrating the stored value to an array. I kept the persisted shape unchanged (comma-joined string), because IOAuthApps.redirectUri is typed string and drives the generated #/components/schemas/IOAuthApps response schema used by oauth-apps.list / .get / .create / .update, and both OAuth2 consumers (server/oauth2-server/oauth.ts, server/oauth2-server/model.ts) do client.redirectUri.split(','). Changing the stored shape would be an API/schema break plus a data migration — out of scope for this bug fix, and a separate call for maintainers. The helper's own contract is now string[] as the issue asks, with the string-joining confined to the persistence boundary.

Issue(s)

Closes #39762

Steps to test or reproduce

Before this change:

  1. Admin → Workspace → OAuth Apps → Add.
  2. Set Redirect URI to http://localhost:3000 (note the single trailing space) and save.
  3. Start an authorization: GET /oauth/authorize?response_type=code&client_id=<clientId>&redirect_uri=http://localhost:3000.
  4. You are redirected to /oauth/error/invalid_redirect_uri.

After this change the URI is stored as http://localhost:3000 and the authorization proceeds. Entering two URIs was unaffected before and after.

Automated coverage added:

  • apps/meteor/tests/unit/server/lib/auth/oauth2-server/parseUriList.spec.ts — 8 cases covering empty, blank, single, single-with-whitespace, trailing separator, comma-separated, newline-separated, and mixed separators with blank entries. All 8 fail on develop and pass with this change.
  • apps/meteor/tests/end-to-end/api/oauthapps.ts — two oauth-apps.create cases asserting the stored redirectUri is trimmed for a single URI and trimmed/normalized for a list.

Further comments

Verified locally (Node 22.22.3):

  • mocha --config ./.mocharc.js — 2129 passing, 0 failing, 12 pending (with TZ=UTC, matching CI; without it, 3 pre-existing timezone-dependent parseMessageSearchQuery specs fail on develop too, unrelated to this change).
  • mocha --config ./.mocharc.definition.js — 149 passing.
  • tsc --noEmit --skipLibCheck — clean.
  • eslint on all changed files — clean.
  • prettier --check on all changed files — clean.

While tracing this I noticed a separate latent issue that I did not touch: EditOauthApp.tsx guards with Array.isArray(data.redirectUri), which suggests some workspaces still hold array-valued redirectUri from the pre-join(',') era. Those documents would throw on client.redirectUri.split(',') in oauth.ts/model.ts. Happy to open a separate issue/PR if maintainers confirm that shape exists in the wild.

Review in cubic

Summary by CodeRabbit

  • Bug Fixes

    • OAuth applications now accept valid authorization requests when redirect URI settings include surrounding whitespace.
    • Redirect URI lists are consistently trimmed, normalized, and validated; blank entries are rejected.
  • Tests

    • Added end-to-end and unit test coverage for redirect URI sanitization on both OAuth app creation and updates, including handling of whitespace, multiple separators, and empty entries.

`parseUriList` short-circuited and returned the raw input whenever it
contained no `,` or `\n`, so a single redirect URI kept any surrounding
whitespace. That value is persisted verbatim and later compared with
strict equality against the `redirect_uri` sent by the client, so an
OAuth app configured with a stray leading/trailing space always failed
authorization with `invalid_redirect_uri`.

Give the helper a single consistent contract: always return the trimmed,
non-empty entries as `string[]`. Callers keep persisting the existing
comma-joined string, and now validate on entry count rather than on the
character length of the joined value.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@AlgoArtist06
AlgoArtist06 requested a review from a team as a code owner July 25, 2026 05:49
@changeset-bot

changeset-bot Bot commented Jul 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 99e2dbc

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 Patch
@rocket.chat/core-typings Patch
@rocket.chat/rest-typings Patch

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

@dionisio-bot

dionisio-bot Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

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

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 214b6baa-fd23-42bf-835d-909d654ac4d1

📥 Commits

Reviewing files that changed from the base of the PR and between 2d3890d and 99e2dbc.

📒 Files selected for processing (1)
  • apps/meteor/tests/end-to-end/api/oauthapps.ts
📜 Recent review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: cubic · AI code reviewer
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/tests/end-to-end/api/oauthapps.ts
🧠 Learnings (3)
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.

Applied to files:

  • apps/meteor/tests/end-to-end/api/oauthapps.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.

Applied to files:

  • apps/meteor/tests/end-to-end/api/oauthapps.ts
📚 Learning: 2026-05-06T12:21:44.083Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 40256
File: apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx:121-149
Timestamp: 2026-05-06T12:21:44.083Z
Learning: Field wrappers in rocket.chat/fuselage-forms (Field, FieldLabel, FieldRow, FieldError, FieldHint) auto-create htmlFor/id associations, aria-describedby, and role="alert" for errors. Do not manually set htmlFor, id, aria-describedby, or role attributes when using these wrappers. This automatic wiring does not apply to plain rocket.chat/fuselage components, which require explicit ID wiring per the accessibility docs. In code reviews, prefer using fuselage-forms wrappers for form fields and verify there is no unnecessary manual ID/aria wiring in files that use these wrappers. If a component uses plain fuselage components, ensure proper id wiring as per docs.

Applied to files:

  • apps/meteor/tests/end-to-end/api/oauthapps.ts
🔇 Additional comments (3)
apps/meteor/tests/end-to-end/api/oauthapps.ts (3)

149-165: LGTM!


167-183: LGTM!


386-402: LGTM!


Walkthrough

OAuth redirect URI parsing now consistently returns trimmed URI arrays. OAuth app creation and updates validate parsed values and persist normalized comma-separated strings, with unit and end-to-end tests covering whitespace, separators, and empty entries.

Changes

OAuth redirect URI handling

Layer / File(s) Summary
Normalize redirect URI lists
apps/meteor/server/lib/auth/oauth2-server/parseUriList.ts, apps/meteor/tests/unit/server/lib/auth/oauth2-server/parseUriList.spec.ts
parseUriList always returns trimmed, non-empty URI strings, with tests for empty input, separators, whitespace, and blank entries.
Apply normalized URIs to OAuth apps
apps/meteor/server/lib/auth/oauth2-server/addOAuthApp.ts, apps/meteor/server/meteor-methods/auth/updateOAuthApp.ts
Creation and updates validate parsed URI arrays and persist normalized comma-separated redirect URIs.
Validate API normalization
apps/meteor/tests/end-to-end/api/oauthapps.ts, .changeset/quiet-pandas-listen.md
End-to-end tests cover single and multiple whitespace-padded URIs, and a patch changeset documents the fix.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested labels: type: bug

Suggested reviewers: tassoevan, kevlehman

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately describes the main change to OAuth redirect URI parsing.
Linked Issues check ✅ Passed The PR makes parseUriList always return trimmed string arrays and adds unit/E2E coverage for empty, single, and multiple inputs.
Out of Scope Changes check ✅ Passed The changes stay focused on OAuth redirect URI parsing, persistence, and test coverage.

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
apps/meteor/tests/end-to-end/api/oauthapps.ts (1)

149-165: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Cover normalization on OAuth app updates too.

These tests cover creation only, while apps/meteor/server/meteor-methods/auth/updateOAuthApp.ts Lines 45-56 also changed the normalization and persistence contract. Add an update test for trimmed and/or multiple redirect URIs to prevent the two paths from diverging.

Also applies to: 167-183

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/meteor/tests/end-to-end/api/oauthapps.ts` around lines 149 - 165, Extend
the OAuth app end-to-end tests near the existing creation normalization cases
with an update scenario that changes an app’s redirect URI using surrounding
whitespace and/or multiple URIs. Call the OAuth app update flow, assert success,
and verify the persisted application redirectUri is normalized consistently with
creation, covering the contract implemented by updateOAuthApp.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@apps/meteor/tests/end-to-end/api/oauthapps.ts`:
- Around line 149-165: Extend the OAuth app end-to-end tests near the existing
creation normalization cases with an update scenario that changes an app’s
redirect URI using surrounding whitespace and/or multiple URIs. Call the OAuth
app update flow, assert success, and verify the persisted application
redirectUri is normalized consistently with creation, covering the contract
implemented by updateOAuthApp.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 43d84acc-5912-406d-8c9e-84d1adb8772d

📥 Commits

Reviewing files that changed from the base of the PR and between 6dc66fb and 2d3890d.

📒 Files selected for processing (6)
  • .changeset/quiet-pandas-listen.md
  • apps/meteor/server/lib/auth/oauth2-server/addOAuthApp.ts
  • apps/meteor/server/lib/auth/oauth2-server/parseUriList.ts
  • apps/meteor/server/meteor-methods/auth/updateOAuthApp.ts
  • apps/meteor/tests/end-to-end/api/oauthapps.ts
  • apps/meteor/tests/unit/server/lib/auth/oauth2-server/parseUriList.spec.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: cubic · AI code reviewer
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/tests/unit/server/lib/auth/oauth2-server/parseUriList.spec.ts
  • apps/meteor/tests/end-to-end/api/oauthapps.ts
  • apps/meteor/server/meteor-methods/auth/updateOAuthApp.ts
  • apps/meteor/server/lib/auth/oauth2-server/parseUriList.ts
  • apps/meteor/server/lib/auth/oauth2-server/addOAuthApp.ts
**/*.spec.ts

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.spec.ts: Use descriptive test names that clearly communicate expected behavior in Playwright tests
Use .spec.ts extension for test files (e.g., login.spec.ts)

Files:

  • apps/meteor/tests/unit/server/lib/auth/oauth2-server/parseUriList.spec.ts
🧠 Learnings (6)
📚 Learning: 2026-02-24T19:22:48.358Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 38493
File: apps/meteor/tests/e2e/omnichannel/omnichannel-send-pdf-transcript.spec.ts:66-67
Timestamp: 2026-02-24T19:22:48.358Z
Learning: In Playwright end-to-end tests (e.g., under apps/meteor/tests/e2e/...), prefer locating elements by translated text (getByText) and ARIA roles (getByRole) over data-qa attributes. If translation values change, update the corresponding test locators accordingly. Never use data-qa locators. This guideline applies to all Playwright e2e test specs in the repository and helps keep tests robust to UI text changes and accessible semantics.

Applied to files:

  • apps/meteor/tests/unit/server/lib/auth/oauth2-server/parseUriList.spec.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.

Applied to files:

  • apps/meteor/tests/unit/server/lib/auth/oauth2-server/parseUriList.spec.ts
  • apps/meteor/tests/end-to-end/api/oauthapps.ts
  • apps/meteor/server/meteor-methods/auth/updateOAuthApp.ts
  • apps/meteor/server/lib/auth/oauth2-server/parseUriList.ts
  • apps/meteor/server/lib/auth/oauth2-server/addOAuthApp.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.

Applied to files:

  • apps/meteor/tests/unit/server/lib/auth/oauth2-server/parseUriList.spec.ts
  • apps/meteor/tests/end-to-end/api/oauthapps.ts
  • apps/meteor/server/meteor-methods/auth/updateOAuthApp.ts
  • apps/meteor/server/lib/auth/oauth2-server/parseUriList.ts
  • apps/meteor/server/lib/auth/oauth2-server/addOAuthApp.ts
📚 Learning: 2026-03-06T18:10:15.268Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 39397
File: packages/gazzodown/src/code/CodeBlock.spec.tsx:47-68
Timestamp: 2026-03-06T18:10:15.268Z
Learning: In tests (especially those using testing-library/dom/jsdom) for Rocket.Chat components, the HTML <code> element has an implicit ARIA role of 'code'. Therefore, screen.getByRole('code') or screen.findByRole('code') will locate <code> elements even without a role attribute. Do not flag findByRole('code') as invalid in reviews; prefer using the implicit role instead of adding role="code" unless necessary for accessibility.

Applied to files:

  • apps/meteor/tests/unit/server/lib/auth/oauth2-server/parseUriList.spec.ts
📚 Learning: 2026-05-06T12:21:44.083Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 40256
File: apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx:121-149
Timestamp: 2026-05-06T12:21:44.083Z
Learning: Field wrappers in rocket.chat/fuselage-forms (Field, FieldLabel, FieldRow, FieldError, FieldHint) auto-create htmlFor/id associations, aria-describedby, and role="alert" for errors. Do not manually set htmlFor, id, aria-describedby, or role attributes when using these wrappers. This automatic wiring does not apply to plain rocket.chat/fuselage components, which require explicit ID wiring per the accessibility docs. In code reviews, prefer using fuselage-forms wrappers for form fields and verify there is no unnecessary manual ID/aria wiring in files that use these wrappers. If a component uses plain fuselage components, ensure proper id wiring as per docs.

Applied to files:

  • apps/meteor/tests/unit/server/lib/auth/oauth2-server/parseUriList.spec.ts
  • apps/meteor/tests/end-to-end/api/oauthapps.ts
  • apps/meteor/server/meteor-methods/auth/updateOAuthApp.ts
  • apps/meteor/server/lib/auth/oauth2-server/parseUriList.ts
  • apps/meteor/server/lib/auth/oauth2-server/addOAuthApp.ts
📚 Learning: 2026-03-16T21:50:37.589Z
Learnt from: amitb0ra
Repo: RocketChat/Rocket.Chat PR: 39676
File: .changeset/migrate-users-register-openapi.md:3-3
Timestamp: 2026-03-16T21:50:37.589Z
Learning: For changes related to OpenAPI migrations in Rocket.Chat/OpenAPI, when removing endpoint types and validators from rocket.chat/rest-typings (e.g., UserRegisterParamsPOST, /v1/users.register) document this as a minor changeset (not breaking) per RocketChat/Rocket.Chat-Open-API#150 Rule 7. Note that the endpoint type is re-exposed via a module augmentation .d.ts in the consuming package (e.g., packages/web-ui-registration/src/users-register.d.ts). In reviews, ensure the changeset clearly states: this is a non-breaking change, the major version should not be bumped, and the changeset reflects a minor version bump. Do not treat this as a breaking change during OpenAPI migrations.

Applied to files:

  • .changeset/quiet-pandas-listen.md
🔇 Additional comments (5)
apps/meteor/server/lib/auth/oauth2-server/parseUriList.ts (1)

1-5: LGTM!

apps/meteor/tests/unit/server/lib/auth/oauth2-server/parseUriList.spec.ts (1)

1-38: LGTM!

apps/meteor/server/lib/auth/oauth2-server/addOAuthApp.ts (1)

46-56: LGTM!

apps/meteor/server/meteor-methods/auth/updateOAuthApp.ts (1)

45-56: LGTM!

.changeset/quiet-pandas-listen.md (1)

1-5: LGTM!

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

Re-trigger cubic

The update path shares `parseUriList` and the comma-joining persistence
step with the create path, but only create was covered. Addresses review
feedback on RocketChat#41562.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@AlgoArtist06

Copy link
Copy Markdown
Contributor Author

Thanks for the reviews.

Addressed@coderabbitai's nitpick about the update path was a fair catch: updateOAuthApp shares parseUriList and the comma-joining persistence step with the create path, so leaving it uncovered would let the two diverge. Added should trim and normalize the redirectUri when updating an app to the [/oauth-apps.update] block in 99e2dbc.

Not addressed — the Docstring Coverage 0% pre-merge warning. There are no JSDoc blocks anywhere in server/lib/auth/oauth2-server/ (addOAuthApp.ts, oauth2-server.ts, index.ts, parseUriList.ts are all at zero), so adding one only to this helper would read as inconsistent with the surrounding code rather than clearer. Happy to add it if a maintainer prefers otherwise.

Note the CI workflow run is sitting at action_required and needs maintainer approval before it can execute — that is what gates the two new end-to-end API cases, which I could not run locally.

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- PR changed files and current head ---'
git status --short
git log -1 --oneline
git diff --name-only HEAD^ HEAD

echo '--- oauthapps test structure and added update test context ---'
ast-grep outline apps/meteor/tests/end-to-end/api/oauthapps.ts --items all --type function --view expanded || true
rg -n -A35 -B12 'should trim and normalize the redirectUri when updating an app|/oauth-apps\.update' apps/meteor/tests/end-to-end/api/oauthapps.ts

echo '--- update implementation context ---'
ast-grep outline apps/meteor/server/meteor-methods/auth/updateOAuthApp.ts --items all --type function --view expanded || true
rg -n -A35 -B10 'parseUriList|redirectUris|redirectUri' apps/meteor/server/meteor-methods/auth/updateOAuthApp.ts

echo '--- JSDoc presence in named helper files ---'
for f in \
  apps/meteor/server/lib/auth/oauth2-server/addOAuthApp.ts \
  apps/meteor/server/lib/auth/oauth2-server/oauth2-server.ts \
  apps/meteor/server/lib/auth/oauth2-server/index.ts \
  apps/meteor/server/lib/auth/oauth2-server/parseUriList.ts; do
  echo "FILE: $f"
  rg -n '^\s*/\*\*' "$f" || true
done

echo '--- coverage/config references (bounded search) ---'
rg -n -i -C2 'docstring.?coverage|jsdoc|typedoc' \
  .coderabbit.yaml .coderabbit.yml package.json turbo.json 2>/dev/null || true

Length of output: 8289


@AlgoArtist06 Thanks—verified.

The new /oauth-apps.update test in 99e2dbc exercises whitespace/newline normalization and asserts the comma-joined persisted value, matching updateOAuthApp’s parseUriList(...).join(',') path. That addresses the update-path coverage finding.

I also confirmed that none of the four neighboring OAuth server files contains JSDoc blocks, and found no relevant documentation-coverage configuration in the checked root config files. I agree that adding documentation solely for this small helper would be inconsistent, so I’m withdrawing that warning. CI execution remains pending maintainer approval.


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent return type in parseUriList leads to incorrect OAuth redirectUri handling

1 participant