package models import "time" // APIKeyPrefix marks an Authorization header value as a service-account API // key rather than a JWT, so validateHeader() can branch without attempting // (and failing) a JWT parse first. const APIKeyPrefix = "xce_ak_" type APIKeyRequest struct { Username string `json:"username" binding:"required"` RoleName string `json:"role_name" binding:"required"` Description string `json:"description,omitempty"` ExpiryDays int `json:"expiry_days,omitempty"` } type APIKeyResponse struct { APIKey string `json:"api_key"` Username string `json:"username"` RoleName string `json:"role_name"` CreateTime time.Time `json:"create_time"` ExpiryTime time.Time `json:"expiry_time"` }