1Password / connect

Access your 1Password secrets using a 1Password Connect Server
https://developer.1password.com/docs/connect
152 stars 29 forks source link

Fix: Field type for one-time passwords is "OTP" #26

Closed verkaufer closed 2 years ago

verkaufer commented 2 years ago

Summary

This PR is a documentation fix for the 1Password Connect API spec.

A customer in the 1Password forums reported our spec defined the One-time Password field type as TOTP when it should be OTP.

I confirmed this by running the following requests against Connect v1.5.0:

❌ Failure (HTTP 400 Validation Error, field type = "totp") ``` POST http://localhost:8080/v1/vaults/vault_id_here/items Accept: application/json Authorization: Bearer { "title": "Testing OTP vs TOTP", "vault": { "id": "vault_id_here" }, "category": "LOGIN", "fields": [ { "type": "totp", "label": "example1", "value":"otpauth://totp/Example:steve@example.com?secret=JBSWY3DPEHPK3PXP&issuer=Example" } ] } ``` Response: ``` { "status": 400, "message": "Validation: (validateVaultItem failed to Validate), Couldn't validate the item: \"[ItemValidator] has found 1 errors, 0 warnings: \\nErrors:{1. details.sections[0].fields[0] has unsupported field type: totp}\"" } ```
✅ Success (HTTP 200, field type = "otp") ``` POST http://localhost:8080/v1/vaults/vault_id_here/items Accept: application/json Authorization: Bearer { "title": "Testing OTP vs TOTP", "vault": { "id": "vault_id_here" }, "category": "LOGIN", "fields": [ { "type": "otp", "label": "example1", "value":"otpauth://totp/Example:steve@example.com?secret=JBSWY3DPEHPK3PXP&issuer=Example" } ] } ```

I will check our other integrations and documentation to make sure we specify the OTP field type.