[feature] SC-166737/improve app proxy security by restricting where token replacements can go#75
Conversation
…oken replacements can go
Reviewer's guide (collapsed on small PRs)Reviewer's GuideEnhances 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 constantsclassDiagram
class placeholders {
+gitlab_instance_url: string
+TOKEN: string
+TOKEN_PATH: string
<<readonly>>
}
class BASE_URL {
+value: string
}
BASE_URL --|> placeholders
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Build for commit 662d900 deployed to: https://gitlab-pr-75.ci.next.deskprodemo.com URLs: |
There was a problem hiding this comment.
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
settingsInjectionconfiguration to control whereapp_idandclient_secretare injected - Enforces stricter typing on the
placeholdersconstant using TypeScript'sas constassertion
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.
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:
settingsInjectionobject to the GitLab API route inmanifest.json, enabling automatic injection ofapp_idandclient_secretfrom settings into the querystring parametersclient_idandclient_secret.Type Safety and Constants:
placeholdersexport insrc/services/gitlab/constants.tsto useas 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:
Enhancements: