Skip to content

Comments

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

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#47
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 14, 2025

This pull request introduces improvements to the way API credentials are handled and strengthens type safety in the constants definition. The main changes are as follows:

API Credential Injection:

  • Updated the API endpoint configuration in manifest.json to support injecting the api_key into the Authorization header for requests to SimpleMDM. This makes credential handling more secure and flexible.

Type Safety Enhancement:

  • Added as const to the placeholders object in src/constants.ts, which enforces stricter type safety for the constant values.

Summary by Sourcery

Improve app proxy security by restricting where token replacements can occur, adding settingsInjection for the API key in the proxy manifest and tightening constant type safety.

New Features:

  • Allow injecting API key into the Authorization header for SimpleMDM requests

Enhancements:

  • Enforce stricter type safety on placeholder constants by adding as const

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

sourcery-ai bot commented Nov 14, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Enhanced app proxy security by enabling selective API credential injection into the Authorization header for SimpleMDM requests and reinforced constant placeholder type safety with 'as const'.

Class diagram for updated placeholders constant with 'as const'

classDiagram
  class placeholders {
    +API_KEY : "__api_key.base64__"
  }
  %% 'as const' enforces readonly and literal type for API_KEY
Loading

File-Level Changes

Change Details Files
Introduce settingsInjection for API key in proxy configuration
  • Add 'settingsInjection' block under the SimpleMDM endpoint config
  • Map 'api_key' injection to the 'Authorization' header
manifest.json
Enforce immutability of placeholders with 'as const'
  • Annotate the placeholders object with 'as const' to strengthen 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 14, 2025 13:32
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 pull request aims to improve API credential handling security by implementing token replacement restrictions through the Deskpro app proxy mechanism. The changes introduce a settingsInjection configuration in the manifest and add type safety to the constants definition.

  • Added settingsInjection configuration to inject API credentials via the Authorization header in the proxy whitelist
  • Enhanced type safety by adding as const to the placeholders object

Reviewed Changes

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

File Description
manifest.json Adds settingsInjection configuration to inject api_key into the Authorization header for SimpleMDM API requests
src/constants.ts Adds as const assertion to the placeholders object for stricter type safety

💡 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