Commit Graph

12 Commits

Author SHA1 Message Date
Torin Sandall d821d80db8 server: Add request headers to authorization input
These changes update the server to include request headers in the
authorization input document.

Fixes #1456

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-06-03 07:11:59 -07:00
Torin Sandall 2d425494aa Refactor discovery implementation
These changes refactor the discovery implementation a bit to improve
test coverage and remove duplication of common logic shared with the
bundle plugin.

Specifically, the downloading logic has been moved into a separate
package that is shared by bundle and discovery. Second, test coverage in
the discovery implementation is increased from ~15% to ~85%.

These changes also include a few functional improvements:

- The default decision paths can be updated dynamically
- The decision logger can be enabled dynamically
- Discovery downloading errors are reported in status updates
- Discovery bundle is evaluated with all runtime params
- Custom plugins can be created dynamically
- Status updates include both discovery and bundle status

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2018-12-08 00:45:36 +01:00
Torin Sandall b95227688b Add default decision configuration
Previously, OPA would serve POST requests with an empty URL path by
querying data.system.main and returning the generated value. In some
cases, it's useful to be able to reconfigure OPA to use a different
document to serve these kinds of requests. The same goes for the OPA
authorization policy.

These changes make the default decision and default authorization
decision paths configurable.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2018-10-17 15:07:26 -07:00
Torin Sandall 38a988765d Add built-in function to get runtime info
These changes add support for accessing runtime information inside of
policies. In some cases, policies need to access environment variables
or configuration that OPA was booted with. These changes add a built-in
function that allows policies to gain access to this information. The
built-in function itself is relatively trivial. Most of the required
changes were plumbing the runtime information from the entrypoint down
into the evaluation engine. The alternative would have been to introduce
a global variable containing this information however that would be have
been harder to reason about in library integrations.

Fixes #420

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2018-10-16 14:20:03 -07:00
Torin Sandall 4aa9d715e4 Improve token authentication docs and handler
With these changes, the identity will be undefined if a token is not
specified. This is less surprising than the empty string that would be
set prior to these changes.

Fixes #901

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2018-09-04 14:30:07 -07:00
Ashutosh Narkar 530cb486a7 Add query parameters to input
Closes #781

Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2018-06-18 11:10:09 -07:00
Matthew Mussomele 142609b88b Use http package constants for request methods 2017-07-20 17:07:51 -07:00
Matthew Mussomele 3261995cac Refactor ast.Value to use Compare instead of Equal 2017-06-27 09:56:31 -07:00
Torin Sandall 10f22906b5 Refactor storage layer interfaces
This is a large change set that contains a few backwards incompatible
changes. Summary of breaking changes:

- Remove storage.Storage in favour of storage.Store interface.
- Remove mount support.
- Remove storage of compiled policies.
- Modify storage.Store to support rollback.
- Modify storage.Store to support raw policy storage.
- Modify storage.Store to support indexing.
2017-06-23 13:18:15 -07:00
Torin Sandall a9567ff6a8 Refactor Value.Find to use Ref instead of []string 2017-05-09 17:26:51 -07:00
Torin Sandall e090ff46d5 Fix stray built-in error messages
Fixes #275
2017-02-23 06:50:57 -08:00
Torin Sandall 96aad95475 Add identifier and authorizer to server 2017-02-22 14:49:21 -08:00