share

package
v0.30.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package share revokes a shared provider account. Revoking always succeeds: the policy bindings holding the share let go of it (a binding left with no account goes), relay keys whose lane it was move to their principal's own account and keep working (or stop, when that is a personal account turned off), and pools drawing on it lose it. Each change is reported, so whoever revokes sees the impact without needing to see or edit the rows.

Out of scope: who may revoke (the callers check), and making shares (app/refcheck and the control API).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Change

type Change struct {
	// Kind is the row's API singular: policy-binding, key or pool.
	Kind  string
	ID    string
	Name  string
	Owner meta.Owner
	// Field is the field that named the share.
	Field string
	// Deleted is set on a policy binding the revoke left with no account, which goes.
	Deleted bool
}

Change is one row a revoke changes besides the share itself.

func Impact

func Impact(r Rows, id string) []Change

Impact is what revoking share id changes in rows, in the order Revoke makes the changes.

func Revoke

func Revoke(ctx context.Context, s Stores, id string) ([]Change, error)

Revoke deletes share id and makes every change Impact reports. A row that is not a share is refused.

type Rows

type Rows struct {
	Bindings []*policybinding.PolicyBinding
	Keys     []*key.Key
	Pools    []*pool.Pool
}

Rows are what a revoke reads.

type Stores

type Stores struct {
	Account       *account.Store
	PolicyBinding *policybinding.Store
	Key           *key.Store
	Pool          *pool.Store
	// OwnAccount returns the id of a principal's own account (a user's personal account, a service account's account), making it on first use; "" leaves the key with no lane, which stops it while that account is turned off.
	OwnAccount func(ctx context.Context, p key.Principal) (string, error)
}

Stores are what a revoke writes through; the caller runs Revoke inside one transaction.

Jump to

Keyboard shortcuts

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