oauth

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2026 License: MIT Imports: 26 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ProtectedResourcePath   = "/.well-known/oauth-protected-resource"
	AuthorizationServerPath = "/.well-known/oauth-authorization-server"
	RegisterPath            = "/oauth/register"
	AuthorizePath           = "/oauth/authorize"
	TokenPath               = "/oauth/token"
	RevokePath              = "/oauth/revoke"
	ResourcePath            = "/mcp"
	Scope                   = "whatsapp"
)
View Source
const (
	StaticTokenPrefix = "wmcp_"
	GrantNameExtra    = "grant_name"
)

Variables

This section is empty.

Functions

func GrantID

func GrantID(info *auth.TokenInfo) (int64, bool)

func GrantName

func GrantName(info *auth.TokenInfo) string

func HashToken

func HashToken(token string) string

func NewStaticToken

func NewStaticToken() (string, error)

func ValidateGrantName

func ValidateGrantName(name string) error

func Verifier

func Verifier(st *store.Store, clk clock.Clock) auth.TokenVerifier

Types

type Deps

type Deps struct {
	Store         *store.Store
	Clock         clock.Clock
	Audit         *audit.Logger
	Grants        GrantEvents
	PublicURL     string
	OwnerPassword string
	Log           *slog.Logger
}

type GrantEvents

type GrantEvents interface {
	GrantRevoked(grantID int64)
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(deps Deps) *Server

func (*Server) Register

func (s *Server) Register(mux *http.ServeMux)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL