42 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
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
275f9e5e93 Replace APScheduler to Celery asynchronous tasks (#229)
* Replace APScheduler to Celery task

* black format

* Add celery to run the script

* Update celery usage to README

* Update test task

* Add celery rabbitmq broker

* Fix dockerfiles

* Add task interface access authorization

* Update celery deploy run

* Fix dockerfiles

* Fix supervisor conf

* Update celery broker default is redis

* Force the pro env to use rabbitmq

* Update the task interface

* Add celery beat README description

* Update warning text style

* Revoke the default config comment content of the supervisor
2023-10-27 11:59:46 +08:00
5173ff734f Update the global unified response code (#223)
* Update the global unified response

* Update the uniform return model default

* Update the environment variable type
2023-09-27 13:45:38 +08:00
44844698ae Optimize role menu authorization logic (#221) 2023-09-26 18:13:08 +08:00
de9b10a867 Fix token whitelist and new token storage (#220)
* Fix token whitelist and new token storage

* Fix logout interface logic
2023-09-26 18:09:55 +08:00
26d7492d6b Add ip location cache (#205)
* Add ip location cache

* Fix ip location cache

* Fix getting subscripts for offline locations
2023-08-28 18:28:22 +08:00
83b6a10327 Add jwt login whitelist (#204)
Co-authored-by: downdawn <downdawn22@gmail.com>
2023-08-28 15:33:18 +08:00
d0388b0256 Add ItsDangerous request parameters encryption (#203)
* Add ItsDangerous request parameters encryption

* fix typo

* update AES decryption returned as a string
2023-08-27 23:26:05 +08:00
44befcc79f Add query users by department ID (#175)
* Add query users by department ID

* fix dept parent id schema field

* fix dept get all select

* update the test sql
2023-07-09 16:39:37 +08:00
865dfccf08 Add demo site mode (#173)
* Add demo site mode

* fix demo site whitelist
2023-07-07 17:55:56 +08:00
465b68d35e Add datetime util (#149)
* Add the datetime utils

* lint
2023-06-19 09:24:23 +08:00
c53fa9fda8 Update and fix permissions logic (#129)
* Update and fix permissions logic

* feat: Update base route

* Exclude non-system routing record operation logs

* Update the parameter variable name

* Fix the jwt authorization verify

* Roles menu authorization is turned off by default

* Fix the operation log code field type

* Update the casbin routing string to config

* Fix JWT middleware

* Add custom msg of token error

* Add the character length of the operation log code field

* Update the logout interface authorization
2023-06-14 22:34:56 +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
ceb8bdc607 Fix log table msg field length (#117)
* Fix log table msg field length

* add logo url path to opera log exclude
2023-06-12 21:57:13 +08:00
682e2fdd88 Add casbine-related interfaces (#107)
* Add casbin-related interfaces

* format
2023-06-10 17:28:18 +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
627208b216 Add operation log related interfaces (#92)
* Add operation log related interfaces

* Update to native ASGI middleware

* add the opera model class to the __init__.py

* Executable code collation

* Reply to the access middleware

* Using the request extension params in the login log

* Fix the whitelist list

* Fix username resolution
2023-06-05 21:23:48 +08:00
e6640e7936 Fix the merge issues (#87)
* Fix the login log status value.

* Fix config information interface constants

* Add fuzzy paging query for login logs

* Fix fuzzy paging query for query user interface

* Fix jwt middleware internal exception not caught
2023-06-01 16:04:59 +08:00
14e1e20185 add jwt authentication middleware (#84)
* Add jwt authentication middleware

* Fix branch conflicts
2023-05-31 16:03:44 +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
16b25c798f add offline ip location resolution (#78) 2023-05-29 10:10:59 +08:00
926a3f9b4e add different log files (#77) 2023-05-27 22:57:33 +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
06a0a33a3a Update tests structure. (#68)
* Update tests structure.
* Unit tests use the test database
* Add function for creating database engine and session.
2023-05-23 17:52:34 +08:00
e43f128086 add token refreshing mechanism (#62)
* add token refreshing mechanism

* update token_expires to token_expire_time

* Fix implicit type conversion exception catch
2023-05-19 21:28:48 +08:00
4c12c53e94 add token storage and logout (#57)
* add token storage and logout

* fix jwt expire time bug
2023-05-19 16:42:43 +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
dff62601d0 Fix the swagger form login structure abnormality (#46) 2023-05-16 15:13:45 +08:00
a19d942bd7 add the get project config api (#33)
* add the get project config api

* delete the password values
2023-05-11 15:20:21 +08:00
64f2a13e37 update to python3.10 (#29) 2023-05-03 17:10:55 +08:00
4e6284eafe improving project configuration (#25)
* delete unused email configuration

* update the default env configuration file to `.env`

* update log file name configuration

* update alembic migration file naming style

* delete the comma after the env_file variable
2023-04-25 16:14:33 +08:00
wu
d6cf5d8aef update the ruff rules and format the code 2023-04-25 14:43:53 +08:00
wu
5b09237835 add black support 2023-04-24 18:47:40 +08:00
wu
f3561e7fa0 Update the env variable file encoding to utf-8 2023-04-22 14:46:05 +08:00
wu
4e637c407c update the location and comments of the config file constants 2023-04-21 23:58:00 +08:00
b9e4ac31eb Add environment variable management and fix Pydantic validation error (#15)
* Use env to manage important configurations and distinguish environments

* fix Pydantic validation error caused by None value in links field of Page class

* Production environment no longer exposes API docs

* Extract TOKEN_URL to conf
2023-04-21 20:10:07 +08:00
wu
60192b044b fix the default host config for redis 2023-04-19 11:05:49 +08:00
wu
b18d51acfb add uvicorn base settings 2023-04-19 11:05:49 +08:00
wu
385209c868 fix the default host config for mysql 2023-04-19 11:05:49 +08:00
wu
135074ec73 commit the base code 2023-04-19 11:05:49 +08:00