MCPcopy Create free account
hub / github.com/chartmuseum/auth / NewTokenDecoder

Function NewTokenDecoder

token.go:120–130  ·  view source on GitHub ↗
(opts *TokenDecoderOptions)

Source from the content-addressed store, hash-verified

118}
119
120func NewTokenDecoder(opts *TokenDecoderOptions) (*TokenDecoder, error) {
121 publicKey, err := generatePublicKey(opts.PublicKeyPath, opts.PublicKey)
122 if err != nil {
123 return nil, err
124 }
125
126 tokenDecoder := TokenDecoder{
127 PublicKey: publicKey,
128 }
129 return &tokenDecoder, nil
130}
131
132func (tokenDecoder *TokenDecoder) DecodeToken(signedString string) (*jwt.Token, error) {
133 return jwt.Parse(signedString, func(token *jwt.Token) (interface{}, error) {

Callers 4

TestGenerateTokenMethod · 0.85
NewAuthorizerFunction · 0.85

Calls 1

generatePublicKeyFunction · 0.85

Used in the wild real call sites across dependent graphs

searching dependent graphs…