Skip to content
Merged

Dev #29

Show file tree
Hide file tree
Changes from 5 commits
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
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"tests"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
"python.testing.pytestEnabled": true,
"python.analysis.typeCheckingMode": "basic"
}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- Core: support OAuth client credentials authentication via `client_id` and `client_secret` in `XurrentApiHelper` while maintaining API key compatibility.
- Core: OAuth token endpoint TLD is now dynamically derived from the API base URL, ensuring the same top-level domain is used for both API and OAuth.
- Core: When using OAuth, if a 401 Unauthorized error is received, the token is automatically refreshed and the API call is retried once. If authentication still fails after token refresh, an explicit HTTPError is raised.

## [0.10.0] - 2025-08-16

### Added
Expand Down
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,30 @@ This module is used to interact with the Xurrent API. It provides a set of class
# this can be used to derive the ID from the nodeID
```

#### Using OAuth client credentials

You can let the helper automatically request and refresh bearer tokens by providing the OAuth
`client_id` and `client_secret` that were issued to your application. The original API key flow
continues to work unchanged, but only one authentication method may be used per helper instance.

```python
from xurrent.core import XurrentApiHelper

baseUrl = "https://api.xurrent.qa/v1"
account = "account-name"
client_id = "your-client-id"
client_secret = "your-client-secret"

x_api_helper = XurrentApiHelper(
baseUrl,
api_account=account,
client_id=client_id,
client_secret=client_secret,
)

response = x_api_helper.api_call("/requests", "GET")
```

#### Configuration Items

```python
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "xurrent"
version = "0.10.0"
version = "0.11.0-preview.4"
authors = [
{ name="Fabian Steiner", email="fabian@stei-ner.net" },
]
Expand All @@ -18,7 +18,7 @@ Homepage = "https://github.com/fasteiner/xurrent-python"
Issues = "https://github.com/fasteiner/xurrent-python/issues"
[tool.poetry]
name = "xurrent"
version = "0.10.0"
version = "0.11.0-preview.4"
description = "A python module to interact with the Xurrent API."
authors = ["Ing. Fabian Franz Steiner BSc. <fabian.steiner@tttech.com>"]
readme = "README.md"
Expand Down
Loading