Commit Graph

10 Commits

Author SHA1 Message Date
Torin Sandall 4033f3d945 server: Remove deprecated diagnostic feature
This commit removes the deprecated diagnostic feature from the
server. The feature has been deprecated since November 2018 and it was
essentially unused at the time so it should be safe to
remove. Removing the diagnostic support from the server saves having
to perform an extra policy evaluation in the server.

Once the buffer is removed from the runtime.Params struct the related
issue can be closed (there is still one known user of that so it has
been left intact for backwards compatibility.)

Ref #1052

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-08-06 02:25:09 +09:00
Patrick East 346aa964e8 Add support for multiple bundles
This change brings in support for multiple bundles to be downloaded
and activated OPA.

This is enabled by using the new config option `bundles` to define
the bundles, and deprecates the older `bundle` option.

The new `bundles` keyword and structure is propagated through to the
decision logs, status API, provenance, stored manifests, etc. Check
out the doc changes for all the updated structures.

That being said any existing configuration using `bundle` will *not*
see the new structure, everything is intended to be backwards
compatible (almost to a fault).

Fixes: #721

Signed-off-by: Patrick East <east.patrick@gmail.com>
2019-07-31 03:43:38 -04:00
Torin Sandall d1d4df9798 server: Pass transaction in decision log event
These changes update the server to pass the server's open transaction
to the decision logger. This prevents the same goroutine from
recursively opening a new transcation when the log masking decision is
evaluated.

Alternatively we could update the server to close it's transaction
before logging the decision however this could lead to the log masking
decision being generated from a different policy revision. Another
alternative would be extend the storage layer to support recursive
transactions however this would be quite a bit more work.

We should investigate whether we can cheaply detect recursive
transactions in the store to avoid potential deadlocks in the future.

Also, delete opa binary that was accidentally committed to the repo.

Fixes #1543

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-07-03 15:10:59 -04:00
Torin Sandall 1db3023d45 Update decision log events to model paths and queries
Previously paths and queries were modelled with the same
attribute. This was going to cause headaches down the road for
decision log consumers that need to be able to deal with both kinds of
policy invocations.

As part of these changes, the decision logging test in the server has
been refactored to make it a bit more maintainable.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-01-16 12:45:47 -08:00
Torin Sandall 4428a9bd31 Update server and decision logger to represent input properly
Previously the input attribute was no represented as *interface{}
which makes it impossible to differentiate between null and undefined
input. This commit changes that. Eventually we should just get rid of
server.Info in favour of the decision log event structure.

This change requires a release note.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-01-16 12:45:47 -08:00
Stephan Renatus fd938f0661 Remove dead code
I don't know why I ended up looking into this, but I've run

    golangci-lint run --disable-all -E deadcode

on the code base and removed everything that came up :)

Signed-off-by: Stephan Renatus <srenatus@chef.io>
2018-07-02 09:19:15 -07:00
Torin Sandall b31412dc8e Update server to include revision in decision logs
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2018-04-10 13:58:36 -07:00
Torin Sandall 05e9eb601c Refactor diagnostics support in server and runtime
- These changes update the server to always report performance metrics
  and the remote client address. The metrics are cheap to compute and
  there is no significant reason to require more complex configuration
  at this point.

- These changes update the runtime to allow callers to supply the
  diagnostics buffer implementation. This way callers can hook up their
  own sinks to the server's diagnostics.
2017-09-19 15:54:26 -07:00
Torin Sandall 2ec6770956 Add optional decision_id to server
Include an optional decision_id field in Data API responses. The
decision_id can be used for correlating application transactions with
policy decisions. The decision_id field is intended to be separate from
any kind of application tracing that OPA may eventually support.
2017-09-19 15:54:26 -07:00
Matthew Mussomele fa23597c04 Implement diagnostic utilities for the server
The package includes a few simple utilities, including a storage struct
for diagnostic info, a way to configure them and a ring buffer to store
them.
2017-08-08 15:45:12 -07:00