Allow forward slashes in vendor definition token types

🤖 AI wrote this code from my instructions.

Unreviewed AI output often lands on reviewers and costs them time.
This MR is human verified: I read the full diff and ran the tests myself, because your time is as valuable as mine.

This merge request lets a vendor definition carry a detection rule id that contains a forward slash, i.e. /.

Related to #631759.

Gap

  • token_type must equal the rule id, because the registry is keyed by it.
  • TOKEN_TYPE_PATTERN does not allow forward slashes, so it rejects rule ids such as Hashicorp Terraform user/org API token.
  • A definition for such a rule needs a renamed token_type and a hand-edited registry key, as in !259344 (merged).

Fix

  • We add the forward slash to TOKEN_TYPE_PATTERN regex.
  • This is safe: token_type reaches generated source only in the registry entry, through #inspect.

MR acceptance checklist

I have evaluated this MR against the MR acceptance checklist.

Edited by Ahmed Hemdan

Merge request reports

Loading
Loading