Compare commits

..
Author SHA1 Message Date
phoenix 4cc80edfbc tsk-15: Added User Id to Login 2025-12-15 21:44:06 -05:00
8 changed files with 17 additions and 21 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ jobs:
run: | run: |
echo "Creating version" echo "Creating version"
VERSION="0.1.1" VERSION="0.0.11"
PROJECT_COMMIT_HASH=$(git rev-parse HEAD | cut -c 1-10) PROJECT_COMMIT_HASH=$(git rev-parse HEAD | cut -c 1-10)
BRANCH_REF="${{ gitea.ref }}" BRANCH_REF="${{ gitea.ref }}"
BRANCH_NAME=$(echo "$BRANCH_REF" | cut -d '/' -f 3) BRANCH_NAME=$(echo "$BRANCH_REF" | cut -d '/' -f 3)
View File
+2
View File
@@ -7,6 +7,7 @@ import (
type TwilioConfig struct { type TwilioConfig struct {
AccountSID string `json:"auth_sid"` AccountSID string `json:"auth_sid"`
ServiceSID string `json:"service_sid"` ServiceSID string `json:"service_sid"`
URI string `json:"uri"`
AuthToken string `json:"auth_token"` AuthToken string `json:"auth_token"`
Number string `json:"phone_number"` Number string `json:"phone_number"`
} }
@@ -15,6 +16,7 @@ func (config *TwilioConfig) PrintConfig() {
fmt.Println("Twilio config") fmt.Println("Twilio config")
fmt.Println("Account SID:", config.AccountSID) fmt.Println("Account SID:", config.AccountSID)
fmt.Println("Service SID:", config.ServiceSID) fmt.Println("Service SID:", config.ServiceSID)
fmt.Println("URI:", config.URI)
fmt.Println("Auth Token:", config.AuthToken) fmt.Println("Auth Token:", config.AuthToken)
fmt.Println("Number:", config.Number) fmt.Println("Number:", config.Number)
} }
+3 -3
View File
@@ -5,7 +5,7 @@ import (
) )
type Message struct { type Message struct {
Id *uuid.UUID `json:"id,omitempty"` Id uuid.UUID `json:"id"`
Content string `json:"content"` Content string `json:"content,omitempty"`
UserId *uuid.UUID `json:"user_id,omitempty"` UserId uuid.UUID `json:"user_id"`
} }
+3 -3
View File
@@ -15,11 +15,11 @@ type MessageEventResponse struct {
UserId uuid.UUID `json:"user_id,omitempty"` UserId uuid.UUID `json:"user_id,omitempty"`
ContactId *uuid.UUID `json:"contact_id,omitempty"` ContactId *uuid.UUID `json:"contact_id,omitempty"`
MessageId *uuid.UUID `json:"message_id,omitempty"` MessageId *uuid.UUID `json:"message_id,omitempty"`
Status string `json:"status"` Status *string `json:"status"`
Sent time.Time `json:"sent"` Sent time.Time `json:"sent"`
} }
const ( const (
Message_Event_Response_Status_Instant = "INSTANT" Message_Event_Response_Status_Instant = "Instant"
Message_Event_Response_Status_Scheduled = "SCHEDULED" Message_Event_Response_Status_Scheduled = "Scheduled"
) )
+5 -10
View File
@@ -11,14 +11,9 @@ type Claims struct {
jwt.RegisteredClaims jwt.RegisteredClaims
} }
type LoginResult struct { type Login struct {
UserId uuid.UUID `json:"user_id"` UserId uuid.UUID `json:"user_id"`
AccessToken string `json:"access_token"` AccessToken string `json:"access_token"`
TokenType string `json:"token_type"` TokenType string `json:"token_type"`
ExpiresIn int64 `json:"expires_in"` ExpiresIn int64 `json:"expires_in"`
IssuedAt int64 `json:"issued_at"`
} }
// Alias for LoginResult
// Will be deprecated at some point
type Login = LoginResult
+2 -3
View File
@@ -7,9 +7,8 @@ import (
) )
type ServiceUser struct { type ServiceUser struct {
Id uuid.UUID `json:"id"` Id uuid.UUID `json:"id"`
// TODO: Remove the omitempty tags at a later point
Username string `json:"username,omitempty"` Username string `json:"username,omitempty"`
Passphrase string `json:"passphrase,omitempty"` Passphrase string `json:"passphrase,omitempty"`
Created time.Time `json:"created"` Created time.Time `json:"date_created"`
} }
+1 -1
View File
@@ -13,6 +13,6 @@ type User struct {
Password string `json:"password"` Password string `json:"password"`
Firstname *string `json:"first_name,omitempty"` Firstname *string `json:"first_name,omitempty"`
Lastname *string `json:"last_name,omitempty"` Lastname *string `json:"last_name,omitempty"`
Created time.Time `json:"created"` Created time.Time `json:"date_created"`
LastLogin *time.Time `json:"last_login,omitempty"` LastLogin *time.Time `json:"last_login,omitempty"`
} }