From 4aae3704e7a1f93d7112d2cc68d273145d7daf79 Mon Sep 17 00:00:00 2001 From: mklee Date: Tue, 19 Aug 2025 07:14:59 +0900 Subject: [PATCH 1/3] =?UTF-8?q?ct=20int64=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- session/common.go | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/session/common.go b/session/common.go index 745d979..901a68d 100644 --- a/session/common.go +++ b/session/common.go @@ -6,6 +6,7 @@ import ( "encoding/hex" "errors" "math/rand" + "strconv" "strings" "time" @@ -17,21 +18,20 @@ type Authorization struct { invalidated string // by authorization provider - Platform string `bson:"p" json:"p"` - Uid string `bson:"u" json:"u"` - Alias string `bson:"al" json:"al"` - CreatedTime primitive.DateTime `bson:"ct" json:"ct"` + Platform string `bson:"p" json:"p"` + Uid string `bson:"u" json:"u"` + Alias string `bson:"al" json:"al"` + CreatedTime int64 `bson:"ct" json:"ct"` } func (auth *Authorization) ToStrings() []string { - ct, _ := auth.CreatedTime.MarshalJSON() return []string{ "a", auth.Account.Hex(), "p", auth.Platform, "u", auth.Uid, "al", auth.Alias, "inv", auth.invalidated, - "ct", string(ct), + "ct", strconv.FormatInt(auth.CreatedTime, 10), } } @@ -41,15 +41,14 @@ func (auth *Authorization) Valid() bool { func MakeAuthrizationFromStringMap(src map[string]string) Authorization { accid, _ := primitive.ObjectIDFromHex(src["a"]) - var datetime primitive.DateTime - datetime.UnmarshalJSON([]byte(src["ct"])) + ct, _ := strconv.ParseInt(src["ct"], 10, 0) return Authorization{ Account: accid, Platform: src["p"], Uid: src["u"], Alias: src["al"], invalidated: src["inv"], - CreatedTime: datetime, + CreatedTime: ct, } } From 887a28aef59caec2c01d571b168fd28e31f5fa2b Mon Sep 17 00:00:00 2001 From: mklee Date: Tue, 19 Aug 2025 07:18:17 +0900 Subject: [PATCH 2/3] =?UTF-8?q?Revert=20"ct=20int64=EB=A1=9C=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4aae3704e7a1f93d7112d2cc68d273145d7daf79. --- session/common.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/session/common.go b/session/common.go index 901a68d..745d979 100644 --- a/session/common.go +++ b/session/common.go @@ -6,7 +6,6 @@ import ( "encoding/hex" "errors" "math/rand" - "strconv" "strings" "time" @@ -18,20 +17,21 @@ type Authorization struct { invalidated string // by authorization provider - Platform string `bson:"p" json:"p"` - Uid string `bson:"u" json:"u"` - Alias string `bson:"al" json:"al"` - CreatedTime int64 `bson:"ct" json:"ct"` + Platform string `bson:"p" json:"p"` + Uid string `bson:"u" json:"u"` + Alias string `bson:"al" json:"al"` + CreatedTime primitive.DateTime `bson:"ct" json:"ct"` } func (auth *Authorization) ToStrings() []string { + ct, _ := auth.CreatedTime.MarshalJSON() return []string{ "a", auth.Account.Hex(), "p", auth.Platform, "u", auth.Uid, "al", auth.Alias, "inv", auth.invalidated, - "ct", strconv.FormatInt(auth.CreatedTime, 10), + "ct", string(ct), } } @@ -41,14 +41,15 @@ func (auth *Authorization) Valid() bool { func MakeAuthrizationFromStringMap(src map[string]string) Authorization { accid, _ := primitive.ObjectIDFromHex(src["a"]) - ct, _ := strconv.ParseInt(src["ct"], 10, 0) + var datetime primitive.DateTime + datetime.UnmarshalJSON([]byte(src["ct"])) return Authorization{ Account: accid, Platform: src["p"], Uid: src["u"], Alias: src["al"], invalidated: src["inv"], - CreatedTime: ct, + CreatedTime: datetime, } } From 8e691a4174a822d5d35938b0e17fc6b1fbf28585 Mon Sep 17 00:00:00 2001 From: mklee Date: Tue, 19 Aug 2025 08:23:07 +0900 Subject: [PATCH 3/3] =?UTF-8?q?ct=20int64=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- session/common.go | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/session/common.go b/session/common.go index 745d979..901a68d 100644 --- a/session/common.go +++ b/session/common.go @@ -6,6 +6,7 @@ import ( "encoding/hex" "errors" "math/rand" + "strconv" "strings" "time" @@ -17,21 +18,20 @@ type Authorization struct { invalidated string // by authorization provider - Platform string `bson:"p" json:"p"` - Uid string `bson:"u" json:"u"` - Alias string `bson:"al" json:"al"` - CreatedTime primitive.DateTime `bson:"ct" json:"ct"` + Platform string `bson:"p" json:"p"` + Uid string `bson:"u" json:"u"` + Alias string `bson:"al" json:"al"` + CreatedTime int64 `bson:"ct" json:"ct"` } func (auth *Authorization) ToStrings() []string { - ct, _ := auth.CreatedTime.MarshalJSON() return []string{ "a", auth.Account.Hex(), "p", auth.Platform, "u", auth.Uid, "al", auth.Alias, "inv", auth.invalidated, - "ct", string(ct), + "ct", strconv.FormatInt(auth.CreatedTime, 10), } } @@ -41,15 +41,14 @@ func (auth *Authorization) Valid() bool { func MakeAuthrizationFromStringMap(src map[string]string) Authorization { accid, _ := primitive.ObjectIDFromHex(src["a"]) - var datetime primitive.DateTime - datetime.UnmarshalJSON([]byte(src["ct"])) + ct, _ := strconv.ParseInt(src["ct"], 10, 0) return Authorization{ Account: accid, Platform: src["p"], Uid: src["u"], Alias: src["al"], invalidated: src["inv"], - CreatedTime: datetime, + CreatedTime: ct, } }