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

Implement secret management commands #1545

Closed
dalazx opened this issue Jun 11, 2020 · 6 comments · Fixed by #1554
Closed

Implement secret management commands #1545

dalazx opened this issue Jun 11, 2020 · 6 comments · Fixed by #1554
Assignees

Comments

@dalazx
Copy link
Contributor

dalazx commented Jun 11, 2020

neuro secrets shows the list of the user's secrets.

GET https://dev.neu.ro/api/v1/secrets

neuro secrets add adds a new secrets or replaces an existing one given its key.

POST https://dev.neu.ro/api/v1/secrets
{
    "key": "<KEY>",
    "value": "BASE64ENCODED(<VALUE>)"
}

neuro secrets remove removes the secret by its key.

DELETE https://dev.neu.ro/api/v1/secrets/<KEY>

The backend codebase: https://github.com/neuromation/platform-secrets/blob/ca8e3c3eb9ce8168e09c7ec335b613e64e58e83f/platform_secrets/api.py#L92-L122

@dalazx
Copy link
Contributor Author

dalazx commented Jun 11, 2020

@asvetlov @shagren
Any ideas on how to pass binary values via CLI?

@shagren
Copy link
Contributor

shagren commented Jun 11, 2020

You mean this:

curl  https://example.com -X POST --data "{\"key\": \"test\", \"value\": \"$(cat path/file/.ext | base64)'\"}"

?

@dalazx
Copy link
Contributor Author

dalazx commented Jun 11, 2020

yep, but using CLI. I remember you suggested using @filename.ext similarly to curl.
@asvetlov what do you think?

@shagren
Copy link
Contributor

shagren commented Jun 11, 2020

You mean neuro cli.
I see two options:

# curl style
neuro secrets update secret-name text-value
neuro secrets update secret-name @file.ext
#kubectl style
neuro secrets update secret-name text-value
neuro secrets update secret-name --from-file=file.ext 

@dalazx
Copy link
Contributor Author

dalazx commented Jun 11, 2020

thanks @shagren
I like the second variant more. up to @asvetlov to decide.

@asvetlov
Copy link
Contributor

I have no strong preference.
@file.ext is shorter though (and less ambiguous, there is no need to forbid neuro secrets add secret-name --from-file=file.ext secret-value notation).

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 a pull request may close this issue.

3 participants