auth

package
v0.0.0-...-161c778 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2024 License: MIT Imports: 6 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL