metosin/ring-swagger — pull request #25 by si14 (2014-12-25 14:08:53+00:00)
Title: Enable Swagger's OAuth2 support

This PR is a part of a changeset (I'll send PRs to `ring-swagger-ui` and `fnhouse-swagger` in a minute) that is required to support OAuth2-protected API.

OAuth2 is supported in Swagger-UI and Swagger Spec, but `ring-swagger` doesn't emit auth specs now. They should be emitted in three ways:

* `authorizations` field in API spec that contains endpoint specification as well as auth scopes specification. This one can be provided in `parameters` argument to `ring.swagger.core/api-listing`;
* `authorizations` field on particular endpoint that specifies which scopes are required to access the endpoint. This one is passed through `metadata` map of particular route;
* finally, Swagger UI needs OAuth2 parameters (client id, realm and app name), so those are accepted as parameters of `ring.swagger.ui/swagger-ui`.