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

feature: Disable primary keypair deletion #2083

Merged
merged 6 commits into from
Dec 7, 2023

Conversation

lizable
Copy link
Contributor

@lizable lizable commented Dec 6, 2023

  • related: backend.ai#1761
  • required Core version: 24.03.0 or newer version
    • You need to upgrade alembic version to the latest by executing the following command in Core directory:
       ./py -m alembic upgrade head
      

FYI:
User management in Backend.AI has two groups, user and keypair.
The relationship btw user and keypair is 1:N relationship, but we regarded as 1:1 relationship.
Both user and keypair has each status and works independently.

In this PR, most of implementation is mainly focused on "main_access_key", considering the relationship between user and keypair (user can have multiple keypairs.)

  • Prevent from deleting main access key by disabling "purge" button (red button in controls column at credentials table)
    • Even if user change the status of icon and requests purge, server returns error.
  • Add Main Access Key tag in Access key column where access key is the main access key
  • Add Main Access Key Column in users tab
  • Show Main Access Key in User detail dialog

Checklist: (if applicable)

  • Mention to the original issue
  • Documentation
  • Minimum required manager version
  • Specific setting for review (eg., KB link, endpoint or how to setup)
  • Minimum requirements to check during review
  • Test case(s) to demonstrate the difference of before/after

Screenshot(s)

Screenshot 2023-12-06 at 6 42 18 PM Screenshot 2023-12-06 at 6 42 23 PM Screenshot 2023-12-06 at 6 42 31 PM

@lizable lizable requested a review from yomybaby December 6, 2023 09:43
@github-actions github-actions bot added the size:L 100~500 LoC label Dec 6, 2023
@lizable lizable requested review from agatha197 and yomybaby and removed request for yomybaby December 6, 2023 09:43
@lizable lizable marked this pull request as ready for review December 6, 2023 09:43
@lizable lizable added this to the 24.03 milestone Dec 6, 2023
Copy link

github-actions bot commented Dec 6, 2023

Coverage report for ./react

St.
Category Percentage Covered / Total
🔴 Statements 3.6% 97/2696
🔴 Branches 3.77% 61/1619
🔴 Functions 1.66% 15/902
🔴 Lines 3.66% 97/2652

Test suite run success

17 tests passing in 4 suites.

Report generated by 🧪jest coverage report action from f0d88e1

Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-2083.d3g9cs6u59b8lw.amplifyapp.com

Copy link
Contributor

@agatha197 agatha197 left a comment

Choose a reason for hiding this comment

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

I suggested just one additional condition. Other things are LGTM.

src/lib/backend.ai-client-esm.ts Show resolved Hide resolved
agatha197

This comment was marked as abuse.

Copy link
Contributor

@agatha197 agatha197 left a comment

Choose a reason for hiding this comment

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

LGTM

@lizable lizable merged commit afa8aca into main Dec 7, 2023
7 checks passed
@lizable lizable deleted the feature/disable-primary-keypair-deletion branch December 7, 2023 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants