mirror of
https://tangled.org/evan.jarrett.net/at-container-registry
synced 2026-09-26 12:14:17 +00:00
clean up logs, delete cached data when atproto account is deleted
This commit is contained in:
+3
-14
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user