From 8a8d003a6406cc65ca24a78c71ee89d25b2e0a70 Mon Sep 17 00:00:00 2001 From: ywkim312 Date: Tue, 16 Jun 2020 15:12:57 -0500 Subject: [PATCH 1/8] Task/459 env variable for printout log (#460) * added env variable for printing log on and off * changed variable name * set print default as true * Update CHANGELOG. * Fix CHANGELOG. * Update CHANGELOG.md Co-authored-by: Sandeep Puthanveetil Satheesan --- CHANGELOG.md | 21 +++++++++++++-------- loggingservice/README.md | 2 +- loggingservice/api/controllers/config.py | 1 + loggingservice/api/controllers/logs.py | 13 ++++++------- 4 files changed, 21 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 242b5631..d89f455c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,30 +4,34 @@ All notable changes to this project will be documented in this file. 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 +### Added +- Add environment variable for on/off of printing logs out. [#459](https://github.com/rokwire/rokwire-building-blocks-api/issues/459) + ## [1.4.0] - 2020-06-11 -## Added +### Added - Index to PII and Non-PII database collections. [#428](https://github.com/rokwire/rokwire-building-blocks-api/issues/428) -## Changed +### Changed - Incoming requests can be validated against a list of API keys. [#277](https://github.com/rokwire/rokwire-building-blocks-api/issues/277) ## [1.3.1] - 2020-06-05 -## Changed +### Changed - Stop printing logs in the Logging Building Block. [#444](https://github.com/rokwire/rokwire-building-blocks-api/issues/444) ## [1.3.0] - 2020-05-15 -## Added +### Added - Add more fields in PII and updated API design. [#411](https://github.com/rokwire/rokwire-building-blocks-api/issues/411) - Couple of examples to Profile PII API documentation. [#426](https://github.com/rokwire/rokwire-building-blocks-api/issues/426) -## Changed +### Changed - Differentiated verified and unverified data items in PII data and made unverified data updatable. [#424](https://github.com/rokwire/rokwire-building-blocks-api/issues/424) - Some PII data fields became read-only (pid, creation date). [#431](https://github.com/rokwire/rokwire-building-blocks-api/issues/431) -## Removed +### Removed - Read-only property from couple of PII fields. [#432](https://github.com/rokwire/rokwire-building-blocks-api/issues/432) -## Fixed +### Fixed - Date string fields in PII examples. [#434](https://github.com/rokwire/rokwire-building-blocks-api/issues/434) - Couple of CHANGELOG entries. [#436](https://github.com/rokwire/rokwire-building-blocks-api/issues/436) @@ -199,7 +203,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - References to AWS keys and variables in the Events Building Block. [Unreleased]: https://github.com/rokwire/rokwire-building-blocks-api/compare/1.4.0...HEAD -[1.4.0]: https://github.com/rokwire/rokwire-building-blocks-api/compare/1.3.0...1.4.0 +[1.4.0]: https://github.com/rokwire/rokwire-building-blocks-api/compare/1.3.1...1.4.0 +[1.3.1]: https://github.com/rokwire/rokwire-building-blocks-api/compare/1.3.0...1.3.1 [1.3.0]: https://github.com/rokwire/rokwire-building-blocks-api/compare/1.2.2...1.3.0 [1.2.2]: https://github.com/rokwire/rokwire-building-blocks-api/compare/1.2.1...1.2.2 [1.2.1]: https://github.com/rokwire/rokwire-building-blocks-api/compare/1.2.0...1.2.1 diff --git a/loggingservice/README.md b/loggingservice/README.md index 2bdcd49a..5d36424a 100644 --- a/loggingservice/README.md +++ b/loggingservice/README.md @@ -41,7 +41,7 @@ The detailed API information is in rokwire.yaml in the OpenAPI Spec 3.0 format. ``` cd rokwire-building-blocks-api docker build -f loggingservice/Dockerfile -t rokwire/logging-building-block . -docker run --name logging --rm --env-file loggingservice/.env -e API_LOC=. -e DEBUG=False -e LOGGING_URL_PREFIX= -p 5000:5000 rokwire/logging-building-block +docker run --name logging --rm --env-file loggingservice/.env -e API_LOC=. -e PRINT_LOG=True -e DEBUG=False -e LOGGING_URL_PREFIX= -p 5000:5000 rokwire/logging-building-block ``` You can edit config.py or environment variable to specify a URL prefix by modifying LOGGIN_URL_PREFIX variable. If you need to make just /logs as endpoint, put the vaiable value to empty string or do not include this variable. diff --git a/loggingservice/api/controllers/config.py b/loggingservice/api/controllers/config.py index 9afd0f4a..9bc82809 100644 --- a/loggingservice/api/controllers/config.py +++ b/loggingservice/api/controllers/config.py @@ -12,5 +12,6 @@ FLASK_APP = os.getenv('FLASK_APP', 'logging_rest_service') FLASK_ENV = os.getenv('FLASK_ENV', 'production') API_LOC = os.getenv('API_LOC', '../../') +PRINT_LOG = bool(os.getenv('PRINT_LOG', 'True') == 'True') DEBUG = bool(os.getenv('DEBUG', 'False') == 'True') diff --git a/loggingservice/api/controllers/logs.py b/loggingservice/api/controllers/logs.py index 5b228149..9c125774 100644 --- a/loggingservice/api/controllers/logs.py +++ b/loggingservice/api/controllers/logs.py @@ -3,9 +3,9 @@ import sys from connexion.exceptions import OAuthProblem - from flask import request +import controllers.config as cfg import utils.rest_handlers as rs_handlers def post(): @@ -34,12 +34,11 @@ def post(): # db[LOGGING_COLL_NAME].insert_many(in_json) # Write incoming click stream data to log (for easy integration with Splunk) - # Temporarily disable printing logs to STDOUT. - - # for log in in_json: - # print(json.dumps(log)) - # sys.stdout.flush() - pass + # if PRINT_LOG is True print out logs + if cfg.PRINT_LOG: + for log in in_json: + print(json.dumps(log)) + sys.stdout.flush() except Exception as ex: logging.exception(ex) From d4ffeac370ec4de64d023b8367f6fc31f241a9b5 Mon Sep 17 00:00:00 2001 From: Sandeep Puthanveetil Satheesan Date: Thu, 25 Jun 2020 14:01:59 -0500 Subject: [PATCH 2/8] Add license (#467) * Add LICENSE file * Update CHANGELOG.md --- CHANGELOG.md | 1 + LICENSE | 201 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 202 insertions(+) create mode 100644 LICENSE diff --git a/CHANGELOG.md b/CHANGELOG.md index d89f455c..c197f6c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased ### Added - Add environment variable for on/off of printing logs out. [#459](https://github.com/rokwire/rokwire-building-blocks-api/issues/459) +- LICENSE file. [#466](https://github.com/rokwire/rokwire-building-blocks-api/issues/466) ## [1.4.0] - 2020-06-11 ### Added diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. From 335bf705157ae40e6876013243fb9f117d51abca Mon Sep 17 00:00:00 2001 From: Sandeep Puthanveetil Satheesan Date: Mon, 29 Jun 2020 23:34:35 -0500 Subject: [PATCH 3/8] Task/473 add document type field in pii (#474) * added documentType field in pii * Update API specification. Co-authored-by: Kim --- CHANGELOG.md | 1 + profileservice/api/models/pii_data.py | 7 +++++++ profileservice/api/rokwireresolver.py | 2 +- profileservice/api/utils/datasetutils.py | 4 ++++ rokwire.yaml | 4 ++++ 5 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c197f6c4..655272dd 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 ### Added - Add environment variable for on/off of printing logs out. [#459](https://github.com/rokwire/rokwire-building-blocks-api/issues/459) - LICENSE file. [#466](https://github.com/rokwire/rokwire-building-blocks-api/issues/466) +- Add documentType field in PII dataset. [#473](https://github.com/rokwire/rokwire-building-blocks-api/issues/473) ## [1.4.0] - 2020-06-11 ### Added diff --git a/profileservice/api/models/pii_data.py b/profileservice/api/models/pii_data.py index 7ebaa3fc..50ffce38 100644 --- a/profileservice/api/models/pii_data.py +++ b/profileservice/api/models/pii_data.py @@ -20,6 +20,7 @@ def __init__(self, injson): self.country = None self.healthcareProviderIDs = None self.testResultsConsent = None + self.documentType = None self.photoImageBase64 = None self.imageUrl = None self.fileDescriptors = None @@ -146,6 +147,12 @@ def set_test_results_consent(self, testResultsConsent): def get_test_results_consent(self): return self.testResultsConsent + def set_document_type(self, documentType): + self.documentType = documentType + + def get_document_type(self): + return self.documentType + def set_photo_image_base64(self, photoImageBase64): self.photoImageBase64 = photoImageBase64 diff --git a/profileservice/api/rokwireresolver.py b/profileservice/api/rokwireresolver.py index b4a77cbd..fdc43c46 100644 --- a/profileservice/api/rokwireresolver.py +++ b/profileservice/api/rokwireresolver.py @@ -55,7 +55,7 @@ def resolve_operation_id_using_rest_semantics(self, operation): method = operation.method.lower() if method == 'get' and '{' not in elements[-1]: method = self.collection_endpoint_name - print(name) + print(name + "_" + method) if name.count('.') < 2: return name + '.' + method diff --git a/profileservice/api/utils/datasetutils.py b/profileservice/api/utils/datasetutils.py index da5df029..b7c3718e 100644 --- a/profileservice/api/utils/datasetutils.py +++ b/profileservice/api/utils/datasetutils.py @@ -168,6 +168,10 @@ def update_pii_dataset_from_json(dataset, injson): dataset.set_test_results_consent(injson['testResultsConsent']) except Exception as e: pass + try: + dataset.set_document_type(injson['documentType']) + except Exception as e: + pass try: dataset.set_photo_image_base64(injson['photoImageBase64']) except Exception as e: diff --git a/rokwire.yaml b/rokwire.yaml index 27dc485d..bc8f6c33 100755 --- a/rokwire.yaml +++ b/rokwire.yaml @@ -1577,6 +1577,10 @@ components: imageUrl: nullable: true type: string + documentType: + nullable: true + description: The type of the user document that was scanned to populate certain PII fields like name, photoImageBase64, birthYear, etc. + type: string creationDate: description: creation date will not be modified once it get set. type: string From 37334c459d085019e6de161ef690418dec094ba0 Mon Sep 17 00:00:00 2001 From: ywkim312 Date: Tue, 30 Jun 2020 01:25:44 -0500 Subject: [PATCH 4/8] Task/470 1 update standard license header in logging and profile building block (#471) * updated standard license header in profiles building block * updated standard license header in logging building block Co-authored-by: Sandeep Puthanveetil Satheesan --- CHANGELOG.md | 1 + loggingservice/__init__.py | 13 +++++++++++++ loggingservice/api/__init__.py | 13 +++++++++++++ loggingservice/api/controllers/__init__.py | 13 +++++++++++++ loggingservice/api/controllers/config.py | 14 ++++++++++++++ loggingservice/api/controllers/logs.py | 14 ++++++++++++++ loggingservice/api/db.py | 14 ++++++++++++++ loggingservice/api/gunicorn.config.py | 15 +++++++++++++++ loggingservice/api/logging_rest_service.py | 14 ++++++++++++++ loggingservice/api/models/__init__.py | 13 +++++++++++++ loggingservice/api/rokwireresolver.py | 14 ++++++++++++++ loggingservice/api/utils/rest_handlers.py | 14 ++++++++++++++ profileservice/__init__.py | 13 +++++++++++++ profileservice/api/__init__.py | 13 +++++++++++++ profileservice/api/controllers/__init__.py | 13 +++++++++++++ profileservice/api/controllers/configs.py | 14 ++++++++++++++ profileservice/api/controllers/profiles.py | 14 ++++++++++++++ profileservice/api/gunicorn.config.py | 15 +++++++++++++++ profileservice/api/models/__init__.py | 13 +++++++++++++ profileservice/api/models/favorites.py | 14 ++++++++++++++ profileservice/api/models/filedescriptor.py | 14 ++++++++++++++ profileservice/api/models/interest.py | 14 ++++++++++++++ profileservice/api/models/non_pii_data.py | 14 ++++++++++++++ profileservice/api/models/pii_data.py | 14 ++++++++++++++ profileservice/api/models/privacysettings.py | 14 ++++++++++++++ profileservice/api/models/testresultsconsent.py | 14 ++++++++++++++ profileservice/api/profile_rest_service.py | 14 ++++++++++++++ profileservice/api/rokwireresolver.py | 14 ++++++++++++++ profileservice/api/utils/__init__.py | 14 ++++++++++++++ profileservice/api/utils/datasetutils.py | 14 ++++++++++++++ profileservice/api/utils/jsonutils.py | 14 ++++++++++++++ profileservice/api/utils/mongoutils.py | 14 ++++++++++++++ profileservice/api/utils/otherutils.py | 14 ++++++++++++++ profileservice/api/utils/query_params.py | 14 ++++++++++++++ profileservice/api/utils/rest_handlers.py | 14 ++++++++++++++ profileservice/api/utils/tokenutils.py | 14 ++++++++++++++ 36 files changed, 485 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 655272dd..93f668d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add environment variable for on/off of printing logs out. [#459](https://github.com/rokwire/rokwire-building-blocks-api/issues/459) - LICENSE file. [#466](https://github.com/rokwire/rokwire-building-blocks-api/issues/466) - Add documentType field in PII dataset. [#473](https://github.com/rokwire/rokwire-building-blocks-api/issues/473) +- Add standard license header to code file [#470](https://github.com/rokwire/rokwire-building-blocks-api/issues/470) ## [1.4.0] - 2020-06-11 ### Added diff --git a/loggingservice/__init__.py b/loggingservice/__init__.py index 8b137891..21531846 100644 --- a/loggingservice/__init__.py +++ b/loggingservice/__init__.py @@ -1 +1,14 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/loggingservice/api/__init__.py b/loggingservice/api/__init__.py index e69de29b..6cab36e6 100644 --- a/loggingservice/api/__init__.py +++ b/loggingservice/api/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/loggingservice/api/controllers/__init__.py b/loggingservice/api/controllers/__init__.py index e69de29b..90a299cd 100644 --- a/loggingservice/api/controllers/__init__.py +++ b/loggingservice/api/controllers/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/loggingservice/api/controllers/config.py b/loggingservice/api/controllers/config.py index 9bc82809..0bbcb84f 100644 --- a/loggingservice/api/controllers/config.py +++ b/loggingservice/api/controllers/config.py @@ -1,3 +1,17 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import os from dotenv import load_dotenv diff --git a/loggingservice/api/controllers/logs.py b/loggingservice/api/controllers/logs.py index 9c125774..19961ae6 100644 --- a/loggingservice/api/controllers/logs.py +++ b/loggingservice/api/controllers/logs.py @@ -1,3 +1,17 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import logging import json import sys diff --git a/loggingservice/api/db.py b/loggingservice/api/db.py index 6b19b50f..4e3b2254 100644 --- a/loggingservice/api/db.py +++ b/loggingservice/api/db.py @@ -1,3 +1,17 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from flask import current_app, g from pymongo.mongo_client import MongoClient diff --git a/loggingservice/api/gunicorn.config.py b/loggingservice/api/gunicorn.config.py index 3be66649..b35fa0c7 100644 --- a/loggingservice/api/gunicorn.config.py +++ b/loggingservice/api/gunicorn.config.py @@ -1,8 +1,23 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Gunicorn configuration.""" bind = '0.0.0.0:5000' workers = 4 worker_class = 'gevent' + # If you adjust this number, also adjust the MongoClient pool connections worker_connections = 100 diff --git a/loggingservice/api/logging_rest_service.py b/loggingservice/api/logging_rest_service.py index 817c50c8..108cd038 100644 --- a/loggingservice/api/logging_rest_service.py +++ b/loggingservice/api/logging_rest_service.py @@ -1,3 +1,17 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import connexion import logging import controllers.config as cfg diff --git a/loggingservice/api/models/__init__.py b/loggingservice/api/models/__init__.py index e69de29b..90a299cd 100644 --- a/loggingservice/api/models/__init__.py +++ b/loggingservice/api/models/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/loggingservice/api/rokwireresolver.py b/loggingservice/api/rokwireresolver.py index b4a77cbd..3f5790bb 100644 --- a/loggingservice/api/rokwireresolver.py +++ b/loggingservice/api/rokwireresolver.py @@ -1,3 +1,17 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import re from connexion import Resolver diff --git a/loggingservice/api/utils/rest_handlers.py b/loggingservice/api/utils/rest_handlers.py index d150722b..304ea270 100644 --- a/loggingservice/api/utils/rest_handlers.py +++ b/loggingservice/api/utils/rest_handlers.py @@ -1,3 +1,17 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import flask from flask import make_response, request diff --git a/profileservice/__init__.py b/profileservice/__init__.py index e69de29b..6cab36e6 100644 --- a/profileservice/__init__.py +++ b/profileservice/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/profileservice/api/__init__.py b/profileservice/api/__init__.py index e69de29b..6cab36e6 100644 --- a/profileservice/api/__init__.py +++ b/profileservice/api/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/profileservice/api/controllers/__init__.py b/profileservice/api/controllers/__init__.py index e69de29b..6cab36e6 100644 --- a/profileservice/api/controllers/__init__.py +++ b/profileservice/api/controllers/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/profileservice/api/controllers/configs.py b/profileservice/api/controllers/configs.py index da1f4bed..4f7da95e 100644 --- a/profileservice/api/controllers/configs.py +++ b/profileservice/api/controllers/configs.py @@ -1,3 +1,17 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import os from dotenv import load_dotenv diff --git a/profileservice/api/controllers/profiles.py b/profileservice/api/controllers/profiles.py index c9462a3c..a54a63fd 100644 --- a/profileservice/api/controllers/profiles.py +++ b/profileservice/api/controllers/profiles.py @@ -1,3 +1,17 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import json import datetime import logging diff --git a/profileservice/api/gunicorn.config.py b/profileservice/api/gunicorn.config.py index 3be66649..b35fa0c7 100644 --- a/profileservice/api/gunicorn.config.py +++ b/profileservice/api/gunicorn.config.py @@ -1,8 +1,23 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Gunicorn configuration.""" bind = '0.0.0.0:5000' workers = 4 worker_class = 'gevent' + # If you adjust this number, also adjust the MongoClient pool connections worker_connections = 100 diff --git a/profileservice/api/models/__init__.py b/profileservice/api/models/__init__.py index e69de29b..90a299cd 100644 --- a/profileservice/api/models/__init__.py +++ b/profileservice/api/models/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/profileservice/api/models/favorites.py b/profileservice/api/models/favorites.py index 047829da..6afffb59 100644 --- a/profileservice/api/models/favorites.py +++ b/profileservice/api/models/favorites.py @@ -1,3 +1,17 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + class Favorites(): def __init__(self): self.eventIds = None diff --git a/profileservice/api/models/filedescriptor.py b/profileservice/api/models/filedescriptor.py index dada9f61..fe8e3a22 100644 --- a/profileservice/api/models/filedescriptor.py +++ b/profileservice/api/models/filedescriptor.py @@ -1,3 +1,17 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + class FileDescriptor: id = None deleted = None diff --git a/profileservice/api/models/interest.py b/profileservice/api/models/interest.py index e808af82..53d0811a 100644 --- a/profileservice/api/models/interest.py +++ b/profileservice/api/models/interest.py @@ -1,3 +1,17 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + class Interest(): def __init__(self): self.category = None diff --git a/profileservice/api/models/non_pii_data.py b/profileservice/api/models/non_pii_data.py index e01b0b0f..ce10980a 100644 --- a/profileservice/api/models/non_pii_data.py +++ b/profileservice/api/models/non_pii_data.py @@ -1,3 +1,17 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import utils.datasetutils as datasetutils class NonPiiData(): diff --git a/profileservice/api/models/pii_data.py b/profileservice/api/models/pii_data.py index 50ffce38..2eed509f 100644 --- a/profileservice/api/models/pii_data.py +++ b/profileservice/api/models/pii_data.py @@ -1,3 +1,17 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import utils.datasetutils as datasetutils class PiiData: diff --git a/profileservice/api/models/privacysettings.py b/profileservice/api/models/privacysettings.py index ad967f84..ce38bf41 100644 --- a/profileservice/api/models/privacysettings.py +++ b/profileservice/api/models/privacysettings.py @@ -1,3 +1,17 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + class PrivacySettings(): def __init__(self): self.level = None diff --git a/profileservice/api/models/testresultsconsent.py b/profileservice/api/models/testresultsconsent.py index 5ec2610c..b2d45871 100644 --- a/profileservice/api/models/testresultsconsent.py +++ b/profileservice/api/models/testresultsconsent.py @@ -1,3 +1,17 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + class TestResultsConsent(): def __init__(self): self.consentProvided = None diff --git a/profileservice/api/profile_rest_service.py b/profileservice/api/profile_rest_service.py index cc999f90..ed10a7bf 100644 --- a/profileservice/api/profile_rest_service.py +++ b/profileservice/api/profile_rest_service.py @@ -1,3 +1,17 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import connexion import logging import controllers.configs as cfg diff --git a/profileservice/api/rokwireresolver.py b/profileservice/api/rokwireresolver.py index fdc43c46..3263404b 100644 --- a/profileservice/api/rokwireresolver.py +++ b/profileservice/api/rokwireresolver.py @@ -1,3 +1,17 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import re from connexion import Resolver diff --git a/profileservice/api/utils/__init__.py b/profileservice/api/utils/__init__.py index e69de29b..eeacdba2 100644 --- a/profileservice/api/utils/__init__.py +++ b/profileservice/api/utils/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/profileservice/api/utils/datasetutils.py b/profileservice/api/utils/datasetutils.py index b7c3718e..002d571d 100644 --- a/profileservice/api/utils/datasetutils.py +++ b/profileservice/api/utils/datasetutils.py @@ -1,3 +1,17 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import copy from models.interest import Interest diff --git a/profileservice/api/utils/jsonutils.py b/profileservice/api/utils/jsonutils.py index 4b75fb8c..bda12950 100644 --- a/profileservice/api/utils/jsonutils.py +++ b/profileservice/api/utils/jsonutils.py @@ -1,3 +1,17 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from flask import make_response def remove_objectid_from_dataset(dataset): diff --git a/profileservice/api/utils/mongoutils.py b/profileservice/api/utils/mongoutils.py index 030f998a..032d37fa 100644 --- a/profileservice/api/utils/mongoutils.py +++ b/profileservice/api/utils/mongoutils.py @@ -1,3 +1,17 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import json import logging import controllers.configs as cfg diff --git a/profileservice/api/utils/otherutils.py b/profileservice/api/utils/otherutils.py index 840c3954..c6a260bd 100644 --- a/profileservice/api/utils/otherutils.py +++ b/profileservice/api/utils/otherutils.py @@ -1,3 +1,17 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import hashlib import os import urllib diff --git a/profileservice/api/utils/query_params.py b/profileservice/api/utils/query_params.py index d8500beb..14f3cb1c 100644 --- a/profileservice/api/utils/query_params.py +++ b/profileservice/api/utils/query_params.py @@ -1,3 +1,17 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + def format_query(args, query): query_parts = [] diff --git a/profileservice/api/utils/rest_handlers.py b/profileservice/api/utils/rest_handlers.py index ceae714b..b7f24359 100644 --- a/profileservice/api/utils/rest_handlers.py +++ b/profileservice/api/utils/rest_handlers.py @@ -1,3 +1,17 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import flask from flask import flash, redirect, jsonify, make_response, request diff --git a/profileservice/api/utils/tokenutils.py b/profileservice/api/utils/tokenutils.py index c0f6d0de..6fe21d16 100644 --- a/profileservice/api/utils/tokenutils.py +++ b/profileservice/api/utils/tokenutils.py @@ -1,3 +1,17 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + def get_id_info_from_token(in_token): # in_token = convert_str_to_dict(in_token) id_type = 0 # 0 for no pii, 1 for uin id, 2 phone id From 5dcdf3155466c2b3af6e240e6a7177c8a5bc58cf Mon Sep 17 00:00:00 2001 From: Wenjie Date: Wed, 1 Jul 2020 14:41:33 -0500 Subject: [PATCH 5/8] Task/470 app config add standard license header (#472) * Add standard license header * Add newline at end of file. * Update CHANGELOG.md Co-authored-by: Sandeep Puthanveetil Satheesan --- CHANGELOG.md | 1 + appconfigservice/__init__.py | 13 +++++++++++++ appconfigservice/api/__init__.py | 13 +++++++++++++ appconfigservice/api/appconfig_rest_service.py | 14 ++++++++++++++ appconfigservice/api/controllers/__init__.py | 13 +++++++++++++ appconfigservice/api/controllers/app.py | 14 ++++++++++++++ appconfigservice/api/controllers/config.py | 14 ++++++++++++++ appconfigservice/api/models/__init__.py | 13 +++++++++++++ appconfigservice/api/models/main.py | 13 +++++++++++++ appconfigservice/api/rokwireresolver.py | 14 ++++++++++++++ appconfigservice/api/test/test_app_config.py | 14 ++++++++++++++ appconfigservice/api/test/test_dbutils.py | 14 ++++++++++++++ appconfigservice/api/test/test_index.py | 14 ++++++++++++++ appconfigservice/api/test/test_search_config.py | 14 ++++++++++++++ appconfigservice/gunicorn.config.py | 14 ++++++++++++++ appconfigservice/setup.py | 14 ++++++++++++++ 16 files changed, 206 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 93f668d0..549a0c76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - LICENSE file. [#466](https://github.com/rokwire/rokwire-building-blocks-api/issues/466) - Add documentType field in PII dataset. [#473](https://github.com/rokwire/rokwire-building-blocks-api/issues/473) - Add standard license header to code file [#470](https://github.com/rokwire/rokwire-building-blocks-api/issues/470) +- Add license header for app config building block [#470](https://github.com/rokwire/rokwire-building-blocks-api/issues/470) ## [1.4.0] - 2020-06-11 ### Added diff --git a/appconfigservice/__init__.py b/appconfigservice/__init__.py index e69de29b..6cab36e6 100644 --- a/appconfigservice/__init__.py +++ b/appconfigservice/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/appconfigservice/api/__init__.py b/appconfigservice/api/__init__.py index e69de29b..6cab36e6 100644 --- a/appconfigservice/api/__init__.py +++ b/appconfigservice/api/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/appconfigservice/api/appconfig_rest_service.py b/appconfigservice/api/appconfig_rest_service.py index 1d4ac732..3c700bc9 100644 --- a/appconfigservice/api/appconfig_rest_service.py +++ b/appconfigservice/api/appconfig_rest_service.py @@ -1,3 +1,17 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import logging from time import gmtime diff --git a/appconfigservice/api/controllers/__init__.py b/appconfigservice/api/controllers/__init__.py index e69de29b..6cab36e6 100644 --- a/appconfigservice/api/controllers/__init__.py +++ b/appconfigservice/api/controllers/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/appconfigservice/api/controllers/app.py b/appconfigservice/api/controllers/app.py index 12d4e35f..e597346d 100644 --- a/appconfigservice/api/controllers/app.py +++ b/appconfigservice/api/controllers/app.py @@ -1,3 +1,17 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import logging import re from time import gmtime diff --git a/appconfigservice/api/controllers/config.py b/appconfigservice/api/controllers/config.py index 5bf9d1d0..462409a8 100644 --- a/appconfigservice/api/controllers/config.py +++ b/appconfigservice/api/controllers/config.py @@ -1,3 +1,17 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import os from dotenv import load_dotenv diff --git a/appconfigservice/api/models/__init__.py b/appconfigservice/api/models/__init__.py index e69de29b..6cab36e6 100644 --- a/appconfigservice/api/models/__init__.py +++ b/appconfigservice/api/models/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/appconfigservice/api/models/main.py b/appconfigservice/api/models/main.py index e69de29b..6cab36e6 100644 --- a/appconfigservice/api/models/main.py +++ b/appconfigservice/api/models/main.py @@ -0,0 +1,13 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/appconfigservice/api/rokwireresolver.py b/appconfigservice/api/rokwireresolver.py index 1f7698ba..0876946d 100644 --- a/appconfigservice/api/rokwireresolver.py +++ b/appconfigservice/api/rokwireresolver.py @@ -1,3 +1,17 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from connexion import Resolver diff --git a/appconfigservice/api/test/test_app_config.py b/appconfigservice/api/test/test_app_config.py index 2f50f4b4..640f0a38 100644 --- a/appconfigservice/api/test/test_app_config.py +++ b/appconfigservice/api/test/test_app_config.py @@ -1,3 +1,17 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import json import connexion diff --git a/appconfigservice/api/test/test_dbutils.py b/appconfigservice/api/test/test_dbutils.py index d7c85343..4822c54f 100644 --- a/appconfigservice/api/test/test_dbutils.py +++ b/appconfigservice/api/test/test_dbutils.py @@ -1,3 +1,17 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from ..utils import dbutils diff --git a/appconfigservice/api/test/test_index.py b/appconfigservice/api/test/test_index.py index b19e4fb2..5268243e 100644 --- a/appconfigservice/api/test/test_index.py +++ b/appconfigservice/api/test/test_index.py @@ -1,3 +1,17 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import json from flask import current_app diff --git a/appconfigservice/api/test/test_search_config.py b/appconfigservice/api/test/test_search_config.py index 19defd7a..4741ba62 100644 --- a/appconfigservice/api/test/test_search_config.py +++ b/appconfigservice/api/test/test_search_config.py @@ -1,3 +1,17 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import json from flask import current_app diff --git a/appconfigservice/gunicorn.config.py b/appconfigservice/gunicorn.config.py index 3be66649..bd4709cd 100644 --- a/appconfigservice/gunicorn.config.py +++ b/appconfigservice/gunicorn.config.py @@ -1,3 +1,17 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Gunicorn configuration.""" bind = '0.0.0.0:5000' diff --git a/appconfigservice/setup.py b/appconfigservice/setup.py index 0c3e6f69..6bc67cad 100644 --- a/appconfigservice/setup.py +++ b/appconfigservice/setup.py @@ -1,3 +1,17 @@ +# Copyright 2020 Board of Trustees of the University of Illinois. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from setuptools import find_namespace_packages, setup setup( From dbbdb7aeacd8f188c78efd80b2d05e806e2d72a4 Mon Sep 17 00:00:00 2001 From: Sandeep Puthanveetil Satheesan Date: Wed, 1 Jul 2020 16:24:32 -0500 Subject: [PATCH 6/8] Update version --- rokwire.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rokwire.yaml b/rokwire.yaml index bc8f6c33..caca3565 100755 --- a/rokwire.yaml +++ b/rokwire.yaml @@ -2,7 +2,7 @@ openapi: 3.0.0 info: title: Rokwire Platform API description: Rokwire Platform API Documentation - version: 1.4.0 + version: 1.5.0 servers: - url: https://api.rokwire.illinois.edu description: Production server From eafd8344e9f0036257109682aa3292b64c27bcd0 Mon Sep 17 00:00:00 2001 From: Sandeep Puthanveetil Satheesan Date: Wed, 1 Jul 2020 16:27:05 -0500 Subject: [PATCH 7/8] Update CHANGELOG.md --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 549a0c76..33a2bd8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. 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 +## [1.5.0] - 2020-07-01 ### Added - Add environment variable for on/off of printing logs out. [#459](https://github.com/rokwire/rokwire-building-blocks-api/issues/459) - LICENSE file. [#466](https://github.com/rokwire/rokwire-building-blocks-api/issues/466) @@ -206,7 +206,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.4.0...HEAD +[Unreleased]: https://github.com/rokwire/rokwire-building-blocks-api/compare/1.5.0...HEAD +[1.5.0]: https://github.com/rokwire/rokwire-building-blocks-api/compare/1.4.0...1.5.0 [1.4.0]: https://github.com/rokwire/rokwire-building-blocks-api/compare/1.3.1...1.4.0 [1.3.1]: https://github.com/rokwire/rokwire-building-blocks-api/compare/1.3.0...1.3.1 [1.3.0]: https://github.com/rokwire/rokwire-building-blocks-api/compare/1.2.2...1.3.0 From 17e9e133861224883d98dacdeb92409de822a64e Mon Sep 17 00:00:00 2001 From: ywkim312 Date: Thu, 2 Jul 2020 11:57:17 -0500 Subject: [PATCH 8/8] added enum values in documentType (#477) * added enum values in documentType * added changelog entry --- CHANGELOG.md | 2 +- rokwire.yaml | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 33a2bd8b..68fcedcb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add documentType field in PII dataset. [#473](https://github.com/rokwire/rokwire-building-blocks-api/issues/473) - Add standard license header to code file [#470](https://github.com/rokwire/rokwire-building-blocks-api/issues/470) - Add license header for app config building block [#470](https://github.com/rokwire/rokwire-building-blocks-api/issues/470) - +- Add enum value to documentType field in PII. [#476](https://github.com/rokwire/rokwire-building-blocks-api/issues/476) ## [1.4.0] - 2020-06-11 ### Added - Index to PII and Non-PII database collections. [#428](https://github.com/rokwire/rokwire-building-blocks-api/issues/428) diff --git a/rokwire.yaml b/rokwire.yaml index caca3565..de96edb8 100755 --- a/rokwire.yaml +++ b/rokwire.yaml @@ -1578,9 +1578,12 @@ components: nullable: true type: string documentType: - nullable: true - description: The type of the user document that was scanned to populate certain PII fields like name, photoImageBase64, birthYear, etc. + description: The type of the user document that was scanned to populate certain PII fields like name, photoImage, birthYear, etc. type: string + nullable: true + enum: + - passport + - drivingLicense creationDate: description: creation date will not be modified once it get set. type: string