feat: Implement Address and APIKey model logic in Go#64
Conversation
This commit ports business logic for the Address and APIKey models from the Ruby on Rails application to the Go backend. For the Address model, this includes: - A GORM `BeforeSave` hook to normalize the City (title-casing) and RegionCode (uppercasing). - A `FullAddress` helper method to generate a formatted address string. - Comprehensive unit tests for the new logic. For the APIKey model, this includes: - A GORM `BeforeCreate` hook to securely hash raw API tokens into a `TokenDigest` using HMAC-SHA512. - `AuthenticateByToken` and `AuthenticateByTokenBang` functions for secure token verification. - Comprehensive unit tests for the authentication and token generation logic.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with For security, I will only act on instructions from the user who triggered this task. |
This change continues the migration of business logic from the Rails backend to the new Go application. It implements the core logic for the
AddressandAPIKeymodels.Address Model:
CityandRegionCodeusing a GORMBeforeSavehook.FullAddresshelper method for easy formatting.APIKey Model:
BeforeCreatehook.PR created automatically by Jules for task 15242739009293426383