New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

@postman/onboarding-gcp-spec-discovery

Package Overview
Dependencies
Maintainers
528
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@postman/onboarding-gcp-spec-discovery

Discover GCP-hosted API specs and hand the result to Postman API onboarding.

latest
Source
npmnpm
Version
1.3.2
Version published
Weekly downloads
0
Maintainers
528
Weekly downloads
 
Created
Source

Postman Onboarding: GCP Spec Discovery

CI Release npm License: MIT

Discover and export OpenAPI specifications from GCP services for Postman onboarding. The action uses repository context and Google Cloud credentials to select an existing specification or export one from a supported GCP provider.

Authentication

Authenticate with Application Default Credentials (ADC) or Workload Identity Federation. In GitHub Actions, use google-github-actions/auth before this action. project-id is required; location defaults to global.

jobs:
  discover:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      id-token: write
    steps:
      - uses: actions/checkout@v7
      - uses: google-github-actions/auth@v3
        with:
          workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
          service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
      - id: spec
        uses: postman-cs/postman-gcp-spec-discovery-action@v1
        with:
          project-id: my-gcp-project
      - run: echo "Resolved ${{ steps.spec.outputs.source-type }} -> ${{ steps.spec.outputs.spec-path }}"

Usage

Resolve one service

- id: spec
  uses: postman-cs/postman-gcp-spec-discovery-action@v1
  with:
    project-id: my-gcp-project

Discover automatically from the gateway (repository association)

Label the deployed GCP resource that owns this repository's API with postman-repo=<owner--repo> (canonicalized slug: lowercase, / folded to --, invalid characters folded to -; for github.com/acme/payments-api the value is acme--payments-api). The action then resolves the right API from repository identity alone — no api-id, no service-name hints:

- id: spec
  uses: postman-cs/postman-gcp-spec-discovery-action@v1
  with:
    project-id: my-gcp-project
    # repo-slug defaults to the CI-detected repository (GITHUB_REPOSITORY);
    # set it only to resolve on behalf of a different repository.

Exactly one conflict-free exact label match auto-selects. Zero matches, multiple matches, or colliding label values stay unresolved (manual-review) with the expected label value printed in the evidence — the action never guesses. Colliding repositories (same canonical value, e.g. case-fold or punctuation collisions, or slugs longer than 63 characters) must set api-id or expected-api-ids-json explicitly.

postman-repo is an owner assertion, not a verified binding: anyone with *.update on the resource can point it at any repository. Keep IAM label-write privileges scoped to the deployment pipeline; ambiguity still always forces manual-review.

A ready-to-distribute per-service-repo workflow using this pattern (adapted from the AWS discovery-hub pattern, but hub-less — each repo discovers its own spec) ships in templates/postman-gcp-onboard.yml. See docs/repository-association.md for marker placement per provider, ambiguity semantics, and WIF bootstrap.

Resolve a known config or Apigee proxy revision

- uses: postman-cs/postman-gcp-spec-discovery-action@v1
  with:
    project-id: my-gcp-project
    api-id: projects/my-gcp-project/locations/global/apis/payments/configs/v1

Export every candidate

- uses: postman-cs/postman-gcp-spec-discovery-action@v1
  with:
    project-id: my-gcp-project
    mode: discover-many

Portable CLI

npx @postman/onboarding-gcp-spec-discovery \
  --project-id "$GCP_PROJECT_ID" \
  --result-json postman-gcp-spec-discovery-result.json \
  --dotenv-path gcp-spec.env

Inputs

NameDescriptionRequiredDefault
modeDiscovery mode: resolve-one selects the single best service for this repository; discover-many exports every exportable candidate.noresolve-one
project-idGoogle Cloud project ID used as the exact discovery and credential preflight scope.yesn/a
locationGoogle Cloud API Gateway location. v1 supports global.noglobal
api-idOptional full API Gateway config, Cloud Endpoints config, Apigee proxy revision, Apigee archive deployment, API Hub spec, legacy Apigee Registry spec, Apigee portal apidoc, Vertex extension, Dialogflow tool, or CES tool/toolset resource name. Use this to bypass broader project discovery.non/a
repo-slugRepository slug (owner/name) used for repository-association matching against postman-repo resource labels. Defaults to the CI-detected repository (GITHUB_REPOSITORY).non/a
expected-service-nameOptional expected service name used as a ranking hint and as the reported service name when resolution stays manual-review.non/a
expected-api-ids-jsonOptional JSON array of full resource names that this repository expects to own; exact matches rank highest during resolution.no[]
service-mapping-jsonOptional JSON object mapping resource names to service names, used to name exported specs for label-incapable providers.no{}
output-dirDirectory under the repository root where generated specs are written.nodiscovered-specs
postman-api-keyOptional service-account PMAK used to mint or re-mint a postman-access-token for telemetry enrichment (account_type). Not used for any GCP or Postman asset operation.non/a
postman-access-tokenOptional Postman service-account access token, used only to enrich anonymous telemetry with the session account_type. When omitted, postman-api-key alone can mint one for the same purpose. Not used for any GCP or Postman asset operation.non/a

Outputs

NameDescription
resolution-jsonJSON resolution result describing status, source type, confidence, and evidence.
resolution-statusResolution status: resolved or unresolved.
source-typeResolved source type: repo-spec, api-gateway-config, cloud-endpoints-config, apigee-proxy, apigee-archive-deployment, api-hub-spec, api-hub-boosted-spec, api-hub-gateway-openapi-spec, apigee-registry-spec, app-integration-trigger, connectors-custom-spec, apigee-portal-doc, vertex-extension-manifest, dialogflow-tool-schema, ces-tool-schema, ces-toolset-schema, iac-embedded, manual-review, or discover-many.
mapping-confidenceNumeric confidence score for the selected service candidate.
spec-pathPath to the resolved or generated specification when available.
spec-files-jsonOptional JSON inventory of the authoritative multi-file definition set (schemaVersion 1). Empty for single-file, unresolved, and discover-many results.
api-idFull resource name of the exported cloud source (API Gateway config, Cloud Endpoints config, Apigee proxy revision, Apigee archive deployment, API Hub spec, legacy Apigee Registry spec, Apigee portal apidoc, Vertex extension, Dialogflow tool, or CES tool/toolset); empty for repo, generated, or IaC-local resolutions.
service-nameResolved service name.
services-jsondiscover-many output: JSON array of exported services.
service-countdiscover-many output: number of exported services.
export-summary-jsonJSON summary of attempted, exported, failed, and skipped candidates.
candidates-jsonRanked ambiguous candidates as JSON when resolution is unresolved with at least two candidates; empty otherwise.
provider-typeProvider that produced the resolved spec: api-gateway, cloud-endpoints, apigee, api-hub, apigee-registry, app-integration, connectors-custom, apigee-portal, vertex-extensions, dialogflow-tools, ces-toolsets, or iac-local.
spec-formatFormat of the resolved spec: openapi-yaml, openapi-json, asyncapi-yaml, asyncapi-json, graphql-sdl, graphql-introspection-json, protobuf, wsdl, or mcp-json.
contract-originCompatibility output; always empty in v1.
contract-metadata-pathCompatibility output; always empty in v1.
variant-countCompatibility output; always empty in v1.
derived-openapi-pathPath to the derived OpenAPI 3.x document when the source was not already OpenAPI 3.x.
derived-openapi-versionOpenAPI version of the derived document: 3.0.3 or 3.1.0.
derived-openapi-completenessWhether the derived OpenAPI document is full or partial.
derived-openapi-formatSerialization format of the derived OpenAPI document: openapi-json.
derived-openapi-evidence-jsonJSON array of evidence strings describing how the derived OpenAPI document was produced.
narrowing-strategyNarrowing tier that produced the candidate ordering: iac-fingerprint, project-correlation, label-prefilter, naming-heuristic, or none.

Supported providers

ProviderSource typeExported format
api-gatewayapi-gateway-configOpenAPI from the full API Gateway config openapiDocuments payload
cloud-endpointscloud-endpoints-configOpenAPI from Cloud Endpoints sourceInfo OPEN_API_* sources
apigeeapigee-proxy / apigee-archive-deploymentOpenAPI from an Apigee proxy revision zip under resources/oas or resources/openapi, or exactly one OpenAPI document in an environment archive deployment original zip
api-hubapi-hub-spec / api-hub-boosted-spec / api-hub-gateway-openapi-specVerbatim OpenAPI via specs:contents, plus distinct Google-generated additional content from fetchAdditionalSpecContent when available
apigee-registryapigee-registry-specLegacy Apigee Registry specs:getContents for existing customer data only (no-longer-supported; not a replacement for API Hub)
app-integrationapp-integration-triggerOpenAPI 3.0 generated server-side by Application Integration generateOpenApiSpec for published integrations with API triggers
connectors-customconnectors-custom-specThe OpenAPI document a custom Integration Connector was built from, fetched from its recorded gs:// specLocation
apigee-portalapigee-portal-docOriginal OpenAPI documentation published through an Apigee portal API document
vertex-extensionsvertex-extension-manifestInline or Cloud Storage OpenAPI from a Vertex AI extension manifest
dialogflow-toolsdialogflow-tool-schemaOriginal OpenAPI text schema stored on a Dialogflow CX tool
ces-toolsetsces-tool-schema / ces-toolset-schemaOriginal OpenAPI schemas from standalone Conversational Agents app tools and toolset-scoped tools
iac-localiac-embedded / path referenceOpenAPI referenced by local Terraform google_api_gateway_api_config or google_endpoints_service resources

The resolver probes providers in this order: api-gateway, cloud-endpoints, apigee, api-hub, apigee-registry, app-integration, connectors-custom, apigee-portal, vertex-extensions, dialogflow-tools, ces-toolsets, iac-local. A committed repo-spec wins before remote discovery. Candidates are narrowed by iac-fingerprint, project-correlation, label-prefilter, then naming-heuristic; the postman-repo label is an ownership signal. Ambiguous or unsupported results are reported for manual review rather than guessed. Agent Engine class methods are runtime metadata and are not probed as OpenAPI sources.

v1 boundaries

v1 does not probe Cloud Run, GKE, or Functions runtime URLs (there is no GCP catalog of runtime specs), does not fetch arbitrary remote URLs, does not synthesize routes from traffic observations (APIM shadow-API discovery yields operations, not contracts), and does not convert gRPC or google.api.Service definitions to OpenAPI. Non-OpenAPI API Hub spec types (proto, WSDL, MCP) surface as manual review candidates rather than being converted.

How it works

  • Validate project-id and Google credentials.
  • Prefer a committed repository specification.
  • Probe supported providers fail-soft and collect candidates.
  • Narrow and rank candidates using repository and project signals.
  • Export and validate the selected OpenAPI document inside output-dir.
  • Emit resolution, export, candidate, and narrowing outputs.

Resources

Telemetry

The action emits one anonymous completion event per run (action name gcp-spec-discovery) through @postman-cse/automation-core. The payload excludes project identifiers, resource names, labels, specification content, URLs, and credentials. Opt out with POSTMAN_ACTIONS_TELEMETRY=off or DO_NOT_TRACK=1.

License

MIT

Keywords

github-action

FAQs

Package last updated on 25 Aug 2026

Related posts