MCPcopy Create free account
hub / github.com/chanify/chanify / parseToken

Method parseToken

core/utils.go:73–82  ·  view source on GitHub ↗
(token string)

Source from the content-addressed store, hash-verified

71}
72
73func (c *Core) parseToken(token string) (*model.Token, error) {
74 tk, err := model.ParseToken(token)
75 if err != nil {
76 return nil, err
77 }
78 if !c.logic.VerifyToken(tk) {
79 return nil, model.ErrInvalidToken
80 }
81 return tk, nil
82}
83
84func getToken(ctx *gin.Context) string {
85 token := ctx.GetHeader("token")

Callers 11

handleImageDownloadMethod · 0.95
handleAudioDownloadMethod · 0.95
handleFileDownloadMethod · 0.95
handleSenderMethod · 0.95
handlePostSenderMethod · 0.95
ParseJSONMethod · 0.80
ParseFormMethod · 0.80
ParseFormDataMethod · 0.80
TestGetTokenFunction · 0.80
TestLuaContextSendFunction · 0.80
luaContextSendFunction · 0.80

Calls 2

ParseTokenFunction · 0.92
VerifyTokenMethod · 0.80

Tested by 2

TestGetTokenFunction · 0.64
TestLuaContextSendFunction · 0.64