Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Add rotation harness and rotate token signing keys #1597

Merged
merged 4 commits into from
Jan 15, 2021

Conversation

sethvargo
Copy link
Member

@sethvargo sethvargo commented Jan 14, 2021

This adds a new service, rotation, which handles key and rotation events. It's designed to be invoked via Cloud Scheduler and has its own locking and time intervals. It's conceptually similar to the cleanup job.

This also adds the database schema and example rotation for token signing keys. Note that this code is NOT in use in main code paths yet.

There's some TODOs in the code assigned to me. I intend to do those in follow-up PRs where all of this will be wired together.

Part of #1569

Release Note

Add rotation service and schema for rotating token signing keys

/assign @mikehelmick

This adds a new service, rotation, which handles key and rotation events. It's designed to be invoked via Cloud Scheduler and has its own locking and time intervals. It's conceptually similar to the cleanup job.

This also adds the database schema and example rotation for token signing keys. Note that this code is NOT in use in main code paths yet.
@google-cla google-cla bot added the cla: yes Auto: added by CLA bot when all committers have signed a CLA. label Jan 14, 2021
@sethvargo
Copy link
Member Author

/assign @whaught

It'd be good to get 2 LGTMs on this

Port string `env:"PORT,default=8080"`

RateLimit uint64 `env:"RATE_LIMIT,default=60"`
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was unused

@@ -93,6 +96,7 @@ func (c *Controller) HandleCleanup() http.Handler {
OK: false,
Errors: []error{fmt.Errorf("too early")},
})
return
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an existing nasty bug in the cleanup server.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch

Copy link
Contributor

@whaught whaught left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need an entry in builders/build.yaml to be able to create /sevice_rotation.tf?

@sethvargo
Copy link
Member Author

Don't we need an entry in builders/build.yaml to be able to create /sevice_rotation.tf?

Done

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mikehelmick, sethvargo, whaught

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [mikehelmick,sethvargo,whaught]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-robot google-oss-robot merged commit 8002a61 into main Jan 15, 2021
@google-oss-robot google-oss-robot deleted the sethvargo/token_signers branch January 15, 2021 01:44
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes Auto: added by CLA bot when all committers have signed a CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants