Commit Graph

5 Commits

Author SHA1 Message Date
Torin Sandall 0dfc7641c9 Set bundle status in case of HTTP 304
Previously, the bundle plugin was only updating the status struct if:

* a download or activation error occurred.
* a new bundle was successfully activated.

As a result, if a transient bundle download/activation error occcured,
OPA would never report that the error condition had been cleared in the
event that the service began serving HTTP 304s.

These changes update the bundle plugin to always set the error status
regardles of whether an error occurred or a new bundle was activated.

Also, refactor the bundle plugin to set all of the activation state
(timestamp, revision, etag) in one place.

Fixes #794

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2018-06-22 14:20:23 -07:00
Torin Sandall 90751a12a5 Remove stray println statement
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2018-06-22 14:20:23 -07:00
Torin Sandall a6783095e4 Write bundle manifest to /system namespace
This provides consistent access to the manifest through the storage
interface.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2018-04-10 13:58:36 -07:00
Torin Sandall be42d33d43 Add notifications to bundle plugin
Previously, the bundle plugin did not expose a mechanism for callers to
inspect the status of bundle downloads. With these changes, callers can
register for notifications when bundle updates are performed. This will
allow OPA to report status to remote HTTP servers.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2018-04-09 11:05:06 -07:00
Torin Sandall f131cfcff3 Add support for bundle downloading
Previously, policies and data had to be pushed into OPA via the REST API
or loaded via command line arguments at startup.

With these changes, OPA can now be configured to pull down bundles of
policy and data from remote HTTP servers. When a bundle is downloaded
successfully, the policies and data are loaded out of the bundle file
and inserted into storage.
2018-03-16 08:51:37 -07:00