Skip to content

Commit

Permalink
KeyExpired event fires properly on key expiry
Browse files Browse the repository at this point in the history
  • Loading branch information
joshblakeley authored and buger committed Mar 23, 2018
1 parent 72e710e commit 99c2f23
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mw_key_expired_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ func (k *KeyExpired) ProcessRequest(w http.ResponseWriter, r *http.Request, _ in
}
logEntry.Info("Attempted access from expired key.")

k.FireEvent(EventKeyExpired, EventKeyFailureMeta{
EventMetaDefault: EventMetaDefault{Message: "Attempted access from expired key.", OriginatingRequest: EncodeRequestToEvent(r)},
Path: r.URL.Path,
Origin: request.RealIP(r),
Key: token,
})
// Report in health check
reportHealthValue(k.Spec, KeyFailure, "-1")

Expand Down

0 comments on commit 99c2f23

Please sign in to comment.