Stigg feature | Stigg feature type | Protected REST endpoints |
---|---|---|
feature-collaborators | Fluctuating | POST /api/collaborators/``DELETE /api/collaborators/:email``POST /api/collaborators/add-seats |
feature-todos | Fluctuating | GET /api/todos/``POST /api/todos/``PUT /api/todos/:id``DELETE /api/todos/:id |
feature-update-todo | Boolean | PUT /api/todos/:id |
PUT /api/todos/:id
is protected by 2 different features.
Let’s translate this table into code, for simplicity we will focus on PUT /api/todos/:id
route only, since it’s protected by 2 entitlements.
The rest of the routes will be included in the full source code attached at the end of the articleWe will add the features definitions along with their fallback:
checkRouteEntitlements
function:
The implementation of the inner functions was omitted for simplicity, and will be included in the full source code attached at the end of the articleThe high-level steps of the authorizer logic: