Within v2.2.0 of Chocolatey Licensed, we released a feature which filters source (what is output when running choco source list or when installing software) to show only the sources that can be used by the current user, based on the configuration that is in place.
For example, if you are logged in as a non-administator user, and a source is marked as admin only, this source will not be returned, since the currently logged in user cannot use that source.
In addition, based on whether or not background service is enabled, again the list of sources will be filtered to show only the sources that can be used.
This feature was added since there were times when there was confusion about not being able to install a package from a source since the source would show as being available, but then the package wouldn't be installed, since at the time of execution, the source wasn't being used. Showing only the sources that can be used means that there is less confusion overall about the current situation.
Having said that, the logic that was put in place doesn't take in account the useBackgroundServiceWithSelfServiceSourcesOnly feature. When this is enabled, which is the default, and running with Background Service enabled, it will force the usage of source that are explicitly marked as being for self service, no other sources will be returned. However, when this feature is disabled, the source filtering should return other sources that are not marked as self service, when running in self service mode.
This issue could result in 0 sources being returned, when prior to v2.2.0 sources were returned.
Steps To Reproduce
Remove all current Chocolatey Sources (leave chocolatey.licensed, as this will only be recreated)
Ensure that you have the following two sources defined:
Run the following to get the list of accessible sources
choco source list
A list of 4 sources will be returned, which includes only the sources that are explicitly listed as being for self service. It should return a list of 8 sources (which includes the chocolatey.licensed source), since the setting for useBackgroundServiceWithSelfServiceSourcesOnly has been set to false, meaning that other sources can be used when running in Self Service mode.
Log into the machine as a non-administrator user
Run the following to get the list of accessible sources
choco source list
A list of 2 sources will be returned, which includes only the sources that are explicitly listed as being for self service, and which aren't marked as for admin only. It should return a list of 5 sources (which includes the chocolatey.licensed source), since the setting for useBackgroundServiceWithSelfServiceSourcesOnly has been set to false, meaning that other sources can be used when running in Self Service mode.
Output Log
N/A
Workarounds
In the interim, marking a source as explicitly being for Self Service should result in it correctly being returned.
Proposed Solution
The filtering of the sources needs to be updated to account for for the UseBackgroundServiceWithSelfServiceSourcesOnly flag. Currently this is being ignored. As a result, when Self Service is enabled, only sources marked explicitly as being enabled for self service are being returned.
Description
Within v2.2.0 of Chocolatey Licensed, we released a feature which filters source (what is output when running
choco source list
or when installing software) to show only the sources that can be used by the current user, based on the configuration that is in place.For example, if you are logged in as a non-administator user, and a source is marked as admin only, this source will not be returned, since the currently logged in user cannot use that source.
In addition, based on whether or not background service is enabled, again the list of sources will be filtered to show only the sources that can be used.
This feature was added since there were times when there was confusion about not being able to install a package from a source since the source would show as being available, but then the package wouldn't be installed, since at the time of execution, the source wasn't being used. Showing only the sources that can be used means that there is less confusion overall about the current situation.
Having said that, the logic that was put in place doesn't take in account the
useBackgroundServiceWithSelfServiceSourcesOnly
feature. When this is enabled, which is the default, and running with Background Service enabled, it will force the usage of source that are explicitly marked as being for self service, no other sources will be returned. However, when this feature is disabled, the source filtering should return other sources that are not marked as self service, when running in self service mode.This issue could result in 0 sources being returned, when prior to v2.2.0 sources were returned.
Steps To Reproduce
useBackgroundServiceWithSelfServiceSourcesOnly
has been set to false, meaning that other sources can be used when running in Self Service mode.useBackgroundServiceWithSelfServiceSourcesOnly
has been set to false, meaning that other sources can be used when running in Self Service mode.Output Log
N/A
Workarounds
In the interim, marking a source as explicitly being for Self Service should result in it correctly being returned.
Proposed Solution
The filtering of the sources needs to be updated to account for for the
UseBackgroundServiceWithSelfServiceSourcesOnly
flag. Currently this is being ignored. As a result, when Self Service is enabled, only sources marked explicitly as being enabled for self service are being returned.Related Issues and Tickets
Done Checklist
┆Issue is synchronized with this Gitlab issue by Unito ┆Milestone: 2.2.1