future-framework 2.1.0__tar.gz → 2.1.1__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 (83) hide show
  1. {future_framework-2.1.0 → future_framework-2.1.1}/PKG-INFO +1 -1
  2. {future_framework-2.1.0 → future_framework-2.1.1}/future/application.py +1 -1
  3. {future_framework-2.1.0 → future_framework-2.1.1}/future/seeder.py +12 -4
  4. {future_framework-2.1.0 → future_framework-2.1.1}/pyproject.toml +1 -1
  5. {future_framework-2.1.0 → future_framework-2.1.1}/LICENSE +0 -0
  6. {future_framework-2.1.0 → future_framework-2.1.1}/README.md +0 -0
  7. {future_framework-2.1.0 → future_framework-2.1.1}/future/__init__.py +0 -0
  8. {future_framework-2.1.0 → future_framework-2.1.1}/future/authentication/Auth0Authentication.py +0 -0
  9. {future_framework-2.1.0 → future_framework-2.1.1}/future/authentication/AzureADAuthentication.py +0 -0
  10. {future_framework-2.1.0 → future_framework-2.1.1}/future/authentication/BasicAuthentication.py +0 -0
  11. {future_framework-2.1.0 → future_framework-2.1.1}/future/authentication/KerberosAuthentication.py +0 -0
  12. {future_framework-2.1.0 → future_framework-2.1.1}/future/authentication/KeycloakAuthentication.py +0 -0
  13. {future_framework-2.1.0 → future_framework-2.1.1}/future/authentication/OAuth2Authentication.py +0 -0
  14. {future_framework-2.1.0 → future_framework-2.1.1}/future/authentication/OpenIdConnectAuthentication.py +0 -0
  15. {future_framework-2.1.0 → future_framework-2.1.1}/future/authentication/SAMLAuthentication.py +0 -0
  16. {future_framework-2.1.0 → future_framework-2.1.1}/future/authentication/__init__.py +0 -0
  17. {future_framework-2.1.0 → future_framework-2.1.1}/future/cli.py +0 -0
  18. {future_framework-2.1.0 → future_framework-2.1.1}/future/controllers/DebugController.py +0 -0
  19. {future_framework-2.1.0 → future_framework-2.1.1}/future/controllers/GraphQLController.py +0 -0
  20. {future_framework-2.1.0 → future_framework-2.1.1}/future/controllers/OpenAPIController.py +0 -0
  21. {future_framework-2.1.0 → future_framework-2.1.1}/future/controllers/WebSocketController.py +0 -0
  22. {future_framework-2.1.0 → future_framework-2.1.1}/future/controllers/WelcomeController.py +0 -0
  23. {future_framework-2.1.0 → future_framework-2.1.1}/future/controllers/__init__.py +0 -0
  24. {future_framework-2.1.0 → future_framework-2.1.1}/future/database.py +0 -0
  25. {future_framework-2.1.0 → future_framework-2.1.1}/future/databases/ClickhouseDatabase.py +0 -0
  26. {future_framework-2.1.0 → future_framework-2.1.1}/future/databases/ElasticsearchDatabase.py +0 -0
  27. {future_framework-2.1.0 → future_framework-2.1.1}/future/databases/MongoDBDatabase.py +0 -0
  28. {future_framework-2.1.0 → future_framework-2.1.1}/future/databases/MySQLDatabase.py +0 -0
  29. {future_framework-2.1.0 → future_framework-2.1.1}/future/databases/PostgresDatabase.py +0 -0
  30. {future_framework-2.1.0 → future_framework-2.1.1}/future/databases/RedisDatabase.py +0 -0
  31. {future_framework-2.1.0 → future_framework-2.1.1}/future/databases/SQLiteDatabase.py +0 -0
  32. {future_framework-2.1.0 → future_framework-2.1.1}/future/databases/__init__.py +0 -0
  33. {future_framework-2.1.0 → future_framework-2.1.1}/future/exceptions.py +0 -0
  34. {future_framework-2.1.0 → future_framework-2.1.1}/future/interfaces/IAuthentication.py +0 -0
  35. {future_framework-2.1.0 → future_framework-2.1.1}/future/interfaces/IController.py +0 -0
  36. {future_framework-2.1.0 → future_framework-2.1.1}/future/interfaces/IDatabase.py +0 -0
  37. {future_framework-2.1.0 → future_framework-2.1.1}/future/interfaces/IMiddleware.py +0 -0
  38. {future_framework-2.1.0 → future_framework-2.1.1}/future/interfaces/IModel.py +0 -0
  39. {future_framework-2.1.0 → future_framework-2.1.1}/future/interfaces/IPlugin.py +0 -0
  40. {future_framework-2.1.0 → future_framework-2.1.1}/future/interfaces/ITask.py +0 -0
  41. {future_framework-2.1.0 → future_framework-2.1.1}/future/interfaces/__init__.py +0 -0
  42. {future_framework-2.1.0 → future_framework-2.1.1}/future/interfacing.py +0 -0
  43. {future_framework-2.1.0 → future_framework-2.1.1}/future/lifespan.py +0 -0
  44. {future_framework-2.1.0 → future_framework-2.1.1}/future/logger.py +0 -0
  45. {future_framework-2.1.0 → future_framework-2.1.1}/future/middleware/BruteforcePreventionMiddleware.py +0 -0
  46. {future_framework-2.1.0 → future_framework-2.1.1}/future/middleware/CORSMiddleware.py +0 -0
  47. {future_framework-2.1.0 → future_framework-2.1.1}/future/middleware/CSRFMiddleware.py +0 -0
  48. {future_framework-2.1.0 → future_framework-2.1.1}/future/middleware/GZipMiddleware.py +0 -0
  49. {future_framework-2.1.0 → future_framework-2.1.1}/future/middleware/HTAccessConfuserMiddleware.py +0 -0
  50. {future_framework-2.1.0 → future_framework-2.1.1}/future/middleware/HeaderConfuserMiddleware.py +0 -0
  51. {future_framework-2.1.0 → future_framework-2.1.1}/future/middleware/RateLimitMiddleware.py +0 -0
  52. {future_framework-2.1.0 → future_framework-2.1.1}/future/middleware/ResponseCodeConfuserMiddleware.py +0 -0
  53. {future_framework-2.1.0 → future_framework-2.1.1}/future/middleware/SQLiConfuserMiddleware.py +0 -0
  54. {future_framework-2.1.0 → future_framework-2.1.1}/future/middleware/ScopeValidationMiddleware.py +0 -0
  55. {future_framework-2.1.0 → future_framework-2.1.1}/future/middleware/SessionMiddleware.py +0 -0
  56. {future_framework-2.1.0 → future_framework-2.1.1}/future/middleware/TestMiddlewareRequest.py +0 -0
  57. {future_framework-2.1.0 → future_framework-2.1.1}/future/middleware/TestMiddlewareResponse.py +0 -0
  58. {future_framework-2.1.0 → future_framework-2.1.1}/future/middleware/WebServerConfuserMiddleware.py +0 -0
  59. {future_framework-2.1.0 → future_framework-2.1.1}/future/middleware/__init__.py +0 -0
  60. {future_framework-2.1.0 → future_framework-2.1.1}/future/migrations.py +0 -0
  61. {future_framework-2.1.0 → future_framework-2.1.1}/future/models/PostModel.py +0 -0
  62. {future_framework-2.1.0 → future_framework-2.1.1}/future/models/Query.py +0 -0
  63. {future_framework-2.1.0 → future_framework-2.1.1}/future/models/UserModel.py +0 -0
  64. {future_framework-2.1.0 → future_framework-2.1.1}/future/models/__init__.py +0 -0
  65. {future_framework-2.1.0 → future_framework-2.1.1}/future/openapi.py +0 -0
  66. {future_framework-2.1.0 → future_framework-2.1.1}/future/plugins/ElasticsearchPlugin.py +0 -0
  67. {future_framework-2.1.0 → future_framework-2.1.1}/future/plugins/__init__.py +0 -0
  68. {future_framework-2.1.0 → future_framework-2.1.1}/future/request.py +0 -0
  69. {future_framework-2.1.0 → future_framework-2.1.1}/future/response.py +0 -0
  70. {future_framework-2.1.0 → future_framework-2.1.1}/future/routing.py +0 -0
  71. {future_framework-2.1.0 → future_framework-2.1.1}/future/settings.py +0 -0
  72. {future_framework-2.1.0 → future_framework-2.1.1}/future/tasks/CheckDNSTask.py +0 -0
  73. {future_framework-2.1.0 → future_framework-2.1.1}/future/tasks/CheckDiskUsageTask.py +0 -0
  74. {future_framework-2.1.0 → future_framework-2.1.1}/future/tasks/CheckHttpStatusTask.py +0 -0
  75. {future_framework-2.1.0 → future_framework-2.1.1}/future/tasks/CheckMemoryUsageTask.py +0 -0
  76. {future_framework-2.1.0 → future_framework-2.1.1}/future/tasks/CheckSSHBannerTask.py +0 -0
  77. {future_framework-2.1.0 → future_framework-2.1.1}/future/tasks/CheckSystemUptimeTask.py +0 -0
  78. {future_framework-2.1.0 → future_framework-2.1.1}/future/tasks/DailyBackupTask.py +0 -0
  79. {future_framework-2.1.0 → future_framework-2.1.1}/future/tasks/SyncTaskExample.py +0 -0
  80. {future_framework-2.1.0 → future_framework-2.1.1}/future/tasks/__init__.py +0 -0
  81. {future_framework-2.1.0 → future_framework-2.1.1}/future/taskscheduler.py +0 -0
  82. {future_framework-2.1.0 → future_framework-2.1.1}/future/testclient.py +0 -0
  83. {future_framework-2.1.0 → future_framework-2.1.1}/future/types.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: future-framework
3
- Version: 2.1.0
3
+ Version: 2.1.1
4
4
  Summary: ASGI-based framework for web APIs
5
5
  License: LICENSE
6
6
  License-File: LICENSE
@@ -402,7 +402,7 @@ class Future:
402
402
  try:
403
403
  host_domain = request.host.split("/")[0] if "/" in request.host else request.host
404
404
  if not self._validate_domain_access(host_domain):
405
- raise HTTPException("Forbidden", 403)
405
+ raise HTTPException("Not Found", 404)
406
406
 
407
407
  debug = bool(self.config.get("APP_DEBUG")) if self.config else False
408
408
  route_host = host_domain.rsplit(":", 1)[0] if debug and ":" in host_domain else host_domain
@@ -65,7 +65,7 @@ class SeedGenerator:
65
65
  return model
66
66
  raise ValueError(f"Model not found: {name}")
67
67
 
68
- def value_expr(self, field, annotation):
68
+ def value_expr(self, field, annotation, model_name=None):
69
69
  origin = get_origin(annotation)
70
70
  if origin is Union or origin is UnionType:
71
71
  args = [arg for arg in get_args(annotation) if arg is not type(None)]
@@ -124,9 +124,9 @@ class SeedGenerator:
124
124
  if field == "trade_type" or field == "side":
125
125
  return 'fake.random_element(elements=("BUY", "SELL"))'
126
126
  if field == "percentage_change_interval":
127
- return 'fake.random_element(elements=("TODAY", "ONE_WEEK", "ONE_MONTH", "THREE_MONTHS", "ONE_YEAR"))'
127
+ return 'fake.random_element(elements=("UNKNOWN", "LESS_THAN_ONE", "ONE_TO_FIVE", "FIVE_TO_TEN", "TEN_TO_TWENTY", "TWENTY_TO_THIRTY", "OVER_ONE_HUNDRED"))'
128
128
  if field == "group_type":
129
- return 'fake.random_element(elements=("COMMON_SHARE", "FUND", "ETF", "WARRANT"))'
129
+ return 'fake.random_element(elements=("COMMON_SHARE", "FND", "ETF", "WARRANT", "OTHER"))'
130
130
  if field == "kind":
131
131
  return 'fake.random_element(elements=("instruments", "users"))'
132
132
  if field == "members":
@@ -137,6 +137,14 @@ class SeedGenerator:
137
137
  return "fake.sentence()"
138
138
  if field == "password_hash":
139
139
  return "fake.sha256()"
140
+ if field == "name" and model_name == "NordnetInstrumentModel":
141
+ return 'fake.random_element(elements=("Equinor", "Nordnet Global Indeks", "DNB Teknologi A", "T1 Energy", "Aker BP"))'
142
+ if field == "name" and model_name == "IndexModel":
143
+ return 'fake.random_element(elements=("Nordic Momentum", "Top Shareville Traders", "Consensus Buys", "Long-term Winners"))'
144
+ if field == "country":
145
+ return 'fake.random_element(elements=("NO", "SE", "DK", "FI"))'
146
+ if field == "slug":
147
+ return "fake.slug()"
140
148
  if "name" in field or "username" in field:
141
149
  return "fake.user_name()"
142
150
  if field in ("description", "text", "body", "content") or field.endswith("_original") or field.endswith("_translated"):
@@ -155,7 +163,7 @@ class SeedGenerator:
155
163
  current = non_null[0] if non_null else str
156
164
  if isinstance(current, type) and issubclass(current, IModel):
157
165
  continue
158
- args.append(f" {field}={self.value_expr(field, annotation)},")
166
+ args.append(f" {field}={self.value_expr(field, annotation, name)},")
159
167
  if args:
160
168
  construct = f" await {name}(\n" + "\n".join(args) + f"\n ).save()"
161
169
  else:
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "future-framework"
3
- version = "2.1.0"
3
+ version = "2.1.1"
4
4
  description = "ASGI-based framework for web APIs"
5
5
  authors = ["nicolaipre"]
6
6
  license = "LICENSE"