Project plan - phase 1
Refactor wikidicts
- refactoring all the groups/dicts/lists code to a more generic approach
- have some api to some generic groups/dicts/lists code that has another backend api to more simple backend plugins for misc group sources
- refactor all groups and other user data to make the storing user data to a new backend storage easier when it will be implemented
Refactoring wikidicts:
done: mv wikidicts.py wikidicts/__init__.py added: _tests/ to wikidicts/
Melita did you done "mv" or "hg mv" that is a big difference if it's done with "mv" you have to undo it please use only "hg mv".
Done hg mv
Please check if there are tests for "member in group" and "list group members" before you start the refactoring. If they are missing you have to add them beforehand.
There are some wikidicts tests, but I also need to put some of them in the backend.
Please check if the tests I told about are defined and do create them if they are missing
- add config backend
admin_group = set(u'UserName', u'SomeOther', ) editor_group = set(u"JoeDoe", ) groups = { u'AdminGroup': admin_group u"EditorGroup": editor_group, }
Why is that needed (predefined groups)? please reread the discussion of yesterday on #moin-dev
I know, but I had a discussion with Thomas yesterday (should have it on #moin-dev) :
<ThomasWaldmann> btw, before starting to work on the wiki and ldap backends for dicts/groups, you maybe want to have a "config" backend <ThomasWaldmann> that doesn't exist yet, but it is maybe the easiest of them all: <ThomasWaldmann> it is just the wiki admin defining some groups and dicts in his wikiconfig <ThomasWaldmann> you don't have to parse wiki pages or query ldap for this :) <ThomasWaldmann> e.g. admin_group = set(u'ThomasWaldmann', u'SomeOther', ) <ThomasWaldmann> editor_group = set(u"JoeDoe", ) <ThomasWaldmann> groups = { <ThomasWaldmann> u'AdminGroup': admin_group, <ThomasWaldmann> u"EditorGroup": editor_group, <ThomasWaldmann> } <ThomasWaldmann> then make the backend to use that <ThomasWaldmann> make the wikidicts code use that (or any other) backend <ThomasWaldmann> write tests for it
- then make a backend to use it and write tests for it
good idea
- add a way of reading groups from (like auth = [ldapauthenticator, ] ) in wikiconfig, maybe use auth to read groups from
- changes to Dict:
move dict definitions to backend regex = r'^ (?P<key>.+?)::(?P<val>.*?) *$'
- leave dict
What is the meaning of leave dict? Please be verbose
- Everything is represent with dictionary so here I can't change to set or something like in Groups (will change list to set).
- changes to Group:
move group definition to the backend regex = r'^ \* +(?:\[\[)?(?P<member>.+?)(?:\]\])? *$'
- see if it is possible to use set and not list (does the group stuff depends on order
- change all methods that depends on list (member, addmember,...)
changes to DictDict:
changes to GroupDict:
- put all "data" to backend
To think about
- what kind of Group and Dicts representation to put to high level code in wikidics.py
Ideas
__init__.py - currently will hold high level of code ldap_groups.py - read groups from ldap and put them mm_groups.py - regexp - curently way of reading groups- change groups representation from list to set for both dict_dict.py - beckend of dict dict code
All classes and method that the filter=isgroup is in it:
MoinMoin/userform/admin.py: isgroup = request.cfg.cache.page_group_regexact.search MoinMoin/userform/admin.py: groupnames = request.rootpage.getPageList(user='', filter=isgroup) MoinMoin/_tests/test_wikidicts.py: isgroup = request.cfg.cache.page_group_regexact.search MoinMoin/_tests/test_wikidicts.py: grouppages = request.rootpage.getPageList(user='', filter=isgroup) MoinMoin/_tests/test_wikidicts.py: isgroup = request.cfg.cache.page_group_regexact.search MoinMoin/_tests/test_wikidicts.py: grouppages = request.rootpage.getPageList(user='', filter=isgroup) MoinMoin/wikidicts/__init__.py: isgroup = self.cfg.cache.page_group_regexact.search MoinMoin/wikidicts/__init__.py: grouppages = request.rootpage.getPageList(user='', filter=isgroup)
All classes and methods that the page_group_regex is in it:
MoinMoin/xmlrpc/UpdateGroup.py: must match the page_group_regex or it won't have effect MoinMoin/xmlrpc/UpdateGroup.py: # check if groupname matches page_group_regex MoinMoin/xmlrpc/UpdateGroup.py: if not self.request.cfg.cache.page_group_regexact.search(groupname): MoinMoin/xmlrpc/UpdateGroup.py: return xmlrpclib.Fault(2, "The groupname %s does not match your page_group_regex (%s)" % ( MoinMoin/xmlrpc/UpdateGroup.py: groupname, self.request.cfg.page_group_regex)) MoinMoin/userform/admin.py: isgroup = request.cfg.cache.page_group_regexact.search MoinMoin/request/_tests/test_request.py: self.config = self.TestConfig(page_group_regex=r'.+Group') MoinMoin/wikiutil.py: return request.cfg.cache.page_group_regexact.search(pagename) is not None MoinMoin/_tests/test_user.py: self.config = self.TestConfig(page_group_regex=r'.+Group') MoinMoin/_tests/test_wikidicts.py: isgroup = request.cfg.cache.page_group_regexact.search MoinMoin/_tests/test_wikidicts.py: isgroup = request.cfg.cache.page_group_regexact.search MoinMoin/events/wikidictsrescan.py: cfg.cache.page_group_regexact.search(pagename): MoinMoin/wikidicts/__init__.py: cfg.page_group_regex MoinMoin/wikidicts/__init__.py: isgroup = self.cfg.cache.page_group_regexact.search MoinMoin/security/__init__.py: "SomeGroup" is a page name matching cfg.page_group_regex with MoinMoin/security/__init__.py: group_re = request.cfg.cache.page_group_regexact MoinMoin/script/maint/makecache.py:do fit to the page_group_regex variable. MoinMoin/script/maint/cleancache.py:do fit to the page_group_regex variable. MoinMoin/config/multiconfig.py: page_group_regex = ur'(?P<all>(?P<key>\S+)Group)' MoinMoin/config/multiconfig.py: self.cache.page_group_regex = re.compile(self.page_group_regex, re.UNICODE) MoinMoin/config/multiconfig.py: self.cache.page_group_regexact = re.compile(u'^%s$' % self.page_group_regex, re.UNICODE) MoinMoin/config/multiconfig.py: 'page_group_regex', 'page_template_regex', 'page_license_page', tests/wiki/underlay/pages/ wiki/config/wikiconfig.py: page_group_regex = ur'(?P<all>(?P<key>\S+)Group)' wiki/config/wikifarm/farmconfig.py: page_group_regex = ur'(?P<all>(?P<key>\S+)Group)'