project ssh keys: work around 404 bug#80
Conversation
141733a to
b1b3528
Compare
|
I think you can say nope and give it only public ones right, somehow? I don't think drone is able to ask for less perms in this old version. Might move this over to cloud.drone.io actually. |
|
fyi failed due to lint |
|
I'm checking with api folks about the 404 though, don't really want to merge in this hack. |
b1b3528 to
61ef89a
Compare
|
Just a follow-up comment on the issue here, because I misremembered. Right now, a project's API token gets a 404 while creating an SSH key: interestingly, it does work: the key is created. But, the reply is still a 404. I then deleted the key from the UI. I also tested with curl: running this request a second time returns a 422 and I confirmed that the Packet API team still has a ticket open to fix this issue. One option (sigh) could be catching the 404 and then querying to see if the key is listed? |
61ef89a to
e57bd92
Compare
w00t |
DEBUG:packet.baseapi:POST https://api.packet.net/projects/86d5d066-b891-4608-af55-a481aa2c0094/ssh-keys {'key': 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL/w0nE8ezh9UX88pT3BLtn9Sx2dFZcDSR1+tv4oBjSj', 'label': 'grahamc-test'} {'X-Auth-Token': 'TOKEN', 'X-Consumer-Token': None, 'Content-Type': 'application/json'} DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.packet.net:443 DEBUG:urllib3.connectionpool:https://api.packet.net:443 "POST /projects/86d5d066-b891-4608-af55-a481aa2c0094/ssh-keys HTTP/1.1" 404 24 DEBUG:packet.baseapi:POST https://api.packet.net/projects/86d5d066-b891-4608-af55-a481aa2c0094/ssh-keys {'key': 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL/w0nE8ezh9UX88pT3BLtn9Sx2dFZcDSR1+tv4oBjSj', 'label': 'grahamc-test'} {'X-Auth-Token': 'TOKEN', 'X-Consumer-Token': None, 'Content-Type': 'application/json'} DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.packet.net:443 DEBUG:urllib3.connectionpool:https://api.packet.net:443 "POST /projects/86d5d066-b891-4608-af55-a481aa2c0094/ssh-keys HTTP/1.1" 422 33 DEBUG:packet.baseapi:GET https://api.packet.net/ssh-keys {} {'X-Auth-Token': 'TOKEN', 'X-Consumer-Token': None, 'Content-Type': 'application/json'} DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.packet.net:443 DEBUG:urllib3.connectionpool:https://api.packet.net:443 "GET /ssh-keys HTTP/1.1" 200 None SSHKey: 3088ab9e-af4d-4f5a-b301-94d90384b2f9
e57bd92 to
fbaf181
Compare
When creating a project's SSH key with a project's API key, the SSH
key gets created but the response is a 404.
This patch works around that issue and allows the code to continue.
Upstreamed from input-output-hk@4baec99
Note the backstory of this PR is in customer issue TUVD-0107-UIKB.