@carecard/validate 3.22.0 → 3.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/pkg-validate-validation-library/SKILL.md +16 -14
- package/.github/workflows/ci.yml +1 -1
- package/.github/workflows/publish.yml +56 -56
- package/.nvmrc +1 -0
- package/THIRD_PARTY_NOTICES +31 -0
- package/data/commonPasswords.json +10006 -0
- package/index.d.ts +8 -19
- package/index.js +4 -2
- package/lib/validate.js +20 -46
- package/lib/validateProperties.js +6 -11
- package/package.json +5 -2
- package/readme.md +124 -103
|
@@ -108,10 +108,12 @@ depend on those folders being present.
|
|
|
108
108
|
|
|
109
109
|
## Validation Behavior
|
|
110
110
|
|
|
111
|
-
-
|
|
112
|
-
`true` or `false`.
|
|
113
|
-
-
|
|
114
|
-
|
|
111
|
+
- General low-level validators should be deterministic predicate functions that
|
|
112
|
+
return `true` or `false`.
|
|
113
|
+
- `validatePassword` is the sole password-policy function and sole direct
|
|
114
|
+
password export. It returns the NFC-normalized accepted value or a stable
|
|
115
|
+
failure reason; do not add password predicates, aliases, failure-message
|
|
116
|
+
helpers, or a nested password export.
|
|
115
117
|
- `validateProperties` should return a new sanitized object and omit unknown or
|
|
116
118
|
invalid fields without mutating the input.
|
|
117
119
|
- `validateWhitelistProperties` should reject missing or invalid required fields
|
|
@@ -204,20 +206,20 @@ repository's agents-only Git workflow:
|
|
|
204
206
|
and mark the pull request ready for review with `gh pr ready <number>`.
|
|
205
207
|
5. Squash-merge with administrator privileges and delete the remote branch:
|
|
206
208
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
209
|
+
```sh
|
|
210
|
+
gh pr merge <number> --squash --admin --delete-branch
|
|
211
|
+
```
|
|
210
212
|
|
|
211
213
|
6. After merge, update the local base branch and remove the local feature
|
|
212
214
|
branch:
|
|
213
215
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
216
|
+
```sh
|
|
217
|
+
git fetch origin <base> --prune
|
|
218
|
+
git switch <base>
|
|
219
|
+
git pull --ff-only origin <base>
|
|
220
|
+
git branch -d feature/codex
|
|
221
|
+
git ls-remote --heads origin feature/codex
|
|
222
|
+
```
|
|
221
223
|
|
|
222
224
|
Do not commit or push `.agents` guidance changes directly from `development`
|
|
223
225
|
or `main`. Do not stage unrelated files, generated output, dependency folders,
|
package/.github/workflows/ci.yml
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
1
|
name: Publish to npm
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- development
|
|
7
|
+
- main
|
|
8
8
|
|
|
9
9
|
permissions:
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
id-token: write
|
|
11
|
+
contents: read
|
|
12
12
|
|
|
13
13
|
jobs:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
14
|
+
publish:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- name: Checkout code
|
|
18
|
+
uses: actions/checkout@v7
|
|
19
|
+
|
|
20
|
+
- name: Setup Node.js
|
|
21
|
+
uses: actions/setup-node@v6
|
|
22
|
+
with:
|
|
23
|
+
node-version-file: '.nvmrc'
|
|
24
|
+
registry-url: 'https://registry.npmjs.org'
|
|
25
|
+
package-manager-cache: false
|
|
26
|
+
|
|
27
|
+
- name: Remove unsupported npm auth config
|
|
28
|
+
run: |
|
|
29
|
+
npm_config_file="${NPM_CONFIG_USERCONFIG:-$HOME/.npmrc}"
|
|
30
|
+
if [ -f "$npm_config_file" ]; then
|
|
31
|
+
sed -i '/^[[:space:]]*always-auth[[:space:]]*=.*/d' "$npm_config_file"
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
- name: Install dependencies
|
|
35
|
+
# Added HUSKY=0 to prevent the husky error in logs
|
|
36
|
+
run: npm ci
|
|
37
|
+
env:
|
|
38
|
+
HUSKY: 0
|
|
39
|
+
|
|
40
|
+
- name: Check package version
|
|
41
|
+
id: package-version
|
|
42
|
+
run: |
|
|
43
|
+
package_name="$(node -p "require('./package.json').name")"
|
|
44
|
+
package_version="$(node -p "require('./package.json').version")"
|
|
45
|
+
|
|
46
|
+
echo "package_name=${package_name}" >> "$GITHUB_OUTPUT"
|
|
47
|
+
echo "package_version=${package_version}" >> "$GITHUB_OUTPUT"
|
|
48
|
+
|
|
49
|
+
published_versions="$(npm view "${package_name}" versions --json)"
|
|
50
|
+
if node -e 'const value=JSON.parse(process.argv[1]); const versions=Array.isArray(value) ? value : [value]; process.exit(versions.includes(process.argv[2]) ? 0 : 1);' "$published_versions" "$package_version"; then
|
|
51
|
+
echo "${package_name}@${package_version} is already published."
|
|
52
|
+
echo "should_publish=false" >> "$GITHUB_OUTPUT"
|
|
53
|
+
else
|
|
54
|
+
echo "${package_name}@${package_version} is not published yet."
|
|
55
|
+
echo "should_publish=true" >> "$GITHUB_OUTPUT"
|
|
56
|
+
fi
|
|
57
|
+
|
|
58
|
+
- name: Publish to npm
|
|
59
|
+
if: steps.package-version.outputs.should_publish == 'true'
|
|
60
|
+
run: npm publish --provenance --access public
|
|
61
|
+
env:
|
|
62
|
+
HUSKY: 0
|
|
63
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/.nvmrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
24.20.0
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
SecLists 10k most common passwords
|
|
2
|
+
===================================
|
|
3
|
+
|
|
4
|
+
data/commonPasswords.json contains the 10,000 entries from
|
|
5
|
+
Passwords/Common-Credentials/10k-most-common.txt in SecLists tag 2026.1,
|
|
6
|
+
plus four CareCard-specific blocked phrases. The pinned upstream file has SHA-256
|
|
7
|
+
4adb3f0afb4a10cf19ebe48d8c69a46f934bbc8d77c694c210564f9583e7f4ba.
|
|
8
|
+
|
|
9
|
+
Source: https://github.com/danielmiessler/SecLists/blob/2026.1/Passwords/Common-Credentials/10k-most-common.txt
|
|
10
|
+
|
|
11
|
+
MIT License
|
|
12
|
+
|
|
13
|
+
Copyright (c) 2018 Daniel Miessler
|
|
14
|
+
|
|
15
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
16
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
17
|
+
in the Software without restriction, including without limitation the rights
|
|
18
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
19
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
20
|
+
furnished to do so, subject to the following conditions:
|
|
21
|
+
|
|
22
|
+
The above copyright notice and this permission notice shall be included in all
|
|
23
|
+
copies or substantial portions of the Software.
|
|
24
|
+
|
|
25
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
26
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
27
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
28
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
29
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
30
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
31
|
+
SOFTWARE.
|