From f10975643b462772288efb8d37049ce29b48528e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Mon, 17 Jul 2023 17:50:32 +0200 Subject: [PATCH] Fix --- .../test-all-usage-account-usage.golden | 3 - internal/namespaces/account/v3/custom.go | 93 -------------- internal/namespaces/account/v3/custom_test.go | 38 ------ internal/namespaces/account/v3/error.go | 21 ---- .../test-init-command-simple.cassette.yaml | 119 ------------------ .../testdata/test-init-command-simple.golden | 8 -- ...-ssh-key-init-command-simple.cassette.yaml | 82 ------------ 7 files changed, 364 deletions(-) delete mode 100644 internal/namespaces/account/v3/custom_test.go delete mode 100644 internal/namespaces/account/v3/error.go delete mode 100644 internal/namespaces/account/v3/testdata/test-init-command-simple.cassette.yaml delete mode 100644 internal/namespaces/account/v3/testdata/test-init-command-simple.golden delete mode 100644 internal/namespaces/account/v3/testdata/test-ssh-key-init-command-simple.cassette.yaml diff --git a/cmd/scw/testdata/test-all-usage-account-usage.golden b/cmd/scw/testdata/test-all-usage-account-usage.golden index 7ec9ab4476..74d9941231 100644 --- a/cmd/scw/testdata/test-all-usage-account-usage.golden +++ b/cmd/scw/testdata/test-all-usage-account-usage.golden @@ -8,9 +8,6 @@ USAGE: AVAILABLE COMMANDS: project Project management commands -WORKFLOW COMMANDS: - ssh-key Initialize SSH key - FLAGS: -h, --help help for account diff --git a/internal/namespaces/account/v3/custom.go b/internal/namespaces/account/v3/custom.go index 2059430ba6..183ebb09e5 100644 --- a/internal/namespaces/account/v3/custom.go +++ b/internal/namespaces/account/v3/custom.go @@ -1,104 +1,11 @@ package account import ( - "context" - "os" - "path" - "reflect" - "strings" - - "github.com/scaleway/scaleway-cli/v2/internal/args" "github.com/scaleway/scaleway-cli/v2/internal/core" - "github.com/scaleway/scaleway-cli/v2/internal/interactive" - iam "github.com/scaleway/scaleway-sdk-go/api/iam/v1alpha1" - "github.com/scaleway/scaleway-sdk-go/scw" ) func GetCommands() *core.Commands { commands := GetGeneratedCommands() - commands.Merge(core.NewCommands( - initCommand(), - )) return commands } - -func initCommand() *core.Command { - return &core.Command{ - Short: `Initialize SSH key`, - Long: `Initialize SSH key.`, - Namespace: "account", - Resource: "ssh-key", - Verb: "init", - Groups: []string{"workflow"}, - ArgsType: reflect.TypeOf(args.RawArgs{}), - ArgSpecs: core.ArgSpecs{}, - Run: InitRun, - } -} - -func InitRun(ctx context.Context, _ interface{}) (i interface{}, e error) { - // Get default local SSH key - var shortenedFilename string - var err error - var localSSHKeyContent []byte - for _, keyName := range [3]string{"id_ecdsa.pub", "id_ed25519.pub", "id_rsa.pub"} { - // element is the element from someSlice for where we are - relativePath := path.Join(".ssh", keyName) - filename := path.Join(core.ExtractUserHomeDir(ctx), relativePath) - shortenedFilename = "~/" + relativePath - localSSHKeyContent, err = os.ReadFile(filename) - // If we managed to load an ssh key, let's stop there - if err == nil { - break - } - } - addKeyInstructions := `scw account ssh-key add name=my-key key="$(cat path/to/my/key.pub)"` - if err != nil && os.IsNotExist(err) { - return nil, sshKeyNotFound(shortenedFilename, addKeyInstructions) - } - - // Get all SSH keys from Scaleway - client := core.ExtractClient(ctx) - api := iam.NewAPI(client) - listSSHKeysResponse, err := api.ListSSHKeys(&iam.ListSSHKeysRequest{}, scw.WithAllPages()) - if err != nil { - return nil, err - } - - // Early exit if the SSH key is present locally and on Scaleway - for _, SSHKey := range listSSHKeysResponse.SSHKeys { - if strings.TrimSpace(SSHKey.PublicKey) == strings.TrimSpace(string(localSSHKeyContent)) { - _, _ = interactive.Println("Looks like your local SSH key " + shortenedFilename + " is already present in your Scaleway account.") - return nil, nil - } - } - - // Ask user - _, _ = interactive.Println("An SSH key is required if you want to connect to a server. More info at https://www.scaleway.com/en/docs/configure-new-ssh-key") - addSSHKey, err := interactive.PromptBoolWithConfig(&interactive.PromptBoolConfig{ - Ctx: ctx, - Prompt: "We found an SSH key in " + shortenedFilename + ". Do you want to add it to your Scaleway account?", - DefaultValue: true, - }) - if err != nil { - return nil, err - } - - // Early exit if user doesn't want to add the key - if !addSSHKey { - return nil, installationCanceled(addKeyInstructions) - } - - // Add key - _, err = api.CreateSSHKey(&iam.CreateSSHKeyRequest{ - PublicKey: string(localSSHKeyContent), - }) - if err != nil { - return nil, err - } - - return &core.SuccessResult{ - Message: "Key " + shortenedFilename + " successfully added", - }, nil -} diff --git a/internal/namespaces/account/v3/custom_test.go b/internal/namespaces/account/v3/custom_test.go deleted file mode 100644 index 78c0074ab7..0000000000 --- a/internal/namespaces/account/v3/custom_test.go +++ /dev/null @@ -1,38 +0,0 @@ -package account - -import ( - "os" - "path" - "testing" - - "github.com/scaleway/scaleway-cli/v2/internal/core" -) - -func Test_initCommand(t *testing.T) { - tmpDir := os.TempDir() - t.Run("simple", core.Test(&core.TestConfig{ - Commands: GetCommands(), - BeforeFunc: func(ctx *core.BeforeFuncCtx) error { - pathToPublicKey := path.Join(tmpDir, ".ssh", "id_ed25519.pub") - _, err := os.Stat(pathToPublicKey) - if err != nil { - content := "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBn9mGL7LGZ6/RTIVP7GExiD5gOwgl63MbJGlL7a6U3x foo@foobar.com" - err := os.MkdirAll(path.Join(tmpDir, ".ssh"), 0755) - if err != nil { - return err - } - err = os.WriteFile(pathToPublicKey, []byte(content), 0644) - return err - } - return err - }, - Cmd: `scw account ssh-key init with-ssh-key=true`, - Check: core.TestCheckCombine( - core.TestCheckGolden(), - core.TestCheckExitCode(0), - ), - OverrideEnv: map[string]string{ - "HOME": tmpDir, - }, - })) -} diff --git a/internal/namespaces/account/v3/error.go b/internal/namespaces/account/v3/error.go deleted file mode 100644 index cc3571b2c2..0000000000 --- a/internal/namespaces/account/v3/error.go +++ /dev/null @@ -1,21 +0,0 @@ -package account - -import ( - "fmt" - - "github.com/scaleway/scaleway-cli/v2/internal/core" -) - -func installationCanceled(addKeyInstructions string) *core.CliError { - return &core.CliError{ - Err: fmt.Errorf("installation of SSH key canceled"), - Hint: "You can add it later using " + addKeyInstructions, - } -} - -func sshKeyNotFound(filename string, addKeyInstructions string) *core.CliError { - return &core.CliError{ - Err: fmt.Errorf("could not find an SSH key at " + filename), - Hint: "You can add one later using " + addKeyInstructions, - } -} diff --git a/internal/namespaces/account/v3/testdata/test-init-command-simple.cassette.yaml b/internal/namespaces/account/v3/testdata/test-init-command-simple.cassette.yaml deleted file mode 100644 index ca7cd69416..0000000000 --- a/internal/namespaces/account/v3/testdata/test-init-command-simple.cassette.yaml +++ /dev/null @@ -1,119 +0,0 @@ ---- -version: 1 -interactions: -- request: - body: '{"ssh_keys":[{"id":"495d0e9f-a22b-4ff5-8324-0cb4746c57dc", "name":"rleone@scaleway.com", - "public_key":"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM6Lfs9IrfEUsw2oALOKucAqjeJo3vdADJAZS0BrJ4Vl - rleone@scaleway.com", "fingerprint":"256 MD5:0d:6d:20:43:4c:0f:38:a3:65:de:8f:72:77:70:26:55 - rleone@scaleway.com (ssh-ed25519)", "created_at":"2022-03-29T07:50:11.839583Z", - "updated_at":"2022-03-29T07:50:17.762922Z", "organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42", - "project_id":"951df375-e094-4d26-97c1-ba548eeb9c42", "disabled":false}, {"id":"e2e9d140-c387-43e8-af1b-5b133f8fe90d", - "name":"leila''s ssh-key", "public_key":"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIG4S+vO03k8VY0qdhRThHbyiDFbIqvzH+94x24b4hbQ - lmarabese", "fingerprint":"256 MD5:69:c9:cf:52:7d:07:cc:ff:a4:58:e4:7e:96:77:18:63 - lmarabese (ssh-ed25519)", "created_at":"2023-02-07T10:19:17.608707Z", "updated_at":"2023-02-07T10:19:17.608707Z", - "organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42", "project_id":"951df375-e094-4d26-97c1-ba548eeb9c42", - "disabled":false}, {"id":"1f5abae8-78f7-41a2-a787-780166d3f736", "name":"foobar", - "public_key":"ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBBieay3nO9wViPkuvFVgGGaA1IRlkFrr946yqvg9LxZIRhsnZ61yLCPmIOhvUAZ/gTxZGmhgtMDxkenSUTsG3F0= - foobar@foobar", "fingerprint":"256 MD5:19:ec:90:3b:95:c6:d8:93:ac:e1:14:4c:0e:cb:ea:44 - foobar@foobar (ecdsa-sha2-nistp256)", "created_at":"2023-07-17T14:47:52.688903Z", - "updated_at":"2023-07-17T14:47:52.688903Z", "organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42", - "project_id":"951df375-e094-4d26-97c1-ba548eeb9c42", "disabled":false}, {"id":"459e72de-56f0-4177-a3fd-f8bf47571915", - "name":"foobar", "public_key":"ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBBieay3nO9wViPkuvFVgGGaA1IRlkFrr946yqvg9LxZIRhsnZ61yLCPmIOhvUAZ/gTxZGmhgtMDxkenSUTsG3F0= - foobar@foobar", "fingerprint":"256 MD5:19:ec:90:3b:95:c6:d8:93:ac:e1:14:4c:0e:cb:ea:44 - foobar@foobar (ecdsa-sha2-nistp256)", "created_at":"2023-07-17T14:47:55.834080Z", - "updated_at":"2023-07-17T14:47:55.834080Z", "organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42", - "project_id":"951df375-e094-4d26-97c1-ba548eeb9c42", "disabled":false}], "total_count":4}' - form: {} - headers: - User-Agent: - - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.20.6; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/iam/v1alpha1/ssh-keys?order_by=created_at_asc&page=1 - method: GET - response: - body: '{"ssh_keys":[{"id":"495d0e9f-a22b-4ff5-8324-0cb4746c57dc", "name":"rleone@scaleway.com", - "public_key":"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM6Lfs9IrfEUsw2oALOKucAqjeJo3vdADJAZS0BrJ4Vl - rleone@scaleway.com", "fingerprint":"256 MD5:0d:6d:20:43:4c:0f:38:a3:65:de:8f:72:77:70:26:55 - rleone@scaleway.com (ssh-ed25519)", "created_at":"2022-03-29T07:50:11.839583Z", - "updated_at":"2022-03-29T07:50:17.762922Z", "organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42", - "project_id":"951df375-e094-4d26-97c1-ba548eeb9c42", "disabled":false}, {"id":"e2e9d140-c387-43e8-af1b-5b133f8fe90d", - "name":"leila''s ssh-key", "public_key":"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIG4S+vO03k8VY0qdhRThHbyiDFbIqvzH+94x24b4hbQ - lmarabese", "fingerprint":"256 MD5:69:c9:cf:52:7d:07:cc:ff:a4:58:e4:7e:96:77:18:63 - lmarabese (ssh-ed25519)", "created_at":"2023-02-07T10:19:17.608707Z", "updated_at":"2023-02-07T10:19:17.608707Z", - "organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42", "project_id":"951df375-e094-4d26-97c1-ba548eeb9c42", - "disabled":false}, {"id":"1f5abae8-78f7-41a2-a787-780166d3f736", "name":"foobar", - "public_key":"ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBBieay3nO9wViPkuvFVgGGaA1IRlkFrr946yqvg9LxZIRhsnZ61yLCPmIOhvUAZ/gTxZGmhgtMDxkenSUTsG3F0= - foobar@foobar", "fingerprint":"256 MD5:19:ec:90:3b:95:c6:d8:93:ac:e1:14:4c:0e:cb:ea:44 - foobar@foobar (ecdsa-sha2-nistp256)", "created_at":"2023-07-17T14:47:52.688903Z", - "updated_at":"2023-07-17T14:47:52.688903Z", "organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42", - "project_id":"951df375-e094-4d26-97c1-ba548eeb9c42", "disabled":false}, {"id":"459e72de-56f0-4177-a3fd-f8bf47571915", - "name":"foobar", "public_key":"ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBBieay3nO9wViPkuvFVgGGaA1IRlkFrr946yqvg9LxZIRhsnZ61yLCPmIOhvUAZ/gTxZGmhgtMDxkenSUTsG3F0= - foobar@foobar", "fingerprint":"256 MD5:19:ec:90:3b:95:c6:d8:93:ac:e1:14:4c:0e:cb:ea:44 - foobar@foobar (ecdsa-sha2-nistp256)", "created_at":"2023-07-17T14:47:55.834080Z", - "updated_at":"2023-07-17T14:47:55.834080Z", "organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42", - "project_id":"951df375-e094-4d26-97c1-ba548eeb9c42", "disabled":false}], "total_count":4}' - headers: - Content-Length: - - "2204" - Content-Security-Policy: - - default-src 'none'; frame-ancestors 'none' - Content-Type: - - application/json - Date: - - Mon, 17 Jul 2023 15:05:30 GMT - Server: - - Scaleway API-Gateway - Strict-Transport-Security: - - max-age=63072000 - X-Content-Type-Options: - - nosniff - X-Frame-Options: - - DENY - X-Request-Id: - - a301a5b9-84a3-481f-a91c-e3ad0782f4dc - status: 200 OK - code: 200 - duration: "" -- request: - body: '{"id":"e4572020-36e1-41fc-9bbc-2faa56c12e93", "name":"key-elastic-allen", - "public_key":"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBn9mGL7LGZ6/RTIVP7GExiD5gOwgl63MbJGlL7a6U3x - foo@foobar.com", "fingerprint":"256 MD5:1e:f8:f7:cb:c4:b7:a8:6d:96:20:49:d0:d0:af:a0:9e - foo@foobar.com (ssh-ed25519)", "created_at":"2023-07-17T15:05:30.415306Z", "updated_at":"2023-07-17T15:05:30.415306Z", - "organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42", "project_id":"951df375-e094-4d26-97c1-ba548eeb9c42", - "disabled":false}' - form: {} - headers: - Content-Type: - - application/json - User-Agent: - - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.20.6; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/iam/v1alpha1/ssh-keys - method: POST - response: - body: '{"id":"e4572020-36e1-41fc-9bbc-2faa56c12e93", "name":"key-elastic-allen", - "public_key":"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBn9mGL7LGZ6/RTIVP7GExiD5gOwgl63MbJGlL7a6U3x - foo@foobar.com", "fingerprint":"256 MD5:1e:f8:f7:cb:c4:b7:a8:6d:96:20:49:d0:d0:af:a0:9e - foo@foobar.com (ssh-ed25519)", "created_at":"2023-07-17T15:05:30.415306Z", "updated_at":"2023-07-17T15:05:30.415306Z", - "organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42", "project_id":"951df375-e094-4d26-97c1-ba548eeb9c42", - "disabled":false}' - headers: - Content-Length: - - "504" - Content-Security-Policy: - - default-src 'none'; frame-ancestors 'none' - Content-Type: - - application/json - Date: - - Mon, 17 Jul 2023 15:05:30 GMT - Server: - - Scaleway API-Gateway - Strict-Transport-Security: - - max-age=63072000 - X-Content-Type-Options: - - nosniff - X-Frame-Options: - - DENY - X-Request-Id: - - 36daf5fd-494e-41dc-acb5-d7ac6ee02e2e - status: 200 OK - code: 200 - duration: "" diff --git a/internal/namespaces/account/v3/testdata/test-init-command-simple.golden b/internal/namespaces/account/v3/testdata/test-init-command-simple.golden deleted file mode 100644 index 3749e4442f..0000000000 --- a/internal/namespaces/account/v3/testdata/test-init-command-simple.golden +++ /dev/null @@ -1,8 +0,0 @@ -🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 -🟩🟩🟩 STDOUT️ 🟩🟩🟩️ -βœ… Key ~/.ssh/id_ed25519.pub successfully added. -🟩🟩🟩 JSON STDOUT 🟩🟩🟩 -{ - "message": "Key ~/.ssh/id_ed25519.pub successfully added", - "details": "" -} diff --git a/internal/namespaces/account/v3/testdata/test-ssh-key-init-command-simple.cassette.yaml b/internal/namespaces/account/v3/testdata/test-ssh-key-init-command-simple.cassette.yaml deleted file mode 100644 index 02ca2f6475..0000000000 --- a/internal/namespaces/account/v3/testdata/test-ssh-key-init-command-simple.cassette.yaml +++ /dev/null @@ -1,82 +0,0 @@ ---- -version: 1 -interactions: -- request: - body: "" - form: {} - headers: - User-Agent: - - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.2; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/account/v2alpha1/ssh-keys?order_by=created_at_asc&page=1 - method: GET - response: - body: '{"ssh_keys":[{"id":"9bf6c340-687c-4f31-8aad-6a525761d8cd","name":"sieben-macbook","public_key":"ssh-rsa - AAAAB3NzaC1yc2EAAAADAQABAAACAQDZrUk+hFs8hYZVu6PVzXIZH83glJfiqZU7gzxw9zSkinCNHZnJ0KViZmol/XUEvGPu0toWOnM5t9MUVRq3xMldo6TKOZ7tvqBDoYD/hMHSBZb+b5f12l7i43wV7dunypy+nKtlb+rv9YJdMdbVaXy29K5EPaQujYTZTvXFEB9b8P0NXt0jA+qsUEf6/TK7dONdh2PFrUFiLXtNxkw21n/q6JGfR78etQ3mIaDKffjoVYHKgMv2edGWpjAkZeM5eBg6U6kb7CMMstpxPfOPADkXu4hbWhMGG5TC4tuizfq8YAeE8t2nyfB+xq8MtQe5jTPLK1/B+NVuKvp+3WLDSrai6dbsMpFsZDXJL34BkoY7XsRf8FeaPiy5Z3ScD6YLTl986rztAPyLCKJrfPSSc2tAOgne9cGFVUPS+tehqtW+VPeD4qu00h7H9hX/x+hefqYL5cfS3h/qgpcUFw+69rVK6r1zcBwJyJAI9gUQ08628iirYku3KkUQ0VdlavrYYfB9wyStQ4VBUYpXKMhKgk5gCRRkEuJ2gETffj+nLZAqL13yFPm8lCOgRztp06S+K9Xq/cYVvAnDh8R2IsBGbs4KmpKMM7PA7mYf3XMI1KzAWXqc6RCv1a+PUwMK/AIKqnk040n2Q0yxuJSOufcVE6mWxVywHag9Ucww1FuSR54i7w== - rleone@scaleway.com","fingerprint":"4096 43:ba:7c:ec:66:6b:cc:fe:02:91:04:29:32:19:30:bf rleone@scaleway.com - (RSA)","created_at":"2019-05-02T08:26:01.304954Z","updated_at":"2020-02-26T12:46:33.737392Z","creation_info":{"address":"195.154.228.158","user_agent":"ansible - 2.7.0.dev0 Python 2.7.16","country_code":"FR"},"organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42"},{"id":"cffa1bb1-57f0-4ad8-be20-f335df743b27","name":"juliencastets-macbook","public_key":"ssh-rsa - AAAAB3NzaC1yc2EAAAADAQABAAABAQDMiV5DEMsYihbdS3kCJwzSBLgGO7L2j5z2/9+HVbJbzDvAz0HcUQ+sKOlvzEUzDgtNKNP+zs7C9sMcDKKUPsVzx2jpZgGN0hP9taDzWuMX+A4B4CBftTQHtZBV8dg+EVeI5Xv6HmY/WtAWC1Xfb8mvz5z+a/8D0u9IVURqiZy/n8moQwhjpK9+m634GorgMwduMZX1pPskSVL1m2ocaP8NFq8oV9L6zf9kSi7/Jwgci1TTsGYGsRSbpc665nP7MgyxZqpP0oQK8f6VW1ndFjsSgE1fT83/1WH8ro2Ou0Esh/FTs0Wxt2A5vIShYJIO+o680rNjbIhoWHLg5tU9+ip1 - macbook","fingerprint":"2048 MD5:00:43:dc:7f:26:64:70:a2:b9:cd:06:77:35:f2:f6:f6 - macbook (ssh-rsa)","created_at":"2020-02-26T12:46:58.241993Z","updated_at":"2020-02-26T12:46:58.241993Z","creation_info":{"address":"195.154.229.35","user_agent":"Mozilla/5.0 - (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 - Safari/537.36","country_code":"FR"},"organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42"}],"total_count":2}' - headers: - Content-Length: - - "2130" - Content-Security-Policy: - - default-src 'none'; frame-ancestors 'none' - Content-Type: - - application/json - Date: - - Tue, 14 Apr 2020 14:12:16 GMT - Server: - - scaleway_api - Strict-Transport-Security: - - max-age=63072000 - X-Content-Type-Options: - - nosniff - X-Frame-Options: - - DENY - X-Request-Id: - - af941d7d-2847-4053-8581-0b7c3f05e7ae - status: 200 OK - code: 200 - duration: "" -- request: - body: '{"name":"","public_key":"ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBLFaYS65Fb6Z77wm4bwUlUOCCbKFU/tRDJkaTFJVNtkIGm6ub1ael54v+UI9qWYxyo1+qLfjloKN6sUCrMkU8/I= - foobar@foobar","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42"}' - form: {} - headers: - Content-Type: - - application/json - User-Agent: - - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.2; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/account/v2alpha1/ssh-keys - method: POST - response: - body: '{"id":"454410ec-ea49-40c6-a6e8-4e7f8c176062","name":"","public_key":"ecdsa-sha2-nistp256 - AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBLFaYS65Fb6Z77wm4bwUlUOCCbKFU/tRDJkaTFJVNtkIGm6ub1ael54v+UI9qWYxyo1+qLfjloKN6sUCrMkU8/I= - foobar@foobar","fingerprint":"256 MD5:fe:48:15:f4:4c:ce:55:1f:fb:bf:f7:48:06:17:d7:a5 - foobar@foobar (ecdsa-sha2-nistp256)","created_at":"2020-04-14T14:10:41.164654Z","updated_at":"2020-04-14T14:12:16.412485Z","creation_info":{"address":"","user_agent":"","country_code":""},"organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42"}' - headers: - Content-Length: - - "561" - Content-Security-Policy: - - default-src 'none'; frame-ancestors 'none' - Content-Type: - - application/json - Date: - - Tue, 14 Apr 2020 14:12:16 GMT - Server: - - scaleway_api - Strict-Transport-Security: - - max-age=63072000 - X-Content-Type-Options: - - nosniff - X-Frame-Options: - - DENY - X-Request-Id: - - 30f6162c-df13-4c23-bd4b-8902b51bc2d4 - status: 200 OK - code: 200 - duration: ""