Controversial I know.
+26
server/handle_age_assurance.go
+26
server/handle_age_assurance.go
···
1
+
package server
2
+
3
+
import (
4
+
"time"
5
+
6
+
"github.com/bluesky-social/indigo/util"
7
+
"github.com/haileyok/cocoon/models"
8
+
"github.com/labstack/echo/v4"
9
+
)
10
+
11
+
func (s *Server) handleAgeAssurance(e echo.Context) error {
12
+
repo := e.Get("repo").(*models.RepoActor)
13
+
14
+
resp := map[string]any{
15
+
"state": map[string]any{
16
+
"status": "assured",
17
+
"access": "full",
18
+
"lastInitiatedAt": time.Now().Format(util.ISO8601),
19
+
},
20
+
"metadata": map[string]any{
21
+
"accountCreatedAt": repo.CreatedAt.Format(util.ISO8601),
22
+
},
23
+
}
24
+
25
+
return e.JSON(200, resp)
26
+
}
+1
-1
server/server.go
+1
-1
server/server.go
···
532
532
s.echo.GET("/xrpc/app.bsky.actor.getPreferences", s.handleActorGetPreferences, s.handleLegacySessionMiddleware, s.handleOauthSessionMiddleware)
533
533
s.echo.POST("/xrpc/app.bsky.actor.putPreferences", s.handleActorPutPreferences, s.handleLegacySessionMiddleware, s.handleOauthSessionMiddleware)
534
534
s.echo.GET("/xrpc/app.bsky.feed.getFeed", s.handleProxyBskyFeedGetFeed, s.handleLegacySessionMiddleware, s.handleOauthSessionMiddleware)
535
-
535
+
s.echo.GET("/xrpc/app.bsky.ageassurance.getState", s.handleAgeAssurance, s.handleLegacySessionMiddleware, s.handleOauthSessionMiddleware)
536
536
// admin routes
537
537
s.echo.POST("/xrpc/com.atproto.server.createInviteCode", s.handleCreateInviteCode, s.handleAdminMiddleware)
538
538
s.echo.POST("/xrpc/com.atproto.server.createInviteCodes", s.handleCreateInviteCodes, s.handleAdminMiddleware)
History
1 round
1 comment
willdot.net
submitted
#0
1 commit
expand
collapse
add age assurance endpoint
Signed-off-by: Will Andrews <will7989@hotmail.com>
expand 1 comment
pull request successfully merged
ya lets do it