jaaql-middleware-python 4.24.2__tar.gz → 4.24.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. {jaaql-middleware-python-4.24.2/jaaql_middleware_python.egg-info → jaaql-middleware-python-4.24.3}/PKG-INFO +1 -1
  2. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/constants.py +2 -2
  3. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/documentation/documentation_public.py +0 -1
  4. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/mvc/model.py +44 -35
  5. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3/jaaql_middleware_python.egg-info}/PKG-INFO +1 -1
  6. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/LICENSE.txt +0 -0
  7. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/README.md +0 -0
  8. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/__init__.py +0 -0
  9. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/config/__init__.py +0 -0
  10. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/config/config-docker.ini +0 -0
  11. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/config/config-test.ini +0 -0
  12. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/config/config.ini +0 -0
  13. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/config_constants.py +0 -0
  14. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/db/__init__.py +0 -0
  15. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/db/db_interface.py +0 -0
  16. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/db/db_pg_interface.py +0 -0
  17. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/db/db_utils.py +0 -0
  18. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/db/db_utils_no_circ.py +0 -0
  19. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/documentation/__init__.py +0 -0
  20. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/documentation/documentation_internal.py +0 -0
  21. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/documentation/documentation_shared.py +0 -0
  22. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/email/__init__.py +0 -0
  23. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/email/email_manager.py +0 -0
  24. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/email/email_manager_service.py +0 -0
  25. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/email/patch_ems.py +0 -0
  26. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/exceptions/__init__.py +0 -0
  27. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/exceptions/custom_http_status.py +0 -0
  28. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/exceptions/http_status_exception.py +0 -0
  29. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/exceptions/jaaql_interpretable_handled_errors.py +0 -0
  30. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/exceptions/not_yet_implement_exception.py +0 -0
  31. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/generated_constants.py +0 -0
  32. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/interpreter/__init__.py +0 -0
  33. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/interpreter/interpret_jaaql.py +0 -0
  34. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/jaaql.py +0 -0
  35. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/migrations/__init__.py +0 -0
  36. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/migrations/migrations.py +0 -0
  37. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/mvc/__init__.py +0 -0
  38. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/mvc/base_controller.py +0 -0
  39. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/mvc/base_model.py +0 -0
  40. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/mvc/controller.py +0 -0
  41. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/mvc/controller_interface.py +0 -0
  42. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/mvc/exception_queries.py +0 -0
  43. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/mvc/generated_queries.py +0 -0
  44. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/mvc/handmade_queries.py +0 -0
  45. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/mvc/model_interface.py +0 -0
  46. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/mvc/response.py +0 -0
  47. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/openapi/__init__.py +0 -0
  48. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/openapi/swagger_documentation.py +0 -0
  49. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/patch.py +0 -0
  50. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/scripts/01.install_domains.generated.sql +0 -0
  51. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/scripts/02.install_super_user.exceptions.sql +0 -0
  52. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/scripts/03.install_super_user.handwritten.sql +0 -0
  53. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/scripts/04.install_jaaql_data_structures.generated.sql +0 -0
  54. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/scripts/05.install_jaaql.exceptions.sql +0 -0
  55. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/scripts/06.install_jaaql.handwritten.sql +0 -0
  56. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/scripts/ZZZZ.generated_functions_views_and_permissions.sql +0 -0
  57. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/scripts/ZZZZ.reset_references.sql +0 -0
  58. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/scripts/swagger_template.html +0 -0
  59. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/services/__init__.py +0 -0
  60. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/services/cached_canned_query_service.py +0 -0
  61. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/services/migrations_manager_service.py +0 -0
  62. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/services/patch_mms.py +0 -0
  63. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/services/patch_shared_var_service.py +0 -0
  64. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/services/shared_var_service.py +0 -0
  65. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/utilities/__init__.py +0 -0
  66. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/utilities/crypt_utils.py +0 -0
  67. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/utilities/options.py +0 -0
  68. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/utilities/utils.py +0 -0
  69. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/utilities/utils_no_project_imports.py +0 -0
  70. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql/utilities/vault.py +0 -0
  71. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql_middleware_python.egg-info/SOURCES.txt +0 -0
  72. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql_middleware_python.egg-info/dependency_links.txt +0 -0
  73. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql_middleware_python.egg-info/requires.txt +0 -0
  74. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/jaaql_middleware_python.egg-info/top_level.txt +0 -0
  75. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/setup.cfg +0 -0
  76. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.3}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: jaaql-middleware-python
3
- Version: 4.24.2
3
+ Version: 4.24.3
4
4
  Summary: The jaaql package, allowing for rapid development and deployment of RESTful HTTP applications
5
5
  Home-page: https://github.com/JAAQL/JAAQL-middleware-python
6
6
  Author: Software Quality Measurement and Improvement bv
@@ -52,7 +52,7 @@ CRON_dayOfMonth = "dayOfMonth"
52
52
  CRON_month = "month"
53
53
  CRON_dayOfWeek = "dayOfWeek"
54
54
 
55
- REGEX__dmbs_object_name = r'^[0-9a-zA-Z_]{1,32}$'
55
+ REGEX__dmbs_object_name = r'^[0-9a-zA-Z_]{1,63}$'
56
56
 
57
57
  SEPARATOR__comma_space = ", "
58
58
  SEPARATOR__comma = ","
@@ -180,5 +180,5 @@ ROLE__postgres = "postgres"
180
180
 
181
181
  PROTOCOL__postgres = "postgresql://"
182
182
 
183
- VERSION = "4.24.2"
183
+ VERSION = "4.24.3"
184
184
 
@@ -291,7 +291,6 @@ DOCUMENTATION__invite = SwaggerDocumentation(
291
291
  body=[
292
292
  set_nullable(ARG_RES__username, "Potentially if the user is not known"),
293
293
  ARG_RES__parameters,
294
- ARG_RES__query,
295
294
  ARG_RES__event_application,
296
295
  SwaggerArgumentResponse(
297
296
  name=KEY__sign_up_template,
@@ -1059,7 +1059,7 @@ WHERE
1059
1059
  where_clause = " WHERE " + where_clause
1060
1060
  permissions_view = sign_up_template[KG__email_template__permissions_view]
1061
1061
  if re.match(REGEX__dmbs_object_name, permissions_view) is None:
1062
- raise HttpStatusException("Unsafe data relation specified for sign up")
1062
+ raise HttpStatusException("Unsafe permissions relation specified for sign up: Found '" + str(permissions_view) + "' na did not match regex " + REGEX__dmbs_object_name)
1063
1063
  permissions_query = f'SELECT * FROM "{permissions_view}"{where_clause}' # Ignore pycharm pep issue
1064
1064
  submit_data[KEY_query] = permissions_query
1065
1065
  submit_data[KEY_parameters] = ret
@@ -1077,27 +1077,34 @@ WHERE
1077
1077
 
1078
1078
  base_relation = sign_up_template[KG__email_template__base_relation]
1079
1079
  if re.match(REGEX__dmbs_object_name, base_relation) is None:
1080
- raise HttpStatusException("Unsafe data relation specified for sign up")
1080
+ raise HttpStatusException("Unsafe base relation specified for sign up: Found '" + str(base_relation) + "' na did not match regex " + REGEX__dmbs_object_name)
1081
1081
 
1082
- if inputs.get(KEY__username) is None:
1083
- get_user_data = {
1084
- KEY__application: inputs[KG__security_event__application],
1085
- KEY__schema: sign_up_template[KG__email_template__validation_schema],
1086
- KEY_parameters: ret,
1087
- KEY_query: f'SELECT {dbms_user_column_name} FROM {base_relation}{where_clause}' # Ignore pycharm PEP issue
1088
- }
1082
+ found_username = None
1083
+ get_user_data = {
1084
+ KEY__application: inputs[KG__security_event__application],
1085
+ KEY__schema: sign_up_template[KG__email_template__validation_schema],
1086
+ KEY_parameters: ret,
1087
+ KEY_query: f'SELECT {dbms_user_column_name} FROM {base_relation}{where_clause}' # Ignore pycharm PEP issue
1088
+ }
1089
1089
 
1090
- try:
1091
- dbms_user = submit(self.vault, self.config, self.get_db_crypt_key(),
1092
- self.jaaql_lookup_connection, get_user_data,
1093
- ROLE__jaaql, None,
1094
- self.cached_canned_query_service, as_objects=True,
1095
- singleton=True)[dbms_user_column_name]
1090
+ try:
1091
+ dbms_user = submit(self.vault, self.config, self.get_db_crypt_key(),
1092
+ self.jaaql_lookup_connection, get_user_data,
1093
+ ROLE__jaaql, None,
1094
+ self.cached_canned_query_service, as_objects=True,
1095
+ singleton=True)[dbms_user_column_name]
1096
+
1097
+ account = account__select(self.jaaql_lookup_connection, self.get_db_crypt_key(), dbms_user)
1098
+ found_username = account[KG__account__username]
1099
+ except HttpSingletonStatusException:
1100
+ if inputs[KEY__username] is None:
1101
+ raise HttpSingletonStatusException("User with specified parameters could not be found! It's likely you should supply a username!")
1096
1102
 
1097
- account = account__select(self.jaaql_lookup_connection, self.get_db_crypt_key(), dbms_user)
1098
- inputs[KEY__username] = account[KG__account__username]
1099
- except HttpSingletonStatusException:
1100
- raise HttpSingletonStatusException("User with specified parameters could not be found!")
1103
+ if found_username and inputs[KEY__username] is not None:
1104
+ raise HttpStatusException("Did not expect username! User has already been created and associated in the base relation")
1105
+
1106
+ if inputs[KEY__username] is None:
1107
+ inputs[KEY__username] = found_username
1101
1108
 
1102
1109
  # We now create the user if the user doesn't exist
1103
1110
  account_existed = False
@@ -1118,22 +1125,6 @@ WHERE
1118
1125
  if account == jaaql_singleton[KG__jaaql__the_anonymous_user]:
1119
1126
  raise HttpStatusException("Cannot re-invite the anonymous user")
1120
1127
 
1121
- data_view = sign_up_template[KG__email_template__data_view]
1122
- data_query = f'SELECT * FROM "{data_view}"{where_clause}' # Ignore pycharm pep issue
1123
- submit_data[KEY_query] = data_query
1124
- try:
1125
- sign_up_data = submit(self.vault, self.config, self.get_db_crypt_key(), self.jaaql_lookup_connection, submit_data, new_account_id,
1126
- None, self.cached_canned_query_service, as_objects=False, singleton=True)
1127
- sign_up_data = objectify(sign_up_data, singleton=True)
1128
- if dbms_user_column_name in sign_up_data:
1129
- del sign_up_data[dbms_user_column_name] # Remove it. Not harmful that it's there as jaaql knows this already
1130
- except HttpSingletonStatusException:
1131
- raise HttpSingletonStatusException("No or multiple rows returned from " + data_view + " with " + where_clause)
1132
-
1133
- for key, val in sign_up_data:
1134
- perms_check[key] = val
1135
- sign_up_data = perms_check
1136
-
1137
1128
  # We abort if there have been too many requests. Everything is rolled back
1138
1129
  count = count_for_security_event(self.jaaql_lookup_connection, self.get_db_crypt_key(), self.get_vault_repeatable_salt(),
1139
1130
  EMAIL_TYPE__signup, EMAIL_TYPE__already_signed_up, new_account_id)
@@ -1158,6 +1149,24 @@ WHERE
1158
1149
  inputs[KG__security_event__application], template[KG__email_template__name], unlock_code,
1159
1150
  new_account_id)
1160
1151
 
1152
+ data_view = sign_up_template[KG__email_template__data_view]
1153
+ if re.match(REGEX__dmbs_object_name, data_view) is None:
1154
+ raise HttpStatusException("Unsafe data view specified for sign up: Found '" + str(data_view) + "' na did not match regex " + REGEX__dmbs_object_name)
1155
+ data_query = f'SELECT * FROM "{data_view}"'
1156
+ submit_data[KEY_query] = data_query
1157
+ try:
1158
+ submit_data[KEY__parameters] = {} # Might at some point have some data parameters but for now none
1159
+ sign_up_data = submit(self.vault, self.config, self.get_db_crypt_key(), self.jaaql_lookup_connection, submit_data, new_account_id,
1160
+ None, self.cached_canned_query_service, as_objects=False, singleton=True)
1161
+ sign_up_data = objectify(sign_up_data, singleton=True)
1162
+ if dbms_user_column_name in sign_up_data:
1163
+ del sign_up_data[dbms_user_column_name] # Remove it. Not harmful that it's there as jaaql knows this already
1164
+ except HttpSingletonStatusException:
1165
+ raise HttpSingletonStatusException("No or multiple rows returned from " + data_view)
1166
+ for key, val in sign_up_data.items():
1167
+ perms_check[key] = val
1168
+ sign_up_data = perms_check
1169
+
1161
1170
  sign_up_data[EMAIL_PARAM__app_url] = app[KG__application__base_url]
1162
1171
  sign_up_data[EMAIL_PARAM__app_name] = app[KG__application__name]
1163
1172
  sign_up_data[EMAIL_PARAM__email_address] = inputs[KEY__username]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: jaaql-middleware-python
3
- Version: 4.24.2
3
+ Version: 4.24.3
4
4
  Summary: The jaaql package, allowing for rapid development and deployment of RESTful HTTP applications
5
5
  Home-page: https://github.com/JAAQL/JAAQL-middleware-python
6
6
  Author: Software Quality Measurement and Improvement bv