mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-11-30 09:32:45 +01:00
A provider could stand the MSP bundle up and evaluate it without asking anyone, but paying still meant emailing its public key to Pulse and copying a licence file onto the host by hand. With the licence server's self-serve purchase path (pulse-pro license-server/provider_msp_purchase), the control plane can do the whole thing itself. The control plane now signs a challenge with its lease signing key to fetch the licence its subscription entitles, validates it exactly as startup does, requires it to bind this platform's key, and keeps it in the data directory, because the host licence is a read-only secret mount. Startup prefers that renewed licence while it validates, so a paying provider keeps starting after the self-issued evaluation on the host expires. A changed licence restarts the control plane through the existing graceful shutdown, since the plan version is read at load by every workspace-limit, backup and status path; client workspaces keep running. Preflight, proof, recovery and backup accept either signed source. The portal gains owner and admin routes for plan state, checkout, the Stripe billing portal and an immediate licence refresh, and the plan list comes from the licence server so it shows only what can be bought, at Stripe's price. Adds the msp_solo plan: 3 client workspaces, the first paid step above the 2-workspace evaluation.
524 lines
16 KiB
Go
524 lines
16 KiB
Go
package cloudcp
|
|
|
|
import (
|
|
"net/http"
|
|
"net/http/httptest"
|
|
"strings"
|
|
"testing"
|
|
|
|
cpauth "github.com/rcourtman/pulse-go-rewrite/internal/cloudcp/auth"
|
|
"github.com/rcourtman/pulse-go-rewrite/internal/cloudcp/portal"
|
|
"github.com/rcourtman/pulse-go-rewrite/internal/cloudcp/registry"
|
|
)
|
|
|
|
func TestRegisterRoutes_StatusAuthModes(t *testing.T) {
|
|
t.Run("default requires admin key", func(t *testing.T) {
|
|
dir := t.TempDir()
|
|
reg, err := registry.NewTenantRegistry(dir)
|
|
if err != nil {
|
|
t.Fatalf("NewTenantRegistry: %v", err)
|
|
}
|
|
t.Cleanup(func() { _ = reg.Close() })
|
|
|
|
mux := http.NewServeMux()
|
|
RegisterRoutes(mux, &Deps{
|
|
Config: &CPConfig{
|
|
DataDir: dir,
|
|
AdminKey: "test-admin-key",
|
|
BaseURL: "https://cloud.example.com",
|
|
StripeWebhookSecret: "whsec_test",
|
|
},
|
|
Registry: reg,
|
|
Version: "test",
|
|
})
|
|
|
|
req := httptest.NewRequest(http.MethodGet, "/status", nil)
|
|
rec := httptest.NewRecorder()
|
|
mux.ServeHTTP(rec, req)
|
|
if rec.Code != http.StatusUnauthorized {
|
|
t.Fatalf("status = %d, want %d (body=%q)", rec.Code, http.StatusUnauthorized, rec.Body.String())
|
|
}
|
|
})
|
|
|
|
t.Run("public status enabled", func(t *testing.T) {
|
|
dir := t.TempDir()
|
|
reg, err := registry.NewTenantRegistry(dir)
|
|
if err != nil {
|
|
t.Fatalf("NewTenantRegistry: %v", err)
|
|
}
|
|
t.Cleanup(func() { _ = reg.Close() })
|
|
|
|
mux := http.NewServeMux()
|
|
RegisterRoutes(mux, &Deps{
|
|
Config: &CPConfig{
|
|
DataDir: dir,
|
|
AdminKey: "test-admin-key",
|
|
BaseURL: "https://cloud.example.com",
|
|
PublicStatus: true,
|
|
StripeWebhookSecret: "whsec_test",
|
|
},
|
|
Registry: reg,
|
|
Version: "test",
|
|
})
|
|
|
|
req := httptest.NewRequest(http.MethodGet, "/status", nil)
|
|
rec := httptest.NewRecorder()
|
|
mux.ServeHTTP(rec, req)
|
|
if rec.Code != http.StatusOK {
|
|
t.Fatalf("status = %d, want %d (body=%q)", rec.Code, http.StatusOK, rec.Body.String())
|
|
}
|
|
})
|
|
}
|
|
|
|
func TestRegisterRoutes_AccountRoutesRequireSession(t *testing.T) {
|
|
dir := t.TempDir()
|
|
reg, err := registry.NewTenantRegistry(dir)
|
|
if err != nil {
|
|
t.Fatalf("NewTenantRegistry: %v", err)
|
|
}
|
|
t.Cleanup(func() { _ = reg.Close() })
|
|
|
|
accountID, err := registry.GenerateAccountID()
|
|
if err != nil {
|
|
t.Fatalf("GenerateAccountID: %v", err)
|
|
}
|
|
if err := reg.CreateAccount(®istry.Account{
|
|
ID: accountID,
|
|
Kind: registry.AccountKindMSP,
|
|
DisplayName: "Acme MSP",
|
|
}); err != nil {
|
|
t.Fatalf("CreateAccount: %v", err)
|
|
}
|
|
|
|
userID, err := registry.GenerateUserID()
|
|
if err != nil {
|
|
t.Fatalf("GenerateUserID: %v", err)
|
|
}
|
|
if err := reg.CreateUser(®istry.User{
|
|
ID: userID,
|
|
Email: "owner@example.com",
|
|
}); err != nil {
|
|
t.Fatalf("CreateUser: %v", err)
|
|
}
|
|
if err := reg.CreateMembership(®istry.AccountMembership{
|
|
AccountID: accountID,
|
|
UserID: userID,
|
|
Role: registry.MemberRoleOwner,
|
|
}); err != nil {
|
|
t.Fatalf("CreateMembership: %v", err)
|
|
}
|
|
|
|
magicSvc, err := cpauth.NewService(dir)
|
|
if err != nil {
|
|
t.Fatalf("NewService: %v", err)
|
|
}
|
|
t.Cleanup(magicSvc.Close)
|
|
|
|
token, err := magicSvc.GenerateSessionToken(userID, "owner@example.com", cpauth.SessionTTL)
|
|
if err != nil {
|
|
t.Fatalf("GenerateSessionToken: %v", err)
|
|
}
|
|
|
|
mux := http.NewServeMux()
|
|
RegisterRoutes(mux, &Deps{
|
|
Config: &CPConfig{
|
|
DataDir: dir,
|
|
AdminKey: "test-admin-key",
|
|
BaseURL: "https://cloud.example.com",
|
|
StripeWebhookSecret: "whsec_test",
|
|
},
|
|
Registry: reg,
|
|
MagicLinks: magicSvc,
|
|
Version: "test",
|
|
})
|
|
|
|
unauthReq := httptest.NewRequest(http.MethodGet, "/api/accounts/"+accountID+"/tenants", nil)
|
|
unauthRec := httptest.NewRecorder()
|
|
mux.ServeHTTP(unauthRec, unauthReq)
|
|
if unauthRec.Code != http.StatusUnauthorized {
|
|
t.Fatalf("unauth status = %d, want %d (body=%q)", unauthRec.Code, http.StatusUnauthorized, unauthRec.Body.String())
|
|
}
|
|
|
|
authReq := httptest.NewRequest(http.MethodGet, "/api/accounts/"+accountID+"/tenants", nil)
|
|
authReq.Header.Set("Authorization", "Bearer "+token)
|
|
authRec := httptest.NewRecorder()
|
|
mux.ServeHTTP(authRec, authReq)
|
|
if authRec.Code != http.StatusOK {
|
|
t.Fatalf("auth status = %d, want %d (body=%q)", authRec.Code, http.StatusOK, authRec.Body.String())
|
|
}
|
|
|
|
// Revoke sessions and verify the previously issued token is no longer valid.
|
|
if _, err := reg.RevokeUserSessions(userID); err != nil {
|
|
t.Fatalf("RevokeUserSessions: %v", err)
|
|
}
|
|
|
|
revokedReq := httptest.NewRequest(http.MethodGet, "/api/accounts/"+accountID+"/tenants", nil)
|
|
revokedReq.Header.Set("Authorization", "Bearer "+token)
|
|
revokedRec := httptest.NewRecorder()
|
|
mux.ServeHTTP(revokedRec, revokedReq)
|
|
if revokedRec.Code != http.StatusUnauthorized {
|
|
t.Fatalf("revoked status = %d, want %d (body=%q)", revokedRec.Code, http.StatusUnauthorized, revokedRec.Body.String())
|
|
}
|
|
}
|
|
|
|
func TestRegisterRoutes_LogoutRevokesSession(t *testing.T) {
|
|
dir := t.TempDir()
|
|
reg, err := registry.NewTenantRegistry(dir)
|
|
if err != nil {
|
|
t.Fatalf("NewTenantRegistry: %v", err)
|
|
}
|
|
t.Cleanup(func() { _ = reg.Close() })
|
|
|
|
accountID, err := registry.GenerateAccountID()
|
|
if err != nil {
|
|
t.Fatalf("GenerateAccountID: %v", err)
|
|
}
|
|
if err := reg.CreateAccount(®istry.Account{
|
|
ID: accountID,
|
|
Kind: registry.AccountKindMSP,
|
|
DisplayName: "Acme MSP",
|
|
}); err != nil {
|
|
t.Fatalf("CreateAccount: %v", err)
|
|
}
|
|
|
|
userID, err := registry.GenerateUserID()
|
|
if err != nil {
|
|
t.Fatalf("GenerateUserID: %v", err)
|
|
}
|
|
if err := reg.CreateUser(®istry.User{
|
|
ID: userID,
|
|
Email: "owner@example.com",
|
|
}); err != nil {
|
|
t.Fatalf("CreateUser: %v", err)
|
|
}
|
|
if err := reg.CreateMembership(®istry.AccountMembership{
|
|
AccountID: accountID,
|
|
UserID: userID,
|
|
Role: registry.MemberRoleOwner,
|
|
}); err != nil {
|
|
t.Fatalf("CreateMembership: %v", err)
|
|
}
|
|
|
|
magicSvc, err := cpauth.NewService(dir)
|
|
if err != nil {
|
|
t.Fatalf("NewService: %v", err)
|
|
}
|
|
t.Cleanup(magicSvc.Close)
|
|
|
|
sessionVersion, err := reg.GetUserSessionVersion(userID)
|
|
if err != nil {
|
|
t.Fatalf("GetUserSessionVersion: %v", err)
|
|
}
|
|
token, err := magicSvc.GenerateSessionTokenWithVersion(userID, "owner@example.com", sessionVersion, cpauth.SessionTTL)
|
|
if err != nil {
|
|
t.Fatalf("GenerateSessionTokenWithVersion: %v", err)
|
|
}
|
|
|
|
mux := http.NewServeMux()
|
|
RegisterRoutes(mux, &Deps{
|
|
Config: &CPConfig{
|
|
DataDir: dir,
|
|
AdminKey: "test-admin-key",
|
|
BaseURL: "https://cloud.example.com",
|
|
StripeWebhookSecret: "whsec_test",
|
|
},
|
|
Registry: reg,
|
|
MagicLinks: magicSvc,
|
|
Version: "test",
|
|
})
|
|
|
|
logoutReq := httptest.NewRequest(http.MethodPost, portal.PortalLogoutPath, nil)
|
|
logoutReq.Header.Set("Authorization", "Bearer "+token)
|
|
logoutRec := httptest.NewRecorder()
|
|
mux.ServeHTTP(logoutRec, logoutReq)
|
|
if logoutRec.Code != http.StatusOK {
|
|
t.Fatalf("logout status = %d, want %d (body=%q)", logoutRec.Code, http.StatusOK, logoutRec.Body.String())
|
|
}
|
|
|
|
afterReq := httptest.NewRequest(http.MethodGet, "/api/accounts/"+accountID+"/tenants", nil)
|
|
afterReq.Header.Set("Authorization", "Bearer "+token)
|
|
afterRec := httptest.NewRecorder()
|
|
mux.ServeHTTP(afterRec, afterReq)
|
|
if afterRec.Code != http.StatusUnauthorized {
|
|
t.Fatalf("post-logout status = %d, want %d (body=%q)", afterRec.Code, http.StatusUnauthorized, afterRec.Body.String())
|
|
}
|
|
}
|
|
|
|
func TestRegisterRoutes_PortalBootstrapRequiresSession(t *testing.T) {
|
|
dir := t.TempDir()
|
|
reg, err := registry.NewTenantRegistry(dir)
|
|
if err != nil {
|
|
t.Fatalf("NewTenantRegistry: %v", err)
|
|
}
|
|
t.Cleanup(func() { _ = reg.Close() })
|
|
|
|
accountID, err := registry.GenerateAccountID()
|
|
if err != nil {
|
|
t.Fatalf("GenerateAccountID: %v", err)
|
|
}
|
|
if err := reg.CreateAccount(®istry.Account{
|
|
ID: accountID,
|
|
Kind: registry.AccountKindIndividual,
|
|
DisplayName: "Hosted Account",
|
|
}); err != nil {
|
|
t.Fatalf("CreateAccount: %v", err)
|
|
}
|
|
|
|
userID, err := registry.GenerateUserID()
|
|
if err != nil {
|
|
t.Fatalf("GenerateUserID: %v", err)
|
|
}
|
|
if err := reg.CreateUser(®istry.User{
|
|
ID: userID,
|
|
Email: "owner@example.com",
|
|
}); err != nil {
|
|
t.Fatalf("CreateUser: %v", err)
|
|
}
|
|
if err := reg.CreateMembership(®istry.AccountMembership{
|
|
AccountID: accountID,
|
|
UserID: userID,
|
|
Role: registry.MemberRoleOwner,
|
|
}); err != nil {
|
|
t.Fatalf("CreateMembership: %v", err)
|
|
}
|
|
|
|
magicSvc, err := cpauth.NewService(dir)
|
|
if err != nil {
|
|
t.Fatalf("NewService: %v", err)
|
|
}
|
|
t.Cleanup(magicSvc.Close)
|
|
|
|
token, err := magicSvc.GenerateSessionToken(userID, "owner@example.com", cpauth.SessionTTL)
|
|
if err != nil {
|
|
t.Fatalf("GenerateSessionToken: %v", err)
|
|
}
|
|
|
|
mux := http.NewServeMux()
|
|
RegisterRoutes(mux, &Deps{
|
|
Config: &CPConfig{
|
|
DataDir: dir,
|
|
AdminKey: "test-admin-key",
|
|
BaseURL: "https://cloud.example.com",
|
|
StripeWebhookSecret: "whsec_test",
|
|
},
|
|
Registry: reg,
|
|
MagicLinks: magicSvc,
|
|
Version: "test",
|
|
})
|
|
|
|
unauthReq := httptest.NewRequest(http.MethodGet, portal.PortalBootstrapPath, nil)
|
|
unauthRec := httptest.NewRecorder()
|
|
mux.ServeHTTP(unauthRec, unauthReq)
|
|
if unauthRec.Code != http.StatusUnauthorized {
|
|
t.Fatalf("unauth status = %d, want %d (body=%q)", unauthRec.Code, http.StatusUnauthorized, unauthRec.Body.String())
|
|
}
|
|
|
|
authReq := httptest.NewRequest(http.MethodGet, portal.PortalBootstrapPath, nil)
|
|
authReq.Header.Set("Authorization", "Bearer "+token)
|
|
authRec := httptest.NewRecorder()
|
|
mux.ServeHTTP(authRec, authReq)
|
|
if authRec.Code != http.StatusOK {
|
|
t.Fatalf("auth status = %d, want %d (body=%q)", authRec.Code, http.StatusOK, authRec.Body.String())
|
|
}
|
|
if !strings.Contains(authRec.Body.String(), "\"email\":\"owner@example.com\"") {
|
|
t.Fatalf("expected bootstrap payload to include owner email, body=%q", authRec.Body.String())
|
|
}
|
|
if !strings.Contains(authRec.Body.String(), "\"id\":\""+accountID+"\"") {
|
|
t.Fatalf("expected bootstrap payload to include account id, body=%q", authRec.Body.String())
|
|
}
|
|
|
|
if _, err := reg.RevokeUserSessions(userID); err != nil {
|
|
t.Fatalf("RevokeUserSessions: %v", err)
|
|
}
|
|
|
|
revokedReq := httptest.NewRequest(http.MethodGet, portal.PortalBootstrapPath, nil)
|
|
revokedReq.Header.Set("Authorization", "Bearer "+token)
|
|
revokedRec := httptest.NewRecorder()
|
|
mux.ServeHTTP(revokedRec, revokedReq)
|
|
if revokedRec.Code != http.StatusUnauthorized {
|
|
t.Fatalf("revoked status = %d, want %d (body=%q)", revokedRec.Code, http.StatusUnauthorized, revokedRec.Body.String())
|
|
}
|
|
}
|
|
|
|
func TestRegisterRoutes_PortalPageSessionModes(t *testing.T) {
|
|
dir := t.TempDir()
|
|
reg, err := registry.NewTenantRegistry(dir)
|
|
if err != nil {
|
|
t.Fatalf("NewTenantRegistry: %v", err)
|
|
}
|
|
t.Cleanup(func() { _ = reg.Close() })
|
|
|
|
accountID, err := registry.GenerateAccountID()
|
|
if err != nil {
|
|
t.Fatalf("GenerateAccountID: %v", err)
|
|
}
|
|
if err := reg.CreateAccount(®istry.Account{
|
|
ID: accountID,
|
|
Kind: registry.AccountKindMSP,
|
|
DisplayName: "Acme MSP",
|
|
}); err != nil {
|
|
t.Fatalf("CreateAccount: %v", err)
|
|
}
|
|
|
|
userID, err := registry.GenerateUserID()
|
|
if err != nil {
|
|
t.Fatalf("GenerateUserID: %v", err)
|
|
}
|
|
if err := reg.CreateUser(®istry.User{
|
|
ID: userID,
|
|
Email: "owner@example.com",
|
|
}); err != nil {
|
|
t.Fatalf("CreateUser: %v", err)
|
|
}
|
|
if err := reg.CreateMembership(®istry.AccountMembership{
|
|
AccountID: accountID,
|
|
UserID: userID,
|
|
Role: registry.MemberRoleOwner,
|
|
}); err != nil {
|
|
t.Fatalf("CreateMembership: %v", err)
|
|
}
|
|
|
|
magicSvc, err := cpauth.NewService(dir)
|
|
if err != nil {
|
|
t.Fatalf("NewService: %v", err)
|
|
}
|
|
t.Cleanup(magicSvc.Close)
|
|
|
|
token, err := magicSvc.GenerateSessionToken(userID, "owner@example.com", cpauth.SessionTTL)
|
|
if err != nil {
|
|
t.Fatalf("GenerateSessionToken: %v", err)
|
|
}
|
|
|
|
mux := http.NewServeMux()
|
|
RegisterRoutes(mux, &Deps{
|
|
Config: &CPConfig{
|
|
DataDir: dir,
|
|
AdminKey: "test-admin-key",
|
|
BaseURL: "https://cloud.example.com",
|
|
StripeWebhookSecret: "whsec_test",
|
|
},
|
|
Registry: reg,
|
|
MagicLinks: magicSvc,
|
|
Version: "test",
|
|
})
|
|
|
|
unauthReq := httptest.NewRequest(http.MethodGet, portal.PortalPagePath, nil)
|
|
unauthRec := httptest.NewRecorder()
|
|
mux.ServeHTTP(unauthRec, unauthReq)
|
|
if unauthRec.Code != http.StatusOK {
|
|
t.Fatalf("unauth status = %d, want %d (body=%q)", unauthRec.Code, http.StatusOK, unauthRec.Body.String())
|
|
}
|
|
for _, needle := range []string{
|
|
`id="portal-app-root"`,
|
|
`"authenticated":false`,
|
|
`"magic_link_request_path":"` + portal.PortalMagicLinkRequestPath + `"`,
|
|
`"signup_path":""`,
|
|
"Enter the commercial email address for your Pulse account.",
|
|
} {
|
|
if !strings.Contains(unauthRec.Body.String(), needle) {
|
|
t.Fatalf("expected unauthenticated portal page to contain %q, body=%q", needle, unauthRec.Body.String())
|
|
}
|
|
}
|
|
|
|
authReq := httptest.NewRequest(http.MethodGet, portal.PortalPagePath, nil)
|
|
authReq.Header.Set("Authorization", "Bearer "+token)
|
|
authRec := httptest.NewRecorder()
|
|
mux.ServeHTTP(authRec, authReq)
|
|
if authRec.Code != http.StatusOK {
|
|
t.Fatalf("auth status = %d, want %d (body=%q)", authRec.Code, http.StatusOK, authRec.Body.String())
|
|
}
|
|
for _, needle := range []string{
|
|
"Pulse Account",
|
|
"Acme MSP",
|
|
`id="pulse-account-bootstrap"`,
|
|
`id="portal-app-root"`,
|
|
`"authenticated":true`,
|
|
} {
|
|
if !strings.Contains(authRec.Body.String(), needle) {
|
|
t.Fatalf("expected authenticated portal page to contain %q, body=%q", needle, authRec.Body.String())
|
|
}
|
|
}
|
|
}
|
|
|
|
// On a provider-hosted platform any member may see the plan, but buying,
|
|
// opening billing and refreshing the licence are owner or admin actions.
|
|
func TestRegisterRoutes_ProviderMSPPurchaseRoutesRequireOwnerOrAdmin(t *testing.T) {
|
|
dir := t.TempDir()
|
|
reg, err := registry.NewTenantRegistry(dir)
|
|
if err != nil {
|
|
t.Fatalf("NewTenantRegistry: %v", err)
|
|
}
|
|
t.Cleanup(func() { _ = reg.Close() })
|
|
accountID, err := registry.GenerateAccountID()
|
|
if err != nil {
|
|
t.Fatalf("GenerateAccountID: %v", err)
|
|
}
|
|
if err := reg.CreateAccount(®istry.Account{ID: accountID, Kind: registry.AccountKindMSP, DisplayName: "Acme MSP"}); err != nil {
|
|
t.Fatalf("CreateAccount: %v", err)
|
|
}
|
|
magicSvc, err := cpauth.NewService(dir)
|
|
if err != nil {
|
|
t.Fatalf("NewService: %v", err)
|
|
}
|
|
t.Cleanup(magicSvc.Close)
|
|
sessionFor := func(email string, role registry.MemberRole) string {
|
|
userID, err := registry.GenerateUserID()
|
|
if err != nil {
|
|
t.Fatalf("GenerateUserID: %v", err)
|
|
}
|
|
if err := reg.CreateUser(®istry.User{ID: userID, Email: email}); err != nil {
|
|
t.Fatalf("CreateUser: %v", err)
|
|
}
|
|
if err := reg.CreateMembership(®istry.AccountMembership{AccountID: accountID, UserID: userID, Role: role}); err != nil {
|
|
t.Fatalf("CreateMembership: %v", err)
|
|
}
|
|
token, err := magicSvc.GenerateSessionToken(userID, email, cpauth.SessionTTL)
|
|
if err != nil {
|
|
t.Fatalf("GenerateSessionToken: %v", err)
|
|
}
|
|
return token
|
|
}
|
|
owner := sessionFor("owner@example.com", registry.MemberRoleOwner)
|
|
readOnly := sessionFor("viewer@example.com", registry.MemberRoleReadOnly)
|
|
|
|
mux := http.NewServeMux()
|
|
RegisterRoutes(mux, &Deps{
|
|
Config: &CPConfig{
|
|
DataDir: dir,
|
|
AdminKey: "test-admin-key",
|
|
BaseURL: "https://msp.example.com",
|
|
ControlPlaneMode: ControlPlaneModeProviderHostedMSP,
|
|
ProviderMSPPlanVersion: "msp_eval",
|
|
},
|
|
Registry: reg,
|
|
MagicLinks: magicSvc,
|
|
Version: "test",
|
|
})
|
|
call := func(method, path, token string) int {
|
|
req := httptest.NewRequest(method, "/api/accounts/"+accountID+"/provider-msp/"+path, strings.NewReader(`{"plan_version":"msp_solo","billing_cycle":"monthly"}`))
|
|
if token != "" {
|
|
req.Header.Set("Authorization", "Bearer "+token)
|
|
}
|
|
rec := httptest.NewRecorder()
|
|
mux.ServeHTTP(rec, req)
|
|
return rec.Code
|
|
}
|
|
|
|
if got := call(http.MethodGet, "plan", ""); got != http.StatusUnauthorized {
|
|
t.Fatalf("unauthenticated plan status = %d", got)
|
|
}
|
|
if got := call(http.MethodGet, "plan", readOnly); got != http.StatusOK {
|
|
t.Fatalf("read-only member plan status = %d", got)
|
|
}
|
|
for _, path := range []string{"checkout", "billing-portal", "license/refresh"} {
|
|
if got := call(http.MethodPost, path, readOnly); got != http.StatusForbidden {
|
|
t.Errorf("read-only member %s status = %d, want 403", path, got)
|
|
}
|
|
// The owner reaches the handler, which answers unavailable because
|
|
// this platform has no licence server to relay to.
|
|
if got := call(http.MethodPost, path, owner); got != http.StatusServiceUnavailable {
|
|
t.Errorf("owner %s status = %d, want 503 from the handler", path, got)
|
|
}
|
|
}
|
|
}
|