forked from vesselpassport/vessel-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
41 lines (34 loc) · 799 Bytes
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package vessel
import (
"math/big"
"time"
"github.com/golang-jwt/jwt"
)
type VesselClaims struct {
AttestationType string `json:"ats_type"`
AttestationData string `json:"ats_data"`
jwt.StandardClaims
}
type Web3UserSession struct {
UserID string
Scope string
CreatedAt time.Time
ExpiresAt time.Time
IsValid bool
Attestations map[string]string
}
// Web3TokenHeader - Primary JWT header describing Algorithm choice and token type
type Web3TokenHeader struct {
Algorithm string `json:"alg"`
Type string `json:"typ"`
}
type Web3TokenPayload struct {
UserX string `json:"sub"`
UserY string `json:"ecy"`
Scope string `json:"aud"`
IssuedAt int64 `json:"iat"`
ExpiresAt int64 `json:"exp"`
}
type ECDSASignature struct {
R, S *big.Int
}