-
Notifications
You must be signed in to change notification settings - Fork 32
[deprecated]Verify origin #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
91cc043 to
09f6242
Compare
deac0e0 to
633e502
Compare
6d8071c to
5ed00bc
Compare
|
|
||
| // newRealIPExtractor creates a new realIPExtractor with the given trusted ranges. | ||
| func newRealIPExtractor(trustedRanges []string) (*realIPExtractor, error) { | ||
| ipNets, err := realclientip.AddressesAndRangesToIPNets(trustedRanges...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add trusted connection address check
handler.go
Outdated
| storage db | ||
| _eventIDs int64 | ||
| heartbeatInterval time.Duration | ||
| connectCache *LRUCache |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rewrite LRU cache to not have duplicates, instead it should store sessions in a way that we can easily get all sessions for given client_id
clients, _ := connectCache.getAllSessions(client_id)
| userAgent := c.Request().Header.Get("User-Agent") | ||
|
|
||
| // Support new JSON POST format; fallback to legacy query params for backward compatibility | ||
| var req verifyRequest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move support to the separate PR?
|
|
||
| } | ||
|
|
||
| func (h *handler) ConnectVerifyHandler(c echo.Context) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to check whether the ip (maybe origin and user agent as well) are not empty or some sort of placeholders.
No description provided.