Skip to content

Commit

Permalink
node: Add URL scheme verification along flag registration (#3627)
Browse files Browse the repository at this point in the history
* node: Add valid schemes for each RPC/WS

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: add function to validate rpc/ws url

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: Add function to generate formats based on schemes input

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: Add function to register and validate flag

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: Change cobra flag register to register and verify

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: registerFlagWithValidation -> registerRPCFlagWithValidationOrFail

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: Fix minor formatting error

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: Format node.go

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: Remove default parameter

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: Fix accoutantWS accepted schemes

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: Remove expectedSchemes to use validSchemes[rpcName] instead

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: Fix typos

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: map -> inline param

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: Add unit test for validateURL

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

---------

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>
  • Loading branch information
bingyuyap authored Jan 9, 2024
1 parent b7631bf commit 81af52a
Show file tree
Hide file tree
Showing 4 changed files with 159 additions and 48 deletions.
2 changes: 1 addition & 1 deletion Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ docker_build(
# ignore local node_modules (in case they're present)
ignore = ["./node_modules"],
build_args = {"num_guardians": str(num_guardians), "dev": str(not ci)},

# sync external scripts for incremental development
# (everything else needs to be restarted from scratch for determinism)
#
Expand Down
Loading

0 comments on commit 81af52a

Please sign in to comment.