Веб-разработка. Разработка с нуля. This service provides the user with a signed JWT token (see example below) that is used by the identify the user. eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZS I6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk 6yJV_adQssw5c Which is translated to: { “sub“: “1234567890“, “name“: “John Doe“, “iat“: 1516239022 } However, this solution doesn’t work for automated CI/CD process s (Jenkins, Github actions, CircleCI…), as these services require n automated login. So, we need to create a new microservice (let’s call t AccessService) that will provide users with automated credentials, based on api-keys. © 2021 Altostra, Inc Example of possible Use Case: - User logs in to the Altostra and requests a new api-key with `read` permissions. This api-key will be used to automate CI/CD processes. - After receiving the api-key, the user installs it on a local machine. - Before running, a CI/CD process sends an authentication request to Altostra’s AccessService with the api-ke . - The AccessService verifies the api-key and generates a signed Altostra JWT token with the original userId and the permissions associated with this api-key. - The CI/CD process executes Altostra commands using the generated JWT token. The Task Your task is to create the new microservice called “AccessService“ to generate API keys for the users and use these api-keys to generate Altostra JWT tokens on demand. The service needs to support the following 4 REST endpoints: ● Create API key ○ POST / ■ Given an authenticated user request (which contains the userId) and a list of required permissions, generate a new api key for the user. ● Use API key ○ POST /authenticate ■ Given a request with a valid api-key: 1. generate a new signed JWT token for the user with the pre-defined set of permissions 2. Update the “last usage“ date of that API key © 2021 Altostra, Inc ● Revoke API key ○ DELETE /{:id} ■ Given an authenticated user request and an API key, revoke the usage of that key. ● Get API keys ○ GET / ■ Given an authenticated user request, get all the API keys of that user in an obstructed form (showing only the last 4 chars, like a credit card) with their status and last recently used date. The outputs ● Implement functionality as described in “The Task” sect on. ● We prefer the solution to be implemented in TypeScript or JavaScript, but you can use any other language. ● Please use your own git repository to manage your code. ● As a final result, please provide a short user guide that describes how to install your code, how to run it and how to get outputs.