mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-07 03:48:17 +02:00
use x-forwarded-for to get client ip
This commit is contained in:
parent
dda4a878bc
commit
9ba7ead459
2 changed files with 17 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
package authenticate
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"net/url"
|
||||
|
||||
|
@ -61,7 +62,8 @@ func (a *Authenticate) logAuthenticateEvent(r *http.Request, profile *identity.P
|
|||
log.Warn(ctx).Err(err).Msg("log authenticate event: failed to decrypt request params")
|
||||
}
|
||||
|
||||
evt := log.Info(ctx).
|
||||
evt := log.Info(context.Background()).
|
||||
Str("ip", httputil.GetClientIP(r)).
|
||||
Str("pomerium_version", params.Get(urlutil.QueryVersion)).
|
||||
Str("pomerium_request_uuid", params.Get(urlutil.QueryRequestUUID)).
|
||||
Str("pomerium_pub", pub.String())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue