project-zot / zui

UI for zot registry
Apache License 2.0
12 stars 20 forks source link

feat: Implement api key management #403

Closed raulkele closed 7 months ago

raulkele commented 9 months ago

Signed-off-by: Raul-Cristian Kele raulkeleblk@gmail.com

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.

codecov[bot] commented 9 months ago

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 :warning:
src/components/User/ApiKeys/ApiKeyDialog.jsx 2.56% 38 Missing :warning:
src/components/User/ApiKeys/ApiKeyCard.jsx 5.55% 17 Missing :warning:
src/components/User/ApiKeys/ApiKeyRevokeDialog.jsx 7.14% 13 Missing :warning:
src/pages/UserManagementPage.jsx 12.50% 7 Missing :warning:
...rc/components/User/ApiKeys/ApiKeyConfirmDialog.jsx 14.28% 6 Missing :warning:
src/components/Header/UserAccountMenu.jsx 0.00% 4 Missing :warning:
src/api.js 66.66% 1 Missing :warning:
Additional details and impacted files ```diff @@ 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 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

andaaron commented 9 months ago

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 https://github.com/project-zot/zot/pull/2138

andaaron commented 9 months ago

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

andaaron commented 9 months ago

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 commented 9 months ago

@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