UNPKG

cdk-ssm-secure-iam-access-key

Version:

Creates an IAM Access Key for a provided IAM User and stores the result in an SSM SecureString Parameter

13 lines (11 loc) 469 B
import { getSkewCorrectedDate } from "./getSkewCorrectedDate"; /** * @internal * * Checks if the provided date is within the skew window of 300000ms. * * @param clockTime - The time to check for skew in milliseconds. * @param systemClockOffset - The offset of the system clock in milliseconds. */ export const isClockSkewed = (clockTime: number, systemClockOffset: number) => Math.abs(getSkewCorrectedDate(systemClockOffset).getTime() - clockTime) >= 300000;