Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
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 proxy object representing a secret item in the Secret Service.
Synopsis
- newtype Item = Item (ManagedPtr Item)
- class GObject o => IsItem o
- toItem :: (MonadIO m, IsItem o) => o -> m Item
- noItem :: Maybe 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 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 ()
- constructItemCreated :: IsItem o => Word64 -> IO (GValueConstruct o)
- getItemCreated :: (MonadIO m, IsItem o) => o -> m Word64
- setItemCreated :: (MonadIO m, IsItem o) => o -> Word64 -> m ()
- clearItemLabel :: (MonadIO m, IsItem o) => o -> m ()
- constructItemLabel :: IsItem o => Text -> IO (GValueConstruct o)
- getItemLabel :: (MonadIO m, IsItem o) => o -> m (Maybe Text)
- setItemLabel :: (MonadIO m, IsItem o) => o -> Text -> m ()
- getItemLocked :: (MonadIO m, IsItem o) => o -> m Bool
- constructItemModified :: IsItem o => Word64 -> IO (GValueConstruct o)
- getItemModified :: (MonadIO m, IsItem o) => o -> m Word64
- setItemModified :: (MonadIO m, IsItem o) => o -> Word64 -> m ()
- constructItemService :: (IsItem o, IsService a) => a -> IO (GValueConstruct o)
- getItemService :: (MonadIO m, IsItem o) => o -> m Service
Exported types
Memory-managed wrapper type.
Instances
GObject Item Source # | |
Defined in GI.Secret.Objects.Item gobjectType :: Item -> IO GType # | |
IsDBusProxy Item Source # | |
Defined in GI.Secret.Objects.Item | |
IsInitable Item Source # | |
Defined in GI.Secret.Objects.Item | |
IsDBusInterface Item Source # | |
Defined in GI.Secret.Objects.Item | |
IsAsyncInitable Item Source # | |
Defined in GI.Secret.Objects.Item | |
IsObject Item Source # | |
Defined in GI.Secret.Objects.Item | |
IsItem Item Source # | |
Defined in GI.Secret.Objects.Item |
class GObject o => IsItem o Source #
Instances
(GObject a, (UnknownAncestorError Item a :: Constraint)) => IsItem a Source # | |
Defined in GI.Secret.Objects.Item | |
IsItem Item Source # | |
Defined in GI.Secret.Objects.Item |
Methods
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. servicePrompt
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. servicePrompt
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. servicePrompt
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.
servicePrompt
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 |
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
itemSetAttributes
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 itemLoadSecret
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 Text | Returns: the schema name |
Gets the name of the schema that this item was stored with. This is also available at the <literal>xdg:schema</literal> attribute.
getSecret
:: (HasCallStack, MonadIO m, IsItem a) | |
=> a |
|
-> m (Maybe Value) | Returns: the secret value which should be
released with |
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 itemLoadSecret
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
itemGetSecret
.
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 SecretItem::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 SecretItem::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
attributes
created
The date and time (in seconds since the UNIX epoch) that this item was created.
constructItemCreated :: IsItem o => Word64 -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “created
” property. This is rarely needed directly, but it is used by new
.
getItemCreated :: (MonadIO m, IsItem o) => o -> m Word64 Source #
Get the value of the “created
” property.
When overloading is enabled, this is equivalent to
get
item #created
setItemCreated :: (MonadIO m, IsItem o) => o -> Word64 -> m () Source #
Set the value of the “created
” property.
When overloading is enabled, this is equivalent to
set
item [ #created:=
value ]
label
The human readable label for the item.
Setting this property will result in the label of the item being
set asynchronously. To properly track the changing of the label use the
itemSetLabel
function.
clearItemLabel :: (MonadIO m, IsItem o) => o -> m () Source #
Set the value of the “label
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#label
constructItemLabel :: IsItem o => Text -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “label
” property. This is rarely needed directly, but it is used by new
.
getItemLabel :: (MonadIO m, IsItem o) => o -> m (Maybe Text) Source #
Get the value of the “label
” property.
When overloading is enabled, this is equivalent to
get
item #label
setItemLabel :: (MonadIO m, IsItem o) => o -> Text -> m () Source #
Set the value of the “label
” property.
When overloading is enabled, this is equivalent to
set
item [ #label:=
value ]
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 serviceLock
or
serviceUnlock
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
modified
The date and time (in seconds since the UNIX epoch) that this item was last modified.
constructItemModified :: IsItem o => Word64 -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “modified
” property. This is rarely needed directly, but it is used by new
.
getItemModified :: (MonadIO m, IsItem o) => o -> m Word64 Source #
Get the value of the “modified
” property.
When overloading is enabled, this is equivalent to
get
item #modified
setItemModified :: (MonadIO m, IsItem o) => o -> Word64 -> m () Source #
Set the value of the “modified
” property.
When overloading is enabled, this is equivalent to
set
item [ #modified:=
value ]
service
The Service
object that this item is associated with and
uses to interact with the actual D-Bus Secret Service.
constructItemService :: (IsItem o, IsService a) => a -> IO (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