Documentation
¶
Index ¶
- Constants
- func SendErrorJSON(w http.ResponseWriter, r *http.Request, l logger.Backend, code int, err error, ...)
- type SSLConfig
- type Server
- func (s *Server) BasicAuthCheckerFn(user, password string) (bool, token.User, error)
- func (s *Server) Check(user, password string) (ok bool, err error)
- func (s *Server) ClaimUpdateFn(claims token.Claims) token.Claims
- func (s *Server) Run(ctx context.Context) error
- func (s *Server) Shutdown()
- func (s *Server) Validate(_ string, claims token.Claims) bool
Constants ¶
View Source
const ( // SSLNone defines to run http server only SSLNone sslMode = iota // SSLStatic defines to run both https and http server. Redirect http to https SSLStatic // SSLAuto defines to run both https and http server. Redirect http to https. Https server with autocert support SSLAuto )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SSLConfig ¶
type SSLConfig struct {
SSLMode sslMode
Cert string
Key string
ACMELocation string
ACMEEmail string
FQDNs []string
Port int // allow user define custom port for secure connection
RedirHTTPPort int
}
SSLConfig holds all ssl params for rest server
type Server ¶
type Server struct {
Hostname string
Listen string // listen on host:port scope
Port int // main service port, default 80 on
SSLConfig SSLConfig
Authenticator *auth.Service // portal access authenticator
AccessLog io.Writer // access logger
L log.L // system logger
Storage engine.Interface // main storage instance interface
RegistryService registryInterface // main instance for connection to registry service
GarbageCollectorInterval int64
WebContentFS *embed.FS
// contains filtered or unexported fields
}
Server the main service instance
func (*Server) BasicAuthCheckerFn ¶
BasicAuthCheckerFn will be checking credentials with basic authenticate method
func (*Server) Check ¶
Check will be checking user credentials with OAuth method It's method pass when add auth local provider
func (*Server) ClaimUpdateFn ¶
ClaimUpdateFn will either add or update token extra data with token claims it call when new token or refresh
Click to show internal directories.
Click to hide internal directories.