Change assets name to config. Name conflict with app/assets #103
Open
muthuubalakan wants to merge 62 commits into
Open
Change assets name to config. Name conflict with app/assets #103muthuubalakan wants to merge 62 commits into
muthuubalakan wants to merge 62 commits into
Conversation
The hippod_login system handle the hippod login, checks user credentials and set cookie. hippod_login.Login() can be imported to hippod run.py
login_system has following files. 1. configuration.json 2. login.html 3. redirect.html
This name cause an error with app/assets where all static files, js and css are stored. The general idea here is all js, and css files must have stored in a separate folder and route static files together as aiohttp add_static requires.
login_system has following files. 1. configuration.json 2. login.html 3. redirect.html
The following main changes need to be implemented in run.py 1. import hippod_login module and add routers. 2. Implement static router for all static files. 3. remove middlewares: aiohttp_index
Serve static files from hippod repository. It makes the server easy to load static files. Add index.html in the hippod directory.
Middleware function for handling 404 error.
Modify hippod-configuration.json Remove the wrong path "/home/muthu/hippod"
Serve the static files from static folder using add_static
Remove aiohttp_index middlewares.
This function can be implemented to handle 404 error.
All html files are moved to hippod/templates. Rewrite all htmls file path and configuration.json file path to config/configuration.json.
Template folder contains all html files. The main goal is serving static files and templates in a separate folders.
we can use 404.html to handle 404 response error. Hippod alone handles the bad requests. But the login system does not have any bad request handling function. So, implementing the 404.html page and hippod/error_handling.py will solve this problem.
All html files stored in templates. The template path for 404.html is templates/404.html
Host and port defined as localhost and port. run.py has its own host and port defined.
Add user credentials in hippod-configuration.json. Username and password is now stored in hippod-configuration. Using a separate configuration file for user credentials makes the system more complicate. It would be more efficient if one configuration file is being served.
As we use a hippod-configuration, Change the path name for configuration file and _check_credentials function needs to modified in order to access the values.
Let the configuration files in assets folder as it was before.
Moving files to config folder is not effective.
Reasons for moved the files:
- Initially assumed that the name assets may cause error with
static/assets. But It is not.
- Serving configuration files from config is easy to recognize, but
that does not make any sense.
change file path config/hippod-configuration.json to assets/hippod-configuration.json
- User credentials for login-authorization
- update file path to /hippod/hippod/app - hippod-login html files are located in /hippod/hippod/app
This reverts commit b399c7b.
- logging for missing user credentials - default logging level is warning
- Use configuration for hippod_login.py in run.py
- Use common path - Modify the app path
- Use app path for hippod login html files - html and static files are in hippod/app
- Set the cookie on the run.py script.
- set a cookie to hippod login - customize cookie name and value
- add logging Log level is debug. use logging warning and info for sign logging - set cookie system default cookie is 'OldTamil' and value 0. Cookie customization could be done by set_cookie. set int cookie value - get cookie use property to limit permission get cookie will allow system to check and verify current cookie which has been set. - wait until check the credentials use async func for checking credentials use await to finish the authorization task. - improve cookie checking get the dict of request cookie check len of the dict of request cookies[should be greater than 0] check the requested cookie name and value. cookie value should be int. compare the value of requested cookie with value of cookie. catch the value error which may occur when someone tries to change cookie value to other than type int.
- Use separate boostraps for login page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.