Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Build

on:
push:
branches: [ master ]
branches: [ main ]
pull_request:
branches: [ master ]
branches: [ main ]

jobs:
build:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ This repository holds integrations, examples, and proof-of-concepts that work wi
- [Kubernetes Node Selector](./k8s_node_selector)
- [Kubernetes API Client](./k8s_api_client)
- [Grafana Dashboard](./grafana-dashboard)
- [OpenAPI Specification for OPA](./open_api)

For a comprehensive list of integrations, see the OPA [ecosystem](https://www.openpolicyagent.org/docs/latest/ecosystem/) page.

Expand Down
8 changes: 3 additions & 5 deletions data_filter_mongodb/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ module github.com/open-policy-agent/contrib/data_filter_mongodb
go 1.13

require (
github.com/google/go-cmp v0.3.0 // indirect
github.com/gorilla/mux v0.0.0-20181024020800-521ea7b17d02
github.com/open-policy-agent/opa v0.20.5
github.com/pkg/errors v0.8.1
github.com/pkg/errors v0.9.1
github.com/spf13/cobra v1.0.0
go.mongodb.org/mongo-driver v1.3.3
go.mongodb.org/mongo-driver v1.5.1
go.uber.org/zap v1.15.0
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5 // indirect
gopkg.in/yaml.v2 v2.2.4
gopkg.in/yaml.v2 v2.2.8
)
68 changes: 38 additions & 30 deletions data_filter_mongodb/go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion k8s_authorization/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ deployed from the [policy](policy) directory. Kind uses kubeadm so that's the
config format used for providing the authorization webhook flags to the API
server (see [kind-conf.yaml](#kind-conf.yaml).

### Testing the auhtorization webhook
### Testing the authorization webhook

With the cluster up and running, you may now issue the usual `kubectl` commands
to interact with your local Kubernetes API. Since the default user for kind is a
Expand Down
2 changes: 1 addition & 1 deletion kafka_authorizer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>24.1.1-jre</version>
<version>29.0-jre</version>
</dependency>

<dependency>
Expand Down
3 changes: 2 additions & 1 deletion kong_api_authz/src/kong/plugins/opa/access.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ function _M.execute(conf)
kong.log.debug(interp("Access allowed to ${method} ${path} for user ${subject}", {
method = input.method,
path = input.path,
subject = (token.payload and token.payload.sub or 'anonymous')
}))
end

return _M
return _M
4 changes: 2 additions & 2 deletions opa-iptables/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ IPTables is a useful tool available to Linux kernel for filtering network packet
- If you want to build opa-iptables right away, you need a working [Go environment](https://golang.org/doc/install). It requires Go version 1.12 and above.
```
$ git clone https://github.com/open-policy-agent/contrib.git
$ cd opa-iptables
$ cd contrib/opa-iptables
$ make go-build
```

- You can build opa-iptables on any system that has Docker running as follows:
```
$ git clone https://github.com/open-policy-agent/contrib.git
$ cd opa-iptables
$ cd contrib/opa-iptables
$ make docker-build
```

Expand Down
17 changes: 17 additions & 0 deletions open_api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# OpenAPI Specification for OPA

Full OpenAPI specifications for the endpoints exposed by OPA's REST API.

This may be used to generate API clients for languages and platforms not currenly supported by existing integrations, or simply just as an excellent resource for documentation.

## Swagger UI

To explore the OPA REST API through Swagger UI, simply start at web server in the root direcotry of the module. Example using Python 3:

```shell
python3 -m http.server
```
The docs will then be browsable on localhost:8000.

![Screenshot](screenshot.png "Screenshot")

Binary file added open_api/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added open_api/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions open_api/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html>
<head>
<title>Open Policy Agent (OPA) REST API</title>
<!-- needed for adaptive design -->
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700" rel="stylesheet">

<!--
ReDoc doesn't change outer page styles
-->
<style>
body {
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<div id='redoc'> </div>
<script src="https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js"></script>
<script>Redoc.init('openapi.yaml', {
noAutoAuth: true,
sortPropsAlphabetically: true,
theme: {
spacing: {
sectionVertical: 5
}
}
}, document.getElementById('redoc'));</script>
</body>
</html>
59 changes: 59 additions & 0 deletions open_api/management-swagger-ui.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Open Policy Agent (OPA) Management API</title>
<link rel="stylesheet" type="text/css" href="swagger-ui.css">
<link rel="icon" type="image/png" href="favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="favicon-16x16.png" sizes="16x16" />
<style>
html
{
box-sizing: border-box;
overflow: -moz-scrollbars-vertical;
overflow-y: scroll;
}

*,
*:before,
*:after
{
box-sizing: inherit;
}

body
{
margin:0;
background: #fafafa;
}
</style>
</head>
<body>
<div id="swagger-ui"></div>
<script src="swagger-ui-bundle.js"> </script>
<script src="swagger-ui-standalone-preset.js"> </script>
<script>
window.onload = function() {

// Build a system
const ui = SwaggerUIBundle({
url: "management.yaml",
dom_id: '#swagger-ui',
defaultModelsExpandDepth: -1,
deepLinking: true,
supportedSubmitMethods: [], // Disable 'try it out' (due to https://github.com/OAI/OpenAPI-Specification/issues/892)
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout"
})

window.ui = ui
}
</script>
</body>
</html>
33 changes: 33 additions & 0 deletions open_api/management.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html>
<head>
<title>Open Policy Agent (OPA) REST API (management)</title>
<!-- needed for adaptive design -->
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700" rel="stylesheet">

<!--
ReDoc doesn't change outer page styles
-->
<style>
body {
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<div id='redoc'> </div>
<script src="https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js"></script>
<script>Redoc.init('management.yaml', {
noAutoAuth: true,
sortPropsAlphabetically: true,
theme: {
spacing: {
sectionVertical: 5
}
}
}, document.getElementById('redoc'));</script>
</body>
</html>
Loading