Documentation
¶
Overview ¶
Package bridge serves Atmos API services to native plugins within live invocations.
Index ¶
- Constants
- func ClearPrivateSession(storage keyring.Keyring, namespace string) error
- type Invocation
- type LogSink
- type SecretReader
- type Server
- func (s *Server) Begin(id string, invocation Invocation) (func(), error)
- func (s *Server) Delete(ctx context.Context, request *apiv1.DeleteRequest) (*emptypb.Empty, error)
- func (s *Server) Do(ctx context.Context, request *apiv1.HTTPRequest) (*apiv1.HTTPResponse, error)
- func (s *Server) Get(ctx context.Context, request *apiv1.GetRequest) (*apiv1.GetResponse, error)
- func (s *Server) Listen(request *apiv1.ListenRequest, ...) error
- func (s *Server) Open(ctx context.Context, request *apiv1.OpenRequest) (*emptypb.Empty, error)
- func (s *Server) Put(ctx context.Context, request *apiv1.PutRequest) (*emptypb.Empty, error)
- func (s *Server) Read(ctx context.Context, request *apiv1.SecretRequest) (*apiv1.SecretResponse, error)
- func (s *Server) Register(server *grpc.Server)
- func (s *Server) Write(ctx context.Context, request *pluginv1.LogRequest) (*emptypb.Empty, error)
Constants ¶
const InvocationMetadata = "atmos-invocation-id"
InvocationMetadata is set by Plugin SDK calls back into the Atmos API.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Invocation ¶
type Invocation struct {
Context context.Context
Browser api.Browser
HTTP api.HTTP
Secrets SecretReader
Keyring keyring.Keyring
// Logs shows the log entries the plugin delivers while the call runs. Nil grants no live delivery.
Logs LogSink
Namespace string
Interactive bool
// AwaitUser marks the call as waiting for the user and returns the function that ends the
// wait, so the call timeout does not run while a person signs in. Nil means no such pause;
// the native runtime sets it for interactive invocations with a call timeout.
AwaitUser func() (resume func())
}
Invocation scopes API services to a single active call. Namespace includes the package, configured provider, realm, and configuration fingerprint.
type LogSink ¶
LogSink shows the log entries a plugin delivers during its invocation. Write returns after the entries are shown, which is what lets a plugin order its entries before its result. It must not fail the invocation.
type SecretReader ¶
SecretReader grants logical names, never arbitrary store paths, to one provider.
type Server ¶
type Server struct {
apiv1.UnimplementedHTTPServer
apiv1.UnimplementedBrowserServer
apiv1.UnimplementedCredentialsServer
apiv1.UnimplementedSecretsServer
pluginv1.UnimplementedLogServer
// contains filtered or unexported fields
}
Server rejects API requests after their invocation has completed.
func (*Server) Begin ¶
func (s *Server) Begin(id string, invocation Invocation) (func(), error)
Begin grants API access until the returned cleanup function is called.
func (*Server) Do ¶
func (s *Server) Do(ctx context.Context, request *apiv1.HTTPRequest) (*apiv1.HTTPResponse, error)
Do executes one exchange through the invocation's shared HTTP transport.
func (*Server) Get ¶
func (s *Server) Get(ctx context.Context, request *apiv1.GetRequest) (*apiv1.GetResponse, error)
Get reads opaque private session state without applying access-token expiry.
func (*Server) Listen ¶
func (s *Server) Listen(request *apiv1.ListenRequest, stream grpc.ServerStreamingServer[apiv1.CallbackEvent]) error
Listen sends readiness before waiting for exactly one matching callback.
func (*Server) Put ¶
Put persists a replacement session before the plugin publishes new credentials.
func (*Server) Read ¶
func (s *Server) Read(ctx context.Context, request *apiv1.SecretRequest) (*apiv1.SecretResponse, error)
Read reads an explicitly granted secret without exposing backend diagnostics.