Skip to content

Commit

Permalink
Confluence connector improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneP committed Dec 4, 2023
1 parent e4f2a60 commit 3e632fc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion confluence/.env-template
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CONFLUENCE_USER=
CONFLUENCE_PASSWORD=
CONFLUENCE_API_TOKEN=
CONFLUENCE_PRODUCT_URL=https://sample.atlassian.net
CONFLUENCE_SPACE_NAME=
CONFLUENCE_SEARCH_LIMIT=10
Expand Down
6 changes: 4 additions & 2 deletions confluence/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ This connector requires the following environment variables:

```
CONFLUENCE_USER
CONFLUENCE_PASSWORD
CONFLUENCE_API_TOKEN
CONFLUENCE_PRODUCT_URL
CONFLUENCE_SPACE_NAME
```

The user and password combination should be a user email address and an API token pair.
The user and api token combination should be a user email address and an API token pair.
The API token can be generated by logging into Confluence and going
to the API tokens [page](https://id.atlassian.com/manage-profile/security/api-tokens).
The product URL should be the URL for the Confluence wiki, including the https:// scheme.
The space name should be the name of a single space in your wiki.

Expand Down
4 changes: 2 additions & 2 deletions confluence/dev/load_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

confluence = Confluence(
url=os.environ.get("CONFLUENCE_PRODUCT_URL"),
username=os.environ.get("CONFLUENCE_CLIENT_USER"),
password=os.environ.get("CONFLUENCE_CLIENT_PASS"),
username=os.environ.get("CONFLUENCE_USER"),
password=os.environ.get("CONFLUENCE_API_TOKEN"),
)
space = os.environ.get("CONFLUENCE_SPACE_NAME")

Expand Down
4 changes: 2 additions & 2 deletions confluence/provider/client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import asyncio
import functools

import asyncio
from atlassian import Confluence
from flask import current_app as app

Expand Down Expand Up @@ -77,7 +77,7 @@ def get_client():

assert (url := app.config.get("PRODUCT_URL")), "CONFLUENCE_PRODUCT_URL must be set"
assert (user := app.config.get("USER")), "CONFLUENCE_USER must be set"
assert (password := app.config.get("PASSWORD")), "CONFLUENCE_PASSWORD must be set"
assert (password := app.config.get("API_TOKEN")), "CONFLUENCE_API_TOKEN must be set"
assert (space := app.config.get("SPACE_NAME")), "CONFLUENCE_SPACE_NAME must be set"
search_limit = app.config.get("SEARCH_LIMIT", 10)
client = ConfluenceClient(url, user, password, space, search_limit)
Expand Down

0 comments on commit 3e632fc

Please sign in to comment.