- pkg/protocol/socketapi/handleAuth.go
- Added import for "orly.dev/pkg/utils/iptracker"
- Added logic to call iptracker.Global.Authenticate() on successful authentication
- pkg/protocol/openapi/event.go
- Added logic to call iptracker.Global.Authenticate() on successful authentication
- pkg/utils/iptracker/iptracker.go
- Introduced offense tracking and block duration calculation based on offense count
- Added Authenticate method to remove blocks upon successful authentication
- Modified isBlockedNoLock to always return true when an IP is blocked
- Added HasBlockDurationPassed, GetBlockDuration, and Reset methods
- pkg/version/version
- Bumped version number from v0.4.4 to v0.4.5
- pkg/protocol/socketapi/socketapi.go
- Added import for "orly.dev/pkg/utils/iptracker"
- Added logic to check if an IP is blocked and reject the connection if it is
- pkg/protocol/socketapi/handleEvent.go
- Added imports for "orly.dev/pkg/utils/iptracker" and "time"
- Added logic to check if an IP is blocked, send a notice to the client, and close the connection if it is
- Added logic to record failed authentication attempts and block IPs that exceed the threshold
- pkg/protocol/openapi/event.go
- Added imports for "orly.dev/pkg/utils/iptracker" and "time"
- Added logic to check if an IP is blocked and return a forbidden error if it is
- Added logic to record failed authentication attempts and return appropriate errors based on whether the IP is blocked or not
- pkg/utils/iptracker/iptracker.go
- Created new package with functionality to track and block IPs based on failed authentication attempts
- pkg/version/version
- Bumped version number from v0.4.3 to v0.4.4
- pkg/app/relay/server-publish.go
- Added log statement for saved events
- pkg/app/relay/addEvent.go
- Added support for multiple pubkeys
- Modified logic to skip sending events back to replicas that already received them
- Added header with pubkeys to prevent unnecessary resending
- pkg/protocol/openapi/event.go
- Added parsing of X-Pubkeys header to avoid resending events
- Updated AddEvent call to use pubkeys parameter
- pkg/protocol/httpauth/nip98auth.go
- Removed log statement for nip-98 http auth event
- pkg/interfaces/server/server.go
- Updated AddEvent method signature to accept pubkeys instead of pubkey
- pkg/protocol/httpauth/validate.go
- Removed log statement for tolerance value
- pkg/protocol/ws/listener.go
- Removed `isAuthed` field from Listener struct
- Modified `IsAuthed()` method to check if `authedPubkey` is non-empty
- Removed `SetAuthed()` method
- pkg/encoders/event/readwriter.go
- Created new file with implementation of `MarshalWrite` and `UnmarshalRead` methods for event encoding/decoding
- pkg/protocol/openapi/events.go
- Created new file with implementation of the Events HTTP API method
- pkg/protocol/socketapi/handleReq.go
- Modified logging to display authed pubkey
- Updated comment regarding authentication status
- pkg/encoders/bytesbuf/pool.go
- Created new package for concurrent-safe buffer pool
- pkg/protocol/openapi/event.go
- Removed import of `lol` package
- Removed tracing logic around `RegisterEvent` function
- pkg/encoders/bytesbuf/pool_test.go
- Created new test file for buffer pool implementation