Commit Graph

879 Commits

Author SHA1 Message Date
Ashutosh Narkar cd72743750 docs: Add guidance for OPA-Envoy benchmarks
Previously we provided actual performance benchmarks
for the OPA-Envoy plugin by running it in an experimental
setup. Although it maybe useful to document real numbers,
the results depend a lot on the environment in which OPA-Envoy
is run, OPA features being used and also on the methodology
used to generate them (eg. how a particular load test tool
measures latency).

Hence this commit provides guidance and best practices for
benchmarking the OPA-Envoy plugin which users can adopt in
their own environments.

Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2021-06-29 12:47:24 -07:00
Pat Myron 47feea7cbb docs: syntax highlighting EBNF grammar (#3588)
https://docs.github.com/en/github/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks#syntax-highlighting

Signed-off-by: Pat Myron <pmyron@nd.edu>
2021-06-27 08:45:25 +02:00
John Snow 5fb5cc4ad4 docs/extensions: marshal the decision log (#3583)
I think this helps people who are not as familiar with go to get
more expected results. The issue is that because `input` and `result`
are interfaces when `event` is printed to stdout without the map being
marshalled to JSON, both `input` and `result` are printed as memory
pointers. This is confusing to someone less familiar with go as
they may believe that their input is not present in the decision
log. By adding Marshal, the stdout will now be standard JSON which
will then have `result` and `input` with the string values.

Signed-off-by: John Snow <john@styra.com>
2021-06-24 10:24:10 +02:00
Ashutosh Narkar 5528361c69 plugins/rest: Add option to specify CA for remote services
This change allows users to specify a certificate for the services
that implement the bundle, status etc. APIs. This cert will be
used to create the root CA pool.

Fixes: #1954

Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2021-06-23 08:36:16 -07:00
Stephan Renatus ba9e1e7b95 docs: update opa-envoy-plugin and contrib default branch (#3578)
These aren't required, since github resolves the `master` links properly.
Anyways, let's clean these up.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
2021-06-22 13:51:12 +02:00
Marius Ileana 13cb6bdc32 docs: typo in "Extending OPA" (#3570)
Signed-off-by: dxps <marius.ileana@gmail.com>
2021-06-20 12:13:12 +02:00
Dave Baker 81c58a89db typo in docs
Signed-off-by: Dave Baker <dbaker@redhat.com>
2021-06-17 13:45:10 +02:00
Anders Eknert 040481b426 Bump live blocks dependencies
Signed-off-by: Anders Eknert <anders@eknert.com>
2021-06-15 09:32:52 -04:00
Anders Eknert 03beded83c Change default linux download
Signed-off-by: Anders Eknert <anders@eknert.com>
2021-06-15 08:35:48 -04:00
Torin Sandall b6eb3fb91b server: Extend POST v1/query endpoint to accept input
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2021-06-14 09:45:08 -04:00
Jonas Iggbom 6f0ba0120b Fixed concat command in metadata discovery method
The concat command to assemble the url for metadata discovery was missing [] and ending )

Signed-off-by: iggbom <jonas@curity.io>
2021-06-09 22:47:06 +02:00
Will Beason 52cf5b84b5 use golangci-lint run --fix instead of goimports
Signed-off-by: Will Beason <willbeason@google.com>
2021-06-03 16:09:02 -04:00
Ansu Varghese b3d7ea49d9 Patch release for OPA v0.28.0 that contains a fix for loading a single global input schema file via "eval --schema" for the input document.
Signed-off-by: Ansu Varghese <avarghese@us.ibm.com>
2021-05-27 14:38:33 -04:00
Olamide Omolola c9c7bac009 topdown: change the tls_use_system_certs default to true
This commit changes the default of `tls_use_system_certs`
parameter for `http.send` from `false` to `true`

Fixes #2271

Signed-off-by: Olamide Omolola <omololaolamidex@gmail.com>

Fixup to commit 5c213e5

Signed-off-by: Olamide Omolola <omololaolamidex@gmail.com>

Fixed variables name changes as suggested by @anderseknert

Signed-off-by: Olamide Omolola <omololaolamidex@gmail.com>

Amended test as suggested by @srenatus

Signed-off-by: Olamide Omolola <omololaolamidex@gmail.com>
2021-05-22 09:02:09 +02:00
Will Beason 3be1d08b87 Change check-lint to use golangci-lint (#3465)
golint is deprecated. The author of the code no longer supports the
codebase. golangci-lint is faster than golint, and is in use by other
opa repositories (e.g. Gatekeeper).

This commit changes tools.go to reference golangci (so it ends up in
vendor) and modifies check-lint to use golangci instead.

Breaking API Changes:

- plugins/rest/rest.go: Fix typo "AllowInsureTLS" -> "AllowInsecureTLS"
- storage/errors.go: Removed unused IndexingNotSupportedErr

Signed-off-by: Will Beason <willbeason@google.com>
2021-05-19 07:52:02 +02:00
Anders Eknert b08313068b Bump lodash dependency
Signed-off-by: Anders Eknert <anders@eknert.com>
2021-05-13 12:50:27 -04:00
viovanov 4a8f57c23f Add a manifest key for bundle metadata
Signed-off-by: viovanov <vlad@aserto.com>
2021-05-13 12:33:28 -04:00
dependabot[bot] 4b72f50f8b build(deps-dev): bump postcss in /docs/website/scripts/live-blocks (#3457)
Bumps [postcss](https://github.com/postcss/postcss) from 8.2.8 to 8.2.10.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.2.8...8.2.10)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-12 15:57:33 +02:00
dependabot[bot] 94436b780d build(deps): bump codemirror in /docs/website/scripts/live-blocks (#3455)
Bumps [codemirror](https://github.com/codemirror/CodeMirror) from 5.48.4 to 5.58.2.
- [Release notes](https://github.com/codemirror/CodeMirror/releases)
- [Changelog](https://github.com/codemirror/CodeMirror/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codemirror/CodeMirror/compare/5.48.4...5.58.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-12 15:42:53 +02:00
Torin Sandall c7ea2bbf48 plugins/discovery: Treat discovery.resource as canonical
This commit updates the discovery plugin so that discovery.resource
can be supplied without discovery.name. This change is a long time
coming and makes the discovery configuration consistent w/ bundle
configuration.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2021-05-10 11:34:14 -04:00
David Eyers c3db237f59 docs: typo "it's" -> "its" (#3451)
Signed-off-by: David Eyers <dme@cs.otago.ac.nz>
2021-05-10 11:57:44 +02:00
Anders Eknert a93af16c37 Use bundle server for http-api tutorial (#3426)
**NOTE** that this depends on changes in the contrib repo
which will need to be merged after next release: https://github.com/open-policy-agent/contrib/pull/142

This code should be reviewed together with the PR targeting contrib.

Signed-off-by: Anders Eknert <anders@eknert.com>
2021-05-07 14:34:39 +02:00
Stephan Renatus e1c803e57e website: resolve "latest" to latest version in shortcodes (#3436)
This came up in the discussion of #3426.

Note that there's two ways to access the current "latest" version:

https://www.openpolicyagent.org/docs/latest/http-api-authorization/
https://www.openpolicyagent.org/docs/v0.28.0/http-api-authorization/

For both sites, the shortcodes now resolve to "0.28.0". Before, the
first one would show "latest", the second "0.28.0".

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
2021-05-06 17:09:59 +02:00
Torin Sandall 2c6c81f25b docs: Update path matching in the Envoy tutorial (#3435)
The path matching in the tutorial is wrong. For example:

> glob.match("/people*", [], "/peoplexyz")
true
> glob.match("/people*", [], "/peoplexxxx/1234")
true

This patch updates the examples so that the matches don't return false positives.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2021-05-05 21:24:05 +02:00
Stephan Renatus a1e3037a54 website/wasm: fix markup around link without target (#3421)
Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
2021-04-30 08:35:43 +02:00
Anders Eknert 0d0a5ac3aa Fix redirects post release
This reverts commit 0a374befee.

Signed-off-by: Anders Eknert <anders@eknert.com>
2021-04-27 16:41:46 +02:00
Torin Sandall a6beeedc08 docs: Add note about comment block parsing
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2021-04-27 09:06:08 -04:00
Torin Sandall 7288872cd6 docs: Add preliminary docs on annotation scopes
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2021-04-27 09:06:08 -04:00
Anders Eknert 0a374befee Temporary fix of redirects
Since this file does not update with releases but with deployments,
we'll need to revert this until the release tomorrow.

Signed-off-by: Anders Eknert <anders@eknert.com>
2021-04-26 19:55:48 +02:00
Anders Eknert 44de60a387 Restructure management docs one sub-page per topic
Signed-off-by: Anders Eknert <anders@eknert.com>
2021-04-26 17:14:41 +02:00
Anders Eknert 8d7e0ecb24 New cloud provider bundle server docs
Signed-off-by: Anders Eknert <anders@eknert.com>
2021-04-26 17:14:41 +02:00
Anders Eknert 681f616b6f Add instructions for contributing
Signed-off-by: Anders Eknert <anders@eknert.com>
2021-04-22 13:24:22 +02:00
mibarg 3e98998e3c docs/website: Add sphinx-rego to integration list
Sphinx-rego automatically generates documentation for Rego policies based on meta properties.
This commit adds `integrations.yml` reference and Sphinx-doc logo.

Signed-off-by: mibarg <11074433+mibarg@users.noreply.github.com>
2021-04-21 23:03:11 +02:00
Torin Sandall 03ef3e7a52 docs: Update ecosystem page link to github (#3403)
Hopefully this makes it easier for people to discover and update the
ecosystem page.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2021-04-21 20:14:07 +02:00
Stephan Renatus 27d658c53a website: link to same page (if possible) from version picker (#3390)
This might not be the most efficient or idiomatic way to do it, but
I think it works.

Doesn't do in-page anchors, so selecting a different version when on
page /docs/v0.26.0/policy-performance/#benchmarking-queries will get
you to /docs/<other>/policy-performance/ only.

Fixes #3023 to some extend. A little less annoying now, I hope.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
2021-04-16 15:53:57 +02:00
Grant Shively dd35d6ce8d plugins/status: add plugin support
Added support for plugins in status plugin, similar to the pattern
employed in the decision logs plugin. By setting `status.plugin`
in configuration, you can override how the status plugin sends status
updates.

Related to #3047

Signed-off-by: Grant Shively <gshively@godaddy.com>
2021-04-16 09:31:23 -04:00
Torin Sandall ad1001a6df docs/content: Update references to default branch
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2021-04-15 15:32:15 -04:00
Torin Sandall 4405a766f8 docs/devel: Update RELEASE.md references to main branch
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2021-04-15 15:32:15 -04:00
Torin Sandall 64288ffaa4 docs/devel: Update DEVELOPMENT.md references to main branch
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2021-04-15 15:32:15 -04:00
Marco Massenzio acd08cccd6 Added Integration entry for Spring Security Reactive
Points to the JTW-OPA Integration in [massenz/jwt-opa](https://github.com/massenz/jwt-opa)

Signed-off-by: Marco Massenzio <marco@alertavert.com>
2021-04-15 07:40:12 +02:00
Asaf Cohen 4092a7c0f2 add OPAL (Open Policy Administration Layer) to integrations
Signed-off-by: Asaf Cohen <asafc@me.com>
2021-04-14 22:50:50 +02:00
Grant Shively ee9dc91767 bundle: refactor sign/verify to use interface (#3336)
It is now possible to register a custom implementation of the sign and
verify functions.

Signed-off-by: Grant Shively <gshively@godaddy.com>
2021-04-14 09:50:52 +02:00
André Håland 458d87489b built-ins: time.diff function (#3358)
This built-in function makes it possible to get the absolute
difference between to unix timestamps (nanoseconds since epoch)
on the format [year, month, day, hour, minute, second].

Fixes: #3348

Signed-off-by: Andre Håland <andre.haland@gmail.com>
2021-04-13 14:30:08 +02:00
Anders Eknert 7bf53f82d7 Add thumbprint config option for x5t JWT header
This is required by the Azure Identity OAuth2 implementation
when the client credentials JWT flow is used.

Fixes #3372

Signed-off-by: Anders Eknert <anders@eknert.com>
2021-04-13 14:12:00 +02:00
Arshad Saquib 2764c67094 Add TLS option to specify CA file (#3359)
this option allows CA file to be used in TLS configuration for bundle downloads

Fixes: #1968
Signed-off-by: Arshad Saquib <arshad.saquib@styra.com>
2021-04-13 09:47:12 +02:00
Mandana Vaziri 3e3655bbaf New support to upload a directory of JSON schema file(s) via "opa eval --schema". Directory can contain schema file(s) for policy input document(s), and schema file(s) for contextual data document(s). These schema files are used then to improve static type checking and to get more precise error reports as you develop Rego code.
Also, there is new support for adding annotations on Rules to specify the schemas to be used specifically for type checking the expressions within the scope of that Rule. It helps address issues with schema overloading, and provides even more precise type error reports for a Rego developer.

Also, added support for annotation processing when loading via bundles.

Co-authored-by: @vazirim Mandana Vaziri mvaziri@us.ibm.com
Co-authored-by: @aavarghese Ansu Varghese avarghese@us.ibm.com
Co-authored-by: @tsandall Torin Sandall torinsandall@gmail.com
Signed-off-by: Mandana Vaziri <mvaziri@us.ibm.com>
2021-03-31 10:15:41 -04:00
Ashutosh Narkar 959de3dac1 plugins/log: Add rate limit control for encoding decision log events
This change allows users to configure the rate at which decision
logs can be written into the encoder. A token bucket based rate
limiter is used to decide if a log event should be written into
the encoder. The encoded events are then added to the
buffer. If the rate limit is exceeded the event is dropped.

This change provides added control to users over buufering log events
on top of the existing behavior of specifying a buffer size limit.

Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2021-03-29 14:04:51 -07:00
Anders Eknert 710b8574f5 Commit package-lock.json (#3316)
Also print info when deps are not installed.

Signed-off-by: Anders Eknert <anders@eknert.com>
2021-03-25 10:26:46 +01:00
Anders Eknert 00f14643fb Live blocks depedency updates (#3315)
Should fix annoying dependabot warning.

Live blocks functionality tested with make serve-local and
remotely using Netlify. Both seems to work as before.

Signed-off-by: Anders Eknert <anders@eknert.com>
2021-03-25 09:19:02 +01:00
Jon Zeolla ce2aeaf163 Fix policy reference documentation typo
Signed-off-by: Jon Zeolla <zeolla@gmail.com>
2021-03-22 17:11:18 -07:00