Skip to content

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

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#75
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 how configuration settings are injected into requests and enforces stricter typing for GitLab service constants. The most important changes are grouped below:

Configuration and Settings Injection:

  • Added a settingsInjection object to the GitLab API route in manifest.json, enabling automatic injection of app_id and client_secret from settings into the querystring parameters client_id and client_secret.

Type Safety and Constants:

  • Updated the placeholders export in src/services/gitlab/constants.ts to use as const, ensuring stricter type safety for these constants throughout the codebase.

Summary by Sourcery

Add settingsInjection config to the GitLab API proxy in manifest.json for secure credential injections and enforce stricter typing on GitLab service constants.

New Features:

  • Introduce settingsInjection in manifest.json to map app_id and client_secret into querystring parameters for GitLab API routes

Enhancements:

  • Export placeholders in GitLab constants as const to strengthen type safety

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

sourcery-ai bot commented Nov 18, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Enhances proxy security by injecting app_id and client_secret into the GitLab API route via settingsInjection and improves type safety of GitLab service constants by marking placeholders as readonly with 'as const'.

Class diagram for updated GitLab service constants

classDiagram
  class placeholders {
    +gitlab_instance_url: string
    +TOKEN: string
    +TOKEN_PATH: string
    <<readonly>>
  }
  class BASE_URL {
    +value: string
  }
  BASE_URL --|> placeholders
Loading

File-Level Changes

Change Details Files
Injected settings for automatic credential replacement in manifest routing
  • Added settingsInjection object under the GitLab API route in manifest.json
  • Mapped app_id to the querystring parameter client_id
  • Mapped client_secret to the querystring parameter client_secret
manifest.json
Enforced stricter typing for GitLab constants
  • Appended 'as const' to the placeholders export
  • Ensured placeholders are treated as readonly literal types
src/services/gitlab/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

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 PR enhances security for the GitLab app integration by restricting where sensitive OAuth credentials can be injected during API requests, and improves type safety for service constants.

  • Adds settingsInjection configuration to control where app_id and client_secret are injected
  • Enforces stricter typing on the placeholders constant using TypeScript's as const assertion

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 restrict OAuth credential injection to specific querystring parameters (client_id and client_secret), improving security by limiting where these sensitive values can be used
src/services/gitlab/constants.ts Adds as const assertion to the placeholders export, making the object deeply readonly and providing stricter type safety for constants used throughout the codebase

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

2 participants