Skip to content

Commit

Permalink
Send Jira Access Token with every request
Browse files Browse the repository at this point in the history
  • Loading branch information
JakubFrejlach committed May 23, 2024
1 parent 6a25f55 commit bc272be
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
15 changes: 11 additions & 4 deletions TUTORIAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,18 @@ OSIDB uses token (JWT) authentication on most of the endpoints. Bindings handles
session = osidb_bindings.new_session(osidb_server_uri="http://localhost:8000/")
```

Some operations mentioned in [operations section](#session-operations) (mainly unsafe operations which creates or modify content) will require Bugzilla API key to work properly. Valid Bugzilla API key is provided via `BUGZILLA_API_KEY` environment variable.
Some operations mentioned in [operations section](#session-operations) (mainly unsafe operations which creates or modify content) will require Bugzilla API key or Jira Access Token to work properly.

```bash
export BUGZILLA_API_KEY="bugzilla api key"
```
* Valid Bugzilla API key is provided via `BUGZILLA_API_KEY` environment variable.

```bash
export BUGZILLA_API_KEY="bugzilla api key"
```
* Valid Jira Access Token is provided via `JIRA_ACCESS_TOKEN` environment variable.

```bash
export JIRA_ACCESS_TOKEN="jira access token"
```

The SSL verification is enabled by the default and in order to work properly you should export the `REQUESTS_CA_BUNDLE` environment variable to point to the location with the proper CA bundle. For example:

Expand Down
1 change: 1 addition & 0 deletions osidb_bindings/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ def __init__(self, base_url, auth=None, verify_ssl=True):
headers={
"User-Agent": OSIDB_BINDINGS_USERAGENT,
"Bugzilla-Api-Key": get_env("BUGZILLA_API_KEY", ""),
"Jira-Api-Key": get_env("JIRA_ACCESS_TOKEN", ""),
},
verify_ssl=verify_ssl,
)
Expand Down

0 comments on commit bc272be

Please sign in to comment.