Skip to content

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

Open
HappyPaul55 wants to merge 2 commits 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#90
HappyPaul55 wants to merge 2 commits intomainfrom
SC-166737/improve-app-proxy-security-by-restricting-where-token-replacements-can-go

Conversation

@HappyPaul55
Copy link
Contributor

@HappyPaul55 HappyPaul55 commented Nov 17, 2025

This pull request introduces improvements to OAuth client secret handling and TypeScript constant definitions. The most significant changes are grouped below:

OAuth Configuration Enhancements:

  • Updated the manifest.json to support dynamic injection of the client_secret into the query string for GitHub API requests, improving flexibility and security in OAuth flows.

Code Quality and Type Safety:

  • Added the as const assertion to the placeholders object in src/services/github/constants.ts, ensuring stronger type safety and preventing accidental mutations.

Summary by Sourcery

Enable secure client secret injection into querystring for GitHub API requests and strengthen type safety of GitHub constants.

New Features:

  • Add settingsInjection in manifest.json to dynamically inject OAuth client_secret into querystring for GitHub API requests

Enhancements:

  • Assert placeholders object as const to enforce stronger type safety

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

sourcery-ai bot commented Nov 17, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Enhances OAuth client_secret handling by introducing dynamic injection into GitHub API requests via manifest.json proxy settings, and strengthens type safety by asserting placeholders as const in the GitHub constants.

Class diagram for updated GitHub constants with 'as const' assertion

classDiagram
  class placeholders {
    CODE : string
    OAUTH_TOKEN_PATH : string
    TOKEN : string
  }
  class BASE_URL {
    <<const>>
    value : "https://api.github.com"
  }
  placeholders <|-- BASE_URL
Loading

File-Level Changes

Change Details Files
Enhanced OAuth proxy configuration for dynamic client_secret injection
  • Added settingsInjection.client_secret.querystring mapping
  • Extended GitHub API proxy entry to support client_secret injection
manifest.json
Improved type safety of placeholders with as const assertion
  • Appended 'as const' assertion to placeholders object
  • Enforced immutability of the placeholders definition
src/services/github/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 AshleyDawson and Copilot and removed request for a team and Copilot November 17, 2025 14:59
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.

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 OAuth security and TypeScript type safety for the GitHub app integration. The changes introduce controlled injection of the OAuth client secret and strengthen compile-time guarantees for constant values.

  • Added settingsInjection configuration to enable secure, platform-managed injection of the OAuth client secret into GitHub OAuth requests
  • Enhanced type safety of the placeholders object with as const assertion to prevent mutations and provide literal types

Reviewed Changes

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

File Description
manifest.json Added settingsInjection configuration to inject the client_secret setting into querystring parameters for GitHub OAuth endpoints
src/services/github/constants.ts Applied as const assertion to the placeholders object to enforce immutability and improve type inference

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

@openhands-ai
Copy link

openhands-ai bot commented Nov 17, 2025

Looks like there are a few issues preventing this PR from being merged!

  • GitHub Actions are failing:
    • Feature Build

If you'd like me to help, just leave a comment, like

@OpenHands please fix the failing actions on PR #90 at branch `SC-166737/improve-app-proxy-security-by-restricting-where-token-replacements-can-go`

Feel free to include any additional details that might help me get this PR into a better state.

You can manage your notification settings

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