1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
10 "git.arvados.org/arvados.git/lib/controller/railsproxy"
11 "git.arvados.org/arvados.git/lib/controller/rpc"
12 "git.arvados.org/arvados.git/sdk/go/arvados"
15 type railsProxy = rpc.Conn
18 cluster *arvados.Cluster
19 *railsProxy // handles API methods that aren't defined on Conn itself
23 func NewConn(cluster *arvados.Cluster) *Conn {
24 railsProxy := railsproxy.NewConn(cluster)
28 railsProxy: railsProxy,
30 conn.loginController = chooseLoginController(cluster, &conn)
34 // Logout handles the logout of conn giving to the appropriate loginController
35 func (conn *Conn) Logout(ctx context.Context, opts arvados.LogoutOptions) (arvados.LogoutResponse, error) {
36 return conn.loginController.Logout(ctx, opts)
39 // Login handles the login of conn giving to the appropriate loginController
40 func (conn *Conn) Login(ctx context.Context, opts arvados.LoginOptions) (arvados.LoginResponse, error) {
41 return conn.loginController.Login(ctx, opts)
44 // UserAuthenticate handles the User Authentication of conn giving to the appropriate loginController
45 func (conn *Conn) UserAuthenticate(ctx context.Context, opts arvados.UserAuthenticateOptions) (arvados.APIClientAuthorization, error) {
46 return conn.loginController.UserAuthenticate(ctx, opts)