Skip to content

Conversation

zubairirfan96
Copy link
Collaborator

@zubairirfan96 zubairirfan96 commented Aug 29, 2025

Summary by CodeRabbit

  • Bug Fixes

    • Improved OAuth handling to work with both legacy and new configurations, ensuring tokens and headers are correctly applied across setups.
    • Increased robustness of token retrieval in client-credentials flows with sensible fallbacks when certain identifiers are missing.
  • Chores

    • Bumped core package version to 1.5.53.
    • Bumped SDK package version to 1.0.48.
  • Refactor

    • Minor internal adjustments to how OAuth headers are combined and token keys are resolved, with no changes to the public API.

samme-abdul and others added 4 commits August 29, 2025 18:15
Updated APICall and OAuth helper logic to handle both legacy 'oauth_con_id' and new 'oauthService' or component ID for OAuth configuration. This improves compatibility with different OAuth setups and ensures correct token retrieval and header generation.
Add support for new and old  OAuth id for configuration in API calls
Copy link

coderabbitai bot commented Aug 29, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Version bumps in core and SDK packages. Core API call logic updated to activate OAuth using either legacy or new configuration and to append OAuth headers. OAuth helper now resolves token keys and prefixes with fallbacks to component IDs, supporting both configuration shapes without changing public interfaces.

Changes

Cohort / File(s) Summary
Version bumps
packages/core/package.json, packages/sdk/package.json
Incremented versions: core 1.5.52→1.5.53; sdk 1.0.47→1.0.48. No other metadata or code changes.
OAuth activation and headers
packages/core/src/Components/APICall/APICall.class.ts
OAuth activation condition now checks oauth_con_id or oauthService (ignoring empty/'None'); OAuth headers are appended to existing headers array; added clarifying comment.
OAuth token key resolution
packages/core/src/Components/APICall/OAuth.helper.ts
Token key resolution falls back to OAUTH_<componentId>_TOKENS when oauth_con_id absent; client-credentials path prefixes fall back to component ID; comments added; no API surface changes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Client as Caller
  participant APICall as APICall.class
  participant OAuth as OAuth.helper
  participant Store as Token Store

  Client->>APICall: execute(request, config)
  alt OAuth enabled (legacy oauth_con_id or new oauthService)
    APICall->>OAuth: retrieveOAuthTokens(config)
    note right of OAuth: Resolve tokenKey: oauth_con_id<br/>or OAUTH_<componentId>_TOKENS
    OAuth->>Store: get(tokenKey)
    Store-->>OAuth: tokens | null
    alt No tokens
      OAuth->>OAuth: getClientCredentialToken(config)
      note right of OAuth: Prefix from oauth_con_id split<br/>or fallback to componentId
      OAuth->>Store: save(tokenKey, tokens)
      Store-->>OAuth: ok
    end
    OAuth-->>APICall: oauthHeaders
    APICall->>APICall: headers = headers + oauthHeaders
  else OAuth not enabled
    APICall->>APICall: use existing headers
  end
  APICall-->>Client: response
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I twitch my whiskers at version’s lift,
Tiny hops, a tidy drift.
OAuth paths now split in two,
Old and new—both see us through.
Headers stack like carrot rows,
Tokens found where river flows.
Thump—release! Onward code it goes.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge Base: Disabled due to data retention organization setting

💡 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 82f30b3 and bbf6ca6.

📒 Files selected for processing (4)
  • packages/core/package.json (1 hunks)
  • packages/core/src/Components/APICall/APICall.class.ts (1 hunks)
  • packages/core/src/Components/APICall/OAuth.helper.ts (2 hunks)
  • packages/sdk/package.json (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

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 @coderabbit in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbit 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:
    • @coderabbit gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbit 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 @coderabbit help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbit ignore or @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbit summary or @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbit or @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

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.

@zubairirfan96 zubairirfan96 merged commit 653b7ad into main Aug 29, 2025
1 check was pending
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.

2 participants