def repozewho1authenticationpolicy(_context, identifier_name='auth_tkt', callback=None): policy = RepozeWho1AuthenticationPolicy(identifier_name=identifier_name, callback=callback) # authentication policies must be registered eagerly so they can # be found by the view registration machinery reg = get_current_registry() config = Configurator(reg, package=_context.package) config._set_authentication_policy(policy, _info=_context.info) _context.action(discriminator=IAuthenticationPolicy)
def remoteuserauthenticationpolicy(_context, environ_key='REMOTE_USER', callback=None): policy = RemoteUserAuthenticationPolicy(environ_key=environ_key, callback=callback) # authentication policies must be registered eagerly so they can # be found by the view registration machinery reg = get_current_registry() config = Configurator(reg, package=_context.package) config._set_authentication_policy(policy, _info=_context.info) _context.action(discriminator=IAuthenticationPolicy)
callback=callback, cookie_name=cookie_name, secure=secure, include_ip = include_ip, timeout = timeout, reissue_time = reissue_time, max_age=max_age, http_only=http_only, path=path) except ValueError, why: raise ConfigurationError(str(why)) # authentication policies must be registered eagerly so they can # be found by the view registration machinery reg = get_current_registry() config = Configurator(reg, package=_context.package) config._set_authentication_policy(policy, _info=_context.info) _context.action(discriminator=IAuthenticationPolicy) class IACLAuthorizationPolicyDirective(Interface): pass def aclauthorizationpolicy(_context): policy = ACLAuthorizationPolicy() # authorization policies must be registered eagerly so they can be # found by the view registration machinery reg = get_current_registry() config = Configurator(reg, package=_context.package) config._set_authorization_policy(policy, _info=_context.info) _context.action(discriminator=IAuthorizationPolicy) class IRendererDirective(Interface):