jentic-openapi-transformer-redocly 1.0.0a31__tar.gz → 1.0.0a33__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.
- {jentic_openapi_transformer_redocly-1.0.0a31 → jentic_openapi_transformer_redocly-1.0.0a33}/PKG-INFO +20 -12
- {jentic_openapi_transformer_redocly-1.0.0a31 → jentic_openapi_transformer_redocly-1.0.0a33}/README.md +17 -9
- {jentic_openapi_transformer_redocly-1.0.0a31 → jentic_openapi_transformer_redocly-1.0.0a33}/pyproject.toml +3 -3
- {jentic_openapi_transformer_redocly-1.0.0a31 → jentic_openapi_transformer_redocly-1.0.0a33}/src/jentic/apitools/openapi/transformer/bundler/backends/redocly/__init__.py +12 -3
- {jentic_openapi_transformer_redocly-1.0.0a31 → jentic_openapi_transformer_redocly-1.0.0a33}/LICENSE +0 -0
- {jentic_openapi_transformer_redocly-1.0.0a31 → jentic_openapi_transformer_redocly-1.0.0a33}/NOTICE +0 -0
- {jentic_openapi_transformer_redocly-1.0.0a31 → jentic_openapi_transformer_redocly-1.0.0a33}/src/jentic/apitools/openapi/transformer/bundler/backends/redocly/py.typed +0 -0
{jentic_openapi_transformer_redocly-1.0.0a31 → jentic_openapi_transformer_redocly-1.0.0a33}/PKG-INFO
RENAMED
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: jentic-openapi-transformer-redocly
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.0a33
|
|
4
4
|
Summary: Jentic OpenAPI Redocly Transformer Backend
|
|
5
5
|
Author: Jentic
|
|
6
6
|
Author-email: Jentic <hello@jentic.com>
|
|
7
7
|
License-Expression: Apache-2.0
|
|
8
8
|
License-File: LICENSE
|
|
9
9
|
License-File: NOTICE
|
|
10
|
-
Requires-Dist: jentic-openapi-common~=1.0.
|
|
11
|
-
Requires-Dist: jentic-openapi-transformer~=1.0.
|
|
10
|
+
Requires-Dist: jentic-openapi-common~=1.0.0a33
|
|
11
|
+
Requires-Dist: jentic-openapi-transformer~=1.0.0a33
|
|
12
12
|
Requires-Python: >=3.11
|
|
13
13
|
Project-URL: Homepage, https://github.com/jentic/jentic-openapi-tools
|
|
14
14
|
Description-Content-Type: text/markdown
|
|
15
15
|
|
|
16
16
|
# jentic-openapi-transformer-redocly
|
|
17
17
|
|
|
18
|
-
A Python library that provides OpenAPI document bundling functionality
|
|
18
|
+
A Python library that provides OpenAPI document bundling functionality
|
|
19
|
+
using [Redocly CLI](https://redocly.com/docs/cli/). This package is part of the Jentic OpenAPI Tools ecosystem and
|
|
20
|
+
implements the transformer backend pattern for bundling OpenAPI documents by resolving external references.
|
|
19
21
|
|
|
20
22
|
## Features
|
|
21
23
|
|
|
@@ -25,7 +27,6 @@ A Python library that provides OpenAPI document bundling functionality using [Re
|
|
|
25
27
|
- **Timeout Configuration**: Configurable timeout for long-running bundling operations
|
|
26
28
|
- **Type Safety**: Full type hints and comprehensive documentation
|
|
27
29
|
|
|
28
|
-
|
|
29
30
|
## Installation
|
|
30
31
|
|
|
31
32
|
```bash
|
|
@@ -33,13 +34,14 @@ pip install jentic-openapi-transformer-redocly
|
|
|
33
34
|
```
|
|
34
35
|
|
|
35
36
|
**Prerequisites:**
|
|
37
|
+
|
|
36
38
|
- Node.js and npm (for Redocly CLI)
|
|
37
39
|
- Python 3.11+
|
|
38
40
|
|
|
39
41
|
The Redocly CLI will be automatically downloaded via npx on first use, or you can install it globally:
|
|
40
42
|
|
|
41
43
|
```bash
|
|
42
|
-
npm install -g @redocly/cli
|
|
44
|
+
npm install -g @redocly/cli@2.14.3
|
|
43
45
|
```
|
|
44
46
|
|
|
45
47
|
## Quick Start
|
|
@@ -122,7 +124,8 @@ The bundler accepts the following input formats (returned by `accepts()` method)
|
|
|
122
124
|
|
|
123
125
|
### Integration Tests
|
|
124
126
|
|
|
125
|
-
The integration tests require Redocly CLI to be available. They will be automatically skipped if Redocly is not
|
|
127
|
+
The integration tests require Redocly CLI to be available. They will be automatically skipped if Redocly is not
|
|
128
|
+
installed.
|
|
126
129
|
|
|
127
130
|
**Run the integration test:**
|
|
128
131
|
|
|
@@ -137,17 +140,21 @@ uv run --package jentic-openapi-transformer-redocly pytest packages/jentic-opena
|
|
|
137
140
|
```python
|
|
138
141
|
class RedoclyBundlerBackend(BaseBundlerBackend):
|
|
139
142
|
def __init__(
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
143
|
+
self,
|
|
144
|
+
redocly_path: str = "npx --yes @redocly/cli@2.14.3",
|
|
145
|
+
timeout: float = 600.0,
|
|
146
|
+
allowed_base_dir: str | Path | None = None,
|
|
144
147
|
) -> None
|
|
145
148
|
```
|
|
146
149
|
|
|
147
150
|
**Parameters:**
|
|
151
|
+
|
|
148
152
|
- `redocly_path`: Path to Redocly CLI executable
|
|
149
153
|
- `timeout`: Maximum execution time in seconds
|
|
150
|
-
- `allowed_base_dir`: Optional base directory for path security validation. When set, all document paths are validated
|
|
154
|
+
- `allowed_base_dir`: Optional base directory for path security validation. When set, all document paths are validated
|
|
155
|
+
to be within this directory, providing defense against path traversal attacks. When `None` (default), only file
|
|
156
|
+
extension validation is performed (no base directory containment check). Recommended for web services or untrusted
|
|
157
|
+
input (optional)
|
|
151
158
|
|
|
152
159
|
**Methods:**
|
|
153
160
|
|
|
@@ -155,6 +162,7 @@ class RedoclyBundlerBackend(BaseBundlerBackend):
|
|
|
155
162
|
- `bundle(document: str | dict, base_url: str | None = None) -> str`: Bundles an OpenAPI document
|
|
156
163
|
|
|
157
164
|
**Exceptions:**
|
|
165
|
+
|
|
158
166
|
- `TypeError`: Document type is not supported
|
|
159
167
|
- `RuntimeError`: Redocly execution fails or produces invalid output
|
|
160
168
|
- `SubprocessExecutionError`: Redocly times out or fails to start
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# jentic-openapi-transformer-redocly
|
|
2
2
|
|
|
3
|
-
A Python library that provides OpenAPI document bundling functionality
|
|
3
|
+
A Python library that provides OpenAPI document bundling functionality
|
|
4
|
+
using [Redocly CLI](https://redocly.com/docs/cli/). This package is part of the Jentic OpenAPI Tools ecosystem and
|
|
5
|
+
implements the transformer backend pattern for bundling OpenAPI documents by resolving external references.
|
|
4
6
|
|
|
5
7
|
## Features
|
|
6
8
|
|
|
@@ -10,7 +12,6 @@ A Python library that provides OpenAPI document bundling functionality using [Re
|
|
|
10
12
|
- **Timeout Configuration**: Configurable timeout for long-running bundling operations
|
|
11
13
|
- **Type Safety**: Full type hints and comprehensive documentation
|
|
12
14
|
|
|
13
|
-
|
|
14
15
|
## Installation
|
|
15
16
|
|
|
16
17
|
```bash
|
|
@@ -18,13 +19,14 @@ pip install jentic-openapi-transformer-redocly
|
|
|
18
19
|
```
|
|
19
20
|
|
|
20
21
|
**Prerequisites:**
|
|
22
|
+
|
|
21
23
|
- Node.js and npm (for Redocly CLI)
|
|
22
24
|
- Python 3.11+
|
|
23
25
|
|
|
24
26
|
The Redocly CLI will be automatically downloaded via npx on first use, or you can install it globally:
|
|
25
27
|
|
|
26
28
|
```bash
|
|
27
|
-
npm install -g @redocly/cli
|
|
29
|
+
npm install -g @redocly/cli@2.14.3
|
|
28
30
|
```
|
|
29
31
|
|
|
30
32
|
## Quick Start
|
|
@@ -107,7 +109,8 @@ The bundler accepts the following input formats (returned by `accepts()` method)
|
|
|
107
109
|
|
|
108
110
|
### Integration Tests
|
|
109
111
|
|
|
110
|
-
The integration tests require Redocly CLI to be available. They will be automatically skipped if Redocly is not
|
|
112
|
+
The integration tests require Redocly CLI to be available. They will be automatically skipped if Redocly is not
|
|
113
|
+
installed.
|
|
111
114
|
|
|
112
115
|
**Run the integration test:**
|
|
113
116
|
|
|
@@ -122,17 +125,21 @@ uv run --package jentic-openapi-transformer-redocly pytest packages/jentic-opena
|
|
|
122
125
|
```python
|
|
123
126
|
class RedoclyBundlerBackend(BaseBundlerBackend):
|
|
124
127
|
def __init__(
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
128
|
+
self,
|
|
129
|
+
redocly_path: str = "npx --yes @redocly/cli@2.14.3",
|
|
130
|
+
timeout: float = 600.0,
|
|
131
|
+
allowed_base_dir: str | Path | None = None,
|
|
129
132
|
) -> None
|
|
130
133
|
```
|
|
131
134
|
|
|
132
135
|
**Parameters:**
|
|
136
|
+
|
|
133
137
|
- `redocly_path`: Path to Redocly CLI executable
|
|
134
138
|
- `timeout`: Maximum execution time in seconds
|
|
135
|
-
- `allowed_base_dir`: Optional base directory for path security validation. When set, all document paths are validated
|
|
139
|
+
- `allowed_base_dir`: Optional base directory for path security validation. When set, all document paths are validated
|
|
140
|
+
to be within this directory, providing defense against path traversal attacks. When `None` (default), only file
|
|
141
|
+
extension validation is performed (no base directory containment check). Recommended for web services or untrusted
|
|
142
|
+
input (optional)
|
|
136
143
|
|
|
137
144
|
**Methods:**
|
|
138
145
|
|
|
@@ -140,6 +147,7 @@ class RedoclyBundlerBackend(BaseBundlerBackend):
|
|
|
140
147
|
- `bundle(document: str | dict, base_url: str | None = None) -> str`: Bundles an OpenAPI document
|
|
141
148
|
|
|
142
149
|
**Exceptions:**
|
|
150
|
+
|
|
143
151
|
- `TypeError`: Document type is not supported
|
|
144
152
|
- `RuntimeError`: Redocly execution fails or produces invalid output
|
|
145
153
|
- `SubprocessExecutionError`: Redocly times out or fails to start
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "jentic-openapi-transformer-redocly"
|
|
3
|
-
version = "1.0.0-alpha.
|
|
3
|
+
version = "1.0.0-alpha.33"
|
|
4
4
|
description = "Jentic OpenAPI Redocly Transformer Backend"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [{ name = "Jentic", email = "hello@jentic.com" }]
|
|
@@ -8,8 +8,8 @@ license = "Apache-2.0"
|
|
|
8
8
|
license-files = ["LICENSE", "NOTICE"]
|
|
9
9
|
requires-python = ">=3.11"
|
|
10
10
|
dependencies = [
|
|
11
|
-
"jentic-openapi-common~=1.0.0-alpha.
|
|
12
|
-
"jentic-openapi-transformer~=1.0.0-alpha.
|
|
11
|
+
"jentic-openapi-common~=1.0.0-alpha.33",
|
|
12
|
+
"jentic-openapi-transformer~=1.0.0-alpha.33"
|
|
13
13
|
]
|
|
14
14
|
|
|
15
15
|
[project.urls]
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import json
|
|
2
|
+
import os
|
|
2
3
|
import shlex
|
|
3
4
|
import tempfile
|
|
4
5
|
from collections.abc import Sequence
|
|
@@ -17,7 +18,7 @@ __all__ = ["RedoclyBundlerBackend"]
|
|
|
17
18
|
class RedoclyBundlerBackend(BaseBundlerBackend):
|
|
18
19
|
def __init__(
|
|
19
20
|
self,
|
|
20
|
-
redocly_path: str = "npx --yes @redocly/cli@2.
|
|
21
|
+
redocly_path: str = "npx --yes @redocly/cli@2.14.3",
|
|
21
22
|
timeout: float = 600.0,
|
|
22
23
|
allowed_base_dir: str | Path | None = None,
|
|
23
24
|
):
|
|
@@ -25,7 +26,7 @@ class RedoclyBundlerBackend(BaseBundlerBackend):
|
|
|
25
26
|
Initialize the RedoclyBundler.
|
|
26
27
|
|
|
27
28
|
Args:
|
|
28
|
-
redocly_path: Path to the redocly CLI executable (default: "npx --yes @redocly/cli@2.
|
|
29
|
+
redocly_path: Path to the redocly CLI executable (default: "npx --yes @redocly/cli@2.14.3").
|
|
29
30
|
Uses shell-safe parsing to handle quoted arguments properly.
|
|
30
31
|
timeout: Maximum time in seconds to wait for Redocly CLI execution (default: 600.0)
|
|
31
32
|
allowed_base_dir: Optional base directory for path security validation.
|
|
@@ -108,7 +109,15 @@ class RedoclyBundlerBackend(BaseBundlerBackend):
|
|
|
108
109
|
# TODO(francesco@jentic.com): raises errors in redocly for unknown reason
|
|
109
110
|
# "--remove-unused-components",
|
|
110
111
|
]
|
|
111
|
-
|
|
112
|
+
env = os.environ.copy()
|
|
113
|
+
env.update(
|
|
114
|
+
{
|
|
115
|
+
"REDOCLY_TELEMETRY": "off",
|
|
116
|
+
"REDOCLY_SUPPRESS_UPDATE_NOTICE": "true",
|
|
117
|
+
}
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
result = run_subprocess(cmd, env=env, timeout=self.timeout)
|
|
112
121
|
|
|
113
122
|
# Check if bundling was successful based on return code
|
|
114
123
|
if result.returncode != 0:
|
{jentic_openapi_transformer_redocly-1.0.0a31 → jentic_openapi_transformer_redocly-1.0.0a33}/LICENSE
RENAMED
|
File without changes
|
{jentic_openapi_transformer_redocly-1.0.0a31 → jentic_openapi_transformer_redocly-1.0.0a33}/NOTICE
RENAMED
|
File without changes
|