trust

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CmdTrust = cli.NewCmd[Command](cli.CmdRoot, "trust", func(cmd *cobra.Command) {
	cfg := cli.ConfigFromCmd(cmd)

	cmd.Flags().StringVarP(&cfg.Org.APID, "org", "o", cli.Defaults.Org.APID, "Organization to trust.")
	cmd.Flags().BoolVar(&cfg.Trust.NoSudo, "no-sudo", cli.Defaults.Trust.NoSudo, "Disable sudo prompts.")
	cmd.Flags().StringVarP(&cfg.Realm.APID, "realm", "r", cli.Defaults.Realm.APID, "Realm to trust.")
	cmd.Flags().StringSliceVar(&cfg.Trust.Stores, "trust-stores", cli.Defaults.Trust.Stores, "Trust stores to update.")

	cmd.MarkFlagsRequiredTogether("org", "realm")
})
View Source
var CmdTrustAudit = cli.NewCmd[Audit](CmdTrust, "audit", func(cmd *cobra.Command) {
	cfg := cli.ConfigFromCmd(cmd)

	cmd.Flags().StringVarP(&cfg.Org.APID, "org", "o", cli.Defaults.Org.APID, "Organization to trust.")
	cmd.Flags().StringVarP(&cfg.Realm.APID, "realm", "r", cli.Defaults.Realm.APID, "Realm to trust.")
	cmd.Flags().StringSliceVar(&cfg.Trust.Stores, "trust-stores", cli.Defaults.Trust.Stores, "Trust stores to update.")

	cmd.MarkFlagsRequiredTogether("org", "realm")
})
View Source
var CmdTrustClean = cli.NewCmd[Clean](CmdTrust, "clean", func(cmd *cobra.Command) {
	cfg := cli.ConfigFromCmd(cmd)

	cmd.Flags().StringSliceVar(&cfg.Trust.Clean.States, "cert-states", cli.Defaults.Trust.Clean.States, "Cert states to clean.")
	cmd.Flags().StringVarP(&cfg.Org.APID, "org", "o", cli.Defaults.Org.APID, "Organization to trust.")
	cmd.Flags().BoolVar(&cfg.Trust.NoSudo, "no-sudo", cli.Defaults.Trust.NoSudo, "Disable sudo prompts.")
	cmd.Flags().StringVarP(&cfg.Realm.APID, "realm", "r", cli.Defaults.Realm.APID, "Realm to trust.")
	cmd.Flags().StringSliceVar(&cfg.Trust.Stores, "trust-stores", cli.Defaults.Trust.Stores, "Trust stores to update.")

	cmd.MarkFlagsRequiredTogether("org", "realm")

	cmd.Hidden = true
})

Functions

func FetchExpectedCAs added in v0.1.0

func FetchExpectedCAs(ctx context.Context, anc *api.Session, org, realm string) ([]*truststore.CA, error)

func FetchLocalDevCAs added in v0.1.0

func FetchLocalDevCAs(ctx context.Context, anc *api.Session) ([]*truststore.CA, error)

func LoadStores added in v0.1.0

func LoadStores(ctx context.Context, drv *ui.Driver) ([]truststore.Store, error)

func PerformAudit added in v0.0.8

func PerformAudit(ctx context.Context, stores []truststore.Store, cas []*truststore.CA) (*truststore.AuditInfo, error)

Types

type Audit added in v0.0.8

type Audit struct {
	Anc *api.Session

	OrgAPID, RealmAPID string
}

func (*Audit) RunTUI added in v0.0.23

func (c *Audit) RunTUI(ctx context.Context, drv *ui.Driver) error

func (Audit) UI added in v0.0.8

func (a Audit) UI() cli.UI

type Clean added in v0.0.8

type Clean struct {
	Anc                *api.Session
	OrgAPID, RealmAPID string
}

func (*Clean) Perform added in v0.0.13

func (c *Clean) Perform(ctx context.Context, drv *ui.Driver) error

func (Clean) UI added in v0.0.8

func (c Clean) UI() cli.UI

type Command

type Command struct {
	Anc                *api.Session
	OrgAPID, RealmAPID string

	AuditInfo *truststore.AuditInfo
}

func (*Command) Perform added in v0.0.33

func (c *Command) Perform(ctx context.Context, drv *ui.Driver) error

func (Command) UI added in v0.0.8

func (c Command) UI() cli.UI

type SudoManager added in v0.0.8

type SudoManager struct {
	truststore.CmdFS

	NoSudo bool

	AroundSudo func(sudoExec func())
}

func (*SudoManager) SudoExec added in v0.0.8

func (s *SudoManager) SudoExec(cmd *exec.Cmd) ([]byte, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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