Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: updated the create or documentation #290

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

brettchaldecott
Copy link

@brettchaldecott brettchaldecott commented Dec 3, 2024

Description (required)

Updated the Ruby Documentation to correct the create organisation API call.

Related issues & labels (optional)

  • Closes #
  • Suggested label:

Summary by CodeRabbit

  • Documentation
    • Clarified installation process for the Kinde SDK in Ruby, including Gemfile entry.
    • Expanded integration section with detailed examples for configuring the SDK in Rails.
    • Updated authentication URL acquisition method to reflect PKCE flow as the default.
    • Enhanced instructions for managing redirects, fetching tokens, and checking user permissions.
    • Refined API reference with simplified method signatures for creating organizations and users.

Copy link
Contributor

coderabbitai bot commented Dec 3, 2024

Walkthrough

The pull request introduces updates to the Ruby SDK documentation, focusing on the integration and usage of the Kinde SDK. Key modifications include clarifications on the installation process, configuration of callback URLs, and environment variables. The documentation now provides enhanced examples for configuring the SDK within Rails applications, updates to the authentication URL parameters, and detailed instructions for managing redirects and tokens. Additionally, method signatures for creating organizations and users have been simplified, improving clarity and usability for developers.

Changes

File Path Change Summary
src/content/docs/developer-tools/sdks/backend/ruby-sdk.mdx Updated installation instructions, clarified environment variable configuration, expanded integration examples, revised authentication URL parameters, enhanced redirect and token management details, and simplified method signatures for organization and user creation.

Possibly related PRs

  • Fix/all docs referring to non-m2m apps connecting to api #184: The changes in the Java SDK documentation may relate to the overall integration of Kinde SDKs, but they do not directly connect to the Ruby SDK modifications regarding method signatures and usage examples.
  • fix(copy): Sign into to Sign in to #220: The correction of "sign into" to "sign in to" in various SDKs, including Ruby, aligns with the focus on improving documentation clarity, which is a common theme in the main PR.
  • fix: remove duplicate org_code #256: The fix for the registration link in the Nuxt documentation, while specific to a different SDK, reflects a similar effort to enhance clarity and accuracy in documentation as seen in the Ruby SDK updates.

Suggested labels

sdk

Suggested reviewers

  • marcosmartini
  • clairekinde11

🐇 In the garden, with joy we play,
The Kinde SDK leads the way.
With clearer paths and tokens bright,
Developers cheer, all feels right!
So hop along, let’s integrate,
With Ruby's charm, we celebrate! 🌼


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai 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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • 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.

@github-actions github-actions bot added the sdk label Dec 3, 2024
Copy link
Contributor

@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: 2

🧹 Outside diff range and nitpick comments (1)
src/content/docs/developer-tools/sdks/backend/ruby-sdk.mdx (1)

459-459: Add security considerations for token storage

The documentation shows examples of storing tokens in Redis without addressing important security considerations:

$redis.set("kinde_m2m_token", result["access_token"], ex: result["expires_in"].to_i)

Consider adding:

  1. A security warning about token storage
  2. Recommendations for encrypting tokens at rest
  3. Best practices for secure token handling
  4. Alternative approaches for different security requirements
  5. Links to security documentation
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 3592aeb and 20704e1.

📒 Files selected for processing (1)
  • src/content/docs/developer-tools/sdks/backend/ruby-sdk.mdx (1 hunks)

@@ -456,7 +456,7 @@ This token can then be used to call any of the endpoints in the [Kinde Manageme
client = KindeSdk.client({"access_token" => $redis.get("kinde_m2m_token")})
client.organizations.get_organizations

client.organizations.create_organization(create_organization_request: {name: "new_org"})
client.organizations.create_organization(name: "new_org")
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Documentation shows inconsistent method signatures for creating organizations

The simplified method signature create_organization(name: "new_org") shown here conflicts with other examples in the documentation that use the original signature create_organization(create_organization_request: {name: "new_org"}). This inconsistency could confuse developers.

Please ensure all examples consistently use the same method signature throughout the documentation. If the signature has been simplified in a new version, consider:

  1. Adding a version note to indicate when this change was introduced
  2. Updating all examples to use the new signature
  3. Adding a migration guide if this is a breaking change

🛠️ Refactor suggestion

Documentation shows multiple patterns for user creation

The documentation presents two different approaches for creating users:

  1. Direct hash creation:
client.users.create_user(
  create_user_request: {
    profile: {given_name: "name", family_name: "surname"},
    identities: [{type: "email", details: {email: "[email protected]"}}]
  }
)
  1. Using model instances:
request = KindeApi::CreateUserRequest.new(...)
client.users.create_user(create_user_request: request)

This could confuse developers about the recommended approach.

Consider:

  1. Clearly indicating which approach is preferred
  2. Adding version information if these represent different SDK versions
  3. Removing deprecated examples if any
  4. Adding examples of the simplified signature mentioned in the AI summary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant