Commit e9ed0f2
authored
[FSSDK-12072] Integrate Redis Streams into agent (#448)
* Integrate Redis Streams and enhance CMAB with flexible authentication
This commit integrates Redis Streams for persistent notification delivery
from v4.3.0-beta.1 with the existing CMAB Redis cache support in master.
Features Added:
- Redis Streams implementation for notification synchronization with
persistent message delivery, automatic retries, consumer groups, and
configurable batching
- Flexible Redis authentication utility supporting auth_token, redis_secret,
and password fields with environment variable fallback
- Applied flexible auth pattern to all Redis clients: ODP cache, UPS,
CMAB cache, and synchronization pubsub
- Configurable CMAB prediction endpoint via config or environment variable
Changes:
- Added pkg/syncer/pubsub/redis_streams.go and comprehensive tests
- Added pkg/utils/redisauth for flexible password authentication
- Updated all Redis clients (ODP, UPS, CMAB) with UnmarshalJSON for auth
- Updated config.yaml with Redis Streams parameters and auth_token field
- Updated CHANGELOG.md with [Unreleased] section documenting new features
- Updated CI workflow to use Redis 6 and added Redis to test-coverage job
- Added docs/redis-streams.md with complete Redis Streams documentation
Configuration:
- CMAB configuration remains under client.cmab section
- Redis Streams enabled via synchronization.notification.default
- All Redis clients support auth_token, redis_secret, password fields
- Environment variables: REDIS_PASSWORD, REDIS_ODP_PASSWORD,
REDIS_UPS_PASSWORD, REDIS_CMAB_PASSWORD
Testing:
- All existing tests pass
- Added 5 new auth tests for CMAB Redis cache
- Redis Streams includes 18 comprehensive tests
- redisauth utility includes 14 tests covering all scenarios
Both features coexist without conflicts - Redis Streams uses STREAM data
type for messaging while CMAB cache uses STRING type for key-value storage.
* add autodetection of redis version
* fix alias
* Removed force_implementation config field and comments about manual override
* cleanup
* improve test coverage
* Add SSE timeout warning to config and reset notification sync to default1 parent 6632f73 commit e9ed0f2
24 files changed
Lines changed: 4541 additions & 73 deletions
File tree
- .github/workflows
- config
- docs
- pkg
- syncer
- pubsub
- utils/redisauth
- plugins
- cmabcache/services
- odpcache/services
- userprofileservice/services
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
53 | 57 | | |
54 | 58 | | |
55 | 59 | | |
| |||
111 | 115 | | |
112 | 116 | | |
113 | 117 | | |
114 | | - | |
| 118 | + | |
115 | 119 | | |
116 | 120 | | |
117 | 121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
7 | 44 | | |
8 | 45 | | |
9 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
83 | 86 | | |
84 | 87 | | |
85 | 88 | | |
| |||
285 | 288 | | |
286 | 289 | | |
287 | 290 | | |
288 | | - | |
289 | | - | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
290 | 296 | | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
295 | 312 | | |
296 | 313 | | |
297 | 314 | | |
298 | 315 | | |
| 316 | + | |
299 | 317 | | |
| 318 | + | |
300 | 319 | | |
301 | 320 | | |
302 | 321 | | |
303 | 322 | | |
| 323 | + | |
304 | 324 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
0 commit comments