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

feat: Implement api key management #403

Merged
merged 1 commit into from
Feb 18, 2024

Conversation

raulkele
Copy link
Collaborator

Signed-off-by: Raul-Cristian Kele [email protected]

What type of PR is this?
feature

Which issue does this PR fix:
Closes #373

What does this PR do / Why do we need it:
Implement api key management page
Implement integration with the api key management backend feature

If an issue # is not available please add repro steps and logs from IPAMD/CNI showing the issue:

Testing done on this change:

Automation added to e2e:

Will this break upgrades or downgrades. Has updating a running cluster been tested?:

Does this change require updates to the CNI daemonset config files to work?:

Does this PR introduce any user-facing change?:

- New page available in the user drop-down menu, "Api Keys"

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link

codecov bot commented Dec 14, 2023

Codecov Report

Attention: 127 lines in your changes are missing coverage. Please review.

Comparison is base (e037c6c) 88.77% compared to head (3c38005) 82.82%.

Files Patch % Lines
src/components/User/ApiKeys/ApiKeys.jsx 2.38% 41 Missing ⚠️
src/components/User/ApiKeys/ApiKeyDialog.jsx 2.56% 38 Missing ⚠️
src/components/User/ApiKeys/ApiKeyCard.jsx 5.55% 17 Missing ⚠️
src/components/User/ApiKeys/ApiKeyRevokeDialog.jsx 7.14% 13 Missing ⚠️
src/pages/UserManagementPage.jsx 12.50% 7 Missing ⚠️
...rc/components/User/ApiKeys/ApiKeyConfirmDialog.jsx 14.28% 6 Missing ⚠️
src/components/Header/UserAccountMenu.jsx 0.00% 4 Missing ⚠️
src/api.js 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #403      +/-   ##
==========================================
- Coverage   88.77%   82.82%   -5.95%     
==========================================
  Files          56       62       +6     
  Lines        1737     1875     +138     
  Branches      457      483      +26     
==========================================
+ Hits         1542     1553      +11     
- Misses        184      311     +127     
  Partials       11       11              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@andaaron
Copy link
Contributor

andaaron commented Dec 14, 2023

The option to create API keys should depend on zot configuration,
see this configuration option: https://github.com/project-zot/project-zot.github.io/pull/122/files#diff-af9facd062d9d27c91959f4f6adb3748a913491c414b4afc386e6925861e7263R107

I opened a PR to add this configuration to the results returned by the mgmt API, see project-zot/zot#2138

@andaaron
Copy link
Contributor

Also, refresh doesn't seem to work on the API key page, I get 404 on refresh

@andaaron
Copy link
Contributor

The option to create API keys should depend on zot configuration, see this configuration option: https://github.com/project-zot/project-zot.github.io/pull/122/files#diff-af9facd062d9d27c91959f4f6adb3748a913491c414b4afc386e6925861e7263R107

I opened a PR to add this configuration to the results returned by the mgmt API, see project-zot/zot#2138

@raulkele the PR I mentioned has been merged, now you can check if the API Keys are enabled using the mgmt API, same as the other auth settings.

@raulkele raulkele force-pushed the feat/api-key-management branch 2 times, most recently from 8866d06 to 3a6b7a0 Compare December 17, 2023 17:11
@raulkele
Copy link
Collaborator Author

@andaaron updated the PR to match the api key config setting returned by the mgmt endpoint.
The 404 issue seems to come from zot side. I opened a PR to fix it project-zot/zot#2141

Signed-off-by: Raul-Cristian Kele <[email protected]>
@raulkele raulkele force-pushed the feat/api-key-management branch from 3a6b7a0 to 3c38005 Compare February 18, 2024 13:15
Copy link
Contributor

@andaaron andaaron left a comment

Choose a reason for hiding this comment

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

Looks good, also tested the changes manually.

@andaaron andaaron merged commit 33524ce into project-zot:main Feb 18, 2024
6 of 8 checks passed
andaaron added a commit to andaaron/zot that referenced this pull request Feb 18, 2024
andaaron added a commit to project-zot/zot that referenced this pull request Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feat] ZUI: implement API key management
2 participants