credentials

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package credentials issues the credential a hosted agent sandbox uses to authenticate to Obot.

The credential authenticates as the agent rather than as its owner, so a compromised sandbox reaches only what that one instance was configured with instead of everything its owner can reach.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Issuer

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

func New

func New(gatewayClient *client.Client) *Issuer

func (*Issuer) EnsureInstanceCredential

func (i *Issuer) EnsureInstanceCredential(ctx context.Context, instanceID, ownerUserID string) (string, string, error)

EnsureInstanceCredential returns the instance's credential, minting one only when none exists.

The plaintext is kept in Obot's encrypted credential store, mirroring what nanobot agents do, because an API key's secret is not recoverable from its database row. Every reconcile therefore returns the same value and the same version, which is what keeps the desired revision stable; reissuing would change the version and restart the sandbox.

func (*Issuer) RevokeInstanceCredential

func (i *Issuer) RevokeInstanceCredential(ctx context.Context, instanceID string) error

RevokeInstanceCredential revokes the key and deletes its stored plaintext. Revocation immediately invalidates a key, so a leaked credential stops working at once rather than waiting for an expiry these keys deliberately do not have.

Jump to

Keyboard shortcuts

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