Author: tchemit Date: 2012-06-15 17:09:26 +0200 (Fri, 15 Jun 2012) New Revision: 3480 Url: http://chorem.org/repositories/revision/pollen/3480 Log: add some tech docs Added: trunk/src/site/rst/security.rst trunk/src/site/rst/tests.rst Removed: trunk/doc/tests.rst Modified: trunk/src/site/site_en.xml Deleted: trunk/doc/tests.rst =================================================================== --- trunk/doc/tests.rst 2012-06-15 14:45:42 UTC (rev 3479) +++ trunk/doc/tests.rst 2012-06-15 15:09:26 UTC (rev 3480) @@ -1,119 +0,0 @@ -~~~~~~~~~~ -Tests d'UI -~~~~~~~~~~ - -Abstract -======== - -- Tests Pollen by ui. -- Needs a db with - - 1 admin user *admin/admin* - - 1 none admin user *user/user* - - 1 none admin user *user2/user2* - - 1 poll of each votecounting type (Normal, pourcentage, Condorcet, Nombre) + some votes on it - - 1 poll with restricted mode - -Scenarii -======== - -Security --------- - -- authentication avec mauvais login/password (KO) -- authentication avec bon login/password (OK) - -- access aux pages connectés en mode déconnecté (KO) -- access aux pages connectés en mode connecté (OK) - -- access aux pages admin en mode déconnecté (KO) -- access aux pages admin avec un user non admin (KO) -- access aux pages admin avec un user admin (OK) - -- access aux pages d'un sondage avec un mauvais pollId (KO) -- access aux pages d'un sondage avec un bon pollId (OK) - -- access aux pages d'un sondage en mode créateur - - en mode admin (pas de accountId dans l'url) : avec un user non admin (KO) - - en mode admin (pas de accountId dans l'url) : avec un admin (OK) - - en mode créateur (avec mauvais accountId dans l'url) (KO) - - en mode créateur (avec bon accountId dans l'url) (OK) - -- access aux résultats d'un sondage (non restreint) (OK) -- access aux résultats d'un sondage restreint en anonyme (KO) -- access aux résultats d'un sondage restreint en extérieur (mauvais accountId) (KO) -- access aux résultats d'un sondage restreint en extérieur (mauvais utilisateur connecté) (KO) -- access aux résultats d'un sondage restreint avec bon accountId (OK) -- access aux résultats d'un sondage restreint avec bon utilisateur connecté (OK) -- access aux résultats d'un sondage restreint avec accountId de créateur (OK) -- access aux résultats d'un sondage restreint avec un admin connecté (OK) - -Création d'un sondage (free + text) ------------------------------------ - -- creation avec champs obligatoires remplis (OK) -- creation avec Titre non rempli (KO) -- creation avec aucun choix proposé (KO) -- creation avec deux choix identiques (KO) -- creation avec Date de fin < Date de début (KO) -- creation avec Date de fin antérieur à maintenant (KO) (TODO) -- creation avec Ajout de choix Date de fin < Date de début (KO) -- creation avec Ajout de choix Date de fin antérieur à maintenant (KO) -- creation avec Ajout de choix cochez et remplit + decochez (les dates doivent être supprimées) (OK) (TODO) -- creation avec email invalide (KO) -- creation avec heure avant la fin de sondage <=0 (KO) (TODO) -- TODO Mettre un warning si date de fin proche... (new feature) -- creation avec nombre de choix <=0 (KO) (TODO : pffff quand on veut voter on a un message Le nombre de choix maximal est de -5....) -- TODO Par défaut mettre au moins 1 - -- TODO Quand on déchoche alors il faut desactiver les champs concernés (et pas uniquement les cacher) - -Création d'un sondage (free + date) ------------------------------------ - -- creation avec aucun choix proposé (KO) -- creation avec deux choix identiques (KO) -- creation d'un sondage de Date avec mauvais format (KO) - -Création d'un sondage (free + image) ------------------------------------- - -- creation avec aucun choix proposé (KO) -- creation d'un sondage d'Image avec mauvais mimetype (KO) (TODO) -- creation avec deux images au nom identiques (KO) (TODO) -- TODO Mettre une image avec une croix ROUGE!!! quand pas chargée - -Création d'un sondage (restreint + text) ----------------------------------------- - -- création sans participant (KO) -- création avec deux participants ayant le même nom (KO) -- création avec deux participants ayant le même email (KO) -- création avec un participants ayant juste un email et pas de nom (KO) (TODO : pollenTechincalException) -- création avec un participants ayant juste un nom et pas d'email (KO) -- TODO problème d'enregistrement des plusieurs votants, le dernier est conservé et dupliqué. -- TODO L'email envoyé n'est pas le bon (il manque le token d'account) + la sécurité ne va pas car je ne dois pas avoir accès à ce sondage - -Création d'un sondage (group + text) ----------------------------------------- - -- création sans nom de groupe (KO) -- création avec deux participants ayant le même nom (KO) -- création avec deux participants ayant le même email (KO) -- création avec un participants ayant juste un email et pas de nom (KO) (TODO : pollenTechincalException) -- création avec un participants ayant juste un nom et pas d'email (KO) -- TODO problème d'enregistrement des plusieurs votants, le dernier est conservé et dupliqué. -- TODO Revoir l'enregistrement (le groupe 2 est perdu...) - - -Edition d'un sondage ---------------------- - -- edition avec champs titre vidé (OK) -- edition avec modification date de fin antérieure à maintenant (KO) -- edition avec suppression de tous les choix (KO) - -Page de résumé d'un sondage ---------------------------- - -- TODO supprimer les // dans les urls - Added: trunk/src/site/rst/security.rst =================================================================== --- trunk/src/site/rst/security.rst (rev 0) +++ trunk/src/site/rst/security.rst 2012-06-15 15:09:26 UTC (rev 3480) @@ -0,0 +1,161 @@ +~~~~~~~~~~~~~~~~~~~~~~~~ +Security model in Pollen +~~~~~~~~~~~~~~~~~~~~~~~~ + +Abstract +======== + +- New way of dealing security in Pollen (1.5 ?) + +Roles +===== + +Pollen defines different roles for different usages. Some roles can be found +by the stored Pollen session (in servlet session), others can be found by the +accountId in some urls (example http://pollen/action/pollId:accountId). + +Anonymous +--------- + +This is a not loggued user with nothing is url (no accountId) which can +identify himself. + +Connected user +-------------- + +When a user has been registred inside Pollen and is connected in Pollen. + +We can find him back by using the pollen user account stored in servlet session. + +Admin +----- + +Connected user with more privileges to manage everything in Pollen. + +We can find him back by using the pollen user account stored in servlet session. + +Poll creator +------------ + +Person which has created a poll. It acts as an admin for his very own poll. + +We can find him back by using a accountId in url. + +Poll voter +---------- + +A person which has voted to a poll. + +We can find him back by using a accountId in url. + +Poll participant +---------------- + +A person that can vote on a none free poll. + +We can find him back by using a accountId in url. + +Resources and permissions +========================= + +User +---- + +A user (*UserAccount*) is a Pollen connected user. + +- user:modify +- user:delete + +VotingList +---------- + +A voting list (*VotingList*) is a list of person (name + email) to simplify +creation of restricted poll (you can import in one time a such list for a poll). + +- votingList:modify +- votingList:delete + +Poll +---- + +A poll (*Poll*) is life in Pollen! + +- poll:create +- poll:modify +- poll:vote +- poll:close +- poll:delete +- poll:clone +- poll:export +- poll:votecounting +- poll:comment +- poll:add choice + +Choice +------ + +A choice (*Choice*) is a choice on which to vote in a poll. + +- choice:modify +- choice:delete + +Comment +------- + +A comment (*Comment*) is a comment to be added on a poll. + +- comment:modify +- comment:delete + +Usage of wildcard +----------------- + +To simplify usage of permissions, we will use some wildcard. For example, an +admin can do anything and has all permissions: :: + + user:*:* + poll:*:* (only if poll is free, result public and continuous,...) + choice:*:* + comment:*:* + +A poll creator will have all permissions on his poll: :: + + poll:*:pollId (only if poll is free, result public and continuous,...) + choice:*:pollId (only if choice can add + comment:*:pollId + +But these examples are not quite exact. In facts, a admin or a poll creator could have + +How to implement this security model +==================================== + +Based on Shiro (http://shiro.apache.org/): + +- using authentication mecanism to find roles (http://shiro.apache.org/authentication-features.html) +- using permission mecanism to find role permissions (http://shiro.apache.org/permissions.html) + +Global workflow +--------------- + +When a user wants to acces a resource (page), find out first the user role, +then compute his. + +To tune this we will use a chache of permissions, beacuse it does seem very +realist to recompute at each request the cache for a poll or a connected user. + +From this first cache: + +- key re userAccount or accountId, +- values are his set of permissions, + +we will build one form each poll: + +- key is pollId +- values are users (on which permissions where build) involved by this poll. + +At each poll modification, we then invalidate poll cache for the pollId entry +and then also simply invalidate the cache of all users involved by this poll. + + + + Copied: trunk/src/site/rst/tests.rst (from rev 3478, trunk/doc/tests.rst) =================================================================== --- trunk/src/site/rst/tests.rst (rev 0) +++ trunk/src/site/rst/tests.rst 2012-06-15 15:09:26 UTC (rev 3480) @@ -0,0 +1,119 @@ +~~~~~~~~~~ +Tests d'UI +~~~~~~~~~~ + +Abstract +======== + +- Tests Pollen by ui. +- Needs a db with + - 1 admin user *admin/admin* + - 1 none admin user *user/user* + - 1 none admin user *user2/user2* + - 1 poll of each votecounting type (Normal, pourcentage, Condorcet, Nombre) + some votes on it + - 1 poll with restricted mode + +Scenarii +======== + +Security +-------- + +- authentication avec mauvais login/password (KO) +- authentication avec bon login/password (OK) + +- access aux pages connectés en mode déconnecté (KO) +- access aux pages connectés en mode connecté (OK) + +- access aux pages admin en mode déconnecté (KO) +- access aux pages admin avec un user non admin (KO) +- access aux pages admin avec un user admin (OK) + +- access aux pages d'un sondage avec un mauvais pollId (KO) +- access aux pages d'un sondage avec un bon pollId (OK) + +- access aux pages d'un sondage en mode créateur + - en mode admin (pas de accountId dans l'url) : avec un user non admin (KO) + - en mode admin (pas de accountId dans l'url) : avec un admin (OK) + - en mode créateur (avec mauvais accountId dans l'url) (KO) + - en mode créateur (avec bon accountId dans l'url) (OK) + +- access aux résultats d'un sondage (non restreint) (OK) +- access aux résultats d'un sondage restreint en anonyme (KO) +- access aux résultats d'un sondage restreint en extérieur (mauvais accountId) (KO) +- access aux résultats d'un sondage restreint en extérieur (mauvais utilisateur connecté) (KO) +- access aux résultats d'un sondage restreint avec bon accountId (OK) +- access aux résultats d'un sondage restreint avec bon utilisateur connecté (OK) +- access aux résultats d'un sondage restreint avec accountId de créateur (OK) +- access aux résultats d'un sondage restreint avec un admin connecté (OK) + +Création d'un sondage (free + text) +----------------------------------- + +- creation avec champs obligatoires remplis (OK) +- creation avec Titre non rempli (KO) +- creation avec aucun choix proposé (KO) +- creation avec deux choix identiques (KO) +- creation avec Date de fin < Date de début (KO) +- creation avec Date de fin antérieur à maintenant (KO) (TODO) +- creation avec Ajout de choix Date de fin < Date de début (KO) +- creation avec Ajout de choix Date de fin antérieur à maintenant (KO) +- creation avec Ajout de choix cochez et remplit + decochez (les dates doivent être supprimées) (OK) (TODO) +- creation avec email invalide (KO) +- creation avec heure avant la fin de sondage <=0 (KO) (TODO) +- TODO Mettre un warning si date de fin proche... (new feature) +- creation avec nombre de choix <=0 (KO) (TODO : pffff quand on veut voter on a un message Le nombre de choix maximal est de -5....) +- TODO Par défaut mettre au moins 1 + +- TODO Quand on déchoche alors il faut desactiver les champs concernés (et pas uniquement les cacher) + +Création d'un sondage (free + date) +----------------------------------- + +- creation avec aucun choix proposé (KO) +- creation avec deux choix identiques (KO) +- creation d'un sondage de Date avec mauvais format (KO) + +Création d'un sondage (free + image) +------------------------------------ + +- creation avec aucun choix proposé (KO) +- creation d'un sondage d'Image avec mauvais mimetype (KO) (TODO) +- creation avec deux images au nom identiques (KO) (TODO) +- TODO Mettre une image avec une croix ROUGE!!! quand pas chargée + +Création d'un sondage (restreint + text) +---------------------------------------- + +- création sans participant (KO) +- création avec deux participants ayant le même nom (KO) +- création avec deux participants ayant le même email (KO) +- création avec un participants ayant juste un email et pas de nom (KO) (TODO : pollenTechincalException) +- création avec un participants ayant juste un nom et pas d'email (KO) +- TODO problème d'enregistrement des plusieurs votants, le dernier est conservé et dupliqué. +- TODO L'email envoyé n'est pas le bon (il manque le token d'account) + la sécurité ne va pas car je ne dois pas avoir accès à ce sondage + +Création d'un sondage (group + text) +---------------------------------------- + +- création sans nom de groupe (KO) +- création avec deux participants ayant le même nom (KO) +- création avec deux participants ayant le même email (KO) +- création avec un participants ayant juste un email et pas de nom (KO) (TODO : pollenTechincalException) +- création avec un participants ayant juste un nom et pas d'email (KO) +- TODO problème d'enregistrement des plusieurs votants, le dernier est conservé et dupliqué. +- TODO Revoir l'enregistrement (le groupe 2 est perdu...) + + +Edition d'un sondage +--------------------- + +- edition avec champs titre vidé (OK) +- edition avec modification date de fin antérieure à maintenant (KO) +- edition avec suppression de tous les choix (KO) + +Page de résumé d'un sondage +--------------------------- + +- TODO supprimer les // dans les urls + Property changes on: trunk/src/site/rst/tests.rst ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/src/site/site_en.xml =================================================================== --- trunk/src/site/site_en.xml 2012-06-15 14:45:42 UTC (rev 3479) +++ trunk/src/site/site_en.xml 2012-06-15 15:09:26 UTC (rev 3480) @@ -103,6 +103,11 @@ <item name="English" href="index.html"/> </menu> + <menu name="Technical"> + <item name="Security" href="security.html"/> + <item name="UI Tests" href="tests.html"/> + </menu> + <menu ref="reports"/> <footer>
participants (1)
-
tchemit@users.chorem.org