Permify / permify-cli

command line interface for Permify
https://docs.permify.co/
Apache License 2.0
5 stars 2 forks source link

Endpoint, Token, Cert Path, and Cert Key Storage for CLI Tool #2

Open tolgaOzen opened 9 months ago

tolgaOzen commented 9 months ago

Description

We need to implement a feature for storing the endpoint, token, cert path, and cert key in the CLI tool. These credentials should be retrievable from the storage for later use during the client creation process.

Location

permify-cli/internal/client/client.go

Proposed Change

Modify the New function in client.go to retrieve stored credentials. The updated function could look something like this:

func New(endpoint string) (*permify.Client, error) {
    // Retrieve credentials from storage
    // ... (code to retrieve credentials)

    client, err := permify.NewClient(
        permify.Config{
            Endpoint: endpoint,
            // Other necessary configurations
        },
        grpc.WithTransportCredentials(insecure.NewCredentials()),
    )
    return client, err
}

Additional Notes

Ensure that the credential retrieval process is secure and efficient. Include error handling for cases where credentials are missing or incorrect.

tolgaOzen commented 9 months ago

/bounty $200

algora-pbc[bot] commented 9 months ago

💎 $200 bounty • Permify.co

Steps to solve:

  1. Start working: Comment /attempt #2 with your implementation plan
  2. Submit work: Create a pull request including /claim #2 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Don't wait to be assigned. A reward will be given for the best PR.

Thank you for contributing to Permify/permify-cli!

Add a bounty • Share on socials

Attempt Started (GMT+0) Solution
🟢 @Pavan-Nambi Dec 8, 2023, 8:56:59 AM WIP
🟢 @wanmail Apr 9, 2024, 3:39:50 PM WIP
🟢 @kumarvikramshahi Jun 22, 2024, 1:44:41 PM WIP
🟢 @Sadaf-A Aug 10, 2024, 4:48:57 AM WIP
🟢 @radasam Aug 24, 2024, 11:58:48 AM WIP
Pavan-Nambi commented 9 months ago

/attempt #2

algora-pbc[bot] commented 9 months ago

@Pavan-Nambi: The Permify.co team prefers to assign a single contributor to the issue rather than let anyone attempt it right away. We recommend waiting for a confirmation from a member before getting started.

Pavan-Nambi commented 9 months ago

hey @tolgaOzen can i work on this?

tolgaOzen commented 9 months ago

@Pavan-Nambi, I have assigned this issue to you. Happy hacking 🚀

Pavan-Nambi commented 9 months ago

hey @tolgaOzen , I am bit new to codebase but by storage u mean to store them in some env/yml files? or something else?

we retrive from something like this config file?? or some vaults?

tolgaOzen commented 9 months ago

Hello @Pavan-Nambi, by storage I mean a way to prevent users from having to repeatedly enter their credentials when connecting to the Permify API. For this, you can use the path ~/.permify/credentials on macOS and Linux, and C:\Users\USERNAME\.permify\credentials on Windows. Here, you can store the endpoint, token, certificate path, and certificate key. When user wants to communicate with Permify APIs, Permify CLI can read these details from there. I hope this is clear.

Pavan-Nambi commented 9 months ago

got it, thanks

Pavan-Nambi commented 9 months ago

@tolgaOzen i've made a pr #8 based on what i understood lmk if i did anything wrong, or if u want me to change anything

Rutik7066 commented 9 months ago

Hey @tolgaOzen can i work on this one?

wanmail commented 5 months ago

/attempt #2

vivasvan1 commented 4 months ago

Putting myself on the queue for collab or in case this needs to be reassigned ✋ @tolgaOzen

snigdha510 commented 3 months ago

Putting myself on the queue for collab or in case this needs to be reassigned ✋ @tolgaOzen

kumarvikramshahi commented 2 months ago

Since the issue is not assigned to anyone, I would like to give it a shot or would be happy to collab if possible. @tolgaOzen Please check if the issue can be reassigned. /attempt #2

connorbrez commented 2 months ago

Hello @tolgaOzen, it doesn't look like anyone is assigned this task. I am interested in working on this, could you assign me this task?

Sadaf-A commented 1 month ago

/attempt #2

Sadaf-A commented 1 month ago

Greetings @tolgaOzen, could you please assign this to me?

radasam commented 3 weeks ago

/attempt #2

radasam commented 3 weeks ago

@tolgaOzen I can see that since this was created a config file has been implemented to store the endpoint, Do we just need to follow the same process for the token + cert, or is this not needed anymore?