pylego 0.1.31.1__tar.gz → 0.1.33__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.
- {pylego-0.1.31.1 → pylego-0.1.33}/PKG-INFO +24 -1
- {pylego-0.1.31.1 → pylego-0.1.33}/README.md +23 -0
- {pylego-0.1.31.1 → pylego-0.1.33}/pyproject.toml +1 -1
- {pylego-0.1.31.1 → pylego-0.1.33}/src/pylego/go.mod +0 -21
- {pylego-0.1.31.1 → pylego-0.1.33}/src/pylego/go.sum +40 -491
- pylego-0.1.33/src/pylego/lego.go +398 -0
- pylego-0.1.33/src/pylego/pylego.py +167 -0
- {pylego-0.1.31.1 → pylego-0.1.33}/src/pylego.egg-info/PKG-INFO +24 -1
- pylego-0.1.31.1/src/pylego/lego.go +0 -195
- pylego-0.1.31.1/src/pylego/pylego.py +0 -71
- {pylego-0.1.31.1 → pylego-0.1.33}/LICENSE +0 -0
- {pylego-0.1.31.1 → pylego-0.1.33}/setup.cfg +0 -0
- {pylego-0.1.31.1 → pylego-0.1.33}/setup.py +0 -0
- {pylego-0.1.31.1 → pylego-0.1.33}/src/pylego/__init__.py +0 -0
- {pylego-0.1.31.1 → pylego-0.1.33}/src/pylego.egg-info/SOURCES.txt +0 -0
- {pylego-0.1.31.1 → pylego-0.1.33}/src/pylego.egg-info/dependency_links.txt +0 -0
- {pylego-0.1.31.1 → pylego-0.1.33}/src/pylego.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pylego
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.33
|
|
4
4
|
Summary: A python wrapper package for the lego application written in Golang
|
|
5
5
|
Author-email: Canonical <telco-engineers@lists.canonical.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/canonical/pylego
|
|
@@ -63,6 +63,29 @@ On top of the environment variables that LEGO supports, we have some extra ones
|
|
|
63
63
|
| `TLSALPN01_IFACE` | Interface for the TLS-ALPN-01 challenge (when `plugin=tls`). Any interface by default. |
|
|
64
64
|
| `TLSALPN01_PORT` | Port for the TLS-ALPN-01 challenge (when `plugin=tls`). 443 by default. |
|
|
65
65
|
|
|
66
|
+
## Error Handling
|
|
67
|
+
|
|
68
|
+
All errors raised by `run_lego_command()` are `LEGOError` exceptions with structured information:
|
|
69
|
+
|
|
70
|
+
```python
|
|
71
|
+
from pylego import run_lego_command, LEGOError
|
|
72
|
+
|
|
73
|
+
try:
|
|
74
|
+
result = run_lego_command(...)
|
|
75
|
+
except LEGOError as e:
|
|
76
|
+
print(f"Error: {e}") # Includes error code in message
|
|
77
|
+
print(f"Type: {e.type}") # "acme" (server) or "lego" (client)
|
|
78
|
+
print(f"Code: {e.code}") # e.g., "invalid_csr", "dns_provider_failed"
|
|
79
|
+
print(f"Detail: {e.detail}") # Human-readable message
|
|
80
|
+
|
|
81
|
+
# ACME-specific fields
|
|
82
|
+
if e.type == "acme":
|
|
83
|
+
print(f"Status: {e.status}") # HTTP status code
|
|
84
|
+
print(f"Subproblems: {e.subproblems}") # Validation details per domain
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Common error codes: `invalid_csr`, `invalid_private_key`, `dns_provider_failed`, `network_error`, `certificate_obtain_failed`. ACME errors include codes like `unauthorized`, `rateLimited`, `dns`.
|
|
88
|
+
|
|
66
89
|
## How does it work?
|
|
67
90
|
|
|
68
91
|
Golang supports building a shared c library from its CLI build tool. We import and use the LEGO application from GoLang, and provide a stub with C bindings so that the shared C binary we produce exposes a C API for other programs to import and utilize. pylego then uses the [ctypes](https://docs.python.org/3/library/ctypes.html) standard library in python to load this binary, and make calls to its methods.
|
|
@@ -48,6 +48,29 @@ On top of the environment variables that LEGO supports, we have some extra ones
|
|
|
48
48
|
| `TLSALPN01_IFACE` | Interface for the TLS-ALPN-01 challenge (when `plugin=tls`). Any interface by default. |
|
|
49
49
|
| `TLSALPN01_PORT` | Port for the TLS-ALPN-01 challenge (when `plugin=tls`). 443 by default. |
|
|
50
50
|
|
|
51
|
+
## Error Handling
|
|
52
|
+
|
|
53
|
+
All errors raised by `run_lego_command()` are `LEGOError` exceptions with structured information:
|
|
54
|
+
|
|
55
|
+
```python
|
|
56
|
+
from pylego import run_lego_command, LEGOError
|
|
57
|
+
|
|
58
|
+
try:
|
|
59
|
+
result = run_lego_command(...)
|
|
60
|
+
except LEGOError as e:
|
|
61
|
+
print(f"Error: {e}") # Includes error code in message
|
|
62
|
+
print(f"Type: {e.type}") # "acme" (server) or "lego" (client)
|
|
63
|
+
print(f"Code: {e.code}") # e.g., "invalid_csr", "dns_provider_failed"
|
|
64
|
+
print(f"Detail: {e.detail}") # Human-readable message
|
|
65
|
+
|
|
66
|
+
# ACME-specific fields
|
|
67
|
+
if e.type == "acme":
|
|
68
|
+
print(f"Status: {e.status}") # HTTP status code
|
|
69
|
+
print(f"Subproblems: {e.subproblems}") # Validation details per domain
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Common error codes: `invalid_csr`, `invalid_private_key`, `dns_provider_failed`, `network_error`, `certificate_obtain_failed`. ACME errors include codes like `unauthorized`, `rateLimited`, `dns`.
|
|
73
|
+
|
|
51
74
|
## How does it work?
|
|
52
75
|
|
|
53
76
|
Golang supports building a shared c library from its CLI build tool. We import and use the LEGO application from GoLang, and provide a stub with C bindings so that the shared C binary we produce exposes a C API for other programs to import and utilize. pylego then uses the [ctypes](https://docs.python.org/3/library/ctypes.html) standard library in python to load this binary, and make calls to its methods.
|
|
@@ -29,16 +29,12 @@ require (
|
|
|
29
29
|
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
|
|
30
30
|
github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 // indirect
|
|
31
31
|
github.com/OpenDNS/vegadns2client v0.0.0-20180418235048-a3fa4a771d87 // indirect
|
|
32
|
-
github.com/akamai/AkamaiOPEN-edgegrid-golang v1.2.2 // indirect
|
|
33
32
|
github.com/akamai/AkamaiOPEN-edgegrid-golang/v11 v11.1.0 // indirect
|
|
34
33
|
github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.5 // indirect
|
|
35
34
|
github.com/alibabacloud-go/darabonba-openapi/v2 v2.1.12 // indirect
|
|
36
35
|
github.com/alibabacloud-go/debug v1.0.1 // indirect
|
|
37
|
-
github.com/alibabacloud-go/endpoint-util v1.1.0 // indirect
|
|
38
|
-
github.com/alibabacloud-go/openapi-util v0.1.1 // indirect
|
|
39
36
|
github.com/alibabacloud-go/tea v1.3.12 // indirect
|
|
40
37
|
github.com/alibabacloud-go/tea-utils/v2 v2.0.7 // indirect
|
|
41
|
-
github.com/aliyun/alibaba-cloud-sdk-go v1.63.100 // indirect
|
|
42
38
|
github.com/aliyun/credentials-go v1.4.7 // indirect
|
|
43
39
|
github.com/aws/aws-sdk-go-v2 v1.39.0 // indirect
|
|
44
40
|
github.com/aws/aws-sdk-go-v2/config v1.31.8 // indirect
|
|
@@ -60,12 +56,9 @@ require (
|
|
|
60
56
|
github.com/benbjohnson/clock v1.3.5 // indirect
|
|
61
57
|
github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc // indirect
|
|
62
58
|
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
|
|
63
|
-
github.com/civo/civogo v0.3.11 // indirect
|
|
64
59
|
github.com/clbanning/mxj/v2 v2.7.0 // indirect
|
|
65
|
-
github.com/cloudflare/cloudflare-go v0.115.0 // indirect
|
|
66
60
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
|
67
61
|
github.com/dimchansky/utfbom v1.1.1 // indirect
|
|
68
|
-
github.com/dnsimple/dnsimple-go v1.7.0 // indirect
|
|
69
62
|
github.com/dnsimple/dnsimple-go/v4 v4.0.0 // indirect
|
|
70
63
|
github.com/exoscale/egoscale/v3 v3.1.26 // indirect
|
|
71
64
|
github.com/fatih/color v1.16.0 // indirect
|
|
@@ -87,7 +80,6 @@ require (
|
|
|
87
80
|
github.com/go-playground/validator/v10 v10.23.0 // indirect
|
|
88
81
|
github.com/go-resty/resty/v2 v2.16.5 // indirect
|
|
89
82
|
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
|
|
90
|
-
github.com/goccy/go-json v0.10.5 // indirect
|
|
91
83
|
github.com/goccy/go-yaml v1.9.8 // indirect
|
|
92
84
|
github.com/gofrs/flock v0.12.1 // indirect
|
|
93
85
|
github.com/golang-jwt/jwt/v4 v4.5.2 // indirect
|
|
@@ -100,17 +92,13 @@ require (
|
|
|
100
92
|
github.com/googleapis/gax-go/v2 v2.15.0 // indirect
|
|
101
93
|
github.com/gophercloud/gophercloud v1.14.1 // indirect
|
|
102
94
|
github.com/gophercloud/utils v0.0.0-20231010081019-80377eca5d56 // indirect
|
|
103
|
-
github.com/hashicorp/errwrap v1.0.0 // indirect
|
|
104
95
|
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
|
105
|
-
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
|
106
96
|
github.com/hashicorp/go-retryablehttp v0.7.8 // indirect
|
|
107
97
|
github.com/hashicorp/go-uuid v1.0.3 // indirect
|
|
108
98
|
github.com/hashicorp/hcl v1.0.0 // indirect
|
|
109
99
|
github.com/huaweicloud/huaweicloud-sdk-go-v3 v0.1.168 // indirect
|
|
110
100
|
github.com/iij/doapi v0.0.0-20190504054126-0bbf12d6d7df // indirect
|
|
111
|
-
github.com/infobloxopen/infoblox-go-client v1.1.1 // indirect
|
|
112
101
|
github.com/infobloxopen/infoblox-go-client/v2 v2.10.0 // indirect
|
|
113
|
-
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
|
114
102
|
github.com/json-iterator/go v1.1.13-0.20220915233716-71ac16282d12 // indirect
|
|
115
103
|
github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213 // indirect
|
|
116
104
|
github.com/kolo/xmlrpc v0.0.0-20220921171641-a4b6fa1dd06b // indirect
|
|
@@ -130,7 +118,6 @@ require (
|
|
|
130
118
|
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
|
131
119
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
|
132
120
|
github.com/modern-go/reflect2 v1.0.2 // indirect
|
|
133
|
-
github.com/namedotcom/go v0.0.0-20180403034216-08470befbe04 // indirect
|
|
134
121
|
github.com/namedotcom/go/v4 v4.0.2 // indirect
|
|
135
122
|
github.com/nrdcg/auroradns v1.1.0 // indirect
|
|
136
123
|
github.com/nrdcg/bunny-go v0.0.0-20250327222614-988a091fc7ea // indirect
|
|
@@ -146,10 +133,7 @@ require (
|
|
|
146
133
|
github.com/nrdcg/oci-go-sdk/dns/v1065 v1065.100.0 // indirect
|
|
147
134
|
github.com/nrdcg/porkbun v0.4.0 // indirect
|
|
148
135
|
github.com/nzdjb/go-metaname v1.0.0 // indirect
|
|
149
|
-
github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b // indirect
|
|
150
|
-
github.com/oracle/oci-go-sdk/v65 v65.87.0 // indirect
|
|
151
136
|
github.com/ovh/go-ovh v1.9.0 // indirect
|
|
152
|
-
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
|
|
153
137
|
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
|
|
154
138
|
github.com/peterhellberg/link v1.2.0 // indirect
|
|
155
139
|
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
|
|
@@ -165,7 +149,6 @@ require (
|
|
|
165
149
|
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
|
|
166
150
|
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.34 // indirect
|
|
167
151
|
github.com/selectel/domains-go v1.1.0 // indirect
|
|
168
|
-
github.com/selectel/go-selvpcclient/v3 v3.2.1 // indirect
|
|
169
152
|
github.com/selectel/go-selvpcclient/v4 v4.1.0 // indirect
|
|
170
153
|
github.com/shopspring/decimal v1.4.0 // indirect
|
|
171
154
|
github.com/sirupsen/logrus v1.9.3 // indirect
|
|
@@ -182,7 +165,6 @@ require (
|
|
|
182
165
|
github.com/stretchr/testify v1.11.1 // indirect
|
|
183
166
|
github.com/subosito/gotenv v1.6.0 // indirect
|
|
184
167
|
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.26 // indirect
|
|
185
|
-
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1128 // indirect
|
|
186
168
|
github.com/tjfoc/gmsm v1.4.1 // indirect
|
|
187
169
|
github.com/transip/gotransip/v6 v6.26.0 // indirect
|
|
188
170
|
github.com/ultradns/ultradns-go-sdk v1.8.1-20250722213956-faef419 // indirect
|
|
@@ -190,7 +172,6 @@ require (
|
|
|
190
172
|
github.com/volcengine/volc-sdk-golang v1.0.219 // indirect
|
|
191
173
|
github.com/vultr/govultr/v3 v3.23.0 // indirect
|
|
192
174
|
github.com/yandex-cloud/go-genproto v0.23.0 // indirect
|
|
193
|
-
github.com/yandex-cloud/go-sdk v0.0.0-20250320143332-9cbcfc5de4ae // indirect
|
|
194
175
|
github.com/yandex-cloud/go-sdk/services/dns v0.0.12 // indirect
|
|
195
176
|
github.com/yandex-cloud/go-sdk/v2 v2.11.0 // indirect
|
|
196
177
|
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
|
|
@@ -200,7 +181,6 @@ require (
|
|
|
200
181
|
go.opentelemetry.io/otel v1.37.0 // indirect
|
|
201
182
|
go.opentelemetry.io/otel/metric v1.37.0 // indirect
|
|
202
183
|
go.opentelemetry.io/otel/trace v1.37.0 // indirect
|
|
203
|
-
go.uber.org/atomic v1.9.0 // indirect
|
|
204
184
|
go.uber.org/multierr v1.11.0 // indirect
|
|
205
185
|
go.uber.org/ratelimit v0.3.1 // indirect
|
|
206
186
|
go.uber.org/zap v1.27.0 // indirect
|
|
@@ -216,7 +196,6 @@ require (
|
|
|
216
196
|
golang.org/x/tools v0.36.0 // indirect
|
|
217
197
|
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
|
|
218
198
|
google.golang.org/api v0.249.0 // indirect
|
|
219
|
-
google.golang.org/genproto v0.0.0-20250603155806-513f23925822 // indirect
|
|
220
199
|
google.golang.org/genproto/googleapis/api v0.0.0-20250818200422-3122310a409c // indirect
|
|
221
200
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20250818200422-3122310a409c // indirect
|
|
222
201
|
google.golang.org/grpc v1.75.0 // indirect
|