Support for retrieving policies from http urls
First cut at resolving #11
Supports the following:
-
file:///path/to/policy/file -
http://host.com/a/b/c -
https://host.com/a/b/c -
path/to/file -
/absolute/path/to/file
The first three are handled by checking that it is a valid URL. The last two are because it treats any invalid URL as a path.
- paths and
file:URLs are handled the same way as before -
httpandhttpsare handled using bent
What is missing?
- authentication for http/https, although it might be out of scope
- git protocol
My preference would be to ignore git entirely for this cut. Actually, I would prefer to ignore authentication, too, and handle that in a separate PR, unless someone can come up with an easy way to handle it?
Codecov Report
Merging #12 into master will decrease coverage by
1.56%. The diff coverage is9.09%.
@@ Coverage Diff @@
## master #12 +/- ##
==========================================
- Coverage 78.22% 76.65% -1.57%
==========================================
Files 19 19
Lines 427 437 +10
==========================================
+ Hits 334 335 +1
- Misses 93 102 +9
| Impacted Files | Coverage Δ | |
|---|---|---|
| safeguards/index.js | 73.33% <9.09%> (-6.67%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 8bb57c3...bd6c0df. Read the comment docs.
I fixed the linting issues. I think this can be reviewed, and we can discuss git URLs and auth in separate PRs.