gimacpay 0.1.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.
- gimacpay-0.1.0/.github/workflows/ci.yml +76 -0
- gimacpay-0.1.0/.github/workflows/release.yml +113 -0
- gimacpay-0.1.0/.gitignore +47 -0
- gimacpay-0.1.0/CHANGELOG.md +51 -0
- gimacpay-0.1.0/CONTRIBUTING.md +101 -0
- gimacpay-0.1.0/LICENSE +202 -0
- gimacpay-0.1.0/PKG-INFO +311 -0
- gimacpay-0.1.0/README.md +280 -0
- gimacpay-0.1.0/SECURITY.md +139 -0
- gimacpay-0.1.0/docs/2026-10-gimacpay-specification-findings.fr.md +342 -0
- gimacpay-0.1.0/docs/2026-10-gimacpay-specification-findings.md +329 -0
- gimacpay-0.1.0/pyproject.toml +79 -0
- gimacpay-0.1.0/scripts/check_wheel.py +81 -0
- gimacpay-0.1.0/src/gimacpay/__init__.py +119 -0
- gimacpay-0.1.0/src/gimacpay/__main__.py +217 -0
- gimacpay-0.1.0/src/gimacpay/builders.py +339 -0
- gimacpay-0.1.0/src/gimacpay/client.py +512 -0
- gimacpay-0.1.0/src/gimacpay/errors.py +159 -0
- gimacpay-0.1.0/src/gimacpay/intents.py +205 -0
- gimacpay-0.1.0/src/gimacpay/models.py +282 -0
- gimacpay-0.1.0/src/gimacpay/money.py +164 -0
- gimacpay-0.1.0/src/gimacpay/py.typed +0 -0
- gimacpay-0.1.0/tests/conftest.py +254 -0
- gimacpay-0.1.0/tests/test_auth.py +150 -0
- gimacpay-0.1.0/tests/test_errors.py +190 -0
- gimacpay-0.1.0/tests/test_intents.py +361 -0
- gimacpay-0.1.0/tests/test_models.py +176 -0
- gimacpay-0.1.0/tests/test_money.py +122 -0
- gimacpay-0.1.0/tests/test_resolve.py +159 -0
- gimacpay-0.1.0/tests/test_send.py +194 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
test:
|
|
15
|
+
name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
|
|
16
|
+
runs-on: ${{ matrix.os }}
|
|
17
|
+
strategy:
|
|
18
|
+
fail-fast: false
|
|
19
|
+
matrix:
|
|
20
|
+
os: [ubuntu-latest]
|
|
21
|
+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
|
|
22
|
+
include:
|
|
23
|
+
# One run on Windows, because the package advertises OS independence
|
|
24
|
+
# and the development machine is Windows.
|
|
25
|
+
- os: windows-latest
|
|
26
|
+
python-version: "3.13"
|
|
27
|
+
|
|
28
|
+
steps:
|
|
29
|
+
- uses: actions/checkout@v4
|
|
30
|
+
|
|
31
|
+
- uses: actions/setup-python@v5
|
|
32
|
+
with:
|
|
33
|
+
python-version: ${{ matrix.python-version }}
|
|
34
|
+
|
|
35
|
+
- name: Install the package and its development tools
|
|
36
|
+
run: |
|
|
37
|
+
python -m pip install --upgrade pip
|
|
38
|
+
pip install -e ".[dev]"
|
|
39
|
+
|
|
40
|
+
- name: Lint
|
|
41
|
+
run: ruff check .
|
|
42
|
+
|
|
43
|
+
- name: Test
|
|
44
|
+
run: pytest -q
|
|
45
|
+
|
|
46
|
+
- name: Check the formatting of the public API
|
|
47
|
+
run: ruff format --check .
|
|
48
|
+
|
|
49
|
+
no-dependencies:
|
|
50
|
+
name: Prove there are no runtime dependencies
|
|
51
|
+
runs-on: ubuntu-latest
|
|
52
|
+
steps:
|
|
53
|
+
- uses: actions/checkout@v4
|
|
54
|
+
- uses: actions/setup-python@v5
|
|
55
|
+
with:
|
|
56
|
+
python-version: "3.13"
|
|
57
|
+
|
|
58
|
+
- name: Install only the package, with no extras
|
|
59
|
+
run: pip install .
|
|
60
|
+
|
|
61
|
+
- name: Import with site-packages disabled
|
|
62
|
+
run: |
|
|
63
|
+
# -S removes site-packages from sys.path, so this import can only
|
|
64
|
+
# succeed through PYTHONPATH=src. If the package imported anything
|
|
65
|
+
# third-party, it would fail here -- that is the proof.
|
|
66
|
+
PYTHONPATH=src python -S -c "import gimacpay; print('gimacpay', gimacpay.__version__)"
|
|
67
|
+
|
|
68
|
+
- name: Assert the dependency list is empty
|
|
69
|
+
run: |
|
|
70
|
+
python - <<'PY'
|
|
71
|
+
import importlib.metadata as md
|
|
72
|
+
requires = md.requires("gimacpay") or []
|
|
73
|
+
runtime = [r for r in requires if "extra ==" not in r]
|
|
74
|
+
assert not runtime, f"runtime dependencies found: {runtime}"
|
|
75
|
+
print("no runtime dependencies declared")
|
|
76
|
+
PY
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: ["v*"]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
inputs:
|
|
8
|
+
confirm:
|
|
9
|
+
description: 'Type "publish" to upload to PyPI'
|
|
10
|
+
required: true
|
|
11
|
+
default: "no"
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
# ------------------------------------------------------------------ #
|
|
18
|
+
# 1. Build, and attach the artifacts to a GitHub Release on a tag push.
|
|
19
|
+
# ------------------------------------------------------------------ #
|
|
20
|
+
build:
|
|
21
|
+
name: Build and attach
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
permissions:
|
|
24
|
+
contents: write
|
|
25
|
+
steps:
|
|
26
|
+
- uses: actions/checkout@v4
|
|
27
|
+
with:
|
|
28
|
+
fetch-depth: 0
|
|
29
|
+
|
|
30
|
+
- uses: actions/setup-python@v5
|
|
31
|
+
with:
|
|
32
|
+
python-version: "3.13"
|
|
33
|
+
|
|
34
|
+
- name: Resolve the tag being released
|
|
35
|
+
id: ref
|
|
36
|
+
run: |
|
|
37
|
+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
|
38
|
+
tag=$(git tag -l 'v*' --sort=-v:refname | head -n1)
|
|
39
|
+
if [ -z "$tag" ]; then
|
|
40
|
+
echo "no v* tag found; tag a release before publishing" >&2
|
|
41
|
+
exit 1
|
|
42
|
+
fi
|
|
43
|
+
echo "manual dispatch: building $tag"
|
|
44
|
+
git checkout --detach "refs/tags/$tag"
|
|
45
|
+
echo "tag=$tag" >> "$GITHUB_OUTPUT"
|
|
46
|
+
else
|
|
47
|
+
echo "tag push: building ${{ github.ref_name }}"
|
|
48
|
+
echo "tag=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
|
|
49
|
+
fi
|
|
50
|
+
|
|
51
|
+
- name: Install the build tools
|
|
52
|
+
run: |
|
|
53
|
+
python -m pip install --upgrade pip build twine
|
|
54
|
+
|
|
55
|
+
- name: Build
|
|
56
|
+
run: python -m build
|
|
57
|
+
|
|
58
|
+
- name: Check the artifacts
|
|
59
|
+
run: |
|
|
60
|
+
twine check dist/*
|
|
61
|
+
python scripts/check_wheel.py dist
|
|
62
|
+
|
|
63
|
+
- name: Verify the tests pass on the tagged commit
|
|
64
|
+
run: |
|
|
65
|
+
pip install -e ".[dev]"
|
|
66
|
+
pytest -q
|
|
67
|
+
|
|
68
|
+
- name: Attach the artifacts to the GitHub Release
|
|
69
|
+
if: github.event_name == 'push'
|
|
70
|
+
uses: softprops/action-gh-release@v2
|
|
71
|
+
with:
|
|
72
|
+
files: |
|
|
73
|
+
dist/*.whl
|
|
74
|
+
dist/*.tar.gz
|
|
75
|
+
generate_release_notes: true
|
|
76
|
+
|
|
77
|
+
- uses: actions/upload-artifact@v4
|
|
78
|
+
with:
|
|
79
|
+
name: dist
|
|
80
|
+
path: dist/
|
|
81
|
+
|
|
82
|
+
# ------------------------------------------------------------------ #
|
|
83
|
+
# 2. Publish to PyPI. Manual only, and only with an explicit confirmation.
|
|
84
|
+
#
|
|
85
|
+
# A tag push deliberately does NOT publish. PyPI is a one-way door: a
|
|
86
|
+
# released version can be yanked, never replaced. So the tag builds and
|
|
87
|
+
# attaches, and a human decides when the irreversible step happens.
|
|
88
|
+
#
|
|
89
|
+
# Uses trusted publishing over OIDC -- no API token is stored anywhere.
|
|
90
|
+
# Configure the publisher at https://pypi.org/manage/account/publishing/
|
|
91
|
+
# ------------------------------------------------------------------ #
|
|
92
|
+
publish:
|
|
93
|
+
name: Publish to PyPI
|
|
94
|
+
needs: build
|
|
95
|
+
runs-on: ubuntu-latest
|
|
96
|
+
if: >-
|
|
97
|
+
github.event_name == 'workflow_dispatch'
|
|
98
|
+
&& github.event.inputs.confirm == 'publish'
|
|
99
|
+
environment:
|
|
100
|
+
name: pypi
|
|
101
|
+
url: https://pypi.org/p/gimacpay
|
|
102
|
+
permissions:
|
|
103
|
+
id-token: write
|
|
104
|
+
steps:
|
|
105
|
+
- uses: actions/download-artifact@v4
|
|
106
|
+
with:
|
|
107
|
+
name: dist
|
|
108
|
+
path: dist/
|
|
109
|
+
|
|
110
|
+
- name: List what is about to be published
|
|
111
|
+
run: ls -la dist/
|
|
112
|
+
|
|
113
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
build/
|
|
8
|
+
dist/
|
|
9
|
+
*.egg-info/
|
|
10
|
+
*.egg
|
|
11
|
+
.eggs/
|
|
12
|
+
|
|
13
|
+
# Environnements virtuels
|
|
14
|
+
.venv/
|
|
15
|
+
venv/
|
|
16
|
+
env/
|
|
17
|
+
ENV/
|
|
18
|
+
|
|
19
|
+
# Tests et couverture
|
|
20
|
+
.pytest_cache/
|
|
21
|
+
.coverage
|
|
22
|
+
.coverage.*
|
|
23
|
+
htmlcov/
|
|
24
|
+
.tox/
|
|
25
|
+
.nox/
|
|
26
|
+
|
|
27
|
+
# Outils
|
|
28
|
+
.ruff_cache/
|
|
29
|
+
.mypy_cache/
|
|
30
|
+
.dmypy.json
|
|
31
|
+
|
|
32
|
+
# Éditeurs
|
|
33
|
+
.vscode/
|
|
34
|
+
.idea/
|
|
35
|
+
*.swp
|
|
36
|
+
*.swo
|
|
37
|
+
|
|
38
|
+
# Système
|
|
39
|
+
.DS_Store
|
|
40
|
+
Thumbs.db
|
|
41
|
+
|
|
42
|
+
# Secrets — ne jamais committer d'identifiants GIMACPay
|
|
43
|
+
.env
|
|
44
|
+
.env.*
|
|
45
|
+
!.env.example
|
|
46
|
+
*.pem
|
|
47
|
+
*.key
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Journal des modifications
|
|
2
|
+
|
|
3
|
+
Le format suit [Keep a Changelog](https://keepachangelog.com/fr/1.1.0/).
|
|
4
|
+
Le versionnage suit [SemVer](https://semver.org/lang/fr/).
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## [Non publié]
|
|
9
|
+
|
|
10
|
+
Rien pour l'instant.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## [0.1.0] — 2026-10-10
|
|
15
|
+
|
|
16
|
+
Première version. Implémente la spécification *GIMACPay Swagger for payments issuers*
|
|
17
|
+
version 1.8 (fichier `gimac-api-1.10.yaml`).
|
|
18
|
+
|
|
19
|
+
### Ajouté
|
|
20
|
+
|
|
21
|
+
- `GimacPayClient` : authentification OAuth 2.0 (flux password), cache du jeton avec marge
|
|
22
|
+
de sécurité de 60 s, rafraîchissement automatique sur un 401 puis nouvel essai unique.
|
|
23
|
+
- Les trois points d'entrée de la spécification : `send_payment` (`/payment/send`),
|
|
24
|
+
`inquiry` (`/payment/inquiry`), `update_payment` (`/payment/update`).
|
|
25
|
+
- `await_state` et `send_and_resolve` : suivent un paiement jusqu'à un état terminal en
|
|
26
|
+
interrogeant GIMACPay, sans jamais deviner.
|
|
27
|
+
- Les 24 valeurs de `intent`, avec leurs champs requis dérivés des exemples travaillés de la
|
|
28
|
+
spécification.
|
|
29
|
+
- Dix constructeurs de requêtes (`wallet_to_wallet`, `merchant_purchase`, `request_to_pay`,
|
|
30
|
+
`bill_inquiry`, `bill_payment`, `cash_in`, `cash_deposit`, `cash_out`, `mobile_reload`,
|
|
31
|
+
`account_inquiry`) plus `build` pour les huit transferts et tout ce qui viendra.
|
|
32
|
+
- Modèles typés : `Payment`, `PaymentState`, `AccountInfo`, `CustomerData`, `Bill`.
|
|
33
|
+
- `normalise_phone` et `validate_amount` : les deux pièges de terrain que la spécification
|
|
34
|
+
laisse ouverts.
|
|
35
|
+
- Hiérarchie d'exceptions distinguant **rejet** (`PaymentRejected`) et **état inconnu**
|
|
36
|
+
(`PaymentStateUnknown`) — des classes sœurs, jamais liées par héritage.
|
|
37
|
+
- Ligne de commande `gimacpay` : `intents`, `doctor`, `build`, `send` (avec `--confirm`
|
|
38
|
+
obligatoire).
|
|
39
|
+
- **Zéro dépendance d'exécution.**
|
|
40
|
+
|
|
41
|
+
### Notes
|
|
42
|
+
|
|
43
|
+
- Aucune sandbox publique n'existe : le bloc `servers` de la spécification pointe sur
|
|
44
|
+
`localhost`. La bibliothèque a été développée et testée contre un serveur local qui
|
|
45
|
+
implémente le protocole documenté, **jamais contre une instance réelle de GIMACPAY**.
|
|
46
|
+
- Deux incohérences de la spécification sont documentées et verrouillées par des tests :
|
|
47
|
+
`mobile_reload` est absent de l'énumération `Payment.intent` alors qu'il figure dans le
|
|
48
|
+
`oneOf` de `/payment/send`, et `wallet_to_account` y est listé deux fois.
|
|
49
|
+
|
|
50
|
+
[Non publié]: https://github.com/bryand410/gimacpay/compare/v0.1.0...HEAD
|
|
51
|
+
[0.1.0]: https://github.com/bryand410/gimacpay/releases/tag/v0.1.0
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Contribuer
|
|
2
|
+
|
|
3
|
+
Merci. Ce dépôt implémente une spécification qui n'appartient pas à ses contributeurs, donc
|
|
4
|
+
la première règle est simple : **la spécification est l'autorité.**
|
|
5
|
+
|
|
6
|
+
## Avant de proposer quoi que ce soit
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
python -m venv .venv && . .venv/bin/activate # Windows : .venv\Scripts\activate
|
|
10
|
+
pip install -e ".[dev]"
|
|
11
|
+
pytest
|
|
12
|
+
ruff check .
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Les deux doivent passer. La suite est rapide et n'a pas besoin de réseau : elle démarre un
|
|
16
|
+
serveur HTTP local qui parle le protocole documenté.
|
|
17
|
+
|
|
18
|
+
## Les règles du dépôt
|
|
19
|
+
|
|
20
|
+
### 1. Zéro dépendance d'exécution
|
|
21
|
+
|
|
22
|
+
Non négociable. Voir `SECURITY.md` pour le raisonnement. Une pull request qui ajoute une
|
|
23
|
+
entrée à `[project].dependencies` sera refusée, même pour quelque chose d'aussi banal que
|
|
24
|
+
`requests`. `urllib` fait le travail.
|
|
25
|
+
|
|
26
|
+
Les dépendances de développement sont libres.
|
|
27
|
+
|
|
28
|
+
### 2. Ne jamais deviner l'état d'un paiement
|
|
29
|
+
|
|
30
|
+
C'est la règle centrale, tirée de la spécification :
|
|
31
|
+
|
|
32
|
+
> Participants should not guess the state if it's not given by GIMACPay.
|
|
33
|
+
|
|
34
|
+
Concrètement, dans le code :
|
|
35
|
+
|
|
36
|
+
- Un code de réponse non documenté produit `PaymentStateUnknown`, **jamais**
|
|
37
|
+
`PaymentRejected`.
|
|
38
|
+
- `PaymentStateUnknown` et `PaymentRejected` restent des classes **sœurs**. Ne les faites
|
|
39
|
+
jamais hériter l'une de l'autre.
|
|
40
|
+
- Une erreur de transport ne doit pas être transformée en échec du paiement.
|
|
41
|
+
- Un `200` ne signifie pas « accepté ». Vérifiez `payment.state`.
|
|
42
|
+
|
|
43
|
+
Si votre changement touche à ça, ajoutez un test qui échoue sans lui.
|
|
44
|
+
|
|
45
|
+
### 3. La spécification est la source, pas la mémoire
|
|
46
|
+
|
|
47
|
+
Les tables de `intents.py` sont dérivées de `docs/reference/gimac-api-1.10.yaml`. Les tests
|
|
48
|
+
comparent les deux. Si GIMAC publie une nouvelle version de la spécification :
|
|
49
|
+
|
|
50
|
+
1. remplacez le fichier dans `docs/reference/` ;
|
|
51
|
+
2. lancez `pytest` — les tests de version et d'énumération échoueront et vous diront quoi
|
|
52
|
+
mettre à jour ;
|
|
53
|
+
3. mettez à jour `REQUIRED_FIELDS` à partir des nouveaux exemples.
|
|
54
|
+
|
|
55
|
+
Ne devinez pas les champs requis. Ils viennent des exemples travaillés de la spécification,
|
|
56
|
+
qui sont les seules charges utiles normatives qu'elle publie.
|
|
57
|
+
|
|
58
|
+
### 4. La licence de la spécification
|
|
59
|
+
|
|
60
|
+
`docs/reference/gimac-api-1.10.yaml` porte `license: Private`. Il est présent comme
|
|
61
|
+
référence de développement et **exclu de tout artefact publié** (voir l'exclusion `sdist`
|
|
62
|
+
dans `pyproject.toml`). Ne le déplacez pas dans `src/`, ne l'embarquez pas dans le paquet,
|
|
63
|
+
ne le publiez pas ailleurs.
|
|
64
|
+
|
|
65
|
+
### 5. Style
|
|
66
|
+
|
|
67
|
+
`ruff` décide, pas vous et pas moi. `line-length = 100`, `target-version = "py39"`.
|
|
68
|
+
|
|
69
|
+
Les docstrings expliquent **pourquoi**, pas **quoi**. Le code dit déjà ce qu'il fait. Une
|
|
70
|
+
docstring qui paraphrase la signature est du bruit ; une docstring qui explique pourquoi le
|
|
71
|
+
`except` est dans cet ordre vaut de l'or.
|
|
72
|
+
|
|
73
|
+
Quand un comportement vient d'une bizarrerie de la spécification, citez la spécification.
|
|
74
|
+
Les numéros de ligne bougent, les citations non.
|
|
75
|
+
|
|
76
|
+
## Signaler une incohérence de la spécification
|
|
77
|
+
|
|
78
|
+
Si vous en trouvez une :
|
|
79
|
+
|
|
80
|
+
1. Ajoutez un test qui la verrouille, nommé d'après elle, avec un commentaire expliquant ce
|
|
81
|
+
qu'un participant en conclurait de travers.
|
|
82
|
+
2. Signalez-la à GIMAC (`info@gimac-afr.org`) — c'est leur spécification.
|
|
83
|
+
|
|
84
|
+
Deux exemples déjà traités dans `tests/test_intents.py` : `mobile_reload` absent de
|
|
85
|
+
l'énumération `Payment.intent`, et `wallet_to_account` dupliqué.
|
|
86
|
+
|
|
87
|
+
## Signaler une faille
|
|
88
|
+
|
|
89
|
+
Pas d'issue publique. Voir `SECURITY.md`.
|
|
90
|
+
|
|
91
|
+
## Commits
|
|
92
|
+
|
|
93
|
+
Un changement par commit, un message qui dit *pourquoi*. « Corrige un bug » n'aide personne ;
|
|
94
|
+
« Un 500 ne doit pas être rapporté comme un rejet » dit tout.
|
|
95
|
+
|
|
96
|
+
## Publication
|
|
97
|
+
|
|
98
|
+
Les publications se font depuis `main` via GitHub Actions, avec publication de confiance
|
|
99
|
+
PyPI (OIDC) — aucun jeton d'API n'est stocké nulle part. Une publication est une porte à sens
|
|
100
|
+
unique : une version publiée sur PyPI se *yank*, elle ne se remplace pas. Étiquetez, laissez
|
|
101
|
+
la CI construire, vérifiez l'artefact, puis publiez.
|
gimacpay-0.1.0/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.
|