enforce license across registry blueprints

This commit is contained in:
Jimmy Zelinskie 2016-10-10 16:23:42 -04:00 committed by Joseph Schorr
parent 8fe29c5b89
commit 0c5400b7d1
8 changed files with 118 additions and 39 deletions

View file

@ -1,14 +1,16 @@
from flask import Blueprint, make_response
from app import metric_queue
from app import metric_queue, license_validator
from endpoints.decorators import anon_protect, anon_allowed
from util.license import enforce_license_before_request
from util.metrics.metricqueue import time_blueprint
v1_bp = Blueprint('v1', __name__)
enforce_license_before_request(license_validator, v1_bp)
time_blueprint(v1_bp, metric_queue)
# Note: This is *not* part of the Docker index spec. This is here for our own health check,
# since we have nginx handle the _ping below.
@v1_bp.route('/_internal_ping')
@ -29,4 +31,4 @@ def ping():
from endpoints.v1 import index
from endpoints.v1 import registry
from endpoints.v1 import tag
from endpoints.v1 import tag