Skip to content

Conversation

@HappyPaul55
Copy link
Contributor

@HappyPaul55 HappyPaul55 commented Nov 18, 2025

This pull request introduces improvements to the way configuration and constants are handled for API integrations, focusing on making settings injection and constant definitions more robust and type-safe.

Configuration and settings injection:

  • Updated the manifest.json to support dynamic injection of app_id and client_secret into the body of OAuth requests for MindMeister, improving flexibility and security for credential management.
  • Added explicit empty settingsInjection for MeisterTask API requests in manifest.json, clarifying that no settings need to be injected for these endpoints.

Type safety improvements:

  • Added as const to several constant objects and arrays in src/constants.ts (placeholders, SCOPES, DESKPRO_LABEL), ensuring stricter type inference and preventing accidental mutation.

Summary by Sourcery

Enhance app proxy security by restricting token replacements to specific OAuth request parameters and strengthen type safety on constants

Enhancements:

  • Restrict MindMeister OAuth token replacements to client_id and client_secret in the request body via manifest settingsInjection
  • Explicitly define an empty settingsInjection for MeisterTask API endpoints in manifest.json
  • Add const assertions to placeholders, SCOPES, and DESKPRO_LABEL constants for stricter type inference

@HappyPaul55 HappyPaul55 requested a review from Copilot November 18, 2025 14:24
@HappyPaul55 HappyPaul55 requested a review from a team as a code owner November 18, 2025 14:24
@sourcery-ai
Copy link

sourcery-ai bot commented Nov 18, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Enhance app proxy security by refining settingsInjection rules in the manifest and improve type safety in constant definitions via const assertions.

Entity relationship diagram for updated settingsInjection in manifest.json

erDiagram
    MindMeister_OAuth_Request {
        string url
        string[] methods
        int timeout
        object settingsInjection
    }
    MeisterTask_API_Request {
        string url
        string[] methods
        int timeout
        object settingsInjection
    }
    MindMeister_OAuth_Request ||--|{ SettingsInjection : contains
    SettingsInjection {
        string app_id
        string client_secret
    }
    SettingsInjection ||--|{ InjectionTarget : injects
    InjectionTarget {
        string[] body
    }
    MeisterTask_API_Request ||--|{ EmptySettingsInjection : contains
    EmptySettingsInjection {
    }
Loading

Class diagram for updated constants with const assertions

classDiagram
    class placeholders {
        +ACCESS_TOKEN : string
        +CLIENT_ID : string
        +CLIENT_SECRET : string
    }
    class SCOPES {
        +["userinfo.email", "userinfo.profile", "meistertask"] : string[]
    }
    class DESKPRO_LABEL {
        +name : string
        +color : string
    }
Loading

File-Level Changes

Change Details Files
Refine settingsInjection configuration for API endpoints
  • Add dynamic injection rules for app_id and client_secret in OAuth requests
  • Explicitly define an empty settingsInjection for MeisterTask API endpoints
manifest.json
Enforce stricter type safety on constant definitions
  • Apply as const assertion to the placeholders object
  • Apply as const assertion to the SCOPES array
  • Apply as const assertion 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 - here's some feedback:

  • Ensure that the manifest JSON schema (and any associated TypeScript interfaces) are updated to include the new settingsInjection field so invalid configurations are caught at build time.
  • Consider removing the explicit empty settingsInjection object for MeisterTask if downstream code already defaults to no injection, to reduce noise in the manifest.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Ensure that the manifest JSON schema (and any associated TypeScript interfaces) are updated to include the new settingsInjection field so invalid configurations are caught at build time.
- Consider removing the explicit empty settingsInjection object for MeisterTask if downstream code already defaults to no injection, to reduce noise in the manifest.

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.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request enhances type safety and configuration for OAuth2 token handling in the MeisterTask integration. The changes add stricter TypeScript type inference for constants and configure settings injection for secure credential management in API requests.

  • Added as const assertions to constants for improved type safety and immutability
  • Configured settings injection for OAuth2 credentials in the proxy whitelist
  • Explicitly declared empty settings injection for MeisterTask API endpoints

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/constants.ts Added as const to placeholders, SCOPES, and DESKPRO_LABEL for stricter type inference
manifest.json Configured settings injection for OAuth2 endpoints and explicitly defined empty injection for MeisterTask API

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

github-actions bot commented Nov 18, 2025

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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