Skip to content

Commit

Permalink
Merge pull request #296 from 4chain-ag/fix/bux-218-access-key-revoked-at
Browse files Browse the repository at this point in the history
fix(BUX-218): do not send access key revoked at if it is not revoked
  • Loading branch information
mrz1836 authored Sep 8, 2023
2 parents a7d34e1 + 58da7b6 commit 6a01236
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion go.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion mappings/access_keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
package mappings

import (
"time"

"github.com/BuxOrg/bux"
buxmodels "github.com/BuxOrg/bux-models"
"github.com/BuxOrg/bux-server/mappings/common"
Expand All @@ -13,11 +15,16 @@ func MapToAccessKeyContract(ac *bux.AccessKey) *buxmodels.AccessKey {
return nil
}

var revokedAt *time.Time
if !ac.RevokedAt.IsZero() {
revokedAt = &ac.RevokedAt.Time
}

return &buxmodels.AccessKey{
Model: *common.MapToContract(&ac.Model),
ID: ac.ID,
XpubID: ac.XpubID,
RevokedAt: ac.RevokedAt.Time,
RevokedAt: revokedAt,
Key: ac.Key,
}
}

0 comments on commit 6a01236

Please sign in to comment.