bindRecordAuthApi registers the auth record api endpoints and the corresponding handlers.
(app core.App, rg *router.RouterGroup[*core.RequestEvent])
| 8 | // bindRecordAuthApi registers the auth record api endpoints and |
| 9 | // the corresponding handlers. |
| 10 | func bindRecordAuthApi(app core.App, rg *router.RouterGroup[*core.RequestEvent]) { |
| 11 | // global oauth2 subscription redirect handler |
| 12 | rg.GET("/oauth2-redirect", oauth2SubscriptionRedirect).Bind( |
| 13 | SkipSuccessActivityLog(), // skip success log as it could contain sensitive information in the url |
| 14 | ) |
| 15 | // add again as POST in case of response_mode=form_post |
| 16 | rg.POST("/oauth2-redirect", oauth2SubscriptionRedirect).Bind( |
| 17 | SkipSuccessActivityLog(), // skip success log as it could contain sensitive information in the url |
| 18 | ) |
| 19 | |
| 20 | sub := rg.Group("/collections/{collection}") |
| 21 | |
| 22 | sub.GET("/auth-methods", recordAuthMethods).Bind( |
| 23 | collectionPathRateLimit("", "listAuthMethods"), |
| 24 | ) |
| 25 | |
| 26 | sub.POST("/auth-refresh", recordAuthRefresh).Bind( |
| 27 | collectionPathRateLimit("", "authRefresh"), |
| 28 | RequireSameCollectionContextAuth(""), |
| 29 | ) |
| 30 | |
| 31 | sub.POST("/auth-with-password", recordAuthWithPassword).Bind( |
| 32 | collectionPathRateLimit("", "authWithPassword", "auth"), |
| 33 | ) |
| 34 | |
| 35 | sub.POST("/auth-with-oauth2", recordAuthWithOAuth2).Bind( |
| 36 | collectionPathRateLimit("", "authWithOAuth2", "auth"), |
| 37 | ) |
| 38 | |
| 39 | sub.POST("/request-otp", recordRequestOTP).Bind( |
| 40 | collectionPathRateLimit("", "requestOTP"), |
| 41 | ) |
| 42 | sub.POST("/auth-with-otp", recordAuthWithOTP).Bind( |
| 43 | collectionPathRateLimit("", "authWithOTP", "auth"), |
| 44 | ) |
| 45 | |
| 46 | sub.POST("/request-password-reset", recordRequestPasswordReset).Bind( |
| 47 | collectionPathRateLimit("", "requestPasswordReset"), |
| 48 | ) |
| 49 | sub.POST("/confirm-password-reset", recordConfirmPasswordReset).Bind( |
| 50 | collectionPathRateLimit("", "confirmPasswordReset"), |
| 51 | ) |
| 52 | |
| 53 | sub.POST("/request-verification", recordRequestVerification).Bind( |
| 54 | collectionPathRateLimit("", "requestVerification"), |
| 55 | ) |
| 56 | sub.POST("/confirm-verification", recordConfirmVerification).Bind( |
| 57 | collectionPathRateLimit("", "confirmVerification"), |
| 58 | ) |
| 59 | |
| 60 | sub.POST("/request-email-change", recordRequestEmailChange).Bind( |
| 61 | collectionPathRateLimit("", "requestEmailChange"), |
| 62 | RequireSameCollectionContextAuth(""), |
| 63 | ) |
| 64 | sub.POST("/confirm-email-change", recordConfirmEmailChange).Bind( |
| 65 | collectionPathRateLimit("", "confirmEmailChange"), |
| 66 | ) |
| 67 |
no test coverage detected
searching dependent graphs…