Add public GET /v1/whitelist/pubkeys for active subscriber pubkeys
Expose JSON array of hex pubkeys backed by ListActivePubkeys query. Includes OpenAPI documentation and integration tests. Made-with: Love
This commit is contained in:
@@ -61,3 +61,12 @@ func (h *Users) Get(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
WriteJSON(w, http.StatusOK, resp)
|
||||
}
|
||||
|
||||
func (h *Users) ListWhitelistedPubkeys(w http.ResponseWriter, r *http.Request) {
|
||||
pubkeys, err := h.Users.Repo().ListActivePubkeys(r.Context())
|
||||
if err != nil {
|
||||
WriteError(w, http.StatusInternalServerError, "InternalError", err.Error())
|
||||
return
|
||||
}
|
||||
WriteJSON(w, http.StatusOK, pubkeys)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user