basicly implement acl crud ops with roles and resources

This commit is contained in:
2025-12-20 17:38:15 +02:00
parent c188b46519
commit 904f446447
18 changed files with 1607 additions and 324 deletions

View File

@@ -65,7 +65,7 @@ type registerRequest struct {
}
type registerResponse struct {
UserID int64 `json:"id"`
UserID uint `json:"id"`
Username string `json:"username"`
}
@@ -92,6 +92,7 @@ func (h *authHandler) handleRegister(w http.ResponseWriter, r *http.Request) {
http.Error(w, "Failed to encode response", http.StatusInternalServerError)
return
}
w.WriteHeader(http.StatusCreated)
}
type loginRequest struct {
@@ -152,7 +153,7 @@ func (h *authHandler) handleLogout(w http.ResponseWriter, r *http.Request) {
}
type meResponse struct {
UserID int64 `json:"id"`
UserID uint `json:"id"`
Username string `json:"username"`
Email string `json:"email"`
}