25 Commits

Author SHA1 Message Date
3b64aeb97b Add OAuth 2.0 authorization login (#293)
* [WIP] Add OAuth 2.0 authorization login

* Add social user relationship table

* Update social user relationship table back_populates

* Add OAuth 2.0 related interface

* Automatically redirect authorization addresses

* Update OAuth2 authorization to GitHub

* Add implementation code

* fix the callback interface return

* fix typo

* fix the api return

* fix imports

* Fix logic for creating system users and social tables

* Fix user information storage

* Add OAuth2 source link

* remove unnecessary db refresh

* remove the front end docker-compose annotation
2024-03-15 13:46:43 +08:00
a41b1673e5 Update schemas naming style (#272) 2024-01-18 19:27:41 +08:00
5c7d6659cf Reconstruct RBAC authentication logic (#264)
* Reconstruct RBAC authentication logic

* fix typo

* Migrate casbin sqla Adapter to redis

* Delete casbin model conf file

* Add permission dependencies

* Add request permission depends on execution condition

* Update openapi authorization method

* Add request permission identity

* Add request permission dependency description

* Migrate casbin redis adapter to sqla

* Update menu model and add function

* Fix menu permission identification

* Update user partial interface permissions

* Update menu table SQL

* Add role menu permission description to README

* fix README typo

* Simplify permission dependency injection

* Fix menu authorization store

* Fix interface permission dependency order

* Update role menu permission flag

* Update the background permission logic of the interface
2024-01-08 09:35:47 +08:00
7bfc7908ab Migrate to pydantic-v2 (#246)
* update the schema to pydantic-v2

* upgrade the ruff version in pre-commit

* update pagination to p-v2

* update encoder to p-v2

* update response_schema to p-v2

* update exception_handler to p-v2

* update config to p-v2

* update crud base to p-v2

* Migrate the JSON Encoder to the official one to reduce maintenance costs

* updated readme description

* restore the bcrypt compatible version

* fix validation error log code return format

* Fix manual processing method for GetCurrentUserInfo

* Integrate pydantic validate exceptions and user exceptions

* Fix validation exception handler

* add custom open response code

* Add a stand-alone assertion error handler

* Restore todo deleted by v1 branch to v2

* Add email and phone number types
2023-12-20 23:56:37 +08:00
470cd9a9c2 adopt ruff formatter (#242)
* adopt ruff formatter

* Fix merge format
2023-11-22 19:09:08 +08:00
46d6fbccf5 Simplified query interface returns data serialization (#219)
* Simplified query interface returns data serialization

* reply to the inquiry pydantic verification

* restore import sorting
2023-09-27 10:46:30 +08:00
09b42c3882 Update the nickname field creation logic (#196)
* Update the nickname field creation logic

* fix nickname field transfer
2023-08-04 19:33:40 +08:00
c1295dda84 Fix casbin async enforcer (#192)
* rename the file casbin_rbac to rbac

* omit

* fix casbin async enforcer

* update the group rule interface access permissions

* add menu permission validation

* update the init test data sql

* add the staff field to the user information query return
2023-07-31 17:12:07 +08:00
b41aca53ad Update roles and nickname fields to be optiona (#190)
* Update roles and nickname fields to be optional

* Update the department and role fields is optional

* fix role judgment

* New add user interface

* update interface permissions

* fix nickname judgment
2023-07-31 11:52:26 +08:00
f21006000a Update user role interface to standalone (#177)
* Update user role interface to standalone

* Fix the userinfo schema department field type

* fix update userinfo values

* fix update user avatar value

* update readme docs

* update test data sql

* update readme typo

* update readme docs
2023-07-14 17:01:47 +08:00
22e205524b Enable login interface captcha function (#165)
* enable captcha login

* Delete menu meta column

* Update the login interface rate limit
2023-07-02 16:05:40 +08:00
ee57c08ea6 Adapt to frontend (#162)
* Adapt to the frontend.
* Fix role update exception.
* add current user info interface.
* add meta schema
* annotate captcha
* update interface to restful specification
* update info to me
2023-07-01 18:51:10 +08:00
3d0d0ccde3 Refactor global datetime to timezone datetime (#152) 2023-06-20 16:50:42 +08:00
59f1daba90 Add the schema base class (#148) 2023-06-18 19:47:39 +08:00
439ab09ebd Update the status field type to int (#143) 2023-06-17 17:22:32 +08:00
f8b48e4eea Add login graphic captcha (#124)
* add the get verification code interface

* add the login interface captcha

* clean up the debugging code
2023-06-13 23:27:12 +08:00
c716d456e8 Add departmental status authentication (#104)
* Add departmental status authentication

* Update jwt middleware error message output
2023-06-10 17:27:51 +08:00
6c5e7a6881 Add department-related interfaces and others (#101)
* Add tool to build tree structure data

* Update to keyword parameter style

* Add department-related interfaces

* Update departmental section interface permissions

* Add TODO and minor fixes

* Fix department relationships

* Fix user foreign key relationship deletion setting

* Add path parameters to the operation log

* Complete todo items

* Update department deletion logic

* Update operation log entry records

* Add AES encryption algorithm

* Add operation log request entry to the secret

* Fix naming prefixes

* Add easy encryption tools

* FIX CASBIN_EXCLUDE typing

* Update user password reset interface

* Add confirm_password to the operation log encryption
2023-06-09 11:00:13 +08:00
227d76cc5f update token handling logic (#83)
* Update token store, refresh, whitelist

* Update the token handling logic when update a user's multi-login status

* Delete all tokens when the user delete

* Fix the user logout interface

* Fix the get refresh token interface

* Fix multi-point login judgement when creat token

* Update the refresh_token interface

* Fix redis prefix deletion exclusion

* Fix token deletion error when user deleted

* Update the token time base to datetime.now()

* Update limiter storage prefix to settings

* Fix user login time not updated to database

* Allowing a user to have multiple refresh tokens.

* Add code comment to user multi-login update method

* Remove refresh token get and create interface

* Add user update multipoint login delete refresh token
2023-05-31 15:24:09 +08:00
4e4c6fbe95 add login logs (#76)
* simplify crud method naming

* update get_user_list to get_select

* add sign in logs

* Perform pre-commit fix

* Encapsulated request ip address resolution

* Delete login log records for uncertain exceptions

* Add login log deletion interface

* Add login logging to background tasks

* update the user agent parse
2023-05-27 22:55:25 +08:00
e1edcade21 Add RBAC authorisation and some tools or optimisations (#41)
* WIP: add rbac authorization

* Perform pre-commit fixes

* add rbac route whitelist

* add init test data user role associations

* Restore database table id naming to fix generic crud base

* Add database section value uniqueness settings

* Update the test directory to tests

* Update route_name file name to health_check

* Split user auth and user action interfaces

* Fix conflict between merge and current branch

* Add pymysql dependencies

* Fix RBAC authentication method

* Add the select serialisation tool

* Fix missing return messages due to global exception handler slicing

* Update the user interface with associated relationships

* Add items to be completed

* Perform pre-commit fixes

* Add pre-made routers

* Paging data return structure optimisation

* Split user auth and user interface tests

* Fix user register test data structure error

* Fix duplicate named test classes
2023-05-17 22:13:37 +08:00
24024d4bf0 fix that the data validation global exception handler does not work (#40)
* fix that the data validation global exception handler does not work

* update login api test

* update the JSON login method to create the user ID of the token
2023-05-13 01:29:15 +08:00
64f2a13e37 update to python3.10 (#29) 2023-05-03 17:10:55 +08:00
wu
7ce3e607cd simplify user apis #11 2023-04-20 18:46:51 +08:00
wu
135074ec73 commit the base code 2023-04-19 11:05:49 +08:00