Add token ID to request log data
This commit is contained in:
@@ -31,7 +31,7 @@ type Application struct {
|
|||||||
ShortDescription string `bson:"shortDescription" json:"shortDescription"`
|
ShortDescription string `bson:"shortDescription" json:"shortDescription"`
|
||||||
User string `bson:"user" json:"user"`
|
User string `bson:"user" json:"user"`
|
||||||
Token string `bson:"token" json:"token"`
|
Token string `bson:"token" json:"token"`
|
||||||
TotalRequests uint64 `bson:"totalRequests" json:"totalRequests"`
|
RequestCount uint64 `bson:"requestCount" json:"requestCount"`
|
||||||
CreatedAt time.Time `bson:"createdAt" json:"createdAt"`
|
CreatedAt time.Time `bson:"createdAt" json:"createdAt"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ type Token struct {
|
|||||||
ID string `bson:"_id" json:"id"`
|
ID string `bson:"_id" json:"id"`
|
||||||
Name string `bson:"name" json:"name"`
|
Name string `bson:"name" json:"name"`
|
||||||
Token string `bson:"token" json:"token"`
|
Token string `bson:"token" json:"token"`
|
||||||
TotalRequests uint64 `bson:"totalRequests" json:"totalRequests"`
|
RequestCount uint64 `bson:"requestCount" json:"requestCount"`
|
||||||
Application string `bson:"application" json:"application"`
|
Application string `bson:"application" json:"application"`
|
||||||
CreatedAt time.Time `bson:"createdAt" json:"createdAt"`
|
CreatedAt time.Time `bson:"createdAt" json:"createdAt"`
|
||||||
LastUsedAt time.Time `bson:"lastUsedAt" json:"lastUsedAt"`
|
LastUsedAt time.Time `bson:"lastUsedAt" json:"lastUsedAt"`
|
||||||
|
|||||||
@@ -330,6 +330,7 @@ func Authenticate(ctx *fiber.Ctx) (bool, error) {
|
|||||||
bson.M{
|
bson.M{
|
||||||
"application": token.Application,
|
"application": token.Application,
|
||||||
"timestamp": GetStartOfHour(),
|
"timestamp": GetStartOfHour(),
|
||||||
|
"token": token.ID,
|
||||||
},
|
},
|
||||||
bson.M{
|
bson.M{
|
||||||
"$setOnInsert": bson.M{
|
"$setOnInsert": bson.M{
|
||||||
|
|||||||
Reference in New Issue
Block a user