Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions scan_explorer_service/views/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def before_request():
manifest_factory.set_base_image_uri(image_proxy)


@advertise(scopes=['api'], rate_limit=[300, 3600*24])
@advertise(scopes=['api'], rate_limit=[5000, 3600*24])
@bp_manifest.route('/<string:id>/manifest.json', methods=['GET'])
def get_manifest(id: str):
""" Creates an IIIF manifest from an article or Collection"""
Expand Down Expand Up @@ -77,7 +77,7 @@ def get_manifest(id: str):
return jsonify(exception='Article not found'), 404


@advertise(scopes=['api'], rate_limit=[300, 3600*24])
@advertise(scopes=['api'], rate_limit=[5000, 3600*24])
@bp_manifest.route('/canvas/<string:page_id>.json', methods=['GET'])
def get_canvas(page_id: str):
""" Creates an IIIF canvas from a page"""
Expand All @@ -90,7 +90,7 @@ def get_canvas(page_id: str):
return jsonify(exception='Page not found'), 404


@advertise(scopes=['api'], rate_limit=[300, 3600*24])
@advertise(scopes=['api'], rate_limit=[5000, 3600*24])
@bp_manifest.route('/<string:id>/search', methods=['GET'])
def search(id: str):
"""Search OCR text within an article or collection, returning IIIF annotations."""
Expand Down
18 changes: 9 additions & 9 deletions scan_explorer_service/views/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
bp_metadata = Blueprint('metadata', __name__, url_prefix='/metadata')


@advertise(scopes=['api'], rate_limit=[300, 3600*24])
@advertise(scopes=['api'], rate_limit=[5000, 3600*24])
@bp_metadata.route('/article/extra/<string:bibcode>', methods=['GET'])
def article_extra(bibcode: str):
"""Route that fetches additional metadata about an article from the ADS search service """
Expand All @@ -40,7 +40,7 @@ def article_extra(bibcode: str):
return jsonify(message='Failed to retrieve external ADS article metadata'), 500
return {}

@advertise(scopes=['api'], rate_limit=[300, 3600*24])
@advertise(scopes=['api'], rate_limit=[5000, 3600*24])
@bp_metadata.route('/article/<string:bibcode>/collection', methods=['GET'])
def article_collection(bibcode: str):
"""Route that fetches collection from an article """
Expand All @@ -54,7 +54,7 @@ def article_collection(bibcode: str):
page_in_collection = first_page.volume_running_page_num
return jsonify({'id': article.collection_id, 'selected_page': page_in_collection}), 200

@advertise(scopes=['ads:scan-explorer'], rate_limit=[300, 3600*24])
@advertise(scopes=['ads:scan-explorer'], rate_limit=[5000, 3600*24])
@bp_metadata.route('/article', methods=['PUT'])
def put_article():
"""Create a new or overwrite an existing article"""
Expand All @@ -72,7 +72,7 @@ def put_article():
return jsonify(message='Invalid article json'), 400


@advertise(scopes=['ads:scan-explorer'], rate_limit=[300, 3600*24])
@advertise(scopes=['ads:scan-explorer'], rate_limit=[5000, 3600*24])
@bp_metadata.route('/collection', methods=['PUT'])
def put_collection():
""" Create a new or overwrite an existing collection """
Expand Down Expand Up @@ -142,7 +142,7 @@ def put_collection():
return jsonify(message='Invalid collection json'), 400


@advertise(scopes=['ads:scan-explorer'], rate_limit=[300, 3600*24])
@advertise(scopes=['ads:scan-explorer'], rate_limit=[5000, 3600*24])
@bp_metadata.route('/page', methods=['PUT'])
def put_page():
"""Create a new or overwrite an existing page """
Expand Down Expand Up @@ -174,7 +174,7 @@ def _make_search_cache_key(prefix, args):
return hashlib.md5(raw.encode()).hexdigest()


@advertise(scopes=['api'], rate_limit=[300, 3600*24])
@advertise(scopes=['api'], rate_limit=[5000, 3600*24])
@bp_metadata.route('/article/search', methods=['GET'])
def article_search():
"""Search for an article using one or some of the available keywords"""
Expand Down Expand Up @@ -207,7 +207,7 @@ def article_search():
return jsonify(message=str(e), type=ApiErrors.SearchError.value), 400


@advertise(scopes=['api'], rate_limit=[300, 3600*24])
@advertise(scopes=['api'], rate_limit=[5000, 3600*24])
@bp_metadata.route('/collection/search', methods=['GET'])
def collection_search():
"""Search for a collection using one or some of the available keywords"""
Expand All @@ -232,7 +232,7 @@ def collection_search():
except Exception as e:
return jsonify(message=str(e), type=ApiErrors.SearchError.value), 400

@advertise(scopes=['api'], rate_limit=[300, 3600*24])
@advertise(scopes=['api'], rate_limit=[5000, 3600*24])
@bp_metadata.route('/page/search', methods=['GET'])
def page_search():
"""Search for a page using one or some of the available keywords"""
Expand All @@ -256,7 +256,7 @@ def page_search():
except Exception as e:
return jsonify(message=str(e), type=ApiErrors.SearchError.value), 400

@advertise(scopes=['api'], rate_limit=[300, 3600*24])
@advertise(scopes=['api'], rate_limit=[5000, 3600*24])
@bp_metadata.route('/page/ocr', methods=['GET'])
def get_page_ocr():
"""Get the OCR for a page using it's parents id and page number"""
Expand Down
Loading