Commit Graph

509 Commits

Author SHA1 Message Date
Tim Hinrichs 05ce97b4a0 docs: Add links to homepage
Previously, there were no links from the homepage to any of the
more detailed docs about use cases and even mention of use cases
was below the fold.

This change adds links to use cases at the very top of the page,
along with pointers to core docs and the OPA summit.

Signed-off-by: Tim Hinrichs <tim@styra.com>
2019-09-12 18:37:05 -04:00
Tim Hinrichs 1aae0a4b2d docs: Clarify type-checking functions
Previously the behavior of the type-checking functions was arguably
underdescribed in the docs when the type-check failed.

This change specifies that the result is undefined.

Signed-off-by: Tim Hinrichs <tim@styra.com>
2019-09-12 18:37:05 -04:00
Patrick East 1e78e7fe9f docs: Redirects for some top level doc sections
After the more recent doc re-org we will want to have redirects help
ease the transition for URL's that were out in the wild. Internally
all the links should be up to date but this will help with external
sites linking to us.

Closes: #1707
Signed-off-by: Patrick East <east.patrick@gmail.com>
2019-09-12 18:36:50 -04:00
Torin Sandall 65cc5f8446 docs: Activate live blocks on the latest version of the docs
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-09-12 18:06:53 -04:00
Torin Sandall ac74fc77ff docs: Refresh docs on how to extend OPA
Users frequently ask how to implement custom built-in functions and up
until now the information has been a bit hidden. This change improves
the visibility of the docs that describe how to customize/extend
OPA. We should revisit the section on how to customize the OPA daemon
to demonstrate how to use dep or modules as well as how to instantiate
only select portions of OPA (e.g., the plugin manager with a custom
gRPC server.)

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-09-12 17:12:41 -04:00
Torin Sandall 4c21b4401b docs: Add overview to management APIs page
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-09-12 17:12:10 -04:00
Torin Sandall b107ef2618 docs: Reorganize operations pages
* Move the integration guide into the core docs. This is one of the
  most common questions when people get started.
* Split the configuration and monitoring sections into their own
  pages. This prepares the management page for an introduction that
  explains the control plane concept.
* Move bundle section up to the top of the page since basic policy
  distribution is usually the first concern.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-09-12 17:12:10 -04:00
Torin Sandall 583b67cb57 docs: Refresh the introduction page
This commit updates the introduction page to focus on Rego and
integrating with OPA (whereas the old introduction content focused on
high-level concepts like policy-decoupling, the data document, etc.)

The new introduction content provides a concise overview of OPA and
then launches into an tour of Rego (by example) that shows the core
concepts in the language. The content ends with an overview of
different ways you can interact with OPA.

The old introduction content has been moved into the Philosophy page
and the How Does OPA Work? page has been removed/replaced by the new
introduction page.

With these changes we can update the frontpage with links to core OPA
introduction and then different use cases (e.g., Kubernetes, Envoy,
etc.)

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-09-11 13:36:19 -04:00
Patrick East b32c17239c docs: Turn off canonifyURLs
This was breaking the site.. reverting the change.

Signed-off-by: Patrick East <east.patrick@gmail.com>
2019-09-10 11:37:16 -07:00
omerlh c8b9985e2c documentation
Signed-off-by: omerlh <omerl@soluto.com>
2019-09-10 10:10:41 -07:00
Patrick East e8f652c436 docs: Fix all broken links
Any links that were caught by the link checker have been
repaired. This also standardizes some to ensure we are
always using URLs with trailing `/` when possible.

Signed-off-by: Patrick East <east.patrick@gmail.com>
2019-09-10 09:58:50 -07:00
Patrick East 0ab559ec9c docs: Turn on hugo canonical urls
This makes it easier to see when we link to the wrong place.

Signed-off-by: Patrick East <east.patrick@gmail.com>
2019-09-10 09:58:50 -07:00
Patrick East f4ca80bb59 docs: Add / for docs landing page link
Signed-off-by: Patrick East <east.patrick@gmail.com>
2019-09-10 09:58:50 -07:00
Patrick East 7a9a78fa2a docs: Use full copy for latest instead of shadow
Instead of using url rewriting tricks we will just copy the latest
docs as part of the build process for a "latest" version.

In the version selector code we need to handle this to hide the
version, but overall it simplifies the template code.. so thats nice.

Best part, and main reason for doing this, is that the pretty url
feature will now work on the `/docs/latest/*` urls. It will fix some
weirdness with the relative url links we use in the markdown content
and remove a duplicate search result.

Signed-off-by: Patrick East <east.patrick@gmail.com>
2019-09-10 09:58:50 -07:00
Patrick East 13f1de2982 docs: Stop showing versions <0.10.7
This lets us simplify some of the code and there isn't really a great
reason to keep the older docs up at this point.

Signed-off-by: Patrick East <east.patrick@gmail.com>
2019-09-10 09:58:50 -07:00
Patrick East 968ad5919c docs: Fix load-docs.sh when HEAD is both a tag and branch
If there was a tag and branch that both referenced HEAD it would
return to the tag instead of branch. This change gives priority to
the branch if the current HEAD corresponds to one.

Signed-off-by: Patrick East <east.patrick@gmail.com>
2019-09-10 09:58:50 -07:00
Patrick East 04c711fc01 docs: Remove non-useful linkcheck target
The `linkcheck` target has been broken since we added in the "latest"
URL stuff and started using netlify redirects all over.

Add documentation for using a different tool that crawls the live
preview deployemnt.

Signed-off-by: Patrick East <east.patrick@gmail.com>
2019-09-10 09:58:50 -07:00
Patrick East 4ea7c206fe docs: Rename data-replication.md to external-data.md
We changed the title in the doc but the file still had the old name.

Signed-off-by: Patrick East <east.patrick@gmail.com>
2019-09-10 09:58:50 -07:00
Stephan Renatus 818738539e build: use docker for golang
As discussed in #1639.

Note that .dockerignore had to be changed as to *not* skip what's needed
for the build: vendor, obviously, and .git for the compiled-in version
information.

parts:
- .travis.yml: don't bother about golang anymore
- docs/devel/DEVELOPMENT.md: update
- Makefile: update hint

Signed-off-by: Stephan Renatus <srenatus@chef.io>
2019-09-10 08:53:41 -04:00
Torin Sandall ccf263c3be runtime: Add build commit to runtime info
With #1715 we updated opa.runtime() to include the OPA semantic
version in the output. This change extends that to include the build
commit which is useful for development purposes.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-09-10 08:49:05 -04:00
Teemu Koponen 515e29b4c6 builtins: Enhance io.jwt.verify_* builtins to accept JWK as a cert parameter.
Signed-off-by: Teemu Koponen <koponen@styra.com>
2019-09-09 10:22:01 -04:00
Patrick East 6b6dd1cf83 docs: remove lint step from live-blocks
This should fix the critical vulnerability found by scanners in the
eslint-utils package by removing the lint script.

We can re-visit this again in the future when someone can spend more
time to fix it.

Signed-off-by: Patrick East <east.patrick@gmail.com>
2019-09-05 19:18:36 -06:00
Ashutosh Narkar fe14bdf754 docs: Create tutorial for Envoy-OPA integration.
Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2019-09-05 06:06:33 -07:00
Patrick East 2f37e38180 docs: Refactor production-build make target
This makes it easier to troubleshoot the live blocks injection step
by isolating the build step to make the hugo content.

Signed-off-by: Patrick East <east.patrick@gmail.com>
2019-09-04 16:36:31 -06:00
omerlh f43bae2509 document the new field
Signed-off-by: omerlh <omerl@soluto.com>
2019-09-04 12:14:40 -06:00
Omer Levi Hevroni d3ecbcb9c5 added examples for decision and multi bundle
Signed-off-by: omerlh <omerl@soluto.com>
2019-09-04 11:32:56 -06:00
Torin Sandall 1e40874c03 docs: Update RELEASE.md file to include bugfix process
Currently this is a bit manual. We can automate/improve it in the future.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-09-03 08:42:29 -07:00
Patrick East 1991bd9032 docs: Remove ceph guide temporarily (again)
It snuck back in.. see 5fd445eab7 for
the original removal.

Signed-off-by: Patrick East <east.patrick@gmail.com>
2019-08-29 10:10:10 -07:00
Tim Hinrichs c47f9da450 docs: Substitute "decouple policy" for "policy-enablement"
We no longer describe OPA as policy-enabling a service.  Instead we talk about
OPA as decoupling policy from a service.  This seems to be the one place we
talk about it.

Also modify the introduction to describe authentication versus authorization.

Signed-off-by: Tim Hinrichs <tim@styra.com>
2019-08-29 09:29:08 -07:00
Tim Hinrichs 6760303a47 docs: Reorganize the docs navigation
The docs have grown organically and it was time for a reorganization, specifically
helping people understand at a single glance the information
that is available in the docs.

The new docs are organized as follows:
- Core docs (policy and data)
- Use-case specific docs
- Operations
- Support

As part of the reorganization, several files were renamed and/or combined.

Also made an editing pass over what was previously the user-attribute docs
and generalized them to focus on data-replication, an issue that is
now promoted to the core docs.  As part of that, updated the images
and removed the old ones; new image sources are in google slides.

Tweaked the navigation bar to give more space on the left-hand column
so that more of the topics are visible without scrolling.

Signed-off-by: Tim Hinrichs <tim@styra.com>
2019-08-29 09:29:08 -07:00
David Boles 9618e9d35a live-blocks: Added an include(<group name>) tag.
Signed-off-by: David Boles <me@davidbol.es>
2019-08-29 09:28:45 -07:00
Marco Sanvido 5850a343a9 Revert "Fix support link"
This reverts commit 1f4a6e3f22.

The url was fixed, no need for this change anymore.

Signed-off-by: Marco Sanvido <marco@styra.com>
2019-08-28 18:19:28 -07:00
Marco Sanvido 1f4a6e3f22 Fix support link
The support link was incorrect.

Signed-off-by: Marco Sanvido <marco@styra.com>
2019-08-27 20:53:37 -07:00
Torin Sandall 5fd445eab7 docs: Removing Ceph tutorial until issues can be resolved
There are a few issues with the Ceph tutorial in it's current
state. I've documented a few of them in the commit message on this
branch: https://github.com/tsandall/opa/tree/fix-ceph-authz.

Once those issues are addressed we can re-introduce the Ceph tutorial.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-08-27 17:29:51 -07:00
Patrick East 0d70daa545 docs: Use a single value for algolia version meta
As-is we have an array like `["v0.13.4", "latest"]` but it seems that
we aren't referencing it as such, its trying to compare a string
version.

It looks like on the `latest` urls we would set the facetFilter to
be the explicit version, so we'll just stick with that for the meta
tags too.

Signed-off-by: Patrick East <east.patrick@gmail.com>
2019-08-27 09:26:48 -07:00
Vincent Gramer 79e2e4a770 docs: update terraform tutorial to works with v.0.12.6
Signed-off-by: Vincent Gramer <vgramer@gmail.com>
2019-08-26 16:05:16 -07:00
Torin Sandall 4ee04ca358 docs: Add language reference section for units
Also fix-up built-in function declaration to match updated name.

Fixes #1561

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-08-26 12:13:16 -04:00
David Boles da95397588 docs: Minor live blocks fixes and improvements.
Allow "open" button for read_only blocks.

Remove erroneous CSS.

Added a tag for showing line numbers.

Signed-off-by: David Boles <me@davidbol.es>
2019-08-23 17:43:25 -07:00
Torin Sandall 41fbf6eb13 docs: Update to show undefined example with !=
Fixes #1626

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-08-23 16:50:32 -04:00
Torin Sandall 74d67c5de1 docs: Update to use live blocks
These changes update most of the docs to use live blocks. The
following pages have not been touched or updated significantly:

* Get Started - this page is based entirely on the REPL. We should
  revisit the "Get Started" page once these changes have
  landed. The existing page can live on as an introduction to the REPL
  while the Get Started page can be tailored to live blocks.

* Ceph Authorization - this page has not been updated aside from
  making the policy example use the live blocks for syntax
  highlighting. We need to revisit the policy example and refactor the
  tutorial a bit to emphasize the policy as opposed to the manifests
  required to install.

* Terraform - this page has not been touched because @vgramer is
  planning to update for Terraform v0.12. We can update this page once
  those changes are in to avoid conflicts.

These changes also remove the use of non-Markdown code examples. All
the examples are inlined into Markdown now.

A few OPA deployment examples have been updated to enable the console
decision logging. This is better than the request/response debug logs.

Fixes #1650

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-08-23 16:50:32 -04:00
Torin Sandall 64139d61f7 docs: Fix whitespace in Makefile
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-08-23 16:50:32 -04:00
Torin Sandall 983dfd4435 docs: Fix package parsing in preprocessor
The regexp was not allowing comments at the end of the line.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-08-23 16:50:32 -04:00
Patrick East 37c1d0be59 docs: Update warning for multi-bundle root overlap
The behavior has since changed and we do check for overlaps.

The warning has been updated to give advice on monitoring for errors
and to describe the somewhat racy nature of loading multiple bundles.

Signed-off-by: Patrick East <east.patrick@gmail.com>
2019-08-22 12:33:13 -07:00
Torin Sandall 1495033a55 docs: Add note about benchmark result page
Fixes #1275

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-08-22 14:49:12 -04:00
lucperkins 614670e0f8 Add initial implementation of search bar
Signed-off-by: lucperkins <lucperkins@gmail.com>
2019-08-21 10:31:24 -07:00
David Boles 91d98c7205 docs: Add live-editable code blocks to the docs.
This commit adds a postprocessor to the docs build that enables
examples to be edited and have the results show up live. See the
additions to `docs/README.md` for more about what writing these
blocks looks like or the netlify PR preview
(e.g. at `docs/edge/how-do-i-write-policies/`)
to see them in action (you'll need to disable CORS for live output).

Signed-off-by: David Boles <me@davidbol.es>
2019-08-21 10:12:49 -07:00
Torin Sandall b0523466c1 Refactor metric provider implementation
* Remove metric provider config to avoid introducing new public
  interfaces. Since there is only one provider (prometheus) and it
  doesn't have any configurable settings, remove the configuration
  changes for now. We can always add these in the future.

* Remove dummy metric provider implementation. This isn't needed now
  that we're using the metrics.Metrics interface instead of
  metrics.GlobalMetrics.

* Remove metrics.GlobalMetrics in favour of metrics.Metrics. Move the
  HTTP handler instrumentation interfaces into the server package to
  avoid coupling the metrics package to the net/http package.

* Refactor the prometheus provider to implement the metrics.Metrics
  interface. Since the prometheus registry can error on Gather()
  calls, the provider has been updated to accept a logger and use ti
  when the Gather() call fails. This doesn't affect any public
  interfaces so it can be revisited in future if needed. Alteratnively
  we could add a Gather() interface onto metrics.Metrics which could
  return the error.

* Refactor status plugin to include metrics in status update by
  default. Users implementing the status API are likely to need
  performance metrics to gauge the OPA's health. Moreover if they are
  implementing the status API it's unlikely they will want to poll the
  /metrics endpoint on the OPA HTTP API (which may not even be
  exposed.)

* Move the prometheus endpoint test case into the e2e package so the
  server package has no dependencies on prometheus anymore.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-08-15 15:08:38 -04:00
Stan Lagun 69fbaacfde Add Prometheus metrics to the status updates
Prometheus metrics can give much of insight into OPA's health.
Run-time metrics are a natural part of the application state
so having them in status update seems like a right change
that can help server understand what's going in with the OPA
instance.

The commit also encapsulates all prometheus-related code in one package
and abstracts it with generic interface so that it would be possible
to add other metrics providers

Addresses #1606

Signed-off-by: Stan Lagun <stan@styra.com>
2019-08-15 15:08:38 -04:00
Torin Sandall 7ef72c191b docs: Refactor admission control content into top-level section
The goal is to have the Kubernetes admission control content organized
into one section. This should make it easier to incorporate Gatekeeper
content in the future.

Since the layouts are not versioned the layout logic had to be
enhanced to filter out sections that have no content for the current
version. Doing a semantic version comparison was considered but it was
unclear how to implement that properly within the Hugo template
system. Since it's unlikely that we will want to ever display empty
sections this approach seems fine.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-08-14 16:38:09 -04:00
Torin Sandall bd0d89bede build: Remove the release-builder image
The release-builder image is no longer required because we only need
the base Go image to build the OPA binaries. The nodejs dependency was
only required for the docs which are handled by netlify now.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-08-14 14:03:50 -04:00