Skip to content

Ensure REST API handles SSH key expiry todos

Paul Gascou-Vaillancourt requested to merge 510792-ssh-key-todo-rest-api into master

What does this MR do and why?

Ensure REST API handles SSH key expiry todos

This ensures the SSH todo type properly maps to the SSHKey API entity to prevent 500 errors when hitting the REST todos API.

Changelog: fixed

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.

How to set up and validate locally

Create an SSH expiry to-do

  • Create an SSH key at http://gdk.test:3000/-/user_settings/ssh_keys
  • Set its expires_at to today via the rails console: Key.last.update(expires_at: 1.hour.ago)
  • Don't set an earlier date here, as the following background job only notifies about the keys that expired today.
  • Still in the console, trigger the job that would otherwise run only twice a day: SshKeys::ExpiredNotificationWorker.new.perform

Hit the REST API

Related to #510792

Edited by Paul Gascou-Vaillancourt

Merge request reports

Loading