Skip to content

Feature/issue 85 personal access token auth#90

Open
lehinevych wants to merge 2 commits intomasterfrom
feature/issue-85-personal-access-token-auth
Open

Feature/issue 85 personal access token auth#90
lehinevych wants to merge 2 commits intomasterfrom
feature/issue-85-personal-access-token-auth

Conversation

@lehinevych
Copy link
Owner

This commit implements support for Wikimedia Personal Access Token
authentication as requested in issue #85.

**Simple authentication:**
```python
from mediawikiapi import MediaWikiAPI
from mediawikiapi.config import Config

config = Config(access_token="your_token_here")
api = MediaWikiAPI(config=config)
```

**With custom headers:**
```python
config = Config(
    access_token="your_token",
    custom_headers={"X-App-Name": "MyBot"}
)
api = MediaWikiAPI(config=config)
```

Per Wikimedia documentation (https://api.wikimedia.org/wiki/Authentication),
Personal Access Tokens are sent via:
```
Authorization: Bearer <token>
```
@lehinevych lehinevych force-pushed the feature/issue-85-personal-access-token-auth branch 4 times, most recently from a185e53 to 4477453 Compare February 22, 2026 23:44
- Add unit tests (test_authentication.py) with mocking to verify headers
- Add integration tests (test_auth_integration.py) using responses library
- Add manual testing script (manual_auth_test.py) for real API verification
- Add responses library as dev dependency for integration testing
@lehinevych lehinevych force-pushed the feature/issue-85-personal-access-token-auth branch from 4477453 to d09199e Compare February 22, 2026 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant