Title: [286074] trunk/Tools
Revision
286074
Author
[email protected]
Date
2021-11-19 13:35:00 -0800 (Fri, 19 Nov 2021)

Log Message

[resultsdbpy] Move AuthedBlueprint to webkitflaskpy
https://bugs.webkit.org/show_bug.cgi?id=233339
<rdar://problem/85571604>

Reviewed by Ryan Haddad.

* Scripts/libraries/resultsdbpy/resultsdbpy/__init__.py: Bump version.
* Scripts/libraries/resultsdbpy/resultsdbpy/controller/api_routes.py: Import
AuthedBlueprint from webkitflaskpy.
* Scripts/libraries/resultsdbpy/resultsdbpy/view/view_routes.py: Ditto.
* Scripts/libraries/resultsdbpy/setup.py: Bump version.
* Scripts/libraries/webkitflaskpy/setup.py: Ditto.
* Scripts/libraries/webkitflaskpy/webkitflaskpy/__init__.py: Bump Export object.
* Scripts/libraries/webkitflaskpy/webkitflaskpy/authed_blueprint.py: Renamed from
Tools/Scripts/libraries/resultsdbpy/resultsdbpy/flask_support/authed_blueprint.py.

Canonical link: https://commits.webkit.org/244461@main

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Tools/ChangeLog (286073 => 286074)


--- trunk/Tools/ChangeLog	2021-11-19 21:20:53 UTC (rev 286073)
+++ trunk/Tools/ChangeLog	2021-11-19 21:35:00 UTC (rev 286074)
@@ -1,3 +1,21 @@
+2021-11-18  Jonathan Bedard  <[email protected]>
+
+        [resultsdbpy] Move AuthedBlueprint to webkitflaskpy
+        https://bugs.webkit.org/show_bug.cgi?id=233339
+        <rdar://problem/85571604>
+
+        Reviewed by Ryan Haddad.
+
+        * Scripts/libraries/resultsdbpy/resultsdbpy/__init__.py: Bump version.
+        * Scripts/libraries/resultsdbpy/resultsdbpy/controller/api_routes.py: Import
+        AuthedBlueprint from webkitflaskpy.
+        * Scripts/libraries/resultsdbpy/resultsdbpy/view/view_routes.py: Ditto.
+        * Scripts/libraries/resultsdbpy/setup.py: Bump version.
+        * Scripts/libraries/webkitflaskpy/setup.py: Ditto.
+        * Scripts/libraries/webkitflaskpy/webkitflaskpy/__init__.py: Bump Export object.
+        * Scripts/libraries/webkitflaskpy/webkitflaskpy/authed_blueprint.py: Renamed from
+        Tools/Scripts/libraries/resultsdbpy/resultsdbpy/flask_support/authed_blueprint.py.
+
 2021-11-19  Brent Fulgham  <[email protected]>
 
         Add support for web app manifest icons in WebKit/UI Process layer

Modified: trunk/Tools/Scripts/libraries/resultsdbpy/resultsdbpy/__init__.py (286073 => 286074)


--- trunk/Tools/Scripts/libraries/resultsdbpy/resultsdbpy/__init__.py	2021-11-19 21:20:53 UTC (rev 286073)
+++ trunk/Tools/Scripts/libraries/resultsdbpy/resultsdbpy/__init__.py	2021-11-19 21:35:00 UTC (rev 286074)
@@ -44,7 +44,7 @@
         "Please install webkitcorepy with `pip install webkitcorepy --extra-index-url <package index URL>`"
     )
 
-version = Version(3, 1, 4)
+version = Version(3, 1, 5)
 
 import webkitflaskpy
 

Modified: trunk/Tools/Scripts/libraries/resultsdbpy/resultsdbpy/controller/api_routes.py (286073 => 286074)


--- trunk/Tools/Scripts/libraries/resultsdbpy/resultsdbpy/controller/api_routes.py	2021-11-19 21:20:53 UTC (rev 286073)
+++ trunk/Tools/Scripts/libraries/resultsdbpy/resultsdbpy/controller/api_routes.py	2021-11-19 21:35:00 UTC (rev 286074)
@@ -30,7 +30,7 @@
 from resultsdbpy.controller.suite_controller import SuiteController
 from resultsdbpy.controller.test_controller import TestController
 from resultsdbpy.controller.upload_controller import UploadController
-from resultsdbpy.flask_support.authed_blueprint import AuthedBlueprint
+from webkitflaskpy import AuthedBlueprint
 from werkzeug.exceptions import HTTPException
 
 

Deleted: trunk/Tools/Scripts/libraries/resultsdbpy/resultsdbpy/flask_support/authed_blueprint.py (286073 => 286074)


--- trunk/Tools/Scripts/libraries/resultsdbpy/resultsdbpy/flask_support/authed_blueprint.py	2021-11-19 21:20:53 UTC (rev 286073)
+++ trunk/Tools/Scripts/libraries/resultsdbpy/resultsdbpy/flask_support/authed_blueprint.py	2021-11-19 21:35:00 UTC (rev 286074)
@@ -1,34 +0,0 @@
-# Copyright (C) 2019 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer.
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS "AS IS" AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
-# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-from flask import Blueprint
-
-
-class AuthedBlueprint(Blueprint):
-    def __init__(self, name, import_name, auth_decorator=None, **kwargs):
-        super(AuthedBlueprint, self).__init__(name, import_name, **kwargs)
-        self.auth_decorator = auth_decorator
-
-    def add_url_rule(self, rule, endpoint=None, view_func=None, authed=True, **options):
-        if not self.auth_decorator or not authed:
-            return super(AuthedBlueprint, self).add_url_rule(rule, endpoint=endpoint, view_func=view_func, **options)
-        return super(AuthedBlueprint, self).add_url_rule(rule, endpoint=endpoint, view_func=self.auth_decorator(view_func), **options)

Modified: trunk/Tools/Scripts/libraries/resultsdbpy/resultsdbpy/view/view_routes.py (286073 => 286074)


--- trunk/Tools/Scripts/libraries/resultsdbpy/resultsdbpy/view/view_routes.py	2021-11-19 21:20:53 UTC (rev 286073)
+++ trunk/Tools/Scripts/libraries/resultsdbpy/resultsdbpy/view/view_routes.py	2021-11-19 21:35:00 UTC (rev 286074)
@@ -26,7 +26,6 @@
 
 from flask import abort, jsonify, send_from_directory, redirect, Response
 from jinja2 import Environment, PackageLoader, select_autoescape
-from resultsdbpy.flask_support.authed_blueprint import AuthedBlueprint
 from resultsdbpy.view.archive_view import ArchiveView
 from resultsdbpy.view.ci_view import CIView
 from resultsdbpy.view.commit_view import CommitView
@@ -33,6 +32,7 @@
 from resultsdbpy.view.site_menu import SiteMenu
 from resultsdbpy.view.suite_view import SuiteView
 from werkzeug.exceptions import HTTPException, InternalServerError
+from webkitflaskpy import AuthedBlueprint
 from webkitflaskpy.util import AssertRequest, cache_for
 
 

Modified: trunk/Tools/Scripts/libraries/resultsdbpy/setup.py (286073 => 286074)


--- trunk/Tools/Scripts/libraries/resultsdbpy/setup.py	2021-11-19 21:20:53 UTC (rev 286073)
+++ trunk/Tools/Scripts/libraries/resultsdbpy/setup.py	2021-11-19 21:35:00 UTC (rev 286074)
@@ -30,7 +30,7 @@
 
 setup(
     name='resultsdbpy',
-    version='3.1.4',
+    version='3.1.5',
     description='Library for visualizing, processing and storing test results.',
     long_description=readme(),
     classifiers=[
@@ -61,9 +61,6 @@
         'boto3',
         'cassandra-driver',
         'fakeredis',
-        'Flask',
-        'Flask-Cors',
-        'gunicorn',
         'lupa',
         'pycryptodome',
         'redis',
@@ -71,6 +68,7 @@
         'selenium',
         'webkitcorepy',
         'webkitscmpy',
+        'webkitflaskpy',
     ],
     include_package_data=True,
     zip_safe=False,

Modified: trunk/Tools/Scripts/libraries/webkitflaskpy/setup.py (286073 => 286074)


--- trunk/Tools/Scripts/libraries/webkitflaskpy/setup.py	2021-11-19 21:20:53 UTC (rev 286073)
+++ trunk/Tools/Scripts/libraries/webkitflaskpy/setup.py	2021-11-19 21:35:00 UTC (rev 286074)
@@ -30,7 +30,7 @@
 
 setup(
     name='webkitflaskpy',
-    version='0.1.2',
+    version='0.2.0',
     description='Library for visualizing, processing and storing test results.',
     long_description=readme(),
     classifiers=[

Modified: trunk/Tools/Scripts/libraries/webkitflaskpy/webkitflaskpy/__init__.py (286073 => 286074)


--- trunk/Tools/Scripts/libraries/webkitflaskpy/webkitflaskpy/__init__.py	2021-11-19 21:20:53 UTC (rev 286073)
+++ trunk/Tools/Scripts/libraries/webkitflaskpy/webkitflaskpy/__init__.py	2021-11-19 21:35:00 UTC (rev 286074)
@@ -43,8 +43,10 @@
         "Please install webkitcorepy with `pip install webkitcorepy --extra-index-url <package index URL>`"
     )
 
-version = Version(0, 1, 2)
+version = Version(0, 2, 0)
 
+from webkitflaskpy.authed_blueprint import AuthedBlueprint
+
 AutoInstall.register(Package('click', Version(7, 1, 2)))
 AutoInstall.register(Package('flask', Version(1, 1, 2)))
 AutoInstall.register(Package('itsdangerous', Version(1, 1, 0)))

Copied: trunk/Tools/Scripts/libraries/webkitflaskpy/webkitflaskpy/authed_blueprint.py (from rev 286073, trunk/Tools/Scripts/libraries/resultsdbpy/resultsdbpy/flask_support/authed_blueprint.py) (0 => 286074)


--- trunk/Tools/Scripts/libraries/webkitflaskpy/webkitflaskpy/authed_blueprint.py	                        (rev 0)
+++ trunk/Tools/Scripts/libraries/webkitflaskpy/webkitflaskpy/authed_blueprint.py	2021-11-19 21:35:00 UTC (rev 286074)
@@ -0,0 +1,34 @@
+# Copyright (C) 2019 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1.  Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+# 2.  Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in the
+#     documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from flask import Blueprint
+
+
+class AuthedBlueprint(Blueprint):
+    def __init__(self, name, import_name, auth_decorator=None, **kwargs):
+        super(AuthedBlueprint, self).__init__(name, import_name, **kwargs)
+        self.auth_decorator = auth_decorator
+
+    def add_url_rule(self, rule, endpoint=None, view_func=None, authed=True, **options):
+        if not self.auth_decorator or not authed:
+            return super(AuthedBlueprint, self).add_url_rule(rule, endpoint=endpoint, view_func=view_func, **options)
+        return super(AuthedBlueprint, self).add_url_rule(rule, endpoint=endpoint, view_func=self.auth_decorator(view_func), **options)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to