Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ieaves committed Mar 12, 2024
1 parent 4729f48 commit 47410b9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/integration-cube-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,6 @@ jobs:
with:
poetry-version: "${{ env.poetry_ver }}"

- name: Wait for Cube to start
run: |
docker run --network container:cubeapi curlimages/curl -s --retry 10 --retry-connrefused http://localhost:4000/readyz
# - name: Set up Postgres db
# working-directory: ${{ env.project_dir }}/data/dev-database
# env:
Expand All @@ -121,7 +116,9 @@ jobs:

- run: poetry install

- name: Wait for Cube to start
run: |
docker run --network container:cubeapi curlimages/curl -s --retry 10 --retry-connrefused http://localhost:4000/readyz
- name: Run Cube Tests
env:
TESTING_CUBE_API_URL: "http://localhost:4000/cubejs-api/v1"
run: poetry run pytest
24 changes: 19 additions & 5 deletions docs/pages/integrations/business_intelligence/cube.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,29 @@ In this way you can quickly identify which data is being used in your Cube insta

| Field | Value | Example |
| --------------- | ------------------------------------------------------------------ | -------- |
| source | The name of the source, see [sources](/concepts/sources) | my-source |
| Name | Name for connection | Looker |
| source | The name of the source, see [sources](/concepts/sources) | my-source|
| Name | Name for connection | Cube |
| Namespace | Namespace for the connection, see [namespace](/concepts/namespace) | default |
| api_url | The API url for your cube instance. This should end with '/v1'. | |
| api_token | The JWT web token you wish to use for authentication with Cube. | |
| namespace_map | An Optional JSON string (see below) | |
| api_url | The API url for your cube instance. This should end with '/v1'. | https://red-apple.aws-us-west-2.cubecloudapp.dev/cubejs-api/v1 |
| api_token | The JWT web token you wish to use for authentication with Cube. | eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3MTAyNjcwMzR9.CGi3Bo-FBKMFTD4l4q06dIixjcw5zpzVBgnZcOWrC-A |
| namespace_map | An Optional JSON string (see below) | see below |

You can find more information about finding your api_url and associated api_token [here](https://cube.dev/docs/product/apis-integrations/rest-api).
However, if you know the api_secret associated with your Cube instance you can use the following python script to generate a JWT token using the pyjwt library.
This default token will be used to authenticate with the Cube API and includes no expiration date.
You can uncomment the "exp" field to add an expiration date to the token with any duration you wish, however, you will need to rotate this token in Grai when it expires.

```python copy
import jwt
import datetime

payload = {
"iat": datetime.datetime.now(datetime.timezone.utc)
#"exp": datetime.datetime.now(datetime.timezone.utc) + datetime.timedelta(days=365),
}
token = jwt.encode(payload, CUBE_API_SECRET, algorithm="HS256")
print(token)
```

#### Namespace Map

Expand Down

0 comments on commit 47410b9

Please sign in to comment.