Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move API key logic from GroupsService to AdminsService #446

Merged
merged 11 commits into from
Mar 29, 2024
Merged

Conversation

0xjei
Copy link
Collaborator

@0xjei 0xjei commented Mar 21, 2024

Description

This PR aims to add functionality for creating, updating, and deleting groups using API keys. The business logic for API keys has been updated to allow for one API key per admin instead of one API key per group. This means that each admin can manage all of their groups with the same API key. Further improvements will be released to support multiple API keys per admin.

In this setting, where there is one key and one admin, we can manage the logic in the admin instead of creating new relations or tables in the database.

This works for any kind of off-chain groups (manual & credential).

The last commit adds the following missing APIs and necessary refactoring to make APISdk and dashboard work

  • createGroup(s) both manually & w/ api key
  • removeGroup(s) both manually & w/ api key
  • updateGroup(s) both manually & w/ api key
  • createAdmin
  • getAdmin
  • updateApiKey

Related Issue

re #318
closes #225
closes #245
closes #448
closes #457

Does this introduce a breaking change?

  • Yes
  • No

This change modifies the underlying logic of API keys from 'Group' to 'Admin', restricting to one API key per 'Admin' instead of per 'Group'. Then, it can be considered a breaking change.

Other information

The most important feature is that an administrator can create, remove and update one or more groups by using his or her own API key.

In addition to the breaking change in the underlying logic, the following minor improvements and fixes have been made:

  • add missing @types/uuid
  • rename AdminService to AdminsService to follow the other services convention
  • add AdminController
  • add AdminsService tests
  • add more tests to GroupsService
  • fancy util for checking admin apikey.
  • dashboard interaction
  • brand new set of APIs

Copy link

vercel bot commented Mar 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
bandada-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 28, 2024 10:06pm

Copy link
Member

@vplasencia vplasencia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great great work! Thank you very much ✨

@0xjei 0xjei requested a review from vplasencia March 28, 2024 22:03
@vplasencia vplasencia merged commit c1b12b9 into dev Mar 29, 2024
5 checks passed
@vplasencia vplasencia deleted the feat/apikeys branch March 31, 2024 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants