feat: add third_party_client_access to organization details edit - #469
feat: add third_party_client_access to organization details edit#469rax7389 wants to merge 2 commits into
Conversation
|
Warning Review limit reached
Next review available in: 33 minutes Limit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?Wait for the limit to reset, then comment An organization admin can change what happens after included review limits in Billing. How do review limits work?CodeRabbit enforces per-developer PR review limits within each organization. For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughThe organization details flow now supports optional third-party client access values. Configuration controls visibility, read-only state, and defaults. The form renders allow/block options, validates submissions, maps values to API requests, and includes localization and tests. ChangesOrganization third-party access
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant OrganizationConfig
participant useConfig
participant useOrganizationDetailsEdit
participant OrganizationDetails
participant ThirdPartyAccessDetails
participant OrganizationAPI
OrganizationConfig->>useConfig: provide access configuration
useConfig->>useOrganizationDetailsEdit: return visibility, read-only state, and default
useOrganizationDetailsEdit->>OrganizationDetails: pass access configuration
OrganizationDetails->>ThirdPartyAccessDetails: render configured form section
ThirdPartyAccessDetails->>OrganizationDetails: update allow or block form value
OrganizationDetails->>OrganizationAPI: submit mapped third_party_client_access
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (2)
packages/react/src/hooks/my-organization/shared/services/__tests__/use-config-service.test.ts (1)
154-237: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse a
when...condition group for the new cases.The block starts with
describe('thirdPartyAccess', ...). Rename it to a condition group such asdescribe('when evaluating third_party_client_access', ...). Use action-orienteditnames such asreturns false when ....As per coding guidelines, condition groups must use
when..., anditnames must describe the action.🤖 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 `@packages/react/src/hooks/my-organization/shared/services/__tests__/use-config-service.test.ts` around lines 154 - 237, Rename the thirdPartyAccess describe block to a when-prefixed condition group describing evaluation of third_party_client_access, and update each test name to use action-oriented wording such as “returns … when …” while preserving the existing assertions and scenarios.Source: Coding guidelines
packages/react/src/tests/utils/__mocks__/my-organization/config/config.mocks.ts (1)
17-19: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winKeep one canonical configuration mock under
internals.This file duplicates
createMockUseConfigfrompackages/react/src/internals/__mocks__/my-organization/config/config.mocks.ts. The two factories now duplicate the same three fields and can drift. Reuse theinternalsfactory instead of maintaining two copies.As per coding guidelines, reusable React test utilities and mocks must live under
internals, including shared mocks underinternals/__mocks__/.🤖 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 `@packages/react/src/tests/utils/__mocks__/my-organization/config/config.mocks.ts` around lines 17 - 19, Remove the duplicate createMockUseConfig factory from the tests utilities mock and reuse the canonical factory exported from internals/__mocks__/my-organization/config/config.mocks.ts. Update imports and consumers as needed so all tests use that shared mock, leaving configuration fields maintained in only the internals factory.Source: Coding guidelines
🤖 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.
Inline comments:
In `@packages/core/package.json`:
- Line 55: Update the dependency entry in packages/core/package.json to use a
published `@auth0/myorganization-js` version, and move the local
../../auth0-myorganization-js-1.1.0.tgz reference into a development-only
override so frozen-lockfile installs and publishing work from a clean checkout.
In `@packages/core/src/i18n/translations/en-US.json`:
- Line 903: Update the title value at the affected translation entry from “Third
party Application Access” to “Third-Party Application Access,” matching the
capitalization used by the corresponding entries around lines 256-257.
In
`@packages/core/src/services/my-organization/organization-management/organization-details-mappers.ts`:
- Line 27: Update the organization details mapping methods fromAPI and toAPI to
validate third_party_client_access at both API boundaries using the appropriate
Zod schemas from packages/core/src/schemas/. Parse the response value before
mapping it in fromAPI and parse the request value before sending it in toAPI,
preserving the existing mapping behavior for valid data.
In
`@packages/react/src/hooks/my-organization/__tests__/use-organization-details-edit.test.ts`:
- Around line 24-26: Extend the test setup around the mocked useConfig and the
public organization-details hook to return non-default configuration values,
then assert that showThirdPartyAccess, isThirdPartyAccessReadOnly, and
thirdPartyAccessDefaultValue in the hook result match those values.
In `@packages/react/src/hooks/my-organization/use-organization-details-edit.ts`:
- Around line 34-35: Update the useOrganizationDetailsEdit hook to destructure
isLoadingConfig from useConfig and pass isFetchLoading || isLoadingConfig to
GateKeeper, preventing form rendering until the third-party access default is
available.
---
Nitpick comments:
In
`@packages/react/src/hooks/my-organization/shared/services/__tests__/use-config-service.test.ts`:
- Around line 154-237: Rename the thirdPartyAccess describe block to a
when-prefixed condition group describing evaluation of
third_party_client_access, and update each test name to use action-oriented
wording such as “returns … when …” while preserving the existing assertions and
scenarios.
In
`@packages/react/src/tests/utils/__mocks__/my-organization/config/config.mocks.ts`:
- Around line 17-19: Remove the duplicate createMockUseConfig factory from the
tests utilities mock and reuse the canonical factory exported from
internals/__mocks__/my-organization/config/config.mocks.ts. Update imports and
consumers as needed so all tests use that shared mock, leaving configuration
fields maintained in only the internals factory.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: b5a74f01-4dc8-4f64-8caf-2ebfeb21dc71
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (21)
packages/core/package.jsonpackages/core/src/i18n/custom-messages/my-organization/organization-management/organization-details-types.tspackages/core/src/i18n/translations/en-US.jsonpackages/core/src/schemas/my-organization/organization-management/organization-details-schema.tspackages/core/src/services/my-organization/organization-management/organization-details-mappers.tspackages/core/src/services/my-organization/organization-management/organization-details-types.tspackages/react/src/components/auth0/my-organization/organization-details-edit.tsxpackages/react/src/components/auth0/my-organization/shared/organization-management/organization-details/__tests__/organization-details.test.tsxpackages/react/src/components/auth0/my-organization/shared/organization-management/organization-details/__tests__/third-party-access-details.test.tsxpackages/react/src/components/auth0/my-organization/shared/organization-management/organization-details/organization-details.tsxpackages/react/src/components/auth0/my-organization/shared/organization-management/organization-details/third-party-access-details.tsxpackages/react/src/hooks/my-organization/__tests__/use-organization-details-edit.test.tspackages/react/src/hooks/my-organization/shared/services/__tests__/use-config-service.test.tspackages/react/src/hooks/my-organization/shared/services/use-config-service.tspackages/react/src/hooks/my-organization/use-organization-details-edit.tspackages/react/src/internals/__mocks__/my-organization/config/config.mocks.tspackages/react/src/tests/utils/__mocks__/my-organization/config/config.mocks.tspackages/react/src/tests/utils/__mocks__/my-organization/organization-management/organization-details.mocks.tspackages/react/src/types/my-organization/config/config-types.tspackages/react/src/types/my-organization/organization-management/organization-details-edit-types.tspackages/react/src/types/my-organization/organization-management/organization-details-types.ts
| "dependencies": { | ||
| "@auth0/myaccount-js": "1.0.0-beta.2", | ||
| "@auth0/myorganization-js": "1.1.0", | ||
| "@auth0/myorganization-js": "../../auth0-myorganization-js-1.1.0.tgz", |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
tarball='auth0-myorganization-js-1.1.0.tgz'
test -f "$tarball"
git ls-files --error-unmatch "$tarball" >/dev/nullRepository: auth0/auth0-ui-components
Length of output: 163
🏁 Script executed:
set -euo pipefail
printf '%s\n' '--- packages/core/package.json ---'
sed -n '1,90p' packages/core/package.json
printf '%s\n' '--- package and workspace metadata ---'
rg -n --hidden -g '!node_modules' -g '!dist' -g '!build' \
'"(workspaces|packageManager|publishConfig|version|`@auth0/myorganization-js`)"|auth0-myorganization-js-1\.1\.0\.tgz' \
package.json packages package-lock.json npm-shrinkwrap.json pnpm-lock.yaml yarn.lock .npmrc .github 2>/dev/null || true
printf '%s\n' '--- matching artifacts and tracked files ---'
find .. -maxdepth 3 -type f -name 'auth0-myorganization-js-1.1.0.tgz' -print
git ls-files | rg '(^|/)auth0-myorganization-js-1\.1\.0\.tgz$|(^|/)(package-lock\.json|npm-shrinkwrap\.json|pnpm-lock\.yaml|yarn\.lock)$' || true
printf '%s\n' '--- publish-related configuration ---'
rg -n --hidden -g '!node_modules' -g '!dist' -g '!build' \
'npm publish|pnpm publish|yarn publish|npm pack|publishConfig|files:' \
package.json packages .github .npmrc 2>/dev/null || trueRepository: auth0/auth0-ui-components
Length of output: 5763
🏁 Script executed:
set -euo pipefail
printf '%s\n' '--- publish workflow ---'
sed -n '150,260p' .github/workflows/publish-public-npm.yml
printf '%s\n' '--- root workspace metadata ---'
sed -n '1,90p' package.json
printf '%s\n' '--- core lockfile importer ---'
sed -n '530,565p' pnpm-lock.yaml
printf '%s\n' '--- package publish configuration ---'
rg -n -C 5 'pkg\.publishConfig|npm publish|pnpm install|pnpm deploy|packages/core|universal-components-core' .github/workflows/publish-public-npm.yml package.json packages/core/package.jsonRepository: auth0/auth0-ui-components
Length of output: 30050
Keep the dependency publishable.
The publish workflow runs pnpm install --frozen-lockfile before npm publish. The referenced tarball is not present or tracked, so a clean workflow checkout cannot resolve the dependency. Use a published @auth0/myorganization-js version and keep the tarball in a development-only override.
🤖 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 `@packages/core/package.json` at line 55, Update the dependency entry in
packages/core/package.json to use a published `@auth0/myorganization-js` version,
and move the local ../../auth0-myorganization-js-1.1.0.tgz reference into a
development-only override so frozen-lockfile installs and publishing work from a
clean checkout.
There was a problem hiding this comment.
this will be handled before the merge
There was a problem hiding this comment.
@rax7389, thanks for the update. Please update the dependency and lockfile before merge. The thread remains open until the clean-checkout install and publish path are valid.
You are interacting with an AI system.
0033fc5 to
0b308b0
Compare
c85ca91 to
306c96a
Compare
Summary
Add
third_party_client_accesssetting to Organization Details Edit screen, allowing organizations to control whether third-party applications can authenticate their users.Why
Organizations need the ability to control third-party application access at the organization level. This is Part 1 of the 3P Client Access feature (UIC-1380).
What
ThirdPartyAccessDetailscomponent with RadioGroup (Block/Allow options)useConfighook to exposeshowThirdPartyAccessandthirdPartyAccessconfigPackages
packages/corepackages/reactexamplesTesting
Checklist
Contributing
Summary by CodeRabbit
New Features
Tests