From 51f403d5dcfdf64f59d104116b64c79708d6a562 Mon Sep 17 00:00:00 2001 From: ax-rpipkin Date: Wed, 26 Jan 2022 16:33:29 -0700 Subject: [PATCH] added cursor regex based off sampling of recent cursor values and noted in issue #32 --- ghec-audit-log-utils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ghec-audit-log-utils.js b/ghec-audit-log-utils.js index 03998b5..dfa45ea 100644 --- a/ghec-audit-log-utils.js +++ b/ghec-audit-log-utils.js @@ -17,13 +17,14 @@ function validateInput (program, config) { // Validate correctness const tokenRegex = /^[g(p|o|u|s|r)1_]{0,1}[A-Za-z0-9_]+$/ + const cursorRegex = /^[a-zA-Z0-9]{3,5}_[a-zA-Z0-9]+$/ const base64Regex = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/ const orgRegex = /^[a-z\d]+(?:-?[a-z\d]+)*$/i const constraints = { cursor: { type: 'string', presence: false, - format: base64Regex + format: cursorRegex }, pretty: { type: 'boolean',