-
Notifications
You must be signed in to change notification settings - Fork 47
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
Skip Loginview create when credentials already exist #275
base: main
Are you sure you want to change the base?
Conversation
To resolve the failing tests I will introduce a mock Keyring since the container has no keyring. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be an easy way to change the login credentials directly.
- Changing login credentials should not need users to change the config.yaml
@bupd Do you thing it would come in handy to create a config subcommand that lets us manipulate the config file? |
Yes this one's good. Should be able to get and set the config without touching the config file. Also it would be great if we could set the current-credential name in config from CLI |
@bupd I added the config sub command and several tests for its functionality. I added some screenshots: Listing Config Items and Setting themClearing config itemsRetrieving config itemsSetting credentials and credentialname supported with --name flag |
@bupd There is still a sign off error in one of the commits. Unfortunately, I would have to rebase over 34 commits from main. Is there an easier way to do this? |
Try squashing the commits |
Signed-off-by: Vadim Bauer <[email protected]> Signed-off-by: Patrick Eschenbach <[email protected]>
* fixed the issue#224 Signed-off-by: ALTHAF <[email protected]> * fixed the issue#224 Signed-off-by: ALTHAF <[email protected]> * some modification in registry Signed-off-by: ALTHAF <[email protected]> --------- Signed-off-by: ALTHAF <[email protected]> Signed-off-by: Patrick Eschenbach <[email protected]>
Signed-off-by: Patrick Eschenbach <[email protected]>
This reverts commit d059ef2. Signed-off-by: Patrick Eschenbach <[email protected]>
* generate credential name Signed-off-by: bupd <[email protected]> * feat: add support for the password-stdin flag in login flow Signed-off-by: karanngi <[email protected]> * fix deps - fixes dependencies Signed-off-by: bupd <[email protected]> * return stdout for tests Signed-off-by: bupd <[email protected]> * update workflow Signed-off-by: bupd <[email protected]> --------- Signed-off-by: bupd <[email protected]> Signed-off-by: karanngi <[email protected]> Co-authored-by: karanngi <[email protected]> Signed-off-by: Patrick Eschenbach <[email protected]>
print test output to screen Signed-off-by: Patrick Eschenbach <[email protected]>
Signed-off-by: ALTHAF <[email protected]> Signed-off-by: Patrick Eschenbach <[email protected]>
* added flags for user list cmd Signed-off-by: ALTHAF <[email protected]> * changed cli flows to the id to name Signed-off-by: ALTHAF <[email protected]> * added flags for artifact list cmd Signed-off-by: ALTHAF <[email protected]> --------- Signed-off-by: ALTHAF <[email protected]> Signed-off-by: Patrick Eschenbach <[email protected]>
* created search sub-command Signed-off-by: ALTHAF <[email protected]> * fix merge conflicts and lint issue Signed-off-by: ALTHAF <[email protected]> --------- Signed-off-by: ALTHAF <[email protected]> Signed-off-by: ALTHAF <[email protected]> Signed-off-by: Patrick Eschenbach <[email protected]>
* Added configpath to loginview; Added configpath validator; Added configpath flag check to determine if given Signed-off-by: qcserestipy <[email protected]> * Added update credentials function Signed-off-by: qcserestipy <[email protected]> * Removed config file from login view; moved credential update or creation to runLogin function Signed-off-by: qcserestipy <[email protected]> * Added PersistentPreRun function to handle config init; Added data file logic that keeps track of the last active config; Made DataFile and ConfigFile Available through global pointer. Adjusted harbor client to retrieve credentials through config pointer; Added funtionality to login run to update credentials after login Signed-off-by: qcserestipy <[email protected]> * Enhanced logging for login subcommand Signed-off-by: qcserestipy <[email protected]> * Improved handling of initConfig function; introduced HARBOR_CLI_CONFIG flag Signed-off-by: qcserestipy <[email protected]> * Improved Data and Config Pointer error handling; Included Mutex functionality for Config and Data Pointer Signed-off-by: qcserestipy <[email protected]> * Added custom sync.Once to handle concurrent config environments in tests; added config tests; adapted login tests to work with new config management Signed-off-by: Patrick Eschenbach <[email protected]> * Added custom sync.Once to handle concurrent config environments in tests; added config tests; adapted login tests to work with new config management Signed-off-by: Patrick Eschenbach <[email protected]> --------- Signed-off-by: qcserestipy <[email protected]> Signed-off-by: Patrick Eschenbach <[email protected]>
Signed-off-by: adwait-godbole <[email protected]> Signed-off-by: Vadim Bauer <[email protected]> Co-authored-by: Vadim Bauer <[email protected]> Signed-off-by: Patrick Eschenbach <[email protected]>
* Support yaml output for 'registry list' Signed-off-by: JianMinTang <[email protected]> * Use gofmt to format all code Signed-off-by: JianMinTang <[email protected]> * fix: Support YAML output for additional commands Signed-off-by: JianMinTang <[email protected]> * fix: Support YAML format on artiface and repo command Signed-off-by: JianMinTang <[email protected]> * fix: Implement a generic function to format output Signed-off-by: JianMinTang <[email protected]> * chore: fix the problem about golangci-lint Signed-off-by: JianMinTang <[email protected]> * AutoGenerate credential name in login (goharbor#250) * generate credential name Signed-off-by: bupd <[email protected]> * feat: add support for the password-stdin flag in login flow Signed-off-by: karanngi <[email protected]> * fix deps - fixes dependencies Signed-off-by: bupd <[email protected]> * return stdout for tests Signed-off-by: bupd <[email protected]> * update workflow Signed-off-by: bupd <[email protected]> --------- Signed-off-by: bupd <[email protected]> Signed-off-by: karanngi <[email protected]> Co-authored-by: karanngi <[email protected]> Signed-off-by: JianMinTang <[email protected]> * print test output to screen (goharbor#254) print test output to screen Signed-off-by: JianMinTang <[email protected]> * Support table format for repo view and add some comments on repo list Signed-off-by: JianMinTang <[email protected]> Add more detail on repo view Signed-off-by: JianMinTang <[email protected]> Support table format on registry view Signed-off-by: JianMinTang <[email protected]> Support table format on project view Signed-off-by: JianMinTang <[email protected]> Fixed tags list Signed-off-by: JianMinTang <[email protected]> Support table format and YAML/JSON output on artifact view Signed-off-by: JianMinTang <[email protected]> Fixed alignment problem Signed-off-by: JianMinTang <[email protected]> Fixed the code format Signed-off-by: JianMinTang <[email protected]> * AutoGenerate credential name in login (goharbor#250) * generate credential name Signed-off-by: bupd <[email protected]> * feat: add support for the password-stdin flag in login flow Signed-off-by: karanngi <[email protected]> * fix deps - fixes dependencies Signed-off-by: bupd <[email protected]> * return stdout for tests Signed-off-by: bupd <[email protected]> * update workflow Signed-off-by: bupd <[email protected]> --------- Signed-off-by: bupd <[email protected]> Signed-off-by: karanngi <[email protected]> Co-authored-by: karanngi <[email protected]> Signed-off-by: JianMinTang <[email protected]> * print test output to screen (goharbor#254) print test output to screen Signed-off-by: JianMinTang <[email protected]> * Support yaml output for 'registry list' Signed-off-by: JianMinTang <[email protected]> Use gofmt to format all code Signed-off-by: JianMinTang <[email protected]> fix: Support YAML output for additional commands Signed-off-by: JianMinTang <[email protected]> fix: Implement a generic function to format output Signed-off-by: JianMinTang <[email protected]> chore: fix the problem about golangci-lint Signed-off-by: JianMinTang <[email protected]> --------- Signed-off-by: JianMinTang <[email protected]> Signed-off-by: bupd <[email protected]> Signed-off-by: karanngi <[email protected]> Co-authored-by: Prasanth B <[email protected]> Co-authored-by: karanngi <[email protected]> Co-authored-by: Vadim Bauer <[email protected]> Signed-off-by: Patrick Eschenbach <[email protected]>
* created schedule cmd Signed-off-by: ALTHAF <[email protected]> * Update cmd.go Signed-off-by: ALTHAF <[email protected]> * Update cmd.go Signed-off-by: ALTHAF <[email protected]> * fix lint error Signed-off-by: ALTHAF <[email protected]> --------- Signed-off-by: ALTHAF <[email protected]> Signed-off-by: ALTHAF <[email protected]> Signed-off-by: Patrick Eschenbach <[email protected]>
Signed-off-by: bupd <[email protected]> Signed-off-by: Patrick Eschenbach <[email protected]>
…p login view creation if some credentials exist Signed-off-by: Patrick Eschenbach <[email protected]>
Signed-off-by: Patrick Eschenbach <[email protected]>
ed config behavior to login docs Signed-off-by: Patrick Eschenbach <[email protected]>
… in the keyring with a specified user and service Signed-off-by: Patrick Eschenbach <[email protected]>
Signed-off-by: Patrick Eschenbach <[email protected]>
Signed-off-by: Patrick Eschenbach <[email protected]>
…ed test for encryption functions; Updated config and login tests with mock key ring provider Signed-off-by: Patrick Eschenbach <[email protected]>
…0.0 (goharbor#189) Bumps [github.com/charmbracelet/bubbles](https://github.com/charmbracelet/bubbles) from 0.18.0 to 0.20.0. - [Release notes](https://github.com/charmbracelet/bubbles/releases) - [Changelog](https://github.com/charmbracelet/bubbles/blob/master/.goreleaser.yml) - [Commits](charmbracelet/bubbles@v0.18.0...v0.20.0) --- updated-dependencies: - dependency-name: github.com/charmbracelet/bubbles dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: Patrick Eschenbach <[email protected]>
Signed-off-by: Patrick Eschenbach <[email protected]>
Signed-off-by: Patrick Eschenbach <[email protected]>
…r config items; added a function to update config on disk Signed-off-by: Patrick Eschenbach <[email protected]>
Signed-off-by: Alan Tang <[email protected]> Signed-off-by: Patrick Eschenbach <[email protected]>
* created new command label and its subcommands Signed-off-by: Althaf66 <[email protected]> * modified label cmd Signed-off-by: Althaf66 <[email protected]> * created update label cmd Signed-off-by: ALTHAF <[email protected]> * modified label update cmd Signed-off-by: ALTHAF <[email protected]> * modified label update cmd Signed-off-by: ALTHAF <[email protected]> * added 32 color choice for label Signed-off-by: ALTHAF <[email protected]> --------- Signed-off-by: Althaf66 <[email protected]> Signed-off-by: ALTHAF <[email protected]> Signed-off-by: ALTHAF <[email protected]> Signed-off-by: Patrick Eschenbach <[email protected]>
* modified registy update command Signed-off-by: Althaf66 <[email protected]> * modified registry cmd Signed-off-by: ALTHAF <[email protected]> * modified registry cmd Signed-off-by: ALTHAF <[email protected]> --------- Signed-off-by: Althaf66 <[email protected]> Signed-off-by: ALTHAF <[email protected]> Signed-off-by: ALTHAF <[email protected]> Signed-off-by: Patrick Eschenbach <[email protected]>
…oharbor#217) Signed-off-by: Patrick Eschenbach <[email protected]>
Signed-off-by: Patrick Eschenbach <[email protected]>
…mmands Signed-off-by: Patrick Eschenbach <[email protected]>
Signed-off-by: Patrick Eschenbach <[email protected]>
Signed-off-by: Patrick Eschenbach <[email protected]>
@qcserestipy did you also add changing between different login accounts via changing the credential name command. Which utilizes the current credential name. |
Signed-off-by: Patrick Eschenbach <[email protected]>
Signed-off-by: Patrick Eschenbach <[email protected]>
…r config items; added a function to update config on disk Signed-off-by: Patrick Eschenbach <[email protected]>
Signed-off-by: Patrick Eschenbach <[email protected]>
69ba8e0
to
a50950f
Compare
Signed-off-by: Patrick Eschenbach <[email protected]>
@bupd I went through the rebase and it worked with a little bit of manual work. You can set the |
Signed-off-by: Patrick Eschenbach <[email protected]>
Signed-off-by: Patrick Eschenbach <[email protected]>
…in config with default config Signed-off-by: Patrick Eschenbach <[email protected]>
Hi @qcserestipy and @bupd, If the command format is as follows, it might be even better.
This is just a suggestion I have for this command. I'm not sure if it would be more user-friendly, but I’d love to hear your thoughts! |
…tch after login execution and credential update Signed-off-by: Patrick Eschenbach <[email protected]>
@bupd @Standing-Man I think a discussion about the context command would be interesting. However, I think than we would have to narrow down the reason for each of the commands. When I was working on the config settings recently and introduced I already thought that the login command also takes over some of those responsibilities. In case we use What is your opinion on this all? To me it is not 100% clear right now which command should take over which functionality since there is a little bit overlap right now. |
Fixes #267
Check for Existing Credentials and Bypass Login View Creation
ToDo: Add base64 encoding for password in config file?