Documentation ¶
Index ¶
- Constants
- Variables
- func AddStdIdentityProvider(provider IdentityProvider, aCfg *config.Auth) (err error)
- func Hash(p []byte, salt []byte) []byte
- type Handler
- type Handlers
- func (hh *Handlers) Add(ah Handler) (err error)
- func (hh *Handlers) Check(id uint64, prefix string, path string, permissions misc.BoolMap, ...) (identity *Identity, code int, msg string)
- func (hh *Handlers) Enabled() bool
- func (hh *Handlers) WriteAuthRequestHeaders(w http.ResponseWriter, prefix string, path string)
- type Identity
- type IdentityProvider
- type LocalIdentityProvider
Constants ¶
View Source
const (
// HTTP заголовок
Header = "Authorization"
)
View Source
const LocalIdentityType = "LocalIdentity"
Variables ¶
View Source
var ( // Log -- Log = log.NewFacility("stdhttp.auth") )
Functions ¶
func AddStdIdentityProvider ¶ added in v0.1.4
func AddStdIdentityProvider(provider IdentityProvider, aCfg *config.Auth) (err error)
Types ¶
type Handler ¶
type Handler interface { Init(lCfg *config.Listener) error Enabled() bool Score() int WWWAuthHeader() (name string, withRealm bool) Check(id uint64, prefix string, path string, w http.ResponseWriter, r *http.Request) (identity *Identity, tryNext bool, err error) }
Handler --
type Handlers ¶
type Handlers struct {
// contains filtered or unexported fields
}
Handlers --
func (*Handlers) Check ¶
func (hh *Handlers) Check(id uint64, prefix string, path string, permissions misc.BoolMap, w http.ResponseWriter, r *http.Request) (identity *Identity, code int, msg string)
Check --
func (*Handlers) WriteAuthRequestHeaders ¶
func (hh *Handlers) WriteAuthRequestHeaders(w http.ResponseWriter, prefix string, path string)
WriteAuthRequestHeaders --
type Identity ¶
type Identity struct { Method string User string UserID uint64 UserGUID string Groups []string Type string IsAdmin bool Extra any }
Identity --
func StdCheckUser ¶ added in v0.1.4
func StdGetIdentity ¶ added in v0.1.4
type IdentityProvider ¶ added in v0.1.4
type LocalIdentityProvider ¶ added in v0.1.4
type LocalIdentityProvider struct {
// contains filtered or unexported fields
}
func (*LocalIdentityProvider) GetIdentity ¶ added in v0.1.4
func (provider *LocalIdentityProvider) GetIdentity(u string) (identity *Identity, err error)
Click to show internal directories.
Click to hide internal directories.