c246b85a9e
- Implemented request ID handling in various services and handlers to improve traceability of requests. - Added new AuthOptions endpoint to expose WxWork and OIDC configuration options. - Updated message and event logging to include request ID for better debugging. - Enhanced login form to dynamically show available authentication options based on server configuration. - Introduced utility functions for normalizing and ensuring valid request IDs. - Updated tests to verify request ID functionality in message sending and event logging.
26 lines
719 B
Go
26 lines
719 B
Go
package response
|
|
|
|
import "cs-agent/internal/pkg/enums"
|
|
|
|
type AuthUserResponse struct {
|
|
ID int64 `json:"id"`
|
|
Username string `json:"username"`
|
|
Nickname string `json:"nickname"`
|
|
Avatar string `json:"avatar"`
|
|
Status enums.Status `json:"status"`
|
|
Roles []string `json:"roles"`
|
|
}
|
|
|
|
type LoginResponse struct {
|
|
AccessToken string `json:"accessToken"`
|
|
ExpiresAt string `json:"expiresAt"`
|
|
User *AuthUserResponse `json:"user"`
|
|
Permissions []string `json:"permissions"`
|
|
Roles []string `json:"roles"`
|
|
}
|
|
|
|
type AuthOptionsResponse struct {
|
|
WxWorkEnabled bool `json:"wxworkEnabled"`
|
|
OIDCEnabled bool `json:"oidcEnabled"`
|
|
}
|