Skip to content

Conversation

@HappyPaul55
Copy link
Contributor

@HappyPaul55 HappyPaul55 commented Nov 17, 2025

This pull request introduces improvements to the configuration and type safety for API integrations and constants. The main changes are the addition of setting injections for OAuth requests in the manifest and enforcing immutability for constants.

Manifest configuration enhancements:

  • Added a settingInjections field to the OAuth API request configuration in manifest.json, specifying how client_id and client_secret should be injected into the request body.
  • Added an empty settingInjections object to the GraphQL API request configuration for future extensibility.

Type safety improvements:

  • Marked placeholders and DESKPRO_LABEL objects as immutable using as const in src/constants.ts, improving type safety and preventing accidental mutation.

Summary by Sourcery

Improve proxy configuration and type safety by introducing explicit setting injections in the manifest and enforcing constant immutability.

New Features:

  • Add settingInjections configuration for OAuth token requests in manifest.json
  • Add placeholder settingInjections object for GraphQL API requests for future extensibility

Enhancements:

  • Mark placeholders and DESKPRO_LABEL as immutable with as const to strengthen type safety

@HappyPaul55 HappyPaul55 requested a review from a team as a code owner November 17, 2025 13:35
@sourcery-ai
Copy link

sourcery-ai bot commented Nov 17, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR hardens proxy security by extending the manifest to support explicit settingInjections for OAuth (with client_id and client_secret in the request body) and an empty stub for GraphQL, and it strengthens type safety by marking key constant objects as immutable via as const.

Entity relationship diagram for updated manifest API request configuration

erDiagram
    MANIFEST {
        string url
        string[] methods
        int timeout
        object settingInjections
    }
    SETTINGINJECTIONS {
        object client_id
        object client_secret
    }
    CLIENT_ID {
        string[] body
    }
    CLIENT_SECRET {
        string[] body
    }
    MANIFEST ||--|{ SETTINGINJECTIONS : contains
    SETTINGINJECTIONS ||--|{ CLIENT_ID : contains
    SETTINGINJECTIONS ||--|{ CLIENT_SECRET : contains
    CLIENT_ID ||--|{ "body[]" : has
    CLIENT_SECRET ||--|{ "body[]" : has
Loading

Class diagram for updated constants immutability

classDiagram
    class placeholders {
        +ACCESS_TOKEN: string
        +CLIENT_ID: string
        +CLIENT_SECRET: string
        <<immutable>>
    }
    class DESKPRO_LABEL {
        +name: string
        +color: string
        <<immutable>>
    }
    class GLOBAL_CLIENT_ID {
        +value: string
    }
Loading

File-Level Changes

Change Details Files
Extend manifest.json with settingInjections for API requests
  • Added settingInjections containing body paths for client_id and client_secret under the OAuth endpoint
  • Injected an empty settingInjections object under the GraphQL endpoint for future use
manifest.json
Enforce immutability on constants
  • Appended as const to the placeholders object
  • Appended as const to the DESKPRO_LABEL object
src/constants.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@github-actions
Copy link

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