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

Return cert chain in json #689

Closed
lukehinds opened this issue Jul 16, 2022 · 4 comments · Fixed by #690
Closed

Return cert chain in json #689

lukehinds opened this issue Jul 16, 2022 · 4 comments · Fixed by #690
Labels
enhancement New feature or request

Comments

@lukehinds
Copy link
Member

Right now we return the cert chain back with whitespace delimiters, it should instead be a json array. I am having to write some ugly arse regex to parse this out in rust.

@lukehinds lukehinds added the enhancement New feature or request label Jul 16, 2022
@haydentherapper
Copy link
Contributor

haydentherapper commented Jul 16, 2022

The v2 API over gRPC solves this - https://github.com/sigstore/fulcio/blob/main/fulcio.proto#L195
For the v2 API over HTTP, this should also occur. We won't be making breaking changes to the v1 API.

@lukehinds
Copy link
Member Author

The v2 API over gRPC solves this - https://github.com/sigstore/fulcio/blob/main/fulcio.proto#L195 For the v2 API over HTTP, this should also occur. We won't be making breaking changes to the v1 API.

cool. so I figure this is not deployed to the fulcio.sigstore.dev yet

@haydentherapper
Copy link
Contributor

It has been as of Fulcio 0.4, for example curl https://fulcio.sigstore.dev/api/v2/trustBundle

Cosign is using the v2 API currently, we switched over to gRPC.

@haydentherapper
Copy link
Contributor

Actually, it looks like there's a bug:

$ curl "https://fulcio.sigstore.dev/api/v2/trustBundle" | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1592  100  1592    0     0  10258      0 --:--:-- --:--:-- --:--:-- 10270
{
  "chains": [
    {
      "certificates": [
        "-----BEGIN CERTIFICATE-----\nMIICGjCCAaGgAwIBAgIUALnViVfnU0brJasmRkHrn/UnfaQwCgYIKoZIzj0EAwMw\nKjEVMBMGA1UEChMMc2lnc3RvcmUuZGV2MREwDwYDVQQDEwhzaWdzdG9yZTAeFw0y\nMjA0MTMy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QEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRY\nwB5fkUWlZql6zJChkyLQKsXF+jAfBgNVHSMEGDAWgBRYwB5fkUWlZql6zJChkyLQ\nKsXF+jAKBggqhkjOPQQDAwNpADBmAjEAj1nHeXZp+13NWBNa+EDsDP8G1WWg1tCM\nWP/WHPqpaVo0jhsweNFZgSs0eE7wYI4qAjEA2WB9ot98sIkoF3vZYdd3/VtWB5b9\nTNMea7Ix/stJ5TfcLLeABLE4BNJOsQ4vnBHJ\n-----END CERTIFICATE-----\n"
      ]
    }
  ]
}

certificates should be multiple strings, not one concatenated. Will look at this tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants