Strip comment when validating SSH keys (BB-7903)

Jamison Valenta avatarJamison Valenta created an issue

Heyo -

I'm attempting to set up my SSH key, but the AJAX request from the modal window that saves the keys is getting a 400 error.

URI throwing error: https://bitbucket.org/!api/1.0/users/jamisonvalenta/ssh-keys

I can hit the URI by typing it into my browser(returns an empty JSON array), but the AJAX request is definitely failing (see attached screenshot)

Comments (10)

  1. Jamison Valenta

    That worked!

    Since the code wasn't working, I checked out the tutorial at https://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Git and looked at the graphic in Step 6 which includes the comment, so I modified my key to look like the one in the graphic (my keys were generated by Puttygen in Win; both the standard WIN save and the openSSH generated public keys weren't validated by bitbucket). It makes sense to me to either 1. allow for trailing comments 2. update the graphic to not have the key comment at the end

    Thanks for your assistance!

  2. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.