Documentation ¶
Index ¶
- Constants
- Variables
- func AddUser(uInfo *UserInfo) error
- func AuthReq(server, uri, adminUser, adminPwd string, params url.Values) error
- func DelAuthCache(username string)
- func GetAuthCache(username string) (string, bool)
- func GetDB() *database.DB
- func HasDB() bool
- func HashPasswd(user, realm, passwd string) string
- func InitDB(dbFile string)
- func ResetPwd(username, passwd string) error
- func UpdateAuthCache(username, token string)
- type DigestAuth
- type IgnoreAuth
- type Prefix
- type UserInfo
Constants ¶
View Source
const ( USER_KIND_ADMIN = 1 USER_KIND_COMMON = 2 )
View Source
const (
REALM = "mdoc"
)
Variables ¶
Functions ¶
func DelAuthCache ¶
func DelAuthCache(username string)
func GetAuthCache ¶
func HashPasswd ¶
func UpdateAuthCache ¶
func UpdateAuthCache(username, token string)
Types ¶
type DigestAuth ¶
type DigestAuth struct { *httpauth.DigestAuth // contains filtered or unexported fields }
func NewDigestAuth ¶
func NewDigestAuth(realm string, plainTextSecret bool, secret httpauth.SecretProvider) *DigestAuth
About SecretProvider
plain text mode provider need return plain text, example: "hello".
hash mode provider need return H(user + ":" + realm + ":" + passwd)
type IgnoreAuth ¶
type IgnoreAuth struct {
// contains filtered or unexported fields
}
func NewIgnoreAuth ¶
func NewIgnoreAuth(prefix []Prefix) *IgnoreAuth
func ParseIgnoreAuth ¶
func ParseIgnoreAuth(data []byte) *IgnoreAuth
func (*IgnoreAuth) Match ¶
func (n *IgnoreAuth) Match(path string) bool
Click to show internal directories.
Click to hide internal directories.