-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3766 from Kong/feat/new-db-plugins-daos
feat(*) port plugins entities and Admin endpoints to the new DAO
- Loading branch information
Showing
85 changed files
with
1,734 additions
and
2,279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
local singletons = require "kong.singletons" | ||
|
||
|
||
local invalidate_cache = function(self, entity) | ||
local consumer = entity.consumer | ||
if type(consumer) ~= "table" then | ||
return true | ||
end | ||
-- skip next lines in some tests where singletons is not available | ||
if not singletons.cache then | ||
return true | ||
end | ||
|
||
local cache_key = self:cache_key(consumer.id) | ||
return singletons.cache:invalidate(cache_key) | ||
end | ||
|
||
|
||
local _ACLs = {} | ||
|
||
function _ACLs:post_crud_event(operation, entity) | ||
local _, err, err_t = invalidate_cache(self, entity) | ||
if err then | ||
return nil, err, err_t | ||
end | ||
return self.super.post_crud_event(self, entity) | ||
end | ||
|
||
return _ACLs |
Oops, something went wrong.