/
types.go
41 lines (34 loc) · 947 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 jcp
import (
"github.com/google/uuid"
)
// ErrorResponse is the response for an error.
type ErrorResponse struct {
Code int `json:"code"`
Meta RequestMeta `json:"meta"`
Msg string `json:"msg"`
}
// RequestMeta is the metadata for a request.
type RequestMeta struct {
UUID uuid.UUID `json:"uuid"`
}
// ValidateArgs are the arguments for a verification request.
type ValidateArgs struct {
Aud []string `json:"aud"`
Iss []string `json:"iss"`
Sub []string `json:"sub"`
Token string `json:"token"`
}
// ValidateRequest is the request for a verification.
type ValidateRequest struct {
Args ValidateArgs `json:"args"`
}
// ValidateResponse is the response for a verification.
type ValidateResponse struct {
Results ValidateResults `json:"results"`
Meta RequestMeta `json:"meta"`
}
// ValidateResults are the results of a verification.
type ValidateResults struct {
Success bool `json:"success"`
}