pyapollo-config-client 0.2.0__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.
- pyapollo_config_client-0.2.0/.gitignore +10 -0
- pyapollo_config_client-0.2.0/CHANGELOG.md +62 -0
- pyapollo_config_client-0.2.0/COMPARISON.md +155 -0
- pyapollo_config_client-0.2.0/LICENSE +202 -0
- pyapollo_config_client-0.2.0/PKG-INFO +561 -0
- pyapollo_config_client-0.2.0/README.md +525 -0
- pyapollo_config_client-0.2.0/demo/__init__.py +1 -0
- pyapollo_config_client-0.2.0/demo/__main__.py +19 -0
- pyapollo_config_client-0.2.0/demo/main.py +256 -0
- pyapollo_config_client-0.2.0/demo/static/index.html +369 -0
- pyapollo_config_client-0.2.0/docs/clients-comparison.html +102 -0
- pyapollo_config_client-0.2.0/docs/clients-comparison.png +0 -0
- pyapollo_config_client-0.2.0/mock_apollo/__init__.py +19 -0
- pyapollo_config_client-0.2.0/mock_apollo/__main__.py +24 -0
- pyapollo_config_client-0.2.0/mock_apollo/app.py +237 -0
- pyapollo_config_client-0.2.0/mock_apollo/store.py +229 -0
- pyapollo_config_client-0.2.0/pyproject.toml +99 -0
- pyapollo_config_client-0.2.0/src/apollo_client/__init__.py +92 -0
- pyapollo_config_client-0.2.0/src/apollo_client/_version.py +3 -0
- pyapollo_config_client-0.2.0/src/apollo_client/async_client.py +1595 -0
- pyapollo_config_client-0.2.0/src/apollo_client/cache.py +197 -0
- pyapollo_config_client-0.2.0/src/apollo_client/client.py +1393 -0
- pyapollo_config_client-0.2.0/src/apollo_client/config.py +356 -0
- pyapollo_config_client-0.2.0/src/apollo_client/env.py +85 -0
- pyapollo_config_client-0.2.0/src/apollo_client/errors.py +46 -0
- pyapollo_config_client-0.2.0/src/apollo_client/meta.py +249 -0
- pyapollo_config_client-0.2.0/src/apollo_client/parser.py +239 -0
- pyapollo_config_client-0.2.0/src/apollo_client/py.typed +0 -0
- pyapollo_config_client-0.2.0/src/apollo_client/transport.py +546 -0
- pyapollo_config_client-0.2.0/src/apollo_client/utils.py +61 -0
- pyapollo_config_client-0.2.0/tests/__init__.py +0 -0
- pyapollo_config_client-0.2.0/tests/conftest.py +58 -0
- pyapollo_config_client-0.2.0/tests/helpers.py +109 -0
- pyapollo_config_client-0.2.0/tests/test_advanced.py +356 -0
- pyapollo_config_client-0.2.0/tests/test_async_client.py +349 -0
- pyapollo_config_client-0.2.0/tests/test_client.py +369 -0
- pyapollo_config_client-0.2.0/tests/test_config.py +162 -0
- pyapollo_config_client-0.2.0/tests/test_fastapi_demo.py +172 -0
- pyapollo_config_client-0.2.0/tests/test_packaging.py +12 -0
- pyapollo_config_client-0.2.0/tests/test_parser.py +186 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/).
|
|
7
|
+
|
|
8
|
+
## [0.2.0] - 2026-11-24
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **Namespace auto-discovery** through `/apps/{appId}/clusters/{cluster}/namespaces`
|
|
13
|
+
(`auto_discover=True` and `discover_namespaces()`); falls back to the explicit
|
|
14
|
+
namespace list when the endpoint is unavailable.
|
|
15
|
+
- **Scheduled polling** mode (`watch_mode="poll"`, `poll_interval`) as an
|
|
16
|
+
alternative to `/notifications/v2` long polling.
|
|
17
|
+
- **Meta Server discovery**: `meta_server_url` resolves Config Service addresses
|
|
18
|
+
from `/services/config` at start-up and refreshes them every
|
|
19
|
+
`meta_refresh_interval` seconds, supporting string and object payloads.
|
|
20
|
+
- **Heartbeat / reconciliation pulls** (`heartbeat_interval`, default 600s):
|
|
21
|
+
re-verify every namespace and repair notifications missed across restarts.
|
|
22
|
+
- **Runtime parameter updates** with `ApolloClient.update_options()`: URLs,
|
|
23
|
+
app/cluster, secret, timeouts, IP, watch mode, intervals, namespaces and
|
|
24
|
+
Meta Server can change without rebuilding the client.
|
|
25
|
+
- **Native asyncio client** `AsyncApolloClient` (optional `[async]` extra,
|
|
26
|
+
httpx) with long polling, polling, discovery, heartbeat, cache and
|
|
27
|
+
sync/async listeners.
|
|
28
|
+
- `ApolloClient.status()` / `AsyncApolloClient.status()` expose watch mode,
|
|
29
|
+
Config Service URLs, Meta Servers, last pull/heartbeat and heartbeat errors.
|
|
30
|
+
- New `APOLLO_*` environment variables for watch mode, intervals, Meta Server
|
|
31
|
+
and auto discovery.
|
|
32
|
+
- Mock Apollo now implements namespace discovery and `/services/config`.
|
|
33
|
+
- New tests for discovery, polling, Meta Server, heartbeat, runtime updates and
|
|
34
|
+
the asyncio client.
|
|
35
|
+
- GitHub Actions workflow (`.github/workflows/publish.yml`) that runs tests,
|
|
36
|
+
verifies the tag against the package version, builds wheel/sdist and
|
|
37
|
+
publishes to PyPI with the `PYPI_API_TOKEN` secret when a `v*` tag is
|
|
38
|
+
pushed (Trusted Publishing is also supported).
|
|
39
|
+
|
|
40
|
+
### Changed
|
|
41
|
+
|
|
42
|
+
- The watcher is split into a watch thread/task and a maintenance thread/task,
|
|
43
|
+
so long polls no longer delay heartbeat or Meta Server refresh work.
|
|
44
|
+
- `pyproject.toml` gains the `async` optional dependency group and the
|
|
45
|
+
`Framework :: AsyncIO` classifier; package version is now 0.2.0.
|
|
46
|
+
- `dist/` build outputs are no longer committed; releases are built by the
|
|
47
|
+
publish workflow on tag pushes.
|
|
48
|
+
|
|
49
|
+
## [0.1.0] - 2026-11-24
|
|
50
|
+
|
|
51
|
+
### Added
|
|
52
|
+
|
|
53
|
+
- Properties, YAML and JSON namespace parsing with format inference.
|
|
54
|
+
- Initial pull, manual `refresh()`, and `/notifications/v2` long-polling hot reload.
|
|
55
|
+
- Immutable `NamespaceConfig` snapshots with dotted-path and typed accessors.
|
|
56
|
+
- Structured change events (`added` / `updated` / `removed`) and namespace/key filters.
|
|
57
|
+
- Disk cache with atomic writes and offline fallback.
|
|
58
|
+
- Apollo HMAC-SHA1 `secret` authentication.
|
|
59
|
+
- Multiple Config Service URLs with automatic failover.
|
|
60
|
+
- FastAPI demo with config endpoints, SSE stream and live dashboard.
|
|
61
|
+
- In-memory Mock Apollo config service.
|
|
62
|
+
- Test suite covering parsers, pull, hot reload, cache, auth, FastAPI and SSE.
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# Apollo Python 客户端能力对比
|
|
2
|
+
|
|
3
|
+
对比时间:2026-11-24 · 参考图 1 的分组能力矩阵形式 · 基于各仓库默认实现
|
|
4
|
+
|
|
5
|
+
本文对比 Apollo 生态中常见的四个 Python 客户端与本次新增的 `pyapollo-config-client`:
|
|
6
|
+
|
|
7
|
+
- [filamoon/pyapollo](https://github.com/filamoon/pyapollo)
|
|
8
|
+
- [BruceWW/pyapollo](https://github.com/BruceWW/pyapollo)
|
|
9
|
+
- [xhrg-product/apollo-client-python](https://github.com/xhrg-product/apollo-client-python)
|
|
10
|
+
- [OuterCloud/pyapollo](https://github.com/OuterCloud/pyapollo)
|
|
11
|
+
- **pyapollo-config-client(本次新增)**
|
|
12
|
+
|
|
13
|
+
> 只比较客户端能力,不评价 Apollo 服务端或部署方式。
|
|
14
|
+
>
|
|
15
|
+
> ✅ 原生支持 · ⚠️ 部分支持 / 有前提 · ❌ 不支持
|
|
16
|
+
|
|
17
|
+
## 客户端概览
|
|
18
|
+
|
|
19
|
+
| 客户端 | 安装名 | 版本 | 最近 push⁸ | License |
|
|
20
|
+
| --- | --- | --- | --- | --- |
|
|
21
|
+
| [filamoon/pyapollo](https://github.com/filamoon/pyapollo) | `pyapollo` | 0.0.1.dev1 | 2020-03 | Apache-2.0 |
|
|
22
|
+
| [BruceWW/pyapollo](https://github.com/BruceWW/pyapollo) | `apollo-client` | 2.1.2 | 2020-10 | Apache-2.0 |
|
|
23
|
+
| [xhrg-product/apollo-client-python](https://github.com/xhrg-product/apollo-client-python) | `apollo-client-python` | 1.0.1 | 2025-06 | MIT⁷ |
|
|
24
|
+
| [OuterCloud/pyapollo](https://github.com/OuterCloud/pyapollo) | `pyapollo-zenkilan` | 0.2.0 | 2025-12 | MIT |
|
|
25
|
+
| **pyapollo-config-client(本次)** | `pyapollo-config-client` | 0.2.0 | 2026-11 | Apache-2.0 |
|
|
26
|
+
|
|
27
|
+
## 配置格式与读取
|
|
28
|
+
|
|
29
|
+
| 能力 | filamoon | BruceWW | xhrg | OuterCloud | **pyapollo-config-client** |
|
|
30
|
+
| --- | :---: | :---: | :---: | :---: | :---: |
|
|
31
|
+
| Properties 命名空间 | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
32
|
+
| YAML 命名空间 | ❌ | ❌ | ❌ | ❌ | **✅** |
|
|
33
|
+
| JSON 命名空间 | ❌ | ❌ | ❌ | ❌ | **✅** |
|
|
34
|
+
| 嵌套 / 点号路径读取 | ❌ | ❌ | ❌ | ❌ | **✅** |
|
|
35
|
+
| 类型化读取(int/bool/float) | ❌ | ❌ | ⚠️¹ | ⚠️² | **✅** |
|
|
36
|
+
| JSON 值解析 | ❌ | ❌ | ⚠️¹ | ✅ | **✅** |
|
|
37
|
+
| Namespace 自动发现 | ❌ | ✅⁶ | ❌ | ❌ | **✅¹¹** |
|
|
38
|
+
|
|
39
|
+
## 更新机制
|
|
40
|
+
|
|
41
|
+
| 能力 | filamoon | BruceWW | xhrg | OuterCloud | **pyapollo-config-client** |
|
|
42
|
+
| --- | :---: | :---: | :---: | :---: | :---: |
|
|
43
|
+
| 首次 / 主动 Pull | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
44
|
+
| 长轮询 `/notifications/v2` | ✅ | ❌ | ✅ | ❌ | **✅** |
|
|
45
|
+
| 定时轮询 | ❌ | ✅ | ❌ | ✅ | **✅¹²** |
|
|
46
|
+
| 变更回调 | ❌ | ❌ | ✅³ | ❌ | **✅** |
|
|
47
|
+
| 按 namespace / key 过滤 | ❌ | ❌ | ❌ | ❌ | **✅** |
|
|
48
|
+
| 结构化 diff | ❌ | ❌ | ⚠️³ | ❌ | **✅** |
|
|
49
|
+
|
|
50
|
+
默认刷新行为:
|
|
51
|
+
|
|
52
|
+
| 客户端 | 刷新机制 | 默认刷新周期 / 超时 |
|
|
53
|
+
| --- | --- | --- |
|
|
54
|
+
| filamoon | 长轮询 | 请求超时 35s |
|
|
55
|
+
| BruceWW | 定时全量刷新 | 300s |
|
|
56
|
+
| xhrg | 长轮询 + 循环 | 长轮询 75s,循环间隔 2s |
|
|
57
|
+
| OuterCloud | 定时全量刷新 | 30s |
|
|
58
|
+
| **pyapollo-config-client** | 长轮询(默认)/ 定时轮询 | 长轮询 60s;轮询 60s;心跳 600s;Meta 刷新 300s |
|
|
59
|
+
|
|
60
|
+
## 可靠性与安全
|
|
61
|
+
|
|
62
|
+
| 能力 | filamoon | BruceWW | xhrg | OuterCloud | **pyapollo-config-client** |
|
|
63
|
+
| --- | :---: | :---: | :---: | :---: | :---: |
|
|
64
|
+
| 内存缓存 | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
65
|
+
| 磁盘缓存 | ❌ | ✅ | ✅ | ✅ | ✅ |
|
|
66
|
+
| 离线 / 启动容灾 | ❌ | ✅ | ✅ | ✅ | ✅ |
|
|
67
|
+
| 多 Config Service 故障转移 | ❌ | ❌ | ❌ | ✅ | **✅** |
|
|
68
|
+
| Meta Server 服务发现 | ❌ | ❌ | ❌ | ✅ | **✅¹³** |
|
|
69
|
+
| Apollo App Secret HMAC | ❌ | ⚠️⁴ | ✅ | ✅ | ✅ |
|
|
70
|
+
| 灰度 IP | ✅ | ⚠️⁵ | ✅ | ⚠️⁵ | ✅ |
|
|
71
|
+
| 客户端心跳 | ❌ | ❌ | ✅ | ❌ | **✅¹⁴** |
|
|
72
|
+
| 运行时更新客户端参数 | ❌ | ❌ | ❌ | ✅ | **✅** |
|
|
73
|
+
|
|
74
|
+
## 工程化
|
|
75
|
+
|
|
76
|
+
| 能力 | filamoon | BruceWW | xhrg | OuterCloud | **pyapollo-config-client** |
|
|
77
|
+
| --- | :---: | :---: | :---: | :---: | :---: |
|
|
78
|
+
| 线程安全设计 | ❌ | ❌ | ❌ | ✅ | **✅** |
|
|
79
|
+
| 原生异步客户端 | ❌ | ❌ | ❌ | ✅ | **✅¹⁰** |
|
|
80
|
+
| `py.typed` / 类型标注 | ❌ | ❌ | ❌ | ⚠️ | **✅** |
|
|
81
|
+
| 自动化测试 | ❌ | ⚠️ | ❌ | ⚠️ | **✅ 68 个** |
|
|
82
|
+
| 现代 pyproject 打包⁹ | ⚠️ | ⚠️ | ⚠️ | ✅ | **✅** |
|
|
83
|
+
| Python 支持 | 2.7 / 3.6 | 3.5+;3.13 不可用 | 2.x / 3.x | >=3.7;3.13 已测 | **>=3.10;3.10 / 3.13 已测** |
|
|
84
|
+
|
|
85
|
+
## 备注
|
|
86
|
+
|
|
87
|
+
¹ xhrg 通过 `eval` / `json.loads` 做类型转换,功能上支持,但存在安全风险;`get_value` 直接返回转换后的值。
|
|
88
|
+
|
|
89
|
+
² OuterCloud 只提供 `get_json_value`,没有 int / bool / float 等完整类型化 API。
|
|
90
|
+
|
|
91
|
+
³ xhrg 的回调形如 `(action, namespace, key, value)`,能表达 add / update / delete,但没有统一的事件对象或快照 diff。
|
|
92
|
+
|
|
93
|
+
⁴ BruceWW 支持传入静态 `Authorization` 请求头,但不是 Apollo App Secret 的 HMAC-SHA1 签名。
|
|
94
|
+
|
|
95
|
+
⁵ BruceWW 和 OuterCloud 都保存了 `ip` 参数,但当前代码在 `/configs` 请求中未携带 `ip`,灰度发布不会生效。
|
|
96
|
+
|
|
97
|
+
⁶ BruceWW 通过旧版 `/apps/{app}/clusters/{cluster}/namespaces` 接口自动发现 namespace;现代 Apollo 版本该接口可能返回 404。
|
|
98
|
+
|
|
99
|
+
⁷ xhrg 的 `setup.py` 声明 MIT,但仓库中没有 LICENSE 文件;如需商用请自行确认授权。
|
|
100
|
+
|
|
101
|
+
⁸ 最近 push 时间取自 GitHub API(2026-11-24 查询),版本号取自各仓库的 `setup.py` / `pyproject.toml`。
|
|
102
|
+
|
|
103
|
+
⁹ “现代打包”指包含 `pyproject.toml` 且可构建 wheel / sdist;仅有 `setup.py` 的记为部分支持。
|
|
104
|
+
|
|
105
|
+
¹⁰ `pyapollo-config-client` 提供原生 asyncio 客户端 `AsyncApolloClient`,位于可选依赖组 `[async]`(httpx);核心包仍只依赖 `requests` 与 `PyYAML`。同步客户端仍是默认入口。
|
|
106
|
+
|
|
107
|
+
¹¹ `pyapollo-config-client` 的 Namespace 自动发现同样使用旧版 `/apps/{app}/clusters/{cluster}/namespaces` 接口;该接口不可用时自动降级为显式 namespace 列表,不阻塞启动。
|
|
108
|
+
|
|
109
|
+
¹² `pyapollo-config-client` 通过 `watch_mode="long_poll"`(默认)或 `"poll"` 选择刷新机制;定时轮询间隔由 `poll_interval` 控制,运行中可切换。
|
|
110
|
+
|
|
111
|
+
¹³ Meta Server 解析 `GET {meta}/services/config`,兼容字符串列表、`{"configServers": [...]}` 与 `{"homepageUrl": ...}` 三种响应;解析失败时保留当前 Config Service 地址。
|
|
112
|
+
|
|
113
|
+
¹⁴ 心跳是默认 600s 的定期全量补偿拉取(与 xhrg 一致),用于修复重启 / 网络抖动期间漏掉的通知;可通过 `heartbeat_interval` 调整或关闭,并通过 `status()` 暴露 `lastHeartbeatAt` / `heartbeatOk`。
|
|
114
|
+
|
|
115
|
+
## 选型建议
|
|
116
|
+
|
|
117
|
+
| 场景 | 建议 |
|
|
118
|
+
| --- | --- |
|
|
119
|
+
| 只需要最简 properties 拉取,且能接受长期不维护 | filamoon 实现最短,但缺少容灾与回调,不建议新项目直接采用 |
|
|
120
|
+
| 需要 properties、namespace 自动发现、文件缓存,能接受 300s 延迟 | BruceWW,但注意 Python 3.13 的 `telnetlib` 问题 |
|
|
121
|
+
| 需要 properties、长轮询、secret、回调、心跳 | xhrg,但注意无 LICENSE 文件、无过滤/事件对象 |
|
|
122
|
+
| 需要 Meta Server 发现、多节点、JSON 值解析 | OuterCloud |
|
|
123
|
+
| 需要 YAML / Properties、双模热更新、服务发现、心跳、结构化 diff、同步 + 异步 | **pyapollo-config-client** |
|
|
124
|
+
|
|
125
|
+
### 本次客户端的取舍
|
|
126
|
+
|
|
127
|
+
`pyapollo-config-client` 0.2.0 已覆盖此前矩阵中所有标记为“不支持”的能力:
|
|
128
|
+
|
|
129
|
+
- YAML / JSON namespace 与 Properties 原生字符串语义;
|
|
130
|
+
- 长轮询与定时轮询两种刷新机制,监听器可按 namespace、key 过滤,事件包含 added / updated / removed;
|
|
131
|
+
- Namespace 自动发现、Meta Server 服务发现及定期刷新;
|
|
132
|
+
- 心跳补偿拉取、磁盘缓存、secret 签名、多 Config Service 故障转移;
|
|
133
|
+
- 运行时更新客户端参数(地址、密钥、超时、灰度 IP、刷新模式、namespace 等);
|
|
134
|
+
- 同步客户端与原生 asyncio 客户端,共享解析、签名、缓存与事件语义;
|
|
135
|
+
- wheel / sdist、`py.typed` 和 68 个测试。
|
|
136
|
+
|
|
137
|
+
仍有前提或需要说明的地方:
|
|
138
|
+
|
|
139
|
+
- Namespace 自动发现依赖 Apollo 的旧版发现接口,新版本未开放时只能使用显式列表;
|
|
140
|
+
- 异步客户端需要安装可选依赖 `pyapollo-config-client[async]`(httpx),同步客户端不引入额外依赖;
|
|
141
|
+
- 心跳默认每 600s 一次全量拉取,可能带来额外请求;对请求量敏感的场景可调大间隔或关闭;
|
|
142
|
+
- Meta Server 仅实现 `/services/config` 解析,不包含 Eureka 注册中心协议本身。
|
|
143
|
+
|
|
144
|
+
## 视觉对比图
|
|
145
|
+
|
|
146
|
+

|
|
147
|
+
|
|
148
|
+
[HTML 版本](docs/clients-comparison.html)(可直接在浏览器打开或打印)
|
|
149
|
+
|
|
150
|
+
## 对比口径
|
|
151
|
+
|
|
152
|
+
- 以各仓库默认分支 HEAD 为准:filamoon `edd936e`、BruceWW `f4fb864`、xhrg `de0507a`、OuterCloud `7a7e646`。
|
|
153
|
+
- “支持”按默认实现判断,不计 fork、插件或自行补丁;Apollo 服务端能力(如灰度规则本身)不计入客户端能力。
|
|
154
|
+
- 维护状态以 GitHub 最近一次 push 时间为参考,不代表项目质量或安全性结论。
|
|
155
|
+
- 本表会随各项目演进变化,建议发布前重新核对。
|
|
@@ -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.
|