Skip to content

v2 token endpoints#312

Merged
LucHeart merged 6 commits into
developfrom
feature/v2-token-endpoints
Jun 3, 2026
Merged

v2 token endpoints#312
LucHeart merged 6 commits into
developfrom
feature/v2-token-endpoints

Conversation

@LucHeart
Copy link
Copy Markdown
Member

@LucHeart LucHeart commented Jun 1, 2026

No description provided.

Comment thread API/Controller/Tokens/GetTokenSelf.cs Outdated
Comment thread API/Controller/Tokens/GetTokenSelf.cs Outdated
@hhvrc hhvrc marked this pull request as ready for review June 3, 2026 07:15
Copilot AI review requested due to automatic review settings June 3, 2026 07:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces v2 token read endpoints and updates the underlying ApiToken.LastUsed storage/model to use NULL instead of a PostgreSQL -infinity sentinel, aligning the API surface with a nullable “never used” concept.

Changes:

  • Make ApiToken.LastUsed nullable and remove the -infinity default from the EF model.
  • Add a migration to convert existing -infinity values to NULL (and restore on down migration).
  • Add v2 token response DTO + versioned v1/v2 GET endpoints to expose LastUsed as nullable in v2.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
Common/OpenShockDb/OpenShockContext.cs Removes LastUsed default value SQL from the EF model configuration.
Common/OpenShockDb/ApiToken.cs Changes LastUsed to DateTime?.
Common/Migrations/OpenShockContextModelSnapshot.cs Updates snapshot to reflect nullable LastUsed and removed default.
Common/Migrations/20260601005411_MakeApiTokenLastUsedNullable.Designer.cs Adds migration designer for the nullable LastUsed change.
Common/Migrations/20260601005411_MakeApiTokenLastUsedNullable.cs Adds migration logic, including data rewrite from -infinity to NULL.
API/Models/Response/TokenResponseV2.cs Introduces v2 token response model with nullable LastUsed.
API/Controller/Tokens/Tokens.cs Adds v1/v2-mapped GET endpoints and shared query/projection helpers.
API/Controller/Tokens/GetTokenSelf.cs Adds v2 self-token endpoint and shares mapping logic between versions.
API/Controller/Tokens/_ApiController.cs Declares token controller supports API versions 1 and 2.
Files not reviewed (1)
  • Common/Migrations/20260601005411_MakeApiTokenLastUsedNullable.Designer.cs: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Common/Migrations/20260601005411_MakeApiTokenLastUsedNullable.cs Outdated
Comment thread Common/Migrations/20260601005411_MakeApiTokenLastUsedNullable.cs Outdated
Comment thread API/Controller/Tokens/Tokens.cs Outdated
Comment thread API/Controller/Tokens/Tokens.cs Outdated
hhvrc and others added 4 commits June 3, 2026 11:00
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Comment thread API/Controller/Shockers/SendControl.cs Outdated
Comment thread API/Controller/Tokens/Tokens.cs
Comment thread API/Models/Requests/CreateTokenRequestV2.cs
Comment thread API/Models/Requests/EditTokenRequestV2.cs
Comment thread API/Services/Token/ApiTokenService.cs
Comment thread Common/Hubs/UserHub.cs Outdated
Comment thread Common/Models/ControlLimitMode.cs
@LucHeart LucHeart merged commit 4b98b80 into develop Jun 3, 2026
22 checks passed
@LucHeart LucHeart deleted the feature/v2-token-endpoints branch June 3, 2026 22:03
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.

3 participants