Skip to content

Comments

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

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#60
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 17, 2025

This pull request introduces a configuration update to enable dynamic API key injection for People HR API requests and strengthens type safety for constants. The main changes are grouped below:

API Configuration Improvements:

  • Added a settingsInjection block to the People HR API entry in manifest.json, allowing the API key to be injected into the request body under the APIKey field.

Type Safety Enhancements:

  • Updated the placeholders object in src/constants.ts to use as const, ensuring its values are treated as immutable and providing better type safety.

Summary by Sourcery

Allow dynamic API key injection into People HR API requests and strengthen type safety for constants

New Features:

  • Enable dynamic injection of API keys into People HR API requests via manifest.json settingsInjection

Enhancements:

  • Mark placeholders object as immutable with 'as const' for improved type safety

@HappyPaul55 HappyPaul55 requested a review from a team as a code owner November 17, 2025 15:21
@HappyPaul55 HappyPaul55 requested review from Copilot and removed request for a team November 17, 2025 15:21
@sourcery-ai
Copy link

sourcery-ai bot commented Nov 17, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Introduces a dynamic API key injection mechanism for People HR API calls by adding a settingsInjection block in the manifest.json, and bolsters type safety of constant placeholders by marking them immutable with ‘as const’.

Class diagram for updated constants with type safety

classDiagram
  class placeholders {
    +API_KEY: "__api_key__"
    <<immutable>>
  }
Loading

File-Level Changes

Change Details Files
Enable dynamic API key injection for People HR API requests
  • Added settingsInjection block to the API entry
  • Configured api_key to inject into request body under ‘APIKey’
  • Maintained existing timeout setting
manifest.json
Improve type safety of constant placeholders
  • Appended ‘as const’ to the placeholders object
  • Ensured placeholder values are now treated as immutable
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.

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 People HR API integration by implementing restricted token replacement through settingsInjection configuration, ensuring API keys can only be injected into specific request body fields. Additionally, it improves type safety for constants.

  • Added settingsInjection configuration to restrict API key injection to the APIKey field in request bodies
  • Applied as const assertion to the placeholders object for improved type immutability

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 whitelist entry, enabling secure API key injection into request body's APIKey field
src/constants.ts Applies as const assertion to placeholders object for better type safety

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

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

1 participant