only check api keys on selected resources
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
from flask import Flask, jsonify, Response, request
|
||||
from api.extensions import db, esales
|
||||
from api.helpers import check_api_key
|
||||
from api.validators import ValidationError
|
||||
|
||||
|
||||
@@ -32,7 +31,4 @@ def create_app(config_name='config'):
|
||||
app.register_blueprint(categories.mod)
|
||||
app.register_blueprint(prices.mod)
|
||||
|
||||
# authentication
|
||||
app.before_request(check_api_key)
|
||||
|
||||
return app
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
from flask import Blueprint, request, jsonify
|
||||
from api import db, tasks
|
||||
from api.models import Category
|
||||
from api.helpers import pagination_to_dict
|
||||
from api.helpers import pagination_to_dict, check_api_key
|
||||
|
||||
mod = Blueprint('categories', __name__, url_prefix='/categories')
|
||||
|
||||
mod.before_request(check_api_key)
|
||||
|
||||
|
||||
@mod.route("/", methods=["GET"])
|
||||
def list():
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
from flask import Blueprint, request, jsonify
|
||||
from api import db, tasks
|
||||
from api.models import Designer
|
||||
from api.helpers import pagination_to_dict
|
||||
from api.helpers import pagination_to_dict, check_api_key
|
||||
from api.validators import validate_jsonschema
|
||||
|
||||
|
||||
mod = Blueprint('designers', __name__, url_prefix='/designers')
|
||||
|
||||
mod.before_request(check_api_key)
|
||||
|
||||
create_designer_schema = {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from flask import Blueprint, request, jsonify, abort
|
||||
from api.helpers import check_api_key
|
||||
from api.validators import validate_territory, validate_number, validate_exists
|
||||
from api.models.product import Material
|
||||
from api.models.contract_customer import ContractCustomer
|
||||
@@ -9,6 +10,8 @@ from api.lib.limits import calculate_canvas_limits
|
||||
|
||||
mod = Blueprint('prices', __name__, url_prefix='/prices')
|
||||
|
||||
mod.before_request(check_api_key)
|
||||
|
||||
|
||||
def get_reseller():
|
||||
dealerurl = request.args.get('dealerurl')
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from flask import Blueprint, jsonify
|
||||
from flask import Blueprint, jsonify, url_for
|
||||
|
||||
mod = Blueprint('server', __name__)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user