clear-skies 1.22.15__py3-none-any.whl → 1.22.17__py3-none-any.whl

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.

Potentially problematic release.


This version of clear-skies might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: clear-skies
3
- Version: 1.22.15
3
+ Version: 1.22.17
4
4
  Summary: A framework for building backends in the cloud
5
5
  Home-page: https://github.com/cmancone/clearskies
6
6
  License: MIT
@@ -13,6 +13,8 @@ Classifier: License :: OSI Approved :: MIT License
13
13
  Classifier: Programming Language :: Python :: 3
14
14
  Classifier: Programming Language :: Python :: 3.10
15
15
  Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
16
18
  Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
17
19
  Provides-Extra: jose
18
20
  Provides-Extra: jwcrypto
@@ -133,7 +133,7 @@ clearskies/functional/validations.py,sha256=f1fTQ4rdFZouxoovAPg-YAgf0Q0QNpKEzxWW
133
133
  clearskies/handlers/__init__.py,sha256=9tH0zk4g7Mt22opD1NlynqXwwMX2DHzLmAVihZsJsfU,1011
134
134
  clearskies/handlers/advanced_search.py,sha256=UbWDntGAGD5NM61yKEws5MfG0Xy3K_fn-i-X9FG-mKs,13746
135
135
  clearskies/handlers/base.py,sha256=aFRm5R6oDJWO4TTxz9BusxuDF3aH_-QVGJUP9atNzLc,22787
136
- clearskies/handlers/callable.py,sha256=wwAoiWFhT331FOS0Q8Ci0jBURq_-tSt8zqYXSJWZ3FI,8281
136
+ clearskies/handlers/callable.py,sha256=wmPhfeORfsXKxZyj1ECH9xw0BeSIxOKjsi9UsWXWQs4,8388
137
137
  clearskies/handlers/create.py,sha256=xj_hVYma2sKDK5Vq_R9wo8f0ZXfGlXTkYU71AMyKF2U,1232
138
138
  clearskies/handlers/crud_by_method.py,sha256=BOkPX-LUvQrbRLSbyTfRh4c8nPF51dZEXSKOl7m9ZYA,435
139
139
  clearskies/handlers/database_connector.py,sha256=XLF_Y3aYnjDtOVP_MOtT5mbI3lHR8S-viOxPiqEAamE,1050
@@ -159,11 +159,11 @@ clearskies/handlers/simple_search.py,sha256=bSfq8rzdqkBj-dTGUBSZ1EkfjzUWHID7mKD2
159
159
  clearskies/handlers/update.py,sha256=rx8HW87Pfh95e_9nEfKKnxfkh2HBlCUdYqVwljtXiJ8,4116
160
160
  clearskies/handlers/write.py,sha256=Gu1w1PQ1F7tlqCqALorMRek3UH6IkViPIO195dxPd8k,9372
161
161
  clearskies/input_outputs/__init__.py,sha256=mQWL-u41FRTrPGuHe8FhLmcHjAEaUxjFwUf7RgDcbAs,182
162
- clearskies/input_outputs/cli.py,sha256=DCoSHn2fd7cwi4-3eZU_M0-Txk85PQNB1x6D_B50f1M,6529
162
+ clearskies/input_outputs/cli.py,sha256=ar2TeW-24BdCRbw9JFilZyJlZ2Qg34uwluutKx1XKSA,6694
163
163
  clearskies/input_outputs/exceptions/__init__.py,sha256=bc5Tc1XBZnqA1fKbk7pk5hyx102vqx3sDE19E03xGk4,82
164
164
  clearskies/input_outputs/exceptions/cli_input_error.py,sha256=kOFU8aLTLmeTL_AKDshxMu8_ufildg6p8ndhE1xHfb0,41
165
165
  clearskies/input_outputs/exceptions/cli_not_found.py,sha256=JBBuZA9ZwdkPhd3a0qaGgEPQrxh1fehy4R3ZaV2gWXU,39
166
- clearskies/input_outputs/input_output.py,sha256=vYKn9SE5erS4LuOhhAsXqaOEsGXwZ1NJ4v85KN1Xg6A,4501
166
+ clearskies/input_outputs/input_output.py,sha256=TyhiHfPzQzjN9lW6hCnrGil-_M_vlICn7uVZvEPFwZI,4666
167
167
  clearskies/input_outputs/wsgi.py,sha256=9p82eJP5FUAI6jbIojvydG3_9gncX7vcUACQMyRN9x4,3142
168
168
  clearskies/input_requirements/__init__.py,sha256=cciSC614VlYsCeTBX69ZCBU6QByT8NNlzWu_n2SVieY,2106
169
169
  clearskies/input_requirements/after.py,sha256=TXy8bIVz_77a8oJuohPwoM5E--AOVWsOSjjh5PpA2Ys,1544
@@ -207,7 +207,7 @@ clearskies/tests/simple_api/models/__init__.py,sha256=nUA0W6fgXw_Bxa9CudkaDkC80t
207
207
  clearskies/tests/simple_api/models/status.py,sha256=PEhPbaQh5qdUNHp8O0gz91LOLENAEBtqSaHxUPXchaM,699
208
208
  clearskies/tests/simple_api/models/user.py,sha256=5_P4Tp1tTdX7PkMJ__epPM5MA7JAeVYGas69vcWloLc,819
209
209
  clearskies/tests/simple_api/users_api.py,sha256=KYXCgEofDxHeRdQK67txN5oYUPvxxmB8JTku7L-apk4,2344
210
- clear_skies-1.22.15.dist-info/LICENSE,sha256=3Ehd0g3YOpCj8sqj0Xjq5qbOtjjgk9qzhhD9YjRQgOA,1053
211
- clear_skies-1.22.15.dist-info/METADATA,sha256=8Tj7H7HxNpEvYI9L-MYxApcMXNSjyqLmGFhAGW219zA,1818
212
- clear_skies-1.22.15.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
213
- clear_skies-1.22.15.dist-info/RECORD,,
210
+ clear_skies-1.22.17.dist-info/LICENSE,sha256=3Ehd0g3YOpCj8sqj0Xjq5qbOtjjgk9qzhhD9YjRQgOA,1053
211
+ clear_skies-1.22.17.dist-info/METADATA,sha256=FrDzoVin5njD_n8BwJSkfIE2za9cKltGlgiaf5rMv8s,1920
212
+ clear_skies-1.22.17.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
213
+ clear_skies-1.22.17.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.7.0
2
+ Generator: poetry-core 1.9.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -29,6 +29,7 @@ class Callable(Base, SchemaHelper):
29
29
  "writeable_columns": None,
30
30
  "doc_model_name": "",
31
31
  "doc_response_data_schema": None,
32
+ "allow_non_json_bodies": False,
32
33
  }
33
34
 
34
35
  def __init__(self, di):
@@ -97,7 +98,7 @@ class Callable(Base, SchemaHelper):
97
98
 
98
99
  def request_data(self, input_output, required=True):
99
100
  if not self.configuration("schema"):
100
- return input_output.request_data(required=required)
101
+ return input_output.request_data(required=required, allow_non_json_bodies=self.configuration("allow_non_json_bodies"))
101
102
  # we have to map from internal names to external names, because case mapping
102
103
  # isn't always one-to-one, so we want to do it exactly the same way that the documentation
103
104
  # is built.
@@ -79,10 +79,10 @@ class CLI:
79
79
  def get_request_method(self):
80
80
  return self._request_method if self._request_method else "GET"
81
81
 
82
- def request_data(self, required=True):
83
- request_data = self.json_body(False)
82
+ def request_data(self, required=True, allow_non_json_bodies=False):
83
+ request_data = self.json_body(False, allow_non_json_bodies=allow_non_json_bodies)
84
84
  if not request_data:
85
- if self.has_body():
85
+ if self.has_body() and not allow_non_json_bodies:
86
86
  raise ClientError("Request body was not valid JSON")
87
87
  request_data = {}
88
88
  return request_data
@@ -126,7 +126,7 @@ class CLI:
126
126
  # in the _get_json_body method
127
127
  return self._cached_body
128
128
 
129
- def json_body(self, required=True):
129
+ def json_body(self, required=True, allow_non_json_bodies=False):
130
130
  json = self._get_json_body()
131
131
  # if we get None then either the body was not JSON or was empty.
132
132
  # If it is required then we have an exception either way. If it is not required
@@ -134,7 +134,7 @@ class CLI:
134
134
  # if json is None and there is an actual request body. If json is none, the body is empty,
135
135
  # and it was not required, then we can just return None
136
136
  if json is None:
137
- if required or self.has_body():
137
+ if required or (self.has_body() and not allow_non_json_bodies):
138
138
  raise ClientError("Request body was not valid JSON")
139
139
  return json
140
140
 
@@ -69,15 +69,15 @@ class InputOutput(ABC):
69
69
  else:
70
70
  self._routing_data[key] = value
71
71
 
72
- def request_data(self, required=True):
73
- request_data = self.json_body(False)
72
+ def request_data(self, required=True, allow_non_json_bodies=False):
73
+ request_data = self.json_body(False, allow_non_json_bodies=allow_non_json_bodies)
74
74
  if not request_data:
75
- if self.has_body():
75
+ if self.has_body() and not allow_non_json_bodies:
76
76
  raise ClientError("Request body was not valid JSON")
77
77
  request_data = {}
78
78
  return request_data
79
79
 
80
- def json_body(self, required=True):
80
+ def json_body(self, required=True, allow_non_json_bodies=False):
81
81
  json = self._get_json_body()
82
82
  # if we get None then either the body was not JSON or was empty.
83
83
  # If it is required then we have an exception either way. If it is not required
@@ -85,7 +85,7 @@ class InputOutput(ABC):
85
85
  # if json is None and there is an actual request body. If json is none, the body is empty,
86
86
  # and it was not required, then we can just return None
87
87
  if json is None:
88
- if required or self.has_body():
88
+ if required or (self.has_body() and not allow_non_json_bodies):
89
89
  raise ClientError("Request body was not valid JSON")
90
90
  return json
91
91