From e31157586ba0424fd25ceabdd989c39af5d8d5d7 Mon Sep 17 00:00:00 2001 From: Minu Mathew Date: Wed, 7 Sep 2022 13:56:58 -0500 Subject: [PATCH 01/36] 961 show appropriate error messages catalog (#972) * updated rendering error page * updated changelog * Fix CHANGELOG after merging changes from develop. Co-authored-by: Sandeep Puthanveetil Satheesan --- CHANGELOG.md | 8 +-- .../catalog/controllers/contribute.py | 58 ++++++++++++------- 2 files changed, 41 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 18277cc4..20423426 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,14 +10,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Hide sensitive data in capability view page. [#950](https://github.com/rokwire/rokwire-building-blocks-api/issues/950) - Minimum user privacy level in talent form. [#970](https://github.com/rokwire/rokwire-building-blocks-api/issues/970) -### Security -- Upgrade Swagger UI base Docker image to v4.13.2. [#991](https://github.com/rokwire/rokwire-building-blocks-api/issues/991) - ### Changed - Change to allow all group admins to manage group events. [#996](https://github.com/rokwire/rokwire-building-blocks-api/issues/996) +- Show appropriate error message when catalog cannot display a contribution. [#961](https://github.com/rokwire/rokwire-building-blocks-api/issues/961) -### Fixed - +### Security +- Upgrade Swagger UI base Docker image to v4.13.2. [#991](https://github.com/rokwire/rokwire-building-blocks-api/issues/991) ## [1.15.0] - 2022-07-11 ### Added diff --git a/contributions/catalog/controllers/contribute.py b/contributions/catalog/controllers/contribute.py index 2858c08e..2f55b47e 100644 --- a/contributions/catalog/controllers/contribute.py +++ b/contributions/catalog/controllers/contribute.py @@ -160,9 +160,17 @@ def contribution_details(contribution_id): username = session["username"] name = session["name"] headers = requestutil.get_header_using_session(session) + # check if the user is reviewer by requesting to endpoint + is_reviewer = adminutil.check_if_reviewer(username, headers) + result = requests.get(cfg.CONTRIBUTION_BUILDING_BLOCK_URL + "/" + str(contribution_id), + headers=headers) + if result.status_code != 200: + err_json = parse_response_error(result) + logging.error("Contribution GET " + json.dumps(err_json)) + msg = "Error: " + err_json['reason'] + return render_template('contribute/error.html', error_msg=msg) - the_json_res = get_contribution(contribution_id) - + the_json_res = result.json() # check if the logged in user is the editor is_superuser = adminutil.check_if_superuser(username) if is_superuser: @@ -170,13 +178,19 @@ def contribution_details(contribution_id): elif username in the_json_res["contributionAdmins"]: is_editor = True - # check if the user is reviewer by requesting to endpoint - is_reviewer = adminutil.check_if_reviewer(username, headers) else: - the_json_res = get_contribution_with_api_key(contribution_id) + headers = requestutil.get_header_using_api_key() + result = requests.get(cfg.CONTRIBUTION_BUILDING_BLOCK_URL + "/" + str(contribution_id), + headers=headers) + the_json_res = result.json() + if result.status_code != 200: + err_json = parse_response_error(result) + logging.error("Contribution GET " + json.dumps(err_json)) + msg = "Error: " + err_json['reason'] + return render_template('contribute/error.html', error_msg=msg) return render_template("contribute/contribution_details.html", is_reviewer=is_reviewer, is_editable=is_editor, - post=the_json_res, user=name) + post=the_json_res, user=name) @bp.route('/contributions//edit', methods=['GET', 'POST']) @login_required @@ -643,17 +657,21 @@ def get_contribution(contribution_id): result = requests.get(cfg.CONTRIBUTION_BUILDING_BLOCK_URL + "/" + str(contribution_id), headers=headers) - if result.status_code != 200: - err_json = parse_response_error(result) - logging.error("Contribution GET " + json.dumps(err_json)) - return {} + if result.status_code != 200: + err_json = parse_response_error(result) + logging.error("Contribution GET " + json.dumps(err_json)) + return {} + else: + print("GET ok." + str(contribution_id)) + return result.json() else: - print("GET ok.".format(contribution_id)) + logging.error("GET method fails. Incorrect contribution ID" + str(contribution_id)) + return {} except Exception: # traceback.print_exc() return False - return result.json() + def get_contribution_with_api_key(contribution_id): headers = requestutil.get_header_using_api_key() @@ -662,18 +680,18 @@ def get_contribution_with_api_key(contribution_id): if contribution_id: result = requests.get(cfg.CONTRIBUTION_BUILDING_BLOCK_URL + "/" + str(contribution_id), headers=headers) - - if result.status_code != 200: - print("GET method fails".format(contribution_id)) - print("with error code:", result.status_code) - return {} + if result.status_code != 200: + print("GET method fails" + str(contribution_id) + "with error code:" + result.status_code) + return {} + else: + print("GET ok.".format(contribution_id)) + return result.json() else: - print("GET ok.".format(contribution_id)) - + logging.error("GET method fails. Incorrect contribution ID" + str(contribution_id)) + return {} except Exception: # traceback.print_exc() return False - return result.json() def get_capability(contribution_id, cid): headers = requestutil.get_header_using_session(session) From 170e51424d898bfe9fa3b68c57233498d7620dd4 Mon Sep 17 00:00:00 2001 From: Bing Zhang Date: Wed, 7 Sep 2022 14:02:32 -0500 Subject: [PATCH 02/36] Release/1.16.0 (#1001) * Update CHANGELOG.md * Update version numbers in the OpenAPI documents. * Update CHANGELOG.md * Update CHANGELOG.md * Update version number in YAML file. * Point to production health and talent chooser API documentation in production. * Update CHANGELOG. * Update version number in OpenAPI spec files. * Update Building Block URL in Api Doc Dockerfile. * Minor update to CHANGELOG. * Fix Auth library dependencies versions to avoid breaking changes. * Update Events Building Block Dockerfile. * Update App Config Dockerfile. * Update Authentication Building Block Dockerfile. * Update Profile Building Block Dockerfile. * Update Contributions Building Block Dockerfile and requirements. * Update Contributions Catalog Dockerfile and requirements. * Update Logging Building Block Dockerfile. * Update version numbers in API specs. * Update CHANGELOG. * Update CHANGELOG.md * Update version number. * Update CHANGELOG.md * Update CHANGELOG.md * Update version numbers in OpenAPI specification. * turn off group authentication on image get endpoint * turn off group authentication on image get endpoint * Update Events Building Block logs and related configuration. * Update CHANGELOG. * Added more information to logs * changed the log's building block name * updated to use longDescription * updated changelog * Update CHANGELOG and verson numbers. * Update API Doc Dockerfile. * Fix CHANGELOG. * Fix CHANGELOG. * Update version numbers in SECURITY.md * Fix merge conflicts. * Update CHANGELOG.md * Update CHANGELOG. * Update Dockerfile. * Update version number in API spec files. * Updater version in SECURITY.md * Update CHANGELOG. * Update Events BB version number. * Update SECURITY.md * updated for release * resolved merge conflicts * updated version in yaml files * updated version in yaml * workaround for Oauth transport lib error * updated changelog * updated docker build with nocache option * moved ProxyFix to catalog * removed no-cache from docker build * updated version in yaml * updated security * Update contributions/api/contributions_rest_service.py remove blank line Co-authored-by: Sandeep Puthanveetil Satheesan * added version comparison * Update catalog_rest_service.py Comment on the proxyFix Co-authored-by: Sandeep Puthanveetil Satheesan * updated release version * release 1.16.0 * Update SECURITY.md Co-authored-by: Sandeep Puthanveetil Satheesan * release 1.16.0 * Update CHANGELOG.md Co-authored-by: Sandeep Puthanveetil Satheesan * release 1.16.0 * Update CHANGELOG.md Co-authored-by: Sandeep Puthanveetil Satheesan * release 1.16.0 * Update appconfig.yaml Updating version number in AppConfig YAML file. * Update Dockerfile Co-authored-by: Sandeep Puthanveetil Satheesan * Update CHANGELOG.md Co-authored-by: Sandeep Puthanveetil Satheesan Co-authored-by: YONG WOOK KIM Co-authored-by: Minu Mathew --- CHANGELOG.md | 10 ++++++++-- SECURITY.md | 1 + appconfigservice/appconfig.yaml | 4 ++-- contributions/contribution.yaml | 2 +- eventservice/events.yaml | 2 +- eventservice/requirements.txt | 2 +- loggingservice/logging.yaml | 4 ++-- 7 files changed, 16 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20423426..bc052fb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] + +### Changed +- Show appropriate error message when catalog cannot display a contribution. [#961](https://github.com/rokwire/rokwire-building-blocks-api/issues/961) + +## [1.16.0] - 2022-08-29 + ### Added - Ability to delete a capability or talent from contribution. [#951](https://github.com/rokwire/rokwire-building-blocks-api/issues/951) - Hide sensitive data in capability view page. [#950](https://github.com/rokwire/rokwire-building-blocks-api/issues/950) @@ -12,7 +18,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Change to allow all group admins to manage group events. [#996](https://github.com/rokwire/rokwire-building-blocks-api/issues/996) -- Show appropriate error message when catalog cannot display a contribution. [#961](https://github.com/rokwire/rokwire-building-blocks-api/issues/961) ### Security - Upgrade Swagger UI base Docker image to v4.13.2. [#991](https://github.com/rokwire/rokwire-building-blocks-api/issues/991) @@ -512,7 +517,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Removed - References to AWS keys and variables in the Events Building Block. -[Unreleased]: https://github.com/rokwire/rokwire-building-blocks-api/compare/1.15.1...HEAD +[Unreleased]: https://github.com/rokwire/rokwire-building-blocks-api/compare/1.16.0...HEAD +[1.16.0]: https://github.com/rokwire/rokwire-building-blocks-api/compare/1.15.0...1.16.0 [1.15.0]: https://github.com/rokwire/rokwire-building-blocks-api/compare/1.14.1...1.15.0 [1.14.1]: https://github.com/rokwire/rokwire-building-blocks-api/compare/1.14.0...1.14.1 [1.14.0]: https://github.com/rokwire/rokwire-building-blocks-api/compare/1.13.0...1.14.0 diff --git a/SECURITY.md b/SECURITY.md index 02eb1d21..eb30f09e 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -6,6 +6,7 @@ Patches for **Rokwire Building Blocks** in this repository will only be applied | Version | Supported | |----------| ------------------ | +| 1.16.0 | :white_check_mark: | | 1.15.0 | :white_check_mark: | | 1.14.1 | :white_check_mark: | | 1.14.0 | :white_check_mark: | diff --git a/appconfigservice/appconfig.yaml b/appconfigservice/appconfig.yaml index 6957ed2a..cd3a356d 100755 --- a/appconfigservice/appconfig.yaml +++ b/appconfigservice/appconfig.yaml @@ -2,7 +2,7 @@ openapi: 3.0.0 info: title: Rokwire App Config Building Block API description: App Config Building Block API Documentation - version: 1.15.0 + version: 1.16.0 servers: - url: https://api.rokwire.illinois.edu description: Production server @@ -310,4 +310,4 @@ components: scheme: bearer bearerFormat: JWT x-bearerInfoFunc: auth_middleware.verify_core_token - description: The client must send a valid (i.e., signed, not expired) OpenID Connect id_token in the Authorization header including anonymous tokens \ No newline at end of file + description: The client must send a valid (i.e., signed, not expired) OpenID Connect id_token in the Authorization header including anonymous tokens diff --git a/contributions/contribution.yaml b/contributions/contribution.yaml index f874d009..17648be7 100644 --- a/contributions/contribution.yaml +++ b/contributions/contribution.yaml @@ -2,7 +2,7 @@ openapi: 3.0.0 info: title: Rokwire Contributions Building Block API description: Contributions Building Block API Documentation - version: 1.15.0 + version: 1.16.0 servers: - url: https://api.rokwire.illinois.edu description: Production server diff --git a/eventservice/events.yaml b/eventservice/events.yaml index 075b12d9..643a4a6e 100755 --- a/eventservice/events.yaml +++ b/eventservice/events.yaml @@ -2,7 +2,7 @@ openapi: 3.0.0 info: title: Rokwire Events Building Block API description: Events Building Block API Documentation - version: 1.15.0 + version: 1.16.0 servers: - url: https://api.rokwire.illinois.edu description: Production server diff --git a/eventservice/requirements.txt b/eventservice/requirements.txt index 653f8166..167cbb26 100644 --- a/eventservice/requirements.txt +++ b/eventservice/requirements.txt @@ -8,7 +8,7 @@ cryptography==3.3.2 gunicorn==20.0.4 boto3==1.9.188 python-dotenv==0.10.3 -gevent==20.9.0 +gevent==21.12.0 diskcache==4.0.0 connexion[swagger-ui]==2.9.0 diff --git a/loggingservice/logging.yaml b/loggingservice/logging.yaml index 7c956c67..d384eeed 100755 --- a/loggingservice/logging.yaml +++ b/loggingservice/logging.yaml @@ -2,7 +2,7 @@ openapi: 3.0.0 info: title: Rokwire Logging Building Block API description: Logging Building Block API Documentation - version: 1.15.0 + version: 1.16.0 servers: - url: https://api.rokwire.illinois.edu description: Production server @@ -165,4 +165,4 @@ components: scheme: bearer bearerFormat: JWT x-bearerInfoFunc: auth_middleware.verify_core_token - description: The client must send a valid (i.e., signed, not expired) OpenID Connect id_token in the Authorization header including anonymous tokens \ No newline at end of file + description: The client must send a valid (i.e., signed, not expired) OpenID Connect id_token in the Authorization header including anonymous tokens From 79417433af0d14463d904a177a2deb4e9dac5856 Mon Sep 17 00:00:00 2001 From: Minu Mathew Date: Wed, 7 Sep 2022 14:07:39 -0500 Subject: [PATCH 03/36] 971 move add talent capability buttons to bottom (#974) * updated capability href div class id * updated capability href div class id * added position to select contribution buttons * updated changelog * moved to unreleased section * deleted fixed section --- CHANGELOG.md | 1 + .../templates/contribute/contribute.html | 26 ++++++++++++++----- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc052fb3..d6412fe6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Show appropriate error message when catalog cannot display a contribution. [#961](https://github.com/rokwire/rokwire-building-blocks-api/issues/961) +- Position of Add capability and talent buttons in catalog form. [#971](https://github.com/rokwire/rokwire-building-blocks-api/issues/971) ## [1.16.0] - 2022-08-29 diff --git a/contributions/catalog/webapps/templates/contribute/contribute.html b/contributions/catalog/webapps/templates/contribute/contribute.html index 489064cd..3f020737 100644 --- a/contributions/catalog/webapps/templates/contribute/contribute.html +++ b/contributions/catalog/webapps/templates/contribute/contribute.html @@ -75,7 +75,7 @@