jaaql-middleware-python 4.24.2__tar.gz → 4.24.4__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.4}/PKG-INFO +1 -1
  2. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/constants.py +2 -2
  3. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/documentation/documentation_public.py +0 -1
  4. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/mvc/model.py +45 -35
  5. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4/jaaql_middleware_python.egg-info}/PKG-INFO +1 -1
  6. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/LICENSE.txt +0 -0
  7. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/README.md +0 -0
  8. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/__init__.py +0 -0
  9. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/config/__init__.py +0 -0
  10. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/config/config-docker.ini +0 -0
  11. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/config/config-test.ini +0 -0
  12. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/config/config.ini +0 -0
  13. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/config_constants.py +0 -0
  14. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/db/__init__.py +0 -0
  15. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/db/db_interface.py +0 -0
  16. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/db/db_pg_interface.py +0 -0
  17. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/db/db_utils.py +0 -0
  18. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/db/db_utils_no_circ.py +0 -0
  19. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/documentation/__init__.py +0 -0
  20. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/documentation/documentation_internal.py +0 -0
  21. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/documentation/documentation_shared.py +0 -0
  22. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/email/__init__.py +0 -0
  23. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/email/email_manager.py +0 -0
  24. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/email/email_manager_service.py +0 -0
  25. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/email/patch_ems.py +0 -0
  26. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/exceptions/__init__.py +0 -0
  27. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/exceptions/custom_http_status.py +0 -0
  28. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/exceptions/http_status_exception.py +0 -0
  29. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/exceptions/jaaql_interpretable_handled_errors.py +0 -0
  30. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/exceptions/not_yet_implement_exception.py +0 -0
  31. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/generated_constants.py +0 -0
  32. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/interpreter/__init__.py +0 -0
  33. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/interpreter/interpret_jaaql.py +0 -0
  34. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/jaaql.py +0 -0
  35. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/migrations/__init__.py +0 -0
  36. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/migrations/migrations.py +0 -0
  37. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/mvc/__init__.py +0 -0
  38. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/mvc/base_controller.py +0 -0
  39. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/mvc/base_model.py +0 -0
  40. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/mvc/controller.py +0 -0
  41. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/mvc/controller_interface.py +0 -0
  42. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/mvc/exception_queries.py +0 -0
  43. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/mvc/generated_queries.py +0 -0
  44. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/mvc/handmade_queries.py +0 -0
  45. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/mvc/model_interface.py +0 -0
  46. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/mvc/response.py +0 -0
  47. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/openapi/__init__.py +0 -0
  48. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/openapi/swagger_documentation.py +0 -0
  49. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/patch.py +0 -0
  50. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/scripts/01.install_domains.generated.sql +0 -0
  51. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/scripts/02.install_super_user.exceptions.sql +0 -0
  52. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/scripts/03.install_super_user.handwritten.sql +0 -0
  53. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/scripts/04.install_jaaql_data_structures.generated.sql +0 -0
  54. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/scripts/05.install_jaaql.exceptions.sql +0 -0
  55. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/scripts/06.install_jaaql.handwritten.sql +0 -0
  56. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/scripts/ZZZZ.generated_functions_views_and_permissions.sql +0 -0
  57. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/scripts/ZZZZ.reset_references.sql +0 -0
  58. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/scripts/swagger_template.html +0 -0
  59. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/services/__init__.py +0 -0
  60. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/services/cached_canned_query_service.py +0 -0
  61. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/services/migrations_manager_service.py +0 -0
  62. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/services/patch_mms.py +0 -0
  63. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/services/patch_shared_var_service.py +0 -0
  64. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/services/shared_var_service.py +0 -0
  65. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/utilities/__init__.py +0 -0
  66. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/utilities/crypt_utils.py +0 -0
  67. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/utilities/options.py +0 -0
  68. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/utilities/utils.py +0 -0
  69. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/utilities/utils_no_project_imports.py +0 -0
  70. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql/utilities/vault.py +0 -0
  71. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql_middleware_python.egg-info/SOURCES.txt +0 -0
  72. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql_middleware_python.egg-info/dependency_links.txt +0 -0
  73. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql_middleware_python.egg-info/requires.txt +0 -0
  74. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/jaaql_middleware_python.egg-info/top_level.txt +0 -0
  75. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/setup.cfg +0 -0
  76. {jaaql-middleware-python-4.24.2 → jaaql-middleware-python-4.24.4}/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.4
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.4"
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,
@@ -361,6 +361,7 @@ WHERE
361
361
  return
362
362
 
363
363
  new_data = open(config_path, "r").read()
364
+ new_data = new_data.replace("{{JAAQL_INSTALL_LOCATION}}", os.environ.get("INSTALL_PATH"))
364
365
 
365
366
  # Read the file content
366
367
  with open(file_path, 'r') as file:
@@ -1059,7 +1060,7 @@ WHERE
1059
1060
  where_clause = " WHERE " + where_clause
1060
1061
  permissions_view = sign_up_template[KG__email_template__permissions_view]
1061
1062
  if re.match(REGEX__dmbs_object_name, permissions_view) is None:
1062
- raise HttpStatusException("Unsafe data relation specified for sign up")
1063
+ raise HttpStatusException("Unsafe permissions relation specified for sign up: Found '" + str(permissions_view) + "' na did not match regex " + REGEX__dmbs_object_name)
1063
1064
  permissions_query = f'SELECT * FROM "{permissions_view}"{where_clause}' # Ignore pycharm pep issue
1064
1065
  submit_data[KEY_query] = permissions_query
1065
1066
  submit_data[KEY_parameters] = ret
@@ -1077,27 +1078,34 @@ WHERE
1077
1078
 
1078
1079
  base_relation = sign_up_template[KG__email_template__base_relation]
1079
1080
  if re.match(REGEX__dmbs_object_name, base_relation) is None:
1080
- raise HttpStatusException("Unsafe data relation specified for sign up")
1081
+ raise HttpStatusException("Unsafe base relation specified for sign up: Found '" + str(base_relation) + "' na did not match regex " + REGEX__dmbs_object_name)
1081
1082
 
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
- }
1083
+ found_username = None
1084
+ get_user_data = {
1085
+ KEY__application: inputs[KG__security_event__application],
1086
+ KEY__schema: sign_up_template[KG__email_template__validation_schema],
1087
+ KEY_parameters: ret,
1088
+ KEY_query: f'SELECT {dbms_user_column_name} FROM {base_relation}{where_clause}' # Ignore pycharm PEP issue
1089
+ }
1089
1090
 
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]
1091
+ try:
1092
+ dbms_user = submit(self.vault, self.config, self.get_db_crypt_key(),
1093
+ self.jaaql_lookup_connection, get_user_data,
1094
+ ROLE__jaaql, None,
1095
+ self.cached_canned_query_service, as_objects=True,
1096
+ singleton=True)[dbms_user_column_name]
1097
+
1098
+ account = account__select(self.jaaql_lookup_connection, self.get_db_crypt_key(), dbms_user)
1099
+ found_username = account[KG__account__username]
1100
+ except HttpSingletonStatusException:
1101
+ if inputs[KEY__username] is None:
1102
+ raise HttpSingletonStatusException("User with specified parameters could not be found! It's likely you should supply a username!")
1096
1103
 
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!")
1104
+ if found_username and inputs[KEY__username] is not None:
1105
+ raise HttpStatusException("Did not expect username! User has already been created and associated in the base relation")
1106
+
1107
+ if inputs[KEY__username] is None:
1108
+ inputs[KEY__username] = found_username
1101
1109
 
1102
1110
  # We now create the user if the user doesn't exist
1103
1111
  account_existed = False
@@ -1118,22 +1126,6 @@ WHERE
1118
1126
  if account == jaaql_singleton[KG__jaaql__the_anonymous_user]:
1119
1127
  raise HttpStatusException("Cannot re-invite the anonymous user")
1120
1128
 
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
1129
  # We abort if there have been too many requests. Everything is rolled back
1138
1130
  count = count_for_security_event(self.jaaql_lookup_connection, self.get_db_crypt_key(), self.get_vault_repeatable_salt(),
1139
1131
  EMAIL_TYPE__signup, EMAIL_TYPE__already_signed_up, new_account_id)
@@ -1158,6 +1150,24 @@ WHERE
1158
1150
  inputs[KG__security_event__application], template[KG__email_template__name], unlock_code,
1159
1151
  new_account_id)
1160
1152
 
1153
+ data_view = sign_up_template[KG__email_template__data_view]
1154
+ if re.match(REGEX__dmbs_object_name, data_view) is None:
1155
+ raise HttpStatusException("Unsafe data view specified for sign up: Found '" + str(data_view) + "' na did not match regex " + REGEX__dmbs_object_name)
1156
+ data_query = f'SELECT * FROM "{data_view}"'
1157
+ submit_data[KEY_query] = data_query
1158
+ try:
1159
+ submit_data[KEY__parameters] = {} # Might at some point have some data parameters but for now none
1160
+ sign_up_data = submit(self.vault, self.config, self.get_db_crypt_key(), self.jaaql_lookup_connection, submit_data, new_account_id,
1161
+ None, self.cached_canned_query_service, as_objects=False, singleton=True)
1162
+ sign_up_data = objectify(sign_up_data, singleton=True)
1163
+ if dbms_user_column_name in sign_up_data:
1164
+ del sign_up_data[dbms_user_column_name] # Remove it. Not harmful that it's there as jaaql knows this already
1165
+ except HttpSingletonStatusException:
1166
+ raise HttpSingletonStatusException("No or multiple rows returned from " + data_view)
1167
+ for key, val in sign_up_data.items():
1168
+ perms_check[key] = val
1169
+ sign_up_data = perms_check
1170
+
1161
1171
  sign_up_data[EMAIL_PARAM__app_url] = app[KG__application__base_url]
1162
1172
  sign_up_data[EMAIL_PARAM__app_name] = app[KG__application__name]
1163
1173
  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.4
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