Skip to content

feat: add GET /1/account and deprecate GET /1/users/self - #379

Merged
hhvrc merged 3 commits into
developfrom
feat/account-self
Nov 13, 2026
Merged

hhvrc merged 3 commits into
developfrom
feat/account-self

Conversation

@hhvrc

@hhvrc hhvrc commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

GET /1/account returns the current user's account information as a plain object (no legacy { message, data } wrapper). It lives on the account controller and, unlike the rest of it, also accepts API tokens so token clients can migrate off /1/users/self.

/1/users/self keeps working with its legacy wrapper and is marked obsolete, which shows as deprecated in the OpenAPI document.

Summary by CodeRabbit

  • New Features
    • Added authenticated GET /1/account for retrieving the current user’s ID, name, email, image, roles, and password status. It supports session and API-token authentication.
  • Changes
    • The existing GET /1/users/self endpoint is deprecated, with callers directed to GET /1/account. It remains available with the legacy rank field for compatibility.

GET /1/account returns the current user's account information as a plain
object (no legacy { message, data } wrapper). It lives on the account
controller and, unlike the rest of it, also accepts API tokens so token
clients can migrate off /1/users/self.

/1/users/self keeps working with its legacy wrapper and is marked
obsolete, which shows as deprecated in the OpenAPI document.
@hhvrc
hhvrc requested a review from LucHeart October 16, 2026 17:48
@hhvrc hhvrc self-assigned this Oct 16, 2026
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Explain Change →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 55 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 87b235c4-92a1-4394-bc01-341dcce96b85
Commits

Reviewing files that changed from the base of the PR and between 10b466f and f15048e.

Files selected for processing: 6

  • API.IntegrationTests/Tests/AccountAuthenticatedTests.cs
  • API.IntegrationTests/Tests/AuthorizationTests.cs
  • API/Controller/Account/Authenticated/GetSelf.cs
  • API/Controller/Users/GetSelf.cs
  • API/Models/Response/LegacyUserSelfResponse.cs
  • API/Models/Response/UserSelfResponse.cs

No actionable comments were generated in the recent review.

Walkthrough

The API adds authenticated GET /1/account with a new response model. The legacy user endpoint now uses a separate legacy response model and is marked obsolete. Integration tests cover session and API-token authentication, response fields, and unauthorized access.

Changes: Account endpoint

Layer / File(s) Summary
Account response models and endpoints
API/Models/Response/UserSelfResponse.cs, API/Controller/Account/Authenticated/GetSelf.cs, API/Models/Response/LegacyUserSelfResponse.cs, API/Controller/Users/GetSelf.cs
Adds the response model and authenticated GET /1/account endpoint. The legacy endpoint now returns LegacyUserSelfResponse and is marked obsolete with guidance to use /1/account.
Endpoint integration coverage
API.IntegrationTests/Tests/AccountAuthenticatedTests.cs, API.IntegrationTests/Tests/AuthorizationTests.cs
Tests session and API-token requests, account response fields, the absence of a root data wrapper, and a 401 response without authentication.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Suggested reviewers: nullstalgia

Merge Risk: Minimal · previous review 10b46

This change adds a new account endpoint and marks the legacy user endpoint as deprecated, leaving the legacy response unchanged. No actionable merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the two main changes: the new GET /1/account endpoint and the deprecation of GET /1/users/self. The summaries confirm both: a new authenticated account controller and response models, …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the two main changes: the new GET /1/account endpoint and the deprecation of GET /1/users/self. The summaries confirm both: a new authenticated account controller and response models, and the legacy GetSelf marked obsolete with a pointer to /1/account. The title is specific and matches the primary change, so it passes.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e6ed1568-f21d-4606-8d5c-d1ef4aee33b5
Commits

Reviewing files that changed from the base of the PR and between 5da14a0 and 10b466f.

Files selected for processing: 4

  • API/Controller/Account/Authenticated/GetSelf.cs
  • API/Controller/Users/GetSelf.cs
  • API/Models/Response/LegacyUserSelfResponse.cs
  • API/Models/Response/UserSelfResponse.cs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@hhvrc
hhvrc requested a review from a team as a code owner November 13, 2026 15:21
@hhvrc
hhvrc requested a review from LucHeart November 13, 2026 20:16
@hhvrc
hhvrc merged commit cd7c030 into develop Nov 13, 2026
25 checks passed
@hhvrc
hhvrc deleted the feat/account-self branch November 13, 2026 21:12
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.

2 participants