interactif

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const AskSecretID = "Enter Secret ID: "

Variables

View Source
var SecretFieldNames = []string{"Username", "Credential", "URL", "LastUpdate", "LastUpdateBy", "Comment"}

this package will contain all the functions to interact with the user it will be used by the main.go file

View Source
var SecretHumanFieldNames = []string{"Username", "Credential", "URL", "Comment"}

Functions

func AddSecretInteractive

func AddSecretInteractive(ctx context.Context, secstore securestore.SecretStore) error

this function will ask the user an ID and a secret and it will be stored in vault

func AskSecret added in v1.0.0

func AskSecret() string

Ask the user to enter a secret Id

func AskSecretI added in v1.0.2

func AskSecretI(i Interactif) string

Ask the user to enter a secret Id

func AskUser

func AskUser() map[string]string

this function will ask the user to enter the value of the field and return the value as map[string]string

func AskUserwithPrevious

func AskUserwithPrevious(Previous map[string]string) map[string]string

this function will ask the user to enter the value of the field and return the value as map[string]string

func DeleteSecretInteractive

func DeleteSecretInteractive(ctx context.Context, secstore securestore.SecretStore) error

this function will ask the user an ID and it will delete it from vault

func GenerateBootstrapToken added in v1.0.0

func GenerateBootstrapToken(ctx context.Context, secstore securestore.SecretStore)

this function will create a temporary token that will return the secret once unwrapped

func GenerateBootstrapTokenList added in v1.0.0

func GenerateBootstrapTokenList(ctx context.Context, secstore securestore.SecretStore)

this function will create a temporary token that will return the lsit of secrets once unwrapped

func GenerateServiceToken added in v1.0.0

func GenerateServiceToken(ctx context.Context, secstore securestore.SecretStore) string

this function will create a service token, will store it in a cubbyhole entry and will return the wrap token

func RandomPassword added in v1.0.0

func RandomPassword()

return random password after asking the user for the length and complexity

func ReadPin

func ReadPin() string

read user input for smartcard pin

func ReadUsernamePassword

func ReadUsernamePassword() (string, string)

ask for username and password and return them

func SelectSmartcard

func SelectSmartcard() string

select smartcard type

func UpdateSecretInteractive

func UpdateSecretInteractive(ctx context.Context, secstore securestore.SecretStore) error

this function will ask the user to enter the secret id and it will search it in vault and allow update it if the secret did not expire

Types

type DefaultInteractif added in v1.0.2

type DefaultInteractif struct{}

default Interactif will be stdin/stdout

func (DefaultInteractif) Print added in v1.0.2

func (i DefaultInteractif) Print(s string)

func (DefaultInteractif) ReadLine added in v1.0.2

func (i DefaultInteractif) ReadLine() string

define the DefaultInteractif methods

type Interactif added in v1.0.2

type Interactif interface {
	ReadLine() string
	Print(s string)
}

define Interactif as a struct to allow testing capabilities

Jump to

Keyboard shortcuts

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