Agent skill · Security

add-admin-endpoints

Add admin API endpoints with proper authorization, audit logging, and rate limiting (project)

majiayu000github.com/majiayu000GitHub ↗
claude-codeMIT
Install
npx skills add majiayu000/claude-skill-registry --skill add-admin-endpoints-tassadar2499-novatune-2 --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 20 KB
Bundled scripts: none
Path: skills/api/add-admin-endpoints-tassadar2499-novatune-2/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

Review
written from the skill's own SKILL.md · Aug 5, 2026

What it does

Implements admin API endpoints for NovaTune with proper authorization, audit logging, and rate limiting. Admin endpoints include user management, track moderation, analytics, and audit logs, plus corresponding handlers for listing, viewing, updating, moderating, deleting, and auditing actions.

How it works

  • Adds authorization policies in AuthorizationConfig.cs to define AdminOnly and AdminWithAuditAccess.
  • Creates admin endpoints in AdminEndpoints.cs under /admin with a group requiring AdminOnly, and subgroups for /users, /tracks, /analytics, and /audit-logs.
  • Exposes endpoints for:
    • User management: GET /admin/users, GET /admin/users/{userId}, PATCH /admin/users/{userId} with rate limits; updates trigger audit logging and handle various error responses.
    • Track moderation: GET /admin/tracks, GET /admin/tracks/{trackId}, POST /admin/tracks/{trackId}/moderate, DELETE /admin/tracks/{trackId} with rate limits; operations log audits and handle not-found cases.
    • Analytics: GET /admin/analytics/overview, /admin/analytics/tracks/top, /admin/analytics/users/active with rate limits.
    • Audit logs: GET /admin/audit-logs, GET /admin/audit-logs/{auditId}, GET /admin/audit-logs/verify with AdminWithAuditAccess and rate limiting where applicable.
  • Implementations make use of services like IAdminUserService, IAdminTrackService, IAuditLogService and construct audit entries via httpContext.CreateAuditRequest, including action, target, reasonCode, and new state.
  • Rate limiting policies are defined in Program.cs for various admin actions, e.g., admin-user-list, admin-user-modify, admin-track-list, admin-track-modify, admin-analytics, admin-audit.

When to use it

Use when you need a secured admin API surface for NovaTune to manage users, tracks, analytics, and audit logs with audit trails and request-rate protections.

What it can touch

  • Endpoints under /admin (authorization enforced)
  • Handlers reference services: IAdminUserService, IAuditLogService, IAdminTrackService
  • Rate limiting policies: admin-user-list, admin-user-modify, admin-track-list, admin-track-modify, admin-analytics, admin-audit

Caveats

  • Relies on existing identity claims (Role, permissions) for policies; behavior depends on claims present in the user principal.
  • Several handlers reference domain-specific types (e.g., AdminUserListQueryParams, ModerateTrackRequest) and may require corresponding models in the project.
  • Integrity verification can be disabled by configuration (EnableIntegrityVerification) and will return 503 if disabled.
  • Self-modification of user status is blocked.
From the SKILL.md

# Add Admin Endpoints Skill Implement admin API endpoints for NovaTune with proper authorization, audit logging, and rate limiting. ## Overview Admin endpoints provide: - **User management**: List, view, and update user status - **Track moderation**: List, view, moderate, and delete tracks - **Analytics**: Dashboard overview and reports - **Audit logs**: View and verify audit trail ## Steps ### 1. Create Authorization Policies Location: `src/NovaTuneApp/NovaTuneApp.ApiService/Configuration/AuthorizationConfig.cs` ```csharp namespace NovaTuneApp.ApiService.Configuration; public static class AuthorizationConfig { public static IServiceCollection AddAdminAuthorization( this IServiceCollection services) { services.AddAuthorization(options => { // Basic admin access options.AddPolicy(PolicyNames.AdminOnly, policy => policy.RequireClaim(ClaimTypes.Role, "Admin")); // Admin with audit access permission options.AddPolicy(PolicyNames.AdminWithAuditAccess, policy => policy.RequireAssertion(context => context.User.HasClaim(ClaimTypes.Role, "Admin") && context.User.HasClaim("permissions", "audit.read"))); }); return services; } } public static class PolicyNames { public const string ActiveUser

What's inside
Steps it walks through
  1. Overview
  2. Steps
  3. 1. Create Authorization Policies
  4. 2. Create Admin Endpoints
  5. 3. Implement User Management Handlers
  6. 4. Implement Track Moderation Handlers
  7. 5. Implement Audit Log Handlers
  8. 6. Add Rate Limiting Policies
  9. 7. Register Endpoints in Program.cs
  10. 8. Add Query Parameter Records
  11. Error Response Format
  12. Security Checklist
  13. Testing
Ships with 1 file
  • metadata.json
More from claude-skill-registry
All skills →
About this skill
What does the add-admin-endpoints skill do?

Add admin API endpoints with proper authorization, audit logging, and rate limiting (project)

How do I install it?

Run `npx skills add majiayu000/claude-skill-registry --skill add-admin-endpoints-tassadar2499-novatune-2 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going