Documentation
¶
Index ¶
- func CSRFInputString(ctx context.Context) string
- func CSRFInputTempl(ctx context.Context) templ.Component
- func GenerateHMACCsrfToken(sid, secret string) string
- func GetCSRFToken(ctx context.Context) string
- func VerifyHMACCsrfToken(csrfToken, sid, secret string) bool
- type Handler
- func (h *Handler) Middleware(next http.Handler) http.Handler
- func (h *Handler) Verify(r *http.Request) error
- func (h *Handler) WriteAnonymousCSRFToken(w http.ResponseWriter)
- func (h *Handler) WriteCSRFFromSID(r *http.Request, w http.ResponseWriter) string
- func (h *Handler) WriteCSRFToken(w http.ResponseWriter, sid string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CSRFInputString ¶
func GenerateHMACCsrfToken ¶
func GetCSRFToken ¶
func VerifyHMACCsrfToken ¶
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func (*Handler) WriteAnonymousCSRFToken ¶
func (h *Handler) WriteAnonymousCSRFToken( w http.ResponseWriter, )
func (*Handler) WriteCSRFFromSID ¶
func (*Handler) WriteCSRFToken ¶
func (h *Handler) WriteCSRFToken( w http.ResponseWriter, sid string, ) string
Click to show internal directories.
Click to hide internal directories.