A fork of https://github.com/teal-fm/piper
at main 36 lines 1.2 kB view raw
1// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 3package atproto 4 5// schema: com.atproto.server.getServiceAuth 6 7import ( 8 "context" 9 10 "github.com/bluesky-social/indigo/xrpc" 11) 12 13// ServerGetServiceAuth_Output is the output of a com.atproto.server.getServiceAuth call. 14type ServerGetServiceAuth_Output struct { 15 Token string `json:"token" cborgen:"token"` 16} 17 18// ServerGetServiceAuth calls the XRPC method "com.atproto.server.getServiceAuth". 19// 20// aud: The DID of the service that the token will be used to authenticate with 21// exp: The time in Unix Epoch seconds that the JWT expires. Defaults to 60 seconds in the future. The service may enforce certain time bounds on tokens depending on the requested scope. 22// lxm: Lexicon (XRPC) method to bind the requested token to 23func ServerGetServiceAuth(ctx context.Context, c *xrpc.Client, aud string, exp int64, lxm string) (*ServerGetServiceAuth_Output, error) { 24 var out ServerGetServiceAuth_Output 25 26 params := map[string]interface{}{ 27 "aud": aud, 28 "exp": exp, 29 "lxm": lxm, 30 } 31 if err := c.Do(ctx, xrpc.Query, "", "com.atproto.server.getServiceAuth", params, nil, &out); err != nil { 32 return nil, err 33 } 34 35 return &out, nil 36}