sortinghat-eclipse-foundation 0.1.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.
@@ -0,0 +1,2 @@
1
+ # File auto-generated by semverup on 2025-09-24 13:34:43.468109
2
+ __version__ = "0.1.0"
@@ -0,0 +1,355 @@
1
+ # -*- coding: utf-8 -*-
2
+ #
3
+ # Copyright 2025-present Bitergia
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+
18
+ import logging
19
+
20
+ import dateutil.relativedelta
21
+ import requests
22
+
23
+ from django.conf import settings
24
+ from django.db.models import (Q, Subquery)
25
+
26
+ from requests_oauth2client import OAuth2Client
27
+ from requests_oauth2client.tokens import ExpiredAccessToken
28
+
29
+ from grimoirelab_toolkit.datetime import (
30
+ str_to_datetime,
31
+ datetime_utcnow
32
+ )
33
+ from sortinghat.core.importer.backend import IdentitiesImporter
34
+ from sortinghat.core.importer.models import (
35
+ Individual,
36
+ Identity,
37
+ Enrollment,
38
+ Organization,
39
+ Profile,
40
+ )
41
+ from sortinghat.core import api
42
+ from sortinghat.core import models as sh_models
43
+
44
+
45
+ # Data source types
46
+ ECLIPSE_SOURCE = "eclipsefdn"
47
+ GITHUB_SOURCE = "github"
48
+
49
+
50
+ logger = logging.getLogger(__name__)
51
+
52
+
53
+ class EclipseFoundationAccountsImporter(IdentitiesImporter):
54
+ """Imports identities from the Eclipse Foundation platform.
55
+
56
+ The importer fetches and stores in the database identities
57
+ created or updated after the given date (`from_date`) parameter.
58
+ Currently, it can only import identities updated since a year ago.
59
+ When no date is given, it will import all the identities updated
60
+ since last year.
61
+
62
+ Each individual created after importing will have two identities:
63
+ one with source set as 'eclipsefdn' that includes their name, email
64
+ and username as it comes from the platform, and a second one with
65
+ source 'github' only when the github user was set by the identity
66
+ on the Eclipse profile.
67
+
68
+ :param ctx: SortingHat context
69
+ :param url: not used on this importer
70
+ :param from_date: start fetching identities updated from this date
71
+
72
+ :raises ValueError: when the date is older than one year ago
73
+ """
74
+ NAME = "EclipseFoundation"
75
+
76
+ def __init__(self, ctx, url, from_date=None):
77
+ super().__init__(ctx, url)
78
+
79
+ min_date = datetime_utcnow() - dateutil.relativedelta.relativedelta(years=1)
80
+
81
+ if not from_date:
82
+ self.from_date = min_date
83
+ elif isinstance(from_date, str):
84
+ self.from_date = str_to_datetime(from_date)
85
+ else:
86
+ self.from_date = from_date
87
+
88
+ if self.from_date < min_date:
89
+ msg = (
90
+ "Invalid 'from_date' value. It can only import identities updated since a year ago."
91
+ "from_date=" + from_date
92
+ )
93
+ logger.error(msg)
94
+ raise ValueError(msg)
95
+
96
+ def get_individuals(self):
97
+ """Get the individuals from the Eclipse Foundation platform."""
98
+
99
+ user_id = getattr(settings, 'ECLIPSE_FOUNDATION_USER_ID', None)
100
+ password = getattr(settings, 'ECLIPSE_FOUNDATION_PASSWORD', None)
101
+
102
+ client = EclipseFoundationAPIClient()
103
+ client.login(user_id, password)
104
+
105
+ epoch = int(self.from_date.timestamp())
106
+
107
+ # Fetch accounts pages
108
+ for account in client.fetch_accounts(epoch=epoch):
109
+ ef_profile = client.fetch_account_profile(account['name'])
110
+
111
+ if not ef_profile:
112
+ continue
113
+
114
+ individual = Individual(uuid=ef_profile['uid'])
115
+
116
+ name = ef_profile['first_name'] + ' ' + ef_profile['last_name']
117
+ email = ef_profile['mail']
118
+
119
+ prf = Profile()
120
+ prf.name = name
121
+ prf.email = email
122
+
123
+ individual.profile = prf
124
+
125
+ eclipse_id = Identity(
126
+ source=ECLIPSE_SOURCE,
127
+ name=name,
128
+ email=email,
129
+ username=ef_profile['name'],
130
+ )
131
+ individual.identities.append(eclipse_id)
132
+
133
+ if ef_profile['github_handle']:
134
+ idt = Identity(
135
+ source=GITHUB_SOURCE,
136
+ name=name,
137
+ username=ef_profile['github_handle'],
138
+ email=email,
139
+ )
140
+ individual.identities.append(idt)
141
+
142
+ # Fetch enrollments for the identity. If no enrollment is set
143
+ # use the organization field from the profile, if set.
144
+ employment_history = client.fetch_employment_history(account['name'])
145
+
146
+ if employment_history:
147
+ for employment in employment_history:
148
+ org = Organization(name=employment['organization_name'])
149
+ start, end = None, None
150
+
151
+ if employment['start']:
152
+ start = str_to_datetime(employment['start'])
153
+ if employment['end']:
154
+ end = str_to_datetime(employment['end'])
155
+
156
+ enr = Enrollment(org, start=start, end=end)
157
+ individual.enrollments.append(enr)
158
+
159
+ if not individual.enrollments:
160
+ company = ef_profile.get('org', None)
161
+ if company:
162
+ org = Organization(name=company)
163
+ enr = Enrollment(org)
164
+ individual.enrollments.append(enr)
165
+
166
+ logger.info(f"Eclipse account processed; account={account['name']}; changed={account['changed']}")
167
+
168
+ yield individual
169
+
170
+ def post_process_individual(self, individual, uuid):
171
+ """Post processing for Eclipse identities.
172
+
173
+ The method tries to find Eclipse or GitHub identities
174
+ already imported to merge them with the given individual.
175
+ When that happens the profile will be the Eclipse individual's
176
+ one.
177
+ """
178
+ eclipse_identity = None
179
+
180
+ for identity in individual.identities:
181
+ if identity.source == ECLIPSE_SOURCE and identity.email and identity.username:
182
+ eclipse_identity = identity
183
+ break
184
+
185
+ if not eclipse_identity:
186
+ return
187
+
188
+ query = sh_models.Individual.objects.filter(
189
+ mk__in=Subquery(
190
+ sh_models.Identity.objects.filter(
191
+ Q(email=eclipse_identity.email) |
192
+ (Q(username=eclipse_identity.username) & Q(source='github'))
193
+ ).exclude(uuid=uuid).values_list('individual__mk')
194
+ )
195
+ ).exclude(mk=uuid).values_list('mk')
196
+
197
+ from_uuids = [entry[0] for entry in query.all()]
198
+
199
+ if from_uuids:
200
+ api.merge(self.ctx, from_uuids, uuid)
201
+
202
+
203
+ class EclipseFoundationAPIClient:
204
+ """Eclipse Foundation's Profile API client."""
205
+
206
+ ECLIPSE_API_URL = "https://api.eclipse.org"
207
+ ECLIPSE_ACCOUNTS_URL = "https://accounts.eclipse.org"
208
+ OAUTH_TOKEN_ENDPOINT = "https://accounts.eclipse.org/oauth2/token"
209
+ ECLIPSE_SCOPE = "eclipsefdn_view_all_profiles"
210
+
211
+ MAX_RETRIES = 3
212
+
213
+ def __init__(self):
214
+ self.token = None
215
+ self.user_id = None
216
+ self.password = None
217
+
218
+ def login(self, user_id, password):
219
+ """Login on the Eclipse platform.
220
+
221
+ The authentication method is OAuth2. We use the scope
222
+ "eclipsefdn_view_all_profiles" that will allow us to
223
+ fetch all the info about profiles/identities.
224
+ """
225
+ self.user_id = user_id
226
+ self.password = password
227
+ self.token = self._authenticate(
228
+ self.user_id,
229
+ self.password,
230
+ self.ECLIPSE_SCOPE,
231
+ )
232
+
233
+ def logout(self):
234
+ """Logout from the Eclipse platform."""
235
+
236
+ self.token = None
237
+
238
+ def fetch_accounts(self, epoch):
239
+ """Fetch accounts updated from a given UNIX time."""
240
+
241
+ page = 1
242
+ total_accounts = 0
243
+
244
+ logger.info(f"Fetching accounts from API; url={self.ECLIPSE_ACCOUNTS_URL}, epoch={epoch}")
245
+
246
+ while True:
247
+ url = f"{self.ECLIPSE_ACCOUNTS_URL}/account/updated"
248
+ params = {
249
+ 'since': epoch,
250
+ 'page': page
251
+ }
252
+
253
+ logger.debug(f"Fetching accounts from API; url={url}, params={params}")
254
+ data = self._fetch(url, params=params)
255
+
256
+ for account in data['result']:
257
+ yield account
258
+
259
+ naccounts = len(data['result'])
260
+ total_accounts += naccounts
261
+
262
+ logger.debug(f"Accounts from API fetched; url={url}, params={params}, naccounts={naccounts}")
263
+
264
+ if page >= data['pagination']['result_end']:
265
+ break
266
+
267
+ page += 1
268
+
269
+ logger.info(f"Accounts fetched from API; url={url}, epoch={epoch}, total_accounts={total_accounts}")
270
+
271
+ def fetch_account_profile(self, eclipsefdn_id):
272
+ """Get the profile of the given identity."""
273
+
274
+ url = f"{self.ECLIPSE_API_URL}/account/profile/{eclipsefdn_id}"
275
+ data = self._fetch(url)
276
+ logger.info(f"Profile fetched; url={url}, eclipsefdn_id={eclipsefdn_id}")
277
+ return data
278
+
279
+ def fetch_employment_history(self, eclipsefdn_id):
280
+ """Get the employment history of the given identity."""
281
+
282
+ url = f"{self.ECLIPSE_API_URL}/account/profile/{eclipsefdn_id}/employment-history"
283
+ data = self._fetch(url)
284
+ logger.info(f"Employment history fetched; url={url}, eclipsefdn_id={eclipsefdn_id}")
285
+ return data
286
+
287
+ def _fetch(self, url, params=None):
288
+ """Generic query to Eclipse usr API."""
289
+
290
+ try:
291
+ data = self._fetch_retry(url, params)
292
+ except requests.exceptions.HTTPError as error:
293
+ # Ignore 5xx errors
294
+ if 500 <= error.response.status_code < 600:
295
+ msg = (
296
+ f"Unable to fetch {url}"
297
+ f"Server error: {error.response.status_code} - {error.response.reason}."
298
+ "Skipping"
299
+ )
300
+ logger.error(msg)
301
+ return None
302
+ else:
303
+ raise error
304
+
305
+ return data
306
+
307
+ def _fetch_retry(self, url, params=None):
308
+ """Fetch URL retrying in case of 403 or 500 errors.
309
+
310
+ When getting a 403 error, the method will try to authenticate
311
+ again in case the OAuth2 token has expired.
312
+ """
313
+ retries = 0
314
+ max_retries = self.MAX_RETRIES
315
+
316
+ while retries < max_retries:
317
+ try:
318
+ response = requests.get(url, params=params, auth=self.token)
319
+ except ExpiredAccessToken:
320
+ # Refresh token and try again
321
+ self.login(self.user_id, self.password)
322
+ retries += 1
323
+ continue
324
+
325
+ if response.status_code == 200:
326
+ return response.json()
327
+ elif response.status_code == 403:
328
+ if self.token.expires_at <= datetime_utcnow():
329
+ self.login(self.user_id, self.password)
330
+ retries += 1
331
+ elif 500 <= response.status_code < 600:
332
+ # Errors could have been related to server overloading
333
+ retries += 1
334
+ else:
335
+ response.raise_for_status()
336
+
337
+ response = requests.get(url, params=params, auth=self.token)
338
+ response.raise_for_status()
339
+
340
+ return response
341
+
342
+ def _authenticate(self, client_id, client_secret, scope):
343
+ """Authenticate using OAuth2.
344
+
345
+ After authenticating, returns a Bearer token that can be used
346
+ in the API requests.
347
+ """
348
+ oauth2client = OAuth2Client(
349
+ token_endpoint=self.OAUTH_TOKEN_ENDPOINT,
350
+ client_id=client_id,
351
+ client_secret=client_secret,
352
+ )
353
+ token = oauth2client.client_credentials(scope=scope)
354
+
355
+ return token
@@ -0,0 +1,91 @@
1
+ Metadata-Version: 2.4
2
+ Name: sortinghat-eclipse-foundation
3
+ Version: 0.1.0
4
+ Summary: SortingHat backend to import identities from the Eclipse Foundation
5
+ License-File: AUTHORS
6
+ License-File: LICENSE.txt
7
+ Keywords: development,grimoirelab,sortinghat
8
+ Author: Bitergia Developers
9
+ Requires-Python: >=3.10,<4.0
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: Topic :: Software Development
14
+ Classifier: Programming Language :: Python :: 3
15
+ Requires-Dist: requests-oauth2client (>=1.7.0,<2.0.0)
16
+ Requires-Dist: sortinghat (>=1.10.0,<2.0.0)
17
+ Description-Content-Type: text/markdown
18
+
19
+ # sortinghat-eclipse-foundation
20
+
21
+ SortingHat backend to import identities from Eclipse Foundation
22
+
23
+ ## Requirements
24
+
25
+ - Python >= 3.9
26
+
27
+ You will also need some other libraries for running the tool, you can find the
28
+ whole list of dependencies in [pyproject.toml](pyproject.toml) file.
29
+
30
+ ## Installation
31
+
32
+ There are several ways to install sortinghat-eclipse-foundation on your system: packages or source
33
+ code using Poetry or pip.
34
+
35
+ ### PyPI
36
+
37
+ sortinghat-eclipse-foundation can be installed using pip, a tool for installing Python packages.
38
+ To do it, run the next command:
39
+ ```
40
+ $ pip install sortinghat-eclipse-foundation
41
+ ```
42
+
43
+ ### Source code
44
+
45
+ To install from the source code you will need to clone the repository first:
46
+ ```
47
+ $ git clone https://github.com/bitergia-analytics/sortinghat-eclipse-foundation
48
+ $ cd sortinghat-eclipse-foundation
49
+ ```
50
+
51
+ Then use pip or Poetry to install the package along with its dependencies.
52
+
53
+ #### Pip
54
+
55
+ To install the package from local directory run the following command:
56
+ ```
57
+ $ pip install .
58
+ ```
59
+ In case you are a developer, you should install sortinghat-eclipse-foundation in editable mode:
60
+ ```
61
+ $ pip install -e .
62
+ ```
63
+
64
+ #### Poetry
65
+
66
+ We use [poetry](https://python-poetry.org/) for dependency management and
67
+ packaging. You can install it following its [documentation](https://python-poetry.org/docs/#installation).
68
+ Once you have installed it, you can install sortinghat-openinfra and the dependencies in
69
+ a project isolated environment using:
70
+ ```
71
+ $ poetry install
72
+ ```
73
+ To spaw a new shell within the virtual environment use:
74
+ ```
75
+ $ poetry shell
76
+ ```
77
+
78
+ ## Usage
79
+
80
+ Install this SortingHat backend to import identities from the Eclipse Foundation.
81
+ You can use this importer using the API or the UI. The name of the backend is
82
+ `EclipseFoundation`. You will have to provide the credentials on the settings file
83
+ in order to access the Eclipse Foundation API:
84
+
85
+ - `ECLIPSE_FOUNDATION_USER_ID`: username on the Eclipse Foundation platform.
86
+ - `ECLIPSE_FOUNDATION_PASSWORD`: password for the previous user.
87
+
88
+ The user will also have the next permissions for reading the identities:
89
+
90
+ - `eclipsefdn_view_all_profiles`
91
+
@@ -0,0 +1,7 @@
1
+ sortinghat/core/importer/backends/_version.py,sha256=iQdCKUd98-Lf57yM9KVG3Jr9tKN2cZ-snl7U4SUW4vE,86
2
+ sortinghat/core/importer/backends/eclipse.py,sha256=cG_Mwewbrm3hCf3WN0x2P-iBrhDbeWk0LajI6RUyw-g,11876
3
+ sortinghat_eclipse_foundation-0.1.0.dist-info/METADATA,sha256=i8ChRp-646cOLxQHJsW5--f80iwdRe2eQyKKqxaETOE,2784
4
+ sortinghat_eclipse_foundation-0.1.0.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
5
+ sortinghat_eclipse_foundation-0.1.0.dist-info/licenses/AUTHORS,sha256=ZI6cTLoNghfhkYwFzkIRwIAIMkG-xsmQEudrKK6Ez4E,90
6
+ sortinghat_eclipse_foundation-0.1.0.dist-info/licenses/LICENSE.txt,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
7
+ sortinghat_eclipse_foundation-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: poetry-core 2.2.1
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,3 @@
1
+ Jose Javier Merchante <jjmerchante@bitergia.com>
2
+ Santiago Dueñas <sduenas@bitergia.com>
3
+
@@ -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 [yyyy] [name of copyright owner]
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.