fufu-cloud-cli 0.9.0__tar.gz → 0.9.1__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.
Files changed (48) hide show
  1. {fufu_cloud_cli-0.9.0/src/fufu_cloud_cli.egg-info → fufu_cloud_cli-0.9.1}/PKG-INFO +7 -2
  2. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/README.md +6 -1
  3. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/pyproject.toml +1 -1
  4. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli/__init__.py +1 -1
  5. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli/api_backend.py +12 -3
  6. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1/src/fufu_cloud_cli.egg-info}/PKG-INFO +7 -2
  7. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/LICENSE +0 -0
  8. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/MANIFEST.in +0 -0
  9. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/setup.cfg +0 -0
  10. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli/__main__.py +0 -0
  11. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli/capabilities.json +0 -0
  12. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli/capacity.py +0 -0
  13. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli/cli.py +0 -0
  14. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli/cloud_data.py +0 -0
  15. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli/cloudflare.py +0 -0
  16. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli/control.py +0 -0
  17. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli/docker_backend.py +0 -0
  18. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli/errors.py +0 -0
  19. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli/http_runtime.py +0 -0
  20. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli/iac_state.py +0 -0
  21. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli/lambda_adapter.py +0 -0
  22. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli/limits.py +0 -0
  23. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli/manifest.py +0 -0
  24. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli/object_transfer.py +0 -0
  25. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli/public_access.py +0 -0
  26. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli/pubsub.py +0 -0
  27. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli/pulumi-endpoints.json +0 -0
  28. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli/pulumi_bridge.py +0 -0
  29. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli/remote_compute.py +0 -0
  30. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli/runtime/functions/Dockerfile +0 -0
  31. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli/runtime/ingress/Dockerfile +0 -0
  32. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli/runtime/ingress/proxy.py +0 -0
  33. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli/runtime_sdk.py +0 -0
  34. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli/secrets.py +0 -0
  35. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli/serverless.py +0 -0
  36. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli/terraform_bridge/__init__.py +0 -0
  37. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli/terraform_bridge/aws.py +0 -0
  38. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli/terraform_bridge/aws_data.py +0 -0
  39. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli/terraform_bridge/common.py +0 -0
  40. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli/terraform_bridge/google.py +0 -0
  41. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli/terraform_bridge/google_pubsub.py +0 -0
  42. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli/terraform_bridge/remote_state.py +0 -0
  43. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli/terraform_bridge/runner.py +0 -0
  44. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli.egg-info/SOURCES.txt +0 -0
  45. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli.egg-info/dependency_links.txt +0 -0
  46. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli.egg-info/entry_points.txt +0 -0
  47. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli.egg-info/requires.txt +0 -0
  48. {fufu_cloud_cli-0.9.0 → fufu_cloud_cli-0.9.1}/src/fufu_cloud_cli.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fufu-cloud-cli
3
- Version: 0.9.0
3
+ Version: 0.9.1
4
4
  Summary: FUFU Cloud CLI for tenant-scoped mock cloud development and deployment
5
5
  License-Expression: LicenseRef-Proprietary
6
6
  Requires-Python: >=3.10
@@ -22,12 +22,17 @@ Dynamic: license-file
22
22
  `gcloud-fufu`、`az-fufu`、`wrangler-fufu`。這是 AWS、Google Cloud、Azure 與 Cloudflare 的**明確子集**,
23
23
  只供 FUFU mock 環境使用;不會把部署轉送到正式雲端。
24
24
 
25
+ 0.9.1 統一所有 CLI API 請求的 `User-Agent: fufu-cloud-cli`,涵蓋物件傳輸、
26
+ Cloudflare 靜態檔案部署、IaC 遠端 state 與 Cloud Shell session,避免沿用
27
+ Python 預設識別而遇到 Cloudflare HTTP 403/1010。識別標頭不取代 credential
28
+ 或 IAM;HTTPS 驗證、禁止重新導向與不使用環境代理的行為保留。
29
+
25
30
  0.8.0 包含資源配額、分段傳輸、Terraform 核心子集與 Cloudflare 靜態部署/R2。需要同步更新服務端;CLI 安裝成功不表示任意 FUFU 服務端都已有這些能力。
26
31
 
27
32
  ## Cloudflare 前端部署與 R2
28
33
 
29
34
  ```bash
30
- pip install 'fufu-cloud-cli==0.8.0'
35
+ pip install 'fufu-cloud-cli==0.9.1'
31
36
  export FUFU_CLOUDFLARE_CREDENTIAL_FILE=/run/secrets/fufu-cloudflare.json
32
37
  wrangler-fufu capabilities
33
38
  wrangler-fufu pages project create frontend --production-branch main
@@ -4,12 +4,17 @@
4
4
  `gcloud-fufu`、`az-fufu`、`wrangler-fufu`。這是 AWS、Google Cloud、Azure 與 Cloudflare 的**明確子集**,
5
5
  只供 FUFU mock 環境使用;不會把部署轉送到正式雲端。
6
6
 
7
+ 0.9.1 統一所有 CLI API 請求的 `User-Agent: fufu-cloud-cli`,涵蓋物件傳輸、
8
+ Cloudflare 靜態檔案部署、IaC 遠端 state 與 Cloud Shell session,避免沿用
9
+ Python 預設識別而遇到 Cloudflare HTTP 403/1010。識別標頭不取代 credential
10
+ 或 IAM;HTTPS 驗證、禁止重新導向與不使用環境代理的行為保留。
11
+
7
12
  0.8.0 包含資源配額、分段傳輸、Terraform 核心子集與 Cloudflare 靜態部署/R2。需要同步更新服務端;CLI 安裝成功不表示任意 FUFU 服務端都已有這些能力。
8
13
 
9
14
  ## Cloudflare 前端部署與 R2
10
15
 
11
16
  ```bash
12
- pip install 'fufu-cloud-cli==0.8.0'
17
+ pip install 'fufu-cloud-cli==0.9.1'
13
18
  export FUFU_CLOUDFLARE_CREDENTIAL_FILE=/run/secrets/fufu-cloudflare.json
14
19
  wrangler-fufu capabilities
15
20
  wrangler-fufu pages project create frontend --production-branch main
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "fufu-cloud-cli"
7
- version = "0.9.0"
7
+ version = "0.9.1"
8
8
  description = "FUFU Cloud CLI for tenant-scoped mock cloud development and deployment"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -1,3 +1,3 @@
1
1
  """FUFU CLI 與本機部署工具;相容範圍見 capabilities.json。"""
2
2
 
3
- __version__ = "0.9.0"
3
+ __version__ = "0.9.1"
@@ -19,6 +19,7 @@ PROVIDERS = {"aws", "gcp", "azure", "cloudflare"}
19
19
  from .limits import JSON_BODY_BYTES, JSON_RESPONSE_BYTES
20
20
 
21
21
  MAX_RESPONSE = 8 * 1024 * 1024
22
+ HTTP_USER_AGENT = "fufu-cloud-cli"
22
23
 
23
24
 
24
25
  @contextmanager
@@ -49,6 +50,15 @@ class NoRedirect(HTTPRedirectHandler):
49
50
  return None
50
51
 
51
52
 
53
+ def api_opener():
54
+ """Keep the CLI identity on every request, including binary and IaC traffic."""
55
+ opener = build_opener(ProxyHandler({}), NoRedirect(), HTTPSHandler(context=ssl.create_default_context()))
56
+ # Python-urllib's default identity can trigger Cloudflare error 1010. Set
57
+ # this at the transport boundary so new request paths inherit it as well.
58
+ opener.addheaders = [("User-Agent", HTTP_USER_AGENT)]
59
+ return opener
60
+
61
+
52
62
  def endpoint_url(value):
53
63
  require(isinstance(value, str) and value == value.strip(), "INVALID_ENDPOINT", "請提供有效的 FUFU API endpoint。")
54
64
  parsed = urlsplit(value)
@@ -113,7 +123,7 @@ def load_credential(provider=None, filename=None):
113
123
  class ApiClient:
114
124
  def __init__(self, provider=None, filename=None, read_only=False):
115
125
  self.owns_token = True
116
- self.opener = build_opener(ProxyHandler({}), NoRedirect(), HTTPSHandler(context=ssl.create_default_context()))
126
+ self.opener = api_opener()
117
127
  if os.environ.get('FUFU_SESSION_FILE') and not filename:
118
128
  p = Path(os.environ['FUFU_SESSION_FILE'])
119
129
  require(p.is_file() and p.stat().st_size <= 16384, 'INVALID_SESSION', 'Session 檔案無效。')
@@ -133,7 +143,6 @@ class ApiClient:
133
143
  credential, self.endpoint = load_credential(provider, filename)
134
144
  self.provider = credential["provider"]
135
145
  self.token = None
136
- self.opener = build_opener(ProxyHandler({}), NoRedirect(), HTTPSHandler(context=ssl.create_default_context()))
137
146
  scopes = [f"{self.provider}:read"] + ([] if read_only else [f"{self.provider}:write"])
138
147
  issued = self._request("POST", "/api/auth/token", {**credential, "scopes": scopes,
139
148
  **({'assume_role': os.environ['FUFU_ASSUME_ROLE']} if os.environ.get('FUFU_ASSUME_ROLE') else {})})
@@ -157,7 +166,7 @@ class ApiClient:
157
166
  def _request(self, method, path, body=None, *, large=False):
158
167
  require(path.startswith("/api/") and "\r" not in path and "\n" not in path,
159
168
  "INVALID_REQUEST", "API 路徑無效。")
160
- headers = {"Accept": "application/json", "User-Agent": "fufu-cloud-cli"}
169
+ headers = {"Accept": "application/json"}
161
170
  if self.token:
162
171
  headers["Authorization"] = f"Bearer {self.token}"
163
172
  data = None if body is None else json.dumps(body).encode("utf-8")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fufu-cloud-cli
3
- Version: 0.9.0
3
+ Version: 0.9.1
4
4
  Summary: FUFU Cloud CLI for tenant-scoped mock cloud development and deployment
5
5
  License-Expression: LicenseRef-Proprietary
6
6
  Requires-Python: >=3.10
@@ -22,12 +22,17 @@ Dynamic: license-file
22
22
  `gcloud-fufu`、`az-fufu`、`wrangler-fufu`。這是 AWS、Google Cloud、Azure 與 Cloudflare 的**明確子集**,
23
23
  只供 FUFU mock 環境使用;不會把部署轉送到正式雲端。
24
24
 
25
+ 0.9.1 統一所有 CLI API 請求的 `User-Agent: fufu-cloud-cli`,涵蓋物件傳輸、
26
+ Cloudflare 靜態檔案部署、IaC 遠端 state 與 Cloud Shell session,避免沿用
27
+ Python 預設識別而遇到 Cloudflare HTTP 403/1010。識別標頭不取代 credential
28
+ 或 IAM;HTTPS 驗證、禁止重新導向與不使用環境代理的行為保留。
29
+
25
30
  0.8.0 包含資源配額、分段傳輸、Terraform 核心子集與 Cloudflare 靜態部署/R2。需要同步更新服務端;CLI 安裝成功不表示任意 FUFU 服務端都已有這些能力。
26
31
 
27
32
  ## Cloudflare 前端部署與 R2
28
33
 
29
34
  ```bash
30
- pip install 'fufu-cloud-cli==0.8.0'
35
+ pip install 'fufu-cloud-cli==0.9.1'
31
36
  export FUFU_CLOUDFLARE_CREDENTIAL_FILE=/run/secrets/fufu-cloudflare.json
32
37
  wrangler-fufu capabilities
33
38
  wrangler-fufu pages project create frontend --production-branch main
File without changes
File without changes