what is api-paste.ini file in openstack

3.8k views Asked by At

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?

1

There are 1 answers

0
AChampion On

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