Documentation ¶
Overview ¶
Package keymgr adds a simple wrapper to Windows Credential Manager for the Go language. This package requires MinGW-64
Source code and other details for the project are available at GitHub:
https://github.com/ro-ag/keymgr
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CallArgs ¶
type CallArgs struct { Target string // Target normally is a Site or Server ( already passed in Cred Structure ) User string // User from Credential Manager Pass string // PassWord from Credential Manager Attempts int // Current number of attempts }
CallArgs : Needed for CallBack function, it contains the User, Password, Target ( usually a server or site ) Attempts is the current time the credentials are prompted
type Cred ¶
type Cred struct { Program string `validate:"nonzero"` // Program identifier Target string `validate:"nonzero"` // Target normally is a Site or Server Limit int `validate:"min=1"` // Limit of login intents before fail Debug bool // Print keymgr log information }
Cred : Initial Structure
func (*Cred) Login ¶
Login : This function needs a CallBack function with interface return The Flow Actions in Login function:
1.- Check if Credentials with name "*[Program]~[Target]*" exits 1.1.- If exists go to step 5 2.- Run a GUI to prompt user and password 3.- Store Credentials in Windows Credential Manager 4.- Load Credentials ( check if works ) 5.- Run "CallBack" function 5.1 - If status is not 0 remove credentials 5.2 - Go to Step 2 5.3 - if Attempts is >= Limit return nil 6.- Return "CallBack" interface
Click to show internal directories.
Click to hide internal directories.