remove authCode (scope should suffice), add org and env to bundles.
2 files changed
tree: 588a65dffb0f1087aceec211a455565aaf06db83
  1. cmd/
  2. github/
  3. .gitignore
  4. api.go
  5. api_test.go
  6. apidGatewayDeploy-api.yaml
  7. apidGatewayDeploy_suite_test.go
  8. cover.sh
  9. data.go
  10. deployments.go
  11. glide.lock
  12. glide.yaml
  13. init.go
  14. LICENSE
  15. listener.go
  16. listener_test.go
  17. README.md
README.md

apidVerifyAPIKey

This core plugin for apid responds to apidApigeeSync events and publishes an API that allows clients to deploy and update a locally configured gateway.

Functional description

This plugin simply tracks counters based on called URIs:

  • GET /deployments/current - retrieve current deployment
  • POST /deployments/{id} - update specified deployment

Building and running standalone

First, install prerequisites:

glide install

To run an apid test instance with just this plugin installed, change to the cmd/apidGatewayDeploy folder. From here, you may create an executable with:

go build 

Alternatively, you may run without creating an executable with:

go run main.go 

Command line options:

  • -manifest

If you use the -manifest option, the server will start using a clean database that contains only the deployment manifest specified.

Once the process is running, you should be able to manually give the plugin's API a whirl...

curl -i localhost:9000/deployments/current 
curl -i -X POST localhost:9000/deployments/entityId -d '{ "status": "SUCCESS" }' 

The following may be interesting env vars for configuration:

  • APID_API_PORT
  • APID_GATEWAYDEPLOY_GITHUB_ACCESSTOKEN

Running tests

To run the tests, just run:

go test

To generate coverage, you may run:

./cover.sh

Then open cover.html with your browser to see details.