square-administration 2.0.0__py3-none-any.whl → 2.1.0__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.
@@ -256,3 +256,121 @@ async def remove_app_for_self_v0(
256
256
  return JSONResponse(
257
257
  status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, content=output_content
258
258
  )
259
+
260
+
261
+ @router.delete("/logout/v0")
262
+ @global_object_square_logger.async_auto_logger
263
+ async def logout_v0(
264
+ refresh_token: Annotated[str, Header()],
265
+ ):
266
+
267
+ try:
268
+ """
269
+ validation
270
+ """
271
+ # pass
272
+ """
273
+ main process
274
+ """
275
+ response = global_object_square_authentication_helper.logout_v0(
276
+ refresh_token=refresh_token
277
+ )
278
+ """
279
+ return value
280
+ """
281
+
282
+ return JSONResponse(
283
+ status_code=status.HTTP_200_OK,
284
+ content=response,
285
+ )
286
+ except HTTPError as http_error:
287
+ global_object_square_logger.logger.error(http_error, exc_info=True)
288
+ """
289
+ rollback logic
290
+ """
291
+ # pass
292
+ return JSONResponse(
293
+ status_code=http_error.response.status_code,
294
+ content=json.loads(http_error.response.content),
295
+ )
296
+ except HTTPException as http_exception:
297
+ global_object_square_logger.logger.error(http_exception, exc_info=True)
298
+ """
299
+ rollback logic
300
+ """
301
+ # pass
302
+ return JSONResponse(
303
+ status_code=http_exception.status_code, content=http_exception.detail
304
+ )
305
+ except Exception as e:
306
+ global_object_square_logger.logger.error(e, exc_info=True)
307
+ """
308
+ rollback logic
309
+ """
310
+ # pass
311
+ output_content = get_api_output_in_standard_format(
312
+ message=messages["GENERIC_500"],
313
+ log=str(e),
314
+ )
315
+ return JSONResponse(
316
+ status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, content=output_content
317
+ )
318
+
319
+
320
+ @router.get("/generate_access_token/v0")
321
+ @global_object_square_logger.async_auto_logger
322
+ async def generate_access_token_v0(
323
+ refresh_token: Annotated[str, Header()],
324
+ ):
325
+
326
+ try:
327
+ """
328
+ validation
329
+ """
330
+ # pass
331
+ """
332
+ main process
333
+ """
334
+ response = global_object_square_authentication_helper.generate_access_token_v0(
335
+ refresh_token=refresh_token
336
+ )
337
+ """
338
+ return value
339
+ """
340
+
341
+ return JSONResponse(
342
+ status_code=status.HTTP_200_OK,
343
+ content=response,
344
+ )
345
+ except HTTPError as http_error:
346
+ global_object_square_logger.logger.error(http_error, exc_info=True)
347
+ """
348
+ rollback logic
349
+ """
350
+ # pass
351
+ return JSONResponse(
352
+ status_code=http_error.response.status_code,
353
+ content=json.loads(http_error.response.content),
354
+ )
355
+ except HTTPException as http_exception:
356
+ global_object_square_logger.logger.error(http_exception, exc_info=True)
357
+ """
358
+ rollback logic
359
+ """
360
+ # pass
361
+ return JSONResponse(
362
+ status_code=http_exception.status_code, content=http_exception.detail
363
+ )
364
+ except Exception as e:
365
+ global_object_square_logger.logger.error(e, exc_info=True)
366
+ """
367
+ rollback logic
368
+ """
369
+ # pass
370
+ output_content = get_api_output_in_standard_format(
371
+ message=messages["GENERIC_500"],
372
+ log=str(e),
373
+ )
374
+ return JSONResponse(
375
+ status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, content=output_content
376
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: square-administration
3
- Version: 2.0.0
3
+ Version: 2.1.0
4
4
  Summary: common business layer for my personal server.
5
5
  Home-page: https://github.com/thepmsquare/square_administration
6
6
  Author: thePmSquare
@@ -42,6 +42,10 @@ pip install square_administration
42
42
 
43
43
  ## changelog
44
44
 
45
+ ### v2.1.0
46
+
47
+ - add authentication -> logout_v0, generate_access_token_v0.
48
+
45
49
  ### v2.0.0
46
50
 
47
51
  - remove refresh token from response body and send in cookies.
@@ -7,10 +7,10 @@ square_administration/pydantic_models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCe
7
7
  square_administration/pydantic_models/authentication.py,sha256=DWXctw5UWzkSVY7nMIQZsRhmgW3OK455OVcoUpJrPY0,202
8
8
  square_administration/pydantic_models/core.py,sha256=HUMrBmfKrXeL-126gE5j2povdVmktn8XLg2tHEdeXTk,344
9
9
  square_administration/routes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
- square_administration/routes/authentication.py,sha256=Jifdsyd0NzrbR7X0OFJGwMl9JFhU4jXjhBIkIqwLkGU,7787
10
+ square_administration/routes/authentication.py,sha256=KSj8oWB3Jw7caVP1z1OoWbQAdawvS04P-4xT2OmzPyo,11029
11
11
  square_administration/routes/core.py,sha256=65_FIZilintZvbHx7r25UQbgN-oKdQ92-Nv3kpwKX6s,5374
12
12
  square_administration/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
- square_administration-2.0.0.dist-info/METADATA,sha256=iONUBJCUqHZq9s9-xT7HEqqvytZusnw3EfXFfEItvP8,1477
14
- square_administration-2.0.0.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
15
- square_administration-2.0.0.dist-info/top_level.txt,sha256=8WFipDrMQUPRDo5AvipxU1YK3wZtWZyCUMWaR416zAw,22
16
- square_administration-2.0.0.dist-info/RECORD,,
13
+ square_administration-2.1.0.dist-info/METADATA,sha256=HAb400ntVv1QSFh6au4oi08tklXJkAUq0FYJvef0Lls,1551
14
+ square_administration-2.1.0.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
15
+ square_administration-2.1.0.dist-info/top_level.txt,sha256=8WFipDrMQUPRDo5AvipxU1YK3wZtWZyCUMWaR416zAw,22
16
+ square_administration-2.1.0.dist-info/RECORD,,