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

serviceaccountcmd

package
v0.30.2 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package serviceaccountcmd provides the "service-account" cobra command a host CLI mounts to manage service accounts: create, list, show, disable, enable and delete accounts; add, list and revoke their keys; and grant and remove their application roles. It opens the identity database directly, so it works whether or not the server is running, and never changes the schema.

Access changes the commands make (disabling an account, removing a role, revoking a key) are recorded in the database, where applications read them; announcing them to a running server's in-process sinks is the server's job.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Command

func Command(open Open, opts Options) *cobra.Command

Command returns "service-account" and its subcommands.

func DefaultService

func DefaultService(registry *authz.VocabularyRegistry, opts ...approle.Option) func(*ent.Client) (*serviceaccount.Service, error)

DefaultService builds the service with the host's application role vocabularies, so role commands accept the host's applications. With a nil registry no application is known: roles cannot be granted, but accounts can still be deleted with any roles they hold.

Types

type Open

type Open func(ctx context.Context) (client *ent.Client, closeFn func() error, err error)

Open opens the identity database for one command, returning its client and the function that closes it.

type Options

type Options struct {
	// Service builds the service-account service over an open client.
	// Default: DefaultService(nil), which cannot grant or remove roles.
	Service func(client *ent.Client) (*serviceaccount.Service, error)
	// Issuer returns SystemAuth's issuer URL, printed with a new key so the
	// workload has everything it needs. Nil leaves it out.
	Issuer func() string
}

Options configure the command.

Jump to

Keyboard shortcuts

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