ios-app-review-plugin 1.0.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/.claude/settings.local.json +42 -0
- package/.github/actions/ios-review/action.yml +106 -0
- package/.github/workflows/ci.yml +103 -0
- package/.github/workflows/publish.yml +57 -0
- package/CHANGELOG.md +66 -0
- package/CONTRIBUTING.md +175 -0
- package/LICENSE +21 -0
- package/README.md +205 -0
- package/bitrise/step.sh +128 -0
- package/bitrise/step.yml +101 -0
- package/dist/analyzer.d.ts.map +1 -0
- package/dist/analyzers/asc-iap.d.ts.map +1 -0
- package/dist/analyzers/asc-metadata.d.ts.map +1 -0
- package/dist/analyzers/asc-screenshots.d.ts.map +1 -0
- package/dist/analyzers/asc-version.d.ts.map +1 -0
- package/dist/analyzers/code-scanner.d.ts.map +1 -0
- package/dist/analyzers/deprecated-api.d.ts.map +1 -0
- package/dist/analyzers/entitlements.d.ts.map +1 -0
- package/dist/analyzers/index.d.ts.map +1 -0
- package/dist/analyzers/info-plist.d.ts.map +1 -0
- package/dist/analyzers/privacy.d.ts.map +1 -0
- package/dist/analyzers/private-api.d.ts.map +1 -0
- package/dist/analyzers/security.d.ts.map +1 -0
- package/dist/analyzers/ui-ux.d.ts.map +1 -0
- package/dist/asc/auth.d.ts.map +1 -0
- package/dist/asc/client.d.ts.map +1 -0
- package/dist/asc/endpoints/apps.d.ts.map +1 -0
- package/dist/asc/endpoints/iap.d.ts.map +1 -0
- package/dist/asc/endpoints/screenshots.d.ts.map +1 -0
- package/dist/asc/endpoints/versions.d.ts.map +1 -0
- package/dist/asc/errors.d.ts.map +1 -0
- package/dist/asc/index.d.ts.map +1 -0
- package/dist/asc/types.d.ts.map +1 -0
- package/dist/badge/generator.d.ts.map +1 -0
- package/dist/badge/index.d.ts.map +1 -0
- package/dist/badge/types.d.ts.map +1 -0
- package/dist/cache/file-cache.d.ts.map +1 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/types.d.ts.map +1 -0
- package/dist/cli/commands/help.d.ts.map +1 -0
- package/dist/cli/commands/scan.d.ts.map +1 -0
- package/dist/cli/commands/version.d.ts.map +1 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/types.d.ts.map +1 -0
- package/dist/git/diff.d.ts.map +1 -0
- package/dist/git/index.d.ts.map +1 -0
- package/dist/git/types.d.ts.map +1 -0
- package/dist/guidelines/database.d.ts.map +1 -0
- package/dist/guidelines/index.d.ts.map +1 -0
- package/dist/guidelines/matcher.d.ts.map +1 -0
- package/dist/guidelines/types.d.ts.map +1 -0
- package/dist/history/comparator.d.ts.map +1 -0
- package/dist/history/index.d.ts.map +1 -0
- package/dist/history/store.d.ts.map +1 -0
- package/dist/history/types.d.ts.map +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +994 -0
- package/dist/parsers/index.d.ts.map +1 -0
- package/dist/parsers/plist.d.ts.map +1 -0
- package/dist/parsers/xcodeproj.d.ts.map +1 -0
- package/dist/progress/index.d.ts.map +1 -0
- package/dist/progress/reporter.d.ts.map +1 -0
- package/dist/progress/types.d.ts.map +1 -0
- package/dist/reports/html.d.ts.map +1 -0
- package/dist/reports/index.d.ts.map +1 -0
- package/dist/reports/json.d.ts.map +1 -0
- package/dist/reports/markdown.d.ts.map +1 -0
- package/dist/reports/types.d.ts.map +1 -0
- package/dist/rules/engine.d.ts.map +1 -0
- package/dist/rules/index.d.ts.map +1 -0
- package/dist/rules/loader.d.ts.map +1 -0
- package/dist/rules/types.d.ts.map +1 -0
- package/dist/types/index.d.ts.map +1 -0
- package/docs/ANALYZERS.md +237 -0
- package/docs/API.md +308 -0
- package/docs/BADGES.md +130 -0
- package/docs/CI_CD.md +283 -0
- package/docs/CLI.md +140 -0
- package/docs/REPORTS.md +212 -0
- package/docs/ROADMAP.md +267 -0
- package/docs/RULES.md +182 -0
- package/docs/SECURITY.md +89 -0
- package/docs/TROUBLESHOOTING.md +227 -0
- package/docs/tutorials/ASC_SETUP.md +188 -0
- package/docs/tutorials/CI_INTEGRATION.md +292 -0
- package/docs/tutorials/CUSTOM_RULES.md +291 -0
- package/docs/tutorials/GETTING_STARTED.md +226 -0
- package/docs/video-scripts/01-introduction.md +106 -0
- package/docs/video-scripts/02-cli-usage.md +120 -0
- package/docs/video-scripts/03-ci-integration.md +198 -0
- package/eslint.config.js +33 -0
- package/examples/.ios-review-rules.json +82 -0
- package/examples/bitrise-workflow.yml +129 -0
- package/examples/fastlane-lane.rb +71 -0
- package/examples/github-action.yml +147 -0
- package/fastlane/Fastfile.example +114 -0
- package/fastlane/README.md +99 -0
- package/jest.config.js +36 -0
- package/package.json +65 -0
- package/scripts/benchmark.ts +112 -0
- package/scripts/debug-parser.ts +37 -0
- package/scripts/debug-pbxproj.ts +36 -0
- package/scripts/debug-specific.ts +47 -0
- package/scripts/test-analyze.ts +67 -0
- package/scripts/xcode-cloud-review.sh +167 -0
- package/src/analyzer.ts +227 -0
- package/src/analyzers/asc-iap.ts +300 -0
- package/src/analyzers/asc-metadata.ts +326 -0
- package/src/analyzers/asc-screenshots.ts +310 -0
- package/src/analyzers/asc-version.ts +368 -0
- package/src/analyzers/code-scanner.ts +408 -0
- package/src/analyzers/deprecated-api.ts +390 -0
- package/src/analyzers/entitlements.ts +345 -0
- package/src/analyzers/index.ts +12 -0
- package/src/analyzers/info-plist.ts +409 -0
- package/src/analyzers/privacy.ts +376 -0
- package/src/analyzers/private-api.ts +377 -0
- package/src/analyzers/security.ts +327 -0
- package/src/analyzers/ui-ux.ts +509 -0
- package/src/asc/auth.ts +204 -0
- package/src/asc/client.ts +258 -0
- package/src/asc/endpoints/apps.ts +115 -0
- package/src/asc/endpoints/iap.ts +171 -0
- package/src/asc/endpoints/screenshots.ts +164 -0
- package/src/asc/endpoints/versions.ts +174 -0
- package/src/asc/errors.ts +109 -0
- package/src/asc/index.ts +108 -0
- package/src/asc/types.ts +369 -0
- package/src/badge/generator.ts +48 -0
- package/src/badge/index.ts +2 -0
- package/src/badge/types.ts +5 -0
- package/src/cache/file-cache.ts +75 -0
- package/src/cache/index.ts +2 -0
- package/src/cache/types.ts +10 -0
- package/src/cli/commands/help.ts +41 -0
- package/src/cli/commands/scan.ts +44 -0
- package/src/cli/commands/version.ts +12 -0
- package/src/cli/index.ts +92 -0
- package/src/cli/types.ts +17 -0
- package/src/git/diff.ts +21 -0
- package/src/git/index.ts +2 -0
- package/src/git/types.ts +5 -0
- package/src/guidelines/database.ts +344 -0
- package/src/guidelines/index.ts +4 -0
- package/src/guidelines/matcher.ts +84 -0
- package/src/guidelines/types.ts +28 -0
- package/src/history/comparator.ts +114 -0
- package/src/history/index.ts +3 -0
- package/src/history/store.ts +135 -0
- package/src/history/types.ts +40 -0
- package/src/index.ts +1113 -0
- package/src/parsers/index.ts +3 -0
- package/src/parsers/plist.ts +253 -0
- package/src/parsers/xcodeproj.ts +265 -0
- package/src/progress/index.ts +2 -0
- package/src/progress/reporter.ts +65 -0
- package/src/progress/types.ts +9 -0
- package/src/reports/html.ts +322 -0
- package/src/reports/index.ts +20 -0
- package/src/reports/json.ts +92 -0
- package/src/reports/markdown.ts +187 -0
- package/src/reports/types.ts +26 -0
- package/src/rules/engine.ts +121 -0
- package/src/rules/index.ts +3 -0
- package/src/rules/loader.ts +83 -0
- package/src/rules/types.ts +25 -0
- package/src/types/index.ts +247 -0
- package/tests/analyzer.test.ts +142 -0
- package/tests/analyzers/asc-iap.test.ts +228 -0
- package/tests/analyzers/asc-metadata.test.ts +210 -0
- package/tests/analyzers/asc-screenshots.test.ts +135 -0
- package/tests/analyzers/asc-version.test.ts +259 -0
- package/tests/analyzers/code-scanner.test.ts +745 -0
- package/tests/analyzers/deprecated-api.test.ts +286 -0
- package/tests/analyzers/entitlements.test.ts +411 -0
- package/tests/analyzers/info-plist.test.ts +148 -0
- package/tests/analyzers/privacy.test.ts +623 -0
- package/tests/analyzers/private-api.test.ts +255 -0
- package/tests/analyzers/security.test.ts +300 -0
- package/tests/analyzers/ui-ux.test.ts +357 -0
- package/tests/asc/auth.test.ts +189 -0
- package/tests/asc/client.test.ts +207 -0
- package/tests/asc/endpoints.test.ts +1359 -0
- package/tests/badge/generator.test.ts +73 -0
- package/tests/cache/file-cache.test.ts +124 -0
- package/tests/cli/cli-index.test.ts +510 -0
- package/tests/cli/commands.test.ts +67 -0
- package/tests/cli/scan.test.ts +152 -0
- package/tests/git/diff.test.ts +69 -0
- package/tests/guidelines/matcher.test.ts +209 -0
- package/tests/history/comparator.test.ts +272 -0
- package/tests/history/store.test.ts +200 -0
- package/tests/integration/cli.test.ts +95 -0
- package/tests/integration/e2e.test.ts +130 -0
- package/tests/parsers/plist.test.ts +240 -0
- package/tests/parsers/xcodeproj.test.ts +289 -0
- package/tests/progress/reporter.test.ts +117 -0
- package/tests/reports/html.test.ts +176 -0
- package/tests/reports/json.test.ts +235 -0
- package/tests/reports/markdown.test.ts +196 -0
- package/tests/rules/engine.test.ts +229 -0
- package/tests/rules/loader.test.ts +187 -0
- package/tests/setup.ts +15 -0
- package/tsconfig.json +27 -0
- package/tsconfig.test.json +9 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import * as path from 'path';
|
|
2
|
+
import * as fs from 'fs/promises';
|
|
3
|
+
import * as os from 'os';
|
|
4
|
+
import { InfoPlistAnalyzer } from '../../src/analyzers/info-plist';
|
|
5
|
+
|
|
6
|
+
describe('InfoPlistAnalyzer', () => {
|
|
7
|
+
let analyzer: InfoPlistAnalyzer;
|
|
8
|
+
let tempDir: string;
|
|
9
|
+
|
|
10
|
+
beforeAll(async () => {
|
|
11
|
+
analyzer = new InfoPlistAnalyzer();
|
|
12
|
+
tempDir = await fs.mkdtemp(path.join(os.tmpdir(), 'ios-review-test-'));
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
afterAll(async () => {
|
|
16
|
+
await fs.rm(tempDir, { recursive: true, force: true });
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
describe('analyzePlist', () => {
|
|
20
|
+
it('should detect missing required keys', async () => {
|
|
21
|
+
const plistPath = path.join(tempDir, 'MissingKeys.plist');
|
|
22
|
+
await fs.writeFile(
|
|
23
|
+
plistPath,
|
|
24
|
+
`<?xml version="1.0" encoding="UTF-8"?>
|
|
25
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
26
|
+
<plist version="1.0">
|
|
27
|
+
<dict>
|
|
28
|
+
<key>CFBundleName</key>
|
|
29
|
+
<string>TestApp</string>
|
|
30
|
+
</dict>
|
|
31
|
+
</plist>`
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
const result = await analyzer.analyzePlist(plistPath);
|
|
35
|
+
|
|
36
|
+
expect(result.passed).toBe(false);
|
|
37
|
+
expect(result.issues.some((i) => i.id === 'missing-cfbundleidentifier')).toBe(true);
|
|
38
|
+
expect(result.issues.some((i) => i.id === 'missing-cfbundleversion')).toBe(true);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('should pass for valid Info.plist', async () => {
|
|
42
|
+
const plistPath = path.join(tempDir, 'Valid.plist');
|
|
43
|
+
await fs.writeFile(
|
|
44
|
+
plistPath,
|
|
45
|
+
`<?xml version="1.0" encoding="UTF-8"?>
|
|
46
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
47
|
+
<plist version="1.0">
|
|
48
|
+
<dict>
|
|
49
|
+
<key>CFBundleIdentifier</key>
|
|
50
|
+
<string>com.example.testapp</string>
|
|
51
|
+
<key>CFBundleName</key>
|
|
52
|
+
<string>TestApp</string>
|
|
53
|
+
<key>CFBundleVersion</key>
|
|
54
|
+
<string>1</string>
|
|
55
|
+
<key>CFBundleShortVersionString</key>
|
|
56
|
+
<string>1.0.0</string>
|
|
57
|
+
<key>CFBundleExecutable</key>
|
|
58
|
+
<string>TestApp</string>
|
|
59
|
+
<key>CFBundlePackageType</key>
|
|
60
|
+
<string>APPL</string>
|
|
61
|
+
<key>UILaunchStoryboardName</key>
|
|
62
|
+
<string>LaunchScreen</string>
|
|
63
|
+
</dict>
|
|
64
|
+
</plist>`
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
const result = await analyzer.analyzePlist(plistPath);
|
|
68
|
+
|
|
69
|
+
expect(result.passed).toBe(true);
|
|
70
|
+
expect(result.issues.filter((i) => i.severity === 'error')).toHaveLength(0);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it('should detect placeholder privacy descriptions', async () => {
|
|
74
|
+
const plistPath = path.join(tempDir, 'Placeholder.plist');
|
|
75
|
+
await fs.writeFile(
|
|
76
|
+
plistPath,
|
|
77
|
+
`<?xml version="1.0" encoding="UTF-8"?>
|
|
78
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
79
|
+
<plist version="1.0">
|
|
80
|
+
<dict>
|
|
81
|
+
<key>CFBundleIdentifier</key>
|
|
82
|
+
<string>com.example.testapp</string>
|
|
83
|
+
<key>CFBundleName</key>
|
|
84
|
+
<string>TestApp</string>
|
|
85
|
+
<key>CFBundleVersion</key>
|
|
86
|
+
<string>1</string>
|
|
87
|
+
<key>CFBundleShortVersionString</key>
|
|
88
|
+
<string>1.0.0</string>
|
|
89
|
+
<key>CFBundleExecutable</key>
|
|
90
|
+
<string>TestApp</string>
|
|
91
|
+
<key>CFBundlePackageType</key>
|
|
92
|
+
<string>APPL</string>
|
|
93
|
+
<key>NSCameraUsageDescription</key>
|
|
94
|
+
<string>TODO: Add description</string>
|
|
95
|
+
</dict>
|
|
96
|
+
</plist>`
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
const result = await analyzer.analyzePlist(plistPath);
|
|
100
|
+
|
|
101
|
+
expect(result.passed).toBe(false);
|
|
102
|
+
expect(
|
|
103
|
+
result.issues.some((i) => i.id === 'placeholder-nscamerausagedescription')
|
|
104
|
+
).toBe(true);
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it('should detect ATS allows arbitrary loads', async () => {
|
|
108
|
+
const plistPath = path.join(tempDir, 'InsecureATS.plist');
|
|
109
|
+
await fs.writeFile(
|
|
110
|
+
plistPath,
|
|
111
|
+
`<?xml version="1.0" encoding="UTF-8"?>
|
|
112
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
113
|
+
<plist version="1.0">
|
|
114
|
+
<dict>
|
|
115
|
+
<key>CFBundleIdentifier</key>
|
|
116
|
+
<string>com.example.testapp</string>
|
|
117
|
+
<key>CFBundleName</key>
|
|
118
|
+
<string>TestApp</string>
|
|
119
|
+
<key>CFBundleVersion</key>
|
|
120
|
+
<string>1</string>
|
|
121
|
+
<key>CFBundleShortVersionString</key>
|
|
122
|
+
<string>1.0.0</string>
|
|
123
|
+
<key>CFBundleExecutable</key>
|
|
124
|
+
<string>TestApp</string>
|
|
125
|
+
<key>CFBundlePackageType</key>
|
|
126
|
+
<string>APPL</string>
|
|
127
|
+
<key>NSAppTransportSecurity</key>
|
|
128
|
+
<dict>
|
|
129
|
+
<key>NSAllowsArbitraryLoads</key>
|
|
130
|
+
<true/>
|
|
131
|
+
</dict>
|
|
132
|
+
</dict>
|
|
133
|
+
</plist>`
|
|
134
|
+
);
|
|
135
|
+
|
|
136
|
+
const result = await analyzer.analyzePlist(plistPath);
|
|
137
|
+
|
|
138
|
+
expect(result.issues.some((i) => i.id === 'ats-allows-arbitrary-loads')).toBe(true);
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
it('should report error for non-existent file', async () => {
|
|
142
|
+
const result = await analyzer.analyzePlist('/nonexistent/path.plist');
|
|
143
|
+
|
|
144
|
+
expect(result.passed).toBe(false);
|
|
145
|
+
expect(result.issues[0]?.id).toBe('info-plist-not-found');
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
});
|