cmem-plugin-git 1.0.0__py3-none-any.whl
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.
- cmem_plugin_git/__init__.py +1 -0
- cmem_plugin_git/autocompletion.py +86 -0
- cmem_plugin_git/download.py +272 -0
- cmem_plugin_git/git-download.svg +2 -0
- cmem_plugin_git/git-list.svg +2 -0
- cmem_plugin_git/git-upload.svg +2 -0
- cmem_plugin_git/list.py +161 -0
- cmem_plugin_git/parameters.py +180 -0
- cmem_plugin_git/remote.py +774 -0
- cmem_plugin_git/upload.py +261 -0
- cmem_plugin_git-1.0.0.dist-info/METADATA +82 -0
- cmem_plugin_git-1.0.0.dist-info/RECORD +14 -0
- cmem_plugin_git-1.0.0.dist-info/WHEEL +4 -0
- cmem_plugin_git-1.0.0.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
"""Commit files into a git repository"""
|
|
2
|
+
|
|
3
|
+
import posixpath
|
|
4
|
+
from collections.abc import Sequence
|
|
5
|
+
from contextlib import suppress
|
|
6
|
+
|
|
7
|
+
from cmem_plugin_base.dataintegration.context import ExecutionContext, ExecutionReport
|
|
8
|
+
from cmem_plugin_base.dataintegration.description import Icon, Plugin, PluginAction, PluginParameter
|
|
9
|
+
from cmem_plugin_base.dataintegration.entity import Entities
|
|
10
|
+
from cmem_plugin_base.dataintegration.parameter.multiline import MultilineStringParameterType
|
|
11
|
+
from cmem_plugin_base.dataintegration.parameter.password import Password
|
|
12
|
+
from cmem_plugin_base.dataintegration.plugins import WorkflowPlugin
|
|
13
|
+
from cmem_plugin_base.dataintegration.ports import FixedNumberOfInputs, FixedSchemaPort
|
|
14
|
+
from cmem_plugin_base.dataintegration.typed_entities.file import File, FileEntitySchema
|
|
15
|
+
|
|
16
|
+
from cmem_plugin_git.parameters import (
|
|
17
|
+
connection_parameters,
|
|
18
|
+
identity_of,
|
|
19
|
+
remote_of,
|
|
20
|
+
)
|
|
21
|
+
from cmem_plugin_git.remote import (
|
|
22
|
+
DEFAULT_MESSAGE,
|
|
23
|
+
DEFAULT_USERNAME,
|
|
24
|
+
UploadRequest,
|
|
25
|
+
iter_warnings,
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
ACCESS_DESCRIPTION = "An access token that may write to the repository."
|
|
29
|
+
REF_LABEL = "Branch"
|
|
30
|
+
REF_DESCRIPTION = (
|
|
31
|
+
"The branch to commit to. It is created from the repository's default branch when it "
|
|
32
|
+
"does not exist yet. Leave it empty to commit to the default branch."
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
@Plugin(
|
|
37
|
+
label="Upload Git files",
|
|
38
|
+
plugin_id="cmem_plugin_git-Upload",
|
|
39
|
+
description="Commit the files of the preceding task into a git repository.",
|
|
40
|
+
documentation="""
|
|
41
|
+
This workflow task commits the files it receives into a folder of a git repository
|
|
42
|
+
and pushes them, as one commit per execution. It builds the commit from the objects
|
|
43
|
+
of the repository rather than from a checkout, so nothing is cloned.
|
|
44
|
+
|
|
45
|
+
Files arrive on the input from any task that produces files. The task hands nothing
|
|
46
|
+
on: it is the last step of its chain, and it has no output.
|
|
47
|
+
|
|
48
|
+
It is the counterpart of **Download Git files**, and a workflow that reads a
|
|
49
|
+
repository, changes something and writes the result back usually ends here.
|
|
50
|
+
|
|
51
|
+
The repository is reached over HTTP(S), which is the only transport this task speaks; an
|
|
52
|
+
SSH address is refused. Committing needs a token with write access: the
|
|
53
|
+
`write_repository` scope on GitLab, or a fine grained GitHub token granting
|
|
54
|
+
`Contents: Read and write`. On GitLab the token's role has to allow pushing to the target
|
|
55
|
+
branch as well, which a protected branch restricts to maintainers by default, and the
|
|
56
|
+
user name sent alongside the token is checked, which is why its default is the value
|
|
57
|
+
GitLab accepts. The
|
|
58
|
+
*Check connection* action asks the server for a write handshake and reports what it
|
|
59
|
+
answered, so a token that is not sufficient can be found before a workflow runs.
|
|
60
|
+
|
|
61
|
+
Every file is committed under its own name in the target folder; a folder structure
|
|
62
|
+
it carried before is not reproduced, and two files that would end up under the same
|
|
63
|
+
name abort the execution before anything is written. When the files are identical to
|
|
64
|
+
what the repository already holds, no commit is created at all. Files excluded by the
|
|
65
|
+
repository's ignore rules are committed unless that is switched off. A branch that
|
|
66
|
+
moved while the task was working is not overwritten: the same files are applied to
|
|
67
|
+
the new tip and pushed again, and the task fails rather than discarding the other
|
|
68
|
+
change. A push the repository refuses - a protected branch, or a hook that declines
|
|
69
|
+
it - fails with the reason the server gave, and nothing is committed.
|
|
70
|
+
|
|
71
|
+
The task writes a branch and stops there. It opens no merge request and no pull
|
|
72
|
+
request, it creates no tag and no release, and the commits it writes are not signed.
|
|
73
|
+
A file committed into a path the repository tracks with Git LFS is stored as ordinary
|
|
74
|
+
content rather than as an LFS pointer, so do not point this task at such a path.
|
|
75
|
+
""",
|
|
76
|
+
icon=Icon(package=__package__, file_name="git-upload.svg"),
|
|
77
|
+
actions=[
|
|
78
|
+
PluginAction(
|
|
79
|
+
name="check_connection",
|
|
80
|
+
label="Check connection",
|
|
81
|
+
description="Test whether the repository can be written to, without pushing.",
|
|
82
|
+
)
|
|
83
|
+
],
|
|
84
|
+
parameters=[
|
|
85
|
+
*connection_parameters(REF_LABEL, REF_DESCRIPTION, ACCESS_DESCRIPTION),
|
|
86
|
+
PluginParameter(
|
|
87
|
+
name="path",
|
|
88
|
+
label="Folder",
|
|
89
|
+
description="The folder inside the repository to commit into. "
|
|
90
|
+
"Leave it empty to commit at the top of the repository.",
|
|
91
|
+
default_value="",
|
|
92
|
+
),
|
|
93
|
+
PluginParameter(
|
|
94
|
+
name="commit_message",
|
|
95
|
+
label="Commit message",
|
|
96
|
+
description="The message of the commit this task creates.",
|
|
97
|
+
param_type=MultilineStringParameterType(),
|
|
98
|
+
default_value=DEFAULT_MESSAGE,
|
|
99
|
+
),
|
|
100
|
+
PluginParameter(
|
|
101
|
+
name="remove_obsolete",
|
|
102
|
+
label="Remove obsolete files",
|
|
103
|
+
description="If enabled, files lying directly in the target folder that were not "
|
|
104
|
+
"part of this execution are deleted in the same commit. Its subfolders, and "
|
|
105
|
+
"everything outside it, are never touched.",
|
|
106
|
+
default_value=False,
|
|
107
|
+
),
|
|
108
|
+
PluginParameter(
|
|
109
|
+
name="honor_gitignore",
|
|
110
|
+
label="Honor ignore rules",
|
|
111
|
+
description="If enabled, a file excluded by the repository's .gitignore is "
|
|
112
|
+
"reported and left out instead of being committed.",
|
|
113
|
+
default_value=False,
|
|
114
|
+
advanced=True,
|
|
115
|
+
),
|
|
116
|
+
PluginParameter(
|
|
117
|
+
name="author_name",
|
|
118
|
+
label="Author name",
|
|
119
|
+
description="The name the commit is attributed to. Left empty, the name of the "
|
|
120
|
+
"user who runs the workflow is used where the deployment provides it.",
|
|
121
|
+
default_value="",
|
|
122
|
+
advanced=True,
|
|
123
|
+
),
|
|
124
|
+
PluginParameter(
|
|
125
|
+
name="author_mail",
|
|
126
|
+
label="Author mail address",
|
|
127
|
+
description="The mail address the commit is attributed to. Left empty, the address "
|
|
128
|
+
"of the user who runs the workflow is used where the deployment provides it.",
|
|
129
|
+
default_value="",
|
|
130
|
+
advanced=True,
|
|
131
|
+
),
|
|
132
|
+
],
|
|
133
|
+
)
|
|
134
|
+
class UploadGitFiles(WorkflowPlugin):
|
|
135
|
+
"""Git Workflow Plugin: commit and push files"""
|
|
136
|
+
|
|
137
|
+
# A plugin constructor takes one argument per PluginParameter, so its arity is
|
|
138
|
+
# fixed by the plugin's configuration surface, not by a style choice here.
|
|
139
|
+
def __init__( # noqa: PLR0913, PLR0917
|
|
140
|
+
self,
|
|
141
|
+
url: str,
|
|
142
|
+
token: str | Password = "",
|
|
143
|
+
ref: str = "",
|
|
144
|
+
username: str = DEFAULT_USERNAME,
|
|
145
|
+
path: str = "",
|
|
146
|
+
commit_message: str = DEFAULT_MESSAGE,
|
|
147
|
+
remove_obsolete: bool = False,
|
|
148
|
+
honor_gitignore: bool = False,
|
|
149
|
+
author_name: str = "",
|
|
150
|
+
author_mail: str = "",
|
|
151
|
+
) -> None:
|
|
152
|
+
self.url = url
|
|
153
|
+
self.token = token
|
|
154
|
+
self.ref = ref
|
|
155
|
+
self.username = username
|
|
156
|
+
self.path = path
|
|
157
|
+
self.commit_message = commit_message
|
|
158
|
+
self.remove_obsolete = remove_obsolete
|
|
159
|
+
self.honor_gitignore = honor_gitignore
|
|
160
|
+
self.author_name = author_name
|
|
161
|
+
self.author_mail = author_mail
|
|
162
|
+
self.input_ports = FixedNumberOfInputs([FixedSchemaPort(schema=FileEntitySchema())])
|
|
163
|
+
self.output_port = None
|
|
164
|
+
|
|
165
|
+
def check_connection(self) -> str:
|
|
166
|
+
"""Report whether the repository can be read and written with these credentials."""
|
|
167
|
+
remote = remote_of(self.url, self.token, self.username)
|
|
168
|
+
branch = self.ref.strip() or remote.default_branch()
|
|
169
|
+
exists = branch in [ref.name for ref in remote.list_refs() if ref.kind == "branch"]
|
|
170
|
+
remote.check_write_access()
|
|
171
|
+
state = "exists" if exists else "does not exist yet and would be created"
|
|
172
|
+
return (
|
|
173
|
+
f"The repository at `{remote.url}` accepts a write with these credentials.\n\n"
|
|
174
|
+
f"The branch `{branch}` {state}."
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
def execute(self, inputs: Sequence[Entities], context: ExecutionContext) -> None:
|
|
178
|
+
"""Run the workflow task."""
|
|
179
|
+
contents = self._read(inputs, context)
|
|
180
|
+
if contents is None:
|
|
181
|
+
context.report.update(
|
|
182
|
+
ExecutionReport(
|
|
183
|
+
entity_count=0,
|
|
184
|
+
operation="write",
|
|
185
|
+
operation_desc="files committed",
|
|
186
|
+
warnings=["The workflow was cancelled, so nothing was committed."],
|
|
187
|
+
)
|
|
188
|
+
)
|
|
189
|
+
return
|
|
190
|
+
if not contents:
|
|
191
|
+
context.report.update(
|
|
192
|
+
ExecutionReport(
|
|
193
|
+
entity_count=0,
|
|
194
|
+
operation="write",
|
|
195
|
+
operation_desc="files committed",
|
|
196
|
+
warnings=["No file arrived on the input, so nothing was committed."],
|
|
197
|
+
)
|
|
198
|
+
)
|
|
199
|
+
return
|
|
200
|
+
remote = remote_of(self.url, self.token, self.username)
|
|
201
|
+
request = UploadRequest(
|
|
202
|
+
branch=self.ref.strip() or remote.default_branch(),
|
|
203
|
+
directory=self.path,
|
|
204
|
+
contents=contents,
|
|
205
|
+
message=self.commit_message,
|
|
206
|
+
author=identity_of(context, self.author_name, self.author_mail),
|
|
207
|
+
remove_obsolete=self.remove_obsolete,
|
|
208
|
+
honor_gitignore=self.honor_gitignore,
|
|
209
|
+
)
|
|
210
|
+
self.log.info(f"Committing {len(contents)} file(s) to {remote.url}")
|
|
211
|
+
result = remote.upload(request)
|
|
212
|
+
summary = [("Branch", result.branch), ("Files written", str(len(result.written)))]
|
|
213
|
+
if result.commit_id:
|
|
214
|
+
summary.append(("Commit", result.commit_id))
|
|
215
|
+
if result.removed:
|
|
216
|
+
summary.append(("Files removed", str(len(result.removed))))
|
|
217
|
+
context.report.update(
|
|
218
|
+
ExecutionReport(
|
|
219
|
+
entity_count=len(result.written),
|
|
220
|
+
operation="write",
|
|
221
|
+
operation_desc="files committed",
|
|
222
|
+
summary=summary,
|
|
223
|
+
warnings=list(iter_warnings(result.warnings)),
|
|
224
|
+
)
|
|
225
|
+
)
|
|
226
|
+
|
|
227
|
+
def _read(
|
|
228
|
+
self, inputs: Sequence[Entities], context: ExecutionContext
|
|
229
|
+
) -> dict[str, bytes] | None:
|
|
230
|
+
"""Read the incoming files, refusing two files of the same name.
|
|
231
|
+
|
|
232
|
+
Returns None when the workflow was cancelled before every file was read.
|
|
233
|
+
A commit is created from all of the input at once, so a partial,
|
|
234
|
+
arbitrary subset of it is not a result worth committing.
|
|
235
|
+
"""
|
|
236
|
+
if not inputs:
|
|
237
|
+
return {}
|
|
238
|
+
schema = FileEntitySchema()
|
|
239
|
+
contents: dict[str, bytes] = {}
|
|
240
|
+
sources: dict[str, str] = {}
|
|
241
|
+
for entity in inputs[0].entities:
|
|
242
|
+
with suppress(AttributeError):
|
|
243
|
+
if context.workflow.status() == "Canceling": # type: ignore[union-attr]
|
|
244
|
+
return None
|
|
245
|
+
file = schema.from_entity(entity)
|
|
246
|
+
name = posixpath.basename(file.path)
|
|
247
|
+
if name in contents:
|
|
248
|
+
raise ValueError(
|
|
249
|
+
f"'{sources[name]}' and '{file.path}' would both be committed as "
|
|
250
|
+
f"'{posixpath.join(self.path.strip('/'), name)}'. Nothing was committed."
|
|
251
|
+
)
|
|
252
|
+
sources[name] = file.path
|
|
253
|
+
contents[name] = _content_of(file, context)
|
|
254
|
+
return contents
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
def _content_of(file: File, context: ExecutionContext) -> bytes:
|
|
258
|
+
"""Read one incoming file as it is, without unpacking or re-encoding it."""
|
|
259
|
+
with file.read_stream(context=context) as stream:
|
|
260
|
+
content: bytes = stream.read()
|
|
261
|
+
return content
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: cmem-plugin-git
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Pull and push files from a git Repository.
|
|
5
|
+
License: Apache-2.0
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Keywords: eccenca Corporate Memory,plugin
|
|
8
|
+
Author: eccenca GmbH
|
|
9
|
+
Author-email: cmempy-developer@eccenca.com
|
|
10
|
+
Requires-Python: >=3.13,<4.0
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Environment :: Plugins
|
|
13
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
17
|
+
Requires-Dist: cmem-plugin-base (>=4.20.0,<5.0.0)
|
|
18
|
+
Requires-Dist: dulwich (>=1.2.14,<2.0.0)
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
|
|
21
|
+
# cmem-plugin-git
|
|
22
|
+
|
|
23
|
+
Read files from a git repository and commit files back into one.
|
|
24
|
+
|
|
25
|
+
[![eccenca Corporate Memory][cmem-shield]][cmem-link]
|
|
26
|
+
|
|
27
|
+
This is a plugin for [eccenca Corporate Memory](https://documentation.eccenca.com). You can install it with the [cmemc](https://eccenca.com/go/cmemc) command line client like this:
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
cmemc admin workspace python install cmem-plugin-git
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Tasks
|
|
34
|
+
|
|
35
|
+
- **List Git files** lists what a repository holds at one revision, without
|
|
36
|
+
transferring any file content.
|
|
37
|
+
- **Download Git files** reads the selected files and hands them to the next
|
|
38
|
+
task in the workflow.
|
|
39
|
+
- **Upload Git files** commits the files of the preceding task into a folder of
|
|
40
|
+
a repository and pushes them.
|
|
41
|
+
|
|
42
|
+
All three talk to a repository over HTTP(S) with an access token, work on the
|
|
43
|
+
objects of the repository rather than on a checkout, and therefore transfer only
|
|
44
|
+
what they were asked for. Git LFS content, SSH remotes, merge and pull requests,
|
|
45
|
+
tags and repository history are out of scope. A file uploaded into a path the
|
|
46
|
+
repository tracks with Git LFS is committed as ordinary content rather than as
|
|
47
|
+
an LFS pointer.
|
|
48
|
+
|
|
49
|
+
## Access rights
|
|
50
|
+
|
|
51
|
+
The tasks speak the git HTTP protocol only and never call a forge API, so the
|
|
52
|
+
token needs repository access and nothing else.
|
|
53
|
+
|
|
54
|
+
| Task | GitLab scope | GitHub fine grained token |
|
|
55
|
+
| ---- | ------------ | ------------------------- |
|
|
56
|
+
| List Git files | `read_repository` | `Contents: Read-only` |
|
|
57
|
+
| Download Git files | `read_repository` | `Contents: Read-only` |
|
|
58
|
+
| Upload Git files | `write_repository` | `Contents: Read and write` |
|
|
59
|
+
|
|
60
|
+
A public repository needs no token at all. The user name sent alongside the
|
|
61
|
+
token is ignored by GitHub and checked by GitLab, so it defaults to
|
|
62
|
+
`gitlab-ci-token`, which GitLab accepts for a repository token. On GitLab the
|
|
63
|
+
token's role has to
|
|
64
|
+
allow pushing to the target branch as well, which a protected branch restricts
|
|
65
|
+
to maintainers by default. **Upload Git files** offers a *Check connection*
|
|
66
|
+
action that asks the server for a write handshake without pushing anything, so
|
|
67
|
+
an insufficient token shows up while the task is being configured.
|
|
68
|
+
|
|
69
|
+
[![poetry][poetry-shield]][poetry-link] [![ruff][ruff-shield]][ruff-link] [![mypy][mypy-shield]][mypy-link] [![copier][copier-shield]][copier]
|
|
70
|
+
|
|
71
|
+
[cmem-link]: https://documentation.eccenca.com
|
|
72
|
+
[cmem-shield]: https://img.shields.io/endpoint?url=https://documentation.eccenca.com/latest/badge.json
|
|
73
|
+
[poetry-link]: https://python-poetry.org/
|
|
74
|
+
[poetry-shield]: https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json
|
|
75
|
+
[ruff-link]: https://docs.astral.sh/ruff/
|
|
76
|
+
[ruff-shield]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json&label=Code%20Style
|
|
77
|
+
[mypy-link]: https://mypy-lang.org/
|
|
78
|
+
[mypy-shield]: https://www.mypy-lang.org/static/mypy_badge.svg
|
|
79
|
+
[copier]: https://copier.readthedocs.io/
|
|
80
|
+
[copier-shield]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-purple.json
|
|
81
|
+
|
|
82
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
cmem_plugin_git/__init__.py,sha256=8_I-EtZ_jm-H3bLaFP1Xee7aoSYKx8VO8S2K-_KUM2E,22
|
|
2
|
+
cmem_plugin_git/autocompletion.py,sha256=AkZNHo6KCxWc_irZYIKlw4MpWbV29UsJz1BkyjbGK6c,3048
|
|
3
|
+
cmem_plugin_git/download.py,sha256=e6GCTAkoVkOtLVAPOlfu-u5g103u0iLFa06AK6laQdM,11557
|
|
4
|
+
cmem_plugin_git/git-download.svg,sha256=4hujJf6WcxOALw9ou7hh5oVrns4c2WylHDhVXyGlLe8,547
|
|
5
|
+
cmem_plugin_git/git-list.svg,sha256=0yoopl-sJogo3IuivPkzIjPpPsDNX9xAEJmgSjsQtC8,609
|
|
6
|
+
cmem_plugin_git/git-upload.svg,sha256=JGHPzI7TDpDXRilOcoD3M8lNicpnTB-kRjP9_cbvnXs,546
|
|
7
|
+
cmem_plugin_git/list.py,sha256=JxWCAkmpUiNQHNwoLB-CNzRrzOq6SmY5QyIsdQSnsuI,6713
|
|
8
|
+
cmem_plugin_git/parameters.py,sha256=fZ46LLOddsVn0MKy-TQKOz2CJ469L8A4tA4kqbzBUBY,6545
|
|
9
|
+
cmem_plugin_git/remote.py,sha256=aFCc4VTkXADdEbEHbNB3eUedcc8PwxifQjbpaOCIghw,31063
|
|
10
|
+
cmem_plugin_git/upload.py,sha256=HdNziw8_CLgJ3LGfsxoGUlgJ0Uly6wN0AbAuf7l2MSw,11460
|
|
11
|
+
cmem_plugin_git-1.0.0.dist-info/METADATA,sha256=cVYqx9RnUQr0hlNgshsck1qdwxdJISPZB-v12RsOmyY,3764
|
|
12
|
+
cmem_plugin_git-1.0.0.dist-info/WHEEL,sha256=eY7nduwzv-ldUxpzbRlxwvC693Hg6PX8bWDjEHjZ_dk,88
|
|
13
|
+
cmem_plugin_git-1.0.0.dist-info/licenses/LICENSE,sha256=pQBKELDhE5pIE6FD62pUiaVznyPXbOWKO9abycLCaQ8,11337
|
|
14
|
+
cmem_plugin_git-1.0.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright eccenca GmbH
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|