Skip to content

Fix firewall JSON parsing to match production#13

Closed
onnimonni wants to merge 1 commit into
MathiasPius:masterfrom
onnimonni:fix-firewall
Closed

Fix firewall JSON parsing to match production#13
onnimonni wants to merge 1 commit into
MathiasPius:masterfrom
onnimonni:fix-firewall

Conversation

@onnimonni

Copy link
Copy Markdown

Hey,

I was building a CLI support to this library with Claude and I noticed that sometimes the firewall config returned ports separated by comma eg: 80,443. This is not great fix but at least it started to work.

It would be great to get some feedback on how you would want the structure to be in that case. Should it return multiple port ranges eg 80-80 and 443-443 in this case?

@MathiasPius

Copy link
Copy Markdown
Owner

Huh, I was not aware you could specify multiple ports per rule. I think I know a pretty elegant way of solving this.

@MathiasPius

Copy link
Copy Markdown
Owner

Sorry for hijacking your change, but while implementing support for many different combinations of port ranges (80,443,8080-9090 for example), I discovered a number of weird client pooling/timeout issues which prevented me from running a complete test suite.

I also stumbled upon a lot of small nits here and there, so I rolled it all into a single PR (#15) and am currently releasing 7.0.0, which also includes the port range fix, but might mess up #14 (I haven't had a chance to take a good look yet).

Thanks for highlighting this issue!

@onnimonni

onnimonni commented Nov 20, 2025

Copy link
Copy Markdown
Author

Yeah no worries. I ended up not using this library and just built a golang version with Claude Code and now there's a cli and terraform provider too: https://github.com/midwork-finds-jobs/terraform-provider-hrobot

Your code was very elegant but using it with terraform prooved to be a bit difficult.

@MathiasPius

Copy link
Copy Markdown
Owner

Oh that's cool, I might have a use for that too!

I too looked into developing Terraform Providers using Rust (and this library specifically) but the Terraform Plugin system is (as you probably also discovered) very heavily reliant on the Go SDK/Framework developed by Hashicorp, so I wasn't able to get anything working either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants