Monorepo for Tangled tangled.org
2

Configure Feed

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

xrpc/serviceauth: didweb svc auth colon parameterization

Lewis: May this revision serve well! <lewis@tangled.org>

author
Lewis
committer
Tangled
date (Jun 10, 2026, 5:40 PM +0300) commit 23d7de0d parent 17d8efc0 change-id smmnnzpn
+11 -5
+2 -1
appview/oauth/oauth.go
··· 24 24 "tangled.org/core/appview/db" 25 25 "tangled.org/core/idresolver" 26 26 "tangled.org/core/rbac" 27 + "tangled.org/core/xrpc/serviceauth" 27 28 ) 28 29 29 30 const ( ··· 399 400 } 400 401 401 402 func (s *ServiceClientOpts) Audience() string { 402 - return fmt.Sprintf("did:web:%s", s.service) 403 + return serviceauth.DidWeb(s.service).String() 403 404 } 404 405 405 406 func (s *ServiceClientOpts) Host() string {
+2 -2
knotserver/config/config.go
··· 2 2 3 3 import ( 4 4 "context" 5 - "fmt" 6 5 7 6 "github.com/bluesky-social/indigo/atproto/syntax" 8 7 "github.com/sethvargo/go-envconfig" 8 + "tangled.org/core/xrpc/serviceauth" 9 9 ) 10 10 11 11 type Repo struct { ··· 36 36 } 37 37 38 38 func (s Server) Did() syntax.DID { 39 - return syntax.DID(fmt.Sprintf("did:web:%s", s.Hostname)) 39 + return serviceauth.DidWeb(s.Hostname) 40 40 } 41 41 42 42 type Config struct {
+2 -2
spindle/config/config.go
··· 2 2 3 3 import ( 4 4 "context" 5 - "fmt" 6 5 7 6 "github.com/bluesky-social/indigo/atproto/syntax" 8 7 "github.com/sethvargo/go-envconfig" 8 + "tangled.org/core/xrpc/serviceauth" 9 9 ) 10 10 11 11 type Server struct { ··· 35 35 } 36 36 37 37 func (s Server) Did() syntax.DID { 38 - return syntax.DID(fmt.Sprintf("did:web:%s", s.Hostname)) 38 + return serviceauth.DidWeb(s.Hostname) 39 39 } 40 40 41 41 type Secrets struct {
+5
xrpc/serviceauth/service_auth.go
··· 8 8 "strings" 9 9 10 10 "github.com/bluesky-social/indigo/atproto/auth" 11 + "github.com/bluesky-social/indigo/atproto/syntax" 11 12 "tangled.org/core/idresolver" 12 13 "tangled.org/core/log" 13 14 xrpcerr "tangled.org/core/xrpc/errors" 14 15 ) 15 16 16 17 const ActorDid string = "ActorDid" 18 + 19 + func DidWeb(hostname string) syntax.DID { 20 + return syntax.DID("did:web:" + strings.ReplaceAll(hostname, ":", "%3A")) 21 + } 17 22 18 23 type ServiceAuth struct { 19 24 logger *slog.Logger