Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsRequestAuthenticated ¶
func IsRequestAuthenticated(users []rules.User, hashing string, r *http.Request) (ok bool, err error)
IsRequestAuthenticated checks if the request is authenticated based on the provided list of users, hashing algorithm, and the request's basic authentication credentials. If the list of users is empty, the request is considered authenticated. If the request is missing basic authentication credentials, the request is considered unauthenticated. For each user in the list, the request password is hashed using the specified algorithm and compared with the user's stored password. If a matching user and password is found, the request is considered authenticated. Returns a boolean indicating if the request is authenticated and any error that occurred during the authentication process.
Types ¶
This section is empty.