Help us shape the future of Go! Take the 2026 Go Developer Survey

credentials

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package credentials delivers credentials into sandboxes for seats whose access grants sandbox delivery (the github and browser plugins), and revokes them when the grant goes (docs/sandbox.html).

Revocation has two parts. Steadmesh stops delivering at once: a seat without the grant is refused. Credentials already delivered are invalidated where the service allows it: GitHub App installation tokens are revoked at GitHub when a sync removes the seat's grant. A personal access token and browser cookies cannot be invalidated by Steadmesh; they stay usable until rotated or logged out, which the documentation states.

Index

Constants

This section is empty.

Variables

View Source
var ErrForbidden = errors.New("credential not granted")

ErrForbidden means the seat's access does not grant the credential.

Functions

func Scope

func Scope(a *access.SeatAccess, connection string) (connectors.CredentialScope, error)

Scope is what a seat's access grants on a connection, or ErrForbidden.

Types

type Connections

type Connections interface {
	Tracker(orgID, key string) (connectors.Tracker, error)
}

Connections resolves a connection's adapter.

type Registry

type Registry struct {
	Connections Connections
	Log         *slog.Logger
	Now         func() time.Time
	// contains filtered or unexported fields
}

Registry issues credentials and remembers revocable ones.

func (*Registry) Issue

func (r *Registry) Issue(ctx context.Context, org, seat string, a *access.SeatAccess, connection string) (runtimeapi.CredentialResponse, error)

Issue delivers a credential of connection to seat (key) of org.

func (*Registry) Outstanding

func (r *Registry) Outstanding(org, seat string) int

Outstanding counts unexpired revocable credentials of a seat.

func (*Registry) Reconcile

func (r *Registry) Reconcile(ctx context.Context, org string, seats map[string]*access.SeatAccess) []Revoked

Reconcile revokes the credentials of org's seats that no longer hold the grant they were issued under. seats maps seat key to current access; a missing seat lost everything.

type Revoked

type Revoked struct {
	Seat, Connection string
	Err              error
}

Revoked is one revoked credential, for events.

Jump to

Keyboard shortcuts

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