Skip to content

Change assets name to config. Name conflict with app/assets #103

Open
muthuubalakan wants to merge 62 commits into
protocollabs:masterfrom
muthuubalakan:master
Open

Change assets name to config. Name conflict with app/assets #103
muthuubalakan wants to merge 62 commits into
protocollabs:masterfrom
muthuubalakan:master

Conversation

@muthuubalakan

Copy link
Copy Markdown

No description provided.

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
- 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant