jlaupa commented on code in PR #13707:
URL: https://github.com/apache/apisix/pull/13707#discussion_r3655810639
##########
apisix/consumer.lua:
##########
@@ -309,10 +521,63 @@ end
local function filter(consumer)
- if not consumer.value or not consumer.value.plugins then
+ -- A delete arrives as a value-less event (the etcd watch sets value = nil
on
+ -- removal). Flag it so the next incremental apply reconciles removed ids
and
+ -- the deleted consumer stops authenticating on the next request.
+ if not consumer.value then
+ if cached_plugins then
+ pending_delete = true
+ has_pending = true
+ end
+ return
+ end
+
+ if not consumer.value.plugins then
return
end
plugin.set_plugins_meta_parent(consumer.value.plugins, consumer)
+
+ -- Track changed consumer for incremental rebuild
+ if cached_plugins and consumer.value.id then
+ pending_set[consumer.value.id] = consumer
Review Comment:
Fixed in d9317ba. Child credentials are now tracked per parent consumer
(`cred_by_consumer`), and when a parent changes, `apply_incremental()`
rebuilds
each of its credential-derived entries — so credential-authenticated requests
pick up the new `group_id`/labels/`custom_id` instead of stale ones. Covered
by
new test cases (the parent's consumer group is moved and the
credential-authenticated response reflects the new group).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]