"context"
"crypto/tls"
"encoding/json"
+ "errors"
"fmt"
"io"
"net"
"time"
"git.curoverse.com/arvados.git/sdk/go/arvados"
+ "git.curoverse.com/arvados.git/sdk/go/auth"
)
type TokenProvider func(context.Context) ([]string, error)
+func PassthroughTokenProvider(ctx context.Context) ([]string, error) {
+ if incoming, ok := auth.FromContext(ctx); !ok {
+ return nil, errors.New("no token provided")
+ } else {
+ return incoming.Tokens, nil
+ }
+}
+
type Conn struct {
clusterID string
httpClient http.Client
return aClient.RequestAndDecodeContext(ctx, dst, ep.Method, path, body, params)
}
+func (conn *Conn) ConfigGet(ctx context.Context) (json.RawMessage, error) {
+ ep := arvados.EndpointConfigGet
+ var resp json.RawMessage
+ err := conn.requestAndDecode(ctx, &resp, ep, nil, nil)
+ return resp, err
+}
+
func (conn *Conn) CollectionCreate(ctx context.Context, options arvados.CreateOptions) (arvados.Collection, error) {
ep := arvados.EndpointCollectionCreate
var resp arvados.Collection