Skip to content

Commit

Permalink
Adds WebSocket protocal to localhost (#1007)
Browse files Browse the repository at this point in the history
  • Loading branch information
agoncal authored Jul 12, 2023
1 parent b125554 commit b2bd1b3
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
19 changes: 18 additions & 1 deletion rules/rules-reviewed/cloud-readiness/localhost.windup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<matches pattern="http(s)?://((localhost)|(127\.0\.0\.1))+(:[0-9]+)?(/.*)?" />
</where>
</rule>
<rule id="localhost-http-00001">
<rule id="localhost-jdbc-00002">
<when>
<filecontent filename="{*}.{extensions}" pattern="{pattern}" />
</when>
Expand All @@ -48,5 +48,22 @@
<matches pattern="jdbc:([a-z0-9-]+)://(localhost|127\.0\.0\.1)(:[0-9]+)?" />
</where>
</rule>
<rule id="localhost-ws-00003">
<when>
<filecontent filename="{*}.{extensions}" pattern="{pattern}" />
</when>
<perform>
<hint title="Local WebSocket Calls" effort="7" category-id="mandatory">
<message>The app is trying to access local resource using WebSocket, please try to migrate the resource to cloud</message>
<tag>localhost</tag>
</hint>
</perform>
<where param="extensions">
<matches pattern="(java|properties|jsp|jspf|tag|xml|txt|yaml)" />
</where>
<where param="pattern">
<matches pattern="ws(s)?://((localhost)|(127\.0\.0\.1))+(:[0-9]+)?(/.*)?" />
</where>
</rule>
</rules>
</ruleset>
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
mysql=jdbc:sqlserver://127.0.0.1:3306/asdf
sqlserver=jdbc:sqlserver://localhost;encrypt=true;user=MyUserName;password=*****
http=http://localhost:8080
https=https://127.0.0.1:8080/ddd
https=https://127.0.0.1:8080/ddd
websocket=ws://localhost:8080
websocketsecure=wss://127.0.0.1:8080/ddd
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@
<fail message="localhost jdbc usage was not found" />
</perform>
</rule>
<rule id="localhost-ws-test-00003">
<when>
<not>
<iterable-filter size="2">
<hint-exists message="The app is trying to access local resource using WebSocket" />
</iterable-filter>
</not>
</when>
<perform>
<fail message="localhost websocket usage was not found" />
</perform>
</rule>
</rules>
</ruleset>
</ruletest>

0 comments on commit b2bd1b3

Please # to comment.