Documentation
¶
Index ¶
- func HandleChangePassword(c *gin.Context)
- func HandleCliLogin(c *gin.Context)
- func HandleLogin(ctx *gin.Context)
- func HandleLogout(ctx *gin.Context)
- func HandleRetrieveInitialUserExists(ctx *gin.Context)
- func HandleRetrieveUserPublicKey(ctx *gin.Context)
- func HandleRetriveUserDetails(ctx *gin.Context)
- func HandleSignup(ctx *gin.Context)
- func HandleSubdomainLoginAuthorize(ctx *gin.Context)
- func HandleSubdomainLoginCallback(ctx *gin.Context)
- func HandleUpdateUserDetails(ctx *gin.Context)
- func SetAuthCookie(ctx *gin.Context, token string, tokenDuration int) error
- func SetSubdomainsAuthCookie(ctx *gin.Context, token string) error
- type LoginRequestBody
- type SignUpRequestBody
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleChangePassword ¶
TODO: ratelimit? POST /api/v1/auth/change-password change the password of current user
func HandleLogin ¶
Login godoc @Summary Login @Schemes @Description Login @Tags Templates @Accept json @Produce json @Param request body LoginRequestBody true "Credentials" @Success 200 {object} @Router /api/v1/auth/login [post]
func HandleLogout ¶
Logout godoc @Summary Logout @Schemes @Description Logout @Tags Templates @Accept json @Produce json @Success 200 {object} @Router /api/v1/auth/logout [post]
func HandleRetrieveInitialUserExists ¶
TODO: ratelimit GET /api/v1/auth/initial-user-exists retrieve if at least one user exists for the current instance of codebox this api is used to redirect users to signup page to create the first user
func HandleRetrieveUserPublicKey ¶
GET /api/v1/auth/user-ssh-public-key retrieve user's ssh public key
func HandleRetriveUserDetails ¶
GET /api/v1/auth/user-details retrieve details about the current user
func HandleSignup ¶
TODO: ratelimit Signup godoc @Summary Signup @Schemes @Description Signup @Tags Templates @Accept json @Produce json @Param request body SignupRequestBody true "Credentials" @Success 200 {object} @Router /api/v1/auth/signup [post]
func HandleUpdateUserDetails ¶
PUT or PATCH /api/v1/auth/user-details update user first and last name
func SetAuthCookie ¶
set authentication cookie
func SetSubdomainsAuthCookie ¶
set authentication cookie for subdomains Note: This cookie uses a different name compared to the main website's authorization cookie. This addresses a scenario where a subdomain (within the codebox server's wildcard domain) might attempt to set a cookie with the same name as the secure codebox server's authorization cookie, which browsers prevent.