WeKnora/internal/application
Fei.Chen bca3a9f448
fix(storage): use virtual-hosted addressing for OBS bucket requests (#3273)
* fix(storage): use virtual-hosted addressing for OBS bucket requests

Huawei Cloud OBS has rejected path-style bucket addressing on domain
endpoints since 2023-12-30, so PutObject failed with 404 NoSuchKey while
HeadBucket still passed. The driver also pinned HostnameImmutable=true
via a deprecated custom endpoint resolver, which blocked the SDK from
injecting the bucket label into the hostname.

- Replace the custom resolver with BaseEndpoint and enable
  virtual-hosted style for domain endpoints; keep path-style as a
  defensive fallback for IP-literal or unparseable endpoints.
- Align checksum negotiation with the S3 driver
  (RequestChecksumCalculation: WhenRequired).
- GetFileURL now emits {bucket}.{endpoint-host}/{key} URLs when no
  proxy domain is configured, mirroring the client addressing.
- Share one obsS3Options constructor between the file service and the
  connectivity check, and add obs_test.go (previously zero coverage).

Closes #3269

* test(storage): assert OBS PutObject hits virtual-hosted URLs

UsePathStyle=false is not sufficient — a HostnameImmutable resolver can still force path-style. Capture the signed request host/path so this cannot regress the way #3272 would have.

* test(storage): keep OBS client tests within lint limits

The new-from-rev pre-push lint also flags the original obs_test.go lines. Wrap long fatals and silence the deprecated EndpointResolver assertion so the fork push can run hooks.

---------

Co-authored-by: wizardchen <wizardchen@tencent.com>
2026-09-15 18:18:40 +08:00
..
access refactor(resource-access): unify scoped authorization and transfer recovery (#3097) 2026-09-08 15:36:33 +08:00
repository fix: clean up wiki data when deleting knowledge base (#3109) 2026-09-14 21:02:31 +08:00
service fix(storage): use virtual-hosted addressing for OBS bucket requests (#3273) 2026-09-15 18:18:40 +08:00