Documentation ¶
Overview ¶
Package middleware handles authentication, user permissions, and any other tasks that occur with an HTTP request to this app.
Index ¶
- func Administrator(next http.Handler) http.Handler
- func Auth(next http.Handler) http.Handler
- func CreateLicenses(next http.Handler) http.Handler
- func ExternalAPI(next http.Handler) http.Handler
- func LogActivity2(next http.Handler) http.Handler
- func SecHeaders(next http.Handler) http.Handler
- func ViewLicenses(next http.Handler) http.Handler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Administrator ¶
Administrator checks if the user has this permission.
func Auth ¶
Auth is used to verify a request to this app is authenticated via a user profile. API authentications are handled via middleware.ExternalAPI since api reachable endpoints are hosted on /api/v1/. If a user is found then the next middleware or handler is performed, otherwise a user is redirected to a login page.
func CreateLicenses ¶
CreateLicenses check if the user has this permission.
func ExternalAPI ¶
ExternalAPI handles authenticating access to the public endpoints using api keys.
func LogActivity2 ¶
LogActivity2 saves the activity the user performed to the database.
This adds a lot of INSERTS to the database which may be undesirable based on server load. Therefore, you can disable this via app settings.
Skip on errors since logging isn't the most important thing in the world.
func SecHeaders ¶
SecHeaders sets http headers for security purposes.
Types ¶
This section is empty.