Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FTDCS-196 - Added default panic guide for Fastly key expiration check #191

Merged
merged 5 commits into from
Jun 22, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ _Note: this assumes that `AWS_ACCESS_KEY` & `AWS_SECRET_ACCESS_KEY` are implicit
#### `fastlyKeyExpiration`
Checks if the expiration date of a Fastly key is due for the next 2 weeks

_Note: there is a default panic guide for this check 'Contact the Slack channel #fastly-support to rotate the keys https://financialtimes.slack.com/archives/C2GFE1C9X'_

* `fastlyKey` = The value of the fastly key to check

_Note: if the expiration date is past, the severity level is 1_
2 changes: 2 additions & 0 deletions src/checks/fastlyKeyExpiration.check.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const Check = require('./check');
const status = require('./status');

const fastlyApiEndpoint = 'https://api.fastly.com/tokens/self';
const defaultPanicGuide = 'Contact the Slack channel #fastly-support to rotate the keys https://financialtimes.slack.com/archives/C2GFE1C9X',
/**
* @description Polls the current state of a Fastly key expiration date
* alert if the key expires in the next week or two
Expand All @@ -14,6 +15,7 @@ class FastlyKeyExpirationCheck extends Check {
constructor(options) {
super(options);
this.fastlyKey = options.fastlyKey;
this.panicGuide options.panicGuide || defaultPanicGuide;
Copy link
Member

Choose a reason for hiding this comment

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

I think just missing an equals here: this.panicGuide =

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, I realized last moments of the work shift I was faster than lucid 🤣

this.states = Object.freeze({
PENDING: {
status: status.PENDING,
Expand Down