Commit fc93f4e7 authored by ReemyHasan's avatar ReemyHasan

delete user management

parent 58a7ff50
......@@ -7,7 +7,6 @@
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="UserManagement" />
<module name="producer" />
<module name="consumer" />
</profile>
......
......@@ -455,3 +455,34 @@
2023-05-12T21:00:36.827190200 1.287507s notice: Server ready, "94f92ff17ad0_b5t" 351bd23d-da7f-4829-93f5-9a1d2711b6cb
2023-05-12T21:00:38.501374800 3.001877s info: Table 9ab94c3e-b3cf-49d9-a5c1-98af7df44d3e: Starting a new Raft election for term 3.
2023-05-12T21:00:38.506684900 3.007187s info: Table 9ab94c3e-b3cf-49d9-a5c1-98af7df44d3e: This server is Raft leader for term 3. Latest log index is 5.
2023-05-13T07:28:07.734202500 0.098485s notice: Running rethinkdb 2.4.2~0bullseye (GCC 10.2.1)...
2023-05-13T07:28:07.748730700 0.113015s notice: Running on Linux 5.10.16.3-microsoft-standard-WSL2 x86_64
2023-05-13T07:28:07.749517800 0.113801s notice: Loading data from directory /data/rethinkdb_data
2023-05-13T07:28:07.808920800 0.173204s info: Automatically using cache size of 3167 MB
2023-05-13T07:28:07.814056900 0.178340s notice: Listening for intracluster connections on port 29015
2023-05-13T07:28:07.871934000 0.236217s notice: Listening for client driver connections on port 28015
2023-05-13T07:28:07.872693600 0.236977s notice: Listening for administrative HTTP connections on port 8080
2023-05-13T07:28:07.872843800 0.237127s notice: Listening on cluster addresses: 127.0.0.1, 172.18.0.2
2023-05-13T07:28:07.872865200 0.237148s notice: Listening on driver addresses: 127.0.0.1, 172.18.0.2
2023-05-13T07:28:07.872869200 0.237152s notice: Listening on http addresses: 127.0.0.1, 172.18.0.2
2023-05-13T07:28:07.872877800 0.237160s notice: Server ready, "94f92ff17ad0_b5t" 351bd23d-da7f-4829-93f5-9a1d2711b6cb
2023-05-13T07:28:09.031502800 1.395786s info: Table 9ab94c3e-b3cf-49d9-a5c1-98af7df44d3e: Starting a new Raft election for term 4.
2023-05-13T07:28:09.058423200 1.422706s info: Table 9ab94c3e-b3cf-49d9-a5c1-98af7df44d3e: This server is Raft leader for term 4. Latest log index is 8.
2023-05-14T08:36:45.361247000 0.627774s notice: Running rethinkdb 2.4.2~0bullseye (GCC 10.2.1)...
2023-05-14T08:36:45.456887900 0.723415s notice: Running on Linux 5.10.16.3-microsoft-standard-WSL2 x86_64
2023-05-14T08:36:45.457866400 0.724394s notice: Loading data from directory /data/rethinkdb_data
2023-05-14T08:36:45.774770400 1.041297s info: Automatically using cache size of 3775 MB
2023-05-14T08:36:45.847378400 1.113905s notice: Listening for intracluster connections on port 29015
2023-05-14T08:36:46.148894500 1.415421s notice: Listening for client driver connections on port 28015
2023-05-14T08:36:46.149198500 1.415725s notice: Listening for administrative HTTP connections on port 8080
2023-05-14T08:36:46.149203600 1.415730s notice: Listening on cluster addresses: 127.0.0.1, 172.18.0.3
2023-05-14T08:36:46.149204600 1.415731s notice: Listening on driver addresses: 127.0.0.1, 172.18.0.3
2023-05-14T08:36:46.149208400 1.415735s notice: Listening on http addresses: 127.0.0.1, 172.18.0.3
2023-05-14T08:36:46.149211900 1.415738s notice: Server ready, "94f92ff17ad0_b5t" 351bd23d-da7f-4829-93f5-9a1d2711b6cb
2023-05-14T08:36:47.919050800 3.194839s info: Table 9ab94c3e-b3cf-49d9-a5c1-98af7df44d3e: Starting a new Raft election for term 5.
2023-05-14T08:36:47.924255800 3.200044s info: Table 9ab94c3e-b3cf-49d9-a5c1-98af7df44d3e: This server is Raft leader for term 5. Latest log index is 11.
2023-05-14T11:27:31.376912900 7609.813046s notice: Server got SIGTERM from pid 0, uid 0; shutting down...
2023-05-14T11:27:31.378463600 7609.814595s notice: Shutting down client connections...
2023-05-14T11:27:31.383893100 7609.820025s notice: All client connections closed.
2023-05-14T11:27:31.383900900 7609.820033s notice: Shutting down storage engine... (This may take a while if you had a lot of unflushed data in the writeback cache.)
2023-05-14T11:27:31.716616700 7610.152749s notice: Storage engine shut down.
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/apache-maven-3.8.6-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar
<mxfile host="Electron" modified="2023-04-27T08:53:10.057Z" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/21.2.1 Chrome/112.0.5615.87 Electron/24.1.2 Safari/537.36" etag="DDOU9Ve5raWsCyPsviHS" version="21.2.1" type="device" pages="4">
<diagram id="pjGB-ErrghB2Nym8I_LS" name="security-workflow">
<mxGraphModel dx="3194" dy="1214" grid="0" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="qfr3ut9dFdVh4iJpzXPu-13" value="" style="group" parent="1" vertex="1" connectable="0">
<mxGeometry x="160" y="30" width="787" height="787" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-14" value="" style="group" parent="qfr3ut9dFdVh4iJpzXPu-13" vertex="1" connectable="0">
<mxGeometry width="787" height="787" as="geometry" />
</mxCell>
<mxCell id="OGfNcUSvT1gZZqw-ERg4-2" value="" style="whiteSpace=wrap;html=1;aspect=fixed;fillColor=#d5e8d4;strokeColor=#82b366;" parent="qfr3ut9dFdVh4iJpzXPu-14" vertex="1">
<mxGeometry width="787" height="787" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-5" value="" style="rounded=0;whiteSpace=wrap;html=1;" parent="qfr3ut9dFdVh4iJpzXPu-14" vertex="1">
<mxGeometry x="38" y="116" width="727" height="520" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-16" value="" style="group" parent="qfr3ut9dFdVh4iJpzXPu-14" vertex="1" connectable="0">
<mxGeometry x="317" y="120" width="124" height="93" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-12" value="" style="sketch=0;html=1;aspect=fixed;strokeColor=none;shadow=0;align=center;verticalAlign=top;fillColor=#3B8DF1;shape=mxgraph.gcp2.systems_check;rounded=0;fontColor=#3399FF;" parent="qfr3ut9dFdVh4iJpzXPu-16" vertex="1">
<mxGeometry x="26.840000000000003" y="26" width="66.33" height="67" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-15" value="UserDetailsService" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontColor=#3399FF;fontStyle=1" parent="qfr3ut9dFdVh4iJpzXPu-16" vertex="1">
<mxGeometry x="-3" width="127" height="26" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-28" value="" style="group" parent="qfr3ut9dFdVh4iJpzXPu-14" vertex="1" connectable="0">
<mxGeometry x="182" y="245" width="120" height="112.04615384615384" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-29" value="" style="group" parent="qfr3ut9dFdVh4iJpzXPu-28" vertex="1" connectable="0">
<mxGeometry x="20" width="80" height="82.04615384615384" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-30" value="" style="group" parent="qfr3ut9dFdVh4iJpzXPu-29" vertex="1" connectable="0">
<mxGeometry x="23.200000000000003" y="18.870615384615384" width="32" height="45.12538461538462" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-31" value="" style="verticalLabelPosition=bottom;html=1;verticalAlign=top;align=center;strokeColor=#2D7600;fillColor=#60a917;shape=mxgraph.azure.startup_task;pointerEvents=1;fontSize=14;fontColor=#ffffff;" parent="qfr3ut9dFdVh4iJpzXPu-30" vertex="1">
<mxGeometry width="31.99999999999999" height="45.12538461538462" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-32" value="" style="sketch=0;html=1;aspect=fixed;strokeColor=#2D7600;shadow=0;align=center;verticalAlign=top;fillColor=#60a917;shape=mxgraph.gcp2.check;fontSize=14;fontColor=#ffffff;" parent="qfr3ut9dFdVh4iJpzXPu-30" vertex="1">
<mxGeometry x="3.1971197119711996" y="5.206775147928994" width="9.89152296481915" height="7.9132183718553195" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-33" value="" style="sketch=0;html=1;aspect=fixed;strokeColor=#2D7600;shadow=0;align=center;verticalAlign=top;fillColor=#60a917;shape=mxgraph.gcp2.check;fontSize=14;fontColor=#ffffff;" parent="qfr3ut9dFdVh4iJpzXPu-30" vertex="1">
<mxGeometry x="3.1971197119711996" y="12.149142011834318" width="9.89152296481915" height="7.9132183718553195" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-34" value="" style="rhombus;whiteSpace=wrap;html=1;fontSize=14;fontColor=default;fillColor=none;" parent="qfr3ut9dFdVh4iJpzXPu-29" vertex="1">
<mxGeometry width="80" height="82.04615384615384" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-35" value="Validate JWT" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontSize=14;fontColor=#006600;fontStyle=1" parent="qfr3ut9dFdVh4iJpzXPu-28" vertex="1">
<mxGeometry x="8" y="83.04615384615384" width="104" height="29" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-45" style="edgeStyle=orthogonalEdgeStyle;rounded=0;sketch=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;strokeColor=default;strokeWidth=2;fontColor=#0079d6;" parent="qfr3ut9dFdVh4iJpzXPu-14" source="qfr3ut9dFdVh4iJpzXPu-41" target="qfr3ut9dFdVh4iJpzXPu-44" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-41" value="Security" style="html=1;strokeColor=none;fillColor=#0079D6;labelPosition=center;verticalLabelPosition=middle;verticalAlign=top;align=center;fontSize=12;outlineConnect=0;spacingTop=-6;fontColor=#FFFFFF;sketch=0;shape=mxgraph.sitemap.security;rounded=0;" parent="qfr3ut9dFdVh4iJpzXPu-14" vertex="1">
<mxGeometry x="332" y="374" width="83" height="63" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-42" style="edgeStyle=orthogonalEdgeStyle;rounded=0;sketch=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;strokeColor=#6c8ebf;strokeWidth=2;fontColor=default;fillColor=#dae8fc;" parent="qfr3ut9dFdVh4iJpzXPu-14" source="qfr3ut9dFdVh4iJpzXPu-34" target="qfr3ut9dFdVh4iJpzXPu-41" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-20" value="" style="group" parent="qfr3ut9dFdVh4iJpzXPu-14" vertex="1" connectable="0">
<mxGeometry x="30.5" y="388" width="115" height="63.4736842105263" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-6" value="&lt;font color=&quot;#3399ff&quot;&gt;Check JWT token&lt;/font&gt;" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontStyle=1" parent="qfr3ut9dFdVh4iJpzXPu-20" vertex="1">
<mxGeometry x="-3" y="37.4736842105263" width="118" height="26" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-4" value="" style="verticalLabelPosition=bottom;html=1;verticalAlign=top;align=center;strokeColor=none;fillColor=#00BEF2;shape=mxgraph.azure.startup_task;pointerEvents=1;" parent="qfr3ut9dFdVh4iJpzXPu-20" vertex="1">
<mxGeometry x="32.580357142857146" width="39.441964285714285" height="39.473684210526315" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-43" value="Update the&lt;br&gt;SecurityContextHolder" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontColor=#0079d6;fontStyle=1" parent="qfr3ut9dFdVh4iJpzXPu-14" vertex="1">
<mxGeometry x="303" y="440" width="148" height="41" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-52" style="edgeStyle=orthogonalEdgeStyle;rounded=0;sketch=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=default;strokeWidth=2;fontColor=#0079d6;" parent="qfr3ut9dFdVh4iJpzXPu-14" source="qfr3ut9dFdVh4iJpzXPu-44" target="qfr3ut9dFdVh4iJpzXPu-47" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-44" value="" style="aspect=fixed;perimeter=ellipsePerimeter;html=1;align=center;shadow=0;dashed=0;fontColor=#4277BB;labelBackgroundColor=#ffffff;fontSize=12;spacingTop=3;image;image=img/lib/ibm/vpc/Router.svg;rounded=0;sketch=0;" parent="qfr3ut9dFdVh4iJpzXPu-14" vertex="1">
<mxGeometry x="575" y="375.5" width="60" height="60" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-46" value="" style="group" parent="qfr3ut9dFdVh4iJpzXPu-14" vertex="1" connectable="0">
<mxGeometry x="552" y="504" width="90" height="130" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-47" value="" style="sketch=0;aspect=fixed;pointerEvents=1;shadow=0;dashed=0;html=1;strokeColor=none;labelPosition=center;verticalLabelPosition=bottom;verticalAlign=top;align=center;fillColor=#808080;shape=mxgraph.mscae.enterprise.server_directory;rounded=0;labelBackgroundColor=none;labelBorderColor=none;strokeWidth=2;fontSize=32;fontColor=#3399FF;" parent="qfr3ut9dFdVh4iJpzXPu-46" vertex="1">
<mxGeometry x="18" width="72" height="100" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-48" value="Controller" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontSize=14;fontColor=default;fontStyle=1" parent="qfr3ut9dFdVh4iJpzXPu-46" vertex="1">
<mxGeometry y="100" width="90" height="30" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-60" value="" style="sketch=0;html=1;aspect=fixed;strokeColor=#82b366;shadow=0;align=center;verticalAlign=top;fillColor=#d5e8d4;shape=mxgraph.gcp2.systems_check;rounded=0;fontColor=#2c8b18;" parent="qfr3ut9dFdVh4iJpzXPu-14" vertex="1">
<mxGeometry x="328.0032258064516" y="219.9320430107527" width="41.72370967741935" height="42.145161290322584" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-61" value="JwtService" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=#82b366;fillColor=#d5e8d4;fontStyle=1;fontColor=#2c8b18;" parent="qfr3ut9dFdVh4iJpzXPu-14" vertex="1">
<mxGeometry x="366.00290322580645" y="228" width="81" height="26" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-62" style="edgeStyle=orthogonalEdgeStyle;rounded=0;sketch=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0;exitDx=0;exitDy=0;strokeColor=#2D7600;strokeWidth=2;fontColor=#2c8b18;fillColor=#60a917;" parent="qfr3ut9dFdVh4iJpzXPu-14" source="qfr3ut9dFdVh4iJpzXPu-34" target="qfr3ut9dFdVh4iJpzXPu-60" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-66" value="DispatcherServlet" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontColor=#8ec53f;" parent="qfr3ut9dFdVh4iJpzXPu-14" vertex="1">
<mxGeometry x="548.5" y="353" width="113" height="26" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-64" style="edgeStyle=orthogonalEdgeStyle;rounded=0;sketch=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;strokeColor=default;strokeWidth=2;fontColor=#2c8b18;" parent="1" source="OGfNcUSvT1gZZqw-ERg4-1" target="OGfNcUSvT1gZZqw-ERg4-2" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="OGfNcUSvT1gZZqw-ERg4-1" value="" style="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image=https://seeklogo.com/images/P/postman-logo-F43375A2EB-seeklogo.com.png;" parent="1" vertex="1">
<mxGeometry x="8" y="398.5" width="48.67" height="50" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-1" value="" style="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image=https://4.bp.blogspot.com/-ou-a_Aa1t7A/W6IhNc3Q0gI/AAAAAAAAD6Y/pwh44arKiuM_NBqB1H7Pz4-7QhUxAgZkACLcBGAs/s1600/spring-boot-logo.png;" parent="1" vertex="1">
<mxGeometry x="688.26" y="672" width="150.48" height="79" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-2" value="" style="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image=https://www.turbonomic.com/wp-content/uploads/2022/04/logo_apache-tomcat.png;" parent="1" vertex="1">
<mxGeometry x="268.26" y="676.25" width="130" height="70.5" as="geometry" />
</mxCell>
<mxCell id="OGfNcUSvT1gZZqw-ERg4-11" value="" style="group;" parent="1" vertex="1" connectable="0">
<mxGeometry x="214" y="366" width="98" height="64" as="geometry" />
</mxCell>
<mxCell id="OGfNcUSvT1gZZqw-ERg4-8" value="" style="rounded=0;whiteSpace=wrap;html=1;" parent="OGfNcUSvT1gZZqw-ERg4-11" vertex="1">
<mxGeometry width="84" height="48" as="geometry" />
</mxCell>
<mxCell id="OGfNcUSvT1gZZqw-ERg4-9" value="" style="rounded=0;whiteSpace=wrap;html=1;" parent="OGfNcUSvT1gZZqw-ERg4-11" vertex="1">
<mxGeometry x="7" y="8" width="84" height="48" as="geometry" />
</mxCell>
<mxCell id="OGfNcUSvT1gZZqw-ERg4-10" value="JwtAuthFilter" style="rounded=0;whiteSpace=wrap;html=1;" parent="OGfNcUSvT1gZZqw-ERg4-11" vertex="1">
<mxGeometry x="14" y="16" width="84" height="48" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-3" value="" style="endArrow=classic;startArrow=classic;html=1;rounded=0;strokeColor=#000033;strokeWidth=2;fontSize=14;fontColor=default;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="1" source="qfr3ut9dFdVh4iJpzXPu-2" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="398.26" y="702" as="sourcePoint" />
<mxPoint x="673.5" y="712" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-18" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;fontColor=#3399FF;strokeWidth=2;" parent="1" source="OGfNcUSvT1gZZqw-ERg4-8" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="502" y="212" as="targetPoint" />
<Array as="points">
<mxPoint x="284" y="366" />
<mxPoint x="284" y="212" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-19" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fontColor=#3399FF;strokeWidth=2;" parent="1" source="qfr3ut9dFdVh4iJpzXPu-12" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="1080" y="280" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-22" value="" style="group" parent="1" vertex="1" connectable="0">
<mxGeometry x="1006.98" y="281" width="133.01999999999998" height="209" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-21" value="" style="aspect=fixed;html=1;points=[];align=center;image;fontSize=12;image=img/lib/azure2/databases/Azure_Database_PostgreSQL_Server.svg;rounded=0;sketch=0;fontColor=#3399FF;" parent="qfr3ut9dFdVh4iJpzXPu-22" vertex="1">
<mxGeometry x="12.019999999999982" width="90.75" height="121" as="geometry" />
</mxCell>
<mxCell id="OGfNcUSvT1gZZqw-ERg4-4" value="" style="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image=https://developers.redhat.com/sites/default/files/styles/article_feature/public/blog/2014/05/homepage-docker-logo.png?itok=zx0e-vcP;" parent="qfr3ut9dFdVh4iJpzXPu-22" vertex="1">
<mxGeometry y="99" width="133.02" height="110" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-24" value="Invalid JWT token" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontColor=#e26259;fontStyle=1" parent="1" vertex="1">
<mxGeometry x="56.8" y="230" width="120" height="26" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-25" value="Missing JWT" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontColor=#e26259;fontStyle=1" parent="1" vertex="1">
<mxGeometry x="76.6" y="288" width="91" height="26" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-26" value="User does not exist" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontColor=#e26259;fontStyle=1" parent="1" vertex="1">
<mxGeometry x="76.6" y="311" width="129" height="26" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-27" value="HTTP 403" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontColor=#e26259;rounded=0;sketch=0;fontStyle=1" parent="1" vertex="1">
<mxGeometry x="1" y="356" width="72" height="26" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-37" style="edgeStyle=orthogonalEdgeStyle;rounded=0;sketch=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.959;entryY=0.695;entryDx=0;entryDy=0;entryPerimeter=0;strokeColor=#0ed60a;strokeWidth=2;fontColor=default;" parent="1" source="qfr3ut9dFdVh4iJpzXPu-21" target="qfr3ut9dFdVh4iJpzXPu-12" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="1064" y="223" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-38" style="edgeStyle=orthogonalEdgeStyle;rounded=0;sketch=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=1;entryY=0;entryDx=0;entryDy=0;strokeColor=#0ed60a;strokeWidth=2;fontColor=default;" parent="1" source="qfr3ut9dFdVh4iJpzXPu-12" target="OGfNcUSvT1gZZqw-ERg4-8" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="298" y="225" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-39" style="edgeStyle=orthogonalEdgeStyle;rounded=0;sketch=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=default;strokeWidth=2;fontColor=default;" parent="1" source="OGfNcUSvT1gZZqw-ERg4-10" target="qfr3ut9dFdVh4iJpzXPu-34" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-40" style="edgeStyle=orthogonalEdgeStyle;rounded=0;sketch=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;strokeColor=#d50c0b;strokeWidth=2;fontColor=default;" parent="1" source="qfr3ut9dFdVh4iJpzXPu-34" target="OGfNcUSvT1gZZqw-ERg4-1" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="402" y="259" />
<mxPoint x="32" y="259" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-53" style="edgeStyle=orthogonalEdgeStyle;rounded=0;sketch=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#3c8df1;strokeWidth=2;fontColor=#0079d6;startArrow=none;" parent="1" source="qfr3ut9dFdVh4iJpzXPu-55" target="OGfNcUSvT1gZZqw-ERg4-1" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-55" value="" style="dashed=0;outlineConnect=0;html=1;align=center;labelPosition=center;verticalLabelPosition=bottom;verticalAlign=top;shape=mxgraph.weblogos.json_2;rounded=0;sketch=0;fontColor=#0079d6;" parent="1" vertex="1">
<mxGeometry x="76.60000000000002" y="571.4" width="80.4" height="25.200000000000003" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-56" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;sketch=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#3c8df1;strokeWidth=2;fontColor=#0079d6;endArrow=none;" parent="1" source="qfr3ut9dFdVh4iJpzXPu-47" target="qfr3ut9dFdVh4iJpzXPu-55" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="730" y="584.0322580645161" as="sourcePoint" />
<mxPoint x="32.322580645161224" y="448.5" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-57" value="HTTP 200" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontColor=#0079d6;fontStyle=1" parent="1" vertex="1">
<mxGeometry y="464" width="72" height="26" as="geometry" />
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-58" style="edgeStyle=orthogonalEdgeStyle;rounded=0;sketch=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;strokeColor=#d40d0b;strokeWidth=2;fontColor=#d40d0b;" parent="1" source="OGfNcUSvT1gZZqw-ERg4-8" target="OGfNcUSvT1gZZqw-ERg4-1" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="214" y="287" />
<mxPoint x="32" y="287" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="qfr3ut9dFdVh4iJpzXPu-65" value="HTTP Requests" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontColor=default;fontStyle=1" parent="1" vertex="1">
<mxGeometry x="45" y="425" width="106" height="26" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
<diagram id="sBTO1LKfppjqILYJjrTV" name="new-flow">
<mxGraphModel dx="2229" dy="1045" grid="0" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="HA8-pInTj3ZK-7nUhY4h-1" value="" style="group;fillColor=default;strokeColor=none;" parent="1" vertex="1" connectable="0">
<mxGeometry x="60" y="360" width="180" height="90" as="geometry" />
</mxCell>
<mxCell id="QRnQFyGs-lFjeeRuztLu-1" value="" style="rounded=0;whiteSpace=wrap;html=1;" parent="HA8-pInTj3ZK-7nUhY4h-1" vertex="1">
<mxGeometry width="160" height="70" as="geometry" />
</mxCell>
<mxCell id="QRnQFyGs-lFjeeRuztLu-2" value="" style="rounded=0;whiteSpace=wrap;html=1;" parent="HA8-pInTj3ZK-7nUhY4h-1" vertex="1">
<mxGeometry x="10" y="10" width="160" height="70" as="geometry" />
</mxCell>
<mxCell id="QRnQFyGs-lFjeeRuztLu-3" value="JwtAuthFilter" style="rounded=0;whiteSpace=wrap;html=1;" parent="HA8-pInTj3ZK-7nUhY4h-1" vertex="1">
<mxGeometry x="20" y="20" width="160" height="70" as="geometry" />
</mxCell>
<mxCell id="OrCYgKApnLObKEuBMM75-9" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="1" source="OrCYgKApnLObKEuBMM75-1" target="OrCYgKApnLObKEuBMM75-5" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="OrCYgKApnLObKEuBMM75-1" value="JwtService" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="400" y="330" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="OrCYgKApnLObKEuBMM75-6" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="OrCYgKApnLObKEuBMM75-2" target="OrCYgKApnLObKEuBMM75-5" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="OrCYgKApnLObKEuBMM75-2" value="TokenRepository" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" vertex="1">
<mxGeometry x="400" y="430" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="OrCYgKApnLObKEuBMM75-3" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;curved=1;" parent="1" source="QRnQFyGs-lFjeeRuztLu-3" target="OrCYgKApnLObKEuBMM75-1" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="OrCYgKApnLObKEuBMM75-4" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;curved=1;" parent="1" source="QRnQFyGs-lFjeeRuztLu-3" target="OrCYgKApnLObKEuBMM75-2" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="EAdGHvd8W2WM0f3SbvN2-2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeWidth=2;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" source="OrCYgKApnLObKEuBMM75-5" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="920" y="405" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="EAdGHvd8W2WM0f3SbvN2-6" value="Valid token" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="EAdGHvd8W2WM0f3SbvN2-2" vertex="1" connectable="0">
<mxGeometry x="-0.319" y="1" relative="1" as="geometry">
<mxPoint x="13" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="EAdGHvd8W2WM0f3SbvN2-4" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeWidth=2;fillColor=#f8cecc;strokeColor=#b85450;" parent="1" source="OrCYgKApnLObKEuBMM75-5" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="740" y="200" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="EAdGHvd8W2WM0f3SbvN2-5" value="Invalid token" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="EAdGHvd8W2WM0f3SbvN2-4" vertex="1" connectable="0">
<mxGeometry x="-0.1919" y="-1" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="OrCYgKApnLObKEuBMM75-5" value="Calculate" style="rhombus;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="700" y="365" width="80" height="80" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
<diagram id="JHzdb8y7AclNLFwD1zrP" name="class-diagram">
<mxGraphModel dx="2229" dy="1045" grid="0" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="XC6CGuYQlSzaP45YXhiZ-1" value="User" style="shape=table;startSize=30;container=1;collapsible=1;childLayout=tableLayout;fixedRows=1;rowLines=0;fontStyle=1;align=center;resizeLast=1;fillColor=default;" parent="1" vertex="1">
<mxGeometry x="344" y="259" width="180" height="210" as="geometry" />
</mxCell>
<mxCell id="XC6CGuYQlSzaP45YXhiZ-2" value="" style="shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;fillColor=none;collapsible=0;dropTarget=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;top=0;left=0;right=0;bottom=1;" parent="XC6CGuYQlSzaP45YXhiZ-1" vertex="1">
<mxGeometry y="30" width="180" height="30" as="geometry" />
</mxCell>
<mxCell id="XC6CGuYQlSzaP45YXhiZ-3" value="PK" style="shape=partialRectangle;connectable=0;fillColor=none;top=0;left=0;bottom=0;right=0;fontStyle=1;overflow=hidden;" parent="XC6CGuYQlSzaP45YXhiZ-2" vertex="1">
<mxGeometry width="60" height="30" as="geometry">
<mxRectangle width="60" height="30" as="alternateBounds" />
</mxGeometry>
</mxCell>
<mxCell id="XC6CGuYQlSzaP45YXhiZ-4" value="id" style="shape=partialRectangle;connectable=0;fillColor=none;top=0;left=0;bottom=0;right=0;align=left;spacingLeft=6;fontStyle=5;overflow=hidden;" parent="XC6CGuYQlSzaP45YXhiZ-2" vertex="1">
<mxGeometry x="60" width="120" height="30" as="geometry">
<mxRectangle width="120" height="30" as="alternateBounds" />
</mxGeometry>
</mxCell>
<mxCell id="XC6CGuYQlSzaP45YXhiZ-5" value="" style="shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;fillColor=none;collapsible=0;dropTarget=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;top=0;left=0;right=0;bottom=0;" parent="XC6CGuYQlSzaP45YXhiZ-1" vertex="1">
<mxGeometry y="60" width="180" height="30" as="geometry" />
</mxCell>
<mxCell id="XC6CGuYQlSzaP45YXhiZ-6" value="String" style="shape=partialRectangle;connectable=0;fillColor=none;top=0;left=0;bottom=0;right=0;editable=1;overflow=hidden;" parent="XC6CGuYQlSzaP45YXhiZ-5" vertex="1">
<mxGeometry width="60" height="30" as="geometry">
<mxRectangle width="60" height="30" as="alternateBounds" />
</mxGeometry>
</mxCell>
<mxCell id="XC6CGuYQlSzaP45YXhiZ-7" value="firstName" style="shape=partialRectangle;connectable=0;fillColor=none;top=0;left=0;bottom=0;right=0;align=left;spacingLeft=6;overflow=hidden;" parent="XC6CGuYQlSzaP45YXhiZ-5" vertex="1">
<mxGeometry x="60" width="120" height="30" as="geometry">
<mxRectangle width="120" height="30" as="alternateBounds" />
</mxGeometry>
</mxCell>
<mxCell id="XC6CGuYQlSzaP45YXhiZ-8" value="" style="shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;fillColor=none;collapsible=0;dropTarget=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;top=0;left=0;right=0;bottom=0;" parent="XC6CGuYQlSzaP45YXhiZ-1" vertex="1">
<mxGeometry y="90" width="180" height="30" as="geometry" />
</mxCell>
<mxCell id="XC6CGuYQlSzaP45YXhiZ-9" value="String" style="shape=partialRectangle;connectable=0;fillColor=none;top=0;left=0;bottom=0;right=0;editable=1;overflow=hidden;" parent="XC6CGuYQlSzaP45YXhiZ-8" vertex="1">
<mxGeometry width="60" height="30" as="geometry">
<mxRectangle width="60" height="30" as="alternateBounds" />
</mxGeometry>
</mxCell>
<mxCell id="XC6CGuYQlSzaP45YXhiZ-10" value="lastName" style="shape=partialRectangle;connectable=0;fillColor=none;top=0;left=0;bottom=0;right=0;align=left;spacingLeft=6;overflow=hidden;" parent="XC6CGuYQlSzaP45YXhiZ-8" vertex="1">
<mxGeometry x="60" width="120" height="30" as="geometry">
<mxRectangle width="120" height="30" as="alternateBounds" />
</mxGeometry>
</mxCell>
<mxCell id="XC6CGuYQlSzaP45YXhiZ-11" value="" style="shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;fillColor=none;collapsible=0;dropTarget=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;top=0;left=0;right=0;bottom=0;" parent="XC6CGuYQlSzaP45YXhiZ-1" vertex="1">
<mxGeometry y="120" width="180" height="30" as="geometry" />
</mxCell>
<mxCell id="XC6CGuYQlSzaP45YXhiZ-12" value="String" style="shape=partialRectangle;connectable=0;fillColor=none;top=0;left=0;bottom=0;right=0;editable=1;overflow=hidden;" parent="XC6CGuYQlSzaP45YXhiZ-11" vertex="1">
<mxGeometry width="60" height="30" as="geometry">
<mxRectangle width="60" height="30" as="alternateBounds" />
</mxGeometry>
</mxCell>
<mxCell id="XC6CGuYQlSzaP45YXhiZ-13" value="email" style="shape=partialRectangle;connectable=0;fillColor=none;top=0;left=0;bottom=0;right=0;align=left;spacingLeft=6;overflow=hidden;" parent="XC6CGuYQlSzaP45YXhiZ-11" vertex="1">
<mxGeometry x="60" width="120" height="30" as="geometry">
<mxRectangle width="120" height="30" as="alternateBounds" />
</mxGeometry>
</mxCell>
<mxCell id="XC6CGuYQlSzaP45YXhiZ-32" value="" style="shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;fillColor=none;collapsible=0;dropTarget=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;top=0;left=0;right=0;bottom=0;" parent="XC6CGuYQlSzaP45YXhiZ-1" vertex="1">
<mxGeometry y="150" width="180" height="30" as="geometry" />
</mxCell>
<mxCell id="XC6CGuYQlSzaP45YXhiZ-33" value="String" style="shape=partialRectangle;connectable=0;fillColor=none;top=0;left=0;bottom=0;right=0;editable=1;overflow=hidden;" parent="XC6CGuYQlSzaP45YXhiZ-32" vertex="1">
<mxGeometry width="60" height="30" as="geometry">
<mxRectangle width="60" height="30" as="alternateBounds" />
</mxGeometry>
</mxCell>
<mxCell id="XC6CGuYQlSzaP45YXhiZ-34" value="password" style="shape=partialRectangle;connectable=0;fillColor=none;top=0;left=0;bottom=0;right=0;align=left;spacingLeft=6;overflow=hidden;" parent="XC6CGuYQlSzaP45YXhiZ-32" vertex="1">
<mxGeometry x="60" width="120" height="30" as="geometry">
<mxRectangle width="120" height="30" as="alternateBounds" />
</mxGeometry>
</mxCell>
<mxCell id="XC6CGuYQlSzaP45YXhiZ-35" value="" style="shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;fillColor=none;collapsible=0;dropTarget=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;top=0;left=0;right=0;bottom=0;" parent="XC6CGuYQlSzaP45YXhiZ-1" vertex="1">
<mxGeometry y="180" width="180" height="30" as="geometry" />
</mxCell>
<mxCell id="XC6CGuYQlSzaP45YXhiZ-36" value="String" style="shape=partialRectangle;connectable=0;fillColor=none;top=0;left=0;bottom=0;right=0;editable=1;overflow=hidden;" parent="XC6CGuYQlSzaP45YXhiZ-35" vertex="1">
<mxGeometry width="60" height="30" as="geometry">
<mxRectangle width="60" height="30" as="alternateBounds" />
</mxGeometry>
</mxCell>
<mxCell id="XC6CGuYQlSzaP45YXhiZ-37" value="role" style="shape=partialRectangle;connectable=0;fillColor=none;top=0;left=0;bottom=0;right=0;align=left;spacingLeft=6;overflow=hidden;" parent="XC6CGuYQlSzaP45YXhiZ-35" vertex="1">
<mxGeometry x="60" width="120" height="30" as="geometry">
<mxRectangle width="120" height="30" as="alternateBounds" />
</mxGeometry>
</mxCell>
<mxCell id="XC6CGuYQlSzaP45YXhiZ-14" value="Token" style="shape=table;startSize=30;container=1;collapsible=1;childLayout=tableLayout;fixedRows=1;rowLines=0;fontStyle=1;align=center;resizeLast=1;fillColor=default;" parent="1" vertex="1">
<mxGeometry x="645" y="389" width="180" height="180" as="geometry" />
</mxCell>
<mxCell id="XC6CGuYQlSzaP45YXhiZ-15" value="" style="shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;fillColor=none;collapsible=0;dropTarget=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;top=0;left=0;right=0;bottom=1;" parent="XC6CGuYQlSzaP45YXhiZ-14" vertex="1">
<mxGeometry y="30" width="180" height="30" as="geometry" />
</mxCell>
<mxCell id="XC6CGuYQlSzaP45YXhiZ-16" value="PK" style="shape=partialRectangle;connectable=0;fillColor=none;top=0;left=0;bottom=0;right=0;fontStyle=1;overflow=hidden;" parent="XC6CGuYQlSzaP45YXhiZ-15" vertex="1">
<mxGeometry width="49" height="30" as="geometry">
<mxRectangle width="49" height="30" as="alternateBounds" />
</mxGeometry>
</mxCell>
<mxCell id="XC6CGuYQlSzaP45YXhiZ-17" value="id" style="shape=partialRectangle;connectable=0;fillColor=none;top=0;left=0;bottom=0;right=0;align=left;spacingLeft=6;fontStyle=5;overflow=hidden;" parent="XC6CGuYQlSzaP45YXhiZ-15" vertex="1">
<mxGeometry x="49" width="131" height="30" as="geometry">
<mxRectangle width="131" height="30" as="alternateBounds" />
</mxGeometry>
</mxCell>
<mxCell id="XC6CGuYQlSzaP45YXhiZ-18" value="" style="shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;fillColor=none;collapsible=0;dropTarget=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;top=0;left=0;right=0;bottom=0;" parent="XC6CGuYQlSzaP45YXhiZ-14" vertex="1">
<mxGeometry y="60" width="180" height="30" as="geometry" />
</mxCell>
<mxCell id="XC6CGuYQlSzaP45YXhiZ-19" value="String" style="shape=partialRectangle;connectable=0;fillColor=none;top=0;left=0;bottom=0;right=0;editable=1;overflow=hidden;" parent="XC6CGuYQlSzaP45YXhiZ-18" vertex="1">
<mxGeometry width="49" height="30" as="geometry">
<mxRectangle width="49" height="30" as="alternateBounds" />
</mxGeometry>
</mxCell>
<mxCell id="XC6CGuYQlSzaP45YXhiZ-20" value="token" style="shape=partialRectangle;connectable=0;fillColor=none;top=0;left=0;bottom=0;right=0;align=left;spacingLeft=6;overflow=hidden;" parent="XC6CGuYQlSzaP45YXhiZ-18" vertex="1">
<mxGeometry x="49" width="131" height="30" as="geometry">
<mxRectangle width="131" height="30" as="alternateBounds" />
</mxGeometry>
</mxCell>
<mxCell id="XC6CGuYQlSzaP45YXhiZ-21" value="" style="shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;fillColor=none;collapsible=0;dropTarget=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;top=0;left=0;right=0;bottom=0;" parent="XC6CGuYQlSzaP45YXhiZ-14" vertex="1">
<mxGeometry y="90" width="180" height="30" as="geometry" />
</mxCell>
<mxCell id="XC6CGuYQlSzaP45YXhiZ-22" value="String" style="shape=partialRectangle;connectable=0;fillColor=none;top=0;left=0;bottom=0;right=0;editable=1;overflow=hidden;" parent="XC6CGuYQlSzaP45YXhiZ-21" vertex="1">
<mxGeometry width="49" height="30" as="geometry">
<mxRectangle width="49" height="30" as="alternateBounds" />
</mxGeometry>
</mxCell>
<mxCell id="XC6CGuYQlSzaP45YXhiZ-23" value="tokenType" style="shape=partialRectangle;connectable=0;fillColor=none;top=0;left=0;bottom=0;right=0;align=left;spacingLeft=6;overflow=hidden;" parent="XC6CGuYQlSzaP45YXhiZ-21" vertex="1">
<mxGeometry x="49" width="131" height="30" as="geometry">
<mxRectangle width="131" height="30" as="alternateBounds" />
</mxGeometry>
</mxCell>
<mxCell id="XC6CGuYQlSzaP45YXhiZ-28" value="" style="shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;fillColor=none;collapsible=0;dropTarget=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;top=0;left=0;right=0;bottom=0;" parent="XC6CGuYQlSzaP45YXhiZ-14" vertex="1">
<mxGeometry y="120" width="180" height="30" as="geometry" />
</mxCell>
<mxCell id="XC6CGuYQlSzaP45YXhiZ-29" value="boolean" style="shape=partialRectangle;connectable=0;fillColor=none;top=0;left=0;bottom=0;right=0;editable=1;overflow=hidden;" parent="XC6CGuYQlSzaP45YXhiZ-28" vertex="1">
<mxGeometry width="49" height="30" as="geometry">
<mxRectangle width="49" height="30" as="alternateBounds" />
</mxGeometry>
</mxCell>
<mxCell id="XC6CGuYQlSzaP45YXhiZ-30" value="expired" style="shape=partialRectangle;connectable=0;fillColor=none;top=0;left=0;bottom=0;right=0;align=left;spacingLeft=6;overflow=hidden;" parent="XC6CGuYQlSzaP45YXhiZ-28" vertex="1">
<mxGeometry x="49" width="131" height="30" as="geometry">
<mxRectangle width="131" height="30" as="alternateBounds" />
</mxGeometry>
</mxCell>
<mxCell id="XC6CGuYQlSzaP45YXhiZ-24" value="" style="shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;fillColor=none;collapsible=0;dropTarget=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;top=0;left=0;right=0;bottom=0;" parent="XC6CGuYQlSzaP45YXhiZ-14" vertex="1">
<mxGeometry y="150" width="180" height="30" as="geometry" />
</mxCell>
<mxCell id="XC6CGuYQlSzaP45YXhiZ-25" value="boolean" style="shape=partialRectangle;connectable=0;fillColor=none;top=0;left=0;bottom=0;right=0;editable=1;overflow=hidden;" parent="XC6CGuYQlSzaP45YXhiZ-24" vertex="1">
<mxGeometry width="49" height="30" as="geometry">
<mxRectangle width="49" height="30" as="alternateBounds" />
</mxGeometry>
</mxCell>
<mxCell id="XC6CGuYQlSzaP45YXhiZ-26" value="revoked" style="shape=partialRectangle;connectable=0;fillColor=none;top=0;left=0;bottom=0;right=0;align=left;spacingLeft=6;overflow=hidden;" parent="XC6CGuYQlSzaP45YXhiZ-24" vertex="1">
<mxGeometry x="49" width="131" height="30" as="geometry">
<mxRectangle width="131" height="30" as="alternateBounds" />
</mxGeometry>
</mxCell>
<mxCell id="XC6CGuYQlSzaP45YXhiZ-31" value="" style="edgeStyle=entityRelationEdgeStyle;fontSize=12;html=1;endArrow=ERoneToMany;rounded=0;strokeWidth=1;" parent="1" edge="1">
<mxGeometry width="100" height="100" relative="1" as="geometry">
<mxPoint x="524" y="343" as="sourcePoint" />
<mxPoint x="644" y="479" as="targetPoint" />
</mxGeometry>
</mxCell>
</root>
</mxGraphModel>
</diagram>
<diagram id="P7HX4lKzGpJc8V-NnKQx" name="roles and permissions">
<mxGraphModel dx="903" dy="446" grid="0" gridSize="10" guides="1" tooltips="1" connect="0" arrows="0" fold="1" page="1" pageScale="1" pageWidth="1100" pageHeight="850" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="Fkp4l_HLPrJYwHj4Cqq2-17" value="Roles and Permissions" style="rounded=0;whiteSpace=wrap;html=1;verticalAlign=top;fontSize=23;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="233" y="213" width="688" height="417" as="geometry" />
</mxCell>
<mxCell id="Fkp4l_HLPrJYwHj4Cqq2-18" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;curved=1;" edge="1" parent="1" source="LGTntW4OqFH9rOVflEHm-1" target="LGTntW4OqFH9rOVflEHm-2">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="Fkp4l_HLPrJYwHj4Cqq2-19" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;curved=1;" edge="1" parent="1" source="LGTntW4OqFH9rOVflEHm-1" target="Fkp4l_HLPrJYwHj4Cqq2-12">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="LGTntW4OqFH9rOVflEHm-1" value="User" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;" parent="1" vertex="1">
<mxGeometry x="332" y="396" width="30" height="60" as="geometry" />
</mxCell>
<mxCell id="Fkp4l_HLPrJYwHj4Cqq2-4" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="LGTntW4OqFH9rOVflEHm-2" target="LGTntW4OqFH9rOVflEHm-3">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="Fkp4l_HLPrJYwHj4Cqq2-5" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="LGTntW4OqFH9rOVflEHm-2" target="Fkp4l_HLPrJYwHj4Cqq2-1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="Fkp4l_HLPrJYwHj4Cqq2-6" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="LGTntW4OqFH9rOVflEHm-2" target="Fkp4l_HLPrJYwHj4Cqq2-2">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="Fkp4l_HLPrJYwHj4Cqq2-7" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="LGTntW4OqFH9rOVflEHm-2" target="Fkp4l_HLPrJYwHj4Cqq2-3">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="LGTntW4OqFH9rOVflEHm-2" value="ROLE_A" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="467" y="329" width="110" height="36" as="geometry" />
</mxCell>
<mxCell id="LGTntW4OqFH9rOVflEHm-3" value="RESOURCE:READ" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" vertex="1">
<mxGeometry x="640" y="272" width="128" height="27" as="geometry" />
</mxCell>
<mxCell id="Fkp4l_HLPrJYwHj4Cqq2-1" value="RESOURCE:WRITE" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="1">
<mxGeometry x="640" y="312" width="128" height="27" as="geometry" />
</mxCell>
<mxCell id="Fkp4l_HLPrJYwHj4Cqq2-2" value="RESOURCE:DELETE" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;" vertex="1" parent="1">
<mxGeometry x="640" y="352" width="128" height="27" as="geometry" />
</mxCell>
<mxCell id="Fkp4l_HLPrJYwHj4Cqq2-3" value="RESOURCE:UPDATE" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
<mxGeometry x="640" y="392" width="128" height="27" as="geometry" />
</mxCell>
<mxCell id="Fkp4l_HLPrJYwHj4Cqq2-8" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="Fkp4l_HLPrJYwHj4Cqq2-12" target="Fkp4l_HLPrJYwHj4Cqq2-13">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="Fkp4l_HLPrJYwHj4Cqq2-9" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="Fkp4l_HLPrJYwHj4Cqq2-12" target="Fkp4l_HLPrJYwHj4Cqq2-14">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="Fkp4l_HLPrJYwHj4Cqq2-10" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="Fkp4l_HLPrJYwHj4Cqq2-12" target="Fkp4l_HLPrJYwHj4Cqq2-15">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="Fkp4l_HLPrJYwHj4Cqq2-11" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="Fkp4l_HLPrJYwHj4Cqq2-12" target="Fkp4l_HLPrJYwHj4Cqq2-16">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="Fkp4l_HLPrJYwHj4Cqq2-12" value="ROLE_B" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="467" y="489" width="110" height="36" as="geometry" />
</mxCell>
<mxCell id="Fkp4l_HLPrJYwHj4Cqq2-13" value="RESOURCE:READ" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">
<mxGeometry x="640" y="432" width="128" height="27" as="geometry" />
</mxCell>
<mxCell id="Fkp4l_HLPrJYwHj4Cqq2-14" value="RESOURCE:WRITE" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="1">
<mxGeometry x="640" y="472" width="128" height="27" as="geometry" />
</mxCell>
<mxCell id="Fkp4l_HLPrJYwHj4Cqq2-15" value="RESOURCE:DELETE" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;" vertex="1" parent="1">
<mxGeometry x="640" y="512" width="128" height="27" as="geometry" />
</mxCell>
<mxCell id="Fkp4l_HLPrJYwHj4Cqq2-16" value="RESOURCE:UPDATE" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
<mxGeometry x="640" y="552" width="128" height="27" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Maven Start Up Batch script
#
# Required ENV vars:
# ------------------
# JAVA_HOME - location of a JDK home dir
#
# Optional ENV vars
# -----------------
# M2_HOME - location of maven2's installed home dir
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
# e.g. to debug Maven itself, use
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
# ----------------------------------------------------------------------------
if [ -z "$MAVEN_SKIP_RC" ] ; then
if [ -f /usr/local/etc/mavenrc ] ; then
. /usr/local/etc/mavenrc
fi
if [ -f /etc/mavenrc ] ; then
. /etc/mavenrc
fi
if [ -f "$HOME/.mavenrc" ] ; then
. "$HOME/.mavenrc"
fi
fi
# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
mingw=false
case "`uname`" in
CYGWIN*) cygwin=true ;;
MINGW*) mingw=true;;
Darwin*) darwin=true
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
if [ -z "$JAVA_HOME" ]; then
if [ -x "/usr/libexec/java_home" ]; then
export JAVA_HOME="`/usr/libexec/java_home`"
else
export JAVA_HOME="/Library/Java/Home"
fi
fi
;;
esac
if [ -z "$JAVA_HOME" ] ; then
if [ -r /etc/gentoo-release ] ; then
JAVA_HOME=`java-config --jre-home`
fi
fi
if [ -z "$M2_HOME" ] ; then
## resolve links - $0 may be a link to maven's home
PRG="$0"
# need this for relative symlinks
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG="`dirname "$PRG"`/$link"
fi
done
saveddir=`pwd`
M2_HOME=`dirname "$PRG"`/..
# make it fully qualified
M2_HOME=`cd "$M2_HOME" && pwd`
cd "$saveddir"
# echo Using m2 at $M2_HOME
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --unix "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi
# For Mingw, ensure paths are in UNIX format before anything is touched
if $mingw ; then
[ -n "$M2_HOME" ] &&
M2_HOME="`(cd "$M2_HOME"; pwd)`"
[ -n "$JAVA_HOME" ] &&
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
fi
if [ -z "$JAVA_HOME" ]; then
javaExecutable="`which javac`"
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
# readlink(1) is not available as standard on Solaris 10.
readLink=`which readlink`
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
if $darwin ; then
javaHome="`dirname \"$javaExecutable\"`"
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
else
javaExecutable="`readlink -f \"$javaExecutable\"`"
fi
javaHome="`dirname \"$javaExecutable\"`"
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
JAVA_HOME="$javaHome"
export JAVA_HOME
fi
fi
fi
if [ -z "$JAVACMD" ] ; then
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
else
JAVACMD="`\\unset -f command; \\command -v java`"
fi
fi
if [ ! -x "$JAVACMD" ] ; then
echo "Error: JAVA_HOME is not defined correctly." >&2
echo " We cannot execute $JAVACMD" >&2
exit 1
fi
if [ -z "$JAVA_HOME" ] ; then
echo "Warning: JAVA_HOME environment variable is not set."
fi
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
# traverses directory structure from process work directory to filesystem root
# first directory with .mvn subdirectory is considered project base directory
find_maven_basedir() {
if [ -z "$1" ]
then
echo "Path not specified to find_maven_basedir"
return 1
fi
basedir="$1"
wdir="$1"
while [ "$wdir" != '/' ] ; do
if [ -d "$wdir"/.mvn ] ; then
basedir=$wdir
break
fi
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
if [ -d "${wdir}" ]; then
wdir=`cd "$wdir/.."; pwd`
fi
# end of workaround
done
echo "${basedir}"
}
# concatenates all lines of a file
concat_lines() {
if [ -f "$1" ]; then
echo "$(tr -s '\n' ' ' < "$1")"
fi
}
BASE_DIR=`find_maven_basedir "$(pwd)"`
if [ -z "$BASE_DIR" ]; then
exit 1;
fi
##########################################################################################
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
# This allows using the maven wrapper in projects that prohibit checking in binary data.
##########################################################################################
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found .mvn/wrapper/maven-wrapper.jar"
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
fi
if [ -n "$MVNW_REPOURL" ]; then
jarUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
else
jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
fi
while IFS="=" read key value; do
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
esac
done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
if [ "$MVNW_VERBOSE" = true ]; then
echo "Downloading from: $jarUrl"
fi
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
if $cygwin; then
wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
fi
if command -v wget > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found wget ... using wget"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
wget "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
else
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
fi
elif command -v curl > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found curl ... using curl"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
curl -o "$wrapperJarPath" "$jarUrl" -f
else
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Falling back to using Java to download"
fi
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
# For Cygwin, switch paths to Windows format before running javac
if $cygwin; then
javaClass=`cygpath --path --windows "$javaClass"`
fi
if [ -e "$javaClass" ]; then
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Compiling MavenWrapperDownloader.java ..."
fi
# Compiling the Java class
("$JAVA_HOME/bin/javac" "$javaClass")
fi
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
# Running the downloader
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Running MavenWrapperDownloader.java ..."
fi
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
fi
fi
fi
fi
##########################################################################################
# End of extension
##########################################################################################
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
if [ "$MVNW_VERBOSE" = true ]; then
echo $MAVEN_PROJECTBASEDIR
fi
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --path --windows "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
fi
# Provide a "standardized" way to retrieve the CLI args that will
# work with both Windows and non-Windows executions.
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
export MAVEN_CMD_LINE_ARGS
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
exec "$JAVACMD" \
$MAVEN_OPTS \
$MAVEN_DEBUG_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
"-Dmaven.home=${M2_HOME}" \
"-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM https://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Maven Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM set title of command window
title %0
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %*
if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %*
:skipRcPre
@setlocal
set ERROR_CODE=0
@REM To isolate internal variables from possible post scripts, we use another setlocal
@setlocal
@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome
echo.
echo Error: JAVA_HOME not found in your environment. >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto init
echo.
echo Error: JAVA_HOME is set to an invalid directory. >&2
echo JAVA_HOME = "%JAVA_HOME%" >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
@REM ==== END VALIDATION ====
:init
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
set EXEC_DIR=%CD%
set WDIR=%EXEC_DIR%
:findBaseDir
IF EXIST "%WDIR%"\.mvn goto baseDirFound
cd ..
IF "%WDIR%"=="%CD%" goto baseDirNotFound
set WDIR=%CD%
goto findBaseDir
:baseDirFound
set MAVEN_PROJECTBASEDIR=%WDIR%
cd "%EXEC_DIR%"
goto endDetectBaseDir
:baseDirNotFound
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
cd "%EXEC_DIR%"
:endDetectBaseDir
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
:endReadAdditionalConfig
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
)
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
if exist %WRAPPER_JAR% (
if "%MVNW_VERBOSE%" == "true" (
echo Found %WRAPPER_JAR%
)
) else (
if not "%MVNW_REPOURL%" == "" (
SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
)
if "%MVNW_VERBOSE%" == "true" (
echo Couldn't find %WRAPPER_JAR%, downloading it ...
echo Downloading from: %DOWNLOAD_URL%
)
powershell -Command "&{"^
"$webclient = new-object System.Net.WebClient;"^
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
"}"^
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
"}"
if "%MVNW_VERBOSE%" == "true" (
echo Finished downloading %WRAPPER_JAR%
)
)
@REM End of extension
@REM Provide a "standardized" way to retrieve the CLI args that will
@REM work with both Windows and non-Windows executions.
set MAVEN_CMD_LINE_ARGS=%*
%MAVEN_JAVA_EXE% ^
%JVM_CONFIG_MAVEN_PROPS% ^
%MAVEN_OPTS% ^
%MAVEN_DEBUG_OPTS% ^
-classpath %WRAPPER_JAR% ^
"-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^
%WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end
:error
set ERROR_CODE=1
:end
@endlocal & set ERROR_CODE=%ERROR_CODE%
if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat"
if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd"
:skipRcPost
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%"=="on" pause
if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE%
cmd /C exit /B %ERROR_CODE%
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.0.5</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>userManagement</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>userManagement</name>
<description>role based authentication</description>
<properties>
<java.version>17</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-core</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
<version>2.2</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>io.jsonwebtoken</groupId>-->
<!-- <artifactId>jjwt</artifactId>-->
<!-- <version>0.9.1</version>-->
<!-- </dependency>-->
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-api</artifactId>
<version>0.11.5</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-impl</artifactId>
<version>0.11.5</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-jackson</artifactId>
<version>0.11.5</version>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>
package com.example.userManagement;
import com.example.userManagement.entity.RegisterRequest;
import com.example.userManagement.entity.Role;
import com.example.userManagement.services.AuthenticationService;
import com.example.userManagement.services.RoleService;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
@SpringBootApplication
public class UserManagementApplication {
public static void main(String[] args) {
SpringApplication.run(UserManagementApplication.class, args);
}
//
// @Bean
// public CommandLineRunner commandLineRunner(
// AuthenticationService service,
// RoleService roleService
// ) {
// return args -> {
//
// var Role1 = new Role("admin");
// var Role2 = new Role("admin");
// roleService.insertRole(Role1);
// roleService.insertRole(Role2);
// var admin = RegisterRequest.builder()
// .firstname("admin1")
// .lastname("admin1")
// .email("admin1@mail.com")
// .password("password")
// .role("admin")
// .build();
// System.out.println("Admin token: " + service.register(admin).getAccessToken());
//
// var manager = RegisterRequest.builder()
// .firstname("admin2")
// .lastname("admin2")
// .email("admin2@mail.com")
// .password("password")
// .role("admin")
// .build();
// System.out.println("Manager token: " + service.register(manager).getAccessToken());
//
// };
// }
}
package com.example.userManagement.configuration;
import com.example.userManagement.repository.UserRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
import org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
@Configuration
@RequiredArgsConstructor
public class ApplicationConfig {
@Autowired
private UserRepository repository;
@Bean
public UserDetailsService userDetailsService() throws UsernameNotFoundException{
return username -> repository.findByUsername(username);
}
@Bean
public AuthenticationProvider authenticationProvider() {
DaoAuthenticationProvider authProvider = new DaoAuthenticationProvider();
authProvider.setUserDetailsService(userDetailsService());
authProvider.setPasswordEncoder(passwordEncoder());
return authProvider;
}
@Bean
public AuthenticationManager authenticationManager(AuthenticationConfiguration config) throws Exception {
return config.getAuthenticationManager();
}
@Bean
public PasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
}
package com.example.userManagement.configuration;
import com.example.userManagement.repository.TokenRepository;
import com.example.userManagement.services.JwtService;
import jakarta.servlet.FilterChain;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
import lombok.RequiredArgsConstructor;
import org.springframework.lang.NonNull;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
import org.springframework.stereotype.Component;
import org.springframework.web.filter.OncePerRequestFilter;
@Component
@RequiredArgsConstructor
public class JwtAuthenticationFilter extends OncePerRequestFilter {
private final JwtService jwtService;
private final UserDetailsService userDetailsService;
private final TokenRepository tokenRepository;
@Override
protected void doFilterInternal(
@NonNull HttpServletRequest request,
@NonNull HttpServletResponse response,
@NonNull FilterChain filterChain
) throws ServletException, IOException {
if (request.getServletPath().contains("/api/v1/auth")) {
filterChain.doFilter(request, response);
return;
}
final String authHeader = request.getHeader("Authorization");
final String jwt;
final String username;
if (authHeader == null ||!authHeader.startsWith("Bearer ")) {
filterChain.doFilter(request, response);
return;
}
jwt = authHeader.substring(7);
username = jwtService.extractUsername(jwt);
if (username != null && SecurityContextHolder.getContext().getAuthentication() == null) {
UserDetails userDetails = this.userDetailsService.loadUserByUsername(username);
var isTokenValid = tokenRepository.findByToken(jwt)
.map(t -> !t.isExpired() && !t.isRevoked())
.orElse(false);
if (jwtService.isTokenValid(jwt, userDetails) && isTokenValid) {
UsernamePasswordAuthenticationToken authToken = new UsernamePasswordAuthenticationToken(
userDetails,
null,
userDetails.getAuthorities()
);
authToken.setDetails(
new WebAuthenticationDetailsSource().buildDetails(request)
);
SecurityContextHolder.getContext().setAuthentication(authToken);
}
}
filterChain.doFilter(request, response);
}
}
package com.example.userManagement.configuration;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.web.SecurityFilterChain;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.security.web.authentication.logout.LogoutHandler;
import static org.springframework.http.HttpMethod.DELETE;
import static org.springframework.http.HttpMethod.GET;
import static org.springframework.http.HttpMethod.POST;
import static org.springframework.http.HttpMethod.PUT;
@Configuration
@EnableWebSecurity
@RequiredArgsConstructor
@EnableMethodSecurity
public class SecurityConfiguration {
private final JwtAuthenticationFilter jwtAuthFilter;
private final AuthenticationProvider authenticationProvider;
private final LogoutHandler logoutHandler;
@Bean
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
http
.csrf()
.disable()
.authorizeHttpRequests()
.requestMatchers(
"/api/v1/auth/authenticate"
)
.permitAll()
//
// .requestMatchers("/api/v1/auth/**")
// .hasAnyRole(ADMIN.name(), MANAGER.name())
//
// .requestMatchers(GET, "/api/v1/management/**").hasAnyAuthority(ADMIN_READ.name(), MANAGER_READ.name())
// .requestMatchers(POST, "/api/v1/management/**").hasAnyAuthority(ADMIN_CREATE.name(), MANAGER_CREATE.name())
// .requestMatchers(PUT, "/api/v1/management/**").hasAnyAuthority(ADMIN_UPDATE.name(), MANAGER_UPDATE.name())
// .requestMatchers(DELETE, "/api/v1/management/**").hasAnyAuthority(ADMIN_DELETE.name(), MANAGER_DELETE.name())
/* .requestMatchers("/api/v1/admin/**").hasRole(ADMIN.name())
.requestMatchers(GET, "/api/v1/admin/**").hasAuthority(ADMIN_READ.name())
.requestMatchers(POST, "/api/v1/admin/**").hasAuthority(ADMIN_CREATE.name())
.requestMatchers(PUT, "/api/v1/admin/**").hasAuthority(ADMIN_UPDATE.name())
.requestMatchers(DELETE, "/api/v1/admin/**").hasAuthority(ADMIN_DELETE.name())*/
.anyRequest()
.authenticated()
.and()
.sessionManagement()
.sessionCreationPolicy(SessionCreationPolicy.STATELESS)
.and()
.authenticationProvider(authenticationProvider)
.addFilterBefore(jwtAuthFilter, UsernamePasswordAuthenticationFilter.class)
.logout()
.logoutUrl("/api/v1/auth/logout")
.addLogoutHandler(logoutHandler)
.logoutSuccessHandler((request, response, authentication) -> SecurityContextHolder.clearContext())
;
return http.build();
}
}
package com.example.userManagement.controller;
import com.example.userManagement.entity.AuthenticationRequest;
import com.example.userManagement.entity.AuthenticationResponse;
import com.example.userManagement.entity.RegisterRequest;
import com.example.userManagement.services.AuthenticationService;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.IOException;
@RestController
@RequestMapping("/api/v1/auth")
@RequiredArgsConstructor
public class AuthenticationController {
private final AuthenticationService service;
@PostMapping("/register")
public ResponseEntity<AuthenticationResponse> register(
@RequestBody RegisterRequest request
) {
return ResponseEntity.ok(service.register(request));
}
@PostMapping("/authenticate")
public ResponseEntity<AuthenticationResponse> authenticate(
@RequestBody AuthenticationRequest request
) {
return ResponseEntity.ok(service.authenticate(request));
}
// @PostMapping("/refresh-token")
// public void refreshToken(
// HttpServletRequest request,
// HttpServletResponse response
// ) throws IOException {
// service.refreshToken(request, response);
// }
}
package com.example.userManagement.controller;
import com.example.userManagement.entity.Role;
import com.example.userManagement.services.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
//@CrossOrigin(origins = {"http://localhost:5173"})
//@CrossOrigin(origins = {"*"})
@RequestMapping("/api/roles")
public class RoleController {
@Autowired
private RoleService roleService;
@GetMapping("/")
Iterable<Role> findAll(){
return roleService.getRoles();
}
@PostMapping("/insertRole")
public Role insertRole(@RequestBody final Role role){
return roleService.insertRole(role);
}
@PutMapping("/updateRole/{id}")
public Role updateRole(@RequestBody final Role role,@PathVariable int id){
return roleService.updateRole(role,id);
}
@DeleteMapping("/{id}")
public boolean deleteRole(@PathVariable int id) {
return roleService.deleteRole(id);
}
}
package com.example.userManagement.controller;
import com.example.userManagement.entity.User;
import com.example.userManagement.services.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
//@CrossOrigin(origins = {"*"})
@RequestMapping("/api/users")
public class UserController {
private final UserService userService;
@Autowired
public UserController(UserService userService) {
this.userService = userService;
}
@GetMapping("/")
public Iterable<User> findAll() {
return userService.getUsers();
}
@GetMapping("/Users/{id}")
public User findById(@PathVariable int id) {
return userService.getUserById(id);
}
@PostMapping("/insertUser")
public User insertUser(@RequestBody final User user) {
return userService.insertUser(user);
}
@PutMapping("/updateUser/{id}")
public User updateUser(@RequestBody User user, @PathVariable int id) {
return userService.updateUser(user, id);
}
@DeleteMapping("/{id}")
public boolean deleteUser(@PathVariable int id) {
return userService.deleteUser(id);
}
}
package com.example.userManagement.entity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class AuthenticationRequest {
private String username;
private String password;
}
package com.example.userManagement.entity;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class AuthenticationResponse {
@JsonProperty("access_token")
private String accessToken;
@JsonProperty("refresh_token")
private String refreshToken;
}
package com.example.userManagement.entity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class RegisterRequest {
private String firstname;
private String lastname;
private String email;
private String password;
private String role;
}
package com.example.userManagement.entity;
import com.example.userManagement.util.Indices;
import lombok.*;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.data.elasticsearch.annotations.Setting;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Data
@Document(indexName = Indices.ROLE_INDEX)
@Setting(settingPath = "static/es-settings.json")
public class Role {
public Role(String role) {
this.role = role;
}
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Field(type = FieldType.Text)
private String id;
@Field(type = FieldType.Text)
private String role;
}
package com.example.userManagement.entity;
import com.example.userManagement.util.Indices;
import com.example.userManagement.util.TokenType;
import lombok.*;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.data.elasticsearch.annotations.Setting;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
@Data
@Builder
@Getter
@NoArgsConstructor
@AllArgsConstructor
@Document(indexName = Indices.TOKEN_INDEX)
@Setting(settingPath = "static/es-settings.json")
public class Token {
@Id
@GeneratedValue
@Field(type = FieldType.Text)
public String id;
@Field(type = FieldType.Keyword)
public String token;
@Enumerated(EnumType.STRING)
public TokenType tokenType = TokenType.BEARER;
@Field(type = FieldType.Boolean)
public boolean revoked;
@Field(type = FieldType.Boolean)
public boolean expired;
@Field(type = FieldType.Text)
public String user;
}
package com.example.userManagement.entity;
import com.example.userManagement.util.Indices;
import lombok.*;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.data.elasticsearch.annotations.Setting;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import java.util.Collection;
import java.util.List;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Entity
@Data
@Document(indexName = Indices.USER_INDEX)
@Setting(settingPath = "static/es-settings.json")
public class User implements UserDetails {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Field(type = FieldType.Keyword)
private String id;
@Field(type = FieldType.Text)
private String username;
// @Field(type = FieldType.Text)
// private String firstname;
// @Field(type = FieldType.Text)
// private String lastname;
@Field(type = FieldType.Text)
private String email;
@Field(type = FieldType.Text)
private String password;
@Field(type = FieldType.Text)
private String role;
@Field(type = FieldType.Keyword)
private boolean enabled;
@Override
public Collection<? extends GrantedAuthority> getAuthorities() {
return List.of(new SimpleGrantedAuthority(role));
}
@Override
public boolean isAccountNonExpired() {
return true;
}
@Override
public boolean isAccountNonLocked() {
return true;
}
@Override
public boolean isCredentialsNonExpired() {
return true;
}
}
package com.example.userManagement.repository;
import com.example.userManagement.entity.Role;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface RoleRepository extends ElasticsearchRepository<Role,Integer> {
}
package com.example.userManagement.repository;
import java.util.List;
import java.util.Optional;
import com.example.userManagement.entity.Token;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
public interface TokenRepository extends ElasticsearchRepository<Token, Integer> {
List<Token> findAllValidTokenByUser(String id);
Token findByUser(String user);
Optional<Token> findByToken(String token);
}
package com.example.userManagement.repository;
import com.example.userManagement.entity.User;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface UserRepository extends ElasticsearchRepository<User,Integer> {
User findByUsername(String username);
}
\ No newline at end of file
package com.example.userManagement.services;
import com.example.userManagement.entity.*;
import com.example.userManagement.repository.TokenRepository;
import com.example.userManagement.repository.UserRepository;
import com.example.userManagement.util.TokenType;
import com.fasterxml.jackson.databind.ObjectMapper;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import org.apache.http.HttpHeaders;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
import java.io.IOException;
@Service
@RequiredArgsConstructor
public class AuthenticationService {
private final UserRepository repository;
private final TokenRepository tokenRepository;
private final PasswordEncoder passwordEncoder;
private final JwtService jwtService;
public AuthenticationResponse register(RegisterRequest request) {
var user = User.builder()
.username(request.getFirstname()+"."+request.getLastname())
.email(request.getEmail())
.password(passwordEncoder.encode(request.getPassword()))
.role(request.getRole()).build();
var savedUser = repository.save(user);
var jwtToken = jwtService.generateToken(user);
var refreshToken = jwtService.generateRefreshToken(user);
saveUserToken(savedUser, jwtToken);
return AuthenticationResponse.builder()
.accessToken(jwtToken)
.refreshToken(refreshToken)
.build();
}
public AuthenticationResponse authenticate(AuthenticationRequest request){
var user = repository.findByUsername(request.getUsername());
if (passwordEncoder.matches(request.getPassword(),user.getPassword())){
var jwtToken = jwtService.generateToken(user);
var refreshToken = jwtService.generateRefreshToken(user);
revokeAllUserTokens(user);
saveUserToken(user, jwtToken);
return AuthenticationResponse.builder()
.accessToken(jwtToken)
.refreshToken(refreshToken)
.build();
}
return AuthenticationResponse.builder().build();
}
private void saveUserToken(User user, String jwtToken) {
var token = Token.builder()
.user(user.getUsername())
.token(jwtToken)
.tokenType(TokenType.BEARER)
.expired(false)
.revoked(false)
.build();
tokenRepository.save(token);
}
private void revokeAllUserTokens(User user) {
var validUserTokens = tokenRepository.findAllValidTokenByUser(user.getId());
if (validUserTokens.isEmpty())
return;
validUserTokens.forEach(token -> {
token.setExpired(true);
token.setRevoked(true);
});
tokenRepository.saveAll(validUserTokens);
}
public void refreshToken(
HttpServletRequest request,
HttpServletResponse response
) throws IOException {
final String authHeader = request.getHeader(HttpHeaders.AUTHORIZATION);
final String refreshToken;
final String username;
if (authHeader == null ||!authHeader.startsWith("Bearer ")) {
return;
}
refreshToken = authHeader.substring(7);
username = jwtService.extractUsername(refreshToken);
if (username != null) {
var user = this.repository.findByUsername(username);
if (jwtService.isTokenValid(refreshToken, user)) {
var accessToken = jwtService.generateToken(user);
revokeAllUserTokens(user);
saveUserToken(user, accessToken);
var authResponse = AuthenticationResponse.builder()
.accessToken(accessToken)
.refreshToken(refreshToken)
.build();
new ObjectMapper().writeValue(response.getOutputStream(), authResponse);
}
}
}
}
package com.example.userManagement.services;
import java.security.Key;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Function;
import com.example.userManagement.entity.Token;
import com.example.userManagement.repository.TokenRepository;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;
import io.jsonwebtoken.io.Decoders;
import io.jsonwebtoken.security.Keys;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.elasticsearch.core.ElasticsearchOperations;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.stereotype.Service;
@Service
public class JwtService {
@Value("${application.security.jwt.secret-key}")
private String secretKey;
@Value("${application.security.jwt.expiration}")
private long jwtExpiration;
@Value("${application.security.jwt.refresh-token.expiration}")
private long refreshExpiration;
@Autowired
private TokenRepository tokenRepository;
public String extractUsername(String token) {
try {
return extractClaim(token, Claims::getSubject);
}catch (Exception e){
System.out.println("Token is not valid");
return "Token is not valid";
}
}
public <T> T extractClaim(String token, Function<Claims, T> claimsResolver) {
try {
final Claims claims = extractAllClaims(token);
return claimsResolver.apply(claims);
}catch (Exception e){
System.out.println("Token is not valid");
return null;
}
}
public String generateToken(UserDetails userDetails) {
Token token=tokenRepository.findByUser(userDetails.getUsername());
if(token!=null){
tokenRepository.delete(token);
}
return generateToken(new HashMap<>(), userDetails);
}
public String generateToken(
Map<String, Object> extraClaims,
UserDetails userDetails
) {
return buildToken(extraClaims, userDetails, jwtExpiration);
}
public String generateRefreshToken(
UserDetails userDetails
) {
return buildToken(new HashMap<>(), userDetails, refreshExpiration);
}
private String buildToken(
Map<String, Object> extraClaims,
UserDetails userDetails,
long expiration
) {
return Jwts
.builder()
.setClaims(extraClaims)
.setSubject(userDetails.getUsername())
.setIssuedAt(new Date(System.currentTimeMillis()))
.setExpiration(new Date(System.currentTimeMillis() + expiration))
.signWith(SignatureAlgorithm.HS256, getSignInKey())
.compact();
}
public boolean isTokenValid(String token, UserDetails userDetails) {
try {
final String username = extractUsername(token);
return (username.equals(userDetails.getUsername())) && !isTokenExpired(token);
}catch (Exception e){
System.out.println("Token is not valid");
return false;
}
}
private boolean isTokenExpired(String token) {
return extractExpiration(token).before(new Date());
}
private Date extractExpiration(String token) {
try {
return extractClaim(token, Claims::getExpiration);
} catch (Exception e) {
System.out.println("Token is not valid");
return null;
}
}
private Claims extractAllClaims(String token) {
return Jwts.parser()
.setSigningKey(getSignInKey())
.parseClaimsJws(token)
.getBody();
}
private Key getSignInKey() {
byte[] keyBytes = Decoders.BASE64.decode(secretKey);
return Keys.hmacShaKeyFor(keyBytes);
}
}
package com.example.userManagement.services;
import com.example.userManagement.repository.TokenRepository;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.web.authentication.logout.LogoutHandler;
import org.springframework.stereotype.Service;
@Service
@RequiredArgsConstructor
public class LogoutService implements LogoutHandler {
private final TokenRepository tokenRepository;
@Override
public void logout(
HttpServletRequest request,
HttpServletResponse response,
Authentication authentication
) {
final String authHeader = request.getHeader("Authorization");
final String jwt;
if (authHeader == null ||!authHeader.startsWith("Bearer ")) {
return;
}
jwt = authHeader.substring(7);
var storedToken = tokenRepository.findByToken(jwt)
.orElse(null);
if (storedToken != null) {
storedToken.setExpired(true);
storedToken.setRevoked(true);
tokenRepository.save(storedToken);
SecurityContextHolder.clearContext();
}
}
}
package com.example.userManagement.services;
import com.example.userManagement.entity.Role;
import com.example.userManagement.repository.RoleRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class RoleService {
@Autowired
private RoleRepository roleRepository;
private final Logger log = LoggerFactory.getLogger(RoleService.class);
public Iterable<Role> getRoles() {
try{
return roleRepository.findAll();
} catch (Exception e) {
log.error("Error getting data from Elastic", e);
return null;
}
}
public Role getRoleById(int id){
try {
return roleRepository.findById(id).orElse(null);
} catch (Exception e) {
log.error("Error getting data from Elastic", e);
return null;
}
}
public Role insertRole(Role role) {
try {
roleRepository.save(role);
log.info("Data saved successfully in Elastic");
return role;
}
catch (Exception e) {
log.error("Error saving data in Elastic", e);
}
return null;
}
public Role updateRole(Role role, int id) {
Role role1 = roleRepository.findById(id).get();
role1.setRole(role.getRole());
return role1;
}
public boolean deleteRole(int id ) {
try {
roleRepository.deleteById(id);
log.info("Role deleted successfully in Elastic");
return true;
}
catch (Exception e) {
log.error("Error deleting role in Elastic", e);
}
return false;
}
}
package com.example.userManagement.services;
import com.example.userManagement.entity.User;
import com.example.userManagement.repository.UserRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class UserService {
@Autowired
private UserRepository userRepository;
@Autowired
private RoleService roleService;
private final Logger log = LoggerFactory.getLogger(UserService.class);
// @Autowired
// private PasswordEncoder passwordEncoder;
// public void initUser() {
//
// User adminUser = new User();
// adminUser.setUsername("reem1");
// adminUser.setRole("admin");
// adminUser.setEmail("reem1@123.com");
// adminUser.setEnabled(true);
// adminUser.setPassword(passwordEncoder.encode("admin@pass"));
// userRepository.save(adminUser);
//
// }
public Iterable<User> getUsers() {
try{
return userRepository.findAll();
} catch (Exception e) {
log.error("Error getting data from Elastic", e);
return null;
}
}
public User getUserById(int id){
try{
return userRepository.findById(id).orElse(null);
} catch (Exception e) {
log.error("Error getting data from Elastic", e);
return null;
}
}
public User insertUser(final User user) {
try {
userRepository.save(user);
log.info("Data saved successfully in Elastic");
return user;
} catch (Exception e) {
log.error("Error saving data in Elastic", e);
}
return null;
}
public User updateUser(User user, int id) {
try {
User user1 = userRepository.findById(id).get();
user1.setUsername(user.getUsername());
user1.setEmail(user.getEmail());
user1.setPassword(
// passwordEncode.encode(
user.getPassword()
// )
);
user1.setRole(user.getRole());
log.info("Data Updated successfully in Elastic");
return user1;
} catch (Exception e) {
log.error("Error Updating data in Elastic", e);
}
return null;
}
public boolean deleteUser(int id) {
try {
userRepository.deleteById(id);
log.info("User deleted successfully in Elastic");
return true;
}
catch (Exception e) {
log.error("Error deleting data in Elastic", e);
}
return false;
}
}
package com.example.userManagement.util;
public final class Indices {
public static final String USER_INDEX = "users";
public static final String ROLE_INDEX = "roles";
public static final String TOKEN_INDEX = "tokens";
}
\ No newline at end of file
package com.example.userManagement.util;
public enum TokenType {
BEARER
}
server.port = 2007
spring.data.elasticsearch.cluster-names=trapsService
spring.data.elasticsearch.cluster-node=localhost:9200
#for generate secret-key https://www.allkeysgenerator.com/
application.security.jwt.secret-key: 452948404D6351665468576D5A7134743777217A25432A462D4A614E64526755
application.security.jwt.expiration: 86400000
application.security.jwt.refresh-token.expiration: 604800000
\ No newline at end of file
{
"id": {
"type": "keyword"
},
"username": {
"type": "text"
},
"email": {
"type": "text"
},
"password": {
"type": "text"
},
"role": {
"type": "text"
}
}
\ No newline at end of file
package com.example.userManagement;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class UserManagementApplicationTests {
@Test
void contextLoads() {
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment