clean up logs, delete cached data when atproto account is deleted

This commit is contained in:
Evan Jarrett
2025-12-31 12:21:17 -06:00
parent f19dfa2716
commit 1df1bb57a4
9 changed files with 236 additions and 76 deletions
+3 -14
View File
@@ -381,17 +381,12 @@ func (h *XRPCHandler) HandleNotifyManifest(w http.ResponseWriter, r *http.Reques
}
// HandleSetStats sets absolute stats values for a repository (used by migration)
// This is a migration-only endpoint that allows AppView to sync existing stats to holds
// This is a temporary migration-only endpoint that allows AppView to sync existing stats to holds.
// No authentication required - this endpoint will be removed after migration is complete.
// TODO: Remove this endpoint after stats migration is complete
func (h *XRPCHandler) HandleSetStats(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
// Validate service token (same auth as blob:write endpoints)
validatedUser, err := pds.ValidateBlobWriteAccess(r, h.pds, h.httpClient)
if err != nil {
RespondError(w, http.StatusForbidden, fmt.Sprintf("authorization failed: %v", err))
return
}
// Parse request
var req struct {
OwnerDID string `json:"ownerDid"`
@@ -407,12 +402,6 @@ func (h *XRPCHandler) HandleSetStats(w http.ResponseWriter, r *http.Request) {
return
}
// Verify user DID matches token (user can only set stats for their own repos)
if req.OwnerDID != validatedUser.DID {
RespondError(w, http.StatusForbidden, "owner DID mismatch")
return
}
// Validate required fields
if req.OwnerDID == "" || req.Repository == "" {
RespondError(w, http.StatusBadRequest, "ownerDid and repository are required")