Closed
Description
To support a new use case, where we need to create projects for inactive users, we need to implement a new auth scheme in project service and use that only for project creation endpoint to allow the creation of projects by inactive users as well.
Details:
- We will look for
Authorization
header - Technically it would still be using
Bearer
auth scheme but its value would not be a jwt token this time, rather it would be a simple string with following pattern likeuserId_<userId>
i.e.useId_
as prefix to the actualuserId
. - if we find the bearer token starting with
userId_
, we should not use the jwt auth middle ware fromtc-core-library-js
to validate the token and rather use custom logic. - if the passed
userId
is inactive (we can query that using admin access to the identity api), we should authorize the user and ifuserId
is active, we need to throw 403 with appropriate message.