- 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/openapi/events.go
- Updated the description of the Events HTTP API method to clarify that it uses a standard NIP-01 filter and returns events as a JSON array of event objects.
- 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
- Added `Export` method in `database/database.go` to export events to an io.Writer
- Implemented detailed logic for exporting all or specific pubkeys' events
- Removed placeholder `Export` function with TODO comment from `database/database.go`
- Updated error handling in `handleReq.go` and `publisher.go` by using `err != nil` instead of `chk.E(err)`
- Added more detailed logging in privilege check conditions in both `publisher.go` and `handleReq.go`
- Introduced new imports such as `"fmt"` in `connection.go` for improved error message formatting
- Created a new file `export.go` under the `database` package with complete implementation of export functionality
- Updated `handleMessage.go` to include the real remote address in the log message when a message is received
- Removed `regexp` import and `NIP20prefixmatcher` variable from `publisher.go`
- Modified `server.go` to remove an unused parameter from the `AddEvent` method
- Added `NIP20prefixmatcher` variable and used it for checking error messages in `addEvent.go`