Skip to content

Conversation

@abdelrahman-zaki
Copy link
Contributor

Explain your changes

  • Updated README_management_client.md:
    • Use id= instead of positional user_id in examples.
    • Updated user creation example to use profile and identities structure.
  • Updated management_client_example.py:
    • Calls to get_user now use id=<user_id>.
  • Updated management/README.md:
    • Corrected get_user usage to use id=user_id.

Checklist

🛟 If you need help, consider asking for advice over in the Kinde community.

@coderabbitai
Copy link

coderabbitai bot commented Sep 5, 2025

Walkthrough

Documentation and example updates align ManagementClient user methods to use id instead of user_id and update create_user payload to use a nested profile object. Examples now call get_user(id=...). Management README references management_client.py and clarifies single-user endpoints use query parameter id.

Changes

Cohort / File(s) Summary
Docs: Management client usage and payloads
README_management_client.md, kinde_sdk/management/README.md
Updated method references to get_user(id), update_user(id, **data), delete_user(id). Clarified single-user endpoints use id query param. Adjusted create_user payload to nested profile with given_name/family_name. Management client file referenced as management_client.py.
Examples: Method call update
examples/management_client_example.py
Modified Test 11 to call get_user(id=user_id) instead of positional user_id.

Sequence Diagram(s)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • brettchaldecott
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@codecov
Copy link

codecov bot commented Sep 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
README_management_client.md (2)

89-93: Standardize method list parameter formatting

For consistency with other entries (e.g., get_role(role_id)), prefer get_user(id), update_user(id, **data), delete_user(id) rather than id=user_id in the methods list.

-- `get_user(id=user_id)` - Get a specific user
+- `get_user(id)` - Get a specific user
-- `update_user(id=user_id, **data)` - Update a user
+- `update_user(id, **data)` - Update a user
-- `delete_user(id=user_id)` - Delete a user
+- `delete_user(id)` - Delete a user

147-150: Create user payload update looks good; add a brief migration note

The profile.given_name/family_name structure is clear. Consider a small “Migration” callout showing the old vs new payload to help users adjust quickly.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between a0024de and 4276ab9.

📒 Files selected for processing (3)
  • README_management_client.md (3 hunks)
  • examples/management_client_example.py (1 hunks)
  • kinde_sdk/management/README.md (3 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-21T04:46:50.368Z
Learnt from: KomanRudden
PR: kinde-oss/kinde-python-sdk#101
File: kinde_sdk/auth/permissions.py:6-7
Timestamp: 2025-08-21T04:46:50.368Z
Learning: The kinde_sdk has both frontend and management API modules. The frontend permissions_api.py exists at kinde_sdk/frontend/api/permissions_api.py and contains PermissionsApi class. Using the management API instead of the frontend API for user permissions would be incorrect.

Applied to files:

  • kinde_sdk/management/README.md
🔇 Additional comments (4)
examples/management_client_example.py (1)

183-183: Switch to keyword id looks correct

Using client.get_user(id=user_id) aligns with the updated single-user endpoints. LGTM.

kinde_sdk/management/README.md (2)

10-10: Filename reference is accurate

management_client.py matches the module path used elsewhere. LGTM.


145-145: Error handling example aligns with new signature

management.get_user(id=user_id) is consistent with the API note above. LGTM.

README_management_client.md (1)

56-56: Quick Start uses the new id keyword correctly

get_user(id="user_id") reflects the updated API. LGTM.

Comment on lines +67 to +71
**Note on Users endpoints:** Single-user operations use a query parameter (`id`) with `/api/v1/user`, e.g.:
- `get_user(id)`
- `update_user(id, **data)``PATCH /api/v1/user?id=...`
- `delete_user(id)``DELETE /api/v1/user?id=...`

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix inconsistency with earlier path example for Users single-resource

This section states single-user ops use /api/v1/user?id=..., but the earlier “Dynamic Method Generation” example shows /users/{user_id}. This will confuse readers—please align the earlier snippet to the query-param style.

Apply this doc tweak to the earlier “API_ENDPOINTS” example to reflect single-user via query param:

-    'users': {
-        'list': ('GET', '/users'),
-        'get': ('GET', '/users/{user_id}'),
-        # ...
-    },
+    'users': {
+        'list': ('GET', '/users'),
+        # single-user operations use query param `id` with /user
+        'get': ('GET', '/user'),
+        # ...
+    },

And consider adding a short note near the snippet: “For users, supply id as a query parameter for GET/DELETE and in kwargs for PATCH/POST.”

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
**Note on Users endpoints:** Single-user operations use a query parameter (`id`) with `/api/v1/user`, e.g.:
- `get_user(id)`
- `update_user(id, **data)``PATCH /api/v1/user?id=...`
- `delete_user(id)``DELETE /api/v1/user?id=...`
'users': {
'list': ('GET', '/users'),
# single-user operations use query param `id` with /user
'get': ('GET', '/user'),
# ...
},
🤖 Prompt for AI Agents
In kinde_sdk/management/README.md around lines 67 to 71, the doc currently says
single-user operations use /api/v1/user?id=..., but an earlier "Dynamic Method
Generation" / API_ENDPOINTS example shows /users/{user_id}; update that earlier
snippet to use the query-parameter style (e.g., /api/v1/user with id passed as a
query param) so both sections are consistent, and add a short note next to the
adjusted snippet: "For users, supply id as a query parameter for GET/DELETE and
in kwargs for PATCH/POST."

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