gi-secret-0.0.2: Libsecret bindings

CopyrightWill Thompson, Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.Secret.Objects.Item

Contents

Description

A proxy object representing a secret item in the Secret Service.

Synopsis

Exported types

newtype Item Source #

Constructors

Item (ManagedPtr Item) 

Instances

GObject Item Source # 

Methods

gobjectType :: Item -> IO GType #

IsAsyncInitable Item Source # 
IsDBusInterface Item Source # 
IsInitable Item Source # 
IsDBusProxy Item Source # 
IsObject Item Source # 
IsItem Item Source # 
((~) * info (ResolveItemMethod t Item), MethodInfo * info Item p) => IsLabel t (Item -> p) Source # 

Methods

fromLabel :: Proxy# Symbol t -> Item -> p #

((~) * info (ResolveItemMethod t Item), MethodInfo * info Item p) => IsLabelProxy t (Item -> p) Source # 

Methods

fromLabelProxy :: Proxy Symbol t -> Item -> p #

HasAttributeList * Item Source # 
type AttributeList Item Source # 
type SignalList Item Source # 

toItem :: IsItem o => o -> IO Item Source #

Methods

create

itemCreate Source #

Arguments

:: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) 
=> a

collection: a secret collection to create this item in

-> Maybe Schema

schema: the schema for the attributes

-> Map Text Text

attributes: attributes for the new item

-> Text

label: label for the new item

-> Value

value: secret value for the new item

-> [ItemCreateFlags]

flags: flags for the creation of the new item

-> Maybe b

cancellable: optional cancellation object

-> Maybe AsyncReadyCallback

callback: called when the operation completes

-> 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

itemCreateFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsAsyncResult a) 
=> a

result: the asynchronous result passed to the callback

-> m Item

Returns: the new item, which should be unreferenced with objectUnref (Can throw GError)

Finish operation to create a new item in the secret service.

createSync

itemCreateSync Source #

Arguments

:: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) 
=> a

collection: a secret collection to create this item in

-> Maybe Schema

schema: the schema for the attributes

-> Map Text Text

attributes: attributes for the new item

-> Text

label: label for the new item

-> Value

value: secret value for the new item

-> [ItemCreateFlags]

flags: flags for the creation of the new item

-> Maybe b

cancellable: optional cancellation object

-> m Item

Returns: the new item, which should be unreferenced with objectUnref (Can throw GError)

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

data ItemDeleteMethodInfo Source #

Instances

((~) * signature (Maybe b -> Maybe AsyncReadyCallback -> m ()), MonadIO m, IsItem a, IsCancellable b) => MethodInfo * ItemDeleteMethodInfo a signature Source # 

Methods

overloadedMethod :: MethodProxy ItemDeleteMethodInfo a -> signature -> s #

itemDelete Source #

Arguments

:: (HasCallStack, MonadIO m, IsItem a, IsCancellable b) 
=> a

self: an item

-> Maybe b

cancellable: optional cancellation object

-> Maybe AsyncReadyCallback

callback: called when the operation completes

-> 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

data ItemDeleteFinishMethodInfo Source #

Instances

((~) * signature (b -> m ()), MonadIO m, IsItem a, IsAsyncResult b) => MethodInfo * ItemDeleteFinishMethodInfo a signature Source # 

itemDeleteFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsItem a, IsAsyncResult b) 
=> a

self: an item

-> b

result: asynchronous result passed to the callback

-> m ()

(Can throw GError)

Complete asynchronous operation to delete the secret item.

deleteSync

data ItemDeleteSyncMethodInfo Source #

Instances

((~) * signature (Maybe b -> m ()), MonadIO m, IsItem a, IsCancellable b) => MethodInfo * ItemDeleteSyncMethodInfo a signature Source # 

itemDeleteSync Source #

Arguments

:: (HasCallStack, MonadIO m, IsItem a, IsCancellable b) 
=> a

self: an item

-> Maybe b

cancellable: optional cancellation object

-> m ()

(Can throw GError)

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

itemGetAttributes Source #

Arguments

:: (HasCallStack, MonadIO m, IsItem a) 
=> a

self: an item

-> m (Map Text Text)

Returns: a new reference to the attributes, which should not be modified, and released with hashTableUnref

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

data ItemGetCreatedMethodInfo Source #

Instances

((~) * signature (m Word64), MonadIO m, IsItem a) => MethodInfo * ItemGetCreatedMethodInfo a signature Source # 

itemGetCreated Source #

Arguments

:: (HasCallStack, MonadIO m, IsItem a) 
=> a

self: an item

-> 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

data ItemGetFlagsMethodInfo Source #

Instances

((~) * signature (m [ItemFlags]), MonadIO m, IsItem a) => MethodInfo * ItemGetFlagsMethodInfo a signature Source # 

itemGetFlags Source #

Arguments

:: (HasCallStack, MonadIO m, IsItem a) 
=> a

self: the secret item proxy

-> 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

data ItemGetLabelMethodInfo Source #

Instances

((~) * signature (m Text), MonadIO m, IsItem a) => MethodInfo * ItemGetLabelMethodInfo a signature Source # 

itemGetLabel Source #

Arguments

:: (HasCallStack, MonadIO m, IsItem a) 
=> a

self: an item

-> m Text

Returns: the label, which should be freed with free

Get the label of this item.

getLocked

data ItemGetLockedMethodInfo Source #

Instances

((~) * signature (m Bool), MonadIO m, IsItem a) => MethodInfo * ItemGetLockedMethodInfo a signature Source # 

itemGetLocked Source #

Arguments

:: (HasCallStack, MonadIO m, IsItem a) 
=> a

self: an item

-> 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

data ItemGetModifiedMethodInfo Source #

Instances

((~) * signature (m Word64), MonadIO m, IsItem a) => MethodInfo * ItemGetModifiedMethodInfo a signature Source # 

itemGetModified Source #

Arguments

:: (HasCallStack, MonadIO m, IsItem a) 
=> a

self: an item

-> 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

itemGetSchemaName Source #

Arguments

:: (HasCallStack, MonadIO m, IsItem a) 
=> a

self: an item

-> 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

data ItemGetSecretMethodInfo Source #

Instances

((~) * signature (m (Maybe Value)), MonadIO m, IsItem a) => MethodInfo * ItemGetSecretMethodInfo a signature Source # 

itemGetSecret Source #

Arguments

:: (HasCallStack, MonadIO m, IsItem a) 
=> a

self: an item

-> m (Maybe Value)

Returns: the secret value which should be released with valueUnref, or Nothing

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

data ItemGetServiceMethodInfo Source #

Instances

((~) * signature (m Service), MonadIO m, IsItem a) => MethodInfo * ItemGetServiceMethodInfo a signature Source # 

itemGetService Source #

Arguments

:: (HasCallStack, MonadIO m, IsItem a) 
=> a

self: an item

-> m Service

Returns: the Secret Service object

Get the Secret Service object that this item was created with.

loadSecret

itemLoadSecret Source #

Arguments

:: (HasCallStack, MonadIO m, IsItem a, IsCancellable b) 
=> a

self: an item proxy

-> Maybe b

cancellable: optional cancellation object

-> Maybe AsyncReadyCallback

callback: called when the operation completes

-> 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

itemLoadSecretFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsItem a, IsAsyncResult b) 
=> a

self: an item proxy

-> b

result: asynchronous result passed to callback

-> m ()

(Can throw GError)

Complete asynchronous operation to load the secret value of this item.

The newly loaded secret value can be accessed by calling itemGetSecret.

loadSecretSync

data ItemLoadSecretSyncMethodInfo Source #

Instances

((~) * signature (Maybe b -> m ()), MonadIO m, IsItem a, IsCancellable b) => MethodInfo * ItemLoadSecretSyncMethodInfo a signature Source # 

itemLoadSecretSync Source #

Arguments

:: (HasCallStack, MonadIO m, IsItem a, IsCancellable b) 
=> a

self: an item

-> Maybe b

cancellable: optional cancellation object

-> m ()

(Can throw GError)

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 indefinetely. Use the asynchronous version in user interface threads.

loadSecrets

itemLoadSecrets Source #

Arguments

:: (HasCallStack, MonadIO m, IsItem a, IsCancellable b) 
=> [a]

items: the items to retrieve secrets for

-> Maybe b

cancellable: optional cancellation object

-> Maybe AsyncReadyCallback

callback: called when the operation completes

-> m () 

Load the secret values for an secret items stored in the service.

The items must all have the same SecretItem::service property.

This function returns immediately and completes asynchronously.

loadSecretsFinish

itemLoadSecretsFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsAsyncResult a) 
=> a

result: asynchronous result passed to callback

-> m ()

(Can throw GError)

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

itemLoadSecretsSync Source #

Arguments

:: (HasCallStack, MonadIO m, IsItem a, IsCancellable b) 
=> [a]

items: the items to retrieve secrets for

-> Maybe b

cancellable: optional cancellation object

-> m ()

(Can throw GError)

Load the secret values for an secret items 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

data ItemRefreshMethodInfo Source #

Instances

((~) * signature (m ()), MonadIO m, IsItem a) => MethodInfo * ItemRefreshMethodInfo a signature Source # 

Methods

overloadedMethod :: MethodProxy ItemRefreshMethodInfo a -> signature -> s #

itemRefresh Source #

Arguments

:: (HasCallStack, MonadIO m, IsItem a) 
=> a

self: the collection

-> 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

itemSetAttributes Source #

Arguments

:: (HasCallStack, MonadIO m, IsItem a, IsCancellable b) 
=> a

self: an item

-> Maybe Schema

schema: the schema for the attributes

-> Map Text Text

attributes: a new set of attributes

-> Maybe b

cancellable: optional cancellation object

-> Maybe AsyncReadyCallback

callback: called when the asynchronous operation completes

-> 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 #

Arguments

:: (HasCallStack, MonadIO m, IsItem a, IsAsyncResult b) 
=> a

self: an item

-> b

result: asynchronous result passed to the callback

-> m ()

(Can throw GError)

Complete operation to set the attributes of this item.

setAttributesSync

itemSetAttributesSync Source #

Arguments

:: (HasCallStack, MonadIO m, IsItem a, IsCancellable b) 
=> a

self: an item

-> Maybe Schema

schema: the schema for the attributes

-> Map Text Text

attributes: a new set of attributes

-> Maybe b

cancellable: optional cancellation object

-> m ()

(Can throw GError)

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 indefinetely. Use the asynchronous version in user interface threads.

setLabel

data ItemSetLabelMethodInfo Source #

Instances

((~) * signature (Text -> Maybe b -> Maybe AsyncReadyCallback -> m ()), MonadIO m, IsItem a, IsCancellable b) => MethodInfo * ItemSetLabelMethodInfo a signature Source # 

itemSetLabel Source #

Arguments

:: (HasCallStack, MonadIO m, IsItem a, IsCancellable b) 
=> a

self: an item

-> Text

label: a new label

-> Maybe b

cancellable: optional cancellation object

-> Maybe AsyncReadyCallback

callback: called when the operation completes

-> m () 

Set the label of this item.

This function returns immediately and completes asynchronously.

setLabelFinish

data ItemSetLabelFinishMethodInfo Source #

Instances

((~) * signature (b -> m ()), MonadIO m, IsItem a, IsAsyncResult b) => MethodInfo * ItemSetLabelFinishMethodInfo a signature Source # 

itemSetLabelFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsItem a, IsAsyncResult b) 
=> a

self: an item

-> b

result: asynchronous result passed to callback

-> m ()

(Can throw GError)

Complete asynchronous operation to set the label of this collection.

setLabelSync

data ItemSetLabelSyncMethodInfo Source #

Instances

((~) * signature (Text -> Maybe b -> m ()), MonadIO m, IsItem a, IsCancellable b) => MethodInfo * ItemSetLabelSyncMethodInfo a signature Source # 

itemSetLabelSync Source #

Arguments

:: (HasCallStack, MonadIO m, IsItem a, IsCancellable b) 
=> a

self: an item

-> Text

label: a new label

-> Maybe b

cancellable: optional cancellation object

-> m ()

(Can throw GError)

Set the label of this item.

This function may block indefinetely. Use the asynchronous version in user interface threads.

setSecret

data ItemSetSecretMethodInfo Source #

Instances

((~) * signature (Value -> Maybe b -> Maybe AsyncReadyCallback -> m ()), MonadIO m, IsItem a, IsCancellable b) => MethodInfo * ItemSetSecretMethodInfo a signature Source # 

itemSetSecret Source #

Arguments

:: (HasCallStack, MonadIO m, IsItem a, IsCancellable b) 
=> a

self: an item

-> Value

value: a new secret value

-> Maybe b

cancellable: optional cancellation object

-> Maybe AsyncReadyCallback

callback: called when the operation completes

-> 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

data ItemSetSecretFinishMethodInfo Source #

Instances

((~) * signature (b -> m ()), MonadIO m, IsItem a, IsAsyncResult b) => MethodInfo * ItemSetSecretFinishMethodInfo a signature Source # 

itemSetSecretFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsItem a, IsAsyncResult b) 
=> a

self: an item

-> b

result: asynchronous result passed to callback

-> m ()

(Can throw GError)

Complete asynchronous operation to set the secret value of this item.

setSecretSync

data ItemSetSecretSyncMethodInfo Source #

Instances

((~) * signature (Value -> Maybe b -> m ()), MonadIO m, IsItem a, IsCancellable b) => MethodInfo * ItemSetSecretSyncMethodInfo a signature Source # 

itemSetSecretSync Source #

Arguments

:: (HasCallStack, MonadIO m, IsItem a, IsCancellable b) 
=> a

self: an item

-> Value

value: a new secret value

-> Maybe b

cancellable: optional cancellation object

-> m ()

(Can throw GError)

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 indefinetely. Use the asynchronous version in user interface threads.

Properties

attributes

data ItemAttributesPropertyInfo Source #

Instances

AttrInfo ItemAttributesPropertyInfo Source # 
type AttrOrigin ItemAttributesPropertyInfo Source # 
type AttrLabel ItemAttributesPropertyInfo Source # 
type AttrGetType ItemAttributesPropertyInfo Source # 
type AttrBaseTypeConstraint ItemAttributesPropertyInfo Source # 
type AttrSetTypeConstraint ItemAttributesPropertyInfo Source # 
type AttrAllowedOps ItemAttributesPropertyInfo Source # 

created

data ItemCreatedPropertyInfo Source #

Instances

AttrInfo ItemCreatedPropertyInfo Source # 
type AttrOrigin ItemCreatedPropertyInfo Source # 
type AttrLabel ItemCreatedPropertyInfo Source # 
type AttrGetType ItemCreatedPropertyInfo Source # 
type AttrBaseTypeConstraint ItemCreatedPropertyInfo Source # 
type AttrSetTypeConstraint ItemCreatedPropertyInfo Source # 
type AttrAllowedOps ItemCreatedPropertyInfo Source # 

setItemCreated :: (MonadIO m, IsItem o) => o -> Word64 -> m () Source #

label

data ItemLabelPropertyInfo Source #

Instances

AttrInfo ItemLabelPropertyInfo Source # 
type AttrOrigin ItemLabelPropertyInfo Source # 
type AttrLabel ItemLabelPropertyInfo Source # 
type AttrGetType ItemLabelPropertyInfo Source # 
type AttrBaseTypeConstraint ItemLabelPropertyInfo Source # 
type AttrSetTypeConstraint ItemLabelPropertyInfo Source # 
type AttrAllowedOps ItemLabelPropertyInfo Source # 

clearItemLabel :: (MonadIO m, IsItem o) => o -> m () Source #

getItemLabel :: (MonadIO m, IsItem o) => o -> m (Maybe Text) Source #

setItemLabel :: (MonadIO m, IsItem o) => o -> Text -> m () Source #

locked

data ItemLockedPropertyInfo Source #

Instances

AttrInfo ItemLockedPropertyInfo Source # 
type AttrOrigin ItemLockedPropertyInfo Source # 
type AttrLabel ItemLockedPropertyInfo Source # 
type AttrGetType ItemLockedPropertyInfo Source # 
type AttrBaseTypeConstraint ItemLockedPropertyInfo Source # 
type AttrSetTypeConstraint ItemLockedPropertyInfo Source # 
type AttrAllowedOps ItemLockedPropertyInfo Source # 

getItemLocked :: (MonadIO m, IsItem o) => o -> m Bool Source #

modified

data ItemModifiedPropertyInfo Source #

Instances

AttrInfo ItemModifiedPropertyInfo Source # 
type AttrOrigin ItemModifiedPropertyInfo Source # 
type AttrLabel ItemModifiedPropertyInfo Source # 
type AttrGetType ItemModifiedPropertyInfo Source # 
type AttrBaseTypeConstraint ItemModifiedPropertyInfo Source # 
type AttrSetTypeConstraint ItemModifiedPropertyInfo Source # 
type AttrAllowedOps ItemModifiedPropertyInfo Source # 

setItemModified :: (MonadIO m, IsItem o) => o -> Word64 -> m () Source #

service

data ItemServicePropertyInfo Source #

Instances

AttrInfo ItemServicePropertyInfo Source # 
type AttrOrigin ItemServicePropertyInfo Source # 
type AttrLabel ItemServicePropertyInfo Source # 
type AttrGetType ItemServicePropertyInfo Source # 
type AttrBaseTypeConstraint ItemServicePropertyInfo Source # 
type AttrSetTypeConstraint ItemServicePropertyInfo Source # 
type AttrAllowedOps ItemServicePropertyInfo Source #