Skip to content

enterprise/internal/authz: Simplify cachedGroups creation

Warren Gifford requested to merge ig/authz-groupcachettl into main

Created by: indradhanush

I was reading through the tests for FetchRepoPerms and it wasn't immediately obvious how setting the GroupsCacheTTL arg to -1 results in a nil Provider.groupsCache, although I did figure it out digging through the call stack.

The function newGroupPermsCache is only used in one place. Inlining the function makes it easier to follow the initialisation conditions of the Provider.groupsCache attribute.

Merge request reports

Loading