gi-secret-0.0.15: Libsecret bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Secret.Objects.Item

Description

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

Exported types

newtype Item Source #

Memory-managed wrapper type.

Constructors

Item (ManagedPtr Item) 

Instances

Instances details
Eq Item Source # 
Instance details

Defined in GI.Secret.Objects.Item

Methods

(==) :: Item -> Item -> Bool #

(/=) :: Item -> Item -> Bool #

GObject Item Source # 
Instance details

Defined in GI.Secret.Objects.Item

ManagedPtrNewtype Item Source # 
Instance details

Defined in GI.Secret.Objects.Item

Methods

toManagedPtr :: Item -> ManagedPtr Item

TypedObject Item Source # 
Instance details

Defined in GI.Secret.Objects.Item

Methods

glibType :: IO GType

HasParentTypes Item Source # 
Instance details

Defined in GI.Secret.Objects.Item

IsGValue (Maybe Item) Source #

Convert Item to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Secret.Objects.Item

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe Item -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe Item)

type ParentTypes Item Source # 
Instance details

Defined in GI.Secret.Objects.Item

type ParentTypes Item = '[DBusProxy, Object, AsyncInitable, DBusInterface, Initable, Retrievable]

class (GObject o, IsDescendantOf Item o) => IsItem o Source #

Type class for types which can be safely cast to Item, for instance with toItem.

Instances

Instances details
(GObject o, IsDescendantOf Item o) => IsItem o Source # 
Instance details

Defined in GI.Secret.Objects.Item

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

Cast to Item, for types for which this is known to be safe. For general casts, use castTo.

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. [methodservice.prompt] 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. [methodservice.prompt] will be used to handle any prompts that are required.

delete

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. [methodservice.prompt] will be used to handle any prompts that show up.

deleteFinish

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

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. [methodservice.prompt] 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 [funcgLib.HashTable.unref]

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

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

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 [methoditem.load_secret] to initialize further features and change the flags.

getLabel

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

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

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

itemGetSecret Source #

Arguments

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

self: an item

-> m (Maybe Value)

Returns: the secret value which should be released with [methodvalue.unref], 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 [methoditem.load_secret] method.

getService

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 [methoditem.get_secret].

loadSecretSync

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

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

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

setLabel

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

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

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

setSecret

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

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

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