Exemplo n.º 1
0
def establish_web(config):
    atom_init(config)
    extraclude_init(config)
    status_init(config)
    logout_init(config)
    oauth_init(config)

    if CSRFProtector not in config['server_request_filters']:
        config['server_request_filters'].append(CSRFProtector)

    selector = config['selector']
    replace_handler(selector, '/', dict(GET=home))
    selector.add('/auth/{key_name:segment}', DELETE=destroy_key)
    selector.add('/auth', GET=view_auth, POST=make_key)
    selector.add('/dash', GET=dash)
    selector.add('/register', POST=register)
    selector.add('/tanks/{bag_name:segment}[/{tiddler_name:segment}]',
            GET=wiki_page)
    selector.add('/edit', GET=editor, POST=edit)
    selector.add('/forge', POST=forge)
    selector.add('/tags', GET=list_tags)
    selector.add('/comps/{recipe_name:segment}', GET=comp)
Exemplo n.º 2
0
def establish_web(config):
    atom_init(config)
    cors_init(config)
    extraclude_init(config)
    status_init(config)
    logout_init(config)
    oauth_init(config)
    privateer_init(config)

    if CSRFProtector not in config['server_request_filters']:
        config['server_request_filters'].append(CSRFProtector)

    response_filters = config['server_response_filters']

    if PrettyError not in response_filters:
        response_filters.insert(
                response_filters.index(PermissionsExceptor) + 1,
                PrettyError)

    selector = config['selector']
    selector.status404 = raiser('404', 'path not found')
    selector.status405 = raiser('405', 'method not allow')

    replace_handler(selector, '/', dict(GET=home))
    selector.add('/auth/{key_name:segment}', DELETE=destroy_key)
    selector.add('/auth', GET=view_auth, POST=make_key)
    selector.add('/dash', GET=dash)
    selector.add('/register', POST=register)
    selector.add('/closet/{bag_name:segment}', POST=closet)
    selector.add('/tanks', GET=list_tanks)
    selector.add('/tanks/{bag_name:segment}[/{tiddler_name:segment}]',
            GET=wiki_page)
    selector.add('/edit', GET=editor, POST=edit)
    selector.add('/forge', POST=forge)
    selector.add('/tags', GET=list_tags)
    selector.add('/comps/{recipe_name:segment}', GET=comp)
    selector.add('/policymgr', GET=policymgr)
Exemplo n.º 3
0
def establish_web(config):
    atom_init(config)
    cors_init(config)
    extraclude_init(config)
    status_init(config)
    logout_init(config)
    oauth_init(config)
    privateer_init(config)

    if CSRFProtector not in config['server_request_filters']:
        config['server_request_filters'].append(CSRFProtector)

    response_filters = config['server_response_filters']

    if PrettyError not in response_filters:
        response_filters.insert(
            response_filters.index(PermissionsExceptor) + 1, PrettyError)

    selector = config['selector']
    selector.status404 = raiser('404', 'path not found')
    selector.status405 = raiser('405', 'method not allow')

    replace_handler(selector, '/', dict(GET=home))
    selector.add('/auth/{key_name:segment}', DELETE=destroy_key)
    selector.add('/auth', GET=view_auth, POST=make_key)
    selector.add('/dash', GET=dash)
    selector.add('/register', POST=register)
    selector.add('/closet/{bag_name:segment}', POST=closet)
    selector.add('/tanks', GET=list_tanks)
    selector.add('/tanks/{bag_name:segment}[/{tiddler_name:segment}]',
                 GET=wiki_page)
    selector.add('/edit', GET=editor, POST=edit)
    selector.add('/forge', POST=forge)
    selector.add('/tags', GET=list_tags)
    selector.add('/comps/{recipe_name:segment}', GET=comp)
    selector.add('/policymgr', GET=policymgr)