From 4bd3d23853bb9257df4754348811bd94af95c1b9 Mon Sep 17 00:00:00 2001 From: Ian Eaves Date: Fri, 3 Nov 2023 18:14:06 -0500 Subject: [PATCH] docs --- docs/pages/integrations/airflow.mdx | 16 +++++++++++----- docs/pages/integrations/openlineage.mdx | 17 ++++++++++++----- grai-server/app/connections/tests/test_urls.py | 9 +++++---- grai-server/app/connections/urls.py | 2 +- grai-server/app/seed/connectors.json | 2 -- 5 files changed, 29 insertions(+), 17 deletions(-) diff --git a/docs/pages/integrations/airflow.mdx b/docs/pages/integrations/airflow.mdx index 834e9baa6..5a2125b81 100644 --- a/docs/pages/integrations/airflow.mdx +++ b/docs/pages/integrations/airflow.mdx @@ -28,21 +28,27 @@ The Airflow integration consumes OpenLineage metadata from Airflow. | source | The name of the source, see [sources](/concepts/sources) | my-source | | Name | Name for connection | Airflow | | Namespace | Namespace for the connection, see [namespaces](/concepts/namespace) | default | -| api_secret | Input an api_secret which will be used to verify each message | super_secret | | namespaces | Optional | | ### Webhook -Grai will open an endpoint at `/api/v1/openlineage///` which can be used to receive Airflow OpenLineage events. + + In order to authenticate your webhook, you will need to create an API key in the Grai web app. + + +Grai will open an endpoint at `/api/v1/openlineage//` which can be used to receive Airflow OpenLineage events. See the [OpenLineage Airflow docs](https://openlineage.io/docs/integrations/airflow/) for how to configure your client to send OpenLineage events. An example config: -``` +```yaml copy transport: - url: "https://api.grai.io", - endpoint: "/api/v1/openlineage///" + type: "http" + url: "https://api.grai.io/api/v1/openlineage//" + auth: + type: "api_key" + api_key: "" ``` ## Python Library diff --git a/docs/pages/integrations/openlineage.mdx b/docs/pages/integrations/openlineage.mdx index 2cac3a159..84a745fcb 100644 --- a/docs/pages/integrations/openlineage.mdx +++ b/docs/pages/integrations/openlineage.mdx @@ -33,21 +33,28 @@ The OpenLineage integration consumes OpenLineage metadata from various systems. | source | The name of the source, see [sources](/concepts/sources) | my-source | | Name | Name for connection | OpenLineage | | Namespace | Namespace for the connection, see [namespaces](/concepts/namespace) | default | -| api_secret | Input an api_secret which will be used to verify each message | super_secret | | namespaces | Optional | | ### Webhook -Grai will open an endpoint at `/api/v1/openlineage///` which can be used to receive OpenLineage events. You should point your OpenLineage clients to this endpoint. + + In order to authenticate your webhook, you will need to create an API key in the Grai web app. + + + +Grai will open an endpoint at `/api/v1/openlineage//` which can be used to receive OpenLineage events. You should point your OpenLineage clients to this endpoint. See the [OpenLineage docs](https://openlineage.io/docs/client/python) for how to configure your client to send events to a webhook. An example config: -``` +```yaml copy transport: - url: "https://api.grai.io", - endpoint: "/api/v1/openlineage///" + type: "http" + url: "https://api.grai.io/api/v1/openlineage//" + auth: + type: "api_key" + api_key: "" ``` ## Python Library diff --git a/grai-server/app/connections/tests/test_urls.py b/grai-server/app/connections/tests/test_urls.py index 5bddef381..430f11100 100644 --- a/grai-server/app/connections/tests/test_urls.py +++ b/grai-server/app/connections/tests/test_urls.py @@ -13,6 +13,7 @@ from lineage.models import Source from workspaces.models import Membership, Organisation, Workspace, WorkspaceAPIKey from users.models import User +from django.urls import reverse @pytest.fixture @@ -680,7 +681,7 @@ def test_dbt_cloud_not_active(test_connection_dbt_cloud, client, hmac_secret): @pytest.mark.django_db def test_openlineage(client, test_connection_openlineage, workspace_api_key): - url = f"/api/v1/openlineage/{test_connection_openlineage.id}/" + url = reverse("connections:openlineage", args=[test_connection_openlineage.id]) body = {} auth_headers = { @@ -696,7 +697,7 @@ def test_openlineage(client, test_connection_openlineage, workspace_api_key): @pytest.mark.django_db def test_openlineage_no_connection(client, workspace_api_key): - url = f"/api/v1/openlineage/{uuid.uuid4()}/" + url = reverse("connections:openlineage", args=[uuid.uuid4()]) body = {} auth_headers = { @@ -710,7 +711,7 @@ def test_openlineage_no_connection(client, workspace_api_key): @pytest.mark.django_db def test_openlineage_invalid_api_key(client, test_connection_openlineage): - url = f"/api/v1/openlineage/{test_connection_openlineage.id}/" + url = reverse("connections:openlineage", args=[test_connection_openlineage.id]) body = {} auth_headers = { @@ -727,7 +728,7 @@ def test_openlineage_not_active(client, test_connection_openlineage, workspace_a test_connection_openlineage.is_active = False test_connection_openlineage.save() - url = f"/api/v1/openlineage/{test_connection_openlineage.id}/" + url = reverse("connections:openlineage", args=[test_connection_openlineage.id]) body = {} auth_headers = { diff --git a/grai-server/app/connections/urls.py b/grai-server/app/connections/urls.py index a6f21b847..ef7166602 100755 --- a/grai-server/app/connections/urls.py +++ b/grai-server/app/connections/urls.py @@ -327,5 +327,5 @@ def open_lineage(request, connection: Connection): urlpatterns = router.urls + [ path("external-runs/", create_run), path("dbt-cloud/", dbt_cloud, name="dbt-cloud"), - path("openlineage//", open_lineage), + path("openlineage//", open_lineage, name="openlineage"), ] diff --git a/grai-server/app/seed/connectors.json b/grai-server/app/seed/connectors.json index 7149187cb..d879e9937 100644 --- a/grai-server/app/seed/connectors.json +++ b/grai-server/app/seed/connectors.json @@ -509,7 +509,6 @@ { "name": "api_secret", "required": true, - "secret": true, "order": 0 }, { @@ -669,7 +668,6 @@ { "name": "api_secret", "required": true, - "secret": true, "order": 0 }, {