GoAT Site is library that implements Standard.site in Go.
atprotocol standard-site atproto library
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(verif): create handler and get uri for publication

+20 -1
+1 -1
document_test.go
··· 57 57 t.Log(string(b)) 58 58 } 59 59 60 - const testDoc = "at://did:plc:jdhpqeb4cb4mng533dx56cbc/site.standard.document/3mhm4obhnx22y" 60 + const testDoc = "at://did:plc:zcanytzlaumjwgaopolw6wes/site.standard.document/3mhmdp3qobs2o" 61 61 62 62 var ( 63 63 docURI syntax.ATURI
+19
publication.go
··· 2 2 3 3 import ( 4 4 "context" 5 + "fmt" 6 + "net/http" 5 7 "strings" 6 8 7 9 "github.com/bluesky-social/indigo/atproto/syntax" ··· 86 88 func DeletePublication(ctx context.Context, client lexutil.LexClient, repo syntax.AtIdentifier, rkey syntax.RecordKey) error { 87 89 return deleteRecord(ctx, client, CollectionPublication, repo, rkey) 88 90 } 91 + 92 + // HandlePublicationVerification returns an [http.Handler] used during the verification of the [Publication]. 93 + // 94 + // See [GetPublicationVerificationURI]. 95 + func HandlePublicationVerification(repo syntax.AtIdentifier, rkey syntax.RecordKey) http.Handler { 96 + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 97 + fmt.Fprintf(w, "at://%s/%s/%s", repo, CollectionPublication, rkey) 98 + }) 99 + } 100 + 101 + // GetPublicationVerificationURI returns the URI called during the verification of the [Publication]. 102 + // Path must be empty if the [Publication] is located at the domain root. 103 + // 104 + // See [HandlePublicationVerification]. 105 + func GetPublicationVerificationURI(path string) string { 106 + return "/.well-known/" + CollectionPublication + path 107 + }