<feed xmlns='http://www.w3.org/2005/Atom'>
<title>wikiapiserver/api, branch master</title>
<subtitle>Small server utility to make working with wikimedia enterprise api a little bit easier.</subtitle>
<link rel='alternate' type='text/html' href='https://git.iamfabulous.de/wikiapiserver/'/>
<entry>
<title>fix: filter to English Wikipedia via POST with filter body</title>
<updated>2026-06-25T23:32:11+00:00</updated>
<author>
<name>wikiapiserver</name>
</author>
<published>2026-06-25T23:32:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.iamfabulous.de/wikiapiserver/commit/?id=46bcf2b5e837bfbc957db60a5c674742f3916083'/>
<id>46bcf2b5e837bfbc957db60a5c674742f3916083</id>
<content type='text'>
The structured contents API requires a POST request with the filter
in the JSON body to narrow results:
  {"filters": [{"field": "in_language.identifier", "value": "en"}]}

Replaces the non-functional query-string filter parameter.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The structured contents API requires a POST request with the filter
in the JSON body to narrow results:
  {"filters": [{"field": "in_language.identifier", "value": "en"}]}

Replaces the non-functional query-string filter parameter.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix: remove invalid project filter from article API call</title>
<updated>2026-06-25T23:20:29+00:00</updated>
<author>
<name>wikiapiserver</name>
</author>
<published>2026-06-25T23:20:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.iamfabulous.de/wikiapiserver/commit/?id=e7bbed2d3b7d06700b0b4d9009f695e0cdf03e40'/>
<id>e7bbed2d3b7d06700b0b4d9009f695e0cdf03e40</id>
<content type='text'>
The filters[project]=en.wikipedia.org parameter caused timeouts and
empty responses. The filter value was incorrect for the Wikimedia
Enterprise API.

Articles from 404-list.test that genuinely don't exist on Wikipedia
(e.g. TV episodes without standalone articles) still return 404 —
this is expected behavior from the upstream API.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The filters[project]=en.wikipedia.org parameter caused timeouts and
empty responses. The filter value was incorrect for the Wikimedia
Enterprise API.

Articles from 404-list.test that genuinely don't exist on Wikipedia
(e.g. TV episodes without standalone articles) still return 404 —
this is expected behavior from the upstream API.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix: pass through upstream HTTP status codes from /article</title>
<updated>2026-06-25T20:00:25+00:00</updated>
<author>
<name>wikiapiserver</name>
</author>
<published>2026-06-25T20:00:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.iamfabulous.de/wikiapiserver/commit/?id=4907cfb72ef69fb94c49cfb484a5a2907db0dee8'/>
<id>4907cfb72ef69fb94c49cfb484a5a2907db0dee8</id>
<content type='text'>
- Non-2xx responses (404, 429, 5xx) are now forwarded to the
  client with their original status code and response body
- Increased WriteTimeout to 45s to accommodate slow upstream API
- Added explicit resp.Body.Close() and response flush before return
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Non-2xx responses (404, 429, 5xx) are now forwarded to the
  client with their original status code and response body
- Increased WriteTimeout to 45s to accommodate slow upstream API
- Added explicit resp.Body.Close() and response flush before return
</pre>
</div>
</content>
</entry>
<entry>
<title>feat: log article API failures to database</title>
<updated>2026-06-25T19:35:50+00:00</updated>
<author>
<name>wikiapiserver</name>
</author>
<published>2026-06-25T19:35:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.iamfabulous.de/wikiapiserver/commit/?id=795fb7facf403f4e3d452d2e08ba11f98e8ee997'/>
<id>795fb7facf403f4e3d452d2e08ba11f98e8ee997</id>
<content type='text'>
- Created api_logs table (username, article_name, status_code,
  response_time_ms, error, request_url)
- GetArticle logs failures (network errors and non-2xx responses)
  with timing, status code, and response body
- Successful requests are not logged
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Created api_logs table (username, article_name, status_code,
  response_time_ms, error, request_url)
- GetArticle logs failures (network errors and non-2xx responses)
  with timing, status code, and response body
- Successful requests are not logged
</pre>
</div>
</content>
</entry>
<entry>
<title>fix: limit article search to English Wikipedia</title>
<updated>2026-06-25T14:19:17+00:00</updated>
<author>
<name>wikiapiserver</name>
</author>
<published>2026-06-25T14:19:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.iamfabulous.de/wikiapiserver/commit/?id=19ec2891109eb0dc9074fcd5f6bdc4ef3f1bb0b4'/>
<id>19ec2891109eb0dc9074fcd5f6bdc4ef3f1bb0b4</id>
<content type='text'>
Add limit=1&amp;filters[project]=en.wikipedia.org to structured
contents API call.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add limit=1&amp;filters[project]=en.wikipedia.org to structured
contents API call.
</pre>
</div>
</content>
</entry>
<entry>
<title>feat: GET /article endpoint proxies Wikimedia structured contents</title>
<updated>2026-06-25T13:42:32+00:00</updated>
<author>
<name>wikiapiserver</name>
</author>
<published>2026-06-25T13:42:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.iamfabulous.de/wikiapiserver/commit/?id=81258d39db6530699194f860206528c6f09a5238'/>
<id>81258d39db6530699194f860206528c6f09a5238</id>
<content type='text'>
GET /article?username=alice&amp;name=en.wikipedia/Sun
→ proxies to api.enterprise.wikimedia.com/v2/structured-contents/{name}
with Authorization: Bearer &lt;access_token&gt;

Returns 401 for unknown users, 400 if params missing,
and passes through the upstream HTTP status on errors.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
GET /article?username=alice&amp;name=en.wikipedia/Sun
→ proxies to api.enterprise.wikimedia.com/v2/structured-contents/{name}
with Authorization: Bearer &lt;access_token&gt;

Returns 401 for unknown users, 400 if params missing,
and passes through the upstream HTTP status on errors.
</pre>
</div>
</content>
</entry>
<entry>
<title>feat: add GET /token endpoint</title>
<updated>2026-06-25T13:02:22+00:00</updated>
<author>
<name>wikiapiserver</name>
</author>
<published>2026-06-25T13:02:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.iamfabulous.de/wikiapiserver/commit/?id=1a25a89dfeeb7ed5af4df77907b65f99bdf5399a'/>
<id>1a25a89dfeeb7ed5af4df77907b65f99bdf5399a</id>
<content type='text'>
Returns access_token and valid_until for a given username.
GET /token?username=foo → {"access_token": "...", "valid_until": "2026-06-26T15:00:51Z"}
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Returns access_token and valid_until for a given username.
GET /token?username=foo → {"access_token": "...", "valid_until": "2026-06-26T15:00:51Z"}
</pre>
</div>
</content>
</entry>
<entry>
<title>feat: GET /token?username=... returns access_token and valid_until</title>
<updated>2026-06-25T12:59:59+00:00</updated>
<author>
<name>wikiapiserver</name>
</author>
<published>2026-06-25T12:59:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.iamfabulous.de/wikiapiserver/commit/?id=857fc8bd77e36a45b249b83419c7ba3dde2b792a'/>
<id>857fc8bd77e36a45b249b83419c7ba3dde2b792a</id>
<content type='text'>
Returns the stored access_token and the timestamp when it was
created (access_token_created). Returns 401 for unknown users.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Returns the stored access_token and the timestamp when it was
created (access_token_created). Returns 401 for unknown users.
</pre>
</div>
</content>
</entry>
<entry>
<title>feat: token refresh with age-based logic</title>
<updated>2026-06-25T12:47:35+00:00</updated>
<author>
<name>wikiapiserver</name>
</author>
<published>2026-06-25T12:47:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.iamfabulous.de/wikiapiserver/commit/?id=cc960860e4109b4eb50721d0b3338df4b859d559'/>
<id>cc960860e4109b4eb50721d0b3338df4b859d559</id>
<content type='text'>
- RefreshTokens checks token age and chooses the right path:
  - refresh_token &gt; 90 days: re-auth via WikimediaLogin (full login)
  - access_token &gt; 24 hours: refresh via WikimediaTokenRefresh
  - otherwise: return current tokens
- WikimediaTokenRefresh posts to /v1/token-refresh endpoint
- Login also uses WikimediaLogin instead of local RotateTokens
- Removed dead RotateTokens, RefreshByToken, and randomHex
- DSN includes parseTime=true for timestamp columns
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- RefreshTokens checks token age and chooses the right path:
  - refresh_token &gt; 90 days: re-auth via WikimediaLogin (full login)
  - access_token &gt; 24 hours: refresh via WikimediaTokenRefresh
  - otherwise: return current tokens
- WikimediaTokenRefresh posts to /v1/token-refresh endpoint
- Login also uses WikimediaLogin instead of local RotateTokens
- Removed dead RotateTokens, RefreshByToken, and randomHex
- DSN includes parseTime=true for timestamp columns
</pre>
</div>
</content>
</entry>
<entry>
<title>refactor: extract Wikimedia auth into reusable function</title>
<updated>2026-06-25T12:40:16+00:00</updated>
<author>
<name>wikiapiserver</name>
</author>
<published>2026-06-25T12:40:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.iamfabulous.de/wikiapiserver/commit/?id=e375b6cc68f4a9b0e91b25479538dc76d1f1e620'/>
<id>e375b6cc68f4a9b0e91b25479538dc76d1f1e620</id>
<content type='text'>
- WikimediaLogin is a standalone function: POSTs to auth.enterprise.wikimedia.com
  and returns the tokens. Can be called from any flow.
- Register composes WikimediaLogin + CreateAccount
- CreateAccount now takes tokens as arguments (pure DB insert)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- WikimediaLogin is a standalone function: POSTs to auth.enterprise.wikimedia.com
  and returns the tokens. Can be called from any flow.
- Register composes WikimediaLogin + CreateAccount
- CreateAccount now takes tokens as arguments (pure DB insert)
</pre>
</div>
</content>
</entry>
</feed>
