[devices] public key operations - #258
Open
capcom6 wants to merge 2 commits into
Open
Conversation
🤖 Pull request artifacts
|
capcom6
force-pushed
the
devices/public-key-support
branch
from
July 29, 2026 07:50
1c556ac to
f8364a1
Compare
capcom6
marked this pull request as ready for review
July 29, 2026 07:50
capcom6
force-pushed
the
devices/public-key-support
branch
from
July 30, 2026 00:29
7b74cd5 to
0bd4583
Compare
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
capcom6
force-pushed
the
devices/public-key-support
branch
from
July 31, 2026 02:16
0bd4583 to
3d10ade
Compare
capcom6
force-pushed
the
devices/public-key-support
branch
from
August 1, 2026 01:21
4303779 to
b167711
Compare
Member
Author
|
@greptile review |
capcom6
force-pushed
the
devices/public-key-support
branch
3 times, most recently
from
August 4, 2026 07:39
0883119 to
90b1780
Compare
capcom6
force-pushed
the
devices/public-key-support
branch
from
August 5, 2026 01:01
90b1780 to
7b24780
Compare
capcom6
force-pushed
the
devices/public-key-support
branch
2 times, most recently
from
August 10, 2026 02:55
5e03d03 to
04f32ec
Compare
capcom6
force-pushed
the
devices/public-key-support
branch
from
August 11, 2026 02:13
5649879 to
8b37237
Compare
capcom6
force-pushed
the
devices/public-key-support
branch
3 times, most recently
from
August 13, 2026 08:25
066ae5e to
7b16d41
Compare
capcom6
force-pushed
the
devices/public-key-support
branch
from
August 18, 2026 00:43
7b16d41 to
f24a89c
Compare
capcom6
force-pushed
the
devices/public-key-support
branch
from
August 20, 2026 00:43
f24a89c to
7957312
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.
Greptile Summary
This PR adds E2E public-key support to device registration and update flows: new
publicKey/keyVersionfields propagate through the domain model, GORM model, repository update, handler, DTO converter, and OpenAPI docs. It also resizes thephone_numbercolumn from 128 to 512 characters, moves device error sentinel variables fromrepository.gotoerrors.go, cleans up theErrInvalidUserreference that was dropped, and adds a lint-suppression comment in the FCM client.Updatemap, handler PATCH/POST, DTO converter, and OpenAPIDeviceschema are all updated consistently.message_recipients.phone_numbertovarchar(512), matching the updated OpenAPImaxLength: 512constraint.ErrInvalidUseris removed from botherrors.goand the3rdparty.goerror handler; the remaining three device errors are reformatted fromfallthroughchains to a single comma-separatederrors.Isexpression.Confidence Score: 4/5
Important Files Changed
Sequence Diagram
sequenceDiagram participant Client as Mobile Client participant MH as mobileHandler participant AuthSvc as auth.Service participant DevSvc as devices.Service participant Repo as devices.Repository participant DB as MySQL Note over Client,DB: Device Registration (POST /mobile/v1/device) Client->>MH: "POST {name, pushToken, publicKey, keyVersion}" MH->>MH: "BodyParserValidator (validates keyVersion min=1)" MH->>AuthSvc: "RegisterDevice(userID, DeviceInfo{PublicKey, KeyVersion})" AuthSvc->>DevSvc: Insert(ctx, userID, DeviceInfo) DevSvc->>Repo: Insert(ctx, DeviceInput) Repo->>DB: INSERT devices (public_key, key_version, ...) DB-->>Repo: device row Repo-->>DevSvc: "*Device" DevSvc-->>AuthSvc: "*Device" AuthSvc-->>MH: "*Device" MH-->>Client: "201 {id, token, login, password}" Note over Client,DB: Device Update (PATCH /mobile/v1/device) Client->>MH: "PATCH {id, pushToken, publicKey, keyVersion}" MH->>MH: BodyParserValidator MH->>DevSvc: "Update(ctx, id, DeviceUpdate{PublicKey, KeyVersion})" DevSvc->>Repo: Update(ctx, id, DeviceUpdate) Repo->>Repo: build map[string]any (nil-guarded per field) Repo->>DB: "UPDATE devices SET public_key=?, key_version=? WHERE id=?" DB-->>Repo: ok Repo-->>DevSvc: nil DevSvc->>DevSvc: cache.DeleteByID(id) DevSvc-->>MH: nil MH-->>Client: 204 Note over Client,DB: List Devices (GET /3rdparty/v1/devices) Client->>MH: GET /3rdparty/v1/devices MH->>DevSvc: Select(ctx, userID) DevSvc->>Repo: Select(ctx, filters) DB-->>Repo: []DeviceModel (with public_key, key_version) Repo-->>DevSvc: []Device DevSvc-->>MH: []Device MH->>MH: "DeviceToDTO → smsgateway.Device{VersionedPublicKey}" MH-->>Client: "200 [{..., publicKey, keyVersion}]"Reviews (28): Last reviewed commit: "[lint] ignore FCM Fid migration" | Re-trigger Greptile