mirror of
https://github.com/sasjs/server.git
synced 2026-01-03 13:10:04 +00:00
Compare commits
10 Commits
v0.36.0
...
ebaffc62a6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ebaffc62a6 | ||
|
|
ea2ec97c1c | ||
|
|
832f1156e8 | ||
|
|
5cda9cd5d8 | ||
|
|
5d576aff91 | ||
|
|
a044176054 | ||
|
|
deee34f5fd | ||
|
|
b0723f1444 | ||
|
|
e9519cb3c6 | ||
|
|
b03a5db22f |
14
CHANGELOG.md
14
CHANGELOG.md
@@ -1,3 +1,17 @@
|
|||||||
|
# [0.38.0](https://github.com/sasjs/server/compare/v0.37.0...v0.38.0) (2024-10-30)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **api:** enabled query params in stp/trigger endpoint ([5cda9cd](https://github.com/sasjs/server/commit/5cda9cd5d8623b7ea2ecd989d7808f47ec866672))
|
||||||
|
|
||||||
|
# [0.37.0](https://github.com/sasjs/server/compare/v0.36.0...v0.37.0) (2024-10-29)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **stp:** added trigger endpoint ([b0723f1](https://github.com/sasjs/server/commit/b0723f14448d60ffce4f2175cf8a73fc4d4dd0ee))
|
||||||
|
|
||||||
# [0.36.0](https://github.com/sasjs/server/compare/v0.35.4...v0.36.0) (2024-10-29)
|
# [0.36.0](https://github.com/sasjs/server/compare/v0.35.4...v0.36.0) (2024-10-29)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,84 +1,206 @@
|
|||||||
<mxfile host="65bd71144e">
|
<mxfile host="65bd71144e">
|
||||||
<diagram id="HJy_QFGaI9JSrArARLup" name="Page-1">
|
<diagram id="HJy_QFGaI9JSrArARLup" name="Page-1">
|
||||||
<mxGraphModel dx="1908" dy="2140" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
|
<mxGraphModel dx="3103" dy="2723" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
|
||||||
<root>
|
<root>
|
||||||
<mxCell id="0"/>
|
<mxCell id="0"/>
|
||||||
<mxCell id="1" parent="0"/>
|
<mxCell id="1" parent="0"/>
|
||||||
<mxCell id="4" value="End user" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;fontStyle=0" vertex="1" parent="1">
|
<mxCell id="7" value="SASjs Server" style="whiteSpace=wrap;html=1;verticalAlign=top;fontStyle=0;fontSize=30;" parent="1" vertex="1">
|
||||||
<mxGeometry x="-360" y="-120" width="40" height="80" as="geometry"/>
|
<mxGeometry x="30" y="-150" width="360" height="1250" as="geometry"/>
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="7" value="SASjs Server" style="whiteSpace=wrap;html=1;verticalAlign=top;fontStyle=0;fontSize=30;" vertex="1" parent="1">
|
<mxCell id="36" value="<font style="font-size: 22px">Internal Authentication</font>" style="whiteSpace=wrap;html=1;verticalAlign=top;fontStyle=0;" vertex="1" parent="1">
|
||||||
<mxGeometry x="30" y="-150" width="360" height="850" as="geometry"/>
|
<mxGeometry x="50" y="-60" width="320" height="330" as="geometry"/>
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="8" value="" style="edgeStyle=none;html=1;entryX=0;entryY=0.25;entryDx=0;entryDy=0;" edge="1" parent="1" target="28">
|
<mxCell id="4" value="End user" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;fontStyle=0" parent="1" vertex="1">
|
||||||
|
<mxGeometry x="-740" y="-120" width="40" height="80" as="geometry"/>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="8" value="" style="edgeStyle=none;html=1;entryX=0;entryY=0.25;entryDx=0;entryDy=0;" parent="1" target="28" edge="1">
|
||||||
<mxGeometry relative="1" as="geometry">
|
<mxGeometry relative="1" as="geometry">
|
||||||
<mxPoint x="-340" y="23" as="sourcePoint"/>
|
<mxPoint x="-530" y="23" as="sourcePoint"/>
|
||||||
<mxPoint x="115" y="22.586363636363558" as="targetPoint"/>
|
<mxPoint x="115" y="22.586363636363558" as="targetPoint"/>
|
||||||
</mxGeometry>
|
</mxGeometry>
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="11" value="<div style="font-family: &#34;menlo&#34; , &#34;monaco&#34; , &#34;courier new&#34; , monospace ; font-size: 12px ; line-height: 18px"><span style="color: #a31515">/SASjsApi/auth/authorize<br>(username,password,clientId)</span></div>" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="8">
|
<mxCell id="11" value="<div style="font-family: &#34;menlo&#34; , &#34;monaco&#34; , &#34;courier new&#34; , monospace ; font-size: 12px ; line-height: 18px"><span style="color: #a31515">/SASjsApi/auth/authorize<br>(username,password,clientId)</span></div>" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="8" vertex="1" connectable="0">
|
||||||
<mxGeometry x="-0.1257" y="2" relative="1" as="geometry">
|
<mxGeometry x="-0.1257" y="2" relative="1" as="geometry">
|
||||||
<mxPoint as="offset"/>
|
<mxPoint as="offset"/>
|
||||||
</mxGeometry>
|
</mxGeometry>
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="14" value="" style="edgeStyle=none;html=1;exitX=-0.002;exitY=0.874;exitDx=0;exitDy=0;exitPerimeter=0;" edge="1" parent="1" source="28">
|
<mxCell id="14" value="" style="edgeStyle=none;html=1;exitX=-0.002;exitY=0.874;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="28" edge="1">
|
||||||
<mxGeometry relative="1" as="geometry">
|
<mxGeometry relative="1" as="geometry">
|
||||||
<mxPoint x="110" y="80" as="sourcePoint"/>
|
<mxPoint x="110" y="80" as="sourcePoint"/>
|
||||||
<mxPoint x="-340" y="80" as="targetPoint"/>
|
<mxPoint x="-530" y="80" as="targetPoint"/>
|
||||||
</mxGeometry>
|
</mxGeometry>
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="16" value="<font color="#a31515" face="menlo, monaco, courier new, monospace"><span style="font-size: 12px">`code`</span></font>" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="14">
|
<mxCell id="16" value="<font color="#a31515" face="menlo, monaco, courier new, monospace"><span style="font-size: 12px">`code`</span></font>" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="14" vertex="1" connectable="0">
|
||||||
<mxGeometry x="0.1931" y="-1" relative="1" as="geometry">
|
<mxGeometry x="0.1931" y="-1" relative="1" as="geometry">
|
||||||
<mxPoint as="offset"/>
|
<mxPoint as="offset"/>
|
||||||
</mxGeometry>
|
</mxGeometry>
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="21" value="End user" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;fontStyle=0" vertex="1" parent="1">
|
<mxCell id="21" value="End user" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;fontStyle=0" parent="1" vertex="1">
|
||||||
<mxGeometry x="-360" y="545" width="40" height="80" as="geometry"/>
|
<mxGeometry x="-730" y="1100" width="40" height="80" as="geometry"/>
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="22" value="" style="edgeStyle=none;html=1;entryX=0;entryY=0.25;entryDx=0;entryDy=0;" edge="1" parent="1" target="30">
|
<mxCell id="22" value="" style="edgeStyle=none;html=1;entryX=0;entryY=0.25;entryDx=0;entryDy=0;" parent="1" target="30" edge="1">
|
||||||
<mxGeometry relative="1" as="geometry">
|
<mxGeometry relative="1" as="geometry">
|
||||||
<mxPoint x="-340" y="165" as="sourcePoint"/>
|
<mxPoint x="-530" y="163" as="sourcePoint"/>
|
||||||
<mxPoint x="115" y="165" as="targetPoint"/>
|
<mxPoint x="115" y="165" as="targetPoint"/>
|
||||||
</mxGeometry>
|
</mxGeometry>
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="23" value="<div style="font-family: &#34;menlo&#34; , &#34;monaco&#34; , &#34;courier new&#34; , monospace ; font-size: 12px ; line-height: 18px"><div style="font-family: &#34;menlo&#34; , &#34;monaco&#34; , &#34;courier new&#34; , monospace ; line-height: 18px"><span style="color: #a31515">/SASjsApi/auth/token</span></div><span style="color: #a31515">(clientId,code)</span></div>" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="22">
|
<mxCell id="23" value="<div style="font-family: &#34;menlo&#34; , &#34;monaco&#34; , &#34;courier new&#34; , monospace ; font-size: 12px ; line-height: 18px"><div style="font-family: &#34;menlo&#34; , &#34;monaco&#34; , &#34;courier new&#34; , monospace ; line-height: 18px"><span style="color: #a31515">/SASjsApi/auth/token</span></div><span style="color: #a31515">(clientId,code)</span></div>" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="22" vertex="1" connectable="0">
|
||||||
<mxGeometry x="-0.1257" y="2" relative="1" as="geometry">
|
<mxGeometry x="-0.1257" y="2" relative="1" as="geometry">
|
||||||
<mxPoint as="offset"/>
|
<mxPoint as="offset"/>
|
||||||
</mxGeometry>
|
</mxGeometry>
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="24" value="" style="edgeStyle=none;html=1;exitX=0.009;exitY=0.905;exitDx=0;exitDy=0;exitPerimeter=0;" edge="1" parent="1" source="30">
|
<mxCell id="24" value="" style="edgeStyle=none;html=1;exitX=0.009;exitY=0.905;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="30" edge="1">
|
||||||
<mxGeometry relative="1" as="geometry">
|
<mxGeometry relative="1" as="geometry">
|
||||||
<mxPoint x="210" y="222.5" as="sourcePoint"/>
|
<mxPoint x="210" y="222.5" as="sourcePoint"/>
|
||||||
<mxPoint x="-340" y="223" as="targetPoint"/>
|
<mxPoint x="-530" y="223" as="targetPoint"/>
|
||||||
</mxGeometry>
|
</mxGeometry>
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="25" value="<font color="#a31515" face="menlo, monaco, courier new, monospace"><span style="font-size: 12px">`</span></font><span style="color: rgb(163 , 21 , 21) ; font-family: &#34;menlo&#34; , &#34;monaco&#34; , &#34;courier new&#34; , monospace ; font-size: 12px">accessToken</span><span style="font-size: 12px ; color: rgb(163 , 21 , 21) ; font-family: &#34;menlo&#34; , &#34;monaco&#34; , &#34;courier new&#34; , monospace">` &amp; `</span><span style="color: rgb(163 , 21 , 21) ; font-family: &#34;menlo&#34; , &#34;monaco&#34; , &#34;courier new&#34; , monospace ; font-size: 12px">refreshToken</span><span style="color: rgb(163 , 21 , 21) ; font-family: &#34;menlo&#34; , &#34;monaco&#34; , &#34;courier new&#34; , monospace ; font-size: 12px">`</span>" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="24">
|
<mxCell id="25" value="<font color="#a31515" face="menlo, monaco, courier new, monospace"><span style="font-size: 12px">`</span></font><span style="color: rgb(163 , 21 , 21) ; font-family: &#34;menlo&#34; , &#34;monaco&#34; , &#34;courier new&#34; , monospace ; font-size: 12px">accessToken</span><span style="font-size: 12px ; color: rgb(163 , 21 , 21) ; font-family: &#34;menlo&#34; , &#34;monaco&#34; , &#34;courier new&#34; , monospace">` &amp; `</span><span style="color: rgb(163 , 21 , 21) ; font-family: &#34;menlo&#34; , &#34;monaco&#34; , &#34;courier new&#34; , monospace ; font-size: 12px">refreshToken</span><span style="color: rgb(163 , 21 , 21) ; font-family: &#34;menlo&#34; , &#34;monaco&#34; , &#34;courier new&#34; , monospace ; font-size: 12px">`</span>" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="24" vertex="1" connectable="0">
|
||||||
<mxGeometry x="0.1931" y="-1" relative="1" as="geometry">
|
<mxGeometry x="0.1931" y="-1" relative="1" as="geometry">
|
||||||
<mxPoint as="offset"/>
|
<mxPoint as="offset"/>
|
||||||
</mxGeometry>
|
</mxGeometry>
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="26" value="" style="endArrow=none;dashed=1;html=1;dashPattern=1 3;strokeWidth=2;" edge="1" parent="1" source="21" target="4">
|
<mxCell id="26" value="" style="endArrow=none;dashed=1;html=1;dashPattern=1 3;strokeWidth=2;" parent="1" source="21" target="4" edge="1">
|
||||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||||
<mxPoint x="40" y="240" as="sourcePoint"/>
|
<mxPoint x="-340" y="240" as="sourcePoint"/>
|
||||||
<mxPoint x="90" y="190" as="targetPoint"/>
|
<mxPoint x="-290" y="190" as="targetPoint"/>
|
||||||
</mxGeometry>
|
</mxGeometry>
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="28" value="<span>Validates</span><br><span>username/password/clientId</span><br><span>and issue short</span><br><span>Authorization code</span>" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
<mxCell id="28" value="<span>Validates</span><br><span>username/password/clientId</span><br><span>and issue short</span><br><span>Authorization code</span>" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||||
<mxGeometry x="115" width="190" height="90" as="geometry"/>
|
<mxGeometry x="115" width="190" height="90" as="geometry"/>
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="30" value="Validates<br>clientId &amp; authorization code<br>and issue<br>Access Token &amp; Refresh Token" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
<mxCell id="30" value="Validates<br>clientId &amp; authorization code<br>and issue<br>Access Token &amp; Refresh Token" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||||
<mxGeometry x="115" y="140" width="190" height="90" as="geometry"/>
|
<mxGeometry x="115" y="140" width="190" height="90" as="geometry"/>
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="32" value="Protected APIs<br>Authenticate requests <br>with provided Bearer Token" style="whiteSpace=wrap;html=1;verticalAlign=top;fontStyle=0;" vertex="1" parent="1">
|
<mxCell id="32" value="Protected APIs<br>Authenticate requests <br>with provided Bearer Token" style="whiteSpace=wrap;html=1;verticalAlign=top;fontStyle=0;" parent="1" vertex="1">
|
||||||
<mxGeometry x="50" y="280" width="320" height="400" as="geometry"/>
|
<mxGeometry x="50" y="920" width="320" height="150" as="geometry"/>
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="33" value="" style="edgeStyle=none;html=1;entryX=0;entryY=0.373;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" target="32">
|
<mxCell id="33" value="" style="edgeStyle=none;html=1;entryX=-0.012;entryY=0.384;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" target="32" edge="1">
|
||||||
<mxGeometry relative="1" as="geometry">
|
<mxGeometry relative="1" as="geometry">
|
||||||
<mxPoint x="-340" y="432.5" as="sourcePoint"/>
|
<mxPoint x="-520" y="978" as="sourcePoint"/>
|
||||||
<mxPoint x="-10" y="430" as="targetPoint"/>
|
<mxPoint x="-80" y="819" as="targetPoint"/>
|
||||||
</mxGeometry>
|
</mxGeometry>
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="34" value="<div style="font-family: &#34;menlo&#34; , &#34;monaco&#34; , &#34;courier new&#34; , monospace ; font-size: 12px ; line-height: 18px"><div style="font-family: &#34;menlo&#34; , &#34;monaco&#34; , &#34;courier new&#34; , monospace ; line-height: 18px"><font color="#a31515">Request with Access Token</font></div></div>" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="33">
|
<mxCell id="34" value="<div style="font-family: &#34;menlo&#34; , &#34;monaco&#34; , &#34;courier new&#34; , monospace ; font-size: 12px ; line-height: 18px"><div style="font-family: &#34;menlo&#34; , &#34;monaco&#34; , &#34;courier new&#34; , monospace ; line-height: 18px"><font color="#a31515">Request with Access Token</font></div></div>" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="33" vertex="1" connectable="0">
|
||||||
|
<mxGeometry x="-0.1257" y="2" relative="1" as="geometry">
|
||||||
|
<mxPoint as="offset"/>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="37" value="Browser" style="rounded=0;whiteSpace=wrap;html=1;fontSize=22;" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="-590" y="-100" width="120" height="60" as="geometry"/>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="38" value="Browser" style="rounded=0;whiteSpace=wrap;html=1;fontSize=22;" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="-590" y="1110" width="120" height="60" as="geometry"/>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="39" value="" style="endArrow=none;dashed=1;html=1;fontSize=22;entryX=0.5;entryY=1;entryDx=0;entryDy=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" edge="1" parent="1" source="38" target="37">
|
||||||
|
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||||
|
<mxPoint x="-340" y="390" as="sourcePoint"/>
|
||||||
|
<mxPoint x="-290" y="340" as="targetPoint"/>
|
||||||
|
<Array as="points"/>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="40" value="<font style="font-size: 22px">Okta Authentication</font>" style="whiteSpace=wrap;html=1;verticalAlign=top;fontStyle=0;" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="50" y="300" width="320" height="560" as="geometry"/>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="41" value="" style="edgeStyle=none;html=1;entryX=-0.013;entryY=0.092;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" target="49">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<mxPoint x="-530" y="373" as="sourcePoint"/>
|
||||||
|
<mxPoint x="115" y="372.58636363636356" as="targetPoint"/>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="42" value="<div style="font-family: &#34;menlo&#34; , &#34;monaco&#34; , &#34;courier new&#34; , monospace ; font-size: 12px ; line-height: 18px"><span style="color: #a31515">/SASjsApi/auth/okta/authorize<br></span></div>" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="41">
|
||||||
|
<mxGeometry x="-0.1257" y="2" relative="1" as="geometry">
|
||||||
|
<mxPoint as="offset"/>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="49" value="redirects to okta server<br><br><br><br>OKTA OIDC middleware<br>https://github.com/okta/okta-oidc-middleware<br><br><br><br>OKTA nodeJS Express implementation<br>https://github.com/okta/samples-nodejs-express-4/tree/master/okta-hosted-login<br>" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="115" y="350" width="190" height="280" as="geometry"/>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="75" style="edgeStyle=none;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fontSize=14;" edge="1" parent="1" source="50" target="32">
|
||||||
|
<mxGeometry relative="1" as="geometry"/>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="50" value="Validates express session <br>through OKTA OIDC middleware" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="115" y="710" width="190" height="90" as="geometry"/>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="51" value="<span style="font-size: 22px">Okta Authorization Server<br></span>" style="whiteSpace=wrap;html=1;verticalAlign=top;fontStyle=0;" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="600" y="300" width="320" height="380" as="geometry"/>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="52" value="" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="665" y="350" width="190" height="280" as="geometry"/>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="53" value="" style="endArrow=classic;html=1;fontSize=22;exitX=1.002;exitY=0.123;exitDx=0;exitDy=0;exitPerimeter=0;" edge="1" parent="1" source="49">
|
||||||
|
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||||
|
<mxPoint x="400" y="480" as="sourcePoint"/>
|
||||||
|
<mxPoint x="660" y="384" as="targetPoint"/>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="54" value="<span style="color: rgb(163 , 21 , 21) ; font-family: &#34;menlo&#34; , &#34;monaco&#34; , &#34;courier new&#34; , monospace ; font-size: 12px">/authorize</span>" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=22;" vertex="1" connectable="0" parent="53">
|
||||||
|
<mxGeometry x="0.0222" y="1" relative="1" as="geometry">
|
||||||
|
<mxPoint as="offset"/>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="58" value="" style="endArrow=classic;html=1;fontSize=22;exitX=-0.016;exitY=0.291;exitDx=0;exitDy=0;exitPerimeter=0;" edge="1" parent="1" source="52">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<mxPoint x="-300" y="470" as="sourcePoint"/>
|
||||||
|
<mxPoint x="-530" y="431" as="targetPoint"/>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="61" value="302 redirect to authentication prompt&nbsp;" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=22;" vertex="1" connectable="0" parent="58">
|
||||||
|
<mxGeometry x="-0.659" y="3" relative="1" as="geometry">
|
||||||
|
<mxPoint x="-630" as="offset"/>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="62" value="" style="endArrow=classic;html=1;fontSize=22;" edge="1" parent="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<mxPoint x="-530" y="500" as="sourcePoint"/>
|
||||||
|
<mxPoint x="665" y="500.48" as="targetPoint"/>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="64" value="Authentication &amp; Consent" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=22;" vertex="1" connectable="0" parent="62">
|
||||||
|
<mxGeometry x="-0.4695" y="6" relative="1" as="geometry">
|
||||||
|
<mxPoint as="offset"/>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="65" value="" style="endArrow=classic;html=1;fontSize=22;exitX=0;exitY=0.679;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.995;entryY=0.679;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="52" target="49">
|
||||||
|
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||||
|
<mxPoint x="230" y="560" as="sourcePoint"/>
|
||||||
|
<mxPoint x="280" y="510" as="targetPoint"/>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="66" value="Authorization Code to redirect uri" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=14;" vertex="1" connectable="0" parent="65">
|
||||||
|
<mxGeometry x="0.0583" y="1" relative="1" as="geometry">
|
||||||
|
<mxPoint x="26" as="offset"/>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="67" value="" style="endArrow=classic;html=1;fontSize=22;exitX=0;exitY=0.679;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.995;entryY=0.679;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1">
|
||||||
|
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||||
|
<mxPoint x="304.0500000000002" y="569.9999999999999" as="sourcePoint"/>
|
||||||
|
<mxPoint x="665.0000000000005" y="569.9999999999999" as="targetPoint"/>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="68" value="<span style="color: rgb(163 , 21 , 21) ; font-family: &#34;menlo&#34; , &#34;monaco&#34; , &#34;courier new&#34; , monospace ; font-size: 12px">/token</span>" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=14;" vertex="1" connectable="0" parent="67">
|
||||||
|
<mxGeometry x="0.0583" y="1" relative="1" as="geometry">
|
||||||
|
<mxPoint x="-5" y="1" as="offset"/>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="69" value="" style="endArrow=classic;html=1;fontSize=22;exitX=0;exitY=0.679;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.995;entryY=0.679;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1">
|
||||||
|
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||||
|
<mxPoint x="665.9500000000005" y="599.9999999999999" as="sourcePoint"/>
|
||||||
|
<mxPoint x="305.00000000000017" y="599.9999999999999" as="targetPoint"/>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="70" value="Access Token" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=14;" vertex="1" connectable="0" parent="69">
|
||||||
|
<mxGeometry x="0.0583" y="1" relative="1" as="geometry">
|
||||||
|
<mxPoint x="26" as="offset"/>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="71" value="" style="edgeStyle=none;html=1;entryX=-0.012;entryY=0.384;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<mxPoint x="-530" y="760" as="sourcePoint"/>
|
||||||
|
<mxPoint x="115.00000000000031" y="759.9999999999999" as="targetPoint"/>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="72" value="<div style="font-family: &#34;menlo&#34; , &#34;monaco&#34; , &#34;courier new&#34; , monospace ; font-size: 12px ; line-height: 18px"><div style="font-family: &#34;menlo&#34; , &#34;monaco&#34; , &#34;courier new&#34; , monospace ; line-height: 18px"><font color="#a31515">Request with OKTA mechanism</font></div></div>" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="71">
|
||||||
<mxGeometry x="-0.1257" y="2" relative="1" as="geometry">
|
<mxGeometry x="-0.1257" y="2" relative="1" as="geometry">
|
||||||
<mxPoint as="offset"/>
|
<mxPoint as="offset"/>
|
||||||
</mxGeometry>
|
</mxGeometry>
|
||||||
|
|||||||
3
SASjsServer.svg
Normal file
3
SASjsServer.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 37 KiB |
@@ -593,6 +593,16 @@ components:
|
|||||||
example: /Public/somefolder/some.file
|
example: /Public/somefolder/some.file
|
||||||
type: object
|
type: object
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
|
TriggerProgramResponse:
|
||||||
|
properties:
|
||||||
|
sessionId:
|
||||||
|
type: string
|
||||||
|
description: "The SessionId is the name of the temporary folder used to store the outputs.\nFor SAS, this would be the SASWORK folder. Can be used to poll program status.\nThis session ID should be used to poll program status."
|
||||||
|
example: '{ sessionId: ''20241028074744-54132-1730101664824'' }'
|
||||||
|
required:
|
||||||
|
- sessionId
|
||||||
|
type: object
|
||||||
|
additionalProperties: false
|
||||||
LoginPayload:
|
LoginPayload:
|
||||||
properties:
|
properties:
|
||||||
username:
|
username:
|
||||||
@@ -1901,6 +1911,50 @@ paths:
|
|||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/ExecutePostRequestPayload'
|
$ref: '#/components/schemas/ExecutePostRequestPayload'
|
||||||
|
/SASjsApi/stp/trigger:
|
||||||
|
post:
|
||||||
|
operationId: TriggerProgram
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: Ok
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/TriggerProgramResponse'
|
||||||
|
description: 'Trigger Program on the Specified Runtime.'
|
||||||
|
summary: 'Triggers program and returns SessionId immediately - does not wait for program completion.'
|
||||||
|
tags:
|
||||||
|
- STP
|
||||||
|
security:
|
||||||
|
-
|
||||||
|
bearerAuth: []
|
||||||
|
parameters:
|
||||||
|
-
|
||||||
|
description: 'Location of code in SASjs Drive.'
|
||||||
|
in: query
|
||||||
|
name: _program
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
example: /Projects/myApp/some/program
|
||||||
|
-
|
||||||
|
description: 'Optional query param for setting debug mode.'
|
||||||
|
in: query
|
||||||
|
name: _debug
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
format: double
|
||||||
|
type: number
|
||||||
|
example: 131
|
||||||
|
-
|
||||||
|
description: 'Optional query param for setting amount of minutes after the completion of the program when the session must be destroyed.'
|
||||||
|
in: query
|
||||||
|
name: expiresAfterMins
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
format: double
|
||||||
|
type: number
|
||||||
|
example: 15
|
||||||
/:
|
/:
|
||||||
get:
|
get:
|
||||||
operationId: Home
|
operationId: Home
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ const executeCode = async (
|
|||||||
const triggerCode = async (
|
const triggerCode = async (
|
||||||
req: express.Request,
|
req: express.Request,
|
||||||
{ code, runTime, expiresAfterMins }: TriggerCodePayload
|
{ code, runTime, expiresAfterMins }: TriggerCodePayload
|
||||||
): Promise<{ sessionId: string }> => {
|
): Promise<TriggerCodeResponse> => {
|
||||||
const { user } = req
|
const { user } = req
|
||||||
const userAutoExec =
|
const userAutoExec =
|
||||||
process.env.MODE === ModeType.Server
|
process.env.MODE === ModeType.Server
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
import express from 'express'
|
import express from 'express'
|
||||||
import { Request, Security, Route, Tags, Post, Body, Get, Query } from 'tsoa'
|
import { Request, Security, Route, Tags, Post, Body, Get, Query } from 'tsoa'
|
||||||
import { ExecutionController, ExecutionVars } from './internal'
|
import {
|
||||||
|
ExecutionController,
|
||||||
|
ExecutionVars,
|
||||||
|
getSessionController
|
||||||
|
} from './internal'
|
||||||
import {
|
import {
|
||||||
getPreProgramVariables,
|
getPreProgramVariables,
|
||||||
makeFilesNamesMap,
|
makeFilesNamesMap,
|
||||||
getRunTimeAndFilePath
|
getRunTimeAndFilePath
|
||||||
} from '../utils'
|
} from '../utils'
|
||||||
import { MulterFile } from '../types/Upload'
|
import { MulterFile } from '../types/Upload'
|
||||||
import { debug } from 'console'
|
|
||||||
|
|
||||||
interface ExecutePostRequestPayload {
|
interface ExecutePostRequestPayload {
|
||||||
/**
|
/**
|
||||||
@@ -17,6 +20,34 @@ interface ExecutePostRequestPayload {
|
|||||||
_program?: string
|
_program?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface TriggerProgramPayload {
|
||||||
|
/**
|
||||||
|
* Location of SAS program.
|
||||||
|
* @example "/Public/somefolder/some.file"
|
||||||
|
*/
|
||||||
|
_program: string
|
||||||
|
/**
|
||||||
|
* Amount of minutes after the completion of the program when the session must be
|
||||||
|
* destroyed.
|
||||||
|
* @example 15
|
||||||
|
*/
|
||||||
|
expiresAfterMins?: number
|
||||||
|
/**
|
||||||
|
* Query param for setting debug mode.
|
||||||
|
*/
|
||||||
|
_debug?: number
|
||||||
|
}
|
||||||
|
|
||||||
|
interface TriggerProgramResponse {
|
||||||
|
/**
|
||||||
|
* The SessionId is the name of the temporary folder used to store the outputs.
|
||||||
|
* For SAS, this would be the SASWORK folder. Can be used to poll program status.
|
||||||
|
* This session ID should be used to poll program status.
|
||||||
|
* @example "{ sessionId: '20241028074744-54132-1730101664824' }"
|
||||||
|
*/
|
||||||
|
sessionId: string
|
||||||
|
}
|
||||||
|
|
||||||
@Security('bearerAuth')
|
@Security('bearerAuth')
|
||||||
@Route('SASjsApi/stp')
|
@Route('SASjsApi/stp')
|
||||||
@Tags('STP')
|
@Tags('STP')
|
||||||
@@ -79,6 +110,26 @@ export class STPController {
|
|||||||
|
|
||||||
return execute(request, program!, vars, otherArgs)
|
return execute(request, program!, vars, otherArgs)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Trigger Program on the Specified Runtime.
|
||||||
|
* @summary Triggers program and returns SessionId immediately - does not wait for program completion.
|
||||||
|
* @param _program Location of code in SASjs Drive.
|
||||||
|
* @param expiresAfterMins Optional query param for setting amount of minutes after the completion of the program when the session must be destroyed.
|
||||||
|
* @param _debug Optional query param for setting debug mode.
|
||||||
|
* @example _program "/Projects/myApp/some/program"
|
||||||
|
* @example _debug 131
|
||||||
|
* @example expiresAfterMins 15
|
||||||
|
*/
|
||||||
|
@Post('/trigger')
|
||||||
|
public async triggerProgram(
|
||||||
|
@Request() request: express.Request,
|
||||||
|
@Query() _program: string,
|
||||||
|
@Query() _debug?: number,
|
||||||
|
@Query() expiresAfterMins?: number
|
||||||
|
): Promise<TriggerProgramResponse> {
|
||||||
|
return triggerProgram(request, { _program, _debug, expiresAfterMins })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const execute = async (
|
const execute = async (
|
||||||
@@ -117,3 +168,52 @@ const execute = async (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const triggerProgram = async (
|
||||||
|
req: express.Request,
|
||||||
|
{ _program, _debug, expiresAfterMins }: TriggerProgramPayload
|
||||||
|
): Promise<TriggerProgramResponse> => {
|
||||||
|
try {
|
||||||
|
// put _program query param into vars object
|
||||||
|
const vars: { [key: string]: string | number } = { _program }
|
||||||
|
|
||||||
|
// if present add _debug query param to vars object
|
||||||
|
if (_debug) {
|
||||||
|
vars._debug = _debug
|
||||||
|
}
|
||||||
|
|
||||||
|
// get code path and runTime
|
||||||
|
const { codePath, runTime } = await getRunTimeAndFilePath(_program)
|
||||||
|
|
||||||
|
// get session controller based on runTime
|
||||||
|
const sessionController = getSessionController(runTime)
|
||||||
|
|
||||||
|
// get session
|
||||||
|
const session = await sessionController.getSession()
|
||||||
|
|
||||||
|
// add expiresAfterMins to session if provided
|
||||||
|
if (expiresAfterMins) {
|
||||||
|
// expiresAfterMins.used is set initially to false
|
||||||
|
session.expiresAfterMins = { mins: expiresAfterMins, used: false }
|
||||||
|
}
|
||||||
|
|
||||||
|
// call executeFile method of ExecutionController without awaiting
|
||||||
|
new ExecutionController().executeFile({
|
||||||
|
programPath: codePath,
|
||||||
|
runTime,
|
||||||
|
preProgramVariables: getPreProgramVariables(req),
|
||||||
|
vars,
|
||||||
|
session
|
||||||
|
})
|
||||||
|
|
||||||
|
// return session id
|
||||||
|
return { sessionId: session.id }
|
||||||
|
} catch (err: any) {
|
||||||
|
throw {
|
||||||
|
code: 400,
|
||||||
|
status: 'failure',
|
||||||
|
message: 'Job execution failed.',
|
||||||
|
error: typeof err === 'object' ? err.toString() : err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
import express from 'express'
|
import express from 'express'
|
||||||
import { executeProgramRawValidation } from '../../utils'
|
import {
|
||||||
|
executeProgramRawValidation,
|
||||||
|
triggerProgramValidation
|
||||||
|
} from '../../utils'
|
||||||
import { STPController } from '../../controllers/'
|
import { STPController } from '../../controllers/'
|
||||||
import { FileUploadController } from '../../controllers/internal'
|
import { FileUploadController } from '../../controllers/internal'
|
||||||
|
|
||||||
@@ -69,4 +72,28 @@ stpRouter.post(
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
stpRouter.post('/trigger', async (req, res) => {
|
||||||
|
const { error, value: query } = triggerProgramValidation(req.query)
|
||||||
|
|
||||||
|
if (error) return res.status(400).send(error.details[0].message)
|
||||||
|
|
||||||
|
try {
|
||||||
|
const response = await controller.triggerProgram(
|
||||||
|
req,
|
||||||
|
query._program,
|
||||||
|
query._debug,
|
||||||
|
query.expiresAfterMins
|
||||||
|
)
|
||||||
|
|
||||||
|
res.status(200)
|
||||||
|
res.send(response)
|
||||||
|
} catch (err: any) {
|
||||||
|
const statusCode = err.code
|
||||||
|
|
||||||
|
delete err.code
|
||||||
|
|
||||||
|
res.status(statusCode).send(err)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
export default stpRouter
|
export default stpRouter
|
||||||
|
|||||||
@@ -192,3 +192,12 @@ export const executeProgramRawValidation = (data: any): Joi.ValidationResult =>
|
|||||||
})
|
})
|
||||||
.pattern(/^/, Joi.alternatives(Joi.string(), Joi.number()))
|
.pattern(/^/, Joi.alternatives(Joi.string(), Joi.number()))
|
||||||
.validate(data)
|
.validate(data)
|
||||||
|
|
||||||
|
export const triggerProgramValidation = (data: any): Joi.ValidationResult =>
|
||||||
|
Joi.object({
|
||||||
|
_program: Joi.string().required(),
|
||||||
|
_debug: Joi.number(),
|
||||||
|
expiresAfterMins: Joi.number().greater(0)
|
||||||
|
})
|
||||||
|
.pattern(/^/, Joi.alternatives(Joi.string(), Joi.number()))
|
||||||
|
.validate(data)
|
||||||
|
|||||||
Reference in New Issue
Block a user