connectorv2

package
v0.0.0-...-9758eb9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 51 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ConnectorControlStreamMetadataKeyToken is the GRPC
	// stream metadata key for the authorization token.
	ConnectorControlStreamMetadataKeyToken = "token"

	// ConnectorControlStreamMetadataKeyConnectorId is
	// the GRPC stream metadata key for the connector id.
	ConnectorControlStreamMetadataKeyConnectorId = "connector_id"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectorControlStreamCredentials

type ConnectorControlStreamCredentials struct {
	// contains filtered or unexported fields
}

ConnectorControlStreamCredentials represents the authentication mechanism against the Border0 API's connector-control-plain (GRPC) server.

func NewConnectorControlStreamCredentials

func NewConnectorControlStreamCredentials(opts ...CredentialOption) *ConnectorControlStreamCredentials

NewConnectorControlStreamCredentials returns a new ConnectorControlStreamCredentials object initialized with the given options.

func (*ConnectorControlStreamCredentials) GetRequestMetadata

func (c *ConnectorControlStreamCredentials) GetRequestMetadata(ctx context.Context, in ...string) (map[string]string, error)

GetRequestMetadata gets the current request metadata, refreshing tokens if required. This should be called by the transport layer on each request, and the data should be populated in headers or other context. If a status code is returned, it will be used as the status for the RPC (restricted to an allowable set of codes as defined by gRFC A54). uri is the URI of the entry point for the request. When supported by the underlying implementation, ctx can be used for timeout and cancellation. Additionally, RequestInfo data will be available via ctx to this call.

^ copied straight from the interface defintion.

func (*ConnectorControlStreamCredentials) RequireTransportSecurity

func (c *ConnectorControlStreamCredentials) RequireTransportSecurity() bool

RequireTransportSecurity indicates whether the credentials requires transport security.

^ copied straight from the interface defintion.

type ConnectorService

type ConnectorService struct {
	// contains filtered or unexported fields
}

func NewConnectorService

func NewConnectorService(
	ctx context.Context,
	l *zap.Logger,
	version string,
	config *config.Configuration,
) *ConnectorService

func (*ConnectorService) AuthorizeRequest

func (c *ConnectorService) AuthorizeRequest(ctx context.Context, socket *models.Socket, host, userEmail, sessionKey string) (map[string][]any, map[string][]string, error)

func (*ConnectorService) Certificate

func (c *ConnectorService) Certificate() (*tls.Certificate, error)

func (*ConnectorService) Evaluate

func (s *ConnectorService) Evaluate(ctx context.Context, socket *models.Socket, clientIP, userEmail, sessionKey string) (allowedActions []any, info map[string][]string, err error)

func (*ConnectorService) GetUserID

func (c *ConnectorService) GetUserID() (string, error)

func (*ConnectorService) Listen

func (c *ConnectorService) Listen(socket *border0.Socket)

func (*ConnectorService) SignSSHKey

func (c *ConnectorService) SignSSHKey(ctx context.Context, socketID string, publicKey []byte) (string, string, error)

func (*ConnectorService) SignSshOrgCertificate

func (c *ConnectorService) SignSshOrgCertificate(ctx context.Context, socketID, sessionKey, userEmail string, ticket, sshKey []byte) ([]byte, error)

func (*ConnectorService) Start

func (c *ConnectorService) Start()

func (*ConnectorService) StartControlStream

func (c *ConnectorService) StartControlStream(ctx context.Context, cancel context.CancelFunc)

func (*ConnectorService) UpdateSession

func (c *ConnectorService) UpdateSession(update models.SessionUpdate) error

func (*ConnectorService) UploadRecording

func (c *ConnectorService) UploadRecording(content []byte, socketID, sessionKey, recordingID string) error

type CredentialOption

type CredentialOption func(*ConnectorControlStreamCredentials)

CredentialOption is the constructor option type for ConnectorControlStreamCredentials.

func WithConnectorId

func WithConnectorId(connectorId string) CredentialOption

WithConnectorId is the CredentialOption to set the connector id.

func WithInsecureTransport

func WithInsecureTransport(insecureTransport bool) CredentialOption

WithInsecureTransport is the CredentialOption to toggle insecure transport.

func WithToken

func WithToken(token string) CredentialOption

WithToken is the CredentialOption to set the token.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL