bridge

package
v1.234.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package bridge serves Atmos API services to native plugins within live invocations.

Index

Constants

View Source
const InvocationMetadata = "atmos-invocation-id"

InvocationMetadata is set by Plugin SDK calls back into the Atmos API.

Variables

This section is empty.

Functions

func ClearPrivateSession

func ClearPrivateSession(storage keyring.Keyring, namespace string) error

ClearPrivateSession deletes a whole host-selected scope without enumerating the keyring. OS keychains support this just like encrypted file and memory backends.

Types

type Invocation

type Invocation struct {
	Context     context.Context
	Browser     api.Browser
	HTTP        api.HTTP
	Secrets     SecretReader
	Keyring     keyring.Keyring
	Namespace   string
	Interactive bool
}

Invocation scopes API services to a single active call. Namespace includes the package, configured provider, realm, and configuration fingerprint.

type SecretReader

type SecretReader interface {
	ReadSecret(context.Context, string) (string, error)
}

SecretReader grants logical names, never arbitrary store paths, to one provider.

type Server

Server rejects API requests after their invocation has completed.

func New

func New() *Server

New creates an isolated API server for one native plugin process.

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) Delete

func (s *Server) Delete(ctx context.Context, request *apiv1.DeleteRequest) (*emptypb.Empty, error)

Delete removes session state even after its access token has expired.

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

Listen sends readiness before waiting for exactly one matching callback.

func (*Server) Open

func (s *Server) Open(ctx context.Context, request *apiv1.OpenRequest) (*emptypb.Empty, error)

Open launches the browser configured for this invocation.

func (*Server) Put

func (s *Server) Put(ctx context.Context, request *apiv1.PutRequest) (*emptypb.Empty, error)

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.

func (*Server) Register

func (s *Server) Register(server *grpc.Server)

Register attaches all API services to one broker connection.

Jump to

Keyboard shortcuts

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