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

Unable to Create SSH Key #77

Open
Omicron7 opened this issue Oct 25, 2023 · 0 comments
Open

Unable to Create SSH Key #77

Omicron7 opened this issue Oct 25, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@Omicron7
Copy link

When adding an item via the connect API with category = "SSH_KEY", the resultant private_key is continually returned as Field type = "STRING" instead of the passed in Field type = "SSHKEY".

Example:
item.json

{
  "vault": {
    "id": "abc123"
  },
  "title": "SSH Key",
  "category": "SSH_KEY",
  "fields": [
    {
      "id": "private_key",
      "label": "private key",
      "type": "SSHKEY",
      "value": "-----BEGIN OPENSSH PRIVATE KEY-----\nabcdefghijklmnopqrstuvwxyz\n...\n-----END OPENSSH PRIVATE KEY-----\n"
    }
  ]
}

curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $OP_API_TOKEN" -d @item.json https://connect-server.example.com/v1/vaults/abc123/items

{
  "vault": {
    "id": "abc123"
  },
  "title": "SSH Key",
  "category": "SSH_KEY",
  "fields": [
    {
      "id": "private_key",
      "label": "private key",
      "type": "STRING",
      "value": "-----BEGIN OPENSSH PRIVATE KEY-----\nabcdefghijklmnopqrstuvwxyz\n...\n-----END OPENSSH PRIVATE KEY-----\n"
    }
  ]
}

When getting an existing SSH_Key from the Connect API, the response includes the correct Field type = "SSHKEY". I've tested using both Field types of SSH_KEY and SSHKEY as I've seen them both mentioned in the docs/returned responses and connect-sdk-go. I ran into this issue while working on adding SSH Key support to the 1Password Terrafrom provider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants