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
0f326899
Commit
0f326899
authored
Mar 23, 2023
by
arun.uday
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test Commit
parent
f40bbc98
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
44 additions
and
13 deletions
+44
-13
.env
.env
+1
-1
scripts/constants/api.py
scripts/constants/api.py
+13
-2
scripts/log/AssetManagerlog.log
scripts/log/AssetManagerlog.log
+5
-0
scripts/schemas/project_schema.py
scripts/schemas/project_schema.py
+18
-0
scripts/services/v1/iot_manager_services.py
scripts/services/v1/iot_manager_services.py
+7
-5
scripts/utils/security/jwt_util.py
scripts/utils/security/jwt_util.py
+0
-2
scripts/utils/security/password_decryption_util.py
scripts/utils/security/password_decryption_util.py
+0
-3
No files found.
.env
View file @
0f326899
...
...
@@ -4,7 +4,7 @@ DB_NAME=userDB
REDIS_URI=redis://127.0.0.1:6379
REDIS_LOGIN_DB=10
SERVICE_HOST=
0.0.0.0
SERVICE_HOST=
127.0.0.1
SERVICE_PORT=8671
PROJECT_NAME=AssetManager
...
...
scripts/constants/api.py
View file @
0f326899
...
...
@@ -3,8 +3,19 @@ class ApiEndPoints:
version
=
"/v1"
# common
asset_manager_submit
:
str
=
"/submit"
asset_manager_user_registration
:
str
=
"/register"
submit
:
str
=
"/submit"
create
:
str
=
"/create"
insert
:
str
=
"/insert"
update
:
str
=
"/update"
delete
:
str
=
"/delete"
# login-management
asset_manager_login
:
str
=
"/login"
asset_manager_submit
:
str
=
asset_manager_login
+
submit
# user-registration
asset_manager_user_registration
:
str
=
"/register"
asset_manager_user_add
:
str
=
asset_manager_user_registration
+
create
asset_manager_user_update
:
str
=
asset_manager_user_registration
+
update
asset_manager_user_delete
:
str
=
asset_manager_user_registration
+
delete
scripts/log/AssetManagerlog.log
View file @
0f326899
...
...
@@ -959,3 +959,8 @@ Traceback (most recent call last):
from scripts.constants import Services
ImportError: cannot import name 'Services' from 'scripts.constants' (E:\Git\meta-services\scripts\constants\__init__.py)
2023-03-23 12:01:37 - INFO - [MainThread:<module>(): 37] - App Starting at 0.0.0.0:8671
2023-03-23 18:42:17 - INFO - [MainThread:<module>(): 37] - App Starting at 0.0.0.0:8671
2023-03-23 19:09:29 - INFO - [MainThread:<module>(): 37] - App Starting at 127.0.0.1:8671
2023-03-23 19:09:51 - INFO - [MainThread:<module>(): 37] - App Starting at 127.0.0.1:8671
2023-03-23 19:33:49 - INFO - [MainThread:<module>(): 37] - App Starting at 127.0.0.1:8671
2023-03-23 19:34:12 - INFO - [MainThread:<module>(): 37] - App Starting at 127.0.0.1:8671
scripts/schemas/
login
_schema.py
→
scripts/schemas/
project
_schema.py
View file @
0f326899
...
...
@@ -7,3 +7,12 @@ from pydantic import BaseModel
class
LoginRequest
(
BaseModel
):
username
:
Union
[
str
,
None
]
=
None
password
:
Union
[
str
,
None
]
=
None
class
RegistrationData
:
name
:
Union
[
str
,
None
]
=
None
email
:
Union
[
str
:
None
]
=
None
password
:
Union
[
str
:
None
]
=
None
user_role
:
Union
[
str
:
None
]
=
None
is_alive
:
Union
[
bool
:
None
]
=
None
created_at
:
Union
[
str
:
None
]
=
None
scripts/services/v1/iot_manager_services.py
View file @
0f326899
...
...
@@ -3,7 +3,7 @@ from fastapi import APIRouter, HTTPException, status, Depends
from
scripts.constants.api
import
ApiEndPoints
from
scripts.core.handlers.login_handler
import
LoginHandlers
from
scripts.logging.logger
import
logger
from
scripts.schemas.
login
_schema
import
LoginRequest
from
scripts.schemas.
project
_schema
import
LoginRequest
from
scripts.utils.security.decorators
import
MetaInfoSchema
,
auth
# creating the login api
...
...
@@ -12,7 +12,7 @@ router = APIRouter(prefix=ApiEndPoints.version)
obj_login_handler
=
LoginHandlers
()
@
router
.
post
(
ApiEndPoints
.
asset_manager_
submit
)
@
router
.
post
(
ApiEndPoints
.
asset_manager_
login
)
async
def
login_default
(
login_type
:
str
,
user_data
:
LoginRequest
,
...
...
@@ -38,7 +38,9 @@ async def login_default(
logger
.
exception
(
e
)
# TODO user register
@
router
.
post
(
ApiEndPoints
.
asset_manager_user_registration
)
async
def
user_register
():
return
{
"message"
:
"Available soon"
}
async
def
user_register
(
user_data
:
LoginRequest
,
request
:
MetaInfoSchema
=
Depends
(
auth
)
):
print
(
user_data
,
request
)
scripts/utils/security/jwt_util.py
View file @
0f326899
import
logging
import
jwt
from
scripts.config
import
Secrets
...
...
scripts/utils/security/password_decryption_util.py
View file @
0f326899
import
base64
from
Cryptodome.Cipher
import
AES
from
scripts.config
import
Secrets
,
Services
from
scripts.logging.logger
import
logger
...
...
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