oxidized
oxidized copied to clipboard
Create PfSenseHttps model
Pre-Request Checklist
- [x] Passes rubocop code analysis (try
rubocop --auto-correct
) - [x] Tests added or adapted (try
rake test
) - [x] Changes are reflected in the documentation
- [x] User-visible changes appended to CHANGELOG.md
Description
This adds a simple model to use the web ui on PfSense machines to download the configuration. I use this in situations where I use oxidized to backup config from remote PfSense machines where I only have access to the web UI.
This is a RFC. I'm probably abusing a lot of code here, and I should write both documentation and some explaining about the model but I'm throwing this out there for some early feedback.
Codecov Report
Merging #2126 (aaa3011) into master (a36aece) will increase coverage by
0.04%
. The diff coverage isn/a
.
:exclamation: Current head aaa3011 differs from pull request most recent head 3c14cea. Consider uploading reports for the commit 3c14cea to get more accurate results
@@ Coverage Diff @@
## master #2126 +/- ##
==========================================
+ Coverage 63.28% 63.32% +0.04%
==========================================
Files 30 30
Lines 1498 1497 -1
==========================================
Hits 948 948
+ Misses 550 549 -1
Impacted Files | Coverage Δ | |
---|---|---|
lib/oxidized/source/http.rb | 40.81% <0.00%> (+0.81%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 0eecddb...3c14cea. Read the comment docs.
Oxidized offers an http
input type which should support https. Is there any benefit to relying on mechanized
directly instead of that input here?
This is way more "scraping" than what the http input can do. This needs Mechanize to handle session cookies, csrf-tokens and such.
Here is mechinize model: https://github.com/ytti/oxidized/blob/master/lib/oxidized/model/cambium.rb
I didn't see any sane way of using the existing @main_page
/ :login
Mechanize
functionally here , where I needed to set OpenSSL::SSL::VERIFY_NONE
and a custom https-port.
Also, I was a bit afraid of breaking the world if I tried to introduce those flags in http
.
That was why I did it the way I did.
It's pretty easy to refactor this code if someone could point me in the right direction on how to get the http model working as needed.
Please process the checklist
Please fix the merge conflicts
Now I've fixed the merge conflicts in the changelog file.