Currently, the public_projects_only
config flag only causes us to drop privileges when collecting the initial project list.
If a public project links to an internal-only one, we'll include that because our API user can access internal projects.
Need to apply this flag more widely - the main exception being when fetching comments/notes: that API (for whatever reason) requires an authenticated user.
Activity
17-Apr-22 08:18
Although not what I was originally thinking of when I raised this issue, whilst working on #19 I found another source of leakage.
The main projects listing is generated by dropping privileges, and iterating over gitlab's paginated result set:
We set
$do_auth
based on the config flag and pass it intocallAPI()
to tell it whether to include the auth header.However, the default behaviour in
callAPI()
is to do auth, and we're not passing$do_auth
into the invocation used to fetch later pages.So privileges get dropped for the first call, but not subsequent ones - we'll end up including non-public ones.
This is fixed in commit be8572d
18-Apr-22 10:19
mentioned in issue #12
18-Apr-22 10:20
It turns out that this isn't an issue, in fact the opposite is true.
Most of the gitlab calling methods do something like
So what we've found (in #12) is that the system often cannot display items (commits in that case) which aren't public.
Need to move the auth calculation somewhere public and then update all to use that.
18-Apr-22 10:27
mentioned in commit 234b8dbf93acb61394393e0dac53470a15ee11b7
Message
Move auth enabled/disabled calcuation to a global point and then make all API calls honour it for websites/Gitlab-Issue-Listing-Script#15
This means that if
public_projects_only
is set, auth will be disabled and the client won't retrieve nonpublic commits, issues, projects etc18-Apr-22 10:28
This is fixed - all calls to
callAPI()
now use$config->do_auth
the value of which is calculated inindex.php
just after instantiating the config object