mcp: authorize request (pt2) (#5586)

This commit is contained in:
Denis Mishin 2025-04-24 15:11:19 -04:00 committed by GitHub
parent 63ccf6ab93
commit 9e4947c62f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 567 additions and 6 deletions

View file

@ -2,6 +2,7 @@ package mcp
import (
"context"
"crypto/cipher"
"fmt"
"net/http"
"path"
@ -32,6 +33,7 @@ type Handler struct {
prefix string
trace oteltrace.TracerProvider
storage *Storage
cipher cipher.AEAD
}
func New(
@ -46,10 +48,16 @@ func New(
return nil, fmt.Errorf("databroker client: %w", err)
}
cipher, err := getCipher(cfg)
if err != nil {
return nil, fmt.Errorf("get cipher: %w", err)
}
return &Handler{
prefix: prefix,
trace: tracerProvider,
storage: NewStorage(client),
cipher: cipher,
}, nil
}