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/lex/util"
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 util.LexClient, aud string, exp int64, lxm string) (*ServerGetServiceAuth_Output, error) {
24 var out ServerGetServiceAuth_Output
25
26 params := map[string]interface{}{}
27 params["aud"] = aud
28 if exp != 0 {
29 params["exp"] = exp
30 }
31 if lxm != "" {
32 params["lxm"] = lxm
33 }
34 if err := c.LexDo(ctx, util.Query, "", "com.atproto.server.getServiceAuth", params, nil, &out); err != nil {
35 return nil, err
36 }
37
38 return &out, nil
39}