Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PermissionCheckResponse ¶
type PermissionCheckResponse struct {
Allowed bool `json:"allowed"`
} // @name PermissionCheckResponse
PermissionCheckResponse is the response for GET /auth/users/:userID/permissions/check.
type PolicyListResponse ¶
type PolicyListResponse struct {
Permissions [][]string `json:"permissions"`
} // @name PolicyListResponse
PolicyListResponse is the response for GET /auth/roles/:name/permissions and GET /auth/permissions — each entry is a [role, resource, action] casbin policy line.
type ResourceListResponse ¶
type ResourceListResponse struct {
Resources []ResourceResponse `json:"resources"`
} // @name ResourceListResponse
ResourceListResponse is the response for GET /auth/resources.
type ResourceResponse ¶
type ResourceResponse struct {
Name string `json:"name"`
Description string `json:"description"`
Actions []string `json:"actions"`
CreatedAt time.Time `json:"createdAt"`
} // @name ResourceResponse
ResourceResponse mirrors repositories.Resource's exported fields for the generic resource-management API. Not constructed from a *repositories.Resource here — same import-cycle reasoning as RoleResponse above (see handlers.newResourceResponse instead).
type RoleListResponse ¶
type RoleListResponse struct {
Roles []RoleResponse `json:"roles"`
} // @name RoleListResponse
RoleListResponse is the response for GET /auth/roles and GET /auth/users/:userID/roles.
type RoleResponse ¶
type RoleResponse struct {
Name string `json:"name"`
Description string `json:"description"`
Metadata map[string]interface{} `json:"metadata"`
CreatedAt time.Time `json:"createdAt"`
} // @name RoleResponse
RoleResponse mirrors repositories.Role's exported fields for the generic role-management API. Deliberately not constructed from a *repositories.Role here (see handlers.NewRoleResponse instead) — this package sits downstream of modules/auth/repositories in the import graph (via interfaces -> models/responses), so importing repositories back from here would be a cycle.
type TokenResponse ¶
type TokenResponse struct {
AccessToken string `json:"accessToken"`
TokenType string `json:"tokenType"`
ExpiresIn int64 `json:"expiresIn"`
RefreshToken string `json:"refreshToken,omitempty"`
Scopes map[string]string `json:"scopes,omitempty"`
User *UserResponse `json:"user,omitempty"`
} // @name TokenResponse
TokenResponse represents the response after successful authentication
type UserResponse ¶
type UserResponse struct {
ID uuid.UUID `json:"id"`
Username string `json:"username"`
Email string `json:"email"`
PhoneNumber string `json:"phoneNumber"`
Role string `json:"role"`
EmailVerified bool `json:"emailVerified"`
Metadata map[string]any `json:"metadata,omitempty"`
} // @name UserResponse
UserResponse represents user information in API responses