-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interfaces authentication and multi-user #25
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- /browser should open the link in frontend instead of backend, since backend can be put on a server instead of running locally
- When signing up, canvas url and access token of canvas should be required and verified, and there should be a captcha there to prevent brute-force registrations
- All interfaces should have anti-csrf protection. Currently CSRF protection relies on CORS settings of cookies, which is not enough.
- All interfaces should limit rates by using IP (DO NOT use XFF header, instead use something that cannot be forged)
Generally it should open in the frontend but in wallpaper engine it bans user from opening web browser so maybe we can set this as an option in config file. |
global_config.py
Outdated
user_conf_path = "./canvas/user_configs/" | ||
user_cache_path = "./canvas/user_caches/" | ||
|
||
front_end_domain = "https://canvashelper.netlify.app" # Used to set CORS and redirect to root path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this url?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was used for setting CORS for all cookies. And CORS shouldn't be changed to wildcard mark "*" because CORS protected against CSRF attacks. This URL was also used for redirecting user. But I just changed the tokens to be stored not in cookie but instead in localStorage, and include it in Authorization header, as OAuth2 recommend, so this url will be removed.
Hi, may you change the target branch to |
You need to add new dependencies like I have error when starting:
|
There is an easier workaround for path on Windows by simply format Windows path into Unix path: |
If you encounter this, please add a folder called |
Hi, could you push code to a branch in this repo rather than in this PR? |
ok. I forgot to close this PR. I am closing it now. I will open a new branch as soon as I fix the bugs. |
All the interfaces have been protected by JWT based authentication system, with only logged-in users can access the configs and make modifications to announcements and configs of his own. All the authentications are based on user, and the sign-up and log-in interface have been added, which enables multiple users to share the same backend while still supporting a single user running uvicorn locally.