<feed xmlns='http://www.w3.org/2005/Atom'>
<title>wikiapiserver/db, 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>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>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>
<entry>
<title>fix: update queries for new refresh_token_created column and add error logging</title>
<updated>2026-06-25T11:10:33+00:00</updated>
<author>
<name>wikiapiserver</name>
</author>
<published>2026-06-25T11:10:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.iamfabulous.de/wikiapiserver/commit/?id=21fb3c12c86fe3f03531c4f323854da36fb82628'/>
<id>21fb3c12c86fe3f03531c4f323854da36fb82628</id>
<content type='text'>
- INSERT and UPDATE now set both refresh_token_created and
  access_token_created timestamps
- Register handler logs the actual error on failure
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- INSERT and UPDATE now set both refresh_token_created and
  access_token_created timestamps
- Register handler logs the actual error on failure
</pre>
</div>
</content>
</entry>
<entry>
<title>refactor: store tokens in plaintext</title>
<updated>2026-06-25T10:47:38+00:00</updated>
<author>
<name>wikiapiserver</name>
</author>
<published>2026-06-25T10:47:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.iamfabulous.de/wikiapiserver/commit/?id=363d4edfed8361ba3121278eb5d7f5e5779e964c'/>
<id>363d4edfed8361ba3121278eb5d7f5e5779e964c</id>
<content type='text'>
Remove SHA-256 hashing of refresh_token and access_token.
Tokens are now stored and looked up as-is, matching the
Wikimedia API format.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove SHA-256 hashing of refresh_token and access_token.
Tokens are now stored and looked up as-is, matching the
Wikimedia API format.
</pre>
</div>
</content>
</entry>
<entry>
<title>feat: integrate Wikimedia Enterprise auth API on register</title>
<updated>2026-06-25T10:45:50+00:00</updated>
<author>
<name>wikiapiserver</name>
</author>
<published>2026-06-25T10:45:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.iamfabulous.de/wikiapiserver/commit/?id=742cd195c0018bcbc6e748d9100b643ffe1f6358'/>
<id>742cd195c0018bcbc6e748d9100b643ffe1f6358</id>
<content type='text'>
Register now calls POST /v1/login on the Wikimedia auth endpoint
to obtain refresh_token and access_token. Tokens are hashed (SHA-256)
before storage. If the API call fails, registration fails.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Register now calls POST /v1/login on the Wikimedia auth endpoint
to obtain refresh_token and access_token. Tokens are hashed (SHA-256)
before storage. If the API call fails, registration fails.
</pre>
</div>
</content>
</entry>
<entry>
<title>refactor: remove token generation from register</title>
<updated>2026-06-25T10:36:15+00:00</updated>
<author>
<name>wikiapiserver</name>
</author>
<published>2026-06-25T10:36:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.iamfabulous.de/wikiapiserver/commit/?id=ad6b1f3138cd3cd953f9caa6ab5483f0d1ac03eb'/>
<id>ad6b1f3138cd3cd953f9caa6ab5483f0d1ac03eb</id>
<content type='text'>
Register only saves username and plaintext password.
Token fields are left empty until set by the Wikimedia API.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Register only saves username and plaintext password.
Token fields are left empty until set by the Wikimedia API.
</pre>
</div>
</content>
</entry>
<entry>
<title>refactor: store password in plaintext</title>
<updated>2026-06-25T10:30:55+00:00</updated>
<author>
<name>wikiapiserver</name>
</author>
<published>2026-06-25T10:30:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.iamfabulous.de/wikiapiserver/commit/?id=550ca6c19b99e899d60153faeaf505530d508f3d'/>
<id>550ca6c19b99e899d60153faeaf505530d508f3d</id>
<content type='text'>
Remove SHA-256 hashing for the password column.
Tokens still hashed with SHA-256 in the database.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove SHA-256 hashing for the password column.
Tokens still hashed with SHA-256 in the database.
</pre>
</div>
</content>
</entry>
<entry>
<title>feat: initial wiki API server with account management</title>
<updated>2026-06-25T10:23:11+00:00</updated>
<author>
<name>wikiapiserver</name>
</author>
<published>2026-06-25T10:22:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.iamfabulous.de/wikiapiserver/commit/?id=6667426e24bba82ade4702cb8f85849bebec6077'/>
<id>6667426e24bba82ade4702cb8f85849bebec6077</id>
<content type='text'>
- HTTP API with JSON over configurable port (default 8080)
- Endpoints: POST /register, POST /login, POST /refresh, GET /health
- MariaDB storage with SHA-256 hashed credentials and tokens
- Token rotation on login and refresh
- Config loaded from config.json (not tracked in git)
- Graceful shutdown on SIGINT/SIGTERM
- Connection pool (25 max open, 10 idle, 5min max lifetime)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- HTTP API with JSON over configurable port (default 8080)
- Endpoints: POST /register, POST /login, POST /refresh, GET /health
- MariaDB storage with SHA-256 hashed credentials and tokens
- Token rotation on login and refresh
- Config loaded from config.json (not tracked in git)
- Graceful shutdown on SIGINT/SIGTERM
- Connection pool (25 max open, 10 idle, 5min max lifetime)
</pre>
</div>
</content>
</entry>
</feed>
