Page MenuHomePhabricator

BDD tests: apiTokens
Open, Needs TriagePublic3 Estimated Story Points

Description

This task's scope includes adding BDD tests for the workflows of the API's /apiTokens endpoint.

That includes:

  • POST /apiTokens creates a new token and returns 201 and its details or 400 if the request was not correctly formed
  • GET /apiTokens returns all existing tokens
  • GET /apiTokens/:id returns 200 and details for token id or 404 if token id doesn't exist
  • Access is restricted to authentication with admin token. For all three calls above:
    • Admin can access
    • Non-authenticated user gets 401
    • Regular user gets 403

Event Timeline

jnuche updated the task description. (Show Details)
thcipriani set the point value for this task to 3.Jul 29 2024, 4:50 PM
thcipriani edited projects, added Catalyst (whole 'nother); removed Catalyst.
thcipriani moved this task from Backlog to Ready on the Catalyst (whole 'nother) board.
SDunlap edited projects, added Catalyst (Code Spa); removed Catalyst.

A new suite for the tokens endpoint should be created. But please note the auth/access portion of the new tests can now be added to the auth test suite: https://gitlab.wikimedia.org/repos/qte/catalyst/catalyst-api/-/blob/6908e4f080f85f36f6d2a673f3132df283f3b4b4/bdd/auth/auth_test.go

@EBomani I'm happy to help with this if you need a hand