dsh-supply-watch 0.0.0-stage → 0.1.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/DESIGN.md +326 -0
- package/LICENSE +202 -0
- package/README.md +273 -2
- package/package.json +48 -4
- package/src/cli.js +285 -0
- package/src/core.js +755 -0
package/DESIGN.md
ADDED
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
# DESIGN — dsh-supply-watch
|
|
2
|
+
|
|
3
|
+
Status: MVP, `0.1.0`, unpublished. License: Apache-2.0.
|
|
4
|
+
|
|
5
|
+
> Unofficial community project. Not affiliated with DeepSeek.
|
|
6
|
+
|
|
7
|
+
## 1. Problem and scope
|
|
8
|
+
|
|
9
|
+
Supply-chain review of an npm dependency often starts with two questions that
|
|
10
|
+
can be answered locally:
|
|
11
|
+
|
|
12
|
+
1. **Does this name look like a trusted package?** (`dsh-core` vs. `dsh-cora`,
|
|
13
|
+
`dsh_core`, `dshcore`, `core`, `node-dsh-core`, ...)
|
|
14
|
+
2. **Does its publication history look plausible?** (`0.0.1`, `99.0.0`, a
|
|
15
|
+
giant major jump, a prerelease that goes backwards, missing intermediate
|
|
16
|
+
releases)
|
|
17
|
+
|
|
18
|
+
`dsh-supply-watch` answers only those questions, with deterministic heuristics
|
|
19
|
+
and no network access. It is a lead generator, not an SCA product.
|
|
20
|
+
|
|
21
|
+
### Goals
|
|
22
|
+
|
|
23
|
+
- zero dependencies, pure ESM, Node built-ins only;
|
|
24
|
+
- offline and deterministic (same input -> same output);
|
|
25
|
+
- usable as a CLI and as a small library;
|
|
26
|
+
- findings carry a stable code, a numeric score, and a reason;
|
|
27
|
+
- conservative about claims: every output says "heuristic", never "malware".
|
|
28
|
+
|
|
29
|
+
### Non-goals
|
|
30
|
+
|
|
31
|
+
- registry metadata fetching or package-name reservation checks;
|
|
32
|
+
- tarball download, extraction, install-script execution, or code analysis;
|
|
33
|
+
- advisory matching (OSV/GHSA), signature/provenance verification;
|
|
34
|
+
- dependency-graph or lockfile analysis;
|
|
35
|
+
- a comprehensive Unicode confusables table;
|
|
36
|
+
- replacing `npm audit`, Socket, Snyk, OSV-Scanner, Dependabot, or human review.
|
|
37
|
+
|
|
38
|
+
## 2. Architecture
|
|
39
|
+
|
|
40
|
+
```text
|
|
41
|
+
src/core.js pure heuristics: normalization, Levenshtein, typo scoring,
|
|
42
|
+
version parsing/anomalies, severity, watch-style merge/sort
|
|
43
|
+
src/cli.js parseArgs + file/stdout I/O + JSON; no heuristic logic
|
|
44
|
+
test/ node:test, offline; core unit tests + spawned CLI tests
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
`core.js` imports nothing. `cli.js` imports only `node:fs/promises`,
|
|
48
|
+
`node:util`, and `core.js`. The CLI never executes a scanned package.
|
|
49
|
+
|
|
50
|
+
## 3. Name comparison
|
|
51
|
+
|
|
52
|
+
### 3.1 Normalization
|
|
53
|
+
|
|
54
|
+
`normalizeName(name)`:
|
|
55
|
+
|
|
56
|
+
1. trim and lowercase;
|
|
57
|
+
2. normalize separators inside an npm scope (`@Scope/Name` -> `@scope/name`);
|
|
58
|
+
3. collapse runs of `-`, `_`, `.` into one `-`;
|
|
59
|
+
4. trim leading/trailing `-`.
|
|
60
|
+
|
|
61
|
+
Examples:
|
|
62
|
+
|
|
63
|
+
| Input | Normalized |
|
|
64
|
+
| --- | --- |
|
|
65
|
+
| ` DSH__Core.Plugin ` | `dsh-core-plugin` |
|
|
66
|
+
| `dsh--core` | `dsh-core` |
|
|
67
|
+
| `@DSH/Foo_Bar` | `@dsh/foo-bar` |
|
|
68
|
+
|
|
69
|
+
This makes punctuation-only variants comparable while keeping scopes
|
|
70
|
+
distinguishable. Scope-hopping itself (`@evil/dsh-core` for `dsh-core`) is not
|
|
71
|
+
given a dedicated signal; it is documented as a limitation.
|
|
72
|
+
|
|
73
|
+
### 3.2 DSH namespace prefix
|
|
74
|
+
|
|
75
|
+
The prefix heuristic recognizes an optional `node-`, `deepseek-`, or
|
|
76
|
+
`official-` qualifier followed by `dsh`, then either a separator or a glued
|
|
77
|
+
continuation:
|
|
78
|
+
|
|
79
|
+
```text
|
|
80
|
+
dsh-core -> core
|
|
81
|
+
dshcore -> core
|
|
82
|
+
node-dsh-core -> core
|
|
83
|
+
deepseek-dsh-core -> core
|
|
84
|
+
official-dsh-core -> core
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
If the stripped cores are equal but the full normalized names differ, the
|
|
88
|
+
candidate is flagged with score 74 and one of three reasons:
|
|
89
|
+
|
|
90
|
+
- candidate adds a `dsh-` prefix (`dsh-core` vs. known `core`);
|
|
91
|
+
- candidate omits it (`core` vs. known `dsh-core`);
|
|
92
|
+
- candidate uses a different prefix form (`node-dsh-core` vs. `dsh-core`).
|
|
93
|
+
|
|
94
|
+
The prefix signal intentionally has a moderate score: adding `dsh-` to an
|
|
95
|
+
unrelated official name is suspicious, but many legitimate companion packages
|
|
96
|
+
share a prefix.
|
|
97
|
+
|
|
98
|
+
### 3.3 Signal order and scores
|
|
99
|
+
|
|
100
|
+
For a normalized candidate and one known name, signals are evaluated and the
|
|
101
|
+
highest score wins. Ties keep the earlier signal (a deterministic, documented
|
|
102
|
+
priority).
|
|
103
|
+
|
|
104
|
+
| Signal | Score | Notes |
|
|
105
|
+
| --- | ---: | --- |
|
|
106
|
+
| exact known name | 0 | checked globally first; never flagged |
|
|
107
|
+
| separator/punctuation variant (normalized equal) | 90 | `dsh_core`, `dsh--core` |
|
|
108
|
+
| same compact form (separators removed) | 88 | `dshcore` |
|
|
109
|
+
| Levenshtein distance 1, max length >= 4 | 88 | typical typo |
|
|
110
|
+
| Levenshtein distance 2, max length >= 5 | 68 | e.g. transposition |
|
|
111
|
+
| prefix add/omit/respell | 74 | see 3.2 |
|
|
112
|
+
| Levenshtein distance 3, max length >= 9 | 46 | longer names only |
|
|
113
|
+
| extra trailing segment | 44 | `dsh-core-utils` |
|
|
114
|
+
| extra glued suffix (3+ chars) | 42 | `dshcoreutils` |
|
|
115
|
+
| no signal | 0 | `no close match among N ...` |
|
|
116
|
+
|
|
117
|
+
Why these thresholds:
|
|
118
|
+
|
|
119
|
+
- Short names are edit-distance minefields. Below the length thresholds, only
|
|
120
|
+
punctuation/prefix signals are trusted.
|
|
121
|
+
- Distance 3 is only used for long names, where three edits are a small
|
|
122
|
+
fraction of the name.
|
|
123
|
+
- Extension signals are deliberately low severity: a name that extends a
|
|
124
|
+
trusted package is a plausible lead, not proof of impersonation.
|
|
125
|
+
- Exact matches short-circuit across the *whole* known list. If both `core`
|
|
126
|
+
and `dsh-core` are trusted, the candidate `core` is not flagged for omitting
|
|
127
|
+
a prefix from its sibling.
|
|
128
|
+
|
|
129
|
+
`typosquatScore` returns the best entry by score, then by lowest distance,
|
|
130
|
+
then by known-list order. `nearest` is the original known string; `distance`
|
|
131
|
+
is computed on normalized names. With no known list (or an empty name), the
|
|
132
|
+
result has `nearest: null`, `distance: null`, `score: 0` and a reason.
|
|
133
|
+
|
|
134
|
+
### 3.4 Levenshtein
|
|
135
|
+
|
|
136
|
+
`levenshtein(a, b)` is a standard dynamic-programming implementation that
|
|
137
|
+
iterates over the shorter string internally. The optional
|
|
138
|
+
`{ maxDistance }` (or numeric third argument) enables a banded computation:
|
|
139
|
+
|
|
140
|
+
- cells outside `|i - j| <= maxDistance` are capped;
|
|
141
|
+
- a row whose minimum exceeds the threshold aborts early;
|
|
142
|
+
- the return value is `maxDistance + 1` when the true distance exceeds the
|
|
143
|
+
bound, instead of the exact distance.
|
|
144
|
+
|
|
145
|
+
This convention is documented because callers must not treat the sentinel as
|
|
146
|
+
an exact distance. Fuzz tests compare the banded result with the full DP for
|
|
147
|
+
random strings and thresholds (see §8).
|
|
148
|
+
|
|
149
|
+
## 4. Version analysis
|
|
150
|
+
|
|
151
|
+
### 4.1 Input and parsing
|
|
152
|
+
|
|
153
|
+
Input is a list of semver-ish strings, expected in **publication order
|
|
154
|
+
(oldest first)**. Accepted shape:
|
|
155
|
+
|
|
156
|
+
```text
|
|
157
|
+
v?MAJOR.MINOR.PATCH(-PRERELEASE)?(+BUILD)?
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Build metadata is ignored. Numeric prerelease identifiers compare numerically;
|
|
161
|
+
alphanumeric identifiers compare lexically; a prerelease is lower than its
|
|
162
|
+
stable release (SemVer 2.0.0). Invalid entries are ignored rather than guessed
|
|
163
|
+
at. Duplicate versions are deduplicated for structural checks.
|
|
164
|
+
|
|
165
|
+
### 4.2 Structural checks (order-independent)
|
|
166
|
+
|
|
167
|
+
A copy is filtered to stable versions and sorted ascending.
|
|
168
|
+
|
|
169
|
+
| Code | Condition | Score |
|
|
170
|
+
| --- | --- | ---: |
|
|
171
|
+
| `placeholder-version` | `0.0.0` or `0.0.1` | 52 |
|
|
172
|
+
| `implausible-major` | major `>= 99` | 92 |
|
|
173
|
+
| `major-jump` | consecutive majors differ by `>= 2` (current major < 99) | 85 if jump >= 5, else 70 |
|
|
174
|
+
| `missing-intermediate` (minor) | same major, minor gap `>= 2` | 45 |
|
|
175
|
+
| `missing-intermediate` (patch) | same major/minor, patch gap `>= 2` | 35 |
|
|
176
|
+
|
|
177
|
+
`missing-intermediate` findings include `missingCount` and up to five example
|
|
178
|
+
versions/lines (`1.1.x`, `1.0.1`) so output stays bounded even for huge gaps.
|
|
179
|
+
Major jumps do not also emit missing-minor findings; they are different
|
|
180
|
+
signals for the same gap.
|
|
181
|
+
|
|
182
|
+
### 4.3 Publication-order checks
|
|
183
|
+
|
|
184
|
+
These iterate the parsed list as supplied, without sorting:
|
|
185
|
+
|
|
186
|
+
| Code | Condition | Score |
|
|
187
|
+
| --- | --- | ---: |
|
|
188
|
+
| `prerelease-rollback` | current version has a prerelease and sorts below previous | 86 |
|
|
189
|
+
| `version-regression` | any other decrease from previous to current | 82 |
|
|
190
|
+
|
|
191
|
+
Sorting for structural checks while preserving original order for rollback
|
|
192
|
+
checks is a deliberate split: jumps/gaps are properties of the set, while a
|
|
193
|
+
rollback is a property of the publish sequence. Passing an unsorted list will
|
|
194
|
+
therefore produce noisy rollback findings; callers should sort first or pass
|
|
195
|
+
the real npm publication history.
|
|
196
|
+
|
|
197
|
+
### 4.4 Why 99.x is special
|
|
198
|
+
|
|
199
|
+
An enormous major version is a classic dependency-confusion bait (it wins
|
|
200
|
+
naive "highest version" resolution). The `>= 99` threshold is a heuristic; a
|
|
201
|
+
real project could legitimately reach it. When the current major is `>= 99`,
|
|
202
|
+
the separate major-jump finding is suppressed to avoid "skips 98 majors"
|
|
203
|
+
noise.
|
|
204
|
+
|
|
205
|
+
## 5. Severity and merging
|
|
206
|
+
|
|
207
|
+
`severityOf(finding)`:
|
|
208
|
+
|
|
209
|
+
- returns an explicit valid `severity` if present;
|
|
210
|
+
- otherwise maps score `>= 80` -> `high`, `>= 50` -> `medium`, else `low`.
|
|
211
|
+
|
|
212
|
+
`watch(names, known)` accepts `string` or `{ name, versions }` entries,
|
|
213
|
+
attaches the name to version findings, adds `severity`, and sorts:
|
|
214
|
+
|
|
215
|
+
1. severity rank (`high`, `medium`, `low`);
|
|
216
|
+
2. score descending;
|
|
217
|
+
3. name ascending;
|
|
218
|
+
4. code/kind ascending (stable tie-break).
|
|
219
|
+
|
|
220
|
+
Typo findings are emitted only when `score > 0`. Version findings with an
|
|
221
|
+
empty version list are not emitted. An empty/missing known list disables typo
|
|
222
|
+
checks but leaves version checks active. Empty input returns `[]`.
|
|
223
|
+
|
|
224
|
+
## 6. CLI behavior
|
|
225
|
+
|
|
226
|
+
```text
|
|
227
|
+
dsh-supply-watch check <name> [--known a,b] [--versions x,y] [--json]
|
|
228
|
+
dsh-supply-watch scan <names.txt> [--known a,b] [--json]
|
|
229
|
+
dsh-supply-watch --help
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
- `check` builds a one-element watch input; `scan` parses lines, ignores
|
|
233
|
+
blanks and `#` comments, and accepts optional comma/space-separated versions
|
|
234
|
+
after the name.
|
|
235
|
+
- `--json` writes one JSON object to stdout; warnings go to stderr so stdout
|
|
236
|
+
remains parseable.
|
|
237
|
+
- No `--known` -> stderr note; typo analysis is inactive.
|
|
238
|
+
- Exit code `0` means the command ran, **not** that the package is safe.
|
|
239
|
+
Usage/IO errors exit `1`. Findings do not fail the process; CI policy is the
|
|
240
|
+
caller's job.
|
|
241
|
+
- The CLI intentionally has no built-in trusted list and makes no network
|
|
242
|
+
calls.
|
|
243
|
+
|
|
244
|
+
## 7. False positives / false negatives
|
|
245
|
+
|
|
246
|
+
### Expected false positives
|
|
247
|
+
|
|
248
|
+
- legitimate extension packages (`dsh-core-utils`);
|
|
249
|
+
- intentional prefix differences (a non-DSH package named `core`);
|
|
250
|
+
- version resets (project rewrite at `2.0.0` after `1.x`);
|
|
251
|
+
- yanked versions creating real gaps;
|
|
252
|
+
- `0.0.1` prototypes;
|
|
253
|
+
- publication lists that are not chronological.
|
|
254
|
+
|
|
255
|
+
Mitigation: every finding carries a reason and score; consumers should treat
|
|
256
|
+
scores as ranking hints and review context. Findings are not verdicts.
|
|
257
|
+
|
|
258
|
+
### Expected false negatives
|
|
259
|
+
|
|
260
|
+
- homoglyphs and mixed-script names not covered by Levenshtein (e.g. Cyrillic
|
|
261
|
+
lookalikes);
|
|
262
|
+
- impersonation more than three edits away;
|
|
263
|
+
- scope-hopping (`@evil/dsh-core`);
|
|
264
|
+
- compromised *official* packages, malicious install scripts, vulnerable
|
|
265
|
+
dependency graphs;
|
|
266
|
+
- malicious versions that happen to be semver-plausible;
|
|
267
|
+
- typos in names shorter than the edit-distance thresholds.
|
|
268
|
+
|
|
269
|
+
These are inherent to a local heuristic MVP. Closing them requires registry
|
|
270
|
+
metadata, tarball analysis, provenance/signature verification, and advisory
|
|
271
|
+
data — explicitly out of scope and not faked here.
|
|
272
|
+
|
|
273
|
+
## 8. Testing
|
|
274
|
+
|
|
275
|
+
`node --test test/*.test.js` (also runnable from the suite root with the
|
|
276
|
+
glob) covers:
|
|
277
|
+
|
|
278
|
+
- Levenshtein basics, empty strings, and the early-exit sentinel (plus a
|
|
279
|
+
development-time fuzz check against full DP for randomized inputs);
|
|
280
|
+
- normalization, including scopes and repeated separators;
|
|
281
|
+
- exact/known short-circuit, punctuation variants, glued names, prefix
|
|
282
|
+
omission/difference, extra segments, one-edit typos, multiple candidates;
|
|
283
|
+
- empty known list, empty names, unrelated names;
|
|
284
|
+
- all version codes, duplicate/invalid versions, forward prerelease history,
|
|
285
|
+
clean history;
|
|
286
|
+
- severity mapping, deterministic sorting, tie-breaking by score;
|
|
287
|
+
- CLI help, JSON for `check`/`scan`, comments/blanks, missing known list,
|
|
288
|
+
unknown command, missing input, unreadable file, and exit codes.
|
|
289
|
+
|
|
290
|
+
Tests are offline and use only `%TEMP%`-style temporary directories for scan
|
|
291
|
+
fixtures (created with `mkdtemp` and removed afterward).
|
|
292
|
+
|
|
293
|
+
## 9. Security and performance
|
|
294
|
+
|
|
295
|
+
- No third-party dependencies and no network calls: nothing to trust beyond
|
|
296
|
+
Node and this source.
|
|
297
|
+
- No evaluation of package contents; scanned names/versions are only compared
|
|
298
|
+
and printed. JSON output uses `JSON.stringify`, so quotes/newlines in input
|
|
299
|
+
are escaped.
|
|
300
|
+
- O(names × known × name-length²) name comparison; names are short. The
|
|
301
|
+
Levenshtein banded mode is available for callers with large candidate sets.
|
|
302
|
+
- Version history is bounded in output examples (`missing` samples capped at
|
|
303
|
+
five) but all versions are parsed; pathological multimegabyte lists are the
|
|
304
|
+
caller's responsibility.
|
|
305
|
+
|
|
306
|
+
## 10. Future work
|
|
307
|
+
|
|
308
|
+
Only after the limitations above are addressed explicitly:
|
|
309
|
+
|
|
310
|
+
- optional registry adapter (opt-in; never required for offline use);
|
|
311
|
+
- conservative homoglyph/confusables normalization with a documented table;
|
|
312
|
+
- scope-hopping signal with allowlists;
|
|
313
|
+
- SARIF/JSON schema for CI ingestion;
|
|
314
|
+
- richer package metadata (maintainers, provenance, publish times) via a
|
|
315
|
+
separately audited data source.
|
|
316
|
+
|
|
317
|
+
None of these are implemented in `0.1.0`; this document is not a claim that
|
|
318
|
+
they exist.
|
|
319
|
+
|
|
320
|
+
## 11. Naming and distribution
|
|
321
|
+
|
|
322
|
+
- Package name: `dsh-supply-watch`.
|
|
323
|
+
- npm availability was checked on 2026-11-14 (`npm view dsh-supply-watch` ->
|
|
324
|
+
`E404 Not Found`); this is a point-in-time observation, not a reservation.
|
|
325
|
+
- License: Apache-2.0.
|
|
326
|
+
- Unofficial: not affiliated with DeepSeek.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|