MCPcopy Create free account
hub / github.com/wavetermdev/waveterm / ExtractUnverifiedRpcContext

Function ExtractUnverifiedRpcContext

pkg/wshutil/wshutil.go:360–370  ·  view source on GitHub ↗

only for use on client

(tokenStr string)

Source from the content-addressed store, hash-verified

358
359// only for use on client
360func ExtractUnverifiedRpcContext(tokenStr string) (*wshrpc.RpcContext, error) {
361 token, _, err := new(jwt.Parser).ParseUnverified(tokenStr, &wavejwt.WaveJwtClaims{})
362 if err != nil {
363 return nil, fmt.Errorf("error parsing token: %w", err)
364 }
365 claims, ok := token.Claims.(*wavejwt.WaveJwtClaims)
366 if !ok {
367 return nil, fmt.Errorf("error getting claims from token")
368 }
369 return claimsToRpcCtx(claims), nil
370}
371
372// only for use on client
373func ExtractUnverifiedSocketName(tokenStr string) (string, error) {

Callers 2

ConnectMethod · 0.92
setupRpcClientFunction · 0.92

Calls 1

claimsToRpcCtxFunction · 0.85

Tested by

no test coverage detected