mirror of
https://github.com/EZ-Api/ez-api.git
synced 2026-01-13 17:47:51 +00:00
feat(api): add admin endpoint to issue keys for masters
Add `POST /admin/masters/{id}/keys` allowing admins to issue child keys
on behalf of a master. Introduce an `issued_by` field in the Key model
to audit whether a key was issued by the master or an admin.
Refactor master service to use typed errors for consistent HTTP status
mapping and ensure validation logic (active status, group check) is
shared.
This commit is contained in:
@@ -158,6 +158,7 @@ func main() {
|
||||
adminGroup.Use(middleware.AdminAuthMiddleware(adminService))
|
||||
{
|
||||
adminGroup.POST("/masters", adminHandler.CreateMaster)
|
||||
adminGroup.POST("/masters/:id/keys", adminHandler.IssueChildKeyForMaster)
|
||||
adminGroup.GET("/features", featureHandler.ListFeatures)
|
||||
adminGroup.PUT("/features", featureHandler.UpdateFeatures)
|
||||
// Other admin routes for managing providers, models, etc.
|
||||
|
||||
Reference in New Issue
Block a user