Skip to content

Conversation

@callmedenchick
Copy link
Contributor

No description provided.

@callmedenchick callmedenchick force-pushed the origin-ip-verifier branch 2 times, most recently from 91cc043 to 09f6242 Compare August 28, 2025 08:40

// newRealIPExtractor creates a new realIPExtractor with the given trusted ranges.
func newRealIPExtractor(trustedRanges []string) (*realIPExtractor, error) {
ipNets, err := realclientip.AddressesAndRangesToIPNets(trustedRanges...)
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor Author

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 {
Copy link
Contributor Author

@callmedenchick callmedenchick Sep 1, 2025

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.

@callmedenchick callmedenchick marked this pull request as draft September 10, 2025 13:07
@callmedenchick callmedenchick changed the title Verify origin [deprecated]Verify origin Sep 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants