ppss-auth 0.6.4__tar.gz → 0.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. {ppss_auth-0.6.4 → var/www/vhosts/pyramid.localhost.me/app/venv/lib/python2.7/site-packages}/ppss_auth/__init__.py +4 -4
  2. var/www/vhosts/pyramid.localhost.me/app/venv/lib/python2.7/site-packages/ppss_auth/__init__.pyc +0 -0
  3. {ppss_auth-0.6.4 → var/www/vhosts/pyramid.localhost.me/app/venv/lib/python2.7/site-packages}/ppss_auth/constants.py +2 -0
  4. var/www/vhosts/pyramid.localhost.me/app/venv/lib/python2.7/site-packages/ppss_auth/constants.pyc +0 -0
  5. {ppss_auth-0.6.4 → var/www/vhosts/pyramid.localhost.me/app/venv/lib/python2.7/site-packages}/ppss_auth/models.py +19 -4
  6. var/www/vhosts/pyramid.localhost.me/app/venv/lib/python2.7/site-packages/ppss_auth/models.pyc +0 -0
  7. var/www/vhosts/pyramid.localhost.me/app/venv/lib/python2.7/site-packages/ppss_auth/ppss_auth_utils/__init__.py +1 -0
  8. var/www/vhosts/pyramid.localhost.me/app/venv/lib/python2.7/site-packages/ppss_auth/ppss_auth_utils/__init__.pyc +0 -0
  9. var/www/vhosts/pyramid.localhost.me/app/venv/lib/python2.7/site-packages/ppss_auth/ppss_auth_utils/password.pyc +0 -0
  10. {ppss_auth-0.6.4 → var/www/vhosts/pyramid.localhost.me/app/venv/lib/python2.7/site-packages}/ppss_auth/routes.py +2 -2
  11. var/www/vhosts/pyramid.localhost.me/app/venv/lib/python2.7/site-packages/ppss_auth/routes.pyc +0 -0
  12. var/www/vhosts/pyramid.localhost.me/app/venv/lib/python2.7/site-packages/ppss_auth/templates/layout.mako +9 -0
  13. {ppss_auth-0.6.4 → var/www/vhosts/pyramid.localhost.me/app/venv/lib/python2.7/site-packages}/ppss_auth/templates/layouts/masterlayout.mako +1 -1
  14. var/www/vhosts/pyramid.localhost.me/app/venv/lib/python2.7/site-packages/ppss_auth/views/__init__.pyc +0 -0
  15. {ppss_auth-0.6.4 → var/www/vhosts/pyramid.localhost.me/app/venv/lib/python2.7/site-packages}/ppss_auth/views/auth.py +4 -3
  16. var/www/vhosts/pyramid.localhost.me/app/venv/lib/python2.7/site-packages/ppss_auth/views/auth.pyc +0 -0
  17. {ppss_auth-0.6.4/ppss_auth.egg-info → var/www/vhosts/pyramid.localhost.me/app/venv/lib/python2.7/site-packages/ppss_auth-0.7-py2.7.egg-info}/PKG-INFO +15 -2
  18. ppss_auth-0.6.4/MANIFEST.in +0 -2
  19. ppss_auth-0.6.4/PKG-INFO +0 -118
  20. ppss_auth-0.6.4/README.md +0 -102
  21. ppss_auth-0.6.4/changelog.txt +0 -2
  22. ppss_auth-0.6.4/ppss_auth/ppss_auth_utils/__init__.py +0 -1
  23. ppss_auth-0.6.4/setup.cfg +0 -4
  24. ppss_auth-0.6.4/setup.py +0 -32
  25. {ppss_auth-0.6.4 → var/www/vhosts/pyramid.localhost.me/app/venv/lib/python2.7/site-packages}/ppss_auth/ppss_auth_static/loader.js +0 -0
  26. {ppss_auth-0.6.4 → var/www/vhosts/pyramid.localhost.me/app/venv/lib/python2.7/site-packages}/ppss_auth/ppss_auth_static/ppssauth.css +0 -0
  27. {ppss_auth-0.6.4 → var/www/vhosts/pyramid.localhost.me/app/venv/lib/python2.7/site-packages}/ppss_auth/ppss_auth_static/ppssauth.js +0 -0
  28. {ppss_auth-0.6.4 → var/www/vhosts/pyramid.localhost.me/app/venv/lib/python2.7/site-packages}/ppss_auth/ppss_auth_static/template.html +0 -0
  29. {ppss_auth-0.6.4 → var/www/vhosts/pyramid.localhost.me/app/venv/lib/python2.7/site-packages}/ppss_auth/ppss_auth_utils/password.py +0 -0
  30. {ppss_auth-0.6.4 → var/www/vhosts/pyramid.localhost.me/app/venv/lib/python2.7/site-packages}/ppss_auth/templates/change.mako +0 -0
  31. {ppss_auth-0.6.4 → var/www/vhosts/pyramid.localhost.me/app/venv/lib/python2.7/site-packages}/ppss_auth/templates/editgroup.mako +0 -0
  32. {ppss_auth-0.6.4 → var/www/vhosts/pyramid.localhost.me/app/venv/lib/python2.7/site-packages}/ppss_auth/templates/editperm.mako +0 -0
  33. {ppss_auth-0.6.4 → var/www/vhosts/pyramid.localhost.me/app/venv/lib/python2.7/site-packages}/ppss_auth/templates/edituser.mako +0 -0
  34. {ppss_auth-0.6.4 → var/www/vhosts/pyramid.localhost.me/app/venv/lib/python2.7/site-packages}/ppss_auth/templates/layouts/midlayout.mako +0 -0
  35. {ppss_auth-0.6.4 → var/www/vhosts/pyramid.localhost.me/app/venv/lib/python2.7/site-packages}/ppss_auth/templates/layouts/public.mako +0 -0
  36. {ppss_auth-0.6.4 → var/www/vhosts/pyramid.localhost.me/app/venv/lib/python2.7/site-packages}/ppss_auth/templates/listgroup.mako +0 -0
  37. {ppss_auth-0.6.4 → var/www/vhosts/pyramid.localhost.me/app/venv/lib/python2.7/site-packages}/ppss_auth/templates/listperm.mako +0 -0
  38. {ppss_auth-0.6.4 → var/www/vhosts/pyramid.localhost.me/app/venv/lib/python2.7/site-packages}/ppss_auth/templates/listuser.mako +0 -0
  39. {ppss_auth-0.6.4 → var/www/vhosts/pyramid.localhost.me/app/venv/lib/python2.7/site-packages}/ppss_auth/templates/login.mako +0 -0
  40. {ppss_auth-0.6.4 → var/www/vhosts/pyramid.localhost.me/app/venv/lib/python2.7/site-packages}/ppss_auth/views/__init__.py +0 -0
  41. {ppss_auth-0.6.4/ppss_auth.egg-info → var/www/vhosts/pyramid.localhost.me/app/venv/lib/python2.7/site-packages/ppss_auth-0.7-py2.7.egg-info}/SOURCES.txt +0 -0
  42. {ppss_auth-0.6.4/ppss_auth.egg-info → var/www/vhosts/pyramid.localhost.me/app/venv/lib/python2.7/site-packages/ppss_auth-0.7-py2.7.egg-info}/dependency_links.txt +0 -0
  43. {ppss_auth-0.6.4/ppss_auth.egg-info → var/www/vhosts/pyramid.localhost.me/app/venv/lib/python2.7/site-packages/ppss_auth-0.7-py2.7.egg-info}/top_level.txt +0 -0
@@ -8,8 +8,8 @@ import zope.sqlalchemy
8
8
 
9
9
  from pyramid.authorization import ACLAuthorizationPolicy
10
10
  from pyramid.authentication import SessionAuthenticationPolicy
11
- from constants import Conf
12
- from models import initdb,PPSsuser
11
+ from .constants import Conf
12
+ from .models import initdb,PPSsuser
13
13
  from .routes import configRoutes
14
14
 
15
15
 
@@ -50,12 +50,12 @@ def includeme(config):
50
50
  #ppssauthpolicy = PPSSAuthenticationPolicy(config.get_settings())
51
51
  settings = config.get_settings()
52
52
  Conf.setup(settings)
53
- config.add_request_method(getLoggedUser,'loggeduser','loggeduser',reify=True)
53
+ config.add_request_method(getLoggedUser,'loggeduser',reify=True)
54
54
  initAuthDb(settings)
55
55
 
56
56
  configRoutes(config,Conf)
57
57
 
58
- from views.auth import getPrincipals,ACLRoot
58
+ from .views.auth import getPrincipals,ACLRoot
59
59
  authz_policy = ACLAuthorizationPolicy()
60
60
  config.set_authentication_policy(SessionAuthenticationPolicy(callback=getPrincipals) )
61
61
  config.set_authorization_policy(ACLAuthorizationPolicy())
@@ -46,6 +46,8 @@ class Conf():
46
46
  cls.sectiontemplateinherit = settings.get("ppss_auth.sectiontemplateinherit","ppss_auth:/templates/layouts/midlayout.mako")
47
47
 
48
48
 
49
+ cls.testurl = settings.get("ppss_auth.testurl","/test")
50
+
49
51
 
50
52
 
51
53
 
@@ -28,7 +28,7 @@ import logging,uuid,hashlib
28
28
  metadata = MetaData(naming_convention=NAMING_CONVENTION)
29
29
  Base = declarative_base(metadata=metadata)
30
30
 
31
- from constants import Conf
31
+ from .constants import Conf
32
32
 
33
33
 
34
34
  l = logging.getLogger('ppssauth.models')
@@ -117,7 +117,7 @@ class PPSsuser(Base,commonTable):
117
117
 
118
118
  @classmethod
119
119
  def checkLogin(cls,user,password,dbsession):
120
- s = hashlib.sha512(password)
120
+ s = hashlib.sha512(password.encode('utf-8'))
121
121
  res = dbsession.query(cls).filter(cls.username==user).filter(cls.password==s.hexdigest()).all()
122
122
  return res[0] if len(res)==1 else None
123
123
 
@@ -130,10 +130,25 @@ class PPSsuser(Base,commonTable):
130
130
  return { "id": self.id, "username":self.username,"enabled":self.enabled}
131
131
 
132
132
  def setPassword(self,password):
133
- s = hashlib.sha512(password)
133
+ s = hashlib.sha512(password.encode('utf-8'))
134
134
  self.password=s.hexdigest()
135
135
  return self
136
136
 
137
+ def getPermissions(self):
138
+ result = set()
139
+ for g in self.groups:
140
+ if g.enabled:
141
+ for p in g.permissions:
142
+ result.add( (p.id, p.name) )
143
+ return result
144
+ # return set([p.name for p in [g.permissions for g in self.groups if g.enabled]] )
145
+
146
+ def isSuperUser(self):
147
+ for p in self.getPermissions():
148
+ if p[0]==1:
149
+ return True
150
+ return False
151
+
137
152
  def __unicode__(self):
138
153
  return u"<PPSsuser ({id}-{name},{enabled})>".format(id=self.id,name=self.username, enabled=self.enabled)
139
154
 
@@ -144,7 +159,7 @@ class PPSspasswordhistory(Base):
144
159
  __tablename__ = 'ppss_passwordhistory'
145
160
  id = Column(Integer, primary_key=True)
146
161
  user_id = Column(Integer, ForeignKey('ppss_user.id'))
147
- insertdt = Column(DateTime,default=datetime.now)
162
+ insertdt = Column(DateTime,default=datetime.now)
148
163
  password = Column(Unicode(1024))
149
164
 
150
165
  user = relationship("PPSsuser", backref=backref('passowrdhistory',order_by="PPSspasswordhistory.id"))
@@ -2,7 +2,7 @@ import logging
2
2
  l = logging.getLogger('ppssauth')
3
3
 
4
4
  def configRoutes(config,Conf):
5
- from views.auth import AuthController
5
+ from .views.auth import AuthController
6
6
 
7
7
  config.include("pyramid_beaker")
8
8
  config.add_static_view( name='ppss_auth_static', path='ppss_auth_static', cache_max_age=3600)
@@ -33,7 +33,7 @@ def configRoutes(config,Conf):
33
33
  config.add_route('ppss:user:remove', '/user/remove/{userid}/{groupid}')
34
34
  config.add_route('ppss:user:checkpassword', '/user/checkpassword/{userid}')
35
35
 
36
-
36
+ config.add_route('test:test',Conf.testurl)
37
37
 
38
38
  ########views
39
39
 
@@ -0,0 +1,9 @@
1
+ <html>
2
+ <head>
3
+ <title>Login page</title>
4
+ </head>
5
+ <body>
6
+ ${next.body()}
7
+ </body>
8
+
9
+ </html>
@@ -20,7 +20,7 @@
20
20
  integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU="
21
21
  crossorigin="anonymous"
22
22
  ></script>
23
- </%block%>
23
+ </%block>
24
24
 
25
25
  </head>
26
26
  <body class="ppss_auth">
@@ -307,7 +307,7 @@ class AuthController():
307
307
  def deletePerm(self):
308
308
  perm = PPSspermission.byId(int(self.request.matchdict.get('elementid',-1)))
309
309
 
310
- if perm and perm.permtype != permtype:
310
+ if perm and perm.permtype != 1:
311
311
  self.request.dbsession.delete(perm)
312
312
  res = {'res':True,'msg':"permesso cancellato"}
313
313
  else:
@@ -391,5 +391,6 @@ class AuthController():
391
391
  users = self.request.dbsession.query(PPSspermission).filter(PPSspermission.name.like(qparam)).all()
392
392
  return {'res':True,'elements':[u.todict() for u in users]}
393
393
 
394
-
395
-
394
+ @view_config(route_name='test:test',permission='listuser',renderer=Conf.logintemplate)
395
+ def testroute(self):
396
+ return {}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ppss-auth
3
- Version: 0.6.4
3
+ Version: 0.7
4
4
  Summary: simple auth scheme for pyramid, based on Mako template and sqlalchemy backend
5
5
  Home-page: http://www.pingpongstars.it
6
6
  Author: pdepmcp
@@ -26,10 +26,20 @@ Description: This package aims to give and easy pluggable module to provide auth
26
26
  config.include('ppss_auth')
27
27
  ```
28
28
 
29
+ in your models include the ppss_auth's models with this line:
30
+ ```python
31
+ from ppss_auth.models import *
32
+ ```
33
+
34
+
35
+
29
36
  ## Configure the database
30
37
  This can be a zero-db-conf module:
31
38
  run the app with _ppss_auth.initdb_ set to True (that is the default for the params, so you can even leave it blank: see configuration, below). You are done with this, unless you need more in-depth initialization (follow reading)
32
39
 
40
+
41
+ ### You want to do it yourself
42
+
33
43
  To init the Tables manually, in the initialization script (usually in *scripts/intializedb.py*), add this row:
34
44
  ```python
35
45
  from ppss_auth import (models as ppssmodels)
@@ -108,11 +118,14 @@ Description: This package aims to give and easy pluggable module to provide auth
108
118
  ### PPSspermission
109
119
 
110
120
  This class represents the permissions of the application. You can create new permissions and link them to group. You can use those permissions in the _permission_ attribute of the _view\_config_ decorator to restrict usage of some methods using ACL, or you can check it whenever needed.
121
+
111
122
  Keywords: pyramid module authentication accelerator
112
123
  Platform: UNKNOWN
113
124
  Classifier: Development Status :: 4 - Beta
114
125
  Classifier: Intended Audience :: Developers
115
126
  Classifier: Programming Language :: Python :: 2
116
127
  Classifier: Programming Language :: Python :: 2.7
117
- Requires-Python: >=2.7, <3
128
+ Classifier: Programming Language :: Python :: 3.6
129
+ Classifier: Programming Language :: Python :: 2.7
130
+ Requires-Python: >=2.7, >=3.6
118
131
  Description-Content-Type: text/markdown
@@ -1,2 +0,0 @@
1
- include *.txt *.ini *.cfg *.rst
2
- recursive-include ppss_auth *.ico *.png *.gif *.jpg *.svg *.css *.jinja2 *.pt *.txt *.mako *.js *.html *.xml
ppss_auth-0.6.4/PKG-INFO DELETED
@@ -1,118 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: ppss_auth
3
- Version: 0.6.4
4
- Summary: simple auth scheme for pyramid, based on Mako template and sqlalchemy backend
5
- Home-page: http://www.pingpongstars.it
6
- Author: pdepmcp
7
- Author-email: d.cariboni@pingpongstars.it
8
- License: MIT
9
- Description: This package aims to give and easy pluggable module to provide authentication and user maintennance in a Pyramid web application.
10
- It relies the Pyramid+SQLAlchemy+Mako stack. Implementation for other template languages is on the roadmap.
11
-
12
-
13
- # Installation and setup
14
-
15
- ## Install the package
16
- Install the package with:
17
- ```sh
18
- pip install ppss_auth
19
- ```
20
- or put ppss_auth in your app dependencies (setup.py, in the install_requires list of packages)
21
-
22
-
23
-
24
- To activate the package, in your main *\_\_init\_\_.py* file, inside the main function, add this line:
25
- ```python
26
- config.include('ppss_auth')
27
- ```
28
-
29
- ## Configure the database
30
- This can be a zero-db-conf module:
31
- run the app with _ppss_auth.initdb_ set to True (that is the default for the params, so you can even leave it blank: see configuration, below). You are done with this, unless you need more in-depth initialization (follow reading)
32
-
33
- To init the Tables manually, in the initialization script (usually in *scripts/intializedb.py*), add this row:
34
- ```python
35
- from ppss_auth import (models as ppssmodels)
36
- ```
37
-
38
- and while creating the default data (in the "with transaction.manager" block of code), use something like:
39
- ```python
40
- ppssmodels.initdb(dbsession,createdefault=False)
41
- ```
42
- This creates the tables and, if *createdefault* evaulates to True, it create a default admin/admin user with the admin permission.
43
- Please change the password to avoid secuirity issues.
44
-
45
-
46
- You can create some data as well. Refer to [models] section, below, for more info.
47
-
48
- ## Requirements
49
- When a user login, *essionauthpolicy* is used to store her informations (userid and user groups).
50
-
51
-
52
- ## ini file configuration
53
- ppss_auth use these info from the ini file:
54
-
55
- *default user*
56
- - ppss_auth.adminname - the name of a sueruser. Deafult to "admin"
57
- - ppss_auth.adminpass - the corresponding password. If not provided the admin is not allowed to log in (with the ini credentials. It may exist in database)
58
-
59
- *db stuff*
60
- - ppss_auth.initdb [True] - true/false value, tells the lib to init db automatically on first run.
61
-
62
-
63
- *routes*
64
- - ppss_auth.login_url [/login] - url for login.
65
- - ppss_auth.logout_url [/logout]- url for logout.
66
-
67
- *where to land after succesfull login/logout*
68
- - ppss_auth.post_login_follow - try to redirect the browser back to where it came from after successful login (use true case insensitive to activate it). It's useful if combined with the forbidden pattern
69
- - ppss_auth.post_login_route [home] - name of the route where to send the browser after user logged in. Ignored if ppss_auth.post_login_follow is set to true AND there is a referer to go to.
70
- - ppss_auth.post_logout_route - name of the route where to send the browser after log out. Defaults to home
71
-
72
- *templates stuff*
73
- You can override all this values and even provide a mako-free environment. This can be a litlle tricky, but there is no hard-coded dependency to mako, just the defaults.
74
-
75
- - ppss_auth.logintemplate - name of the login template. It defaults to the internal template: "ppss_auth:/templates/login.mako"
76
- - ppss_auth.changepasswordtemplate - name of the change password template. Defaults to: ppss_auth:/templates/change.mako
77
- - ppss_auth.modifyusertemplate - Defaults to: ppss_auth:/templates/modifyuser.mako
78
- - ppss_auth.listusertemplate - Defaults to: ppss_auth:/templates/listuser.mako
79
- - ppss_auth.logintemplateinherit - Defaults to: ppss_auth:/templates/layout.mako
80
-
81
-
82
-
83
-
84
- # Things to know (devs only)
85
-
86
- ## database
87
- Thi package provide the creation and usage of 3 main tables (and the other tables required for ER consistency):
88
- - ppss_user - containing basic information about the users (username, hashed password and related data )
89
- - ppss_group - user groups to allow for easier handling of user groups and permissions
90
- - ppss_permission - a list of permissions (just an id and a name)
91
-
92
- ## models
93
-
94
- ### PPSsuser
95
-
96
- This represents the user of your application.
97
- She has a _username_, a _password_ and relation to her _groups_. She also has a _enabled_ property and some timestamps (creation times, and similar times).
98
-
99
- Use the _setPassword(password)_ method on PPSsuser instances to change the password, providing the new password.
100
-
101
- _todict(self)_ is a commodity method to get a dict of the main properties.
102
-
103
- ### PPSsgroup
104
-
105
- This class represnts the groups of your users. It's a many-to-many relation: each user can belong to many groups, and each group can gather many users.
106
- Other than a _name_ and the _enabled_ flag (integer with 1 for enabled), its main user is the many-to-many relation to permissions. This means that all users in the same group share (at least) all the permissions given to the group.
107
-
108
- ### PPSspermission
109
-
110
- This class represents the permissions of the application. You can create new permissions and link them to group. You can use those permissions in the _permission_ attribute of the _view\_config_ decorator to restrict usage of some methods using ACL, or you can check it whenever needed.
111
- Keywords: pyramid module authentication accelerator
112
- Platform: UNKNOWN
113
- Classifier: Development Status :: 4 - Beta
114
- Classifier: Intended Audience :: Developers
115
- Classifier: Programming Language :: Python :: 2
116
- Classifier: Programming Language :: Python :: 2.7
117
- Requires-Python: >=2.7, <3
118
- Description-Content-Type: text/markdown
ppss_auth-0.6.4/README.md DELETED
@@ -1,102 +0,0 @@
1
- This package aims to give and easy pluggable module to provide authentication and user maintennance in a Pyramid web application.
2
- It relies the Pyramid+SQLAlchemy+Mako stack. Implementation for other template languages is on the roadmap.
3
-
4
-
5
- # Installation and setup
6
-
7
- ## Install the package
8
- Install the package with:
9
- ```sh
10
- pip install ppss_auth
11
- ```
12
- or put ppss_auth in your app dependencies (setup.py, in the install_requires list of packages)
13
-
14
-
15
-
16
- To activate the package, in your main *\_\_init\_\_.py* file, inside the main function, add this line:
17
- ```python
18
- config.include('ppss_auth')
19
- ```
20
-
21
- ## Configure the database
22
- This can be a zero-db-conf module:
23
- run the app with _ppss_auth.initdb_ set to True (that is the default for the params, so you can even leave it blank: see configuration, below). You are done with this, unless you need more in-depth initialization (follow reading)
24
-
25
- To init the Tables manually, in the initialization script (usually in *scripts/intializedb.py*), add this row:
26
- ```python
27
- from ppss_auth import (models as ppssmodels)
28
- ```
29
-
30
- and while creating the default data (in the "with transaction.manager" block of code), use something like:
31
- ```python
32
- ppssmodels.initdb(dbsession,createdefault=False)
33
- ```
34
- This creates the tables and, if *createdefault* evaulates to True, it create a default admin/admin user with the admin permission.
35
- Please change the password to avoid secuirity issues.
36
-
37
-
38
- You can create some data as well. Refer to [models] section, below, for more info.
39
-
40
- ## Requirements
41
- When a user login, *essionauthpolicy* is used to store her informations (userid and user groups).
42
-
43
-
44
- ## ini file configuration
45
- ppss_auth use these info from the ini file:
46
-
47
- *default user*
48
- - ppss_auth.adminname - the name of a sueruser. Deafult to "admin"
49
- - ppss_auth.adminpass - the corresponding password. If not provided the admin is not allowed to log in (with the ini credentials. It may exist in database)
50
-
51
- *db stuff*
52
- - ppss_auth.initdb [True] - true/false value, tells the lib to init db automatically on first run.
53
-
54
-
55
- *routes*
56
- - ppss_auth.login_url [/login] - url for login.
57
- - ppss_auth.logout_url [/logout]- url for logout.
58
-
59
- *where to land after succesfull login/logout*
60
- - ppss_auth.post_login_follow - try to redirect the browser back to where it came from after successful login (use true case insensitive to activate it). It's useful if combined with the forbidden pattern
61
- - ppss_auth.post_login_route [home] - name of the route where to send the browser after user logged in. Ignored if ppss_auth.post_login_follow is set to true AND there is a referer to go to.
62
- - ppss_auth.post_logout_route - name of the route where to send the browser after log out. Defaults to home
63
-
64
- *templates stuff*
65
- You can override all this values and even provide a mako-free environment. This can be a litlle tricky, but there is no hard-coded dependency to mako, just the defaults.
66
-
67
- - ppss_auth.logintemplate - name of the login template. It defaults to the internal template: "ppss_auth:/templates/login.mako"
68
- - ppss_auth.changepasswordtemplate - name of the change password template. Defaults to: ppss_auth:/templates/change.mako
69
- - ppss_auth.modifyusertemplate - Defaults to: ppss_auth:/templates/modifyuser.mako
70
- - ppss_auth.listusertemplate - Defaults to: ppss_auth:/templates/listuser.mako
71
- - ppss_auth.logintemplateinherit - Defaults to: ppss_auth:/templates/layout.mako
72
-
73
-
74
-
75
-
76
- # Things to know (devs only)
77
-
78
- ## database
79
- Thi package provide the creation and usage of 3 main tables (and the other tables required for ER consistency):
80
- - ppss_user - containing basic information about the users (username, hashed password and related data )
81
- - ppss_group - user groups to allow for easier handling of user groups and permissions
82
- - ppss_permission - a list of permissions (just an id and a name)
83
-
84
- ## models
85
-
86
- ### PPSsuser
87
-
88
- This represents the user of your application.
89
- She has a _username_, a _password_ and relation to her _groups_. She also has a _enabled_ property and some timestamps (creation times, and similar times).
90
-
91
- Use the _setPassword(password)_ method on PPSsuser instances to change the password, providing the new password.
92
-
93
- _todict(self)_ is a commodity method to get a dict of the main properties.
94
-
95
- ### PPSsgroup
96
-
97
- This class represnts the groups of your users. It's a many-to-many relation: each user can belong to many groups, and each group can gather many users.
98
- Other than a _name_ and the _enabled_ flag (integer with 1 for enabled), its main user is the many-to-many relation to permissions. This means that all users in the same group share (at least) all the permissions given to the group.
99
-
100
- ### PPSspermission
101
-
102
- This class represents the permissions of the application. You can create new permissions and link them to group. You can use those permissions in the _permission_ attribute of the _view\_config_ decorator to restrict usage of some methods using ACL, or you can check it whenever needed.
@@ -1,2 +0,0 @@
1
- V0.6.1
2
- Added search functionality
@@ -1 +0,0 @@
1
- from password import *
ppss_auth-0.6.4/setup.cfg DELETED
@@ -1,4 +0,0 @@
1
- [egg_info]
2
- tag_build =
3
- tag_date = 0
4
-
ppss_auth-0.6.4/setup.py DELETED
@@ -1,32 +0,0 @@
1
- from setuptools import setup,find_packages
2
-
3
-
4
- import os
5
- here = os.path.abspath(os.path.dirname(__file__))
6
- readme = open(os.path.join(here, 'README.md'), 'r').read()
7
-
8
- setup(name='ppss_auth',
9
- version='0.6.4',
10
- description='simple auth scheme for pyramid, based on Mako template and sqlalchemy backend',
11
- long_description=readme,
12
- long_description_content_type="text/markdown",
13
- author='pdepmcp',
14
- author_email='d.cariboni@pingpongstars.it',
15
- license='MIT',
16
- classifiers=[
17
- 'Development Status :: 4 - Beta',
18
- 'Intended Audience :: Developers',
19
- 'Programming Language :: Python :: 2',
20
- 'Programming Language :: Python :: 2.7',
21
- ],
22
- keywords="pyramid module authentication accelerator",
23
- python_requires='>=2.7, <3',
24
- url='http://www.pingpongstars.it',
25
-
26
- #packages=['src/test1'],
27
- packages=find_packages(),
28
- include_package_data=True,
29
-
30
- )
31
-
32
-