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

Add profile support for cli #931

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

MonkeyCanCode
Copy link
Contributor

Helper:

➜  polaris git:(cli_profile) ./polaris profiles --help
input: polaris profiles --help
options:
  profiles
    create
      Positional arguments:
        profile
    delete
      Positional arguments:
        profile
    get
      Positional arguments:
        profile
    list
    update
      Positional arguments:
        profile

Create profile:

➜  polaris git:(cli_profile) ./polaris profiles create dev
Polaris Client ID: root
Polaris Client Secret: 712f1f6daf16326fd794607ef1ce90d9
Polaris Host [localhost]:
Polaris Port [8181]:
Polaris profile dev created successfully.

Get profile:

➜  polaris git:(cli_profile) ./polaris profiles get dev
Polaris profile dev: {'client_id': 'root', 'client_secret': '712f1f6daf16326fd794607ef1ce90d9', 'host': 'localhost', 'port': 8181}

List profiles:

➜  polaris git:(cli_profile) ./polaris profiles list
Polaris profiles:
 - dev

Delete profile:

➜  polaris git:(cli_profile) ./polaris profiles create test
Polaris Client ID: 1
Polaris Client Secret: 2
Polaris Host [localhost]:
Polaris Port [8181]:
Polaris profile test created successfully.
➜  polaris git:(cli_profile) ./polaris profiles list
Polaris profiles:
 - dev
 - test
➜  polaris git:(cli_profile) ./polaris profiles delete test
Polaris profile test deleted successfully.
➜  polaris git:(cli_profile) ./polaris profiles list
Polaris profiles:
 - dev

Update profile:

➜  polaris git:(cli_profile) ./polaris profiles create test
Polaris Client ID: 1
Polaris Client Secret: 2
Polaris Host [localhost]:
Polaris Port [8181]:
Polaris profile test created successfully.
➜  polaris git:(cli_profile) ./polaris profiles update test
Polaris Client ID [1]: test
Polaris Client Secret [2]: pass
Polaris Client ID [localhost]:
Polaris Client Secret [8181]:
Polaris profile test updated successfully.
➜  polaris git:(cli_profile) ./polaris profiles get test
Polaris profile test: {'client_id': 'test', 'client_secret': 'pass', 'host': 'localhost', 'port': 8181}

Use profile with CLI:

➜  polaris git:(cli_profile) ./polaris --profile dev principals create test
{"clientId": "abf965119fa69b9c", "clientSecret": "e3eecb2082a90b0e2126d0920f404b3c"}

@flyrain
Copy link
Contributor

flyrain commented Feb 4, 2025

cc @HonahX

Copy link
Contributor

@eric-maynard eric-maynard left a comment

Choose a reason for hiding this comment

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

This looks cool! Can you also be sure to update:
site/content/in-dev/unreleased/command-line-interface.md

@MonkeyCanCode
Copy link
Contributor Author

This looks cool! Can you also be sure to update: site/content/in-dev/unreleased/command-line-interface.md

Sure thing. Yes, this is more like draft PR to see if that is the layout we would like to support before I add more test cases, readme, etc.

@MonkeyCanCode
Copy link
Contributor Author

@eric-maynard @HonahX @flyrain this is ready for review again. thanks.

Copy link
Contributor

@HonahX HonahX left a comment

Choose a reason for hiding this comment

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

LGTM! Just have one non-blocking comment.

@MonkeyCanCode
Copy link
Contributor Author

@eric-maynard do u mind take another look before I merge this?

Copy link
Contributor

@eric-maynard eric-maynard left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for making the additional doc changes

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.

4 participants