apigee/microgateway-config

Error: no auth mechanism defined

frankgreco opened this issue · 6 comments

I cloned the project and then did npm test and got the error, Error: no auth mechanism defined. This is because the edge_micro.bootstrap url requires authentication. Is this the expected behavior. If so, how to I run tests locally?

Hi @frankgreco,

You'll want to set your edgemicro key and secret as the following environment variables:

  • EDGEMICRO_KEY
  • EDGEMICRO_SECRET

Our tests require those credentials to talk with edge services. Apologies for the lack of documentation around this. I'll get that updated ASAP.

Oh. You'll also need to update this line in the tests to point at your personal config:

https://github.com/apigee/microgateway-config/blob/master/tests/it.js#L32

@mdobson thanks. I was able to pass all test cases with the above steps.

However, do you have an abstract/generic config that can be used to test against so I don't have to use my own. I will be making a pull request shortly and am just trying to test my small change before I do that. I shouldn't have to test against my custom config to test a change that would potentially be in master because I would want to make sure it holds true for all config options...which would be handled in the test suite.

Two options to fix this would be:

  1. make the bootstrap url, https://edgemicroservices-us-east-1.apigee.net/edgemicro/bootstrap/organization/ws-poc3/environment/test unauthenticated
  2. mock out what you would get back from Apigee edge so that test cases aren't dependent on external resources.

In my pull request i'll add a test case that mocks out what would be received from Apigee edge so that my change can thoroughly be tested without an external resource

Option 1 isn't feasible. As this is a base URL for interacting with Apigee services. Making this unauthenticated would not be a good idea.

Option 2 sounds great. Look forward to your pull request.

-Matt

@mdobson just made my pull request. Part of it will resolve this issue

Great. I'll review accordingly.