Skip to content
This repository has been archived by the owner on Dec 5, 2023. It is now read-only.

Policy Decision Point API

Alvaro Villanueva edited this page Nov 14, 2022 · 8 revisions

The Policy Decision Point also exposes a Swagger UI solution to display the aforementioned policy endpoints.

This endpoint is available on: http://<host>:<PDP NodePort>/swagger-ui/

Developer Notes

For this purpose, an existing python library in PyPI was used, flask-swagger-ui.

This library allows us to use a JSON file to build a Flask blueprint, which is then registered with the PDP Flask instance and exposed as an endpoint. JSON Template for blueprint is available here.

The blueprint can be built with his code source:

swaggerui_blueprint = get_swaggerui_blueprint(
    SWAGGER_URL,                           # Desired endpoint
    API_URL,                               # Empty since this is specified in current spec file
    config={                               # Swagger UI config overrides
        'app_name': SWAGGER_APP_NAME,      # Desired page name for endpoint
        'spec': SWAGGER_SPEC               # Loaded JSON specification
    },
)
Clone this wiki locally