コード例 #1
0
def test_product_and_app():
    """Setup & Teardown an product and app for this api"""
    product = ApigeeApiProducts()
    app = ApigeeApiDeveloperApps()
    loop = asyncio.new_event_loop()
    loop.run_until_complete(product.create_new_product())
    loop.run_until_complete(app.setup_app())
    app.oauth = OauthHelper(app.client_id, app.client_secret, app.callback_url)
    yield product, app
    loop.run_until_complete(app.destroy_app())
    loop.run_until_complete(product.destroy_product())
コード例 #2
0
def base_test_app():
    """Setup & Teardown an app-restricted app for this api"""
    app = ApigeeApiDeveloperApps()
    loop = asyncio.new_event_loop()
    loop.run_until_complete(
        app.setup_app(
            api_products=[get_env("APIGEE_PRODUCT")],
            custom_attributes=_BASE_CUSTOM_ATTRIBUTES,
        ))
    app.oauth = OauthHelper(app.client_id, app.client_secret, app.callback_url)
    yield app
    loop.run_until_complete(app.destroy_app())
コード例 #3
0
def test_app():
    """Setup & Teardown an app-restricted app for this api"""
    app = ApigeeApiDeveloperApps()
    loop = asyncio.new_event_loop()
    loop.run_until_complete(
        app.setup_app(
            api_products=[get_env("APIGEE_PRODUCT")],
            custom_attributes={
                "jwks-resource-url": "https://raw.githubusercontent.com/NHSDigital/identity-service-jwks/main/jwks/internal-dev/9baed6f4-1361-4a8e-8531-1f8426e3aba8.json"  # noqa
            },
        )
    )
    app.oauth = OauthHelper(app.client_id, app.client_secret, app.callback_url)
    yield app
    loop.run_until_complete(app.destroy_app())
コード例 #4
0
def test_product_and_app():
    """Setup & Teardown an product and app for this api"""
    product = ApigeeApiProducts()
    app = ApigeeApiDeveloperApps()
    loop = asyncio.new_event_loop()
    loop.run_until_complete(product.create_new_product())
    loop.run_until_complete(
        product.update_scopes([
            "urn:nhsd:apim:app:level3:immunisation-history",
            "urn:nhsd:apim:user-nhs-login:P9:immunisation-history",
            "urn:nhsd:apim:user-nhs-login:P5:immunisation-history"
        ]))
    loop.run_until_complete(
        app.setup_app(
            api_products=[product.name],
            custom_attributes=_BASE_CUSTOM_ATTRIBUTES,
        ))
    app.oauth = OauthHelper(app.client_id, app.client_secret, app.callback_url)
    yield product, app
    loop.run_until_complete(app.destroy_app())
    loop.run_until_complete(product.destroy_product())
コード例 #5
0
def test_product_and_app(request):
    """Setup & Teardown an product and app for this api"""
    request_params = request.param
    product = ApigeeApiProducts()
    app = ApigeeApiDeveloperApps()
    loop = asyncio.new_event_loop()
    loop.run_until_complete(product.create_new_product())
    loop.run_until_complete(product.update_scopes(
        request_params['scopes']
    ))
    loop.run_until_complete(
        app.setup_app(
            api_products=[product.name],
            custom_attributes= {
                "jwks-resource-url": "https://raw.githubusercontent.com/NHSDigital/identity-service-jwks/main/jwks/internal-dev/9baed6f4-1361-4a8e-8531-1f8426e3aba8.json",
                "nhs-login-allowed-proofing-level": request_params.get('requested_proofing_level')
            },
        )
    )
    app.oauth = OauthHelper(app.client_id, app.client_secret, app.callback_url)
    app.request_params = request_params
    yield product, app
    loop.run_until_complete(app.destroy_app())
    loop.run_until_complete(product.destroy_product())