Skip to content

Add get to pushcert to retrieve cert details#243

Merged
jessepeterson merged 1 commit intomicromdm:mainfrom
WardsParadox:wp/getcert
Mar 13, 2026
Merged

Add get to pushcert to retrieve cert details#243
jessepeterson merged 1 commit intomicromdm:mainfrom
WardsParadox:wp/getcert

Conversation

@WardsParadox
Copy link
Copy Markdown
Contributor

Adds

  • http/api/pushcert.go - Added NewRetrievePushCertHandler: takes a ?topic= query param, calls store.RetrievePushCert, parses the leaf cert, and returns the same PushCertResponseJson shape (topic + not_after).
  • http/api/v1.go - Replaced the single NewStorePushCertHandler registration with a method-dispatch wrapper on the same path: GET → retrieve, PUT → store, anything else → 405.

Updated:

  • docs/openapi.yaml - Added a get: operation under /v1/pushcert with a required topic query parameter and the same PushCertResponse schema.
  • docs/operations-guide.md - Split the "Push Cert" section into "Uploading (PUT)" and "Retrieving (GET)" subsections with a curl example for the new get.

@jessepeterson
Copy link
Copy Markdown
Member

jessepeterson commented Mar 12, 2026

Generally this looks good. Just this week I did but for a Thrift endpoint. I do have a methodmux in the nanolib repos instead of the inline function, but not sure it's worth pulling in: https://github.com/jessepeterson/nanolib-x/blob/main/http/mux/methodmux.go

Is probably fine as until we move to go1.24 for the new http router.

Copy link
Copy Markdown
Member

@jessepeterson jessepeterson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. thanks!

@jessepeterson jessepeterson merged commit 2232da1 into micromdm:main Mar 13, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants