authadminclient

package
v1.98.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2025 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Error = errs.Class("auth admin client")

Error is a class of auth admin client errors.

Functions

This section is empty.

Types

type Client

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

Client is a client for managing auth records.

func Open added in v1.70.0

func Open(ctx context.Context, config Config, log *zap.Logger) (*Client, error)

Open returns an initialized Client connected to the configured databases.

func (*Client) Close added in v1.70.0

func (c *Client) Close() error

Close closes the client's database connections.

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, encodedKey string) error

Delete deletes a record from all configured authservice databases.

func (*Client) Get

func (c *Client) Get(ctx context.Context, encodedKey string) (record Record, err error)

Get returns a record.

func (*Client) Invalidate

func (c *Client) Invalidate(ctx context.Context, encodedKey, reason string) error

Invalidate invalidates a record on all configured authservice databases.

func (*Client) Resolve

func (c *Client) Resolve(ctx context.Context, encodedKey string) (record Record, err error)

Resolve resolves an encryption key or access grant to a record. This is useful if input key could be either an encryption key for an authservice record, a hash of the encryption key, or an access grant.

Linksharing links support both access keys and access grants, so this is useful to look up details for either case.

Note that various fields on pb.Record are not set if resolving an access grant, such as EncryptedAccessGrant, and ExpiresAtUnix.

func (*Client) Unpublish

func (c *Client) Unpublish(ctx context.Context, encodedKey string) error

Unpublish unpublishes a record on all configured authservice databases.

type Config

type Config struct {
	Spanner spannerauth.Config
}

Config configures Client.

type Record

type Record struct {
	*authdb.FullRecord
	DecryptedAccessGrant string    `json:"decrypted_access_grant,omitempty"`
	PublicProjectUUID    uuid.UUID `json:"public_project_id,omitempty"`
	MacaroonHeadHex      string    `json:"macaroon_head_hex,omitempty"`
	APIKey               string    `json:"api_key,omitempty"`
}

Record is a representation of pb.Record for display purposes.

Jump to

Keyboard shortcuts

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