Add authentication log entries to job token allowlist
What does this MR do and why?
Implements third part of #498125 (closed).
Dependent on !177785 (merged) and !177465 (merged).
Feature is developed under the authentication_logs_migration_for_allowlist feature flag. This adds the button for autopopulating the job token allowlist with entries from the authentication log.
References
Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
| Before | After |
|---|---|
![]() |
Screen_Recording_2025-01-26_at_00.13.05 |
How to set up and validate locally
-
Enable the feature flag.
Feature.enable(:authentication_logs_migration_for_allowlist) -
Create sample authorization log records in the rails console:
project = Project.first project2 = Project.second project3 = Project.third Ci::JobToken::Authorization.create(accessed_project: project, origin_project: project2, last_authorized_at: 1.day.ago) Ci::JobToken::Authorization.create(accessed_project: project, origin_project: project3, last_authorized_at: 1.day.ago) Ci::JobToken::Authorization.all Ci::JobToken::ProjectScopeLink.where(source_project: project) -
Visit the Job token permissions section of the CI/CD settings.
<path-to-project>/-/settings/ci_cd#js-token-access. -
In CI/CD job token allowlist click Add > All projects in authentication log.
-
This will open the modal. Click on the Add entries button.
-
A toast message will show up and the allowlist will refresh with the new entries included.

