api

package
v0.0.0-...-e1c9297 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PropertyNotes = SecretProperty{Name: "notes", Display: "Notes", MultiLine: true}
View Source
var PropertyPassword = SecretProperty{Name: "password", Display: "Password", Blurred: true}
View Source
var PropertyProductVersion = SecretProperty{Name: "productVersion", Display: "Version"}
View Source
var PropertyRegCode = SecretProperty{Name: "regCode", Display: "Licence code", MultiLine: true}
View Source
var PropertyRegName = SecretProperty{Name: "regName", Display: "Licenced to"}
View Source
var PropertySID = SecretProperty{Name: "sid", Display: "Sid", Blurred: true}
View Source
var PropertyTOTPUrl = SecretProperty{Name: "totpUrl", Display: "TOTP Url", OTPParams: true}
View Source
var PropertyUsername = SecretProperty{Name: "username", Display: "Username"}
View Source
var SecretTypes = []SecretTypeDefinition{
	{Type: SecretTypeLogin, Display: "Login", Properties: []SecretProperty{
		PropertyUsername,
		PropertyPassword,
		PropertyTOTPUrl,
		PropertyNotes,
	}},
	{Type: SecretTypeNote, Display: "Note", Properties: []SecretProperty{
		PropertyNotes,
	}},
	{Type: SecretTypeWLAN, Display: "WLAN", Properties: []SecretProperty{
		PropertySID,
		PropertyPassword,
		PropertyNotes,
	}},
	{Type: SecretTypeLicence, Display: "Licence", Properties: []SecretProperty{
		PropertyRegName,
		PropertyRegCode,
		PropertyProductVersion,
		PropertyNotes,
	}},
}

Functions

This section is empty.

Types

type CharsParameter

type CharsParameter struct {
	NumChars         int  `json:"num_chars"`
	IncludeUpper     bool `json:"include_upper"`
	IncludeNumbers   bool `json:"include_numbers"`
	IncludeSymbols   bool `json:"include_symbols"`
	RequireUpper     bool `json:"require_upper"`
	RequireNumber    bool `json:"require_number"`
	RequireSymbol    bool `json:"require_symbol"`
	ExcludeSimilar   bool `json:"exclude_similar"`
	ExcludeAmbiguous bool `json:"exclude_ambiguous"`
}

type GenerateParameter

type GenerateParameter struct {
	Chars *CharsParameter `json:"chars,omitempty"`
	Words *WordsParameter `json:"words,omitempty"`
}

type Identity

type Identity struct {
	Name  string `json:"name"`
	Email string `json:"email"`
}

Identity contains information about anyone allowed to access a trust store

type MasterKey

type MasterKey struct {
	Locked     bool       `json:"locked"`
	AutolockAt *time.Time `json:"autolock_at,omitempty"`
}

MasterKey contains information about an available masterkey (and its status)

type MasterKeyUnlock

type MasterKeyUnlock struct {
	Identity
	// NODE: Tempoary measure until there is proper pinentry
	Passphrase string `json:"passphrase"`
}

MasterKeyUnlock is required to unlock a masterkey (might become obsolete)

type PasswordEstimate

type PasswordEstimate struct {
	Password string   `json:"password"`
	Inputs   []string `json:"inputs,omitempty"`
}

PasswordEstimate options to estimate the strength of a password

type PasswordStrength

type PasswordStrength struct {
	Entropy          float64 `json:"entropy"`
	CrackTime        float64 `json:"crackTime"`
	CrackTimeDisplay string  `json:"crackTimeDisplay"`
	Score            int     `json:"score"`
}

PasswordStrength contains details about the strength of a password

type Secret

type Secret struct {
	SecretCurrent
	Versions          SecretVersions               `json:"versions"`
	PasswordStrengths map[string]*PasswordStrength `json:"password_strengths"`
}

Secret holds all information of a secret (including all previous versions)

type SecretAttachment

type SecretAttachment struct {
	Name     string `json:"name"`
	MimeType string `json:"mimeType"`
	Content  []byte `json:"content"`
}

SecretAttachment is an attachment to a secret

type SecretCurrent

type SecretCurrent struct {
	ID      string         `json:"id"`
	Type    SecretType     `json:"type"`
	Current *SecretVersion `json:"current,omitempty"`
}

SecretCurrent contains the current (head) version of a secret

type SecretEntry

type SecretEntry struct {
	ID             string     `json:"id"`
	Name           string     `json:"name"`
	NameHighlights []int      `json:"nameHighlights"`
	Type           SecretType `json:"type"`
	Tags           []string   `json:"tags"`
	URLs           []string   `json:"urls"`
	Timestamp      time.Time  `json:"timestamp"`
	Deleted        bool       `json:"deleted"`
}

SecretEntry is a reference to a stored secret

func (*SecretEntry) HasTag

func (e *SecretEntry) HasTag(tag string) bool

func (*SecretEntry) MatchesURL

func (e *SecretEntry) MatchesURL(urlStr string) bool

type SecretList

type SecretList struct {
	AllTags []string       `json:"all_tags"`
	Entries []*SecretEntry `json:"entries"`
}

SecretList contains a list of all SecretEntries

type SecretListFilter

type SecretListFilter struct {
	URL     string     `json:"url,omitempty"`
	Tag     string     `json:"tag,omitempty"`
	Type    SecretType `json:"type,omitempty"`
	Name    string     `json:"name,omitempty"`
	Deleted bool       `json:"deleted,omitempty"`
}

SecretListFilter filter options to query secret list

type SecretProperty

type SecretProperty struct {
	Name      string
	Display   string
	MultiLine bool
	Blurred   bool
	OTPParams bool
}

type SecretPropertyList

type SecretPropertyList []SecretProperty

func (SecretPropertyList) Len

func (p SecretPropertyList) Len() int

func (SecretPropertyList) Less

func (p SecretPropertyList) Less(i, j int) bool

func (SecretPropertyList) Sort

func (p SecretPropertyList) Sort()

func (SecretPropertyList) Swap

func (p SecretPropertyList) Swap(i, j int)

type SecretType

type SecretType string

SecretType is the type of the secret to store

const (
	// SecretTypeLogin is a generic login (of a webpage)
	SecretTypeLogin SecretType = "login"
	// SecretTypeNote is a general secret note
	SecretTypeNote SecretType = "note"
	// SecretTypeLicence is some kind of software licence (key)
	SecretTypeLicence SecretType = "licence"
	// SecretTypeWLAN is a wlan password
	SecretTypeWLAN SecretType = "wlan"
	// SecretTypePassword is some kind of generic password/key
	SecretTypePassword SecretType = "password"
)

type SecretTypeDefinition

type SecretTypeDefinition struct {
	Type       SecretType
	Display    string
	Properties []SecretProperty
}

type SecretVersion

type SecretVersion struct {
	Timestamp   time.Time          `json:"timestamp"`
	Name        string             `json:"name"`
	Tags        []string           `json:"tags"`
	URLs        []string           `json:"urls"`
	Properties  map[string]string  `json:"properties"`
	Attachments []SecretAttachment `json:"attachment"`
	Deleted     bool               `json:"deleted"`
}

SecretVersion is a concret version of a secret

type SecretVersions

type SecretVersions []*SecretVersion

SecretVersions is a sequence of SecretVersion

func (SecretVersions) Len

func (s SecretVersions) Len() int

func (SecretVersions) Less

func (s SecretVersions) Less(i, j int) bool

func (SecretVersions) Sort

func (s SecretVersions) Sort()

Sort the versions, newest will be first

func (SecretVersions) Swap

func (s SecretVersions) Swap(i, j int)

type Status

type Status struct {
	Initialized bool       `json:"initialized"`
	Locked      bool       `json:"locked"`
	AutolockAt  *time.Time `json:"autolock_at,omitempty"`
	Version     string     `json:"version"`
}

Status contains relevant status information of the daemon

type WordsParameter

type WordsParameter struct {
	NumWords int    `json:"num_words"`
	Delim    string `json:"delim"`
}

Jump to

Keyboard shortcuts

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