what is api-paste.ini file in openstack
Asked Answered
C

1

7

I've seen api-paste.ini as a conf file after installing openstack. It looks like substituting some prefixes for python implementation but have no clue about this. Here, my questions are:

What script is it? it looks like very bizarre grammar like the following:

[composite:metadata]
use = egg:Paste#urlmap
/: meta

How does it work within python script?

Corn answered 23/9, 2013 at 5:32 Comment(0)
B
11

See documentation for Paste Deploy.

The api-paste.ini is the configuration for the above web-services framework. Paste.deploy allows you to separate concerns between writing your application and middleware/filters from the composition of them into a web service. You define you WSGI applications and any middleware filters in the configuration file then you can compose pipelines which include the middleware/filters you want into your web-service, e.g. authentication, rate-limiting, etc.
You want to temporarily remove authentication, take it out of your pipeline and restart your web service. The declaration above is declaring a composite application, but with only one application binding (a bit unnecessary - normally you would expect to see more than one binding, e.g. for different versions of the application). The WSGI application app:meta will be bound to / and you should have a declaration of app:meta later in the file. The implementation of the composite app is declared via the use and the egg:Paste#urlmap is a simple reference implementation.
You load this in your program with paste.deploy.loadwsgi.loadapp(). There is a proposal/recommendation(?) to move away from Paste Deploy/WebOb to WSME/Pecan see OpenStack Common WSGI
Buckling answered 23/9, 2013 at 15:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.