Add pretend authenticated API for govuk-alerts

We can define the API properly in future work. I've used a separate
blueprint from "broadcasts" since this API is purely internal, and
it's helpful to make it clear it's specific to govuk-alerts.
This commit is contained in:
Ben Thorner
2021-07-29 12:25:28 +01:00
parent 3e32fc99b8
commit 4b7ad89f6a
6 changed files with 45 additions and 2 deletions

View File

@@ -271,10 +271,16 @@ def register_blueprint(application):
def register_v2_blueprints(application):
from app.authentication.auth import requires_auth
from app.authentication.auth import (
requires_auth,
requires_govuk_alerts_auth,
)
from app.v2.broadcast.post_broadcast import (
v2_broadcast_blueprint as post_broadcast,
)
from app.v2.govuk_alerts.get_broadcasts import (
v2_govuk_alerts_blueprint as get_broadcasts,
)
from app.v2.inbound_sms.get_inbound_sms import (
v2_inbound_sms_blueprint as get_inbound_sms,
)
@@ -315,6 +321,9 @@ def register_v2_blueprints(application):
post_broadcast.before_request(requires_auth)
application.register_blueprint(post_broadcast)
get_broadcasts.before_request(requires_govuk_alerts_auth)
application.register_blueprint(get_broadcasts)
def init_app(app):