orgdatacore 2.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.
@@ -0,0 +1,444 @@
1
+ Metadata-Version: 2.5
2
+ Name: orgdatacore
3
+ Version: 2.0.0
4
+ Summary: Python library for organizational data management
5
+ Project-URL: Homepage, https://github.com/openshift-eng/cyborg-data/tree/main/python
6
+ Project-URL: Repository, https://github.com/openshift-eng/cyborg-data
7
+ Project-URL: Changelog, https://github.com/openshift-eng/cyborg-data/blob/main/python/CHANGELOG.md
8
+ Project-URL: Issues, https://github.com/openshift-eng/cyborg-data/issues
9
+ Author: Continuous Release Tooling - Red Hat
10
+ License-Expression: Apache-2.0
11
+ License-File: LICENSE
12
+ Keywords: employees,organizational-data,organizations,teams
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Typing :: Typed
21
+ Requires-Python: >=3.11
22
+ Requires-Dist: orgindex-schema<0.2.0,>=0.1.0
23
+ Requires-Dist: pydantic>=2.0
24
+ Provides-Extra: dev
25
+ Requires-Dist: black>=23.0.0; extra == 'dev'
26
+ Requires-Dist: isort>=5.0.0; extra == 'dev'
27
+ Requires-Dist: mypy>=1.0.0; extra == 'dev'
28
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
29
+ Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
30
+ Requires-Dist: pytest>=7.0.0; extra == 'dev'
31
+ Requires-Dist: ruff>=0.1.0; extra == 'dev'
32
+ Provides-Extra: gcs
33
+ Requires-Dist: google-cloud-storage>=2.0.0; extra == 'gcs'
34
+ Description-Content-Type: text/markdown
35
+
36
+ # orgdatacore - Python
37
+
38
+ Python port of the Go orgdatacore library for organizational data management.
39
+
40
+ This library provides thread-safe access to organizational data including employees, teams, organizations, pillars, and team groups.
41
+
42
+ ## Installation
43
+
44
+ ### Using UV (Recommended)
45
+
46
+ [UV](https://github.com/astral-sh/uv) is a fast Python package installer.
47
+
48
+ ```bash
49
+ # Install the package
50
+ uv pip install -e .
51
+
52
+ # With GCS support (recommended for production)
53
+ uv pip install -e ".[gcs]"
54
+
55
+ # Or use uv sync for development (installs dev dependencies)
56
+ uv sync
57
+
58
+ # With GCS support
59
+ uv sync --extra gcs
60
+ ```
61
+
62
+ ### Using pip
63
+
64
+ ```bash
65
+ # Install from source
66
+ pip install -e .
67
+
68
+ # With GCS support (recommended for production)
69
+ pip install -e ".[gcs]"
70
+
71
+ # With development dependencies
72
+ pip install -e ".[dev]"
73
+ ```
74
+
75
+ ## Quick Start
76
+
77
+ ### Using GCS (Recommended for Production)
78
+
79
+ ```python
80
+ from orgdatacore import Service, GCSConfig
81
+ from orgdatacore.datasources import GCSDataSourceWithSDK
82
+ from datetime import timedelta
83
+
84
+ # Configure GCS data source
85
+ config = GCSConfig(
86
+ bucket="your-bucket",
87
+ object_path="path/to/org_data.json",
88
+ project_id="your-project",
89
+ check_interval=timedelta(minutes=5),
90
+ )
91
+ source = GCSDataSourceWithSDK(config)
92
+
93
+ # Option 1: Constructor injection (recommended for simple cases)
94
+ service = Service(data_source=source)
95
+
96
+ # Option 2: Lazy loading (matches Go API, good for deferred loading)
97
+ # service = Service()
98
+ # service.load_from_data_source(source)
99
+
100
+ # Query employees
101
+ employee = service.get_employee_by_uid("jsmith")
102
+ if employee:
103
+ print(f"Found: {employee.full_name}")
104
+ ```
105
+
106
+ ### Using a Custom DataSource (S3, Azure, etc.)
107
+
108
+ The library supports pluggable data sources. Implement the `DataSource` interface for your storage backend:
109
+
110
+ ```python
111
+ from orgdatacore import Service
112
+ from orgdatacore.interface import DataSource
113
+ from typing import BinaryIO, Callable, Optional
114
+ from io import BytesIO
115
+
116
+ class S3DataSource(DataSource):
117
+ """Example custom DataSource for AWS S3."""
118
+
119
+ def __init__(self, bucket: str, key: str):
120
+ self.bucket = bucket
121
+ self.key = key
122
+
123
+ def load(self) -> BinaryIO:
124
+ import boto3
125
+ s3 = boto3.client('s3')
126
+ response = s3.get_object(Bucket=self.bucket, Key=self.key)
127
+ return BytesIO(response['Body'].read())
128
+
129
+ def watch(self, callback: Callable[[], Optional[Exception]]) -> Optional[Exception]:
130
+ # Implement watching logic (polling, S3 events, etc.)
131
+ return None
132
+
133
+ def __str__(self) -> str:
134
+ return f"s3://{self.bucket}/{self.key}"
135
+
136
+ # Use your custom data source
137
+ service = Service()
138
+ source = S3DataSource("my-org-bucket", "data/org_data.json")
139
+ service.load_from_data_source(source)
140
+ ```
141
+
142
+ ## API Reference
143
+
144
+ ### Service
145
+
146
+ The main class providing access to organizational data.
147
+
148
+ #### Core Data Access
149
+
150
+ - `get_employee_by_uid(uid: str) -> Employee | None`
151
+ - `get_employee_by_slack_id(slack_id: str) -> Employee | None`
152
+ - `get_employee_by_github_id(github_id: str) -> Employee | None`
153
+ - `get_manager_for_employee(uid: str) -> Employee | None`
154
+ - `get_team_by_name(team_name: str) -> Team | None`
155
+ - `get_org_by_name(org_name: str) -> Org | None`
156
+ - `get_pillar_by_name(pillar_name: str) -> Pillar | None`
157
+ - `get_team_group_by_name(team_group_name: str) -> TeamGroup | None`
158
+
159
+ #### Membership Queries
160
+
161
+ - `get_teams_for_uid(uid: str) -> list[str]`
162
+ - `get_teams_for_slack_id(slack_id: str) -> list[str]`
163
+ - `get_team_members(team_name: str) -> list[Employee]`
164
+ - `is_employee_in_team(uid: str, team_name: str) -> bool`
165
+ - `is_slack_user_in_team(slack_id: str, team_name: str) -> bool`
166
+
167
+ #### Organization Queries
168
+
169
+ - `is_employee_in_org(uid: str, org_name: str) -> bool`
170
+ - `is_slack_user_in_org(slack_id: str, org_name: str) -> bool`
171
+ - `get_user_organizations(slack_user_id: str) -> list[OrgInfo]`
172
+
173
+ #### Data Management
174
+
175
+ - `get_version() -> DataVersion`
176
+ - `load_from_data_source(source: DataSource) -> None`
177
+ - `start_data_source_watcher(source: DataSource) -> None`
178
+
179
+ #### Hierarchy Queries
180
+
181
+ - `get_hierarchy_path(entity_name: str, entity_type: str) -> list[HierarchyPathEntry]`
182
+ - `get_descendants_tree(entity_name: str) -> HierarchyNode | None`
183
+
184
+ #### Jira Queries
185
+
186
+ - `get_jira_projects() -> list[str]`
187
+ - `get_jira_components(project: str) -> list[str]`
188
+ - `get_teams_by_jira_project(project: str) -> list[JiraOwnerInfo]`
189
+ - `get_teams_by_jira_component(project: str, component: str) -> list[JiraOwnerInfo]`
190
+ - `get_jira_ownership_for_team(team_name: str) -> list[dict]`
191
+
192
+ #### Component Queries
193
+
194
+ - `get_component_by_name(name: str) -> Component | None`
195
+ - `get_all_components() -> list[Component]`
196
+
197
+ #### Enumeration
198
+
199
+ - `get_all_employee_uids() -> list[str]`
200
+ - `get_all_team_names() -> list[str]`
201
+ - `get_all_org_names() -> list[str]`
202
+ - `get_all_pillar_names() -> list[str]`
203
+ - `get_all_team_group_names() -> list[str]`
204
+
205
+ ### DataSource Protocol
206
+
207
+ Implement this protocol for custom storage backends (no inheritance needed):
208
+
209
+ ```python
210
+ from typing import BinaryIO, Callable, Optional
211
+
212
+ class MyDataSource: # No inheritance needed!
213
+ def load(self) -> BinaryIO:
214
+ """Return a file-like object containing JSON data."""
215
+ ...
216
+
217
+ def watch(self, callback: Callable[[], Optional[Exception]]) -> Optional[Exception]:
218
+ """Start watching for changes, call callback when data updates."""
219
+ ...
220
+
221
+ def __str__(self) -> str:
222
+ """Return a description of this data source."""
223
+ ...
224
+ ```
225
+
226
+ ### Data Sources
227
+
228
+ #### GCSDataSource / GCSDataSourceWithSDK
229
+
230
+ For production use with Google Cloud Storage (requires `google-cloud-storage`):
231
+
232
+ ```python
233
+ from orgdatacore import GCSConfig
234
+ from orgdatacore.datasources import GCSDataSourceWithSDK
235
+ from datetime import timedelta
236
+
237
+ config = GCSConfig(
238
+ bucket="your-bucket",
239
+ object_path="path/to/data.json",
240
+ project_id="your-project",
241
+ check_interval=timedelta(minutes=5),
242
+ )
243
+ source = GCSDataSourceWithSDK(config)
244
+ ```
245
+
246
+ ## Async API
247
+
248
+ For asyncio-based applications (FastAPI, aiohttp, etc.), use `AsyncService`:
249
+
250
+ ### Basic Async Usage
251
+
252
+ ```python
253
+ import asyncio
254
+ from orgdatacore import AsyncService, GCSConfig
255
+ from orgdatacore._async import AsyncGCSDataSource
256
+
257
+ async def main():
258
+ # Configure async GCS data source
259
+ config = GCSConfig(
260
+ bucket="your-bucket",
261
+ object_path="path/to/org_data.json",
262
+ project_id="your-project",
263
+ )
264
+ source = AsyncGCSDataSource(config)
265
+
266
+ # Create and initialize async service
267
+ service = AsyncService()
268
+ await service.load_from_data_source(source)
269
+
270
+ # Query employees (all methods are async)
271
+ employee = await service.get_employee_by_uid("jsmith")
272
+ if employee:
273
+ print(f"Found: {employee.full_name}")
274
+
275
+ # Check team membership
276
+ is_member = await service.is_employee_in_team("jsmith", "platform-team")
277
+
278
+ # Get hierarchy path
279
+ path = await service.get_hierarchy_path("platform-team", "team")
280
+ for entry in path:
281
+ print(f" {entry.type}: {entry.name}")
282
+
283
+ asyncio.run(main())
284
+ ```
285
+
286
+ ### Using with Data Watcher
287
+
288
+ ```python
289
+ import asyncio
290
+ from orgdatacore import AsyncService, GCSConfig
291
+ from orgdatacore._async import AsyncGCSDataSource
292
+
293
+ async def run_with_auto_reload():
294
+ config = GCSConfig(
295
+ bucket="your-bucket",
296
+ object_path="org_data.json",
297
+ project_id="your-project",
298
+ )
299
+ source = AsyncGCSDataSource(config)
300
+ service = AsyncService()
301
+
302
+ # Start watcher - loads data and monitors for changes
303
+ await service.start_data_source_watcher(source)
304
+
305
+ try:
306
+ # Service auto-reloads when data changes
307
+ while True:
308
+ teams = await service.get_all_team_names()
309
+ print(f"Currently tracking {len(teams)} teams")
310
+ await asyncio.sleep(60)
311
+ finally:
312
+ await service.stop_watcher()
313
+
314
+ asyncio.run(run_with_auto_reload())
315
+ ```
316
+
317
+ ### AsyncService API Reference
318
+
319
+ The `AsyncService` has the same methods as `Service`, but all are async:
320
+
321
+ #### Core Data Access
322
+ - `await get_employee_by_uid(uid)` → `Employee | None`
323
+ - `await get_employee_by_email(email)` → `Employee | None`
324
+ - `await get_employee_by_slack_id(slack_id)` → `Employee | None`
325
+ - `await get_employee_by_github_id(github_id)` → `Employee | None`
326
+ - `await get_manager_for_employee(uid)` → `Employee | None`
327
+ - `await get_team_by_name(name)` → `Team | None`
328
+ - `await get_org_by_name(name)` → `Org | None`
329
+ - `await get_pillar_by_name(name)` → `Pillar | None`
330
+ - `await get_team_group_by_name(name)` → `TeamGroup | None`
331
+ - `await get_component_by_name(name)` → `Component | None`
332
+
333
+ #### Membership Queries
334
+ - `await get_teams_for_uid(uid)` → `list[str]`
335
+ - `await get_teams_for_slack_id(slack_id)` → `list[str]`
336
+ - `await get_team_members(team_name)` → `tuple[Employee, ...]`
337
+ - `await get_org_members(org_name)` → `tuple[Employee, ...]`
338
+ - `await is_employee_in_team(uid, team_name)` → `bool`
339
+ - `await is_slack_user_in_team(slack_id, team_name)` → `bool`
340
+ - `await is_employee_in_org(uid, org_name)` → `bool`
341
+ - `await is_slack_user_in_org(slack_id, org_name)` → `bool`
342
+
343
+ #### Hierarchy Queries
344
+ - `await get_hierarchy_path(entity_name, entity_type)` → `list[HierarchyPathEntry]`
345
+ - `await get_descendants_tree(entity_name)` → `HierarchyNode | None`
346
+ - `await get_user_organizations(uid)` → `tuple[OrgInfo, ...]`
347
+
348
+ #### Jira Queries
349
+ - `await get_jira_projects()` → `list[str]`
350
+ - `await get_jira_components(project)` → `list[str]`
351
+ - `await get_teams_by_jira_project(project)` → `list[JiraOwnerInfo]`
352
+ - `await get_teams_by_jira_component(project, component)` → `list[JiraOwnerInfo]`
353
+ - `await get_jira_ownership_for_team(team_name)` → `list[dict]`
354
+
355
+ #### Enumeration
356
+ - `await get_all_employee_uids()` → `list[str]`
357
+ - `await get_all_team_names()` → `list[str]`
358
+ - `await get_all_org_names()` → `list[str]`
359
+ - `await get_all_pillar_names()` → `list[str]`
360
+ - `await get_all_team_group_names()` → `list[str]`
361
+ - `await get_all_employees()` → `tuple[Employee, ...]`
362
+ - `await get_all_teams()` → `tuple[Team, ...]`
363
+ - `await get_all_orgs()` → `tuple[Org, ...]`
364
+ - `await get_all_pillars()` → `tuple[Pillar, ...]`
365
+ - `await get_all_team_groups()` → `tuple[TeamGroup, ...]`
366
+ - `await get_all_components()` → `tuple[Component, ...]`
367
+
368
+ #### Data Management
369
+ - `await load_from_data_source(source)` → `None`
370
+ - `await start_data_source_watcher(source)` → `None`
371
+ - `await stop_watcher()` → `None`
372
+ - `is_healthy()` → `bool` (sync)
373
+ - `is_ready()` → `bool` (sync)
374
+ - `get_version()` → `DataVersion` (sync)
375
+
376
+ ## Thread Safety
377
+
378
+ The `Service` class is thread-safe. All read operations can be performed concurrently, and data reloading is atomic.
379
+
380
+ The `AsyncService` class is asyncio-safe, using `asyncio.Lock` to protect data access during concurrent async operations.
381
+
382
+ ## Development
383
+
384
+ ### Using UV (Recommended)
385
+
386
+ ```bash
387
+ # Set up development environment
388
+ uv sync
389
+
390
+ # Run tests
391
+ uv run pytest
392
+
393
+ # Run tests with coverage
394
+ uv run pytest --cov=orgdatacore --cov-report=html
395
+
396
+ # Type checking
397
+ uv run mypy orgdatacore
398
+
399
+ # Code formatting
400
+ uv run black orgdatacore tests
401
+ uv run isort orgdatacore tests
402
+
403
+ # Linting
404
+ uv run ruff check orgdatacore tests
405
+ ```
406
+
407
+ ### Using pip
408
+
409
+ ```bash
410
+ # Install dev dependencies
411
+ pip install -e ".[dev]"
412
+
413
+ # Run tests
414
+ pytest
415
+
416
+ # Run tests with coverage
417
+ pytest --cov=orgdatacore --cov-report=html
418
+
419
+ # Type checking
420
+ mypy orgdatacore
421
+
422
+ # Code formatting
423
+ black orgdatacore tests
424
+ isort orgdatacore tests
425
+ ```
426
+
427
+ ## Examples
428
+
429
+ Run the GCS demo with real data:
430
+
431
+ ```bash
432
+ # Make sure you're logged in
433
+ gcloud auth application-default login
434
+
435
+ # Install GCS support
436
+ pip install -e ".[gcs]"
437
+
438
+ # Run the demo
439
+ python examples/gcs_demo.py
440
+ ```
441
+
442
+ ## License
443
+
444
+ Apache-2.0
@@ -0,0 +1,21 @@
1
+ orgdatacore/__init__.py,sha256=kL05FmXMp1uIn8RvxkOxPhdGYvVCayeuAeePyDF_TcM,3469
2
+ orgdatacore/_anonymization.py,sha256=1dgK2n7EO1Jj4ufkj38IOHyVpPyDTAYrP3cNQWlN1eA,16671
3
+ orgdatacore/_async.py,sha256=gpYNEt1qjCd394uD4Au8LzCyBdGTBDJ2Namz1Xyi0ys,55935
4
+ orgdatacore/_exceptions.py,sha256=j03sI3av5PXEZtWgfJFb_PIlx8JAGSF8RlojWlo_Ukw,1743
5
+ orgdatacore/_gcs.py,sha256=IukQ_ghMrYpdYT-cy_tA6dXBXgKdusdcrk_fkwoTJKc,10610
6
+ orgdatacore/_log.py,sha256=VN9TRttglj83dnCozUcKzzrjijT5ezYhj7RRsgy_YyM,2515
7
+ orgdatacore/_redaction.py,sha256=7f_EUFKYEH1Zbkp7imVbot3Bo8aLXdCYNYM4k64p1XU,6707
8
+ orgdatacore/_serialization.py,sha256=fcadan_S1db78m8xHUuFEAxSVABR2_bbZ3AzIyGdMFE,758
9
+ orgdatacore/_service.py,sha256=7okehs8llK9kJ1-wRyzaGSxHe4JXIxOlXmMn8ScURsM,53427
10
+ orgdatacore/_types.py,sha256=jeqWMVL72xCWpjs6uau3qQak71uD6x8BAUw9J55ANUY,6793
11
+ orgdatacore/_version.py,sha256=Y3soZWYzN1FXxCY1fXsybM6UDKS1VpzAyUy5AXnEIZg,3792
12
+ orgdatacore/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
+ orgdatacore/_internal/__init__.py,sha256=-agyFZJf2TLyXiZkcCSJk-ZPYM-EFPj0wNvHL7G1WdI,198
14
+ orgdatacore/_internal/testing/__init__.py,sha256=jIYMixjP-4M4UZbTtxjBJI5ElUmdg5xQcmATYNbBP1k,445
15
+ orgdatacore/_internal/testing/fake_gcs.py,sha256=QmzbMm3Gnc_3O6KmqqHGRQBGx9bkrgbHDnZ9s9wKWYA,5536
16
+ orgdatacore/_internal/testing/filesource.py,sha256=nXawRG_l9_INhw0gba9ATj4jwJJUbzjNBcaTfIIFJEM,4887
17
+ orgdatacore/_internal/testing/helpers.py,sha256=KsSYgnYcyZf7xgzMJSQYf1pyD931tJNxzX-npvRMFRg,6162
18
+ orgdatacore-2.0.0.dist-info/METADATA,sha256=DAryDpXRUEU4CYdRhGUxhIbDoWhYt3BFqulPgyRatAk,13111
19
+ orgdatacore-2.0.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
20
+ orgdatacore-2.0.0.dist-info/licenses/LICENSE,sha256=ZMaOn4vY3xHcEiUhtFO26tLdPeMgeP5ahb-67-3QaS0,11343
21
+ orgdatacore-2.0.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.33.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -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 2026 Red Hat, LLC.
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.