feat(shield): add GitLab Personal Access Token detection#57
Merged
PythonWoods-Dev merged 1 commit intoPythonWoods:mainfrom Apr 16, 2026
Merged
Conversation
Add regex pattern for GitLab PATs (glpat-[A-Za-z0-9\-_]{20,}) to the
Shield credential scanner.
- Added gitlab-pat pattern to _SECRETS list in shield.py
- Updated docstring to document the new pattern
- Added 4 test cases: detection, URL embedding, false positive guard,
and clean line verification
Closes PythonWoods#53
PythonWoods-Dev
approved these changes
Apr 16, 2026
Contributor
PythonWoods-Dev
left a comment
There was a problem hiding this comment.
Clean, well-scoped contribution — thanks @gtanb4l! 🛡️
Pattern, tests, and placement all look good. 963 tests pass with the change.
One minor issue I'll fix in a follow-up commit: the docstring at line 19 of shield.py uses \- which triggers a SyntaxWarning: invalid escape sequence on Python 3.12+. It needs to be \\- in the docstring. The regex itself (line 84) is correct.
Merging now.
PythonWoods-Dev
added a commit
that referenced
this pull request
Apr 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds GitLab Personal Access Token (
glpat-) detection to the Shield credential scanner.Changes
gitlab-patpattern:glpat-[A-Za-z0-9\-_]{20,}to_SECRETSlistPattern Details
glpat-followed by 20+ alphanumeric/underscore/hyphen charactersTesting
All regex patterns verified manually (project requires Python 3.10+ for full test suite).
Closes #53