MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / CreateTokenStorage

Method CreateTokenStorage

internal/auth/kimi/kimi.go:78–92  ·  view source on GitHub ↗

CreateTokenStorage creates a new KimiTokenStorage from auth bundle.

(bundle *KimiAuthBundle)

Source from the content-addressed store, hash-verified

76
77// CreateTokenStorage creates a new KimiTokenStorage from auth bundle.
78func (k *KimiAuth) CreateTokenStorage(bundle *KimiAuthBundle) *KimiTokenStorage {
79 expired := ""
80 if bundle.TokenData.ExpiresAt > 0 {
81 expired = time.Unix(bundle.TokenData.ExpiresAt, 0).UTC().Format(time.RFC3339)
82 }
83 return &KimiTokenStorage{
84 AccessToken: bundle.TokenData.AccessToken,
85 RefreshToken: bundle.TokenData.RefreshToken,
86 TokenType: bundle.TokenData.TokenType,
87 Scope: bundle.TokenData.Scope,
88 DeviceID: strings.TrimSpace(bundle.DeviceID),
89 Expired: expired,
90 Type: "kimi",
91 }
92}
93
94// DeviceFlowClient handles the OAuth2 device flow for Kimi.
95type DeviceFlowClient struct {

Callers 2

RequestKimiTokenMethod · 0.95
LoginMethod · 0.95

Calls 1

FormatMethod · 0.80

Tested by

no test coverage detected