Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
A proxy object representing a collection of secrets in the Secret Service.
Collection
represents a collection of secret items stored in the
Secret Service.
A collection can be in a locked or unlocked state. Use
[methodsecretService
.lock] or [methodsecretService
.unlock] to lock or
unlock the collection.
Use the [propertysecretCollection
:items] property or
[methodsecretCollection
.get_items] to lookup the items in the collection.
There may not be any items exposed when the collection is locked.
Synopsis
- newtype Collection = Collection (ManagedPtr Collection)
- class (GObject o, IsDescendantOf Collection o) => IsCollection o
- toCollection :: (MonadIO m, IsCollection o) => o -> m Collection
- collectionCreate :: (HasCallStack, MonadIO m, IsService a, IsCancellable b) => Maybe a -> Text -> Maybe Text -> [CollectionCreateFlags] -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- collectionCreateFinish :: (HasCallStack, MonadIO m, IsAsyncResult a) => a -> m Collection
- collectionCreateSync :: (HasCallStack, MonadIO m, IsService a, IsCancellable b) => Maybe a -> Text -> Maybe Text -> [CollectionCreateFlags] -> Maybe b -> m Collection
- collectionDelete :: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) => a -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- collectionDeleteFinish :: (HasCallStack, MonadIO m, IsCollection a, IsAsyncResult b) => a -> b -> m ()
- collectionDeleteSync :: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) => a -> Maybe b -> m ()
- collectionForAlias :: (HasCallStack, MonadIO m, IsService a, IsCancellable b) => Maybe a -> Text -> [CollectionFlags] -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- collectionForAliasFinish :: (HasCallStack, MonadIO m, IsAsyncResult a) => a -> m Collection
- collectionForAliasSync :: (HasCallStack, MonadIO m, IsService a, IsCancellable b) => Maybe a -> Text -> [CollectionFlags] -> Maybe b -> m Collection
- collectionGetCreated :: (HasCallStack, MonadIO m, IsCollection a) => a -> m Word64
- collectionGetFlags :: (HasCallStack, MonadIO m, IsCollection a) => a -> m [CollectionFlags]
- collectionGetItems :: (HasCallStack, MonadIO m, IsCollection a) => a -> m [Item]
- collectionGetLabel :: (HasCallStack, MonadIO m, IsCollection a) => a -> m Text
- collectionGetLocked :: (HasCallStack, MonadIO m, IsCollection a) => a -> m Bool
- collectionGetModified :: (HasCallStack, MonadIO m, IsCollection a) => a -> m Word64
- collectionGetService :: (HasCallStack, MonadIO m, IsCollection a) => a -> m Service
- collectionLoadItems :: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) => a -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- collectionLoadItemsFinish :: (HasCallStack, MonadIO m, IsCollection a, IsAsyncResult b) => a -> b -> m ()
- collectionLoadItemsSync :: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) => a -> Maybe b -> m ()
- collectionRefresh :: (HasCallStack, MonadIO m, IsCollection a) => a -> m ()
- collectionSearch :: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) => a -> Maybe Schema -> Map Text Text -> [SearchFlags] -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- collectionSearchFinish :: (HasCallStack, MonadIO m, IsCollection a, IsAsyncResult b) => a -> b -> m [Item]
- collectionSearchSync :: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) => a -> Maybe Schema -> Map Text Text -> [SearchFlags] -> Maybe b -> m [Item]
- collectionSetLabel :: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) => a -> Text -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- collectionSetLabelFinish :: (HasCallStack, MonadIO m, IsCollection a, IsAsyncResult b) => a -> b -> m ()
- collectionSetLabelSync :: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) => a -> Text -> Maybe b -> m ()
- constructCollectionCreated :: (IsCollection o, MonadIO m) => Word64 -> m (GValueConstruct o)
- getCollectionCreated :: (MonadIO m, IsCollection o) => o -> m Word64
- setCollectionCreated :: (MonadIO m, IsCollection o) => o -> Word64 -> m ()
- constructCollectionFlags :: (IsCollection o, MonadIO m) => [CollectionFlags] -> m (GValueConstruct o)
- getCollectionFlags :: (MonadIO m, IsCollection o) => o -> m [CollectionFlags]
- clearCollectionLabel :: (MonadIO m, IsCollection o) => o -> m ()
- constructCollectionLabel :: (IsCollection o, MonadIO m) => Text -> m (GValueConstruct o)
- getCollectionLabel :: (MonadIO m, IsCollection o) => o -> m (Maybe Text)
- setCollectionLabel :: (MonadIO m, IsCollection o) => o -> Text -> m ()
- getCollectionLocked :: (MonadIO m, IsCollection o) => o -> m Bool
- constructCollectionModified :: (IsCollection o, MonadIO m) => Word64 -> m (GValueConstruct o)
- getCollectionModified :: (MonadIO m, IsCollection o) => o -> m Word64
- setCollectionModified :: (MonadIO m, IsCollection o) => o -> Word64 -> m ()
- constructCollectionService :: (IsCollection o, MonadIO m, IsService a) => a -> m (GValueConstruct o)
- getCollectionService :: (MonadIO m, IsCollection o) => o -> m Service
Exported types
newtype Collection Source #
Memory-managed wrapper type.
Collection (ManagedPtr Collection) |
Instances
Eq Collection Source # | |
Defined in GI.Secret.Objects.Collection (==) :: Collection -> Collection -> Bool # (/=) :: Collection -> Collection -> Bool # | |
GObject Collection Source # | |
Defined in GI.Secret.Objects.Collection | |
ManagedPtrNewtype Collection Source # | |
Defined in GI.Secret.Objects.Collection toManagedPtr :: Collection -> ManagedPtr Collection | |
TypedObject Collection Source # | |
Defined in GI.Secret.Objects.Collection | |
HasParentTypes Collection Source # | |
Defined in GI.Secret.Objects.Collection | |
IsGValue (Maybe Collection) Source # | Convert |
Defined in GI.Secret.Objects.Collection gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Collection -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Collection) | |
type ParentTypes Collection Source # | |
Defined in GI.Secret.Objects.Collection type ParentTypes Collection = '[DBusProxy, Object, AsyncInitable, DBusInterface, Initable] |
class (GObject o, IsDescendantOf Collection o) => IsCollection o Source #
Type class for types which can be safely cast to Collection
, for instance with toCollection
.
Instances
(GObject o, IsDescendantOf Collection o) => IsCollection o Source # | |
Defined in GI.Secret.Objects.Collection |
toCollection :: (MonadIO m, IsCollection o) => o -> m Collection Source #
Cast to Collection
, for types for which this is known to be safe. For general casts, use castTo
.
Methods
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, call, callFinish, callSync, callWithUnixFdList, callWithUnixFdListFinish, callWithUnixFdListSync, delete, deleteFinish, deleteSync, forceFloating, freezeNotify, getv, init, initAsync, initFinish, isFloating, loadItems, loadItemsFinish, loadItemsSync, notify, notifyByPspec, ref, refSink, refresh, runDispose, search, searchFinish, searchSync, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getCachedProperty, getCachedPropertyNames, getConnection, getCreated, getData, getDefaultTimeout, getFlags, getInfo, getInterfaceInfo, getInterfaceName, getItems, getLabel, getLocked, getModified, getName, getNameOwner, getObject, getObjectPath, getProperty, getQdata, getService.
Setters
setCachedProperty, setData, setDataFull, setDefaultTimeout, setInterfaceInfo, setLabel, setLabelFinish, setLabelSync, setObject, setProperty.
create
:: (HasCallStack, MonadIO m, IsService a, IsCancellable b) | |
=> Maybe a |
|
-> Text |
|
-> Maybe Text |
|
-> [CollectionCreateFlags] |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Create a new collection in the secret service.
This method returns immediately and completes asynchronously. The secret
service may prompt the user. [methodservice
.prompt] will be used to handle
any prompts that are required.
An alias
is a well-known tag for a collection, such as 'default' (ie: the
default collection to store items in). This allows other applications to
easily identify and share a collection. If you specify an alias
, and a
collection with that alias already exists, then a new collection will not
be created. The previous one will be returned instead.
If service
is Nothing
, then Service.get
will be called to get the
default [classservice
] proxy.
createFinish
collectionCreateFinish Source #
:: (HasCallStack, MonadIO m, IsAsyncResult a) | |
=> a |
|
-> m Collection | Returns: the new collection, which should be unreferenced
with |
Finish operation to create a new collection in the secret service.
createSync
:: (HasCallStack, MonadIO m, IsService a, IsCancellable b) | |
=> Maybe a |
|
-> Text |
|
-> Maybe Text |
|
-> [CollectionCreateFlags] |
|
-> Maybe b |
|
-> m Collection | Returns: the new collection, which should be unreferenced
with |
Create a new collection in the secret service.
This method may block indefinitely and should not be used in user interface
threads. The secret service may prompt the user. [methodservice
.prompt]
will be used to handle any prompts that are required.
An alias
is a well-known tag for a collection, such as default
(ie: the
default collection to store items in). This allows other applications to
easily identify and share a collection. If you specify an alias
, and a
collection with that alias already exists, then a new collection will not
be created. The previous one will be returned instead.
If service
is Nothing
, then Service.get_sync
will be called to get the
default [classservice
] proxy.
delete
:: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) | |
=> a |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Delete this collection.
This method returns immediately and completes asynchronously. The secret
service may prompt the user. [methodservice
.prompt] will be used to handle
any prompts that show up.
deleteFinish
collectionDeleteFinish Source #
:: (HasCallStack, MonadIO m, IsCollection a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m () | (Can throw |
Complete operation to delete this collection.
deleteSync
:: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) | |
=> a |
|
-> Maybe b |
|
-> m () | (Can throw |
Delete this collection.
This method may block indefinitely and should not be used in user interface
threads. The secret service may prompt the user. [methodservice
.prompt] will
be used to handle any prompts that show up.
forAlias
:: (HasCallStack, MonadIO m, IsService a, IsCancellable b) | |
=> Maybe a |
|
-> Text |
|
-> [CollectionFlags] |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Lookup which collection is assigned to this alias. Aliases help determine well known collections, such as 'default'.
If service
is Nothing
, then Service.get
will be called to get the
default [classservice
] proxy.
This method will return immediately and complete asynchronously.
forAliasFinish
collectionForAliasFinish Source #
:: (HasCallStack, MonadIO m, IsAsyncResult a) | |
=> a |
|
-> m Collection | Returns: the collection, or |
Finish an asynchronous operation to lookup which collection is assigned to an alias.
forAliasSync
collectionForAliasSync Source #
:: (HasCallStack, MonadIO m, IsService a, IsCancellable b) | |
=> Maybe a |
|
-> Text |
|
-> [CollectionFlags] |
|
-> Maybe b |
|
-> m Collection | Returns: the collection, or |
Lookup which collection is assigned to this alias. Aliases help determine
well known collections, such as default
.
If service
is Nothing
, then Service.get_sync
will be called to get the
default [classservice
] proxy.
This method may block and should not be used in user interface threads.
getCreated
:: (HasCallStack, MonadIO m, IsCollection a) | |
=> a |
|
-> m Word64 | Returns: the created date and time |
Get the created date and time of the collection.
The return value is the number of seconds since the unix epoch, January 1st 1970.
getFlags
:: (HasCallStack, MonadIO m, IsCollection a) | |
=> a |
|
-> m [CollectionFlags] | Returns: the flags for features initialized |
Get the flags representing what features of the Collection
proxy
have been initialized.
Use [methodcollection
.load_items] to initialize further features and change
the flags.
getItems
:: (HasCallStack, MonadIO m, IsCollection a) | |
=> a |
|
-> m [Item] | Returns: a list of items, when
done, the list should be freed with [func |
Get the list of items in this collection.
getLabel
:: (HasCallStack, MonadIO m, IsCollection a) | |
=> a |
|
-> m Text | Returns: the label, which should be freed with
|
Get the label of this collection.
getLocked
:: (HasCallStack, MonadIO m, IsCollection a) | |
=> a |
|
-> m Bool | Returns: whether the collection is locked or not |
Get whether the collection is locked or not.
Use [methodservice
.lock] or [methodservice
.unlock] to lock or unlock the
collection.
getModified
collectionGetModified Source #
:: (HasCallStack, MonadIO m, IsCollection a) | |
=> a |
|
-> m Word64 | Returns: the modified date and time |
Get the modified date and time of the collection.
The return value is the number of seconds since the unix epoch, January 1st 1970.
getService
:: (HasCallStack, MonadIO m, IsCollection a) | |
=> a |
|
-> m Service | Returns: the Secret Service object |
Get the Secret Service object that this collection was created with.
loadItems
:: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) | |
=> a |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Ensure that the Collection
proxy has loaded all the items present
in the Secret Service.
This affects the result of [methodcollection
.get_items].
For collections returned from [methodservice
.get_collections] the items will
have already been loaded.
This method will return immediately and complete asynchronously.
loadItemsFinish
collectionLoadItemsFinish Source #
:: (HasCallStack, MonadIO m, IsCollection a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m () | (Can throw |
Complete an asynchronous operation to ensure that the Collection
proxy
has loaded all the items present in the Secret Service.
loadItemsSync
collectionLoadItemsSync Source #
:: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) | |
=> a |
|
-> Maybe b |
|
-> m () | (Can throw |
Ensure that the Collection
proxy has loaded all the items present
in the Secret Service. This affects the result of
[methodcollection
.get_items].
For collections returned from [methodservice
.get_collections] the items
will have already been loaded.
This method may block indefinitely and should not be used in user interface threads.
refresh
:: (HasCallStack, MonadIO m, IsCollection a) | |
=> a |
|
-> m () |
Refresh the properties on this collection. This fires off a request to refresh, and the properties will be updated later.
Calling this method is not normally necessary, as the secret service will notify the client when properties change.
search
:: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) | |
=> a |
|
-> Maybe Schema |
|
-> Map Text Text |
|
-> [SearchFlags] |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Search for items matching the attributes
in the collection
.
The attributes
should be a table of string keys and string values.
If SearchFlagsAll
is set in flags
, then all the items matching the
search will be returned. Otherwise only the first item will be returned.
This is almost always the unlocked item that was most recently stored.
If SearchFlagsUnlock
is set in flags
, then items will be unlocked
if necessary. In either case, locked and unlocked items will match the
search and be returned. If the unlock fails, the search does not fail.
If SearchFlagsLoadSecrets
is set in flags
, then the items will have
their secret values loaded and available via [methoditem
.get_secret].
This function returns immediately and completes asynchronously.
searchFinish
collectionSearchFinish Source #
:: (HasCallStack, MonadIO m, IsCollection a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m [Item] | Returns:
a list of items that matched the search (Can throw |
Complete asynchronous operation to search for items in a collection.
searchSync
:: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) | |
=> a |
|
-> Maybe Schema |
|
-> Map Text Text |
|
-> [SearchFlags] |
|
-> Maybe b |
|
-> m [Item] | Returns:
a list of items that matched the search (Can throw |
Search for items matching the attributes
in the collection
.
The attributes
should be a table of string keys and string values.
If SearchFlagsAll
is set in flags
, then all the items matching the
search will be returned. Otherwise only the first item will be returned.
This is almost always the unlocked item that was most recently stored.
If SearchFlagsUnlock
is set in flags
, then items will be unlocked
if necessary. In either case, locked and unlocked items will match the
search and be returned. If the unlock fails, the search does not fail.
If SearchFlagsLoadSecrets
is set in flags
, then the items will have
their secret values loaded and available via [methoditem
.get_secret].
This function may block indefinitely. Use the asynchronous version in user interface threads.
setLabel
:: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) | |
=> a |
|
-> Text |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Set the label of this collection.
This function returns immediately and completes asynchronously.
setLabelFinish
collectionSetLabelFinish Source #
:: (HasCallStack, MonadIO m, IsCollection a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m () | (Can throw |
Complete asynchronous operation to set the label of this collection.
setLabelSync
collectionSetLabelSync Source #
:: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) | |
=> a |
|
-> Text |
|
-> Maybe b |
|
-> m () | (Can throw |
Set the label of this collection.
This function may block indefinitely. Use the asynchronous version in user interface threads.
Properties
created
The date and time (in seconds since the UNIX epoch) that this collection was created.
constructCollectionCreated :: (IsCollection o, MonadIO m) => Word64 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “created
” property. This is rarely needed directly, but it is used by new
.
getCollectionCreated :: (MonadIO m, IsCollection o) => o -> m Word64 Source #
Get the value of the “created
” property.
When overloading is enabled, this is equivalent to
get
collection #created
setCollectionCreated :: (MonadIO m, IsCollection o) => o -> Word64 -> m () Source #
Set the value of the “created
” property.
When overloading is enabled, this is equivalent to
set
collection [ #created:=
value ]
flags
A set of flags describing which parts of the secret collection have been initialized.
constructCollectionFlags :: (IsCollection o, MonadIO m) => [CollectionFlags] -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “flags
” property. This is rarely needed directly, but it is used by new
.
getCollectionFlags :: (MonadIO m, IsCollection o) => o -> m [CollectionFlags] Source #
Get the value of the “flags
” property.
When overloading is enabled, this is equivalent to
get
collection #flags
label
The human readable label for the collection.
Setting this property will result in the label of the collection being
set asynchronously. To properly track the changing of the label use the
[methodcollection
.set_label] function.
clearCollectionLabel :: (MonadIO m, IsCollection o) => o -> m () Source #
Set the value of the “label
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#label
constructCollectionLabel :: (IsCollection o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “label
” property. This is rarely needed directly, but it is used by new
.
getCollectionLabel :: (MonadIO m, IsCollection o) => o -> m (Maybe Text) Source #
Get the value of the “label
” property.
When overloading is enabled, this is equivalent to
get
collection #label
setCollectionLabel :: (MonadIO m, IsCollection o) => o -> Text -> m () Source #
Set the value of the “label
” property.
When overloading is enabled, this is equivalent to
set
collection [ #label:=
value ]
locked
Whether the collection is locked or not.
To lock or unlock a collection use the [methodservice
.lock] or
[methodservice
.unlock] functions.
getCollectionLocked :: (MonadIO m, IsCollection o) => o -> m Bool Source #
Get the value of the “locked
” property.
When overloading is enabled, this is equivalent to
get
collection #locked
modified
The date and time (in seconds since the UNIX epoch) that this collection was last modified.
constructCollectionModified :: (IsCollection o, MonadIO m) => Word64 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “modified
” property. This is rarely needed directly, but it is used by new
.
getCollectionModified :: (MonadIO m, IsCollection o) => o -> m Word64 Source #
Get the value of the “modified
” property.
When overloading is enabled, this is equivalent to
get
collection #modified
setCollectionModified :: (MonadIO m, IsCollection o) => o -> Word64 -> m () Source #
Set the value of the “modified
” property.
When overloading is enabled, this is equivalent to
set
collection [ #modified:=
value ]
service
The [classservice
] object that this collection is associated with and
uses to interact with the actual D-Bus Secret Service.
constructCollectionService :: (IsCollection o, MonadIO m, IsService a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “service
” property. This is rarely needed directly, but it is used by new
.
getCollectionService :: (MonadIO m, IsCollection o) => o -> m Service Source #
Get the value of the “service
” property.
When overloading is enabled, this is equivalent to
get
collection #service