Logo: Relish

  1. Sign in

Project: relish

Get API token

  • @api

In order to store people's API keys on their local machine
the relish gem needs an API endpoint to fetch their API key based on email / password.

Scenarios
Look up the API token for a user who exists
Given
a user "[email protected]/password"
When
I GET "/api/token" using the HTTP basic credentials "[email protected]/password"
Then
I should receive a successful plain-text response
And
the response should be the user's API token
Attempt to look up an API token with invalid credentials
Given
a user "[email protected]/password"
When
I GET "/api/token" using the HTTP basic credentials "[email protected]/secret"
Then
I should receive a 403 forbidden response

Last published about 4 years ago by mattwynne.