MCPcopy
hub / github.com/google/seesaw / authConnect

Method authConnect

ecu/auth.go:64–82  ·  view source on GitHub ↗

authConnect attempts to authenticate the user using the given context. If authentication succeeds an authenticated IPC connection to the Seesaw Engine is returned.

(ctx *ipc.Context)

Source from the content-addressed store, hash-verified

62// authentication succeeds an authenticated IPC connection to the Seesaw
63// Engine is returned.
64func (e *ECU) authConnect(ctx *ipc.Context) (*conn.Seesaw, error) {
65 if ctx == nil {
66 return nil, errors.New("context is nil")
67 }
68 authCtx, err := e.cfg.Authenticator.Authenticate(ctx)
69 if err != nil {
70 return nil, fmt.Errorf("authentication failed: %v", err)
71 }
72
73 seesawConn, err := conn.NewSeesawIPC(authCtx)
74 if err != nil {
75 return nil, fmt.Errorf("failed to connect to engine: %v", err)
76 }
77 if err := seesawConn.Dial(e.cfg.EngineSocket); err != nil {
78 return nil, fmt.Errorf("failed to connect to engine: %v", err)
79 }
80
81 return seesawConn, nil
82}

Callers 13

FailoverMethod · 0.80
ClusterStatusMethod · 0.80
HAStatusMethod · 0.80
ConfigStatusMethod · 0.80
ConfigReloadMethod · 0.80
ConfigSourceMethod · 0.80
BGPNeighborsMethod · 0.80
VLANsMethod · 0.80
VserversMethod · 0.80
BackendsMethod · 0.80
OverrideBackendMethod · 0.80
OverrideDestinationMethod · 0.80

Calls 3

NewSeesawIPCFunction · 0.92
AuthenticateMethod · 0.65
DialMethod · 0.65

Tested by

no test coverage detected