Skip to content

Commit efc7e9d

Browse files
Merge pull request #28 from sebdeveloper6952/bug-blob-pubkey
Bug blob pubkey
2 parents 5732006 + ef5fcf1 commit efc7e9d

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

internal/httpapi/auth_middleware.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ func nostrAuthMiddleware(action string, log *zap.Logger) gin.HandlerFunc {
6060
return
6161
}
6262

63-
// the created_at must be in the past
64-
if ev.CreatedAt.Time().Unix() > time.Now().Unix() {
63+
// the created_at must be in the past (allow 60 seconds clock skew)
64+
if ev.CreatedAt.Time().Unix() > time.Now().Unix()+60 {
6565
log.Debug("[nostrAuthMiddleware] invalid created_at")
6666
c.AbortWithStatus(http.StatusUnauthorized)
6767
return

internal/service/blob_service.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ func (r *blobService) Save(
5757
}
5858

5959
return &core.Blob{
60+
Pubkey: pubkey,
6061
Url: url,
6162
Sha256: sha256,
6263
Size: size,
@@ -122,6 +123,7 @@ func (r *blobService) DeleteFromHash(ctx context.Context, sha256 string) error {
122123
func (r *blobService) dbBlobIntoBlobDescriptor(blob db.Blob) *core.Blob {
123124
url := r.cdnBaseUrl + "/" + blob.Hash
124125
return &core.Blob{
126+
Pubkey: blob.Pubkey,
125127
Url: url,
126128
Sha256: blob.Hash,
127129
Size: blob.Size,

0 commit comments

Comments
 (0)