mirror of
https://github.com/fleetdm/fleet
synced 2026-05-18 22:49:19 +00:00
for #19027, this modifies the website to accept an `deliveryMethod` parameter to respond with the signed CSR instead of delivering an email. The current approach also maintains backwards compatibility: **Response without `deliveryMethod` (unchanged except for custom headers)** ``` $ curl --insecure -v -H 'content-type: application/json' http://localhost:2024/api/v1/deliver-apple-csr -d '{"unsignedCsrData": "foo"}' * Trying [::1]:2024... * Connected to localhost (::1) port 2024 > POST /api/v1/deliver-apple-csr HTTP/1.1 > Host: localhost:2024 > User-Agent: curl/8.4.0 > Accept: */* > content-type: application/json > Content-Length: 26 > < HTTP/1.1 200 OK < X-Powered-By: Sails <sailsjs.com> < Cache-Control: no-cache, no-store < X-Exit: success < X-Exit-Description: Delivered email to specified email address with certificate signing request attached. < Content-Type: text/plain; charset=utf-8 < Content-Length: 2 < ETag: W/"2-nOO9QiTIwXgNtWtBJezz8kv3SLc" < Set-Cookie: sails.sid=s%3AqOZoNKY2CCZ6PFb9fIKaAjtiTKjB7Gum.9jodWIUG6DCNnXu%2Bn%2BF8cJmI%2Fn19Tk%2FdIkDPBl%2BILbI; Path=/; HttpOnly < Date: Wed, 22 May 2024 18:23:16 GMT < Connection: keep-alive < Keep-Alive: timeout=5 < * Connection #0 to host localhost left intact OK ``` **Response with `deliveryMethod=json`** ``` $ curl --insecure -v -H 'content-type: application/json' http://localhost:2024/api/v1/deliver-apple-csr?deliveryMethod=json -d '{"unsignedCsrData": "foo"}' * Trying [::1]:2024... * Connected to localhost (::1) port 2024 > POST /api/v1/deliver-apple-csr?alt=json HTTP/1.1 > Host: localhost:2024 > User-Agent: curl/8.4.0 > Accept: */* > content-type: application/json > Content-Length: 26 > < HTTP/1.1 200 OK < X-Powered-By: Sails <sailsjs.com> < Cache-Control: no-cache, no-store < Content-Type: application/json; charset=utf-8 < X-Exit: success < X-Exit-Description: Delivered email to specified email address with certificate signing request attached. < X-Exit-Output-Friendly-Name: RSS feed XML < Content-Length: 26 < ETag: W/"1a-NnuclRv86ZEKA9WB967iUGlz84s" < Set-Cookie: sails.sid=s%3AbpaKOTbNe4E911qH4z1-12ABGd_z2d2I.mAimDARoZgnq8zpJHcF95y8qFJXX0iky4Suj0HUKjpI; Path=/; HttpOnly < Date: Wed, 22 May 2024 18:22:07 GMT < Connection: keep-alive < Keep-Alive: timeout=5 < * Connection #0 to host localhost left intact {"csr":"UEQ5NGJXdy4uLg=="} ``` # Checklist for submitter - [x] Manual QA for all new/changed functionality --------- Co-authored-by: Eric <eashaw@sailsjs.com> |
||
|---|---|---|
| .. | ||
| controllers | ||
| helpers | ||
| hooks/custom | ||
| models | ||
| policies | ||
| responses | ||