Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type User ¶
type User struct {
// contains filtered or unexported fields
}
func (*User) Bind ¶
func (h *User) Bind(rg *gin.RouterGroup, jwtHandler *jwt.GinJWTMiddleware, options *services.Options) error
@Summary User Management @Description This API is used to manage user accounts, including creating, removing, and editing user profiles. This API only available in restricted mode and requires a valid JWT token. @Router /user [post] @Produce application/json @Security ApiKeyAuth @Param action formData string true "Specifies the action to be performed. Use `preauth` to get a Base64 RSA public key in PEM format, `profile` to get profile of current user, `list` to get list of all users (admin only), `create` to create a new user (admin only), `remove` to remove a user (admin only), and `edit` to edit a user (admin only)." @Param nonce formData string false "A unique string used to prevent replay attacks, required for the `create`, `remove`, `edit` actions and left empty for other actions. The nonce is the SHA-1 hash of the RSA public key from the pre-authentication stage and becomes invalid once the request is sent. It also expires if unused within the time-to-live (TTL) period, which is set during the pre-authentication stage." @Param user_id formData string false "The user ID to be removed or edited, required for the `remove` and `edit` actions and left empty for other actions. The user ID is encrypted with the RSA public key." @Param admin formData bool false "Specifies whether the user is an administrator, required for the `create` and `edit` actions and set to false in other actions." @Param username formData string false "The username of the user to be created or edited, required for the `create` and `edit` actions and left empty for other actions. The username is encrypted with the RSA public key." @Param password formData string false "The password of the user to be created or edited, required for the `create` and `edit` actions and left empty for other actions. The password is encrypted with the RSA public key." @Param Authorization header string true "Bearer JWT token."