From 7ec0cb4e74616ab7408ec734b872a04246c4d01d Mon Sep 17 00:00:00 2001 From: kakwa Date: Wed, 15 Apr 2015 21:13:14 +0200 Subject: [PATCH] adding skeleton for most files --- ldapcherry/backend/__init__.py | 20 +++++++++++++++++++ ldapcherry/backend/ldap.py | 11 +++++++++++ ldapcherry/backend/samba4.py | 7 +++++++ ldapcherry/exceptions.py | 7 +++++++ ldapcherry/roles.py | 35 ++++++++++++++++++++++++++++++++++ 5 files changed, 80 insertions(+) create mode 100644 ldapcherry/backend/__init__.py create mode 100644 ldapcherry/backend/ldap.py create mode 100644 ldapcherry/backend/samba4.py create mode 100644 ldapcherry/exceptions.py create mode 100644 ldapcherry/roles.py diff --git a/ldapcherry/backend/__init__.py b/ldapcherry/backend/__init__.py new file mode 100644 index 0000000..c73186c --- /dev/null +++ b/ldapcherry/backend/__init__.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# vim:set expandtab tabstop=4 shiftwidth=4: +# +# The MIT License (MIT) +# LdapCherry +# Copyright (c) 2014 Carpentier Pierre-Francois + +class Backend: + + def __init__(self): + pass + + def add_group(self): + pass + + def set_attr(self): + pass + + def rm_group(self): + pass diff --git a/ldapcherry/backend/ldap.py b/ldapcherry/backend/ldap.py new file mode 100644 index 0000000..bc750cd --- /dev/null +++ b/ldapcherry/backend/ldap.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- +# vim:set expandtab tabstop=4 shiftwidth=4: +# +# The MIT License (MIT) +# LdapCherry +# Copyright (c) 2014 Carpentier Pierre-Francois + +class Backend(ldapcherry.backend.Backend): + + def __init__(self, config, logger): + pass diff --git a/ldapcherry/backend/samba4.py b/ldapcherry/backend/samba4.py new file mode 100644 index 0000000..bc807ca --- /dev/null +++ b/ldapcherry/backend/samba4.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# vim:set expandtab tabstop=4 shiftwidth=4: +# +# License GPLv3 +# LdapCherry +# Copyright (c) 2014 Carpentier Pierre-Francois + diff --git a/ldapcherry/exceptions.py b/ldapcherry/exceptions.py new file mode 100644 index 0000000..baa706b --- /dev/null +++ b/ldapcherry/exceptions.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# vim:set expandtab tabstop=4 shiftwidth=4: +# +# The MIT License (MIT) +# LdapCherry +# Copyright (c) 2014 Carpentier Pierre-Francois + diff --git a/ldapcherry/roles.py b/ldapcherry/roles.py new file mode 100644 index 0000000..ccefbf5 --- /dev/null +++ b/ldapcherry/roles.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +# vim:set expandtab tabstop=4 shiftwidth=4: +# +# The MIT License (MIT) +# LdapCherry +# Copyright (c) 2014 Carpentier Pierre-Francois + +import os +import sys + +try: + from yaml import CLoader as Loader, CDumper as Dumper +except ImportError: + from yaml import Loader, Dumper + +class Roles: + + def __init__(self, role_file): + pass + + def _nest(self, role_file): + """nests the roles (creates roles hierarchy)""" + pass + + def write(self, out_file): + """write the nested role hierarchy to a file""" + pass + + def get_roles(self, groups): + """get list of roles and list of standalone groups""" + pass + + def get_groups(self, roles): + """get the list of groups from roles""" + pass