Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
assetmanagerLogin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
arun.uday
assetmanagerLogin
Commits
4f6f6377
Commit
4f6f6377
authored
Mar 20, 2023
by
arun.uday
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AssetManager-V1.0- Not yet reviewed
Added some changes to the documentation
parent
73dae1a2
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
17 deletions
+24
-17
__pycache__/main.cpython-39.pyc
__pycache__/main.cpython-39.pyc
+0
-0
app.py
app.py
+5
-1
main.py
main.py
+3
-1
scripts/core/handlers/__pycache__/login_handler.cpython-39.pyc
...ts/core/handlers/__pycache__/login_handler.cpython-39.pyc
+0
-0
scripts/core/handlers/login_handler.py
scripts/core/handlers/login_handler.py
+15
-15
scripts/log/AssetManagerlog.log
scripts/log/AssetManagerlog.log
+1
-0
No files found.
__pycache__/main.cpython-39.pyc
View file @
4f6f6377
No preview for this file type
app.py
View file @
4f6f6377
...
...
@@ -2,6 +2,7 @@
if
__name__
==
"__main__"
:
from
dotenv
import
load_dotenv
# getting the env variables
load_dotenv
()
import
uvicorn
...
...
@@ -15,6 +16,7 @@ ap = argparse.ArgumentParser()
if
__name__
==
"__main__"
:
try
:
# creating the argument for the port
ap
.
add_argument
(
"--port"
,
"-p"
,
...
...
@@ -22,6 +24,7 @@ if __name__ == "__main__":
default
=
Services
.
PORT
,
help
=
"Port to start the application."
,
)
# creating the argument for the host
ap
.
add_argument
(
"--bind"
,
"-b"
,
...
...
@@ -30,8 +33,9 @@ if __name__ == "__main__":
help
=
"IF to start the application."
,
)
arguments
=
vars
(
ap
.
parse_args
())
# logging the info
logger
.
info
(
f
"App Starting at {arguments['bind']}:{arguments['port']}"
)
# starting the app
uvicorn
.
run
(
"main:app"
,
host
=
arguments
[
"bind"
],
port
=
int
(
arguments
[
"port"
]))
except
Exception
as
e
:
logger
.
exception
(
e
)
...
...
main.py
View file @
4f6f6377
...
...
@@ -3,7 +3,7 @@
Author: Arun Uday
Email: arun.uday@knowledgelens.com
Asset Manager Login For Normal User
Asset Manager Login For Normal User
Login
---------------------------------------------------------
...
...
@@ -11,6 +11,7 @@ Asset Manager Login For Normal User
if
__name__
==
"__main__"
:
from
dotenv
import
load_dotenv
# getting the env variables
load_dotenv
()
from
fastapi
import
FastAPI
...
...
@@ -20,6 +21,7 @@ from fastapi.middleware.cors import CORSMiddleware
from
scripts.logging.logger
import
logger
app
=
FastAPI
()
# routing to the service
app
.
include_router
(
router
)
# starting the application
...
...
scripts/core/handlers/__pycache__/login_handler.cpython-39.pyc
View file @
4f6f6377
No preview for this file type
scripts/core/handlers/login_handler.py
View file @
4f6f6377
...
...
@@ -28,21 +28,6 @@ class LoginHandlers:
# un_padding the encrypted password
return
s
[:
-
ord
(
s
[
len
(
s
)
-
1
:])]
def
new_user_login
(
self
,
login_data
,
password
):
# check the domain of the email the user has entered
if
login_data
.
username
.
split
(
"@"
)[
-
1
]
==
"knowledgelens.com"
:
# hash the password
hashed_password
=
self
.
pwd_context
.
hash
(
password
)
# Enter the user as a guest user to the db
if
self
.
mongo_user
.
insert_user
(
self
.
mongo_queries
.
insert_user_query
(
login_data
,
Services
.
PROJECT_ID
,
hashed_password
,
self
.
time_dt
)):
return
True
return
False
def
password_decrypt
(
self
,
password
):
try
:
# encoding the Key
...
...
@@ -78,6 +63,21 @@ class LoginHandlers:
except
Exception
as
e
:
logger
.
exception
(
e
)
def
new_user_login
(
self
,
login_data
,
password
):
# check the domain of the email the user has entered
if
login_data
.
username
.
split
(
"@"
)[
-
1
]
==
"knowledgelens.com"
:
# hash the password
hashed_password
=
self
.
pwd_context
.
hash
(
password
)
# Enter the user as a guest user to the db
if
self
.
mongo_user
.
insert_user
(
self
.
mongo_queries
.
insert_user_query
(
login_data
,
Services
.
PROJECT_ID
,
hashed_password
,
self
.
time_dt
)):
return
True
return
False
def
db_data_validation
(
self
,
login_data
,
password
):
try
:
# fetching the data based on the username
...
...
scripts/log/AssetManagerlog.log
View file @
4f6f6377
...
...
@@ -530,3 +530,4 @@ SyntaxError: invalid syntax
2023-03-20 10:50:34 - INFO - [MainThread:<module>(): 34] - App Starting at 0.0.0.0:8671
2023-03-20 10:55:39 - INFO - [MainThread:<module>(): 34] - App Starting at 0.0.0.0:8671
2023-03-20 11:07:35 - INFO - [MainThread:<module>(): 34] - App Starting at 0.0.0.0:8671
2023-03-20 12:15:30 - INFO - [MainThread:<module>(): 37] - App Starting at 0.0.0.0:8671
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment