Documentation
¶
Overview ¶
Package jwt implements a Hook that fails on Announce or Scrape if the client's request is missing a valid JSON Web Token.
JWTs are validated against the standard claims in RFC7519 along with an extra "infohash(es)" claim that verifies the client has access to the Swarm.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrMissingJWT is returned when a JWT is missing from a request. ErrMissingJWT = bittorrent.ClientError("request not allowed by mochi: missing jwt") // ErrInvalidJWT is returned when a JWT fails to verify. ErrInvalidJWT = bittorrent.ClientError("request not allowed by mochi: invalid jwt") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Header string Issuer string Audience string JWKSetURL string `cfg:"jwk_set_url"` JWKUpdateInterval time.Duration `cfg:"jwk_set_update_interval"` HandleAnnounce bool `cfg:"handle_announce"` HandleScrape bool `cfg:"handle_scrape"` }
Config represents all the values required by this middleware to fetch JWKs and verify JWTs.
Click to show internal directories.
Click to hide internal directories.