Skip to content

Generate experimental API commands with compatibility error guidance - #69

Closed
dennis-chen-vanta wants to merge 1 commit into
mainfrom
feat/experimental-api-commands
Closed

dennis-chen-vanta wants to merge 1 commit into
mainfrom
feat/experimental-api-commands

Conversation

@dennis-chen-vanta

Copy link
Copy Markdown
Contributor

Experimental API endpoints can change or disappear without notice. This adds generated commands under vanta experimental <operation-name>, using kebab-case OpenAPI operation IDs so experimental routes do not need to follow stable API naming conventions.

pnpm generate now builds a command catalog from x-vanta-experimental: true operations and /experimental/ paths. Commands preserve API paths and expose parameter flags, JSON bodies, multipart uploads, downloads, and experimental warnings. Endpoint failures include the command, HTTP status, original error, and guidance that the endpoint may have changed or been removed and the CLI may need updating. Authentication, rate-limit, transport, and local errors retain their specific messages.

The checked-in API spec currently has no experimental endpoints, so the production build exposes the namespace with an explanation. Fixtures cover generation and execution without publishing sample endpoints. Stable commands keep their existing behavior.

Validation

  • 148 tests passing with inherited Vanta credential environment settings cleared.
  • pnpm build, pnpm typecheck, and pnpm format:check passed.
  • An isolated tester discovered inputs through standalone binary help and verified dry runs, uploads, JSON input, downloads, and stable commands.
  • Sandboxed binary tests with in-process mock responses verified HTTP 404/405/410/422/500 failures, invalid JSON responses, nonzero exit codes, empty stdout on failure, and preservation of authentication, rate-limit, network, and local input errors. No live API calls were made.

Comment on lines +94 to +96
target = (target as Record<string, unknown>)?.[
part.replace(/~1/g, "/").replace(/~0/g, "~")
];

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium severity blocking issue identified in your code:
Possibility of prototype polluting function detected. By adding or modifying attributes of an object prototype, it is possible to create attributes that exist on every object, or replace critical attributes with malicious ones. This can be problematic if the software depends on existence or non-existence of certain attributes, or uses pre-defined attributes of object prototype (such as hasOwnProperty, toString or valueOf). Possible mitigations might be: freezing the object prototype, using an object without prototypes (via Object.create(null) ), blocking modifications of attributes that resolve to object prototype, using Map instead of object.

Why this might be safe to ignore:

The matched code only reads a property while resolving an internal JSON reference; it does not assign to an object or modify a prototype. Although an unusual reference could access inherited properties, this context does not provide a meaningful prototype-pollution exploit.

To resolve this comment:

🔧 No guidance has been designated for this issue. Fix according to your organization's approved methods.

💬 Ignore this finding

Reply with Semgrep commands to ignore this finding.

  • /fp <comment> for false positive
  • /ar <comment> for acceptable risk
  • /other <comment> for all other reasons

Alternatively, triage in Semgrep AppSec Platform to ignore the finding created by prototype-pollution-loop.

You can view more details about this finding in the Semgrep AppSec Platform.

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