1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-18 00:20:57 +03:00
Commit Graph

276 Commits

Author SHA1 Message Date
e6e2cead66 feat: remove global handlers and enable push notifications by default
- Remove all global push notification handler functionality
- Simplify registry to support only single handler per notification type
- Enable push notifications by default for RESP3 connections
- Update comprehensive test suite to remove global handler tests
- Update demo to show multiple specific handlers instead of global handlers
- Always respect custom processors regardless of PushNotifications flag

Push notifications are now automatically enabled for RESP3 and each
notification type has a single dedicated handler for predictable behavior.
2025-06-27 01:36:17 +03:00
1ff0ded0e3 feat: enforce single handler per notification type
- Change PushNotificationRegistry to allow only one handler per command
- RegisterHandler methods now return error if handler already exists
- Update UnregisterHandler to remove handler by command only
- Update all client methods to return errors for duplicate registrations
- Update comprehensive test suite to verify single handler behavior
- Add specific test for duplicate handler error scenarios

This prevents handler conflicts and ensures predictable notification
routing with clear error handling for registration conflicts.
2025-06-27 01:36:15 +03:00
b02eed63b2 feat: add general push notification system
- Add PushNotificationRegistry for managing notification handlers
- Add PushNotificationProcessor for processing RESP3 push notifications
- Add client methods for registering push notification handlers
- Add PubSub integration for handling generic push notifications
- Add comprehensive test suite with 100% coverage
- Add push notification demo example

This system allows handling any arbitrary RESP3 push notification
with registered handlers, not just specific notification types.
2025-06-27 01:36:08 +03:00
82b00cc520 chore: remove a redundant method (#3401)
Signed-off-by: fukua95 <fukua95@gmail.com>
Co-authored-by: Nedyalko Dyakov <1547186+ndyakov@users.noreply.github.com>
2025-06-16 16:55:23 +03:00
86d418f940 feat: Introducing StreamingCredentialsProvider for token based authentication (#3320)
* wip

* update documentation

* add streamingcredentialsprovider in options

* fix: put back option in pool creation

* add package level comment

* Initial re authentication implementation

Introduces the StreamingCredentialsProvider as the CredentialsProvider
with the highest priority.

TODO: needs to be tested

* Change function type name

Change CancelProviderFunc to UnsubscribeFunc

* add tests

* fix race in tests

* fix example tests

* wip, hooks refactor

* fix build

* update README.md

* update wordlist

* update README.md

* refactor(auth): early returns in cred listener

* fix(doctest): simulate some delay

* feat(conn): add close hook on conn

* fix(tests): simulate start/stop in mock credentials provider

* fix(auth): don't double close the conn

* docs(README): mark streaming credentials provider as experimental

* fix(auth): streamline auth err proccess

* fix(auth): check err on close conn

* chore(entraid): use the repo under redis org
2025-05-27 16:25:20 +03:00
28a3c97409 chore: set the default value for the options.protocol in the init() of options (#3387)
* chore: set the default value for the `options.protocol` in the `init()` of `options`

Signed-off-by: fukua95 <fukua95@gmail.com>

* add a test

Signed-off-by: fukua95 <fukua95@gmail.com>

---------

Signed-off-by: fukua95 <fukua95@gmail.com>
2025-05-27 14:53:41 +03:00
d54e848055 feat(options): panic when options are nil (#3363)
Client creation should panic when options are nil.
2025-04-30 09:33:40 +03:00
d236865b0c fix: handle network error on SETINFO (#3295) (CVE-2025-29923)
* fix: handle network error on SETINFO

This fix addresses potential out of order responses as described in `CVE-2025-29923`

* fix: deprecate DisableIndentity and introduce DisableIdentity

Both options will work before V10. In v10 DisableIndentity will be dropped. The preferred flag to use is `DisableIdentity`.
2025-03-19 19:02:36 +02:00
1c9309fdc2 Set client name in HELLO RESP handshake (#3294) 2025-03-13 14:55:28 +02:00
9db1286414 Reinstate read-only lock on hooks access in dialHook (#3225) 2025-02-11 17:50:31 +02:00
080e051124 Eliminate redundant dial mutex causing unbounded connection queue contention (#3088)
* Eliminate redundant dial mutex causing unbounded connection queue contention

* Dialer connection timeouts unit test

---------

Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
2024-11-20 13:38:06 +02:00
04005cbdc7 Support Resp 3 Redis Search Unstable Mode (#3098)
* Updated module version that points to retracted package version (#3074)

* Updated module version that points to retracted package version

* Updated testing image to latest

* support raw parsing for problematic Redis Search types

* Add UnstableResp3SearchModule to client options

* Add tests for Resp3 Search unstable mode

* Add tests for Resp3 Search unstable mode

* Add readme note

* Add words to spellcheck

* Add UnstableResp3SearchModule check to assertStableCommand

* Fix assertStableCommand logic

* remove go.mod changes

* Check panic occur on tests

* rename method

* update errors

* Rename flag to UnstableResp3

---------

Co-authored-by: Vladyslav Vildanov <117659936+vladvildanov@users.noreply.github.com>
Co-authored-by: vladvildanov <divinez122@outlook.com>
2024-09-12 11:26:10 +03:00
2d8fa02ac2 fix: fix #2681 (#2998)
Signed-off-by: monkey92t <golang@88.com>
2024-05-29 10:55:28 +08:00
5da49b1aba bug: Fix SETINFO ensuring it is set-and-forget (#2915)
* Exexcute set-info without validation

* Fix tests

* Remove spaces from runtime.Version

* fix typo

* Send setinfo after auth

* Add pipline

* fix golangci

* revert fixing typo

* support sentinel
2024-02-20 17:34:35 +02:00
35de49a8da Speed up connections by sending SetInfo via a pipeline (#2880)
* Send Client SetInfo via pipe

* Fix ACL test

* Add client set info to acl command rules
2024-02-15 12:48:56 +02:00
21ed15bbed Add helpers to set libinfo without panic (#2724)
* add helpers to set library name and library info without risk of panic if we try to set both

* refactor code to use helpers

* add example

* refactor tests

* fix testable example

* simplify example

* rename exampl

* fix ring.go

* update example

---------

Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
2024-02-14 22:40:20 +02:00
a32be3d93d Add Suffix support to default client set info (#2852)
* Add Suffix support to defualt client set info

* Change ClientNameSuffix to IdentitySuffix

* add tests
2024-01-04 14:40:14 +02:00
a109302230 fix: #2730 data race at hooksMixin (#2814) 2023-12-10 12:04:13 +02:00
0b6be62b71 Identify client on connect (#2708)
* Update CLIENT-SETINFO to support suffixes

* Update CLIENT-SETINFO

* fix acl log test

* add setinfo option to cluster

* change to DisableIndentity

* change to DisableIndentity
2023-09-20 10:33:09 +03:00
391798880c feat: add protocol option (#2598) 2023-05-16 22:02:22 +08:00
7b4f2179cb feat: no longer verify HELLO error messages (#2515)
Signed-off-by: monkey92t <golang@88.com>
2023-04-12 20:35:32 +08:00
30a6f7107e fixed #2462 v9 continue support dragonfly, it's Hello command return "NOAUTH Authentication required" error (#2479)
* fixed #2462 error NOAUTH and support dragonfly

* check add comment

* alignment

---------

Co-authored-by: Monkey <golang@88.com>
2023-03-10 21:21:24 +08:00
21e1954745 fix(conn): releaseConn should be executed correctly
Signed-off-by: monkey92t <golang@88.com>
2023-01-28 15:44:06 +08:00
97b491aace chore: update import path 2023-01-23 08:48:54 +02:00
767109c632 chore: cleanup names 2023-01-21 10:30:02 +02:00
a5aeb1659b docs: update hook doc
Signed-off-by: monkey <golang@88.com>
2023-01-21 00:20:50 +08:00
0ed4a4420f fix: fix the withHook func
Signed-off-by: monkey <golang@88.com>
2023-01-21 00:02:44 +08:00
97697f488f feat: hook mode is changed to FIFO
Signed-off-by: monkey <golang@88.com>
2023-01-20 23:19:49 +08:00
d42dd1007c docs: add a description of the hook
Signed-off-by: monkey92t <golang@88.com>
2023-01-07 16:30:56 +08:00
c7bc54b4d0 Merge pull request #2333 from monkey92t/fix_2312
feat: add ClientName option
2022-12-28 22:31:25 +08:00
a872c35b1a feat: add ClientName option
Signed-off-by: monkey92t <golang@88.com>
2022-12-28 22:14:52 +08:00
a4336cbd43 feat(scan): add Scanner interface (#2317)
Signed-off-by: monkey92t <golang@88.com>
2022-12-24 22:29:45 +08:00
5053db2f9c fix: wrap cmds in Conn.TxPipeline 2022-11-22 14:30:27 +02:00
d1bfaba549 fix: capture error correctly in withConn 2022-11-02 09:11:36 +00:00
2ec03d9b37 fix: late binding for dial hook 2022-10-12 15:00:06 +03:00
0dff3d1461 feat: add OpenTelemetry metrics instrumentation 2022-10-12 11:09:41 +03:00
58f7149e38 feat: add ContextTimeoutEnabled to respect context timeouts and deadlines 2022-10-11 10:22:42 +03:00
4bb485d044 fix: retry dial errors from pipelines 2022-10-11 09:38:10 +03:00
dd9a200427 fix: improve pipelines retry logic (#2232)
* fix: improve pipelines retry logic
2022-10-06 14:05:55 +03:00
b0231c659e chore: always retry write timeouts 2022-10-06 10:06:02 +03:00
6725851465 Merge pull request #2071 from ray2011/master
fix retryTimeout in baseClient _process
2022-10-06 10:05:25 +03:00
baa48a4415 feat(pubsub): support sharded pub/sub 2022-08-04 00:05:22 +08:00
e061db8c13 refactor: remove unused context attributes (#2154)
* refactor: remove unused context field
2022-07-14 13:43:42 +03:00
092a692384 refactor: remove unused context attribute from conn (#2150) 2022-07-13 08:49:28 +03:00
b6d2a92529 fix: #2114 for redis-server not support Hello
Using `strings.HasPrefix` instead of `equal`
2022-06-10 21:19:02 +08:00
4ddd7d1803 chore: remove WithContext 2022-06-05 09:58:05 +03:00
a18fad5bd3 chore: v9 2022-06-04 17:42:06 +03:00
d09c27e604 feat: upgrade to Redis 7 2022-06-04 17:25:12 +03:00
b0bb514059 fix: update COMMAND parser for Redis 7 2022-06-04 16:07:28 +03:00
0aa94538ee Merge branch 'v9' 2022-06-04 14:28:10 +03:00