From 62a85a0ea18a6f853f03d4101bf7436ebf8fc589 Mon Sep 17 00:00:00 2001 From: Kentrow <22888702+Kentrow@users.noreply.github.com> Date: Mon, 23 Nov 2026 22:27:19 +0100 Subject: [PATCH] chore(deps): move to go-ovh 1.10.0 and the new OVHcloud API domains --- CHANGELOG.md | 4 ++++ NOTICE | 2 +- README.fr.md | 4 ++-- README.md | 4 ++-- docs/ARCHITECTURE.md | 3 ++- go.mod | 2 +- go.sum | 4 ++-- internal/httpapi/handoff_test.go | 2 +- internal/httpapi/inventory_test.go | 2 +- internal/ovh/api.go | 2 +- internal/ovh/api_test.go | 8 ++++---- internal/publicip/publicip.go | 2 +- ovh.conf.example | 4 ++-- 13 files changed, 24 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e25504..e3d60e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Changed + +- Reach the OVHcloud API at its new addresses, `api.eu.ovhcloud.com` for `ovh-eu` and `api.ca.ovhcloud.com` for `ovh-ca`, as go-ovh 1.10.0 does; an outbound filter that only lets `eu.api.ovh.com` or `ca.api.ovh.com` through needs the new name. The links that open the key creation page use the same addresses. + ## [1.0.3] - 2026-11-11 ### Changed diff --git a/NOTICE b/NOTICE index cd5f3b7..1fe1c5e 100644 --- a/NOTICE +++ b/NOTICE @@ -43,7 +43,7 @@ Data internal/catalog/snapshots/ and internal/catalog/testdata/ are derived from the public API descriptions (schemas) published by OVHcloud at -https://eu.api.ovh.com/1.0/, https://ca.api.ovh.com/1.0/ and +https://api.eu.ovhcloud.com/1.0/, https://api.ca.ovhcloud.com/1.0/ and https://api.us.ovhcloud.com/1.0/. ------------------------------------------------------------------------------- diff --git a/README.fr.md b/README.fr.md index 2f2c6cb..7899b19 100644 --- a/README.fr.md +++ b/README.fr.md @@ -137,11 +137,11 @@ Prenez celui qui correspond à la région de votre compte, telle que la nomment **`ovh-eu`** - + **`ovh-ca`** - + **`ovh-us`** diff --git a/README.md b/README.md index 3b9f4e0..c145473 100644 --- a/README.md +++ b/README.md @@ -129,11 +129,11 @@ one matching the region of your account, as the official SDKs name it. **`ovh-eu`** - + **`ovh-ca`** - + **`ovh-us`** diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index b94deb6..4cb9650 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -147,7 +147,8 @@ in all. Writes are sent again too, since a call refused for its rate did nothing | `GET` | `/1.0/` and the `*.json` schemas it lists | Building the route catalogue, without authentication | Accepted endpoints are `ovh-eu`, `ovh-ca` and `ovh-us`. The Kimsufi and SoYouStart entries of -the `go-ovh` table resolve to hosts outside `api.ovh.com` and are refused. +the `go-ovh` table resolve to hosts on their own domains, `kimsufi.com` and `soyoustart.com`, and +are refused. The management key needs these rules, declared in `ovh.ManagementRules`. A test ties every rule, `ovh.AddressRule` included, to a call the client makes, and every call under `/me` to a rule. diff --git a/go.mod b/go.mod index 5367e2a..7a6fa80 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.27.0 toolchain go1.27.4 -require github.com/ovh/go-ovh v1.9.0 +require github.com/ovh/go-ovh v1.10.0 require ( github.com/pmezard/go-difflib v1.0.0 // indirect diff --git a/go.sum b/go.sum index 32e6b08..e5cc359 100644 --- a/go.sum +++ b/go.sum @@ -6,8 +6,8 @@ github.com/jarcoal/httpmock v1.3.0 h1:2RJ8GP0IIaWwcC9Fp2BmVi8Kog3v2Hn7VXM3fTd+nu github.com/jarcoal/httpmock v1.3.0/go.mod h1:3yb8rc4BI7TCBhFY8ng0gjuLKJNquuDNiPaZjnENuYg= github.com/maxatome/go-testdeep v1.12.0 h1:Ql7Go8Tg0C1D/uMMX59LAoYK7LffeJQ6X2T04nTH68g= github.com/maxatome/go-testdeep v1.12.0/go.mod h1:lPZc/HAcJMP92l7yI6TRz1aZN5URwUBUAfUNvrclaNM= -github.com/ovh/go-ovh v1.9.0 h1:6K8VoL3BYjVV3In9tPJUdT7qMx9h0GExN9EXx1r2kKE= -github.com/ovh/go-ovh v1.9.0/go.mod h1:cTVDnl94z4tl8pP1uZ/8jlVxntjSIf09bNcQ5TJSC7c= +github.com/ovh/go-ovh v1.10.0 h1:TlH3Y7FRxgnPeYJHPbNSCESU8GkX2Sxo2ifaiS+IwH8= +github.com/ovh/go-ovh v1.10.0/go.mod h1:cTVDnl94z4tl8pP1uZ/8jlVxntjSIf09bNcQ5TJSC7c= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= diff --git a/internal/httpapi/handoff_test.go b/internal/httpapi/handoff_test.go index 28f6579..7749425 100644 --- a/internal/httpapi/handoff_test.go +++ b/internal/httpapi/handoff_test.go @@ -41,7 +41,7 @@ func TestHandoffCarriesEveryRuleToThePageOfTheRegion(t *testing.T) { } got := decode[handoffResponse](t, rec).URL - if !strings.HasPrefix(got, "https://eu.api.ovh.com/createToken/?") { + if !strings.HasPrefix(got, "https://api.eu.ovhcloud.com/createToken/?") { t.Fatalf("url = %q, want the page of the configured region", got) } for _, want := range []string{ diff --git a/internal/httpapi/inventory_test.go b/internal/httpapi/inventory_test.go index 82e9925..14dca8b 100644 --- a/internal/httpapi/inventory_test.go +++ b/internal/httpapi/inventory_test.go @@ -88,7 +88,7 @@ func TestTheSessionCarriesTheSensitiveBranchesOfTheAudit(t *testing.T) { func TestTheSessionCarriesThePageThatIssuesAManagementKey(t *testing.T) { got := decode[sessionResponse](t, request(t, newTestServer(t, inventoryFixture()), "/api/session", true)).ManagementKeyURL - if !strings.HasPrefix(got, "https://eu.api.ovh.com/createToken/?") { + if !strings.HasPrefix(got, "https://api.eu.ovhcloud.com/createToken/?") { t.Fatalf("managementKeyUrl = %q, want the page of the configured region", got) } for _, rule := range []string{"GET=/me/api/credential", "DELETE=/me/api/credential/*"} { diff --git a/internal/ovh/api.go b/internal/ovh/api.go index 24765ca..f2f5d8b 100644 --- a/internal/ovh/api.go +++ b/internal/ovh/api.go @@ -33,7 +33,7 @@ const ( ) // supportedEndpoints is deliberately narrower than the SDK table. The Kimsufi and -// SoYouStart entries point at hosts outside api.ovh.com, which the outbound rule does +// SoYouStart entries point at hosts on their own domains, which the outbound rule does // not cover, and supporting them has not been decided. var supportedEndpoints = []string{"ovh-eu", "ovh-ca", "ovh-us"} diff --git a/internal/ovh/api_test.go b/internal/ovh/api_test.go index fbe7398..50165d0 100644 --- a/internal/ovh/api_test.go +++ b/internal/ovh/api_test.go @@ -294,8 +294,8 @@ func TestUnsupportedEndpointsAreRefused(t *testing.T) { func TestTheCreateTokenPageIsOnTheHostOfTheRegion(t *testing.T) { cases := map[string]string{ - "ovh-eu": "https://eu.api.ovh.com/createToken/", - "ovh-ca": "https://ca.api.ovh.com/createToken/", + "ovh-eu": "https://api.eu.ovhcloud.com/createToken/", + "ovh-ca": "https://api.ca.ovhcloud.com/createToken/", "ovh-us": "https://api.us.ovhcloud.com/createToken/", } @@ -320,7 +320,7 @@ func TestTheCreateTokenLinkCarriesTheRulesReadably(t *testing.T) { t.Fatalf("CreateTokenURL: %v", err) } - want := "https://eu.api.ovh.com/createToken/" + + want := "https://api.eu.ovhcloud.com/createToken/" + "?GET=/me/api/credential" + "&GET=/me/api/credential/*" + "&GET=/me/api/application" + @@ -364,7 +364,7 @@ func TestAnUnusualRulePathIsEscaped(t *testing.T) { if err != nil { t.Fatalf("CreateTokenURL: %v", err) } - if want := "https://eu.api.ovh.com/createToken/?GET=/me/api%3Fx%3D1%26y%3D2%20z%23f"; got != want { + if want := "https://api.eu.ovhcloud.com/createToken/?GET=/me/api%3Fx%3D1%26y%3D2%20z%23f"; got != want { t.Errorf("link = %q, want %q", got, want) } } diff --git a/internal/publicip/publicip.go b/internal/publicip/publicip.go index 8563825..2dfe619 100644 --- a/internal/publicip/publicip.go +++ b/internal/publicip/publicip.go @@ -11,7 +11,7 @@ // The call is never made on its own. It happens when the reader asks for the address, or // restricts the credential the tool runs with, which cannot be done safely without knowing // it. The whole feature can be switched off, so that an instance can be run with nothing but -// api.ovh.com on its outbound path. +// the OVHcloud API on its outbound path. package publicip import ( diff --git a/ovh.conf.example b/ovh.conf.example index 436f615..5375bd0 100644 --- a/ovh.conf.example +++ b/ovh.conf.example @@ -11,7 +11,7 @@ [default] ; The region of your account, as the official SDKs name it: ovh-eu, ovh-ca or ovh-us. ; The Kimsufi and SoYouStart endpoints are not accepted, because they resolve to hosts -; outside api.ovh.com. +; on their own domains, kimsufi.com and soyoustart.com. endpoint=ovh-eu [ovh-eu] @@ -31,7 +31,7 @@ endpoint=ovh-eu ; those. ; ; This link opens the OVHcloud page with exactly those rules prefilled: -; https://eu.api.ovh.com/createToken/?GET=/me/api/credential&GET=/me/api/credential/*&GET=/me/api/application&GET=/me/api/application/*&DELETE=/me/api/credential/*&DELETE=/me/api/application/* +; https://api.eu.ovhcloud.com/createToken/?GET=/me/api/credential&GET=/me/api/credential/*&GET=/me/api/application&GET=/me/api/application/*&DELETE=/me/api/credential/*&DELETE=/me/api/application/* application_key= application_secret= consumer_key=