From b4204a1fd74247ba14ef9c50e8744cb5376e7857 Mon Sep 17 00:00:00 2001 From: AshFahim Date: Thu, 18 Apr 2024 18:42:24 +0600 Subject: [PATCH] Removed auth --- auth/__pycache__/app.cpython-311.pyc | Bin 6819 -> 0 bytes auth/__pycache__/app.cpython-312.pyc | Bin 6247 -> 0 bytes auth/__pycache__/main.cpython-312.pyc | Bin 491 -> 0 bytes auth/__pycache__/model.cpython-312.pyc | Bin 784 -> 0 bytes auth/app.py | 194 ------------------ auth/config/CorsOrigins.py | 9 - .../__pycache__/CorsOrigins.cpython-311.pyc | Bin 295 -> 0 bytes .../__pycache__/CorsOrigins.cpython-312.pyc | Bin 279 -> 0 bytes auth/controller/GetAll.py | 29 --- auth/controller/RemoveOneUser.py | 24 --- .../__pycache__/GetAll.cpython-311.pyc | Bin 1072 -> 0 bytes .../__pycache__/GetAll.cpython-312.pyc | Bin 965 -> 0 bytes .../__pycache__/RemoveOneUser.cpython-311.pyc | Bin 957 -> 0 bytes .../__pycache__/RemoveOneUser.cpython-312.pyc | Bin 830 -> 0 bytes auth/datatype/UserModel.py | 22 -- .../__pycache__/UserModel.cpython-311.pyc | Bin 1259 -> 0 bytes .../__pycache__/UserModel.cpython-312.pyc | Bin 1004 -> 0 bytes auth/lib/__pycache__/mysql.cpython-311.pyc | Bin 2113 -> 0 bytes auth/lib/__pycache__/mysql.cpython-312.pyc | Bin 1629 -> 0 bytes auth/lib/fakedata.py | 0 auth/lib/mysql.py | 64 ------ .../authenticate_user.cpython-311.pyc | Bin 1180 -> 0 bytes .../authenticate_user.cpython-312.pyc | Bin 1027 -> 0 bytes auth/model/__pycache__/model.cpython-311.pyc | Bin 994 -> 0 bytes auth/model/__pycache__/model.cpython-312.pyc | Bin 790 -> 0 bytes .../__pycache__/register_user.cpython-311.pyc | Bin 1133 -> 0 bytes .../__pycache__/register_user.cpython-312.pyc | Bin 997 -> 0 bytes auth/model/authenticate_user.py | 30 --- auth/model/model.py | 10 - auth/model/register_user.py | 35 ---- auth/readme.md | 27 --- auth/requirements.txt | 60 ------ auth2/app.py | 34 --- auth2/database/db.py | 57 ----- auth2/datatype/datatype.py | 23 --- auth2/model/model.py | 0 36 files changed, 618 deletions(-) delete mode 100644 auth/__pycache__/app.cpython-311.pyc delete mode 100644 auth/__pycache__/app.cpython-312.pyc delete mode 100644 auth/__pycache__/main.cpython-312.pyc delete mode 100644 auth/__pycache__/model.cpython-312.pyc delete mode 100644 auth/app.py delete mode 100644 auth/config/CorsOrigins.py delete mode 100644 auth/config/__pycache__/CorsOrigins.cpython-311.pyc delete mode 100644 auth/config/__pycache__/CorsOrigins.cpython-312.pyc delete mode 100644 auth/controller/GetAll.py delete mode 100644 auth/controller/RemoveOneUser.py delete mode 100644 auth/controller/__pycache__/GetAll.cpython-311.pyc delete mode 100644 auth/controller/__pycache__/GetAll.cpython-312.pyc delete mode 100644 auth/controller/__pycache__/RemoveOneUser.cpython-311.pyc delete mode 100644 auth/controller/__pycache__/RemoveOneUser.cpython-312.pyc delete mode 100644 auth/datatype/UserModel.py delete mode 100644 auth/datatype/__pycache__/UserModel.cpython-311.pyc delete mode 100644 auth/datatype/__pycache__/UserModel.cpython-312.pyc delete mode 100644 auth/lib/__pycache__/mysql.cpython-311.pyc delete mode 100644 auth/lib/__pycache__/mysql.cpython-312.pyc delete mode 100644 auth/lib/fakedata.py delete mode 100644 auth/lib/mysql.py delete mode 100644 auth/model/__pycache__/authenticate_user.cpython-311.pyc delete mode 100644 auth/model/__pycache__/authenticate_user.cpython-312.pyc delete mode 100644 auth/model/__pycache__/model.cpython-311.pyc delete mode 100644 auth/model/__pycache__/model.cpython-312.pyc delete mode 100644 auth/model/__pycache__/register_user.cpython-311.pyc delete mode 100644 auth/model/__pycache__/register_user.cpython-312.pyc delete mode 100644 auth/model/authenticate_user.py delete mode 100644 auth/model/model.py delete mode 100644 auth/model/register_user.py delete mode 100644 auth/readme.md delete mode 100644 auth/requirements.txt delete mode 100644 auth2/app.py delete mode 100644 auth2/database/db.py delete mode 100644 auth2/datatype/datatype.py delete mode 100644 auth2/model/model.py diff --git a/auth/__pycache__/app.cpython-311.pyc b/auth/__pycache__/app.cpython-311.pyc deleted file mode 100644 index 6fe5122c2fbcdf8b1512f7486e95860808a2f7ff..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6819 zcmcH-Yj0G?b?##y-j{d1Pd_jV0UJZ?waJ5oM;i(bk0!>kO&%M@YKqfO0# z=AJooX3m*&&Yaob`~4mQPhjzH%0!%yf8a;`an~Bpj?0AHCZ`D{R8UD8Yf%*nVpEe$GD$Gq^sc~1m-c?^aepqo&x`*QeYPb+d zM+(t&v=B?jIIdfb7ZT|NZwJ-hLSMR%w?k@wVIV!g+db-*!eDxEQ%Seh-&!j^B}k+5gvP!RXq+bI#Rt9j9Ka1;`w<9?-CqA{t!dwedHXx& zeF-=Zd?TcHC_9xQy5%4Yhdmr_-+})ILkI3k>0Na221$>=dN$ed4eQz3v7X&9c2BDe z^)^jz7`sh*nQm92^d)8VoRjXjA-AtNJ+>*QoiF4RIVaPh4lb!pWf|VU1=k_cT^$_8 zH{~$0fdfbc9CmkbnAnuVo)>a>xr4)A;P6UaldUx!eIbXj4i2vZhu2z1*4s4I$pQ8y z2HG6&;PM(3X35CJ6C6A>B3Q1svzmT*`UEsR(x_0K+d1dikW${cF#+}KQ%VXs$mSdhNiq8B%j3%sMV}(?m#J9un>@egV%nKM; zn6P_9wA`5tt}~OdoVf+2l^Apcj+~mAeK$|3sw`%i0vO-P*;7+9idHTaHT-s!SbjcV z)S&4H4)3!e06zuA z-zIt^hLH_X8lxlZg8(hP-xnuuoLu2QPCqx| zu%u&?bCx`PYIe?&rccjV&ZCp>OwLVOj_Jd5M~+*56c4nxltr~I`Hqx|I!HS@ccrY1 z$d*5=s-?wDP0d!w{>(9jqDr!=R;MT^z=k$H&nsC9%CY40x?avTjwDzs8XQ-}95ifI zh-6t+8xh5{#(NxpYhBui;VtId|F zv0!6BG6Ao49Du!9A`@M=8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iFVSVmG66Z{ASDDEk<}~ zLs@k{j`f?70sBk};+e!jmj@1q@W6%xA)Hz$!*Te3F$MNBSUAff_!L0f&fBxHJmCL` z1QY=t4ol$_ToaWID{7=%K!IDtH}WUYs2e90YH3xh^)lCbShODrS4F&^@XMVz#Ztft z_M;yv9)@8Ho3U~lud5PsYvEEpS7JrWbq@YB$U>5Y(pg@-@Tg-PGBjLEf}6Z0fo1SZ zyw#=VKOHMv(LPh{YiST^;x!&)g~mO7447*yguS79Z{s$^Fp;);a;4(A{QTGvpgd(? z;Tc|J8U8WCBAf&hCd|0TPQ%&9@9`{(y)guFBnjIqt{)#6Otb7$C~o((q;znpz+RrL zgW5@VSo}qJCi59$lr9V~VSAM=pmb+BUD3>5bR|3ZA|XBNnoY+GfBVE zUQDvxXfKbQ{+0PJ@;CA;k}1ev#;?U!!#7{Qxoai9F7#J~{;DhpJF5i1QwI?T8W<-L zVg`xY#Uw+1$+*#8fXWr9>jts|(edTLwSm?Ax{#;{iK-|FLDWm|sYJxy2F6VU`4Q=PNP0}U z$L#5a?Aq+vXYgW%x35hZJ+D-~L3G%mO*ZN5LA!^ o)j)F)ViN!JOnuk-3|~VZk`S|(7c++U;R<6-(9}m8nn(Zt09u|q=Kufz diff --git a/auth/__pycache__/app.cpython-312.pyc b/auth/__pycache__/app.cpython-312.pyc deleted file mode 100644 index 235477a84be3b989875b993e66136b453b167870..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6247 zcmcIoO>i8=74Dvy{n7quCGDSnz5bKDVExz_47MRLwql!rEF>AoVzODb$MQyb`bJ6e6b&QwXyaSnUE{w1Yv|xjU=&_G@6r= z62-Qx$vGvdP$Cgkx>03HI#kD$-xgJ`nZg{C^dsjD$?9XSH%X1h1=8Fa{n(P*q`7lV z$)=nq=@IjIG;hwA^oh1t^XCG|fN1-)=3Fot6m6=tBwIj=AJ*5JY!!V0tt}TyhH~L# zI2TDqL|?NO&Bc;2(GF_uxsGIqXt!vcxvpfFX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!Zm1g?vgq0|}(K%bNkb{?&JFdg^U)2^4TM6%9T}n9ZqF zI-f7VhTy`f!-oIBW=zON4V+y_7tGn)Doe+x#@)$04ftSd65^d<@1BAvI$mM@(Ci`fOaOqI8z z7ov-8mma&cVddO_e(#;tHU22$z!M?XC-5i`f+#yCYE=T$72^UcpwyO{lU;T9-*{ zS!pe|wnKVqw(c#rZMi;DYJH^QCA94;;-pd~fKqxc^jvbT(C8gWp&^tKt6=MHfV2%Q zcoz4pkik115@>nn#Am^_UpPMVHNP_qX>PN$;Jq7=X^XWMvDb@TxRhQL62PVOT4S*b zv681}g>I@y9d!57BNYPG^@6BAiQUCFWQmL6$^l%IVA;Gvw^XDMuw*I(s#4;KyI3Rf zRxwZ+Kw_M`eTBAFBrok-di*Yd3TZ;3qta8QDK%MZkU`*~y9BE0tkAMl0fKBIw?zb1 pl?Ymu*ncgl<3dNtXRTkRk)=Zwm@ZQ4+l$ji#QN_@&=R-ke*+phri=gp diff --git a/auth/__pycache__/main.cpython-312.pyc b/auth/__pycache__/main.cpython-312.pyc deleted file mode 100644 index 2930397a42700350f985e88d398ce97a85295e98..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 491 zcmYLFO-lk{5T4n6*EQ3KItbdqTY0fthlrpCHz98rN#E1<}%*%+xCQ9O@~voT=Zz|BT+obog5qvS|$T z6T|b5a%Ti1IoI>^C5t=81a|}GbI+$V^NosET9N}G1uE${Oolc_3-gdxve!|I+qQe2 zx^#tYK7m+~O{6eM9q$)&!maU=?-fri-n!teqS5rNqGMF+nMOO%DuQ!gM5#MO>dCV@ zFbY95(T^nhEFt6z)8RmGUR6u3s0VtPRyP_|A$JMZC0oXEO>WPukdF;iqtOV|%A9$+ z(UeH6QgsqOpn;~%55)$B@-Aq1bJ;qrM}%kKe=}HoJS>olbm! Q$zO(;9BZI#P0^J14;Pqkvj6}9 diff --git a/auth/__pycache__/model.cpython-312.pyc b/auth/__pycache__/model.cpython-312.pyc deleted file mode 100644 index 12e678a8dd67855f03688e4973bd5ce3ff526a35..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 784 zcmZuv&ubGw7@Z%x+08aF#>OA@W(kzNqz6w*@lc65H594{OJG=breb*@g&J5bMfHGTQQ1|lQX-KQuKp;^FF@E`yM;5&5Zxf z%K6MJW-4|`#kM9WHwB(Egsv@}{WKE?L7&Bb*M-ue?9d-XLZXmLQ-mU7(hAZdVRsPQe92 zcbvBszOFicQ-Qn2uW4S>pwn}G6I`n$4ih13g!oC43SWe2k`co7gONBBoUdu6HsLok z Huntick -# Dictionary to store user tokens -user_tokens = { - "admin": set(), - "employee": set(), - "user": set(), -} - -# Function to generate a unique token for a user type -def generate_unique_token(user_type): - # Generate a random token (16 characters long) - token = secrets.token_hex(8) - return token - -#D07.10.23< -@app.get("/") -async def root(): - return {"message": "Auth server is running"} - -# login/admin -# login/employee -# login/user -@app.post("/login/{user_type}") -async def login(user_type: str, data: UserModel_Login, response: Response): - if user_type in user_types: - userdata = { - "email": data.email, - "password": data.password, - "user_type": user_type - } - # authenticate user from here - resulting_in = AuthenticateUser(userdata) - # print(resulting_in,'this?') - if resulting_in["status"] == 1: - response.set_cookie( - key="user_token", - value=resulting_in["token"], - httponly=True, - samesite="strict", - secure=True, - max_age=36000, - expires=36000, - ) - return { - "message": f"Hello {user_type}", - "id": data.email, - "result": resulting_in - } - else: return {"message": "Error authenticating user"} - else: return {"message": "Invalid user type"} - -# !register/employee -# register/user -@app.post("/register/{user_type}") -async def register(user_type: str, data: UserModel_Signup): - if user_type in user_types: - userdata = { - "serial": data.serial, - "name": data.name, - "email": data.email, - "password": data.password, - "user_type": user_type - } - # add to auth database from here - resulting_in = RegisterUser(userdata) - print("a user with serial {} and email {} registered".format(data.serial, data.email)) - if resulting_in: - return { - "message": f"Hello {user_type}", - "id": data.serial, - "name": data.name, - "email": data.email, - } - else: return {"message": "Error registering user"} - else: return {"message": "Invalid user type"} - -# logout -@app.get("/logout") -async def logout(response: Response): - # remove all the httponly cookies - response.set_cookie( - key="user_token", - value="", - httponly=True, - samesite="strict", - secure=True, - max_age=0, - expires=36000, - ) - return {"message": "Hello logout"} - -# getone/employee -# getone/user -@app.get("/getone/{user_type}") -async def getone(user_type: str): - if user_type in user_types: - return {"message": f"Hello {user_type}"} - else: return {"message": "Invalid user type"} - -# getall/employee -# getall/user -@app.get("/getall/{user_type}") -async def getall(user_type: str): - if user_type in user_types: - userdata = await GetAllUsers() - return { - "status": "200", - "data": userdata, - "user_type": user_type - } - else: return {"message": "Invalid user type"} - -# update/employee -# update/user -@app.put("/update/{user_type}") -async def update(user_type: str): - if user_type in user_types: - return {"message": f"Hello {user_type}"} - else: return {"message": "Invalid user type"} - -# delete/employee -# delete/user -@app.delete("/delete/{user_type}") -async def delete(user_type: str, data: UserModel_Remove): - if user_type == 'admin': - result = RemoveAUser(data.id) - return result - - - - -# install all required dependencies for fastapi: -## pip install "fastapi[all]" -## pip install "uvicorn[standard]" - -# uvicorn app:app --reload --port 3400 \ No newline at end of file diff --git a/auth/config/CorsOrigins.py b/auth/config/CorsOrigins.py deleted file mode 100644 index 2c18f3a..0000000 --- a/auth/config/CorsOrigins.py +++ /dev/null @@ -1,9 +0,0 @@ -origins = [ - "*", - "http://localhost", - "http://localhost:8080", - "http://localhost:8000", - "http://localhost:3000", - "http://localhost:5000" - # add other origins here -] \ No newline at end of file diff --git a/auth/config/__pycache__/CorsOrigins.cpython-311.pyc b/auth/config/__pycache__/CorsOrigins.cpython-311.pyc deleted file mode 100644 index d07d66f6ba42f5013a958f074297d305ac6509ee..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 295 zcmZ3^%ge<81h-0WrXB;*k3k$5V1hC}^8p#t8PXY27#1-`F{CgCGiWktvfX0TsuIX3 zDJihh*U!mMPRz;3FD|JPMHjKMFt9MdDr|sF*w_H8uqja3Pm}Q$dwx-7dS+hnN`}uM z*ZtCSwTdYy%FjwoE-8+2&qyuzO)ZZ}EG@~1NzTtp%S?}P&MzwVhv?BOsQkrYlbfGX nnv-f*#17QX2*kxwK;i>4BO~JnCJt_<4-7D(fgJ>kSb@?23J6p@ diff --git a/auth/config/__pycache__/CorsOrigins.cpython-312.pyc b/auth/config/__pycache__/CorsOrigins.cpython-312.pyc deleted file mode 100644 index 24c33b06d279b709748df82d0699f39e1baa297f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 279 zcmX@j%ge<81Zf+uryc{+k3k$5V1hC}^8gvs8PXY27#1-`F;p^YGHJ5iV$`Y<$S5f( zu+rDh$xlwq$;dA*sS-sOv9d6*Fu*EofKAxg0IRSmP}onC@fLf2QD%B(UhztX&mgz` z(sQ+n2`I|XN=+^)j&aXOE%!|=k4Y>o$%skL&r8cpk8#c~D)xuy(JQF@#bJ}1pHiBW gYFES#)XoUR#UQ_ZU}j`w{KUk;&D6+V#0nGu01J&!qW}N^ diff --git a/auth/controller/GetAll.py b/auth/controller/GetAll.py deleted file mode 100644 index e89c856..0000000 --- a/auth/controller/GetAll.py +++ /dev/null @@ -1,29 +0,0 @@ -from lib.mysql import cursor -### -""" -@component: GetAllUsers, Converting_Arrays_to_dict -@description: Get all the users from the database, Convert arrays to dictionary -@props: Data[serial,name,email,password,user_type] - -""" - -async def GetAllUsers(): - allUserData = cursor.execute("SELECT * FROM Users") - alluserDataset = cursor.fetchall() - alluserDataset = Converting_Arrays_to_dict(alluserDataset) - return { - "message": "Hello getall", - "data": alluserDataset - } - -def Converting_Arrays_to_dict(data): - dataset = [] - for i in data: - dataset.append({ - "serial": i[0], - "name": i[1], - "email": i[2], - "password": i[3], - "user_type": i[4] - }) - return dataset \ No newline at end of file diff --git a/auth/controller/RemoveOneUser.py b/auth/controller/RemoveOneUser.py deleted file mode 100644 index 3f64aa0..0000000 --- a/auth/controller/RemoveOneUser.py +++ /dev/null @@ -1,24 +0,0 @@ -from lib.mysql import cursor -### -""" -@component: RemoveAUser -@description: Removes a particular user -@props: id -""" -def RemoveAUser(id): - try: - query:str = str("DELETE FROM Users WHERE serial =") +"'"+ str(id) + "'" + ";" - # print(query) - cursor.execute(query) - return { - "message": "User removed successfully", - "id": id, - "status": 200 - } - except Exception as e: - print(e) - return { - "message": "Error removing user", - "error": e, - "status": 500 - } \ No newline at end of file diff --git a/auth/controller/__pycache__/GetAll.cpython-311.pyc b/auth/controller/__pycache__/GetAll.cpython-311.pyc deleted file mode 100644 index 3378c9437778e8d91fe1bf3ea7e043cf54a5d7c2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1072 zcmZWn&1(}u6rb6Td^8`{q+1)6vb_`{81Q02OQAHeLTv7Z@$E0BM6Muzmsth zp`V=eO}KD+Dmc5yKn6BZ1+QU@!pIQbqBX$~0YyVvL20?m!_$}r^g6XIs&m>mkVbD{ z^qK%m2!ou1`#%xd82AQ00RM2nTf=evl+XbzJ{$N zO72l^VO71QK6vtYS$%2~YHvp$64SKQ5^*%sObaYnA-1iR2$KxW(b5v-M_@tnis*HR zu+R(Q=<5*5QVUk~C818aS}M*{sx|DQV-=0E?tn@JBDj7QG*}!+{esxUvH4+C_3U=; zUZF;<4Wc`CVR4;oEt9Q+R(IA5x>a?kWtxN*7Kt-&nweUIMb2G6YZ?Oy-atDC@C%+c zI!#P;GDlN)j}tQ|iJA7&sdA%JJXWSpl<9WTm>Svg{Y)!$yslhZbVTg%COd4YHKV}5> z<>A|a(Z|^)hAsy4lvl6I^X&Q_&#)^2q-7R>B9}FjNmZ>vm`o~K*<_)bX4_j9HCUK8 zq3ASfgx^-JRwGp-Ez$riWY<<< z@!>soLsveiXWD{V^{Rm>BU8z;6@? zNB(dC+J`ubCfj)$hn@0iiG|Jb^Gu~-Z<_v1^gHk8^9}hiewJsU*@|VqBxA{o2Ql=20ErQt^w4GScliq@Zt$D{ diff --git a/auth/controller/__pycache__/GetAll.cpython-312.pyc b/auth/controller/__pycache__/GetAll.cpython-312.pyc deleted file mode 100644 index dce49c8256300ccefb8de7612aec25e21cd0836f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 965 zcmYjQ&1(}u6rag{BxydZP1813%Jw2|!GITqS_-AD6>8&0>!n1(x-(5vHraG$V@ydT zs0RhX=9Cut2PnmZe}@;L2bZCO;Kkn320?prX1mc2%=^9B`MuxFdvEr0EY=73So`!9 z4@m(05R2Xj_)d3>J8ggff)*&kRR}>Cpuj7z8bA`aQcc#CBSF?7Q_TvYHZlEJ54bRR z$!E9D%_4wY%z@qxHygcUdLK9b&NJn66yM$Vu>qZ6Z@2zG8lpfQB55zM3_eO# zsLPqH#Pa;z`Pmh1Lc9I&-jeo+VnVl~cd%vIS{^%wW$6JHEMiKHJZ3U797C6hNPz|M zGi+8I%tC9}G1objrDpBYQ%syfDW97m#Hi7nW9Lx8bht`{Glc#e*I;qJsQ3$t9V*h+ zw9{+zliB;k-oU0qvkU9Ex`eA)qvEV*O}pd}+p;jpE?{TIveM-mi=4UMtx1eai1yK2 z-24Q;o8WL@q@8Z1zl`5F7`WM7JWP(ZbFJJ#@=7yvm`uNaevq7QX1*uJ-Ttv-MT)8& zASvn}Dhm5zatfONy23w%`4nk)5jSm+2Mt&UbKvn+02;ii8|S&4Ax1rbVCoD5K1x2y zJ}Lr{x~KFy48hw88Pwr2(1RHws&XWhk33JDeYU98bf%X>{;_q?+|05Zxs-i=N}Q$-t9EIdub fUneR-hq>uU5W;WZaz|F6d=d{rwL8!U6JFq7YhT`D diff --git a/auth/controller/__pycache__/RemoveOneUser.cpython-311.pyc b/auth/controller/__pycache__/RemoveOneUser.cpython-311.pyc deleted file mode 100644 index 4d6d1fa283de05d98a87124e167dae1e412a190c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 957 zcmZWnO=uHA6rS0iWV6~@+HGUS>SBd9pgo9QS`~w?KVVx(Ez*)px-+&Zn`}C>YnqaZ zh=&S2cH}B_r``(*<-_fBXkih>= zXC#Dv2%{}vH)a1Es0~CA!4AsdS&UH(5$QFWm54lr63U)POW+`4`;5EH#!XraR8TU! z`?~-eK=h7834RCG$G;vTtw7e%j50c&A>yqpB8&4X_C)nVS!}nA%Kufyh$v-5R1(>Q zmIsj+X>$;|jM&9h$&3B-l%?Ze1$MM75skz)Wm}qoRjf)cq^Uz)#6`3$&!8es=o2gE zJ?pXc#4_)vCdbWbP8m0!KD1Jn3CC>4F>f{SPy>&x^oy9uXwH33iOGH2rkp?X9jCOn z1)U`1AesYDW}XI8mIM**Wjvp+^jM6!hrDcl-tc!@&kjH>S#@#@*p znlZL*jD4P}8F#)7ewnKbeI2S9kGAgCjLB+hx@JtTsXw*O_0G3`O&i$O2CCY?Zv0xk z+o<>Thf$?V4^azZ`oV72&ciC;1l(54$HBsa{la{IeZHUXd*APyPaPcw0$F(T zmCi~C{SZMU5Vxe!3uX%uM6inrcn)KvBO*OTb5dDOD~F;ejl-A|Fzzu2w@7WJf|22C z?1I_?nty^4{QB4@QU%acq>3U$Pb(Gh*CvFC9!RJ8Vw>p z7FAtDtbarD^(d}N(P_YmS0$nmeOq>M^QI=TzgHncC|e`D~89ovxYJ zKMua1|1eZD@9y5HnNxe2nVLDXss7YDUvxg}d>MSv&L5;M?{}H|$-ZB4C1KQ&q8opY z40N{VH;O?wtz$FyTsufz+V4q5MSn!mzq$%|llQ~XPe#VjJAM3uyc0`|56C-7Ec^i# z^d#(Bck}bZg)(1tTia?~`xR;c5wR{%P3>yIBY{h=u@r>j|KuWHmodiQ(Lh~Mu+lIR J*kDOW{|AJL$$|g? diff --git a/auth/datatype/UserModel.py b/auth/datatype/UserModel.py deleted file mode 100644 index 9f0927b..0000000 --- a/auth/datatype/UserModel.py +++ /dev/null @@ -1,22 +0,0 @@ -from pydantic import BaseModel, Field - -# creating a data type for fastapi to recieve post request - -class UserModel_Login(BaseModel): - email: str - password: str - -class UserModel_Signup(BaseModel): - serial: str - name: str - email: str - password: str - -class UserModel_Login(BaseModel): - email: str - password: str - -class UserModel_Remove(BaseModel): - id: str - - diff --git a/auth/datatype/__pycache__/UserModel.cpython-311.pyc b/auth/datatype/__pycache__/UserModel.cpython-311.pyc deleted file mode 100644 index 8f98a2270dcf4b874510f537d1e80370bdd03f02..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1259 zcma)6J#P~+7`E>ty`)Lg7BPUtf?(*tGO zyP*C9P{facF?eNSOO;HWcwgtEjdChD=jYz@^ZNaGY~@>_kRvd3|Cjhe3Hgm5tKlw< z*=H~=2`8L}q(hsuV>K;GEK(xe`b4-b=vSMN?=TmmX&cS~&fVf1!)5N+w*#EFwa?|* z206<8!4yZ9&c5;!QH!|-tGDh$XL&UF|Uz`5nQS&N0@Bc|Sxu&)A2)A1)a? z=}BE=%#WhD=l6m*N*EiH8CG_E{Q5ev{ojRZ*2uWwLjmYN|GZscQ0IwJBYc=Rp5U6eEwl7RoU~xo`p* zy}vGyHG;FK-_;pVF7QL`paRmv>{)=i#LFf35ll&kXx(1{x+Kp4Haf}|RaI3-)k&_P z%Bnmn-_;|=O7HQ14_;=loU}UE$`{e&9s)Lzp6($q>5_5_M6+*;_D*!-k3w4kPZtPd zNd(N9JOJ1b$lFyVRT{xmrG>2MTZe=3xj>+B;d?;g|9e zIKv+RNqzuKZA$5cJpGyWOg)PpPRTZ01Xs8^zo9$_J-6Xvc!jI;8!EpY&ZJ0*Nojsc OwgF?p>O6%qD*XkblL~YI diff --git a/auth/datatype/__pycache__/UserModel.cpython-312.pyc b/auth/datatype/__pycache__/UserModel.cpython-312.pyc deleted file mode 100644 index 58c9a4c309935635dccb2e059b1ade66ce817d55..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1004 zcma)5J8u&~5T3nu1rk_1Vj)l(%hGD)U6MohFnedLt8Hr1 zT)(KcYCq_> zmSd`qM5azssUqV)2~{Nf%RWn7HHG;d++Tu%E|bu8PC>cKlk6C?HgYH`+^J`pr~Dnd*Wp<*9GD6^6pF}rG^q}# zcNL+d>7wX;0xRf{qU&oQN_GPQmDii&=d)U4{Pgb`h+RIz|9wDRp>}0DHV!t4agBgP zmN&bJm2$%hr{!*2@=C?&du5zZmXCjn8WB*(j6~r0!S1BJw1_GlG&vX)QY3lU*K}jG zM_?6O`|Kfq`g#={FYnz$eH+R6V?uTx;it62t1671>mx%Z|51S LUlhLp7c1vCU=__L diff --git a/auth/lib/__pycache__/mysql.cpython-311.pyc b/auth/lib/__pycache__/mysql.cpython-311.pyc deleted file mode 100644 index 04910c0bdd147cbaf684dfa911c7e3a0155f0cf1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2113 zcmcgt-EY%Y6u)*H$IfTdrUfE8t~T`}rLE{RShWvC)`n4$q%28?h>9#X_m&1Zaj_jr zB28oni3(MMmx(>{R8+A)fJgoWdy2Hk5)#v%_Lix8s(9G7ouJ#Ea8xR-NpVp3V>$-0YpilLKUeBU8E^XrX^3&W6w;Hp#i3m zXP01KlHpL%OSGQb#Ir+)L0-fnAL4%DcfABjhC@Xk_C4ngrT%%B2rqkzB8PoSka*>h z|NU4Ls0M6(z^%vJbNiG%C*1`K9)k?HQI_n=A&7&E;O0;_g@}<670uK?av0otU8PNJ{N>sBfT|$(*URFikL%4dLd>Kq0 z?0K_FnD{6t)@5GaqfLLQcL>wFsg$eQ9@w{{9E_#DSlv|Q+vJ4m>bIm;8N9Vh>aejY zmDg4)b@h%kyID6mLC~Zf7-#OFqIz7?IeIi-WP z1y0%q0xF9VT*?+;a;2~=EM*BalOp1^+)^f)y8*AJZcN+Is#wAB`($q6N-{Tj;j;wH zE*D^SC7pK6xFVLN|F9o+M-TGp`SWfcRv!skee)>J+=YbW-cEt^6^4bSOe$YUX0E}- z)aB$#x&RkeaygQ+(6iX!#Fzd?_pGEFB@9anCi_ue&q?)0+^L3x5G4XZb%^hkRZabW zTTF?Pi&O?JHf%BLUX>FTv--nk7p;Z$<768XgC^^Ivx?Q>3PYIb%hdDVrO}#6%c{we z9$hcrGJV}%Rfa4GTdFCltSB)XkMH49O~WR)jgSJ+1 zDr62iH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Sbp)xNsy*yE*t5z{rQA diff --git a/auth/lib/fakedata.py b/auth/lib/fakedata.py deleted file mode 100644 index e69de29..0000000 diff --git a/auth/lib/mysql.py b/auth/lib/mysql.py deleted file mode 100644 index 47a2f9d..0000000 --- a/auth/lib/mysql.py +++ /dev/null @@ -1,64 +0,0 @@ -## mysql connection here -from dotenv import load_dotenv, dotenv_values -import MySQLdb -import os - -# load_dotenv() -config = dotenv_values(".env") -# config["DB_HOST"][0] - - -connection = MySQLdb.connect( - host="localhost", - user="root", - password="", - database="ghewmew", - autocommit = True -) - -cursor = connection.cursor() - -# Check if connection is okay -if connection: - print("Database Connection successful") -else: - print("Database Connection unsuccessful") - -# Print all tables of the database -cursor.execute("SHOW TABLES") -tables = cursor.fetchall() -for table in tables: - print(table[0]) - - -def __test__(): - if connection: print("Database Connection successful"); return True - else: print("Database Connection unsuccessful"); return False - - -# Check if Users table exists -cursor.execute("SHOW TABLES LIKE 'Users'") -table_exists = cursor.fetchone() - -# If Users table does not exist, create it -if not table_exists: - create_table_query = """ - CREATE TABLE Users ( - serial INT AUTO_INCREMENT PRIMARY KEY, - name VARCHAR(64) NOT NULL, - email VARCHAR(64) NOT NULL, - password VARCHAR(255) NOT NULL, - user_type VARCHAR(16), - - date TIMESTAMP DEFAULT CURRENT_TIMESTAMP - ); -""" - cursor.execute(create_table_query) - print("Users table created successfully") -else: - print("Users table already exists") - - -def __test__(): - if connection: print("Database Connection successful"); return True - else: print("Database Connection unsuccessful"); return False diff --git a/auth/model/__pycache__/authenticate_user.cpython-311.pyc b/auth/model/__pycache__/authenticate_user.cpython-311.pyc deleted file mode 100644 index 18866091b7a83c2bf267df691bf9ae70254552fa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1180 zcmZWny>HV%6u+~5jvW$kg<7BlWT{XT1PmY;5FiyAV1ObK%12aGx%NR^96OxPO^X_Y z5JQj{7?5CKU@AgoVBjBsiGd+V8Nx|ONK9-&1*tIc?2z#Fa{0ZFyZ5{I-uY=Zn?@ia zdQZPg2z`p3o`9do%3e?pk%JuUp;A}l5(Z!Lq>5aUaW|%v6dgJ89aJI?E~32hIZmI* zW1-p+3j=23gs%%KC>j1MIfy<)I^uuq&h~8wFTy>W`ibDlzr8Ec5>&a|s}$AoUo8Fj z667!UIqDKm^&K>;^z46bk{sptO%8c1IjWO-t}Q{;%W>t2)a6CIC_DONsfb1pPo~-3 z*@oEGy27)+4uV=#mY}cYes3_hG)xh4ZRrxsu&&%xiobLX*U-Ft3Dt0Z&BToZ#loq= zv2*55^Z3~_r_ITbve3M6vT(Lw(u(DJ=3#StXpT*cn^h|eYXNhTh#<+X(0Wl8Pb4of z0!paB;#yv;ZAQ5uCyRUcAAsl5E$?c;Twbo^CD`Q_k3vCsaEd)!+7YKh zyF$5L4ty#yvti)Z=uC1@sMNOuhYGzgZ__Gw17DCTbA6sCLUAl^335H6Y(bO`5=PSe_y74h;^1=zjBq&|0Ti__@{I@(iR5XKlB z=tbjUv5i0&zeLyqxP>~BLDCf<5@4WgFIA?Vi@qlB7-lBtg0!bNmOZARPiUpu?@u z*zGZMYy`a;NgrJ!zuLY2s4Blk80^<70nDpH=VeAM$Mvs@loc-cwi^iDb7%Hc7Q*XZ z^0I6l5GC_^hE~8tYy-d#?GVg6^5_v3Ulf1B;dy|Lj4^H_quE<+wDwl=YolEA@6|@@ Vo4wUh6|8hJ0~i|nAJ`V4{t30gAz1(b diff --git a/auth/model/__pycache__/authenticate_user.cpython-312.pyc b/auth/model/__pycache__/authenticate_user.cpython-312.pyc deleted file mode 100644 index 49d2c91938e0f3472b27912f2de9c3bebc194709..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1027 zcmYjQO=uHA6rS1LNwP6%Q>3kpRTk zhrK|!d89=u9D=+#?qikB7z%Tz(|HliCM)-<$Wo_ujlWn|H}%9D(51 zAL$m0WQdILQ-t=jCO-HtRALU5}XS8oJc_@QL z#454CXBG~tZK?=>3cqy(-g%@Wz7?Hp^xa0c@ho)f01u!l@w&2D=T-5xTy0xY-CV3= zRpHS_bTZbk{^M2$#nxm8n=B}H#E!m*Ey|mMRMlBLtJ?a4GK{(q4>u?M`w&Z4HJ+5V zlv!=DJ`HRp4ts(OOBsbNRkb_Xa2?CIjAqnPRK}SdL$`Z}bLVoWFB^x9!Alp;8zTW_ zfpO(*?o!U6MbmMOeq(=NWQPWfDKiMlKC?rQAYoL*8eS&1l2I4|5D}>2n65;NQ7*{Y z;hy8Y@FcqF-td{j3&o5AQEu{5APDzwQg1L5WpZ8-r8CqjaVlchDYpu~M@3>X@Vzpf z2#F#>JE0@J~K|%Qf!4pt- zQB6sa_@`9ceADBm)x^MRvgOgi2iKksJWH>19$royStn{se2)B#p|;NX@yFxuTMx_u zzw=|NYbDk7QhRyjRq{=G`SQryJuCaKF6Sqfz0!x&tvT|gZTD(x`a4lm@fuR~_-`nY zX#If*w2LL@%!jd%(GfC!NygtAf#6247cO=$+n!CMrL>;ySC_h)vwiAP50-Wx0iB5m zofjB2ZO6MIqGnL>EXNnR>r8YPE5WoIz6@)ILgBp6;r}D;c2FC!ld!LnOHVP`NPd99 gZcsH9W4wk^YpCfn>RdxRYY`1=>xmW|XL}(255yJw-T(jq diff --git a/auth/model/__pycache__/model.cpython-311.pyc b/auth/model/__pycache__/model.cpython-311.pyc deleted file mode 100644 index 2d6c414125ed576d663f690d98a7b31f9c19319a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 994 zcmaJ=y>AmS6u0ku$t6t)p(&z_QKTqKJ0LNjilHcUYK2q~(kYU4id}N(K7!9t>6U>Z zV;0noOhKspF&C*r@XExNDxEU%oJ)zSw)o?B@A*By_j|VQd$E{D&{Xdiw=qJ$wQ}98 zr7(LA!YN{iVIKw9!GYlzf$5kS8E6kN;|pRY$0HM=bC_v!2qTB6Vg1o+!&JFlH|F~h zBLnilT;|C$4CUA=|0as%VY|Zv_n?7QmhmIE=SyXH zOj**CK3Cax6iOb-8+BbXo;`wqtGYbo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/auth/model/__pycache__/register_user.cpython-312.pyc deleted file mode 100644 index f42e44aab93ba563c522572c1344ef0fe37f459b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 997 zcmZWn%}X0W6rb6z?3%Bti7_f=v5GDPdoM-EAuWQYMPtDbkZpF<4f%3*LfoQlDLr`T zB`2l-L9xePdi2~=prDLtFFp0P)EF?5PW-MR*kJQG5S|OJHo!J)gFSHrw4pJS zfA)4r|8Fhj*K(@`eJNjfq^~;&J2xWcnb$U}8NF`SP)0{J(`H7~bewhrTN%B@?l+0s zM8=KOC)wro+?qZ=>tytQ_sv+U40Nc(b*S9ep=zK*wQC)LD#XOwh){`vQ+Qy6s77`$ zGA+BlO_f5QV*X!g2<@SAi?D(Y%OOr5|hRT6_B;L+d|l- z5IMX8o7dId+`ZCc+^C>3aY_$&PSJ$$5i zjFpM7?Yv;eOW+A(aVh!>5H#D2>0iTGj6n+96yOr7egQ=iq_=kd{By>Q|O5SWY_Jv85_ zy?ElcCo}uX8D~Ab%7(Ksa2nIH8Syj~&d!Oab28(GjCr3lWIArWY&WP@wVy83TxYl1 zpJx9{-hoRN!=4~JuGIT%0<9`q#FNbAudpxRi4ejIaO(oZzJMuDk)U)LNx>wZU=e=+ DnHuX! diff --git a/auth/model/authenticate_user.py b/auth/model/authenticate_user.py deleted file mode 100644 index a100cc2..0000000 --- a/auth/model/authenticate_user.py +++ /dev/null @@ -1,30 +0,0 @@ -import threading -import asyncio -from lib.mysql import cursor -import jsonwebtoken - -### -""" -@component: AuthenticateUser -@description: User authentication -@props: data -""" - -def AuthenticateUser(data): - try: - query = cursor.execute( - "SELECT * FROM Users WHERE email = %s AND password = %s", - (data["email"], data["password"]) - ) - query_data = cursor.fetchone() - token = jsonwebtoken.encode( { 'email': data["email"], 'serial': query_data[0] }, "secret", algorithm="HS256") - return { - "status": query, - "token": token - } - except Exception as e: - print(e) - return { - "status": False, - "token": None - } \ No newline at end of file diff --git a/auth/model/model.py b/auth/model/model.py deleted file mode 100644 index 0e83d69..0000000 --- a/auth/model/model.py +++ /dev/null @@ -1,10 +0,0 @@ -from pydantic import BaseModel, Field, EmailStr - -class PostSchema(BaseModel): - id : int = Field(default=None) - title: str = Field(default=None) - content : str = Field(default=None) - class Config: - schema_extra = { - - } \ No newline at end of file diff --git a/auth/model/register_user.py b/auth/model/register_user.py deleted file mode 100644 index 3419137..0000000 --- a/auth/model/register_user.py +++ /dev/null @@ -1,35 +0,0 @@ -import threading -import asyncio -from lib.mysql import cursor - -### -""" -@component: RegisterUser -@description: User Registration -@props: data -""" - -def RegisterUser(data): - try: - threaded_query = threading.Thread( - target=cursor.execute, - args=( - """ - INSERT INTO Users - (serial, name, email, password, user_type) - VALUES (%s, %s, %s, %s, %s) - """, - ( - data["serial"], - data["name"], - data["email"], - data["password"], - data["user_type"] - ) - )) - # print(query) - threaded_query.start() - return True - except Exception as e: - print(e) - return False \ No newline at end of file diff --git a/auth/readme.md b/auth/readme.md deleted file mode 100644 index bd83af4..0000000 --- a/auth/readme.md +++ /dev/null @@ -1,27 +0,0 @@ -# Auth Microservice - -Instruction for the Auth microservice. - -## Installation - -1. Clone the repository: - - ```bash - git clone https://github.com/AshFahim/GhewMew - - ``` - -2. create database nameed 'ghewmew' - -3. connect it on ./lib/mysql.py - -4. install requirements - - ```python - pip install -r requirements.txt - ``` - -5. run uvicorn server with the following command on ./auth folder - ```python - uvicorn app:app --reload --port 3500 - ``` diff --git a/auth/requirements.txt b/auth/requirements.txt deleted file mode 100644 index a29e4de..0000000 --- a/auth/requirements.txt +++ /dev/null @@ -1,60 +0,0 @@ -autopep8==2.0.4 -bcrypt==4.0.1 -beanie==1.23.0 -blinker==1.6.2 -bson==0.5.10 -certifi==2023.7.22 -charset-normalizer==3.2.0 -click==8.1.6 -comm==0.1.3 -cycler==0.11.0 -exceptiongroup==1.1.2 -fastapi==0.109.1 -fastapi-limiter==0.1.5 -flake8==6.1.0 -Flask==2.3.2 -Flask-Cors==4.0.0 -Flask-MySQLdb==1.0.1 -Flask-SQLAlchemy==3.0.5 -gunicorn==21.2.0 -httpcore==0.17.3 -httptools==0.6.0 -httpx==0.24.1 -iniconfig==2.0.0 -ipykernel==6.25.0 -ipython==8.14.0 -jax==0.4.14 -Jinja2==3.1.2 -motor==3.2.0 -mysql==0.0.3 -mysql-connector-python==8.2.0 -mysqlclient==2.2.0 -psycopg2==2.9.6 -pyasn1==0.5.0 -pyasn1-modules==0.3.0 -pycodestyle==2.11.0 -pydantic==2.1.1 -pydantic_core==2.4.0 -pyflakes==3.1.0 -PyJWT==2.8.0 -pymongo==4.4.1 -pyparsing==3.0.9 -pytest==7.4.0 -python-dateutil==2.8.2 -python-dotenv==1.0.0 -python-multipart==0.0.6 -pytz==2023.3 -PyYAML==6.0.1 -pyzmq==25.1.0 -redis==4.6.0 -regex==2023.6.3 -requests==2.31.0 -requests-oauthlib==1.3.1 -SQLAlchemy==2.0.20 -sqlparse==0.4.4 -tqdm==4.65.0 -urllib3==2.0.4 -uvicorn==0.23.1 -watchfiles==0.19.0 -websockets==11.0.3 -Werkzeug==2.3.6 \ No newline at end of file diff --git a/auth2/app.py b/auth2/app.py deleted file mode 100644 index 557f2de..0000000 --- a/auth2/app.py +++ /dev/null @@ -1,34 +0,0 @@ -import uvicorn -from fastapi import FastAPI -from database.db import cursor -from fastapi import HTTPException -from datatype.datatype import UserModel_Login, UserModel_Signup, UserModel_Remove -app = FastAPI() - - -@app.get("/") -async def root(): - return {"message": "Auth server is running"} - -@app.post("/adduser/") -async def create_user(user: UserModel_Signup): - #if usertype not in ["user", "admin"]: - #raise HTTPException(status_code=400, detail="Invalid user type") - #usertype = "user" - - if not ([user.name, user.email, user.password]): - raise HTTPException(status_code=400, detail="All fields are required") - - query = """ - INSERT INTO users (name, email, password, user_type) - VALUES (%s, %s, %s, %s) - """ - values = (user.name, user.email, user.password, "user") - - try: - cursor.execute(query, values) - return {"message": "User added successfully"} - except Exception as e: - raise HTTPException(status_code=500, detail="Internal server error") - -#python -m uvicorn app:app --reload --port 3600 \ No newline at end of file diff --git a/auth2/database/db.py b/auth2/database/db.py deleted file mode 100644 index fff4d9b..0000000 --- a/auth2/database/db.py +++ /dev/null @@ -1,57 +0,0 @@ -## mysql connection here -from dotenv import load_dotenv, dotenv_values -import MySQLdb -import os - -# load_dotenv() -config = dotenv_values(".env") -# config["DB_HOST"][0] - - -connection = MySQLdb.connect( - host="localhost", - user="root", - password="", - database="test", - autocommit = True -) - -cursor = connection.cursor() - -# Check if connection is okay -if connection: - print("Database Connection successful") -else: - print("Database Connection unsuccessful") - -# Print all tables of the database -cursor.execute("SHOW TABLES") -tables = cursor.fetchall() -for table in tables: - print(table[0]) - - -# Check if Users table exists -cursor.execute("SHOW TABLES LIKE 'Users'") -table_exists = cursor.fetchone() - -# If Users table does not exist, create it -if not table_exists: - create_table_query = """ - CREATE TABLE Users ( - serial INT AUTO_INCREMENT PRIMARY KEY, - name VARCHAR(64) NOT NULL, - email VARCHAR(64) NOT NULL, - password VARCHAR(255) NOT NULL, - user_type VARCHAR(16), - Bio VARCHAR(255), - profile_picture VARCHAR(255), - pet VARCHAR(255), - date TIMESTAMP DEFAULT CURRENT_TIMESTAMP - ); -""" - cursor.execute(create_table_query) - print("Users table created successfully") -else: - print("Users table already exists") - diff --git a/auth2/datatype/datatype.py b/auth2/datatype/datatype.py deleted file mode 100644 index fe7e563..0000000 --- a/auth2/datatype/datatype.py +++ /dev/null @@ -1,23 +0,0 @@ -from pydantic import BaseModel, Field - -# creating a data type for fastapi to recieve post request - -class UserModel_Login(BaseModel): - email: str - password: str - -class UserModel_Signup(BaseModel): - name: str - email: str - password: str - bio : str - profile_picture: str - -class UserModel_Login(BaseModel): - email: str - password: str - -class UserModel_Remove(BaseModel): - id: str - - diff --git a/auth2/model/model.py b/auth2/model/model.py deleted file mode 100644 index e69de29..0000000