src/pyams_security/credential.py
changeset 0 f04e1d0a0723
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_security/credential.py	Thu Feb 19 10:53:29 2015 +0100
@@ -0,0 +1,37 @@
+#
+# Copyright (c) 2008-2015 Thierry Florac <tflorac AT ulthar.net>
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+
+__docformat__ = 'restructuredtext'
+
+
+# import standard library
+
+# import interfaces
+from pyams_security.interfaces import ICredentials
+
+# import packages
+from zope.interface import implementer
+from zope.schema.fieldproperty import FieldProperty
+
+
+@implementer(ICredentials)
+class Credentials(object):
+    """Credentials class"""
+
+    prefix = FieldProperty(ICredentials['prefix'])
+    id = FieldProperty(ICredentials['id'])
+    attributes = FieldProperty(ICredentials['attributes'])
+
+    def __init__(self, prefix, id, **attributes):
+        self.prefix = prefix
+        self.id = id
+        self.attributes.update(**attributes)