kritalon 0.0.1__tar.gz
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.
- kritalon-0.0.1/.gitattributes +1 -0
- kritalon-0.0.1/.github/workflows/tests.yml +80 -0
- kritalon-0.0.1/.gitignore +28 -0
- kritalon-0.0.1/CHANGELOG.md +48 -0
- kritalon-0.0.1/LICENSE +202 -0
- kritalon-0.0.1/PKG-INFO +495 -0
- kritalon-0.0.1/README.md +464 -0
- kritalon-0.0.1/SECURITY.md +30 -0
- kritalon-0.0.1/action.yml +76 -0
- kritalon-0.0.1/docs/never-do.md +26 -0
- kritalon-0.0.1/docs/rules-of-engagement.md +75 -0
- kritalon-0.0.1/examples/support_bot.py +98 -0
- kritalon-0.0.1/integrations/claude-code/.claude-plugin/plugin.json +17 -0
- kritalon-0.0.1/integrations/claude-code/.mcp.json +8 -0
- kritalon-0.0.1/integrations/claude-code/README.md +31 -0
- kritalon-0.0.1/integrations/claude-code/skills/test-my-bot/SKILL.md +40 -0
- kritalon-0.0.1/js/harness/LICENSE +202 -0
- kritalon-0.0.1/js/harness/README.md +269 -0
- kritalon-0.0.1/js/harness/examples/support-bot.mjs +108 -0
- kritalon-0.0.1/js/harness/index.d.ts +307 -0
- kritalon-0.0.1/js/harness/index.js +1164 -0
- kritalon-0.0.1/js/harness/package.json +36 -0
- kritalon-0.0.1/js/harness/test/adapters.test.js +247 -0
- kritalon-0.0.1/js/harness/test/bot.mjs +53 -0
- kritalon-0.0.1/js/harness/test/context.test.js +104 -0
- kritalon-0.0.1/js/harness/test/express.test.js +127 -0
- kritalon-0.0.1/js/harness/test/fetch.test.js +140 -0
- kritalon-0.0.1/js/harness/test/firstscan.test.js +357 -0
- kritalon-0.0.1/js/harness/test/index.js +14 -0
- kritalon-0.0.1/js/harness/test/interop.mjs +68 -0
- kritalon-0.0.1/js/harness/test/live.test.js +480 -0
- kritalon-0.0.1/js/harness/test/strict.test.js +162 -0
- kritalon-0.0.1/js/harness/test/token.test.js +213 -0
- kritalon-0.0.1/js/harness/test/worker.mjs +14 -0
- kritalon-0.0.1/pyproject.toml +64 -0
- kritalon-0.0.1/src/kritalon/__init__.py +3 -0
- kritalon-0.0.1/src/kritalon/__main__.py +8 -0
- kritalon-0.0.1/src/kritalon/attacks/__init__.py +0 -0
- kritalon-0.0.1/src/kritalon/attacks/adaptive.py +495 -0
- kritalon-0.0.1/src/kritalon/attacks/library.py +239 -0
- kritalon-0.0.1/src/kritalon/attacks/pyrit_adapter.py +227 -0
- kritalon-0.0.1/src/kritalon/attacks/strategy.py +157 -0
- kritalon-0.0.1/src/kritalon/authorize_cli.py +148 -0
- kritalon-0.0.1/src/kritalon/ci.py +122 -0
- kritalon-0.0.1/src/kritalon/cli.py +464 -0
- kritalon-0.0.1/src/kritalon/console.py +240 -0
- kritalon-0.0.1/src/kritalon/core/__init__.py +0 -0
- kritalon-0.0.1/src/kritalon/core/authorization.py +550 -0
- kritalon-0.0.1/src/kritalon/core/benchmark.py +199 -0
- kritalon-0.0.1/src/kritalon/core/canary.py +80 -0
- kritalon-0.0.1/src/kritalon/core/judge.py +175 -0
- kritalon-0.0.1/src/kritalon/core/matcher.py +367 -0
- kritalon-0.0.1/src/kritalon/core/meter.py +228 -0
- kritalon-0.0.1/src/kritalon/core/models.py +560 -0
- kritalon-0.0.1/src/kritalon/core/preflight.py +283 -0
- kritalon-0.0.1/src/kritalon/core/replay.py +145 -0
- kritalon-0.0.1/src/kritalon/core/runner.py +39 -0
- kritalon-0.0.1/src/kritalon/core/scan.py +917 -0
- kritalon-0.0.1/src/kritalon/core/stats.py +42 -0
- kritalon-0.0.1/src/kritalon/demo.py +215 -0
- kritalon-0.0.1/src/kritalon/doctor.py +271 -0
- kritalon-0.0.1/src/kritalon/egress_trap.py +243 -0
- kritalon-0.0.1/src/kritalon/exits.py +38 -0
- kritalon-0.0.1/src/kritalon/frameworks.py +453 -0
- kritalon-0.0.1/src/kritalon/harness.py +893 -0
- kritalon-0.0.1/src/kritalon/harness_tools.py +260 -0
- kritalon-0.0.1/src/kritalon/llm/__init__.py +0 -0
- kritalon-0.0.1/src/kritalon/llm/base.py +31 -0
- kritalon-0.0.1/src/kritalon/llm/ollama.py +165 -0
- kritalon-0.0.1/src/kritalon/llm/scripted.py +122 -0
- kritalon-0.0.1/src/kritalon/mcp_server.py +618 -0
- kritalon-0.0.1/src/kritalon/practice_server.py +190 -0
- kritalon-0.0.1/src/kritalon/presets.py +222 -0
- kritalon-0.0.1/src/kritalon/quick.py +485 -0
- kritalon-0.0.1/src/kritalon/report_html.py +588 -0
- kritalon-0.0.1/src/kritalon/report_markdown.py +472 -0
- kritalon-0.0.1/src/kritalon/reporting.py +73 -0
- kritalon-0.0.1/src/kritalon/seal.py +245 -0
- kritalon-0.0.1/src/kritalon/shell.py +40 -0
- kritalon-0.0.1/src/kritalon/sterility.py +407 -0
- kritalon-0.0.1/src/kritalon/targets/__init__.py +0 -0
- kritalon-0.0.1/src/kritalon/targets/base.py +207 -0
- kritalon-0.0.1/src/kritalon/targets/hardened.py +360 -0
- kritalon-0.0.1/src/kritalon/targets/http.py +826 -0
- kritalon-0.0.1/src/kritalon/targets/registry.py +96 -0
- kritalon-0.0.1/src/kritalon/targets/toy.py +310 -0
- kritalon-0.0.1/tests/test_actions.py +534 -0
- kritalon-0.0.1/tests/test_actions_review.py +483 -0
- kritalon-0.0.1/tests/test_adaptive.py +337 -0
- kritalon-0.0.1/tests/test_authorization.py +821 -0
- kritalon-0.0.1/tests/test_benchmark.py +84 -0
- kritalon-0.0.1/tests/test_canary_styles.py +224 -0
- kritalon-0.0.1/tests/test_ci.py +100 -0
- kritalon-0.0.1/tests/test_claims.py +153 -0
- kritalon-0.0.1/tests/test_cli.py +223 -0
- kritalon-0.0.1/tests/test_console.py +138 -0
- kritalon-0.0.1/tests/test_demo.py +53 -0
- kritalon-0.0.1/tests/test_doctor.py +197 -0
- kritalon-0.0.1/tests/test_egress_trap.py +174 -0
- kritalon-0.0.1/tests/test_frameworks.py +150 -0
- kritalon-0.0.1/tests/test_harness.py +798 -0
- kritalon-0.0.1/tests/test_harness_frameworks.py +135 -0
- kritalon-0.0.1/tests/test_harness_js.py +398 -0
- kritalon-0.0.1/tests/test_harness_live.py +463 -0
- kritalon-0.0.1/tests/test_harness_tools.py +459 -0
- kritalon-0.0.1/tests/test_http_inputs.py +320 -0
- kritalon-0.0.1/tests/test_http_target.py +422 -0
- kritalon-0.0.1/tests/test_matcher.py +312 -0
- kritalon-0.0.1/tests/test_mcp_server.py +304 -0
- kritalon-0.0.1/tests/test_ollama.py +214 -0
- kritalon-0.0.1/tests/test_presets.py +159 -0
- kritalon-0.0.1/tests/test_provenance.py +173 -0
- kritalon-0.0.1/tests/test_pyrit_adapter.py +75 -0
- kritalon-0.0.1/tests/test_quick.py +447 -0
- kritalon-0.0.1/tests/test_report_html.py +332 -0
- kritalon-0.0.1/tests/test_report_markdown.py +494 -0
- kritalon-0.0.1/tests/test_runner.py +557 -0
- kritalon-0.0.1/tests/test_seal.py +155 -0
- kritalon-0.0.1/tests/test_shell.py +55 -0
- kritalon-0.0.1/tests/test_stats.py +36 -0
- kritalon-0.0.1/tests/test_sterility.py +417 -0
- kritalon-0.0.1/tests/test_tools.py +50 -0
- kritalon-0.0.1/tests/test_toy_target.py +139 -0
- kritalon-0.0.1/tools/regenerate_js_fixtures.py +81 -0
- kritalon-0.0.1/tools/rename_project.py +130 -0
- kritalon-0.0.1/uv.lock +4949 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
* text=auto eol=lf
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
name: tests
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches: [main]
|
|
5
|
+
pull_request:
|
|
6
|
+
permissions:
|
|
7
|
+
contents: read
|
|
8
|
+
jobs:
|
|
9
|
+
test:
|
|
10
|
+
runs-on: ${{ matrix.os }}
|
|
11
|
+
strategy:
|
|
12
|
+
fail-fast: false
|
|
13
|
+
matrix:
|
|
14
|
+
os: [ubuntu-latest, windows-latest]
|
|
15
|
+
python: ["3.11", "3.12", "3.13"]
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
|
18
|
+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
|
|
19
|
+
with:
|
|
20
|
+
python-version: ${{ matrix.python }}
|
|
21
|
+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
|
22
|
+
with:
|
|
23
|
+
node-version: "22"
|
|
24
|
+
- run: python -m pip install -e . pytest ruff
|
|
25
|
+
- run: python -m ruff check src tests examples
|
|
26
|
+
- run: python -m pytest -q
|
|
27
|
+
- run: node --test "js/harness/test/*.test.js"
|
|
28
|
+
adapters:
|
|
29
|
+
# The framework adapters fail closed only if each framework still dispatches tools the way the
|
|
30
|
+
# adapter expects. These tests are skipped without the libraries, so this job installs them.
|
|
31
|
+
runs-on: ubuntu-latest
|
|
32
|
+
steps:
|
|
33
|
+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
|
34
|
+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
|
|
35
|
+
with:
|
|
36
|
+
python-version: "3.12"
|
|
37
|
+
- run: python -m pip install -e ".[agents,langchain,claude-agent]" pytest
|
|
38
|
+
- run: python -m pytest -q tests/test_harness_tools.py -rs
|
|
39
|
+
- name: None of the adapter tests was skipped
|
|
40
|
+
run: python -m pytest -q tests/test_harness_tools.py -rs | (! grep -q "SKIPPED")
|
|
41
|
+
frameworks:
|
|
42
|
+
# The drop-in harness on the real web frameworks. These tests are skipped without the libraries.
|
|
43
|
+
runs-on: ubuntu-latest
|
|
44
|
+
steps:
|
|
45
|
+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
|
46
|
+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
|
|
47
|
+
with:
|
|
48
|
+
python-version: "3.12"
|
|
49
|
+
- run: python -m pip install -e . pytest flask quart fastapi
|
|
50
|
+
- run: python -m pytest -q tests/test_harness_frameworks.py -rs
|
|
51
|
+
- name: None of the framework tests was skipped
|
|
52
|
+
run: python -m pytest -q tests/test_harness_frameworks.py -rs | (! grep -q "SKIPPED")
|
|
53
|
+
practice-scan:
|
|
54
|
+
# The action, run on the built-in practice bots: the vulnerable one must be caught and the
|
|
55
|
+
# fixed one must come out clean. Nothing leaves the runner.
|
|
56
|
+
runs-on: ubuntu-latest
|
|
57
|
+
steps:
|
|
58
|
+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
|
59
|
+
- id: vulnerable
|
|
60
|
+
uses: ./
|
|
61
|
+
with:
|
|
62
|
+
target: toy:vulnerable
|
|
63
|
+
fail-on: never
|
|
64
|
+
report-dir: report-vulnerable
|
|
65
|
+
upload: "false"
|
|
66
|
+
- id: fixed
|
|
67
|
+
uses: ./
|
|
68
|
+
with:
|
|
69
|
+
target: toy:fixed
|
|
70
|
+
fail-on: inconclusive
|
|
71
|
+
report-dir: report-fixed
|
|
72
|
+
upload: "false"
|
|
73
|
+
- name: The vulnerable bot was caught and the fixed one was not
|
|
74
|
+
shell: bash
|
|
75
|
+
env:
|
|
76
|
+
VULNERABLE: ${{ steps.vulnerable.outputs.status }}
|
|
77
|
+
FIXED: ${{ steps.fixed.outputs.status }}
|
|
78
|
+
run: |
|
|
79
|
+
test "$VULNERABLE" = "violations_verified"
|
|
80
|
+
test "$FIXED" = "no_verified_violations"
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
.venv/
|
|
5
|
+
dist/
|
|
6
|
+
build/
|
|
7
|
+
*.egg-info/
|
|
8
|
+
.pytest_cache/
|
|
9
|
+
.ruff_cache/
|
|
10
|
+
|
|
11
|
+
# Scan output
|
|
12
|
+
/reports/
|
|
13
|
+
*.kritalon.json
|
|
14
|
+
|
|
15
|
+
# Internal business documents: kept out of the repository because it is meant to be open-sourced.
|
|
16
|
+
/PROJECT_BRIEF.md
|
|
17
|
+
/PLAN.md
|
|
18
|
+
/research/
|
|
19
|
+
|
|
20
|
+
# Authorizations name real people and the sites they control; they stay on this machine.
|
|
21
|
+
kritalon.authorizations.json
|
|
22
|
+
.kritalon-auth-*
|
|
23
|
+
|
|
24
|
+
# Descriptions of real bots; may name internal addresses.
|
|
25
|
+
kritalon.targets.json
|
|
26
|
+
|
|
27
|
+
# Adapters and runs for the owner's own systems; internal, never published.
|
|
28
|
+
/local/
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
Nothing has been released yet. This lists what the first release will contain.
|
|
4
|
+
|
|
5
|
+
## Unreleased
|
|
6
|
+
|
|
7
|
+
### Finding problems
|
|
8
|
+
- Disclosure, forbidden-action and planted-text attacks, with a static list and an adaptive attacker (built in, or PyRIT behind the same interface).
|
|
9
|
+
- Fake secrets ("canaries") in two styles: a code, and an invented name for places where a bot would refuse to repeat a code-like value.
|
|
10
|
+
- A matcher that recognizes a leaked secret in plain text, re-cased, reversed, rot13, URL-encoded, base64, hex, spelled out or split across replies, with the odds of a chance match stated in every report's limitations.
|
|
11
|
+
- Every finding is replayed from a clean state, with discovery and reproduction rates and their intervals.
|
|
12
|
+
- A scan that could not have seen a failure is reported as inconclusive, never as clean.
|
|
13
|
+
|
|
14
|
+
### Connecting a bot
|
|
15
|
+
- Built-in practice bots (vulnerable, hardened, fixed).
|
|
16
|
+
- Any bot over HTTP, described in one JSON file.
|
|
17
|
+
- A drop-in harness for Python (ASGI and WSGI) and JavaScript (Node, Express, fetch-style): mark the risky tools and where a secret lives; nothing changes for real users.
|
|
18
|
+
- `harness_tools`: hand over a whole tool list (plain functions, OpenAI Agents SDK, LangChain, Claude Agent SDK); every tool not listed as read-only is recorded during a test, so a forgotten tool is blocked, not run.
|
|
19
|
+
- Bots built in a no-code builder: the fake secret travels in the chat request (`"harness": "inputs"`), with nothing added to the bot. `kritalon init` writes the description for Flowise, Dify and Langflow.
|
|
20
|
+
- A first scan with no description file: `kritalon scan http://localhost:8000/chat`. The harness tells the scanner which tools are marked and which secrets the bot reads, and provides the legitimate route for each secret through a pass phrase used in control conversations only.
|
|
21
|
+
- The first scan also tests text the bot reads from elsewhere, at each place the code reads with `pp.content(...)`; `--message` names the ordinary request to use.
|
|
22
|
+
- A Flask or Quart app is wrapped in place, so `app.run()` and its routes keep working and are wrapped.
|
|
23
|
+
- A secret that the bot's code reads only once, when it starts, is named by the first scan with what to change.
|
|
24
|
+
- A terminal summary that leads with the verdict, groups findings, and shows one real exchange.
|
|
25
|
+
- Anything a scan never tried (secret leaks, forbidden actions, text the bot reads from elsewhere) is named directly under the verdict in every output, and is never shown as a zero.
|
|
26
|
+
- `kritalon doctor` checks a setup step by step and names the fix.
|
|
27
|
+
- `kritalon mcp` lets a coding assistant set a bot up, scan it and read the report. It cannot authorize a test. Its `first_scan` tool scans a bot from its chat address alone, once a person has authorized that address.
|
|
28
|
+
- A Claude Code plugin in `integrations/claude-code`: that connection and one skill.
|
|
29
|
+
- `kritalon demo` shows the whole flow on one machine in about a minute.
|
|
30
|
+
|
|
31
|
+
### Doing no harm
|
|
32
|
+
- No scan without a named person's authorization for one exact address, and proof of control of it.
|
|
33
|
+
- Tools must be recorders before any attack is sent.
|
|
34
|
+
- A bot carrying the harness refuses any test message it cannot verify.
|
|
35
|
+
- Live testing under caps: a tool runs for real only when a cap in the bot's code, a switch on the deployment, the signed session and the authorization all agree; a call outside a cap is recorded and not run.
|
|
36
|
+
- `kritalon sterile-check` looks for production keys on a test deployment, by name and known prefix only.
|
|
37
|
+
- Limits on messages, tool calls and time, and a stop that takes effect at once.
|
|
38
|
+
- `kritalon egress-trap`: a trap you run next to a bot to record and refuse its outbound web traffic, with a hash-chained log. No scan starts it by itself.
|
|
39
|
+
- Every scan request is labelled as test traffic.
|
|
40
|
+
- A name under `.localhost` counts as this machine only if every address it resolves to is a loopback one.
|
|
41
|
+
- Scanning an address again never loses a description that was edited by hand: the earlier one is kept beside it.
|
|
42
|
+
|
|
43
|
+
### Evidence
|
|
44
|
+
- JSON, Markdown and self-contained HTML reports, with the transcript behind every finding. The browser report groups findings by what was reached and folds all but the first of each group.
|
|
45
|
+
- A report says when the legitimate route for a secret was supplied by the test itself, and what that does and does not show.
|
|
46
|
+
- Findings and coverage mapped to public frameworks, with the tester and their independence stated.
|
|
47
|
+
- `kritalon seal` and `check-seal`: an evidence bundle anyone can check later.
|
|
48
|
+
- `kritalon ci` and a GitHub Action: scan, report, seal, and fail the build on a proven finding.
|
kritalon-0.0.1/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.
|