Use AM_CPPFLAGS instead of INCLUDES
[platform/upstream/libsecret.git] / libsecret / secret-schemas.c
1 /* libsecret - GLib wrapper for Secret Service
2  *
3  * Copyright 2012 Stef Walter
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Lesser General Public License as published
7  * by the Free Software Foundation; either version 2.1 of the licence or (at
8  * your option) any later version.
9  *
10  * See the included COPYING file for more information.
11  *
12  * Author: Stef Walter <stefw@gnome.org>
13  */
14
15 #include "config.h"
16
17 #include "secret-schema.h"
18
19 /**
20  * SECRET_SCHEMA_NOTE:
21  *
22  * A predefined schema for personal passwords stored by the user in the
23  * password manager. This schema has no attributes, and the items are not
24  * meant to be used automatically by applications.
25  *
26  * When used to search for items using this schema, it will only match
27  * items that have the same schema. Items stored via libgnome-keyring with the
28  * <literal>GNOME_KEYRING_ITEM_NOTE</literal> item type will match.
29  */
30
31 static const SecretSchema note_schema = {
32         "org.gnome.keyring.Note",
33         SECRET_SCHEMA_NONE,
34         {
35                 {  NULL, 0 },
36         }
37 };
38
39 const SecretSchema *  SECRET_SCHEMA_NOTE = &note_schema;
40
41 /**
42  * SECRET_SCHEMA_COMPAT_NETWORK:
43  *
44  * A predefined schema that is compatible with items stored via the
45  * libgnome-keyring 'network password' functions. This is meant to be used by
46  * applications migrating from libgnome-keyring which stored their secrets as
47  * 'network passwords'. It is not recommended that new code use this schema.
48  *
49  * When used to search for items using this schema, it will only match
50  * items that have the same schema. Items stored via libgnome-keyring with the
51  * <literal>GNOME_KEYRING_ITEM_NETWORK_PASSWORD</literal> item type will match.
52  *
53  * The following attributes exist in the schema:
54  * <variablelist><title>Attributes:</title>
55  *     <varlistentry><term><literal>user</literal>:</term>
56  *         <listitem><para>The user name (string).</para></listitem></varlistentry>
57  *     <varlistentry><term><literal>domain</literal>:</term>
58  *         <listitem><para>The login domain or realm (string).</para></listitem></varlistentry>
59  *     <varlistentry><term><literal>object</literal>:</term>
60  *         <listitem><para>The object or path (string).</para></listitem></varlistentry>
61  *     <varlistentry><term><literal>protocol</literal>:</term>
62  *         <listitem><para>The protocol (a string like 'http').</para></listitem></varlistentry>
63  *     <varlistentry><term><literal>port</literal>:</term>
64  *         <listitem><para>The network port (integer).</para></listitem></varlistentry>
65  *     <varlistentry><term><literal>server</literal>:</term>
66  *         <listitem><para>The hostname or server (string).</para></listitem></varlistentry>
67  *     <varlistentry><term><literal>authtype</literal>:</term>
68  *         <listitem><para>The authentication type (string).</para></listitem></varlistentry>
69  * </variablelist>
70  */
71
72 static const SecretSchema network_schema = {
73         "org.gnome.keyring.NetworkPassword",
74         SECRET_SCHEMA_NONE,
75         {
76                 {  "user", SECRET_SCHEMA_ATTRIBUTE_STRING },
77                 {  "domain", SECRET_SCHEMA_ATTRIBUTE_STRING },
78                 {  "object", SECRET_SCHEMA_ATTRIBUTE_STRING },
79                 {  "protocol", SECRET_SCHEMA_ATTRIBUTE_STRING },
80                 {  "port", SECRET_SCHEMA_ATTRIBUTE_INTEGER },
81                 {  "server", SECRET_SCHEMA_ATTRIBUTE_STRING },
82                 {  "authtype", SECRET_SCHEMA_ATTRIBUTE_STRING },
83                 {  NULL, 0 },
84         }
85 };
86
87 const SecretSchema *  SECRET_SCHEMA_COMPAT_NETWORK = &network_schema;