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

feat: New --private-key-file flag when creating a resource instance #670

Merged
merged 5 commits into from
Apr 3, 2023

Conversation

janelletavares
Copy link
Contributor

@janelletavares janelletavares commented Mar 30, 2023

Description of change

There are security concerns and UX hiccups around providing the value of a key at the command line rather than the filepath. This adds the file path flag option, and eventually we will deprecate the key value flag.

Also made resource create examples more complete in terms of missing resource types.

Fixes #381

Type of change

  • New feature
  • Bug fix
  • Refactor
  • Documentation

How was this tested?

  • Unit Tests
  • Tested in staging
  • Tested in minikube

Demo

Additional flag in docs:

Flags:
      --ca-cert string            trusted certificates for verifying resource
      --client-cert string        client certificate for authenticating to the resource
      --client-key string         client private key for authenticating to the resource
      --env string                environment (name or UUID) where resource will be created
  -h, --help                      help for create
  -m, --metadata string           resource metadata
      --password string           password
      --private-key-file string   Path to private key file
      --ssh-private-key string    SSH tunneling private key
      --ssh-url string            SSH tunneling address
      --ssl                       use SSL
      --token string              API Token
      --type string               resource type (required)
  -u, --url string                resource url
      --username string           username

Screenshot from 2023-03-30 13-32-18

Additional references

Documentation updated

Copy link
Contributor

@jayjayjpg jayjayjpg left a comment

Choose a reason for hiding this comment

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

This is great, thank you for the command update, as well as the upgrade to the meroxa resources create docs! ✨

SSL bool `long:"ssl" short:"" usage:"use SSL"`
SSHURL string `long:"ssh-url" short:"" usage:"SSH tunneling address"`
SSHPrivateKey string `long:"ssh-private-key" short:"" usage:"SSH tunneling private key"`
PrivateKeyFile string `long:"private-key-file" short:"" usage:"path to private key file"`
Copy link
Contributor

Choose a reason for hiding this comment

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

That's neat and as you already said, super helpful with creating snowflake resources in particular!

cmd/meroxa/root/resources/create.go Outdated Show resolved Hide resolved
@@ -358,3 +366,103 @@ Sign up for the Beta here: https://share.hsforms.com/1Uq6UYoL8Q6eV5QzSiyIQkAc2sm
t.Fatalf("expected output:\n%s\ngot:\n%s", wantError, gotError)
}
}

func TestCreateResourceExecutionPrivateKeyFlags(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice test coverage as always! ✨

@janelletavares janelletavares merged commit 05bda8b into master Apr 3, 2023
@janelletavares janelletavares deleted the ssh-key-file branch April 3, 2023 16:01
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.

Make creating a resource with an SSH key more clear
2 participants