bbyars / mountebank

Over the wire test doubles
http://www.mbtest.org
MIT License
2k stars 268 forks source link

Add optional API Key security to mb api #699

Closed peterjp80 closed 2 years ago

peterjp80 commented 2 years ago

This PR adds an optional startup option named "apikey". If the API Key is set, calls to the Mountebank API will require a matching value set in the x-api-key header, otherwise an unauthorized response will be returned. This does not affect calls to imposters.

mb start --apikey abc123

peterjp80 commented 2 years ago

@bbyars would you be interested in pulling this into master? This just optionally adds some minimal security to the API so we don't risk exposing certs and keys.

bbyars commented 2 years ago

Thanks!