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

Confluence connector improvements #4

Merged
merged 3 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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"
EugeneLightsOn marked this conversation as resolved.
Show resolved Hide resolved
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