square-administration 2.0.0__tar.gz → 2.1.0__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.
- {square_administration-2.0.0 → square_administration-2.1.0}/PKG-INFO +5 -1
- {square_administration-2.0.0 → square_administration-2.1.0}/README.md +4 -0
- {square_administration-2.0.0 → square_administration-2.1.0}/setup.py +1 -1
- {square_administration-2.0.0 → square_administration-2.1.0}/square_administration/routes/authentication.py +118 -0
- {square_administration-2.0.0 → square_administration-2.1.0}/square_administration.egg-info/PKG-INFO +5 -1
- {square_administration-2.0.0 → square_administration-2.1.0}/setup.cfg +0 -0
- {square_administration-2.0.0 → square_administration-2.1.0}/square_administration/__init__.py +0 -0
- {square_administration-2.0.0 → square_administration-2.1.0}/square_administration/configuration.py +0 -0
- {square_administration-2.0.0 → square_administration-2.1.0}/square_administration/data/config.ini +0 -0
- {square_administration-2.0.0 → square_administration-2.1.0}/square_administration/main.py +0 -0
- {square_administration-2.0.0 → square_administration-2.1.0}/square_administration/messages.py +0 -0
- {square_administration-2.0.0 → square_administration-2.1.0}/square_administration/pydantic_models/__init__.py +0 -0
- {square_administration-2.0.0 → square_administration-2.1.0}/square_administration/pydantic_models/authentication.py +0 -0
- {square_administration-2.0.0 → square_administration-2.1.0}/square_administration/pydantic_models/core.py +0 -0
- {square_administration-2.0.0 → square_administration-2.1.0}/square_administration/routes/__init__.py +0 -0
- {square_administration-2.0.0 → square_administration-2.1.0}/square_administration/routes/core.py +0 -0
- {square_administration-2.0.0 → square_administration-2.1.0}/square_administration/utils/__init__.py +0 -0
- {square_administration-2.0.0 → square_administration-2.1.0}/square_administration.egg-info/SOURCES.txt +0 -0
- {square_administration-2.0.0 → square_administration-2.1.0}/square_administration.egg-info/dependency_links.txt +0 -0
- {square_administration-2.0.0 → square_administration-2.1.0}/square_administration.egg-info/requires.txt +0 -0
- {square_administration-2.0.0 → square_administration-2.1.0}/square_administration.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: square_administration
|
3
|
-
Version: 2.
|
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
|
@@ -32,6 +32,10 @@ pip install square_administration
|
|
32
32
|
|
33
33
|
## changelog
|
34
34
|
|
35
|
+
### v2.1.0
|
36
|
+
|
37
|
+
- add authentication -> logout_v0, generate_access_token_v0.
|
38
|
+
|
35
39
|
### v2.0.0
|
36
40
|
|
37
41
|
- remove refresh token from response body and send in cookies.
|
@@ -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
|
+
)
|
{square_administration-2.0.0 → square_administration-2.1.0}/square_administration.egg-info/PKG-INFO
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: square-administration
|
3
|
-
Version: 2.
|
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
|
@@ -32,6 +32,10 @@ pip install square_administration
|
|
32
32
|
|
33
33
|
## changelog
|
34
34
|
|
35
|
+
### v2.1.0
|
36
|
+
|
37
|
+
- add authentication -> logout_v0, generate_access_token_v0.
|
38
|
+
|
35
39
|
### v2.0.0
|
36
40
|
|
37
41
|
- remove refresh token from response body and send in cookies.
|
File without changes
|
{square_administration-2.0.0 → square_administration-2.1.0}/square_administration/__init__.py
RENAMED
File without changes
|
{square_administration-2.0.0 → square_administration-2.1.0}/square_administration/configuration.py
RENAMED
File without changes
|
{square_administration-2.0.0 → square_administration-2.1.0}/square_administration/data/config.ini
RENAMED
File without changes
|
File without changes
|
{square_administration-2.0.0 → square_administration-2.1.0}/square_administration/messages.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{square_administration-2.0.0 → square_administration-2.1.0}/square_administration/routes/__init__.py
RENAMED
File without changes
|
{square_administration-2.0.0 → square_administration-2.1.0}/square_administration/routes/core.py
RENAMED
File without changes
|
{square_administration-2.0.0 → square_administration-2.1.0}/square_administration/utils/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|