Skip to content

Comments

[feature] SC-166737/improve app proxy security by restricting where token replacements can go#61

Open
HappyPaul55 wants to merge 1 commit intomainfrom
SC-166737/improve-app-proxy-security-by-restricting-where-token-replacements-can-go
Open

[feature] SC-166737/improve app proxy security by restricting where token replacements can go#61
HappyPaul55 wants to merge 1 commit intomainfrom
SC-166737/improve-app-proxy-security-by-restricting-where-token-replacements-can-go

Conversation

@HappyPaul55
Copy link
Contributor

@HappyPaul55 HappyPaul55 commented Nov 18, 2025

This pull request introduces improvements to the Sellsy integration configuration, focusing on better handling of authentication settings and code clarity. The most important changes are grouped below:

Manifest configuration improvements:

  • Added a settingsInjection property to the OAuth endpoint in manifest.json, enabling automatic injection of client_id and client_secret from settings into the request body. This streamlines authentication setup.
  • Added an empty settingsInjection object to the API endpoint configuration in manifest.json, preparing for future extensibility and ensuring consistency in endpoint definitions.

Codebase clarity:

  • Marked the placeholders object in src/constants.ts as const using TypeScript's as const assertion, improving type safety and preventing accidental mutation.

Summary by Sourcery

Introduce settingsInjection configurations in manifest.json to streamline authentication setup for the Sellsy integration and enforce immutability on the placeholders constant for better code safety

New Features:

  • Enable automatic injection of client_id and client_secret into OAuth request bodies via settingsInjection in manifest.json

Enhancements:

  • Add an empty settingsInjection entry to the Sellsy API endpoint in manifest.json for future extensibility
  • Assert the placeholders object as immutable with TypeScript's as const to improve type safety

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

sourcery-ai bot commented Nov 18, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Extends the Sellsy integration manifest by introducing settingsInjection for automated credential injection in OAuth and API endpoints, and enforces immutability on the placeholders object via a TypeScript const assertion for improved type safety.

Entity relationship diagram for updated manifest endpoint configuration

erDiagram
    SETTINGS_INJECTION {
        string client_id
        string client_secret
    }
    ENDPOINT_OAUTH {
        string url
        string[] methods
        int timeout
        SETTINGS_INJECTION settingsInjection
    }
    ENDPOINT_API {
        string url
        string[] methods
        int timeout
        SETTINGS_INJECTION settingsInjection
    }
    SETTINGS_INJECTION ||--|{ ENDPOINT_OAUTH : "used by"
    SETTINGS_INJECTION ||--|{ ENDPOINT_API : "used by"
Loading

Class diagram for updated placeholders constant

classDiagram
    class placeholders {
        <<const>>
        CLIENT_SECRET : string
        ACCESS_TOKEN : string
        REFRESH_TOKEN : string
    }
Loading

File-Level Changes

Change Details Files
Enhance manifest endpoints with settingsInjection support
  • Add settingsInjection mapping for client_id and client_secret in OAuth endpoint request body
  • Introduce empty settingsInjection object on API endpoint for consistency and future extensibility
manifest.json
Enforce immutability of placeholders
  • Apply TypeScript as const assertion to placeholders object to prevent mutation and improve type safety
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

@HappyPaul55 HappyPaul55 requested review from Copilot and removed request for a team November 18, 2025 14:48
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:

  • Add a brief comment or TODO explaining the purpose of the empty settingsInjection on the API endpoint so its intent is clear to future maintainers.
  • Update the TypeScript schema or types for manifest.json to include the new settingsInjection property and catch misconfigurations at compile time.
  • Ensure there’s validation or fallback logic in the OAuth flow to handle cases where client_id or client_secret might be missing from settings.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Add a brief comment or TODO explaining the purpose of the empty settingsInjection on the API endpoint so its intent is clear to future maintainers.
- Update the TypeScript schema or types for manifest.json to include the new settingsInjection property and catch misconfigurations at compile time.
- Ensure there’s validation or fallback logic in the OAuth flow to handle cases where client_id or client_secret might be missing from settings.

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

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 security for the Sellsy integration by implementing the settingsInjection feature in the proxy configuration, which restricts where sensitive credentials can be injected in API requests. Additionally, it improves type safety for placeholder constants.

Key changes:

  • Added settingsInjection configuration to the OAuth endpoint to automatically inject client_id and client_secret from settings into request bodies
  • Added empty settingsInjection object to the API endpoint for consistency and future extensibility
  • Applied as const assertion to the placeholders object for improved type safety

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
manifest.json Adds settingsInjection configuration to both OAuth and API proxy endpoints to control credential injection
src/constants.ts Marks placeholders object as const with TypeScript assertion for type safety and immutability

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

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