keyring

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: MIT Imports: 5 Imported by: 1

Documentation

Overview

Package keyring provides totp secret storage using keyring.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option interface {
	TOTPSecretProviderOption
}

Option configures the services provided by the keyring package.

func WithLogger

func WithLogger(l ctxd.Logger) Option

WithLogger sets the logger for the keyring package.

type TOTPSecretProvider added in v0.5.0

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

TOTPSecretProvider is a TOTP secret getter and setter that uses the keyring to store the TOTP secret.

func TOTPSecretFromKeyring

func TOTPSecretFromKeyring(account string, opts ...TOTPSecretProviderOption) *TOTPSecretProvider

TOTPSecretFromKeyring returns a TOTP secret getter and setter that uses the keyring to store the TOTP secret.

func (*TOTPSecretProvider) DeleteTOTPSecret added in v0.5.0

func (s *TOTPSecretProvider) DeleteTOTPSecret(ctx context.Context) error

DeleteTOTPSecret deletes the TOTP secret in the keyring.

func (*TOTPSecretProvider) SetTOTPSecret added in v0.5.0

func (s *TOTPSecretProvider) SetTOTPSecret(ctx context.Context, secret otp.TOTPSecret, _ string) error

SetTOTPSecret persists the TOTP secret to the keyring.

func (*TOTPSecretProvider) TOTPSecret added in v0.5.0

func (s *TOTPSecretProvider) TOTPSecret(ctx context.Context) otp.TOTPSecret

TOTPSecret returns the TOTP secret from the keyring.

type TOTPSecretProviderOption added in v0.5.0

type TOTPSecretProviderOption interface {
	// contains filtered or unexported methods
}

TOTPSecretProviderOption is an option to configure TOTPSecretProvider.

func WithStorage

WithStorage sets the storage for the TOTP secret getter and setter.

Jump to

Keyboard shortcuts

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