maas-alliance / apis

Example APIs designed to support the MaaS ecosystem.
Apache License 2.0
4 stars 4 forks source link

Initial mock-server #25

Closed brylie closed 5 years ago

brylie commented 5 years ago

We agreed to provide a proof-of-concept server to provide mock data that can be used by developers. This PR is the initial effort to set up the mock server.

brylie commented 5 years ago

I am having difficulty getting past the auth stage. How should we set up or disable authentication for this mock-server?

nighthawk commented 5 years ago

You could use some kind of simple pseudo-authentication. Say, you have endpoints that require a "login token" for the user to be passed as a header. Your mock server could then still require that but it just checks it against a hard-coded valid token, e.g., "X-MaaS-User-Token: test-token".

brylie commented 5 years ago

Here is the security configuration for the Bookings API:

https://github.com/maas-alliance/apis/blob/4e312581989c7a69e7ef194f357c1b2f2b68d070/specifications/booking.yaml#L31-L32

So, it looks like you recommend using this approach? https://connexion.readthedocs.io/en/latest/security.html#apikey-authentication

brylie commented 5 years ago

Ah, I just removed the security definition, since this is a mock-api to serve as a reference.

brylie commented 5 years ago

@nighthawk I would like to keep the scope of this PR relatively small, so we can work in parallel on mock-data functions. Would you mind reviewing and, if permissible, signing-off on this PR?