Documentation ¶
Index ¶
- Constants
- type ConnectorControlStreamCredentials
- type ConnectorService
- func (c *ConnectorService) AuthorizeRequest(ctx context.Context, socket *models.Socket, host, userEmail, sessionKey string) (map[string][]any, map[string][]string, error)
- func (c *ConnectorService) Certificate() (*tls.Certificate, error)
- func (s *ConnectorService) Evaluate(ctx context.Context, socket *models.Socket, ...) (allowedActions []any, info map[string][]string, err error)
- func (c *ConnectorService) GetTLSCertificateForSocket(socket *border0.Socket) ([]byte, []byte, error)
- func (c *ConnectorService) GetUserID() (string, error)
- func (c *ConnectorService) Listen(socket *border0.Socket)
- func (c *ConnectorService) SignSSHKey(ctx context.Context, socketID string, publicKey []byte) (string, string, error)
- func (c *ConnectorService) SignSshOrgCertificate(ctx context.Context, socketID, sessionKey, userEmail string, ...) ([]byte, error)
- func (c *ConnectorService) Start()
- func (c *ConnectorService) StartControlStream(ctx context.Context, cancel context.CancelFunc)
- func (c *ConnectorService) UpdateSession(update models.SessionUpdate) error
- func (c *ConnectorService) UploadRecording(content []byte, socketID, sessionKey, recordingID string) error
- type CredentialOption
Constants ¶
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 (*ConnectorService) Certificate ¶
func (c *ConnectorService) Certificate() (*tls.Certificate, error)
func (*ConnectorService) GetTLSCertificateForSocket ¶
func (c *ConnectorService) GetTLSCertificateForSocket(socket *border0.Socket) ([]byte, []byte, error)
GetTLSCertificateForSocket is used to get a fresh TLS certificate for a given socket. The certificate will have the socket DNS name as a SAN and is signed by the org-wide CA.
func (*ConnectorService) GetUserID ¶
func (c *ConnectorService) GetUserID() (string, error)
func (*ConnectorService) Listen ¶
func (c *ConnectorService) Listen(socket *border0.Socket)
func (*ConnectorService) SignSSHKey ¶
func (*ConnectorService) SignSshOrgCertificate ¶
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.