SLD-789: Add PowerShell Proxy OpenAPI spec - #199
Khalil O. (Kh4lil) wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds the SHIELD PowerShell Proxy service to this central OpenAPI repository by introducing a new OpenAPI 3.1.1 spec and a generated TypeScript SDK package, and wiring both into existing publishing/documentation workflows.
Changes:
- Added
specs/PowerShell-Proxy.jsondescribingPOST /api/proxy(authenticated allowlisted cmdlet execution). - Added a new TypeScript SDK package at
src/powershellProxy/TypeScript(Kiota-generated client + factory/export surface). - Registered the service in API docs and CI publish/build workflows.
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/powershellProxy/TypeScript/tsconfig.json |
TypeScript build configuration for the new SDK package. |
src/powershellProxy/TypeScript/README.md |
Usage and installation documentation for the new SDK. |
src/powershellProxy/TypeScript/package.json |
Package metadata, scripts, and dependencies for publishing the SDK. |
src/powershellProxy/TypeScript/LICENSE |
MIT license for the new SDK package. |
src/powershellProxy/TypeScript/index.ts |
Public SDK entrypoint: client factory + type exports. |
src/powershellProxy/TypeScript/eslint.config.js |
Lint configuration for the new SDK package. |
src/powershellProxy/TypeScript/.npmrc |
npm configuration for the new SDK package. |
src/powershellProxy/TypeScript/.npmignore |
Publish-time ignore rules for the new SDK package. |
specs/PowerShell-Proxy.json |
New OpenAPI 3.1.1 contract for the PowerShell Proxy endpoint. |
apis.yaml |
Adds PowerShell Proxy to the API catalog for documentation/discovery. |
.github/workflows/Publish-Specs.yml |
Adds PowerShell Proxy spec to the Swagger UI list on GitHub Pages. |
.github/workflows/Publish-NPM.yml |
Adds the new SDK path to the NPM publish matrix. |
.github/workflows/Build.yml |
Adds the new SDK path to the build/generate matrix. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| - name: PowerShellProxy | ||
| sdkPath: 'src/powershellProxy/TypeScript' | ||
| specPath: 'specs/PowerShell-Proxy.json' |
| - name: PowerShellProxy | ||
| sdkPath: 'src/powershellProxy/TypeScript' | ||
| specPath: 'specs/PowerShell-Proxy.json' |
|
|
||
| ```TypeScript | ||
| /** Custom host and endpoint base to as an example for something behind a layer 7 load balancer, E.g. Azure App Gateway or Azure API Gateway. If in debug mode, run against localhost. */ | ||
| const customBaseUrl = debugMode ? new URL('http://localhost:7071') : new URL('https://custom-host.example.com/Ballance/Instance1/'); |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 14 changed files in this pull request and generated no new comments.
Suppressed comments (1)
src/powershellProxy/TypeScript/README.md:62
- Typo/grammar in the example URL and comment: "Ballance" should be "Balance", and the sentence reads as "base to as an example" which is ungrammatical.
/** Custom host and endpoint base to as an example for something behind a layer 7 load balancer, E.g. Azure App Gateway or Azure API Gateway. If in debug mode, run against localhost. */
const customBaseUrl = debugMode ? new URL('http://localhost:7071') : new URL('https://custom-host.example.com/Ballance/Instance1/');
Co-authored-by: Kh4lil <23207971+Kh4lil@users.noreply.github.com>
Pasha Zayko (pasha-zayko)
left a comment
There was a problem hiding this comment.
This is partial review, still a couple of files to get through.
Also, update OpenAPI.code-workspace file so the folder for powershellProxy shows up in the UI in VSC
| }, | ||
| "info": { | ||
| "contact": { | ||
| "email": "elliot_huffman@shi.com", |
There was a problem hiding this comment.
This is not going to be accurate, please use some form of group contact.
As we are migrating into corp the name is likely to become either just SHI or something very specific to our organization (like ASG).
| "value": { | ||
| "description": "Arbitrary JSON-compatible parameter value, retained as opaque data. The server owns command-specific parameter validation; this value is never inspected, typed, or transformed by the contract." | ||
| } | ||
| } |
There was a problem hiding this comment.
examples section missing, it would be a good place to showcase what values "value" prop can be
| "result": { | ||
| "$ref": "#/components/schemas/ProxyExecutionResult" | ||
| } | ||
| } |
There was a problem hiding this comment.
examples section missing
| "minItems": 0, | ||
| "items": { | ||
| "description": "Arbitrary JSON-compatible command output item." | ||
| } |
There was a problem hiding this comment.
examples section missing
| "minItems": 0, | ||
| "items": { | ||
| "$ref": "#/components/schemas/ProxyWarning" | ||
| } |
There was a problem hiding this comment.
examples section missing
| "The requested cmdlet is not allowed." | ||
| ] | ||
| } | ||
| } |
There was a problem hiding this comment.
overall examples section missing for the object
| "result": { | ||
| "$ref": "#/components/schemas/ProxyInfoResult" | ||
| } | ||
| } |
There was a problem hiding this comment.
examples section missing
| "version": { | ||
| "description": "Semantic version of the deployed proxy application.", | ||
| "type": "string", | ||
| "minLength": 1, |
There was a problem hiding this comment.
should this have a defined pattern since its semantic version ?
| }, | ||
| "openapi": "3.1.1", | ||
| "paths": { | ||
| "/api/proxy": { |
There was a problem hiding this comment.
So far for Shield the path had each segment starting with capital first letter. Does this work intend to deviate?
| @@ -0,0 +1,7 @@ | |||
| import { defineConfig, globalIgnores } from 'eslint/config' | |||
| import { eslintConfig } from '@shi-corp/development-utilities/optimized/lint/base.js' | |||
There was a problem hiding this comment.
This should be changed to reference of the new package location SHI - Lab (@Software-Hardware-Integration-Lab)
Pasha Zayko (pasha-zayko)
left a comment
There was a problem hiding this comment.
Additional comments
There was a problem hiding this comment.
I am not certain about the changes here as we have reachability working fine elsewhere without these. I would avoid the modification at the moment unless we have some supported documentation to reference.
There was a problem hiding this comment.
This file should be regenerated before merge
Hi! This is related to this ticket: https://asg-shicorp.atlassian.net/browse/SLD-789?focusedCommentId=49205
The PR adds the PowerShell Proxy to the central OpenAPI repo, I followed the existing SHIELD/Data Gateway/URL Shortener SDK pattern.
POST /api/proxy@software-hardware-integration-lab/sdk-powershell-proxy