Skip to content

Conversation

kostysh
Copy link
Contributor

@kostysh kostysh commented Jun 26, 2023

In this PR:

  • Added UsersDb class which implements users management API
  • Added NodeApiServer class which implements a tRPC-based API for the protocol Node
  • Added tests for the UsersDb
  • Added tests for the NodeApiServer (routes for a user and admin)

Authorization endpoints:

  • admin.register: Can be called by the Node owner only (using EIP-712 signature);
  • admin.login: Can be called by the Node owner only (using EIP-712 signature); If succeeded, returns an access token in the ACCESS_TOKEN HTTP header;
  • user.register: Can be called by admin only. Accepts login and password;
  • user.login: Log in the user; If succeeded, returns an access token in the ACCESS_TOKEN HTTP header;
  • user.logout: Can be called by an authorized user only; Log out the user;
  • user.delete: Can be called by an authorized user only (in upcoming updates this will be allowed to an admin also); Deletes the user;

All requests that require authorization must include an access token in the authorization (Bearer <access_token>) header format

@kostysh kostysh added A-tests Area: tests D-average Difficulty: average T-feature Type: feature labels Jun 26, 2023
@kostysh kostysh self-assigned this Jun 26, 2023
@kostysh kostysh requested a review from Galeaf11 June 26, 2023 08:03
@kostysh kostysh merged commit 8e6cea9 into develop Jun 29, 2023
@kostysh kostysh deleted the feat/node-trpc-auth branch June 29, 2023 08:53
@github-actions
Copy link
Contributor

🎉 This PR is included in version 0.1.0-beta.18 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tests Area: tests D-average Difficulty: average released on @beta T-feature Type: feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants