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.Structs.Schema

Contents

Description

Represents a set of attributes that are stored with an item. These schemas are used for interoperability between various services storing the same types of items.

Each schema has a name like "org.gnome.keyring.NetworkPassword", and defines a set of attributes, and types (string, integer, boolean) for those attributes.

Attributes are stored as strings in the Secret Service, and the attribute types simply define standard ways to store integer and boolean values as strings. Attributes are represented in libsecret via a HashTable with string keys and values. Even for values that defined as an integer or boolean in the schema, the attribute values in the HashTable are strings. Boolean values are stored as the strings 'true' and 'false'. Integer values are stored in decimal, with a preceding negative sign for negative integers.

Schemas are handled entirely on the client side by this library. The name of the schema is automatically stored as an attribute on the item.

Normally when looking up passwords only those with matching schema names are returned. If the schema flags contain the SchemaFlagsDontMatchName flag, then lookups will not check that the schema name matches that on the item, only the schema's attributes are matched. This is useful when you are looking up items that are not stored by the libsecret library. Other libraries such as libgnome-keyring don't store the schema name.

Synopsis

Exported types

newtype Schema Source #

Constructors

Schema (ManagedPtr Schema) 

Instances

BoxedObject Schema Source # 

Methods

boxedType :: Schema -> IO GType #

(~) AttrOpTag tag AttrSet => Constructible Schema tag Source # 

Methods

new :: MonadIO m => (ManagedPtr Schema -> Schema) -> [AttrOp Schema tag] -> m Schema #

((~) * info (ResolveSchemaMethod t Schema), MethodInfo * info Schema p) => IsLabel t (Schema -> p) Source # 

Methods

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

((~) * info (ResolveSchemaMethod t Schema), MethodInfo * info Schema p) => IsLabelProxy t (Schema -> p) Source # 

Methods

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

HasAttributeList * Schema Source # 
((~) * signature (m ()), MonadIO m) => MethodInfo * SchemaUnrefMethodInfo Schema signature Source # 
((~) * signature (m Schema), MonadIO m) => MethodInfo * SchemaRefMethodInfo Schema signature Source # 
type AttributeList Schema Source # 

newZeroSchema :: MonadIO m => m Schema Source #

Construct a Schema struct initialized to zero.

Methods

ref

data SchemaRefMethodInfo Source #

Instances

((~) * signature (m Schema), MonadIO m) => MethodInfo * SchemaRefMethodInfo Schema signature Source # 

schemaRef Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Schema

schema: the schema to reference

-> m Schema

Returns: the referenced schema, which should be later unreferenced with schemaUnref

Adds a reference to the Schema.

It is not normally necessary to call this function from C code, and is mainly present for the sake of bindings. If the schema was statically allocated, then this function will copy the schema.

unref

data SchemaUnrefMethodInfo Source #

Instances

((~) * signature (m ()), MonadIO m) => MethodInfo * SchemaUnrefMethodInfo Schema signature Source # 

schemaUnref Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Schema

schema: the schema to reference

-> m () 

Releases a reference to the Schema. If the last reference is released then the schema will be freed.

It is not normally necessary to call this function from C code, and is mainly present for the sake of bindings. It is an error to call this for a schema that was statically allocated.

Properties

flags

name