Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
feat: adds string definitions - errors and authentication consts
Browse files Browse the repository at this point in the history
  • Loading branch information
wregulski committed Jul 7, 2023
1 parent d6564fa commit d402c76
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
26 changes: 26 additions & 0 deletions authentication.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package buxmodels

import "time"

const (
// AuthHeader is the header to use for authentication (raw xPub)
AuthHeader = "bux-auth-xpub"

// AuthAccessKey is the header to use for access key authentication (access public key)
AuthAccessKey = "bux-auth-key"

// AuthSignature is the given signature (body + timestamp)
AuthSignature = "bux-auth-signature"

// AuthHeaderHash hash of the body coming from the request
AuthHeaderHash = "bux-auth-hash"

// AuthHeaderNonce random nonce for the request
AuthHeaderNonce = "bux-auth-nonce"

// AuthHeaderTime the time of the request, only valid for 30 seconds
AuthHeaderTime = "bux-auth-time"

// AuthSignatureTTL is the max TTL for a signature to be valid
AuthSignatureTTL = 20 * time.Second
)
7 changes: 7 additions & 0 deletions errors_def.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package buxmodels

import "errors"

var ErrDraftNotFound = errors.New("corresponding draft transaction not found")

var ErrMissingXPriv = errors.New("missing xPriv key")

0 comments on commit d402c76

Please sign in to comment.