safeguards-plugin icon indicating copy to clipboard operation
safeguards-plugin copied to clipboard

Support for retrieving policies from http urls

Open deitch opened this issue 4 years ago • 2 comments

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
  • http and https are 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?

deitch avatar Oct 16 '20 08:10 deitch

Codecov Report

Merging #12 into master will decrease coverage by 1.56%. The diff coverage is 9.09%.

Impacted file tree graph

@@            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 data Powered by Codecov. Last update 8bb57c3...bd6c0df. Read the comment docs.

codecov[bot] avatar Oct 16 '20 08:10 codecov[bot]

I fixed the linting issues. I think this can be reviewed, and we can discuss git URLs and auth in separate PRs.

deitch avatar Oct 22 '20 09:10 deitch