Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readme update #419

Merged
merged 5 commits into from
Feb 20, 2024
Merged
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
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,18 @@ website generator that uses Markdown and Javascript.

### Installation

#### Unix-like systems

```console
asdf install
corepack enable
yarn install
```

#### Windows

Install [nvm-windows](https://github.com/coreybutler/nvm-windows). Make sure your `node` version matches the one specified in `.tool-versions`.

### Starting your docs site server

```console
Expand Down
4 changes: 4 additions & 0 deletions docs/build/triggers.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ real-time event-based automation.

![Webhook Trigger](/img/webhook_trigger.png)

To learn about how to add an additional layer of security to your Webhook
Trigger by adding authentication, head over to our
[Webhook Security](../manage-projects/webhook-auth.md) page.

### Cron Triggers (formerly timers)

`Cron Triggers` run Workflows based on a cron schedule, and are good for
Expand Down
75 changes: 75 additions & 0 deletions docs/manage-projects/webhook-auth.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
title: Webhook Security
sidebar_label: Webhook Security
slug: /webhook-security
---

This page guides you through the steps of adding an additional layer of security
to your webhook.

## Adding a Webhook Authentication Method

In your OpenFn projects, you can utilize webhooks to receive data from external
applications using a
[Webhook Trigger](../build/triggers.md). When using a
webhook, you can require external applications to authenticate before sending
your project data for more security.

OpenFn supports Basic HTTP Authentication using username and password, and API
Key Authentication using the `x-api-key` request header.

### Adding Authentication Via `Project Settings`

You can add a new Authentication Method under `Webhook Security` of your
`Project Settings`. The authentication you set up here can then be used in any
of your Workflows within this Project.

![Project Settings Webhook Security](/img/lightning_auth_project_settings.png)

After clicking `New auth method`, choose the type - Basic HTTP or API Key
Authentication.

![New Auth Method](/img/lightning_choose_auth_method.png)

#### Basic Auth

For Basic Auth, give it a name, choose a username and password, and hit
`Create Auth Method`.

![Basic Auth](/img/lightning_basic_auth.png)

#### API Key

For API Key, just choose a name, and click `Create Auth Method`. An API key is
generated for you.

![API auth](/img/lightning_api_auth.png)

You can edit or delete your auth methods on this page as well.

// screenshot

Once you added an auth method to a webhook, it will show up under
`Linked Triggers`.

![Linked Triggers](/img/lightning_linked_triggers.png)

![Linked Triggers](/img/lightning_linked_triggers2.png)

### Adding Authentication Via a Workflow

On your Workflows you can use the auth methods you created under
`Project Settings`, or you can create a new one.

When you click on `Add authentication` under `Webhook Authentication`, select a
(or multiple) existing method(s), or hit `Create a new webhook auth method`.
Refer to the `Basic Auth` and `API Key` sections above for details on adding
these.

Once you've added an auth method, it will show up in your Webhook Trigger
configuration.

![Linked Triggers](/img/lightning_workflow_trigger_added.png)

Only requests using these required auth details will be able to send data to
your Workflow.
1 change: 1 addition & 0 deletions sidebars-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ module.exports = {
'manage-projects/user-roles-permissions',
'manage-projects/notifications',
'manage-projects/link-to-gh',
'manage-projects/webhook-auth',
],
},
{
Expand Down
Binary file added static/img/lightning_api_auth.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 static/img/lightning_auth_from_workflow.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 static/img/lightning_auth_project_settings.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 static/img/lightning_basic_auth.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 static/img/lightning_choose_auth_method.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 static/img/lightning_edit_auth_method.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 static/img/lightning_linked_triggers.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 static/img/lightning_linked_triggers2.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 static/img/lightning_workflow_trigger_added.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.