Skip to content
This repository has been archived by the owner on Oct 27, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' into apikey-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank B Greco Jr committed Apr 4, 2018
2 parents 2b44d8c + 5f0e4fb commit e6cc7c0
Showing 1 changed file with 81 additions and 0 deletions.
81 changes: 81 additions & 0 deletions hugo/content/docs/v2/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,87 @@ spec:

</div>

##### SSL

The presence of the <code>ssl</code> field specifies that tls will be used to secure the connection between Kanali and an upstream service. To configure this option, just specify the secret name containing the tls assets. An example is demonstrated below.

<div class="example">
<pre>
---
apiVersion: kanali.io/v2
kind: ApiProxy
metadata:
name: example
spec:
source:
path: /foo
target:
path: /bar
backend:
endpoint: https://foo.bar.com:8443
ssl:
secretName: my-secret</pre>
</div>

Let's assume that the specified secret above is structured like the example below. Note the presence of the <code>kanali.io/enabled</code> annotation. This annotation declares that Kanali is <i>allowed</i> to use this secret (this is due to Kubernetes RBAC limitations).

Note the data fields present in this secret. If your upstream service wants to perform client side validation, the tls certificate/key pair as specified in the <code>tls.crt</code> and <code>tls.key</code> fields will be send to the server.

<div class="example">
<pre>
---
apiVersion: v1
kind: Secret
metadata:
name: my-secret
annotations:
kanali.io/enabled: 'true'
type: Opaque
data:
tls.crt: <tls crt data>
tls.key: <tls key data>
tls.ca: <tls ca data></pre>
</div>

If you want to customize the name of the data keys, you can specify your custom key via an annotation. For example, if you want to use the data key <code>crt.pem</code> instead of <code>tls.crt</code>, you would need to include the annotation <code>kanali.io/cert: 'crt.pem'</code>. A complete list of override annotations for the data fields are listed below.

<table>
<tr><td>Data field</td><td>Annotation</td></tr>
<tr><td><code>tls.ca</code></td><td><code>kanali.io/ca: 'custom.ca.value'</code></td></tr>
<tr><td><code>tls.crt</code></td><td><code>kanali.io/cert: 'custom.cert.value'</code></td></tr>
<tr><td><code>tls.key</code></td><td><code>kanali.io/key: 'custom.key.value'</code></td></tr>
<table>

#### Plugins

Plugins enable the execution of encapsulated logic on a per proxy basis. Plugins are configured as a list of different plugins that you want executed for a specific <code>ApiProxy</code>. Each plugin in the list requires the name of the plugin and an optional config field specifying proxy level configuration items that will be passed to the plugin upon execution.

For a complete list of available plugins and their corresponding documentation, visit the [documentation for plugins](/docs/v2/plugins).

<div class="example">
<pre>
---
apiVersion: kanali.io/v2
kind: ApiProxy
metadata:
name: example
spec:
source:
path: /foo
target:
path: /bar
backend:
endpoint: https://foo.bar.com:8443
plugins:
- name: apikey
config:
bindingName: my-binding
- name: jwt
config:
audienceID: abc123</pre>

</div>

### The `ApiKey` Resource

This resource configures API keys. Note that by itself, an <code>ApiKey</code> resource does not grant permission to any <code>ApiProxy</code>. Permissions are granted via the <code>ApiKeyBinding</code> resource (the next resource we will explore).
Expand Down

0 comments on commit e6cc7c0

Please sign in to comment.