Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new authenticated API endpoint to “bump” a user’s last-login timestamp and wires up test support/configuration for Bearer tokens.
Changes:
- Introduced
webroot/lan/api/bump-last-login.phpendpoint guarded by a newUnityHTTPD::validateAPIKey()helper. - Extended PHPUnit HTTP helpers to send
Authorization: Bearer ...headers. - Added functional coverage + config entries for API keys.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| webroot/lan/api/bump-last-login.php | New POST endpoint that validates API key and records a login event for a UID |
| resources/lib/UnityHTTPD.php | Adds Bearer-token API key validation helper |
| test/phpunit-bootstrap.php | Extends http helpers to inject Bearer token + renames http_get param |
| test/functional/BumpLastLoginApiTest.php | Functional test for bump-last-login endpoint |
| deployment/overrides/phpunit/config/config.ini | Adds [api]keys for PHPUnit environment |
| defaults/config.ini.default | Documents [api]keys config option |
| CHANGELOG.md | Notes new config option for API keys |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merged
da9388f to
d04c7a5
Compare
bryank-cs
reviewed
Mar 5, 2026
8105221 to
7213015
Compare
101d402 to
7663b22
Compare
42b7d00 to
e62e286
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
adds an API endpoint where you can HTTP POST to bump the last login timestamp of a user. Requires an API key.
To demonstrate this, I needed to add an API key that runs in the docker dev environment. To do that, I needed another config override. I didn't want to use 127.0.0.1, since that address could conceivably be used in production. Instead, I set
ServerNameandUseCanonicalNameand switched the code over fromHTTP_HOSTtoSERVER_NAME.