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 |
- Exported types
- Methods
- create
- createFinish
- createSync
- delete
- deleteFinish
- deleteSync
- getAttributes
- getCreated
- getFlags
- getLabel
- getLocked
- getModified
- getSchemaName
- getSecret
- getService
- loadSecret
- loadSecretFinish
- loadSecretSync
- loadSecrets
- loadSecretsFinish
- loadSecretsSync
- refresh
- setAttributes
- setAttributesFinish
- setAttributesSync
- setLabel
- setLabelFinish
- setLabelSync
- setSecret
- setSecretFinish
- setSecretSync
- Properties
A secret item
Item
represents a secret item stored in the Secret Service.
Each item has a value, represented by a [structvalue
], which can be
retrieved by [methoditem
.get_secret] or set by [methoditem
.set_secret].
The item is only available when the item is not locked.
Items can be locked or unlocked using the [methodservice
.lock] or
[methodservice
.unlock] functions. The Secret Service may not be able to
unlock individual items, and may unlock an entire collection when a single
item is unlocked.
Each item has a set of attributes, which are used to locate the item later.
These are not stored or transferred in a secure manner. Each attribute has
a string name and a string value. Use [methodservice
.search] to search for
items based on their attributes, and [methoditem
.set_attributes] to change
the attributes associated with an item.
Items can be created with Item.create
or [methodservice
.store].
Synopsis
- newtype Item = Item (ManagedPtr Item)
- class (GObject o, IsDescendantOf Item o) => IsItem o
- toItem :: (MonadIO m, IsItem o) => o -> m Item
- itemCreate :: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) => a -> Maybe Schema -> Map Text Text -> Text -> Value -> [ItemCreateFlags] -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- itemCreateFinish :: (HasCallStack, MonadIO m, IsAsyncResult a) => a -> m Item
- itemCreateSync :: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) => a -> Maybe Schema -> Map Text Text -> Text -> Value -> [ItemCreateFlags] -> Maybe b -> m Item
- itemDelete :: (HasCallStack, MonadIO m, IsItem a, IsCancellable b) => a -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- itemDeleteFinish :: (HasCallStack, MonadIO m, IsItem a, IsAsyncResult b) => a -> b -> m ()
- itemDeleteSync :: (HasCallStack, MonadIO m, IsItem a, IsCancellable b) => a -> Maybe b -> m ()
- itemGetAttributes :: (HasCallStack, MonadIO m, IsItem a) => a -> m (Map Text Text)
- itemGetCreated :: (HasCallStack, MonadIO m, IsItem a) => a -> m Word64
- itemGetFlags :: (HasCallStack, MonadIO m, IsItem a) => a -> m [ItemFlags]
- itemGetLabel :: (HasCallStack, MonadIO m, IsItem a) => a -> m Text
- itemGetLocked :: (HasCallStack, MonadIO m, IsItem a) => a -> m Bool
- itemGetModified :: (HasCallStack, MonadIO m, IsItem a) => a -> m Word64
- itemGetSchemaName :: (HasCallStack, MonadIO m, IsItem a) => a -> m (Maybe Text)
- itemGetSecret :: (HasCallStack, MonadIO m, IsItem a) => a -> m (Maybe Value)
- itemGetService :: (HasCallStack, MonadIO m, IsItem a) => a -> m Service
- itemLoadSecret :: (HasCallStack, MonadIO m, IsItem a, IsCancellable b) => a -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- itemLoadSecretFinish :: (HasCallStack, MonadIO m, IsItem a, IsAsyncResult b) => a -> b -> m ()
- itemLoadSecretSync :: (HasCallStack, MonadIO m, IsItem a, IsCancellable b) => a -> Maybe b -> m ()
- itemLoadSecrets :: (HasCallStack, MonadIO m, IsItem a, IsCancellable b) => [a] -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- itemLoadSecretsFinish :: (HasCallStack, MonadIO m, IsAsyncResult a) => a -> m ()
- itemLoadSecretsSync :: (HasCallStack, MonadIO m, IsItem a, IsCancellable b) => [a] -> Maybe b -> m ()
- itemRefresh :: (HasCallStack, MonadIO m, IsItem a) => a -> m ()
- itemSetAttributes :: (HasCallStack, MonadIO m, IsItem a, IsCancellable b) => a -> Maybe Schema -> Map Text Text -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- itemSetAttributesFinish :: (HasCallStack, MonadIO m, IsItem a, IsAsyncResult b) => a -> b -> m ()
- itemSetAttributesSync :: (HasCallStack, MonadIO m, IsItem a, IsCancellable b) => a -> Maybe Schema -> Map Text Text -> Maybe b -> m ()
- itemSetLabel :: (HasCallStack, MonadIO m, IsItem a, IsCancellable b) => a -> Text -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- itemSetLabelFinish :: (HasCallStack, MonadIO m, IsItem a, IsAsyncResult b) => a -> b -> m ()
- itemSetLabelSync :: (HasCallStack, MonadIO m, IsItem a, IsCancellable b) => a -> Text -> Maybe b -> m ()
- itemSetSecret :: (HasCallStack, MonadIO m, IsItem a, IsCancellable b) => a -> Value -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- itemSetSecretFinish :: (HasCallStack, MonadIO m, IsItem a, IsAsyncResult b) => a -> b -> m ()
- itemSetSecretSync :: (HasCallStack, MonadIO m, IsItem a, IsCancellable b) => a -> Value -> Maybe b -> m ()
- constructItemFlags :: (IsItem o, MonadIO m) => [ItemFlags] -> m (GValueConstruct o)
- getItemFlags :: (MonadIO m, IsItem o) => o -> m [ItemFlags]
- getItemLocked :: (MonadIO m, IsItem o) => o -> m Bool
- constructItemService :: (IsItem o, MonadIO m, IsService a) => a -> m (GValueConstruct o)
- getItemService :: (MonadIO m, IsItem o) => o -> m Service
Exported types
Memory-managed wrapper type.
Instances
Eq Item Source # | |
GObject Item Source # | |
Defined in GI.Secret.Objects.Item | |
ManagedPtrNewtype Item Source # | |
Defined in GI.Secret.Objects.Item toManagedPtr :: Item -> ManagedPtr Item | |
TypedObject Item Source # | |
Defined in GI.Secret.Objects.Item | |
HasParentTypes Item Source # | |
Defined in GI.Secret.Objects.Item | |
IsGValue (Maybe Item) Source # | Convert |
Defined in GI.Secret.Objects.Item gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Item -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Item) | |
type ParentTypes Item Source # | |
Defined in GI.Secret.Objects.Item |
class (GObject o, IsDescendantOf Item o) => IsItem o Source #
Instances
(GObject o, IsDescendantOf Item o) => IsItem o Source # | |
Defined in GI.Secret.Objects.Item |
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, loadSecret, loadSecretFinish, loadSecretSync, notify, notifyByPspec, ref, refSink, refresh, retrieveSecret, retrieveSecretFinish, retrieveSecretSync, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getAttributes, getCachedProperty, getCachedPropertyNames, getConnection, getCreated, getData, getDefaultTimeout, getFlags, getInfo, getInterfaceInfo, getInterfaceName, getLabel, getLocked, getModified, getName, getNameOwner, getObject, getObjectPath, getProperty, getQdata, getSchemaName, getSecret, getService.
Setters
setAttributes, setAttributesFinish, setAttributesSync, setCachedProperty, setData, setDataFull, setDefaultTimeout, setInterfaceInfo, setLabel, setLabelFinish, setLabelSync, setObject, setProperty, setSecret, setSecretFinish, setSecretSync.
create
:: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) | |
=> a |
|
-> Maybe Schema |
|
-> Map Text Text |
|
-> Text |
|
-> Value |
|
-> [ItemCreateFlags] |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Create a new item in the secret service.
If the flags
contains ItemCreateFlagsReplace
, then the secret
service will search for an item matching the attributes
, and update that item
instead of creating a new one.
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.
createFinish
:: (HasCallStack, MonadIO m, IsAsyncResult a) | |
=> a |
|
-> m Item | Returns: the new item, which should be unreferenced
with |
Finish operation to create a new item in the secret service.
createSync
:: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) | |
=> a |
|
-> Maybe Schema |
|
-> Map Text Text |
|
-> Text |
|
-> Value |
|
-> [ItemCreateFlags] |
|
-> Maybe b |
|
-> m Item | Returns: the new item, which should be unreferenced
with |
Create a new item in the secret service.
If the flags
contains ItemCreateFlagsReplace
, then the secret
service will search for an item matching the attributes
, and update that item
instead of creating a new one.
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.
delete
:: (HasCallStack, MonadIO m, IsItem a, IsCancellable b) | |
=> a |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Delete this item.
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
:: (HasCallStack, MonadIO m, IsItem a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m () | (Can throw |
Complete asynchronous operation to delete the secret item.
deleteSync
:: (HasCallStack, MonadIO m, IsItem a, IsCancellable b) | |
=> a |
|
-> Maybe b |
|
-> m () | (Can throw |
Delete this secret item.
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.
getAttributes
:: (HasCallStack, MonadIO m, IsItem a) | |
=> a |
|
-> m (Map Text Text) | Returns: a new reference
to the attributes, which should not be modified, and
released with [func |
Set the attributes of this item.
The attributes
are a mapping of string keys to string values.
Attributes are used to search for items. Attributes are not stored
or transferred securely by the secret service.
Do not modify the attributes returned by this method. Use
[methoditem
.set_attributes] instead.
getCreated
:: (HasCallStack, MonadIO m, IsItem a) | |
=> a |
|
-> m Word64 | Returns: the created date and time |
Get the created date and time of the item.
The return value is the number of seconds since the unix epoch, January 1st 1970.
getFlags
:: (HasCallStack, MonadIO m, IsItem a) | |
=> a |
|
-> m [ItemFlags] | Returns: the flags for features initialized |
Get the flags representing what features of the Item
proxy
have been initialized.
Use [methoditem
.load_secret] to initialize further features
and change the flags.
getLabel
:: (HasCallStack, MonadIO m, IsItem a) | |
=> a |
|
-> m Text | Returns: the label, which should be freed with |
Get the label of this item.
getLocked
:: (HasCallStack, MonadIO m, IsItem a) | |
=> a |
|
-> m Bool | Returns: whether the item is locked or not |
Get whether the item is locked or not.
Depending on the secret service an item may not be able to be locked independently from the collection that it is in.
getModified
:: (HasCallStack, MonadIO m, IsItem a) | |
=> a |
|
-> m Word64 | Returns: the modified date and time |
Get the modified date and time of the item.
The return value is the number of seconds since the unix epoch, January 1st 1970.
getSchemaName
:: (HasCallStack, MonadIO m, IsItem a) | |
=> a |
|
-> m (Maybe Text) | Returns: the schema name |
Gets the name of the schema that this item was stored with. This is also
available at the xdg:schema
attribute.
getSecret
:: (HasCallStack, MonadIO m, IsItem a) | |
=> a |
|
-> m (Maybe Value) | Returns: the secret value which should be
released with [method |
Get the secret value of this item.
If this item is locked or the secret has not yet been loaded then this will
return Nothing
.
To load the secret call the [methoditem
.load_secret] method.
getService
:: (HasCallStack, MonadIO m, IsItem a) | |
=> a |
|
-> m Service | Returns: the Secret Service object |
Get the Secret Service object that this item was created with.
loadSecret
:: (HasCallStack, MonadIO m, IsItem a, IsCancellable b) | |
=> a |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Load the secret value of this item.
Each item has a single secret which might be a password or some other secret binary value.
This function will fail if the secret item is locked.
This function returns immediately and completes asynchronously.
loadSecretFinish
:: (HasCallStack, MonadIO m, IsItem a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m () | (Can throw |
Complete asynchronous operation to load the secret value of this item.
The newly loaded secret value can be accessed by calling
[methoditem
.get_secret].
loadSecretSync
:: (HasCallStack, MonadIO m, IsItem a, IsCancellable b) | |
=> a |
|
-> Maybe b |
|
-> m () | (Can throw |
Load the secret value of this item.
Each item has a single secret which might be a password or some other secret binary value.
This function may block indefinitely. Use the asynchronous version in user interface threads.
loadSecrets
:: (HasCallStack, MonadIO m, IsItem a, IsCancellable b) | |
=> [a] |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Load the secret values for a secret item stored in the service.
The items
must all have the same [propertyitem
:service] property.
This function returns immediately and completes asynchronously.
loadSecretsFinish
itemLoadSecretsFinish Source #
:: (HasCallStack, MonadIO m, IsAsyncResult a) | |
=> a |
|
-> m () | (Can throw |
Complete asynchronous operation to load the secret values for secret items stored in the service.
Items that are locked will not have their secrets loaded.
loadSecretsSync
:: (HasCallStack, MonadIO m, IsItem a, IsCancellable b) | |
=> [a] |
|
-> Maybe b |
|
-> m () | (Can throw |
Load the secret values for a secret item stored in the service.
The items
must all have the same [propertyitem
:service] property.
This method may block indefinitely and should not be used in user interface threads.
Items that are locked will not have their secrets loaded.
refresh
:: (HasCallStack, MonadIO m, IsItem a) | |
=> a |
|
-> m () |
Refresh the properties on this item.
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.
setAttributes
:: (HasCallStack, MonadIO m, IsItem a, IsCancellable b) | |
=> a |
|
-> Maybe Schema |
|
-> Map Text Text |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Set the attributes of this item.
The attributes
are a mapping of string keys to string values.
Attributes are used to search for items. Attributes are not stored
or transferred securely by the secret service.
This function returns immediately and completes asynchronously.
setAttributesFinish
itemSetAttributesFinish Source #
:: (HasCallStack, MonadIO m, IsItem a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m () | (Can throw |
Complete operation to set the attributes of this item.
setAttributesSync
itemSetAttributesSync Source #
:: (HasCallStack, MonadIO m, IsItem a, IsCancellable b) | |
=> a |
|
-> Maybe Schema |
|
-> Map Text Text |
|
-> Maybe b |
|
-> m () | (Can throw |
Set the attributes of this item.
The attributes
are a mapping of string keys to string values.
Attributes are used to search for items. Attributes are not stored
or transferred securely by the secret service.
This function may block indefinitely. Use the asynchronous version in user interface threads.
setLabel
:: (HasCallStack, MonadIO m, IsItem a, IsCancellable b) | |
=> a |
|
-> Text |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Set the label of this item.
This function returns immediately and completes asynchronously.
setLabelFinish
:: (HasCallStack, MonadIO m, IsItem a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m () | (Can throw |
Complete asynchronous operation to set the label of this collection.
setLabelSync
:: (HasCallStack, MonadIO m, IsItem a, IsCancellable b) | |
=> a |
|
-> Text |
|
-> Maybe b |
|
-> m () | (Can throw |
Set the label of this item.
This function may block indefinitely. Use the asynchronous version in user interface threads.
setSecret
:: (HasCallStack, MonadIO m, IsItem a, IsCancellable b) | |
=> a |
|
-> Value |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Set the secret value of this item.
Each item has a single secret which might be a password or some other secret binary value.
This function returns immediately and completes asynchronously.
setSecretFinish
:: (HasCallStack, MonadIO m, IsItem a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m () | (Can throw |
Complete asynchronous operation to set the secret value of this item.
setSecretSync
:: (HasCallStack, MonadIO m, IsItem a, IsCancellable b) | |
=> a |
|
-> Value |
|
-> Maybe b |
|
-> m () | (Can throw |
Set the secret value of this item.
Each item has a single secret which might be a password or some other secret binary value.
This function may block indefinitely. Use the asynchronous version in user interface threads.
Properties
flags
A set of flags describing which parts of the secret item have been initialized.
constructItemFlags :: (IsItem o, MonadIO m) => [ItemFlags] -> 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
.
getItemFlags :: (MonadIO m, IsItem o) => o -> m [ItemFlags] Source #
Get the value of the “flags
” property.
When overloading is enabled, this is equivalent to
get
item #flags
locked
Whether the item is locked or not.
An item may not be independently lockable separate from other items in its collection.
To lock or unlock a item use the [methodservice
.lock] or
[methodservice
.unlock] functions.
getItemLocked :: (MonadIO m, IsItem o) => o -> m Bool Source #
Get the value of the “locked
” property.
When overloading is enabled, this is equivalent to
get
item #locked
service
The [classservice
] object that this item is associated with and
uses to interact with the actual D-Bus Secret Service.
constructItemService :: (IsItem 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
.
getItemService :: (MonadIO m, IsItem o) => o -> m Service Source #
Get the value of the “service
” property.
When overloading is enabled, this is equivalent to
get
item #service