Skip to content

Update AllowlistChecker to verify authorization for upstream Forgejo events #3183

Description

@betulependule

This is a follow-up to #3154, which added Forgejo events as unchecked events to AllowlistChecker (previously just Allowlist), which is sufficient for downstream support, but not upstream. In order to add Forgejo support for upstream CI, these events need to be authorized (similarly as it is done for GitHub and GitLab).

Remove Forgejo events from this Union:

UncheckedEvent = Union[
anitya.NewHotness,
copr.CoprBuild,
forgejo.push.Commit,
forgejo.pr.Action,
forgejo.pr.Comment,
forgejo.issue.Comment,
forgejo.action_run.Push,
forgejo.action_run.PullRequest,
github.check.Rerun,
github.installation.Installation,
koji.result.Task,
koji.result.Build,
pagure.pr.Comment,
pagure.pr.Action,
pagure.push.Commit,
testing_farm.Result,
]

Forgejo events need to be removed here as well. The logic in AllowlistChecker.check_and_report() needs to be refined to distinguish between upstream and downstream events, and not let upstream events bypass authorization:

( # events that are not checked against allowlist
# [XXX] dist-git Forgejo events are unchecked
# upstream Forgejo events would require authorization checking
forgejo.push.Commit,
forgejo.pr.Action,
forgejo.pr.Comment,
forgejo.issue.Comment,
forgejo.action_run.Push,
forgejo.action_run.PullRequest,
pagure.push.Commit,
pagure.pr.Action,
pagure.pr.Comment,
copr.CoprBuild,
testing_farm.Result,
github.installation.Installation,
koji.result.Task,
koji.result.Build,
koji.tag.Build,
github.check.Rerun,
anitya.NewHotness,
openscanhub.task.Started,
openscanhub.task.Finished,
): self._check_unchecked_event,

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/forgejoForgejo-forge relatedkind/featureA request, idea, or new functionality

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions