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()
def __init__(self, secret): self.authtkt = AuthTktCookieHelper(secret) self.identity_cache = RequestLocalCache(self.load_identity)
def _makeOne(self, *args, **kwargs): from pyramid.request import RequestLocalCache return RequestLocalCache(*args, **kwargs)
def __init__(self): self._identity_cache = RequestLocalCache(self._load_identity)