Paste has been under development for a while, and has lots of code in it.

The code is largely decoupled except for some core functions shared by many parts of the code.

Those core functions are largely replaced in WebOb, and replaced with better implementations.

The future of these pieces is to split them into independent packages, and refactor the internal Paste dependencies to rely instead on WebOb.

paste.httpserver

# Use paste httpserver
from paste import httpserver
httpserver.serve(application, host='127.0.0.1', port=8000)

paste.deploy

murano-paste.ini is as follows.

[pipeline:murano]
pipeline = versionnegotiation faultwrap authtoken context rootapp [filter:context]
paste.filter_factory = murano.api.middleware.context:ContextMiddleware.factory #For more information see Auth-Token Middleware with Username and Password
#http://docs.openstack.org/developer/keystone/configuringservices.html
[filter:authtoken]
paste.filter_factory = keystonemiddleware.auth_token:filter_factory [composite:rootapp]
use = egg:Paste#urlmap
/: apiversions
/v1: apiv1app [app:apiversions]
paste.app_factory = murano.api.versions:create_resource [app:apiv1app]
paste.app_factory = murano.api.v1.router:API.factory [filter:versionnegotiation]
paste.filter_factory = murano.api.middleware.version_negotiation:VersionNegotiationFilter.factory [filter:faultwrap]
paste.filter_factory = murano.api.middleware.fault:FaultWrapper.factory

(1) pipeline

[pipeline:murano]

pipeline = versionnegotiation faultwrap authtoken context rootapp

pipeline is used when you need apply a number of filters.

It takes one configuration key pipeline (plus any global configuration overrides you want).

pipeline is a list of filters ended by an application.

These filters are defined by the ini file.

rootapp is a Murano application.

(2) filter_factory

Filters are callables that take a WSGI application as the only argument, and return a “filtered” version of that application.

[filter:authtoken]

paste.filter_factory = keystonemiddleware.auth_token:filter_factory

For example, authtoken filter is implemented by keystonemiddleware.auth_token:filter_factory function.

Before visiting the Murano Application interface, filter_factory function will call the keystone client to check the user or tenant authorization.

(3) composite

[composite:rootapp]

use = egg:Paste#urlmap

/: apiversions

/v1: apiv1app

The default site directory is implemented by apiversions app.

The /v1 directory is implemented by apiv1app app.

(4) app_factory

[app:apiv1app]

paste.app_factory = murano.api.v1.router:API.factory

The application is the most common. You define one like:

def app_factory(global_config, **local_conf):
return wsgi_app

The global_config is a dictionary, and local configuration is passed as keyword arguments.

The function returns a WSGI application.

apiv1app is implemented by murano.api.v1.router:API.factory function.

WSGI学习系列Paste的更多相关文章

  1. WSGI学习系列多种方式创建WebServer

    def application(environ, start_response): start_response('200 OK', [('Content-Type', 'text/html')]) ...

  2. WSGI学习系列WebOb

    1. WSGI Server <-----> WSGI Middleware<-----> WSGI Application  1.1 WSGI Server wsgi ser ...

  3. WSGI学习系列WSME

    Introduction Web Services Made Easy (WSME) simplifies the writing of REST web services by providing ...

  4. WSGI学习系列eventlet.wsgi

    WSGI是Web Service Gateway Interface的缩写. WSGI标准在PEP(Python Enhancement Proposal)中定义并被许多框架实现,其中包括现广泛使用的 ...

  5. WSGI学习系列Pecan

    Pecan Introduce Pecan是一个轻量级的基于Python的Web框架, Pecan的目标并不是要成为一个“full stack”的框架, 因此Pecan本身不支持类似Session和D ...

  6. Docker学习系列(一):windows下安装docker(转载)

    本文目录如下: windows按照docker的基本要求 具体安装步骤 开始使用 安装远程连接工具连接docker 安装中遇到的问题 Docker的更新 Docker中的jupyter windows ...

  7. 分布式学习系列【dubbo入门实践】

    分布式学习系列[dubbo入门实践] dubbo架构 组成部分:provider,consumer,registry,monitor: provider,consumer注册,订阅类似于消息队列的注册 ...

  8. Entity Framework Code First学习系列目录

    Entity Framework Code First学习系列说明:开发环境为Visual Studio 2010 + Entity Framework 5.0+MS SQL Server 2012, ...

  9. WCF学习系列汇总

    最近在学习WCF,打算把一整个系列的文章都”写“出来,包括理论和实践,这里的“写”是翻译,是国外的大牛写好的,我只是搬运工外加翻译.翻译的不好,大家请指正,谢谢了.如果觉得不错的话,也可以给我点赞,这 ...

随机推荐

  1. HDU 2102 A计划 (BFS或DFS)

    题意:中文题. 析:是一个简单的搜索,BFS 和 DFS都可行, 主要是这个题有一个坑点,那就是如果有一层是#,另一个层是#或者*,都是过不去的,就可以直接跳过, 剩下的就是一个简单的搜索,只不过是两 ...

  2. How a web page loads

    The major web browsers load web pages in basically the same way. This process is known as parsing an ...

  3. vimrc配置-新建文件时自动生成文件头

    vimrc配置-新建文件时自动生成文件头    auto add file header autocmd BufNewFile *.py 0r /home/zxkletters/.vim/vim_te ...

  4. FileStream流读取

    using (FileStream fread = new FileStream(@"C:\Users\kyp10\Desktop\1.复.avi", FileMode.OpenO ...

  5. Powershell Deploy Service Fabric Application To Local Cluster

    之前写过一篇用 Powershell 部署 Service Fabric Application 到本地集群的随笔,感觉过程有点复杂,这次将流程简化,只需要将应用程序打包,加上配置文件就可以了.   ...

  6. Dubbo接口测试方法及步骤

    1)打开soapUI,点击File--New project: 2)右键New REST service from URL,注:因为dubbo接口不像http接口一样有URL,所以这里的URL可以随便 ...

  7. [Windows] 程序生成出现语法错误: 意外的令牌“标识符”,预期的令牌为“类型说明符”

    程序生成出现语法错误: 意外的令牌“标识符”,预期的令牌为“类型说明符” 将平台工具集改为VS 2015 (v140) ,重新编译即可

  8. Python中的map_reduce

      原教程地址: map/reduce-廖雪峰   将数值型字符串转换成数值,解释map, reduce的使用: #!/usr/bin/env python #-*- coding:utf-8 -*- ...

  9. Iterator 遍历器

    1.遍历器(Iterator)是一种接口,为各种不同的数据结构提供统一的访问机制.任何数据结构只要部署Iterator接口,就可以完成遍历操作(即依次处理该数据结构的所有成员). 2.Iterator ...

  10. 【图灵学院01】Java程序员开发效率工具IntelliJ IDEA使用

    1. 什么是IDEA? IDEA, Java智能IDE. 2. 为什么要使用? IDEA的优点: 1)智能选取 2)导航模式 3)历史记录 4)重构 5)编码辅助 6)智能排版,控制 7)智能代码,查 ...