示例#1
0
文件: combined.py 项目: kaydoh/h
    def __init__(self, proxy_auth=False):
        """
        Initialise a security policy.

        :param proxy_auth: Replace the default `CookiePolicy` for the UI with
            the `RemoteUserPolicy`.
        """
        self._bearer_token_policy = BearerTokenPolicy()
        self._http_basic_auth_policy = AuthClientPolicy()
        self._identity_cache = RequestLocalCache(self._load_identity)

        self._ui_policy = RemoteUserPolicy() if proxy_auth else CookiePolicy()
示例#2
0
 def __init__(self, secret):
     self.authtkt = AuthTktCookieHelper(secret)
     self.identity_cache = RequestLocalCache(self.load_identity)
示例#3
0
    def _makeOne(self, *args, **kwargs):
        from pyramid.request import RequestLocalCache

        return RequestLocalCache(*args, **kwargs)
示例#4
0
 def __init__(self):
     self._identity_cache = RequestLocalCache(self._load_identity)