Class RotatePatKeysJob

java.lang.Object
edu.ucsb.cs.scaffold.jobs.RotatePatKeysJob
All Implemented Interfaces:
edu.ucsb.cs156.jobs.services.JobContextConsumer

public class RotatePatKeysJob extends Object implements edu.ucsb.cs156.jobs.services.JobContextConsumer
Re-encrypts every stored PAT under the current PAT_ENCRYPTION_KEY. Launched by an admin (POST /api/jobs/launch/rotatePatKeys) after the key rotation script has moved the retiring key to PREVIOUS_PAT_ENCRYPTION_KEY and installed a new PAT_ENCRYPTION_KEY; see docs/PAT_ENCRYPTION_KEY_instructions.md.

Credentials already on the current key version are skipped, so the job is idempotent and can simply be re-launched after a partial failure. A credential whose key version has no configured key (e.g. PREVIOUS_PAT_ENCRYPTION_KEY was removed too early) is logged and skipped rather than failing the whole job; that user must re-enter their PAT.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    accept(edu.ucsb.cs156.jobs.services.JobContext ctx)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface edu.ucsb.cs156.jobs.services.JobContextConsumer

    getJobName, getScopeId, getScopeType
  • Constructor Details

    • RotatePatKeysJob

      public RotatePatKeysJob()
  • Method Details

    • accept

      public void accept(edu.ucsb.cs156.jobs.services.JobContext ctx) throws Exception
      Specified by:
      accept in interface edu.ucsb.cs156.jobs.services.JobContextConsumer
      Throws:
      Exception