Documentation ¶
Overview ¶
secret service implementation according to: http://standards.freedesktop.org/secret-service
create, update dbus objects and interfaces
secret service implementation according to: http://standards.freedesktop.org/secret-service
secret service implementation according to: http://standards.freedesktop.org/secret-service
secret service implementation according to: http://standards.freedesktop.org/secret-service
secret service implementation according to: http://standards.freedesktop.org/secret-service
secret service implementation according to: http://standards.freedesktop.org/secret-service
secret service implementation according to: http://standards.freedesktop.org/secret-service
secret service implementation according to: http://standards.freedesktop.org/secret-service
secret service implementation according to: http://standards.freedesktop.org/secret-service
secret service implementation according to: http://standards.freedesktop.org/secret-service
secret service implementation according to: http://standards.freedesktop.org/secret-service
secret service implementation according to: http://standards.freedesktop.org/secret-service
secret service implementation according to: http://standards.freedesktop.org/secret-service
secret service implementation according to: http://standards.freedesktop.org/secret-service
Index ¶
- Variables
- func ApiErrorIsLocked() *dbus.Error
- func ApiErrorNoSession() *dbus.Error
- func ApiErrorNoSuchObject() *dbus.Error
- func ApiErrorNotSupported() *dbus.Error
- func CommandExists(cmdName string) bool
- func DbusError(dbusError, message string) *dbus.Error
- func DbusErrorAccessDenied(message string) *dbus.Error
- func DbusErrorAddressInUse(message string) *dbus.Error
- func DbusErrorBadAddress(message string) *dbus.Error
- func DbusErrorCallFailed(message string) *dbus.Error
- func DbusErrorDisconnected(message string) *dbus.Error
- func DbusErrorInvalidArgs(message string) *dbus.Error
- func DbusErrorInvalidSignature(message string) *dbus.Error
- func DbusErrorLimitsExceeded(message string) *dbus.Error
- func DbusErrorNoMemory(message string) *dbus.Error
- func DbusErrorNoNetwork(message string) *dbus.Error
- func DbusErrorNoReply(message string) *dbus.Error
- func DbusErrorNoServer(message string) *dbus.Error
- func DbusErrorNotSupported(message string) *dbus.Error
- func DbusErrorPropertyReadOnly(message string) *dbus.Error
- func DbusErrorServiceUnknown(message string) *dbus.Error
- func DbusErrorTimeout(message string) *dbus.Error
- func DbusErrorUnknownInterface(message string) *dbus.Error
- func DbusErrorUnknownMethod(message string) *dbus.Error
- func DbusErrorUnknownObject(message string) *dbus.Error
- func DbusErrorUnknownProperty(message string) *dbus.Error
- func DefaultCollection(parent *Service, locked bool, created uint64, modified uint64)
- func Epoch() uint64
- func IsMapSubsetFullMatch(mapSet map[string]string, mapSubset map[string]string, lock *sync.RWMutex) bool
- func IsMapSubsetFullMatchGeneric(mapSet interface{}, mapSubset interface{}, lock *sync.RWMutex) bool
- func IsMapSubsetSingleMatch(mapSet map[string]string, mapSubset map[string]string, lock *sync.RWMutex) bool
- func Marshal(service *Service, dbFile string)
- func MemUsageOS() uint64
- func Path2Name(path string, name string) (string, string)
- func PersistData(ctx context.Context, service *Service)
- func RestoreData(service *Service)
- func UUID() string
- type CliSession
- type Collection
- func (collection *Collection) AddItem(item *Item, replace bool, saveData bool, locked bool, created uint64, ...) error
- func (c *Collection) CreateItem(properties map[string]dbus.Variant, secretApi SecretApi, replace bool) (dbus.ObjectPath, dbus.ObjectPath, *dbus.Error)
- func (collection *Collection) CreateMethodFromPath(method string) string
- func (c *Collection) Delete() (dbus.ObjectPath, *dbus.Error)
- func (collection *Collection) GetItemByPath(itemPath dbus.ObjectPath) *Item
- func (collection *Collection) GetProperty(name string) (dbus.Variant, error)
- func (collection *Collection) Lock()
- func (collection *Collection) RemoveItem(item *Item)
- func (c *Collection) SearchItems(attributes map[string]string) ([]dbus.ObjectPath, *dbus.Error)
- func (collection *Collection) SetProperties(properties map[string]dbus.Variant)
- func (collection *Collection) SetProperty(name string, value interface{})
- func (collection *Collection) SignalCollectionChanged()
- func (collection *Collection) SignalCollectionCreated()
- func (collection *Collection) SignalCollectionDeleted()
- func (collection *Collection) Unlock()
- func (collection *Collection) UpdateModified()
- func (collection *Collection) UpdatePropertyCollectionItems()
- type Database
- type DbCollection
- type DbItem
- type DbSecret
- type EncryptionAlgorithm
- type Item
- func (i *Item) CreateMethodFromPath(method string) string
- func (item *Item) Delete() (dbus.ObjectPath, *dbus.Error)
- func (i *Item) GetLookupAttribute(key string) string
- func (item *Item) GetProperty(name string) (dbus.Variant, error)
- func (item *Item) GetSecret(session dbus.ObjectPath) (*SecretApi, *dbus.Error)
- func (item *Item) Lock()
- func (item *Item) SetProperties(properties map[string]dbus.Variant)
- func (item *Item) SetProperty(name string, value interface{})
- func (item *Item) SetSecret(secretApi SecretApi) *dbus.Error
- func (item *Item) SignalItemChanged()
- func (item *Item) SignalItemCreated()
- func (item *Item) SignalItemDeleted()
- func (item *Item) Unlock()
- func (item *Item) UpdateModified()
- type PasswordFile
- type Prompt
- type SaveData
- type Secret
- type SecretApi
- type SecretMap
- type SecretService
- type SecretServiceCLiSession
- type Service
- func (s *Service) AddCollection(collection *Collection, locked bool, created uint64, modified uint64, ...)
- func (s *Service) AddSession(session *Session)
- func (service *Service) Command(command string, params string) (string, *dbus.Error)
- func (service *Service) CreateCollection(properties map[string]dbus.Variant, alias string) (dbus.ObjectPath, dbus.ObjectPath, *dbus.Error)
- func (s *Service) GetCollectionByAlias(alias string) *Collection
- func (service *Service) GetCollectionByPath(collectionPath dbus.ObjectPath) *Collection
- func (service *Service) GetItemByPath(itemPath dbus.ObjectPath) *Item
- func (service *Service) GetSecrets(items []dbus.ObjectPath, session dbus.ObjectPath) (map[dbus.ObjectPath]SecretApi, *dbus.Error)
- func (service *Service) GetSessionByPath(sessionPath dbus.ObjectPath) *Session
- func (s *Service) HasCollection(collectionPath dbus.ObjectPath) bool
- func (s *Service) HasSession(sessionPath dbus.ObjectPath) bool
- func (service *Service) Lock(objects []dbus.ObjectPath) ([]dbus.ObjectPath, dbus.ObjectPath, *dbus.Error)
- func (service *Service) OpenSession(algorithm string, input dbus.Variant) (dbus.Variant, dbus.ObjectPath, *dbus.Error)
- func (service *Service) ReadAlias(name string) (dbus.ObjectPath, *dbus.Error)
- func (service *Service) ReadPasswordFile() string
- func (s *Service) RemoveCollection(collection *Collection)
- func (s *Service) RemoveSession(session *Session)
- func (s *Service) SaveData()
- func (service *Service) SearchItems(attributes map[string]string) ([]dbus.ObjectPath, []dbus.ObjectPath, *dbus.Error)
- func (service *Service) SetAlias(name string, collection dbus.ObjectPath) *dbus.Error
- func (service *Service) Start(ctx context.Context)
- func (service *Service) Unlock(objects []dbus.ObjectPath) ([]dbus.ObjectPath, dbus.ObjectPath, *dbus.Error)
- func (s *Service) UpdatePropertyCollections()
- func (service *Service) WritePasswordFile(passwordHash string) error
- type ServiceConfig
- type Session
Constants ¶
This section is empty.
Variables ¶
var PropsCollection *prop.Properties
Collection dbus properties
var PropsItem *prop.Properties
var PropsService *prop.Properties
Functions ¶
func ApiErrorIsLocked ¶
func ApiErrorIsLocked() *dbus.Error
OrgFreedesktopSecretErrorIsLocked "The object must be unlocked before this action can be carried out."
func ApiErrorNoSession ¶
func ApiErrorNoSession() *dbus.Error
OrgFreedesktopSecretErrorNoSession "The session does not exist."
func ApiErrorNoSuchObject ¶
func ApiErrorNoSuchObject() *dbus.Error
OrgFreedesktopSecretErrorNoSuchObject "No such item or collection exists."
func ApiErrorNotSupported ¶
func ApiErrorNotSupported() *dbus.Error
OrgFreedesktopDBusErrorNotSupported "Service does not support a specific set of algorithms for encryption."
func CommandExists ¶
CommandExists returns true if command exists on OS otherwise false
func DbusError ¶
func DbusError(dbusError, message string) *dbus.Error
DbusError is the low-level dbus error function
func DbusErrorAccessDenied ¶
func DbusErrorAccessDenied(message string) *dbus.Error
DbusErrorAccessDenied means the call/operation tried to access a resource it isn't allowed to
func DbusErrorAddressInUse ¶
func DbusErrorAddressInUse(message string) *dbus.Error
DbusErrorAddressInUse means D-Bus address is already taken
func DbusErrorBadAddress ¶
func DbusErrorBadAddress(message string) *dbus.Error
DbusErrorBadAddress means the given address is not valid
func DbusErrorCallFailed ¶
func DbusErrorCallFailed(message string) *dbus.Error
DbusErrorCallFailed means the call has failed
func DbusErrorDisconnected ¶
func DbusErrorDisconnected(message string) *dbus.Error
DbusErrorDisconnected means connection is closed
func DbusErrorInvalidArgs ¶
func DbusErrorInvalidArgs(message string) *dbus.Error
DbusErrorInvalidArgs means the arguments passed to this call/operation are not valid
func DbusErrorInvalidSignature ¶
func DbusErrorInvalidSignature(message string) *dbus.Error
DbusErrorInvalidSignature means the type signature is not valid or compatible
func DbusErrorLimitsExceeded ¶
func DbusErrorLimitsExceeded(message string) *dbus.Error
DbusErrorLimitsExceeded means the limits allocated to this process/call/connection exceeded the pre-defined
func DbusErrorNoMemory ¶
func DbusErrorNoMemory(message string) *dbus.Error
DbusErrorNoMemory means system is out of memory
func DbusErrorNoNetwork ¶
func DbusErrorNoNetwork(message string) *dbus.Error
DbusErrorNoNetwork means network is not available
func DbusErrorNoReply ¶
func DbusErrorNoReply(message string) *dbus.Error
DbusErrorNoReply means the called method did not reply within the specified timeout
func DbusErrorNoServer ¶
func DbusErrorNoServer(message string) *dbus.Error
DbusErrorNoServer means server is not listening on the address
func DbusErrorNotSupported ¶
func DbusErrorNotSupported(message string) *dbus.Error
DbusErrorNotSupported means the call/operation is not supported
func DbusErrorPropertyReadOnly ¶
func DbusErrorPropertyReadOnly(message string) *dbus.Error
DbusErrorPropertyReadOnly means the property set failed because the property is read-only
func DbusErrorServiceUnknown ¶
func DbusErrorServiceUnknown(message string) *dbus.Error
DbusErrorServiceUnknown means the called service is not known
func DbusErrorTimeout ¶
func DbusErrorTimeout(message string) *dbus.Error
DbusErrorTimeout means operation has timed out
func DbusErrorUnknownInterface ¶
func DbusErrorUnknownInterface(message string) *dbus.Error
DbusErrorUnknownInterface means the interface is not known in this object
func DbusErrorUnknownMethod ¶
func DbusErrorUnknownMethod(message string) *dbus.Error
DbusErrorUnknownMethod means the method called was not found in this object/interface with the given parameters
func DbusErrorUnknownObject ¶
func DbusErrorUnknownObject(message string) *dbus.Error
DbusErrorUnknownObject means the object path points to an object that does not exist
func DbusErrorUnknownProperty ¶
func DbusErrorUnknownProperty(message string) *dbus.Error
DbusErrorUnknownProperty means the property does not exist in this interface
func DefaultCollection ¶
DefaultCollection create and initialize a new default collection at: '/org/freedesktop/secrets/aliases/default'
func IsMapSubsetFullMatch ¶
func IsMapSubsetFullMatch(mapSet map[string]string, mapSubset map[string]string, lock *sync.RWMutex) bool
IsMapSubsetFullMatch returns true if mapSubset is a full subset of mapSet otherwise false
func IsMapSubsetFullMatchGeneric ¶
func IsMapSubsetFullMatchGeneric(mapSet interface{}, mapSubset interface{}, lock *sync.RWMutex) bool
IsMapSubsetFullMatchGeneric returns true if mapSubset is a full subset of mapSet otherwise false
func IsMapSubsetSingleMatch ¶
func IsMapSubsetSingleMatch(mapSet map[string]string, mapSubset map[string]string, lock *sync.RWMutex) bool
IsMapSubsetSingleMatch returns true if only one key/value of mapSubset exists in mapSet otherwise false
func Path2Name ¶
Path2Name takes a dbus path like /a/b/c/d and returns a dbus object name like a.b.c and last part d Example: path=/a/b/c/xyz, name=Foo -> (a.b.c.Foo, xyz)
func PersistData ¶
PersistData makes dbus objects persistent to db as soon as they change
func RestoreData ¶
func RestoreData(service *Service)
RestoreData reads database and restores dbus objects
Types ¶
type CliSession ¶ added in v0.2.0
type CliSession struct { // reference to parent (service) Parent *Service // symmetric key used or AES encryption/decryption. Needs IV as well SymmetricKey []byte // 16 bytes (128 bits) }
func NewCliSession ¶ added in v0.2.0
func NewCliSession(parent *Service) *CliSession
type Collection ¶
type Collection struct { // reference to parent (service) Parent *Service // Mutex for lock/unlock Items slice ItemsMutex *sync.RWMutex // Items map. key: Item dbus object path, value: Item object Items map[string]*Item // collection full dbus object path ObjectPath dbus.ObjectPath // Mutex for lock/unlock Properties map PropertiesMutex *sync.RWMutex // collection Properties map Properties map[string]dbus.Variant // dbus properties handle DbusProperties *prop.Properties // collection alias (friendly name) Alias string // Mutex to lock/unlock Locked status of collection LockMutex *sync.Mutex // collection Label Label string // true if collection is locked otherwise false Locked bool // Unix time collection created Created uint64 // Unix time collection modified Modified uint64 // inform parent data has happened SaveData SaveData // Temporary solution to data race in marshaling for db DataMutex *sync.RWMutex // contains filtered or unexported fields }
Collection data structure collection consists of items
func NewCollection ¶
func NewCollection(parent *Service) *Collection
NewCollection creates and initialize a new collection
func (*Collection) AddItem ¶
func (collection *Collection) AddItem(item *Item, replace bool, saveData bool, locked bool, created uint64, modified uint64, inPlace bool) error
AddItem adds a new item to collection's items
func (*Collection) CreateItem ¶
func (c *Collection) CreateItem(properties map[string]dbus.Variant, secretApi SecretApi, replace bool) (dbus.ObjectPath, dbus.ObjectPath, *dbus.Error)
creates an item (secret + lookup attributes + label) in a collection
func (*Collection) CreateMethodFromPath ¶
func (collection *Collection) CreateMethodFromPath(method string) string
CreateMethodFromPath returns a.b.c.Foo when collection path is /a/b/c/xyz and passed method is 'Foo'
func (*Collection) Delete ¶
func (c *Collection) Delete() (dbus.ObjectPath, *dbus.Error)
Delete removes the collection
func (*Collection) GetItemByPath ¶
func (collection *Collection) GetItemByPath(itemPath dbus.ObjectPath) *Item
GetItemByPath returns the collection with given dbus object path, otherwise null
func (*Collection) GetProperty ¶
func (collection *Collection) GetProperty(name string) (dbus.Variant, error)
GetProperty returns given dbus property value
func (*Collection) Lock ¶
func (collection *Collection) Lock()
Lock locks a collection and updates dbus 'Locked' and 'Modified' properties
func (*Collection) RemoveItem ¶
func (collection *Collection) RemoveItem(item *Item)
RemoveItem removes an item from collection's item map
func (*Collection) SearchItems ¶
func (c *Collection) SearchItems( attributes map[string]string) ([]dbus.ObjectPath, *dbus.Error)
SearchItems Searches for items in this collection matching the lookup attributes
func (*Collection) SetProperties ¶
func (collection *Collection) SetProperties(properties map[string]dbus.Variant)
SetProperties processes raw properties and sets collection.Properties
func (*Collection) SetProperty ¶
func (collection *Collection) SetProperty(name string, value interface{})
SetProperty sets given dbus property name to given value
func (*Collection) SignalCollectionChanged ¶
func (collection *Collection) SignalCollectionChanged()
SignalCollectionDeleted emits a signal that a collection has changed
func (*Collection) SignalCollectionCreated ¶
func (collection *Collection) SignalCollectionCreated()
SignalCollectionCreated emits a signal that a new collection was created
func (*Collection) SignalCollectionDeleted ¶
func (collection *Collection) SignalCollectionDeleted()
SignalCollectionDeleted emits a signal that a collection was deleted
func (*Collection) Unlock ¶
func (collection *Collection) Unlock()
Unlock unlocks a collection and updates dbus 'Locked' and 'Modified' properties
func (*Collection) UpdateModified ¶
func (collection *Collection) UpdateModified()
UpdateModified updated 'Modified' dbus property of this collection
func (*Collection) UpdatePropertyCollectionItems ¶
func (collection *Collection) UpdatePropertyCollectionItems()
UpdatePropertyCollections updates dbus property of this collection's items
type Database ¶
type Database struct { // Database version (used for backward compatibility) Version string `json:"version"` // TRUE if database is encrypted otherwise false Encrypted bool `json:"encrypted"` // All collections in this database Collections []DbCollection `json:"collections"` }
type DbCollection ¶
type DbCollection struct { // Collection object path on dbus ObjectPath dbus.ObjectPath `json:"objectPath"` // All items in this collection Items []DbItem `json:"items"` // Collection properties Properties map[string]string `json:"properties"` // Collection Alias Alias string `json:"alias"` // Collection Label Label string `json:"label"` // Is collection locked? Locked bool `json:"locked"` // Collection creation time (epoch) Created uint64 `json:"created"` // Collection modification time (epoch) Modified uint64 `json:"modified"` }
Collection's Parent is Database (root)
type DbItem ¶
type DbItem struct { // Item parent (collection) object path Parent dbus.ObjectPath `json:"parent"` // Item object path on dbus ObjectPath dbus.ObjectPath `json:"objectPath"` // Item properties Properties map[string]string `json:"properties"` // Item secret (wrapper around SecretApi) Secret DbSecret `json:"secret"` // Item lookup attributes LookupAttributes map[string]string `json:"lookupAttributes"` // Item label Label string `json:"label"` // Is item locked? Locked bool `json:"locked"` // Item creation time (epoch) Created uint64 `json:"created"` // Item modification time (epoch) Modified uint64 `json:"modified"` }
Item's Parent is Collection
type DbSecret ¶
type DbSecret struct { // Secret parent (item) Parent dbus.ObjectPath `json:"parent"` // Secret without encryption SecretText string `json:"secretText"` }
Secret's Parent is Item
type EncryptionAlgorithm ¶
type EncryptionAlgorithm uint8
encryption algorithm type plain or Dh_ietf1024_sha256_aes128_cbc_pkcs7
const ( // Plain algorithm (no encryption) Plain EncryptionAlgorithm = iota // Dh_ietf1024_sha256_aes128_cbc_pkcs7 algorithm Dh_ietf1024_sha256_aes128_cbc_pkcs7 )
type Item ¶
type Item struct { // reference to parent (collection) Parent *Collection // item full dbus object path ObjectPath dbus.ObjectPath // Mutex for lock/unlock Properties map PropertiesMutex *sync.RWMutex // collection Properties map Properties map[string]dbus.Variant // dbus properties handle DbusProperties *prop.Properties // secret contained in this item Secret *Secret // Mutex for lock/unlock LookupAttributes slice LookupAttributesMutex *sync.RWMutex // LookupAttributes (name + value) contained in this item LookupAttributes map[string]string // label of this item Label string // Mutex to lock/unlock Locked status of item LockMutex *sync.Mutex // true if item is locked otherwise false Locked bool // Unix time item created Created uint64 // Unix time item modified Modified uint64 // inform parent data has happened SaveData SaveData // Temporary solution to data race in marshaling for db DataMutex *sync.RWMutex // contains filtered or unexported fields }
Item data structure item = secret + lookup attributes + label
func (*Item) CreateMethodFromPath ¶
CreateMethodFromPath returns a.b.c.Foo when item path is /a/b/c/xyz and passed method is 'Foo'
func (*Item) Delete ¶
func (item *Item) Delete() (dbus.ObjectPath, *dbus.Error)
Delete removes an item from a collection
func (*Item) GetLookupAttribute ¶
GetLookupAttribute returns an attribute with given key otherwise null
func (*Item) GetProperty ¶
GetProperty returns given dbus property value
func (*Item) Lock ¶
func (item *Item) Lock()
Lock locks a collection and updates dbus 'Locked' and 'Modified' properties
func (*Item) SetProperties ¶
SetProperties processes raw properties and sets collection.Properties
func (*Item) SetProperty ¶
SetProperty sets given dbus property name to given value
func (*Item) SignalItemChanged ¶
func (item *Item) SignalItemChanged()
func (*Item) SignalItemCreated ¶
func (item *Item) SignalItemCreated()
func (*Item) SignalItemDeleted ¶
func (item *Item) SignalItemDeleted()
func (*Item) Unlock ¶
func (item *Item) Unlock()
Unlock unlocks a collection and updates dbus 'Locked' and 'Modified' properties
func (*Item) UpdateModified ¶
func (item *Item) UpdateModified()
UpdateModified updated 'Modified' dbus property of this collection
type PasswordFile ¶ added in v0.2.0
type Prompt ¶
type Prompt struct { // reference to parent Parent *Service // prompt full dbus object path ObjectPath dbus.ObjectPath // client applications can use the window-id to // display the prompt attached to their application window WindowId string }
Prompt data structure
func (*Prompt) Prompt ¶
perform the prompt. A prompt necessary to complete an operation windowId: Platform specific window handle to use for showing the prompt
func (*Prompt) SignalPromptCompleted ¶
type SaveData ¶
type SaveData func()
SaveData is a function used by a child to inform parent of a change in data
type Secret ¶
type Secret struct { // reference to parent (item) Parent *Item // Unencrypted secret PlainSecret string // Secret type needed by API SecretApi *SecretApi // inform parent data has happened SaveData SaveData // Temporary solution to data race in marshaling for db DataMutex *sync.RWMutex }
Secret data structure
type SecretApi ¶
type SecretApi struct { // The session full dbus object path that was used to encode the secret Session dbus.ObjectPath // Algorithm dependent parameters for secret value encoding Parameters []byte // Possibly encoded secret value Value []byte //The content type of the secret i.e. 'text/plain; charset=utf8' ContentType string }
Secret data structure needed bu API
type SecretMap ¶
type SecretMap map[dbus.ObjectPath]Secret
A mapping from object-paths to Secret structs
type SecretService ¶ added in v0.2.0
type SecretService struct { // reference to parent (service) Parent *Service // session (public key negotiation) Session *SecretServiceCLiSession }
CLI interface data structure
func NewSecretService ¶ added in v0.2.0
func NewSecretService(parent *Service) *SecretService
type SecretServiceCLiSession ¶ added in v0.2.0
type SecretServiceCLiSession struct { // symmetric key used or AES encryption/decryption. Needs IV as well SymmetricKey []byte // 16 bytes (128 bits) }
session (public key negotiation)
type Service ¶
type Service struct { // dbus session connection Connection *dbus.Conn Config *ServiceConfig // SecretService session SecretService *SecretService // Mutex for lock/unlock Sessions map SessionsMutex *sync.RWMutex // Cli Session CliSession *CliSession // TODO: REMOVE ME // sessions map. key: session dbus object path, value: session object Sessions map[string]*Session // Mutex for lock/unlock Collections map CollectionsMutex *sync.RWMutex // Collections map. key: Collection dbus object path, value: Collection object Collections map[string]*Collection // inform parent data has happened // SaveData SaveData // Channel to signal saving data to db SaveSignalChan chan struct{} // inform service is up and ready ServiceReadyChan chan struct{} // inform service is shutdown ServiceShutdownChan chan struct{} // inform database has loaded DbLoadedChan chan struct{} }
secretservice data structure
func (*Service) AddCollection ¶
func (s *Service) AddCollection(collection *Collection, locked bool, created uint64, modified uint64, saveData bool)
add a new collection to service's collection map
func (*Service) AddSession ¶
add a new session to service's session map
func (*Service) Command ¶ added in v0.2.0
Command receives a command from CLI and runs it on daemon side
func (*Service) CreateCollection ¶
func (service *Service) CreateCollection(properties map[string]dbus.Variant, alias string) (dbus.ObjectPath, dbus.ObjectPath, *dbus.Error)
CreateCollection creates a collection which can hold multiple items
func (*Service) GetCollectionByAlias ¶
func (s *Service) GetCollectionByAlias(alias string) *Collection
GetCollectionByAlias finds and return a collection by it's alias name otherwise return nil
func (*Service) GetCollectionByPath ¶
func (service *Service) GetCollectionByPath(collectionPath dbus.ObjectPath) *Collection
func (*Service) GetItemByPath ¶
func (*Service) GetSecrets ¶
func (service *Service) GetSecrets(items []dbus.ObjectPath, session dbus.ObjectPath) (map[dbus.ObjectPath]SecretApi, *dbus.Error)
GetSecrets retrieves multiple secrets from different items
func (*Service) GetSessionByPath ¶
GetSessionByPath returns session with given objectpath
func (*Service) HasCollection ¶
HasCollection returns true if collection exists otherwise false
func (*Service) HasSession ¶
HasSession returns true if session exists otherwise false
func (*Service) Lock ¶
func (service *Service) Lock( objects []dbus.ObjectPath) ([]dbus.ObjectPath, dbus.ObjectPath, *dbus.Error)
Lock locks the specified objects (collections, items)
func (*Service) OpenSession ¶
func (service *Service) OpenSession(algorithm string, input dbus.Variant) (dbus.Variant, dbus.ObjectPath, *dbus.Error)
OpenSession opens a unique session for the caller application further communication encryption/decryption relies on the related session
func (*Service) ReadPasswordFile ¶ added in v0.2.0
ReadPasswordFile returns contents of 'password.yaml' file if exists otherwise empty string
func (*Service) RemoveCollection ¶
func (s *Service) RemoveCollection(collection *Collection)
remove a collection from service's collection map
func (*Service) RemoveSession ¶
remove a session from service's session map
func (*Service) SearchItems ¶
func (service *Service) SearchItems( attributes map[string]string) ([]dbus.ObjectPath, []dbus.ObjectPath, *dbus.Error)
SearchItems finds items inside all collection. A collection consists of many items: item = secret + lookup attributes + label
func (*Service) Unlock ¶
func (service *Service) Unlock( objects []dbus.ObjectPath) ([]dbus.ObjectPath, dbus.ObjectPath, *dbus.Error)
Unlock unlocks the specified objects (collections, items)
func (*Service) UpdatePropertyCollections ¶
func (s *Service) UpdatePropertyCollections()
UpdatePropertyCollections updates dbus properties of Service
func (*Service) WritePasswordFile ¶ added in v0.2.0
WritePasswordFile writes 'password.yaml' file or returns error
type ServiceConfig ¶ added in v0.2.0
type Session ¶
type Session struct { // reference to parent (service) Parent *Service // session full dbus object path ObjectPath dbus.ObjectPath // encryption algorithm type EncryptionAlgorithm EncryptionAlgorithm // symmetric key used or AES encryption/decryption. Needs IV as well SymmetricKey []byte // 16 bytes (128 bits) }
Session data structure
func (*Session) Close ¶
func (s *Session) Close() *dbus.Error
closes a session and removes its object from dbus
func (*Session) CreateMethodFromPath ¶
CreateMethodFromPath returns a.b.c.Foo when session path is /a/b/c/xyz and passed method is 'Foo'
Source Files ¶
- api-errors.go
- bus-collection.go
- bus-initialize.go
- bus-item.go
- bus-root.go
- bus-secretservice.go
- bus-service.go
- bus-session.go
- collection-api.go
- collection-methods.go
- database.go
- entities.go
- item-api.go
- item-methods.go
- prompt-api.go
- prompt-methods.go
- secret-methods.go
- secretservice-api.go
- secretservice-methods.go
- service-api.go
- service-methods.go
- session-api.go
- session-methods.go
- utils.go