credentials

package
v3.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package credentials implements our struct stored in keychain. Store struct is kind of like a database client. Credentials struct is kind of like one record from the database.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrWrongFormat = errors.New("malformed credentials")
)

Functions

This section is empty.

Types

type Credentials

type Credentials struct {
	UserID,
	Name,
	Emails,
	APIToken string
	MailboxPassword []byte
	BridgePassword,
	Version string
	Timestamp int64
	IsHidden,
	IsCombinedAddressMode bool
}

func (*Credentials) EmailList

func (s *Credentials) EmailList() []string

func (*Credentials) Marshal

func (s *Credentials) Marshal() string

func (*Credentials) SplitAPIToken

func (s *Credentials) SplitAPIToken() (string, string, error)

func (*Credentials) Unmarshal

func (s *Credentials) Unmarshal(secret string) error

type Keychain

type Keychain interface {
	List() ([]string, error)
	Get(string) (string, string, error)
	Put(string, string) error
	Delete(string) error
}

type Store

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

Store is an encrypted credentials store.

func NewStore

func NewStore(keychain Keychain) *Store

NewStore creates a new encrypted credentials store.

func (*Store) Get

func (s *Store) Get(userID string) (creds *Credentials, err error)

func (*Store) List

func (s *Store) List() (userIDs []string, err error)

List returns a list of usernames that have credentials stored.

Jump to

Keyboard shortcuts

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