summaryrefslogtreecommitdiff
path: root/docs/tutorials/wiki
diff options
context:
space:
mode:
Diffstat (limited to 'docs/tutorials/wiki')
-rw-r--r--docs/tutorials/wiki/authorization.rst2
-rw-r--r--docs/tutorials/wiki/src/authorization/tutorial/security.py6
-rw-r--r--docs/tutorials/wiki/src/tests/tutorial/security.py6
3 files changed, 7 insertions, 7 deletions
diff --git a/docs/tutorials/wiki/authorization.rst b/docs/tutorials/wiki/authorization.rst
index 3c9913d8c..9c685639d 100644
--- a/docs/tutorials/wiki/authorization.rst
+++ b/docs/tutorials/wiki/authorization.rst
@@ -88,7 +88,7 @@ The security policy controls several aspects of authentication and authorization
Identifying logged-in users
~~~~~~~~~~~~~~~~~~~~~~~~~~~
-The ``MySecurityPolicy.authenticated_identity`` method inspects the ``request`` and determines if it came from an authenticated user.
+The ``MySecurityPolicy.identity`` method inspects the ``request`` and determines if it came from an authenticated user.
It does this by utilizing the :class:`pyramid.authentication.AuthTktCookieHelper` class which stores the :term:`identity` in a cryptographically-signed cookie.
If a ``request`` does contain an identity, then we perform a final check to determine if the user is valid in our current ``USERS`` store.
diff --git a/docs/tutorials/wiki/src/authorization/tutorial/security.py b/docs/tutorials/wiki/src/authorization/tutorial/security.py
index f4445578e..6c091b4a6 100644
--- a/docs/tutorials/wiki/src/authorization/tutorial/security.py
+++ b/docs/tutorials/wiki/src/authorization/tutorial/security.py
@@ -28,13 +28,13 @@ class MySecurityPolicy:
self.authtkt = AuthTktCookieHelper(secret)
self.acl = ACLHelper()
- def authenticated_identity(self, request):
+ def identity(self, request):
identity = self.authtkt.identify(request)
if identity is not None and identity['userid'] in USERS:
return identity
def authenticated_userid(self, request):
- identity = self.authenticated_identity(request)
+ identity = self.identity(request)
if identity is not None:
return identity['userid']
@@ -50,7 +50,7 @@ class MySecurityPolicy:
def effective_principals(self, request):
principals = [Everyone]
- identity = self.authenticated_identity(request)
+ identity = self.identity(request)
if identity is not None:
principals.append(Authenticated)
principals.append('u:' + identity['userid'])
diff --git a/docs/tutorials/wiki/src/tests/tutorial/security.py b/docs/tutorials/wiki/src/tests/tutorial/security.py
index f4445578e..6c091b4a6 100644
--- a/docs/tutorials/wiki/src/tests/tutorial/security.py
+++ b/docs/tutorials/wiki/src/tests/tutorial/security.py
@@ -28,13 +28,13 @@ class MySecurityPolicy:
self.authtkt = AuthTktCookieHelper(secret)
self.acl = ACLHelper()
- def authenticated_identity(self, request):
+ def identity(self, request):
identity = self.authtkt.identify(request)
if identity is not None and identity['userid'] in USERS:
return identity
def authenticated_userid(self, request):
- identity = self.authenticated_identity(request)
+ identity = self.identity(request)
if identity is not None:
return identity['userid']
@@ -50,7 +50,7 @@ class MySecurityPolicy:
def effective_principals(self, request):
principals = [Everyone]
- identity = self.authenticated_identity(request)
+ identity = self.identity(request)
if identity is not None:
principals.append(Authenticated)
principals.append('u:' + identity['userid'])