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

CSM Authorization karavictl requires an admin token #222

Merged
merged 7 commits into from
Mar 31, 2023
Merged

Conversation

alikdell
Copy link
Collaborator

@alikdell alikdell commented Mar 31, 2023

Description

A few sentences describing the overall goals of the pull request's commits.

GitHub Issues

List the GitHub issues impacted by this PR:

GitHub Issue #
#dell/csm#725

Checklist:

  • I have performed a self-review of my own code to ensure there are no formatting, vetting, linting, or security issues
  • I have verified that new and existing unit tests pass locally with my changes
  • I have not allowed coverage numbers to degenerate
  • I have maintained at least 90% code coverage
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • Backward compatibility is not broken

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration

  • karavictl admin token --name Test --jwt-signing-secret secret
    access: XlKaGJHY2lPaUpJVXpJMU5pSXNJ
    refresh: ZXlKaGJHY2lPaUpJVXpJMU5pSXNJb

  • karavi-authorization]# karavictl admin token --name
    Error: flag needs an argument: --name
    Usage:
    karavictl admin token [flags]

                      Flags:
                            --access-token-expiration duration    Expiration time of the access token, e.g. 1m30s (default 1m0s)
                        -h, --help                                help for token
                        -n, --name string                         Admin name
                        -p, --password string                     Specify password, or omit to use stdin
                            --refresh-token-expiration duration   Expiration time of the refresh token, e.g. 48h (default 720h0m0s)
                      
                      Global Flags:
                            --config string   config file (default is $HOME/.karavictl.yaml)
                      
                      flag needs an argument: --name
    
  • karavictl admin token --name Test
    Enter JWT Signing Secret:

}

adminTokenCmd.Flags().StringP("name", "n", "", "Admin name")
adminTokenCmd.Flags().StringP("password", "p", "", "Specify password, or omit to use stdin")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of using "password", this can be "jwtsigningsecret" (or "jwt-signing-secret") or similar to remain consistent with our RPM and Helm installs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

atye
atye previously approved these changes Mar 31, 2023
xuluna
xuluna previously approved these changes Mar 31, 2023
func NewAdminCmd() *cobra.Command {
adminCmd := &cobra.Command{
Use: "admin",
Short: "Generate admin token for use with Karavi",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we use csm instead of karavi?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

@alikdell alikdell dismissed stale reviews from xuluna and atye via afe17d9 March 31, 2023 14:39
@alikdell
Copy link
Collaborator Author

run e2e test

@alikdell alikdell merged commit ffa13cb into main Mar 31, 2023
@alikdell alikdell deleted the pvt/admin-token branch March 31, 2023 16:58
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.

5 participants