Skip to content

Latest commit

 

History

History

endpoints-oas-importer

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Cloud Endpoints to Apigee Proxy Bundle Importer

Cloud Endpoints adds a number of OpenAPI extensions that are used to configure the API proxy behavior.

This tool can be used to import an OpenAPI specification with cloud Cloud Endpoints extensions to generate Apigee proxies.

Prerequisites

  • jq (needed to process OAS in JSON and YAML format)
  • yq (only needed to process OAS in YAML format)

What is currently supported

  • default target backend via x-google-backend.address and x-google-backend.path_translation
  • path level dynamic routing via x-google-backend.address and x-google-backend.path_translation
  • intercept unmatched paths via x-google-allow
  • authenticate towards backend with a Google ID token e.g. for Cloud Run backends
  • authenticate client via JWT through the OAS x-google-... security context extensions

How to use it

The endpoints importer expects the following parameters:

--oas/-o            the path of an OpenAPI 2.0 file in json or yaml format
--base-path/-b      the basepath that should be extracted from
                    the OAS paths and used in the proxy
--name/-n           the name of the proxy to be created
--quiet/-q          (optional) skip the override confirmation

With a JSON OAS file

./import-endpoints.sh --oas ./examples/openapi_test.json --base-path /headers --name oas-import-test

With a YAML OAS file

./import-endpoints.sh --oas ./examples/openapi_test.yaml --base-path /headers --name oas-import-test