From 824d8242752e1e0d1c3469f5058896858361e9f7 Mon Sep 17 00:00:00 2001 From: MathewFrancis Date: Mon, 12 May 2025 17:39:09 +0530 Subject: [PATCH] Open Route added with Spring security --- ...enPBX_API.postman_collection_Security.json | 204 ++++++++++++++++++ .../test1/mariadb_data/aria_log.00000001 | Bin 4898816 -> 4898816 bytes .../test1/mariadb_data/aria_log_control | Bin 52 -> 52 bytes .../test1/mariadb_data/asterisk_db/roles.ibd | Bin 81920 -> 81920 bytes .../test1/mariadb_data/asterisk_db/user.ibd | Bin 81920 -> 81920 bytes .../mariadb_data/asterisk_db/user_roles.ibd | Bin 81920 -> 81920 bytes .../test1/mariadb_data/ddl_recovery.log | Bin 16384 -> 9 bytes .../test1/mariadb_data/ib_buffer_pool | 56 +++-- MySQL_conf_pbx/test1/mariadb_data/ib_logfile0 | Bin 100663296 -> 100663296 bytes MySQL_conf_pbx/test1/mariadb_data/ibdata1 | Bin 12582912 -> 12582912 bytes .../mariadb_data/mysql/innodb_index_stats.ibd | Bin 65536 -> 65536 bytes .../mariadb_data/mysql/innodb_table_stats.ibd | Bin 65536 -> 65536 bytes MySQL_conf_pbx/test1/mariadb_data/undo001 | Bin 10485760 -> 10485760 bytes MySQL_conf_pbx/test1/mariadb_data/undo002 | Bin 10485760 -> 10485760 bytes MySQL_conf_pbx/test1/mariadb_data/undo003 | Bin 10485760 -> 10485760 bytes MySQL_conf_pbx/test1/springCezenPBX/pom.xml | 19 ++ .../com/example/cezenPBX/DAO/UserOpsDAO.java | 10 + .../example/cezenPBX/DAO/UserOpsDAOImpl.java | 9 + .../config/CezenLoginSecurityChain.java | 91 ++++++++ .../CustomAuthenticationProviderForCezen.java | 146 +++++++++++++ .../cezenPBX/constents/SecurityConstants.java | 7 + .../cezenPBX/controller/SignUpController.java | 25 +++ .../security/JWTTokenGeneratorFilter.java | 81 +++++++ .../security/JWTTokenValidatorFilter.java | 81 +++++++ .../cezenPBX/service/PbxUserController.java | 7 + 25 files changed, 719 insertions(+), 17 deletions(-) create mode 100644 MySQL_conf_pbx/test1/Rest-API-Postman/CezenPBX_API.postman_collection_Security.json create mode 100644 MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/DAO/UserOpsDAO.java create mode 100644 MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/DAO/UserOpsDAOImpl.java create mode 100644 MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/config/CustomAuthenticationProviderForCezen.java create mode 100644 MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/constents/SecurityConstants.java create mode 100644 MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/controller/SignUpController.java create mode 100644 MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/security/JWTTokenGeneratorFilter.java create mode 100644 MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/security/JWTTokenValidatorFilter.java create mode 100644 MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/service/PbxUserController.java diff --git a/MySQL_conf_pbx/test1/Rest-API-Postman/CezenPBX_API.postman_collection_Security.json b/MySQL_conf_pbx/test1/Rest-API-Postman/CezenPBX_API.postman_collection_Security.json new file mode 100644 index 0000000..934f22d --- /dev/null +++ b/MySQL_conf_pbx/test1/Rest-API-Postman/CezenPBX_API.postman_collection_Security.json @@ -0,0 +1,204 @@ +{ + "info": { + "_postman_id": "721d5504-301f-488d-a25b-5e78769eac5a", + "name": "CezenPBX_API", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "29498098" + }, + "item": [ + { + "name": "create a new endpoint", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"id\": \"1005\",\n// \"transport\": \"transport-udp\",\n// \"context\": \"default\",\n// \"disallow\": \"all\",\n// \"allow\": \"ulaw,alaw\",\n// \"directMedia\": \"no\",\n \"connectedLineMethod\": null,\n \"callerid\": null,\n \"dtmfMode\": null,\n// \"mohsuggest\": \"default\",\n \"mailboxes\": null\n}\n\n// {\n// \"id\": \"1004\",\n// \"transport\": \"transport-udp\",\n// \"aors\": \"1004\",\n// \"auth\": \"1004\",\n// \"context\": \"default\",\n// \"disallow\": \"all\",\n// \"allow\": \"ulaw,alaw\",\n// \"directMedia\": \"no\",\n// \"connectedLineMethod\": null,\n// \"callerid\": \"User <1004>\",\n// \"dtmfMode\": null,\n// \"mohsuggest\": \"default\",\n// \"mailboxes\": \"1004@default\"\n// }", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:8081/cezen/add_user", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "8081", + "path": [ + "cezen", + "add_user" + ] + } + }, + "response": [] + }, + { + "name": "create a new extension", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"context\": \"default\",\n \"extension\": \"1005\",\n \"priority\": 1,\n \"app\": \"Dial\",\n \"appdata\": \"PJSIP/1005,20,m(default)\"\n}\n", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:8081/cezen/add_extension", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "8081", + "path": [ + "cezen", + "add_extension" + ] + } + }, + "response": [] + }, + { + "name": "set_password", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"id\": \"1005\",\n \"authType\": \"userpass\",\n \"userName\": \"1005\",\n \"password\": \"12345\",\n \"md5Cred\": null,\n \"realm\": null\n}\n", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:8081/cezen/set_password", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "8081", + "path": [ + "cezen", + "set_password" + ] + } + }, + "response": [] + }, + { + "name": "SetAORS", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"id\": \"1005\",\n \"maxContacts\": 1\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:8081/cezen/set_aors", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "8081", + "path": [ + "cezen", + "set_aors" + ] + } + }, + "response": [] + }, + { + "name": "DeleteExtension", + "request": { + "method": "DELETE", + "header": [], + "url": { + "raw": "http://localhost:8081/cezen/delete_extension?sipNumber=testEndPoint", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "8081", + "path": [ + "cezen", + "delete_extension" + ], + "query": [ + { + "key": "sipNumber", + "value": "testEndPoint" + } + ] + } + }, + "response": [] + }, + { + "name": "Add_a_global_extension_feature", + "request": { + "method": "PUT", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"context\": \"default\",\n \"extension\": \"w\",\n \"priority\": 5,\n \"app\": \"Dial\",\n \"appdata\": \"W conf\"\n}\n", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:8081/cezen/add_feature", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "8081", + "path": [ + "cezen", + "add_feature" + ] + } + }, + "response": [] + }, + { + "name": "login", + "request": { + "auth": { + "type": "noauth" + }, + "method": "POST", + "header": [], + "url": { + "raw": "http://localhost:8081/open/signup", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "8081", + "path": [ + "open", + "signup" + ] + } + }, + "response": [] + } + ] +} \ No newline at end of file diff --git a/MySQL_conf_pbx/test1/mariadb_data/aria_log.00000001 b/MySQL_conf_pbx/test1/mariadb_data/aria_log.00000001 index 8b58be4e10fab674abc6c0e087b4756062b93a9f..8cd7a258cc7c00f6b0fd8f4c1307f74abe9749ac 100644 GIT binary patch delta 196 zcmXBDNiqWg006)d>x7IgBDRQqOM=)5VvCrQpTra9&>v7a78EQhTC!}#sx|92Y}&GIM@d=5 zu08vz4jeji?8K=v=PuM-x^k`V#;rT|9yB~^diso8-Okrr97e5f90bA7zwgd#9A(=t N#ju^OWj^Z9g@beFJCC nT^PD_W#rn8TX*h_J(zej^YIbq>hMh1rbg<{9 diff --git a/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/roles.ibd b/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/roles.ibd index 8b3f54553a69a3939037ba3ebe1946e06a16786d..aebdf9d820b80b6d953900caaa991bd7d4083963 100644 GIT binary patch literal 81920 zcmeI*J!=#}7y#hey=;&i95z;#ifP4PAb9Bn!Olhzzc}#15lI`buvDl^|X-AIO)AIT!{-!o31-kKd+|ze}w=60t5&UAV7cs0RjXF5FkK+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBoL z`vNh?|Hao=MLxJZp8r1^hTg&_2Wd5grp?dWH}li^+VbATdG%%VIlkXZ&sJ618@KmM zaV*~Lw0VkuRdKi9&2e|X&uQ_dy^HJFf2}=h6@89>E%(RbTaI^m{tx-L;p+(yAV7cs z0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZ zfB*pk1PBly@TUURYw|numyuu3*Ehd!eO&m!Ae7{(tXAhjclP z>iqw5ryUjVf0zG1Pxqg8e+i&F(SQH}0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk z1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PGjMfhPZd|7tPW_zCC| B_pbl| delta 30 YcmZo@U~On%-FU##e&YpAG_1@50L}^xKmY&$ diff --git a/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/user.ibd b/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/user.ibd index 8b3f54553a69a3939037ba3ebe1946e06a16786d..176e67edbde33e4f8907a50b4b87e3f6fed8fd6e 100644 GIT binary patch literal 81920 zcmeI*O==WD6ae7Yoiqq4%tpLHTne5b8<#nS7??#gMuIK{H-dM_0bIHdg5Ds>1Qb1i zJGX;BRXwjKlTiZxz!3Zj>aSl_bHHxn@{-?Q|yZZeH48K~VTYaMr`ZkBo@$5A&% zw&htJ)i$Sna0|}D@QdNF>CXAGsKr;7tOoV@ln~gR@bbm@W4>F6oDDb1a8zm=U*@AbO_^RFKiD4c?C(SqS0f(p@9y2NGlc*F z0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+ z009C72oNAZfB*pk1PJ`^0=sc9N{;`>7oQ#`#rz-P`+50ofZxvlzg2ej`Ty>@56&Eg~Tjh^c&m;2Zb=mV&ixZ)G92 zzJk5E&fGnBvsooz6qb;0VE*oznLGP!eRd<}rOz_Vx_%ZnGEloo);jJ=yKT99*T&5fn74Jw>YDcbX6fx^qpn$3$$Ph#z5lxIJ-#>Zz4(6W z^X2d6qIvpnj%Tf-&--s)asTo9dIAIp5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U zAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5*Bt3cP!jvqZ7v)~sQ`NOf@ z>Eqo`OD~v28%J-(wcS$WYFnh)~- z(^p4;009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk j1PBlyK!5-N0t5&UAV7cs0RjYm7Z~#Y``PE+osYi&!`kgL delta 30 YcmZo@U~On%-FU##e&YpAG_1@50L}^xKmY&$ diff --git a/MySQL_conf_pbx/test1/mariadb_data/ddl_recovery.log b/MySQL_conf_pbx/test1/mariadb_data/ddl_recovery.log index 434b85ce8ff7d3aa34aeb4824aef83379d4d60ee..5e30b6d298935b23b6eee5c79d90efbcee948868 100644 GIT binary patch literal 9 QcmezOkDG}>z=DAR01_wyQUCw| literal 16384 zcmeI&!Ab%_7{Ku_gM@_A2M7kbBxKSh?6~R_lB}@qrPHkD2IAtDqn>(zUZit9NN>># zbnGO#DrAekfczJBhxxvbkD1?Xn4QgX8Oc|K2LS{SKmY**5I_I{1Q0*~0R(neAd}Cg zHuqZn`8aSw?kxsB2q1s}0tg_000IagfB*srAh2@+nSw}i@ZWy;pKjap|C|3*)l{6O zuRY~E)uvX#-(`QGoO)f=T5j9-oQCVKa#1`Ct?|s`z>H&)ln3gj<>|()tM2suS&;lG tVEVnFs62h6J?++XTP>nCSj(oC!4v@m5I_I{1Q0*~0R#|0009K%0>3HBT|58) diff --git a/MySQL_conf_pbx/test1/mariadb_data/ib_buffer_pool b/MySQL_conf_pbx/test1/mariadb_data/ib_buffer_pool index 18bd109..018cf43 100644 --- a/MySQL_conf_pbx/test1/mariadb_data/ib_buffer_pool +++ b/MySQL_conf_pbx/test1/mariadb_data/ib_buffer_pool @@ -1,11 +1,30 @@ -1,50 +18,4 +18,3 +18,2 +18,1 +18,0 +17,3 +17,2 +17,1 +17,0 +16,4 +16,3 +16,2 +16,1 +16,0 +15,3 +15,2 +15,1 +15,0 +14,4 +14,3 +14,2 +14,1 +14,0 13,3 13,2 13,1 13,0 -11,5 -11,4 -11,3 11,2 11,1 11,0 @@ -25,11 +44,6 @@ 8,1 8,0 7,3 -5,3 -4,3 -3,2 -2,2 -1,2 0,9 1,45 3,44 @@ -153,23 +167,15 @@ 2,8 1,8 3,7 -2,7 -1,7 3,6 -2,6 -1,6 -3,5 2,5 1,5 3,4 2,4 1,4 3,3 -3,0 2,3 -2,0 1,3 -1,0 0,6 0,0 0,47 @@ -181,6 +187,22 @@ 0,10 0,8 0,11 +11,5 +11,4 +11,3 +5,3 +4,3 +3,5 +3,2 +3,0 +2,7 +2,6 +2,2 +2,0 +1,7 +1,6 +1,2 +1,0 0,5 0,7 0,4 diff --git a/MySQL_conf_pbx/test1/mariadb_data/ib_logfile0 b/MySQL_conf_pbx/test1/mariadb_data/ib_logfile0 index a33bd14c2ecd3f6a8c0a157f4b0474a8688defb2..febfc332ee0663ce40f44a35e70f51498a3e16d0 100644 GIT binary patch delta 7566 zcmX}scl6DL|G@D+_R1<{WQK_Nm`MZKM3jtVW@HzlVUxWxGZQ5wTa=O2P{=NdB9t;3 zR>t@B@H^*s&v`!X>z?;H_ukh(uK@!FBo2s{CC`{PMd8$Uc*XmKyhW33xpXGu+JpyF zY|oH3MWOQl_oPsHPX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!wMM#*esytM~~& n;~IX!ulNnW;}86a>$rix@HcMaAKb$2#O-nZ68}AxaL4}v`Hgx) diff --git a/MySQL_conf_pbx/test1/mariadb_data/ibdata1 b/MySQL_conf_pbx/test1/mariadb_data/ibdata1 index b60b4eac564bdd5046e3220c64a5212e8ff22a39..f5aa9573648662eb4fe6e5722750c6110c07a343 100644 GIT binary patch delta 9608 zcmeHNdvH|M89(Rly}KJWkjG_V2?^|y5E6(*ud z_nv$1`JL~5zw_8N48v)NYd`mfH0`H_%(=CK5AK`HWEn|SVsK)J2TNSkd+!DBU$!aU zROc|y4To%qtW<3WOVnnudDK)GXK^isNb#m-QQuIts-}Kv*`kFxt7?~3nQOV? zE%q6L1!Dop*}Bi9d%sDCO2%H7Gb%NC0As7Ys;Bet#`>yNWnmgk$wqVED6g?9 zM%K)Ka7<+@DBe-dz_|#^YL4w}pyOut9gWxMij#C4#U_A~&DCHnC_612M1CHCC0k_3e!o*oSAtPcEiLQrnvREb^)T|ql;Tl%#f9^UfGI@ zLdYlXT}w3)iTQoN#)WWKRkNlxZWDlu8S z>tvUCdSX7YzoxTD<$B_`LL@V*S&3P}lxkhyD~3_&$QSfzh&E%<>>gH+DRuhgh#+)V zRifCft%83yN^3}LjQ`&J@Q@O4QBdFyCt6!WR)D-85g_iEDa`L)!J3J-!dxtQ^H8rj zJ){J<7OV{^Yc<8Cm=}&J)3|DmKc*b;(`QN^q|ctBHRN?o6Dm*<5g-tz=sC2;7WYdsU*PxM!M^IAf%Dc?i&rW;EyhUAP`Or(>pDe=V zqNH20R8oS9l!dXgUU%mR5%3Y>cG)c=4~C;e$|5LrljRGqYa2;Z*hQMJz3!hZYL`8p zDWn-_etJZ4&rhU2%RHr%VO-&8Y0XRCE}j;{#jHZbuZs_M&Tmn~je)=*m} zUQwqV6->}ogI^s}p3WcG;F{)~sGe~ImHYW3D^a|E$GWj6wmHPC)DjT}9@iHvo1D3u z2#7q9(NgH3G;yHTajQn2e@Am<^>Gf9Vz6OmljiVM$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 zG8u|5KkZXG++LZo`kq|`$P9NN7Mt>}o87KJTUwruA zC4FH^#-4WEpicJ1QV*EaX~!R|d1s;#J>eNLJ(}jDg84r-?7b77IsK!AYkiQDrKaC* zbTgUHiKB$+Hv#Fl5B>V`cO;vs8!aWH8fUp*!4PhO^dW3d_4G0?%HX+=L z(1CCt!e)dm2wM@hA#@^iA^ao4c7*#8x)F9D>_pgwup8k4ga;8GLih&4!wBC*2q5SP zk0AUL!lMX}A$$t~5gtd_gRmFj350(}*oW{W!cz$Q5e^{Gf1C~>^dKBY=tby52qGLo zIEwIXgr^anL3kG7I|$Dq978yc@Lhy{gcArS5uQi*9>OVv7ZARWa2nwU2tP!45#dJ& pXAsUJoI@Bu_%XtHgqILP2rnbNf^Y%hRfN|NE+YKP^YD83{{T?ilcWFu diff --git a/MySQL_conf_pbx/test1/mariadb_data/mysql/innodb_index_stats.ibd b/MySQL_conf_pbx/test1/mariadb_data/mysql/innodb_index_stats.ibd index c16ad8fa202140a6952a5646e9aa4ffce1e1b786..c994ab3f785819bd3cc9e86f027471aad2c7f14b 100644 GIT binary patch delta 1370 zcmb7EOK1~O6umEb`7|?%A|;8?Q(x{LR{NlhFki_9i-^Ugi*ymRh6Ri&y* z7rToQXXMR^kI;M^u&w8|dfb25{tN%KfgOem2a7+b&G}r5mAr+0OW$d)M*t_Rxu3?A zX*ruvlG4Q08AZ-Y+4Q8W^_RlFc(9Uda`HDaBPAxZ^Q#*UC)EBN(qgN7wCva6fJ<~a z1Vn5)TrG54Og-^nnF(oq2wOz5yxv;~mLJnVm{AZQCn0X82(E-FqtM9bK`(+R8G$Qi z(0ko)faa?M16^Vl(?c%8WfM-}`=(-3vbM0~Kh{Lna`!)p{i5i?1b}2Rp+`OeLgZ~;9~Cf5UKH!k^7^=dM)(90A}jSrc|9ZaQlqTa@3U2x=;h!w zwwl6Tqg<~)$m-X}yioHfztIy!-0qn)0p=1-1CW-vBRk$~k>6ENUQR!Mz znodjHS{(JL)i5>Y2sN--v;kx~q8%*Sot;Mv@8wwX3VU}fMG*wmoOy^Z0qfE5E10|$fZW{U%NS(sS8CMO;e z->i4^5(^tQH-iGhjfn>XCWoDR$I8O+;j7i;#8aA+i%wf|v+_s@a5Jbd{P-6%@nHI9 s*)vmFHdo$GQ`vaoJeOnvwwX3VU}0cpdeFcP6<`I@oRcjM7&Ed>&N&ds%EBPQn7H}S zfhfj$R-hUOhStR5lGLKi;_Ud8q@w(s)MALn1_+fQd*%~_1t%GyEJiM%evkiUNcu~Q zQ;XuU8FIE0t{uVv8e$7(F|q(n3HZMo%@l~L1_+fQd$t9_f|HD!c@9b2@)j^0Vn}8H KhCrZ$>JtDi+cv2H delta 82 zcmZo@U}wX3VU}0cll4;-o2{7JdUfsN-&CV ZK6D_8apTFGw%i2_$qYaP{+!sV3;^K26w?3z diff --git a/MySQL_conf_pbx/test1/mariadb_data/undo001 b/MySQL_conf_pbx/test1/mariadb_data/undo001 index 8c6fc55ef106c90455fde0b66b695d3608d9bc4a..0833be4a94ade2a952d8bc7c7c2ff98a5f303971 100644 GIT binary patch delta 735 zcmY+;M^97%6o%p4838+3(5s@N%-9wCSYhm4?7d;{z1M4d?aGLby{t@(8MW zf~!?;-rkGlEK&C%j5S^OXNkIXi@vH*?(f`_*_;R8d z#xRb#B@gql0GneAY>BO~HMYUFScpZ~4%=e~?1;tK2|HtmU9c;5!xHR{J+LR1VlV8C zWthMu_QAf`5BuW)9EgK(Fb=_T9E!tmIF7)PI0{E&3di7B9Eam^0#3vVti&`j|cD|9>T+T1drk|JdP*uB%Z?4cm~hnIgIc;UcifZ x2`?jf1+U^YypA{UCf>r^cn51RgLknO@8NyS;sbn$kMJ=*!Ke5PpTF`&`WJHGP09cO delta 751 zcmXZW>u=2m9LMqg&P7qQR)-%pmsMwDT3VD^>&%$Vb+wh54t2lRb<~U>=54O+aX9Xl zN=WR1ghm=X@P6ihkw}(UBH@Xit`ELXzOPU6`9x8ajJmHq6;D2E$%N%Wb*8>1$Xuxi zhG*I)2Cp7Hub*AmO)KA|iyo&_>3pm+jGD`Ww(PrTR#25~@JQ$C;N{4CYHZ6t|2;Mp z#STK|Bakf25W(Ng* zV)5Yrbh4wkwXCiqXV5dOD>SGn2~xfItflDThHIB&sd(aE?UOK;ui4RCbFcQ`xQgmr zI*;M|?h!p&+NoLgrztHQ#cfdVTi+V1dhay@e>?{qj3z5#ZR#e$6+~shU4*b`~oN7MEnvb zVFgy=WSoLkSdCM08cxR=oPjg37H8pCScmmE8`JnT&cSbRF3!VmaXx;B-{S&Yh>LJB zF2SYv12*6?{1Jb`MqG|7@Mm0!zu+ot!e4PUuEDj~jO%bcZorMW2{+>w+=|<9JMO@p zxC>iwH}1i`xDWT^0sIXQ;vsCs!}vQM!9VaQ9>WNa;|V;8f8r?wPvc*B2G8O-JdYRf iBDP^WX7Cbb@iJb)9A3q1cpY!xO}vG-@y>n!PJaM)T~XBl diff --git a/MySQL_conf_pbx/test1/mariadb_data/undo002 b/MySQL_conf_pbx/test1/mariadb_data/undo002 index 3386d3cd680635aad86b732af9c7bc2aa0d3a074..4fd7f5e92866b9a7128721d08f48b17c76a78e2d 100644 GIT binary patch delta 569 zcmY+-+f$5j9LI6bvu&G0tg_pKBx+X*8_~+4eMCxhAR?^JRL&ySsh@gxaI8(9LWk=v z^M+t?0Z%9!kuU$&j>!eAK%{t?a^EdTtLUPKpdPotbW&E>Q zy>TLF(ZZ5ZN%w@5u!#kK(HN#X^zTEmX$zkfIoB>*{@a45bxD$@n&=7`#VBJ;`h!g^i@LiOr;ujte(i$Y3j(WU-Cy?7%}dJK04JyV*l7UiOm5KK65fgXH5w za#H>7xr_xa2-j}XEx%xQCKoHRTsUK9kmG9}H*^c#9&<6J&a}Ec z&O~XKAxxFNPnesQ&iXl{X5w!N|1*+SH>jASsjfHO4JwmWzq7HCft}enn8RG=F`or2 zWD%JtWU&}0OHgsK6b(1o&lUYSyq83z0;zj`diH zW&;Wv*~DhHu$67Zu$@@qh{uK<2Rl&N$u4%YhrR40f&CodAcr{25fVw_D9JcU;TWkL zCk+=TNGAg~nPid8NltN^9CFDcpEI1LfI^BmM=>Roa-IuZq>M|HQ^94fP{~!Uah)4f zag$rz<_>qc$9*19%|mK<#ABXNOC9wz(8yDs@thaD4jED1tK`^~lt`5_?1~HR#qPhRP&AA6y(g**#ba01 zhDj=$FA+V%j3wwqRFC~nCqDXuqn}mz%xXC0uo`zgQ?B96^@l&0Le(tF?`F9ir_+8+ zQrQd)e*JF7B(;u=%jJaIJ>`y!e{=om#DWzY(@7$k8O&rBvzfzO=3ys=`J}P{jWp8H zS;!(5vxKEAV>v5W$tqTpfrB-yC6g@H;bc7<*occwxXETSTiA++9JZ0mc6P9nJa&spring-security-test test + + + + io.jsonwebtoken + jjwt-api + 0.12.3 + + + io.jsonwebtoken + jjwt-impl + 0.12.3 + runtime + + + io.jsonwebtoken + jjwt-jackson + 0.12.3 + runtime + diff --git a/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/DAO/UserOpsDAO.java b/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/DAO/UserOpsDAO.java new file mode 100644 index 0000000..6764c15 --- /dev/null +++ b/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/DAO/UserOpsDAO.java @@ -0,0 +1,10 @@ +package com.example.cezenPBX.DAO; + +// TODO only one admin allowed ... once the admin creates an +// account they should not be able to make the account again +// admin login, logout and signup DAO operations +public interface UserOpsDAO { + + + // admin login +} diff --git a/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/DAO/UserOpsDAOImpl.java b/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/DAO/UserOpsDAOImpl.java new file mode 100644 index 0000000..7c3f179 --- /dev/null +++ b/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/DAO/UserOpsDAOImpl.java @@ -0,0 +1,9 @@ +package com.example.cezenPBX.DAO; + +import org.springframework.stereotype.Repository; + +@Repository +public class UserOpsDAOImpl implements UserOpsDAO{ + + +} diff --git a/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/config/CezenLoginSecurityChain.java b/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/config/CezenLoginSecurityChain.java index b214d24..aa35a37 100644 --- a/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/config/CezenLoginSecurityChain.java +++ b/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/config/CezenLoginSecurityChain.java @@ -1,11 +1,102 @@ package com.example.cezenPBX.config; +import com.example.cezenPBX.security.JWTTokenGeneratorFilter; +import com.example.cezenPBX.security.JWTTokenValidatorFilter; +import jakarta.servlet.http.HttpServletRequest; +import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.http.HttpMethod; +import org.springframework.security.config.Customizer; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer; +import org.springframework.security.config.http.SessionCreationPolicy; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.security.crypto.password.PasswordEncoder; +import org.springframework.security.web.SecurityFilterChain; +import org.springframework.security.web.authentication.www.BasicAuthenticationFilter; +import org.springframework.security.web.csrf.CookieCsrfTokenRepository; +import org.springframework.security.web.csrf.CsrfTokenRequestAttributeHandler; +import org.springframework.web.cors.CorsConfiguration; +import org.springframework.web.cors.CorsConfigurationSource; + +import java.util.Collections; +import java.util.List; // this class will handel the routs that are protected and // allow spring security to accept login details from our custom login page @Configuration public class CezenLoginSecurityChain { + @Bean + SecurityFilterChain defaultSecurityFilterChain(HttpSecurity http) throws Exception { + + //the token is generated here + CsrfTokenRequestAttributeHandler requestHandler = new CsrfTokenRequestAttributeHandler(); + requestHandler.setCsrfRequestAttributeName("_csrf"); + + //CSRF cookie + final CookieCsrfTokenRepository cookieCsrfTokenRepo = new CookieCsrfTokenRepository(); + //make secure true when using only https + cookieCsrfTokenRepo.setCookieCustomizer(responseCookieBuilder -> responseCookieBuilder.secure(true)); + + // bellow line is used when you are using JWT tokens instead of jSession session keys but i put always because i guess CSRF token needs it + http. + logout((logout) -> logout.deleteCookies("Authorization", "JSESSIONID", "XSRF-TOKEN")) + .sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) + + //now because we aare sending the JWT token to The UI Application in a Header + //we need to manage it in the CORs config + .cors(corsCustomizer -> corsCustomizer.configurationSource(new CorsConfigurationSource() { + @Override + public CorsConfiguration getCorsConfiguration(HttpServletRequest request) { + //check CORs and CSRF in Previous commits + CorsConfiguration config = new CorsConfiguration(); +// config.setAllowedOrigins(Collections.singletonList("http://localhost:4200")); + config.setAllowedOrigins(Collections.singletonList("*")); + config.setAllowedMethods(Collections.singletonList("*")); + config.setAllowCredentials(true); + config.setAllowedHeaders(Collections.singletonList("*")); + //the JWT will be sent to UI under Authorization header and XSR under X-XSRF-TOKEN + config.setExposedHeaders(List.of("Authorization", "X-XSRF-TOKEN")); + config.setMaxAge(3600L); + return config; + } + })) + + + .csrf(AbstractHttpConfigurer::disable) + //.addFilterAfter(new CsrfCookieFilter(), BasicAuthenticationFilter.class) + + //token generation after BasicAuthenticationFilter.class + .addFilterAfter(new JWTTokenGeneratorFilter(), BasicAuthenticationFilter.class) + //then position the verification filter + .addFilterBefore(new JWTTokenValidatorFilter(), BasicAuthenticationFilter.class) + .authorizeHttpRequests((requests) -> requests + //only admin can use this rout + //user roles :- ROLE_admin ROLE_employee ROLE_manager ROLE_user + .requestMatchers( + "/admin/get_all_users", + "/admin/list_all_branches_with_manager" + ).hasAnyRole("admin") + //any one who is authenticated can access /logout + .requestMatchers("/bankUser/login", "/user/getXSRfToken", "/logout").authenticated() + .requestMatchers("/bankUser/**").hasAnyRole("user") + //all the rest are open to public + .requestMatchers("/open/**").permitAll() + //.requestMatchers(HttpMethod.POST, "/open/**").permitAll() + ) + // redirect to /login if the user is not authenticated Customizer.withDefaults() enables a security feature using the defaults provided by Spring Security + .formLogin(Customizer.withDefaults()) + .httpBasic(Customizer.withDefaults()); + + return http.build(); + + } + + // to encode the password + @Bean + public PasswordEncoder passwordEncoder() { + return new BCryptPasswordEncoder(); + } } diff --git a/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/config/CustomAuthenticationProviderForCezen.java b/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/config/CustomAuthenticationProviderForCezen.java new file mode 100644 index 0000000..3eb2a41 --- /dev/null +++ b/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/config/CustomAuthenticationProviderForCezen.java @@ -0,0 +1,146 @@ +//package com.example.cezenPBX.config; +// +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.security.authentication.AuthenticationProvider; +//import org.springframework.security.authentication.BadCredentialsException; +//import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +//import org.springframework.security.core.Authentication; +//import org.springframework.security.core.AuthenticationException; +//import org.springframework.security.core.GrantedAuthority; +//import org.springframework.security.core.authority.SimpleGrantedAuthority; +//import org.springframework.security.crypto.password.PasswordEncoder; +// +//import java.util.ArrayList; +//import java.util.List; +// +//public class CustomAuthenticationProviderForCezen implements AuthenticationProvider { +// +// @Autowired +// private UserRepository userRepository; +// +// @Autowired +// private EmployeeRepository employeeRepository; +// +// @Autowired +// private PasswordEncoder passwordEncoder; +// +// @Override +// public Authentication authenticate(Authentication authentication) throws AuthenticationException { +// +// //get credentials from login form +// String username = authentication.getName(); +// String pwd = authentication.getCredentials().toString(); +// +// //sanity check +// if (username.isEmpty() || pwd.isEmpty()) return null; +// +// System.out.println(pwd); +// System.out.println(username); +// +// int employeeId = 0; +// boolean isEmployee = false; +// +// //what if the username is an employee login +// try { +// //if true +// employeeId = Integer.parseInt(username); +// isEmployee = true; +// } catch (Exception e) { +// System.out.println(e.toString()); +// } +// +// //employee auth +// if (isEmployee) { +// // if it is a valid number range +// if (employeeId > 0) { +// //check for employee +// Employee employee = null; +// try { +// //check if employee exists if yes then fetch details +// employee = employeeRepository.getEmployeeAndRolesById(employeeId); +// } catch (Exception e) { +// System.out.println(e.toString()); +// return null; +// } +// +// if (passwordEncoder.matches(pwd, employee.getPassword())) { +// +// //then it is a match a number of springs granted authorities +// List authorities = new ArrayList<>(); +// +// //loop through the users authorities and add each of them to simple granted authority +// try { +// +// //check if employee is part of permission set for employee signing in +// boolean hasEmployee = false; +// for(var permission : employee.getRoles()){ +// if(permission.getRole().equals("ROLE_employee")) hasEmployee = true; +// } +// if(!hasEmployee) throw new BadCredentialsException("no employee permission for given employee"); +// +// employee.getRoles().forEach(a -> authorities.add(new SimpleGrantedAuthority(a.getRole()))); +// } catch (Exception e) { +// //use/**/r doesn't have permissions or roles = null +// System.out.println(e.toString()); +// return null; +// } +// +// return new UsernamePasswordAuthenticationToken(employeeId, pwd, authorities); +// } else { +// throw new BadCredentialsException("Invalid password!"); +// } +// } else { +// throw new BadCredentialsException("No user registered with this details!"); +// } +// +// } +// +// //customer +// User customer = null; +// try { +// customer = userRepository.getUserDetailsByUserName(username); +// +// } catch (Exception e) { +// throw new BadCredentialsException("No user registered with this details!"); +// } +// +// //if the person exists +// if (customer != null) { +// System.out.println(customer.getPassword()); +// +// //check for a match +// if (passwordEncoder.matches(pwd, customer.getPassword())) { +// +// //then it is a match a number of springs granted authorities +// List authorities = new ArrayList<>(); +// +// //loop through the users authorities and add each of them to simple granted authority +// try { +// customer.getRoles().forEach(a -> authorities.add(new SimpleGrantedAuthority(a.getRole()))); +// } catch (Exception e) { +// //user doesn't have permissions or roles = null +// System.out.println(e.toString()); +// return null; +// } +// //final send the username password and auth as a token which will call the authenticate method in the ProviderManager +// // in this edit i wont store the password but a use id +// +// //this is so that i can get a global access to an authenticated users name and id +// username = username + "," + customer.getId() + "," + customer.getUserAccountId().getId(); +// +// return new UsernamePasswordAuthenticationToken(username, pwd, authorities); +// } else { +// throw new BadCredentialsException("Invalid password!"); +// } +// } else { +// throw new BadCredentialsException("No user registered with this details!"); +// } +// } +// +// @Override +// public boolean supports(Class authentication) { +// //tells spring that i want to support username password style of auth +// return (UsernamePasswordAuthenticationToken.class.isAssignableFrom(authentication)); +// } +// +//} diff --git a/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/constents/SecurityConstants.java b/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/constents/SecurityConstants.java new file mode 100644 index 0000000..f72c978 --- /dev/null +++ b/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/constents/SecurityConstants.java @@ -0,0 +1,7 @@ +package com.example.cezenPBX.constents; + +public interface SecurityConstants { + + public static final String JWT_KEY = ";sdmn3426FHB426RH62389;]['/.sdwswa"; + public static final String JWT_HEADER = "Authorization"; +} diff --git a/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/controller/SignUpController.java b/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/controller/SignUpController.java new file mode 100644 index 0000000..1abe1a9 --- /dev/null +++ b/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/controller/SignUpController.java @@ -0,0 +1,25 @@ +package com.example.cezenPBX.controller; + +import com.example.cezenPBX.DTO.ReturnStatus; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/open") +public class SignUpController { + + + //sign up route + @PostMapping("/signup") + public ReturnStatus signUp(){ + + return new ReturnStatus(true, "User created successfully", ""); + } + + // and a login route + + + + // forgot password +} diff --git a/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/security/JWTTokenGeneratorFilter.java b/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/security/JWTTokenGeneratorFilter.java new file mode 100644 index 0000000..e1d8be5 --- /dev/null +++ b/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/security/JWTTokenGeneratorFilter.java @@ -0,0 +1,81 @@ +package com.example.cezenPBX.security; + +import com.example.cezenPBX.constents.SecurityConstants; +import io.jsonwebtoken.Jwts; +import io.jsonwebtoken.security.Keys; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.Cookie; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.web.filter.OncePerRequestFilter; + +import javax.crypto.SecretKey; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.Collection; +import java.util.Date; +import java.util.HashSet; +import java.util.Set; + +public class JWTTokenGeneratorFilter extends OncePerRequestFilter { + @Override + protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { + + //at this point the user is authenticated we just have to send the token back + Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); + System.out.println(authentication); + if (null != authentication) { + + //get the JWT key from the contents we defined + // Keys, Jwts class comes from pom.xml + SecretKey key = Keys.hmacShaKeyFor(SecurityConstants.JWT_KEY.getBytes(StandardCharsets.UTF_8)); + + //creating a JWT token + // issuer issues a jwt token + //subject can be any value + String jwt = Jwts.builder().issuer("Mathew Francis").subject("JWT_Token") + //building the token + .claim("username", authentication.getName()) + .claim("authorities", populateAuthorities(authentication.getAuthorities())) + .issuedAt(new Date()) + .expiration(new Date((new Date()).getTime() + 30000000)) + //signing it with the key we set on line 35 + .signWith(key).compact(); + //SecurityConstants.JWT_HEADER, in the Constants SecurityConstants folder + //response.setHeader(SecurityConstants.JWT_HEADER, jwt); + //uncomment for cookie based saving + Cookie cookie = new Cookie(SecurityConstants.JWT_HEADER,jwt); + cookie.setHttpOnly(true); + cookie.setSecure(true); + cookie.setPath("/"); + response.addCookie(cookie); + System.out.println("JWT Generated"); + } + System.out.println("Intercepted"); + + System.out.println(response.getHeader("X-XSRF-TOKEN")); + filterChain.doFilter(request, response); + } + + //only generate if the path is login + //other words this method will return false for /login + @Override + protected boolean shouldNotFilter(HttpServletRequest request) { + + return (request.getServletPath().equals("/open/signup") || request.getServletPath().equals("/open/employee-login")); + } + + // gets the authority's from granted authority which we set in the configuration CustomAuthenticationProvider class + // plug in user auth into jwt token + private String populateAuthorities(Collection collection) { + Set authoritiesSet = new HashSet<>(); + for (GrantedAuthority authority : collection) { + authoritiesSet.add(authority.getAuthority()); + } + return String.join(",", authoritiesSet); + } +} diff --git a/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/security/JWTTokenValidatorFilter.java b/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/security/JWTTokenValidatorFilter.java new file mode 100644 index 0000000..60e23df --- /dev/null +++ b/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/security/JWTTokenValidatorFilter.java @@ -0,0 +1,81 @@ +package com.example.cezenPBX.security; + +import com.example.cezenPBX.constents.SecurityConstants; +import io.jsonwebtoken.Claims; +import io.jsonwebtoken.Jwts; +import io.jsonwebtoken.security.Keys; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import org.springframework.security.authentication.BadCredentialsException; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.authority.AuthorityUtils; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.web.filter.OncePerRequestFilter; + +import javax.crypto.SecretKey; +import java.io.IOException; +import java.nio.charset.StandardCharsets; + +public class JWTTokenValidatorFilter extends OncePerRequestFilter { + + @Override + protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, + FilterChain filterChain) throws ServletException, IOException { + + // SecurityConstants + // public static final String JWT_KEY = "jxgEQeXHuPq8VdbyYFNkANdudQ53YUn4"; + // public static final String JWT_HEADER = "Authorization"; + //String jwt = request.getHeader(SecurityConstants.JWT_HEADER); + //below is the COOKIE approach + String jwt = null; + for(var cookie : request.getCookies()){ + if(cookie.getName().equals("Authorization")){ + System.out.print("COOKIE"); + System.out.println(cookie.getValue()); + jwt = cookie.getValue(); + } + } + if (null != jwt) { + try { + //generating the key + SecretKey key = Keys.hmacShaKeyFor( + SecurityConstants.JWT_KEY.getBytes(StandardCharsets.UTF_8)); + + //verification of legitimacy + Claims claims = Jwts.parser() + .verifyWith(key) + .build() + .parseSignedClaims(jwt) + .getPayload(); + String username = String.valueOf(claims.get("username")); + String authorities = (String) claims.get("authorities"); + +// System.out.println("JWT name : "+ username); +// System.out.println("JWT auth "+ authorities); + + //if successful the result will be stored in SecurityContextHolder + Authentication auth = new UsernamePasswordAuthenticationToken(username, null, + //this comes in a string of comas and values + AuthorityUtils.commaSeparatedStringToAuthorityList(authorities)); + SecurityContextHolder.getContext().setAuthentication(auth); + } catch (Exception e) { + throw new BadCredentialsException("Invalid Token received!"); + } + + } + filterChain.doFilter(request, response); + } + + //should be executed for all the api except the login api + @Override + protected boolean shouldNotFilter(HttpServletRequest request) { + + return request.getServletPath().equals("/open/signup") + || request.getServletPath().equals("/employee/employee-login"); +// //bellow was done to archive this /exposed/** +// request.getServletPath().split("/")[1].equals("exposed"); + } +} diff --git a/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/service/PbxUserController.java b/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/service/PbxUserController.java new file mode 100644 index 0000000..d8ac35f --- /dev/null +++ b/MySQL_conf_pbx/test1/springCezenPBX/src/main/java/com/example/cezenPBX/service/PbxUserController.java @@ -0,0 +1,7 @@ +package com.example.cezenPBX.service; + +import org.springframework.stereotype.Service; + +@Service +public class PbxUserController { +}