Add ability to set authenticated user in request header (#889)

* Add ability to set authenticated user in request header

Some web applications provide the ability to authorize users based on
the authenticated from Basic Auth. This patch provides a way to set a
key to which the authenticated user can be set in the Header.

For example, if I set `HeaderValue = "X-WebAuth-User"` and authenticate,
my application will be able to read my user name from that header and
provide me with the proper access.

This fixes #802
This commit is contained in:
Ian 2016-12-16 07:42:51 -08:00 committed by Emile Vauge
parent 913a297e8d
commit 94bb7a1435
4 changed files with 59 additions and 3 deletions

View file

@ -222,8 +222,9 @@ type Cluster struct {
// Auth holds authentication configuration (BASIC, DIGEST, users)
type Auth struct {
Basic *Basic
Digest *Digest
Basic *Basic
Digest *Digest
HeaderField string
}
// Users authentication users