fork of indigo with slightly nicer lexgen
at main 508 B view raw
1package client 2 3import ( 4 "net/http" 5 6 "github.com/bluesky-social/indigo/atproto/syntax" 7) 8 9// Simple [AuthMethod] implementation for atproto "admin auth". 10type AdminAuth struct { 11 Password string 12} 13 14func (a *AdminAuth) DoWithAuth(c *http.Client, req *http.Request, endpoint syntax.NSID) (*http.Response, error) { 15 req.SetBasicAuth("admin", a.Password) 16 return c.Do(req) 17} 18 19func NewAdminClient(host, password string) *APIClient { 20 c := NewAPIClient(host) 21 c.Auth = &AdminAuth{Password: password} 22 return c 23}