22 lines
454 B
Go
22 lines
454 B
Go
package models
|
|
|
|
import "github.com/golang-jwt/jwt/v5"
|
|
|
|
type AuthorizationRequest struct {
|
|
UserID string `json:"user_id"`
|
|
Resource string `json:"resource"`
|
|
Action string `json:"action"`
|
|
}
|
|
|
|
type AuthorizationResponse struct {
|
|
Allowed bool `json:"allowed"`
|
|
Reason string `json:"reason,omitempty"`
|
|
}
|
|
|
|
type Claims struct {
|
|
UserID string `json:"user_id"`
|
|
Username string `json:"username"`
|
|
Role string `json:"role"`
|
|
jwt.RegisteredClaims
|
|
}
|