-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.go
45 lines (38 loc) · 1.11 KB
/
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
42
43
44
45
package openxlab
import (
"encoding/json"
"github.com/golang-jwt/jwt/v5"
)
type LoginConfig struct {
AK string `json:"ak"`
SK string `json:"sk"`
JWTSecretKey string `json:"jwt_secret_key"`
}
type GetTokenResponse struct {
TraceId string `json:"traceId,omitempty"`
MsgCode string `json:"msgCode,omitempty"`
Msg string `json:"msg,omitempty"`
Data json.RawMessage `json:"data"`
Total json.RawMessage `json:"total,omitempty"`
}
type GetTokenResponseData struct {
RefreshToken string `json:"refresh_token"`
SSOUID string `json:"sso_uid"`
JWT string `json:"jwt"`
RefreshExpiration string `json:"refresh_expiration"`
Expiration string `json:"expiration"`
}
type GetAuthResponseData struct {
Nonce string `json:"nonce"`
Algorithm string `json:"algorithm"`
}
type AuthRequestBody struct {
AK string `json:"ak,omitempty"`
D string `json:"d,omitempty"`
RefreshToken string `json:"refresh_token,omitempty"`
}
type SSOJWTClaim struct {
EXP int64 `json:"exp"`
AK string `json:"ak"`
jwt.RegisteredClaims
}