mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-03 01:41:44 +00:00
27 lines
468 B
Go
27 lines
468 B
Go
package auth
|
|||
|
|
|
||
|
|
import (
|
||
|
|
"github.com/labstack/echo/v4"
|
||
|
|
)
|
||
|
|
|
||
|
|
type Option func(c *UCANConfig)
|
||
|
|
|
||
|
|
func WithSkipper(skipper func(c echo.Context) bool) Option {
|
||
|
|
return func(c *UCANConfig) {
|
||
|
|
c.Skipper = skipper
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
func WithAuthScheme(scheme string) Option {
|
||
|
|
return func(c *UCANConfig) {
|
||
|
|
c.AuthScheme = scheme
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
// WithTokenLookup sets the token lookup strategy
|
||
|
|
func WithTokenLookup(lookup string) Option {
|
||
|
|
return func(c *UCANConfig) {
|
||
|
|
c.TokenLookup = lookup
|
||
|
|
}
|
||
|
|
}
|