Twice the identity provider's admin kept an older password than the one the mesh minted (an adopted, then a moved database), and the provisioner failed every consumer until it was repaired by hand (hq issue 179). The module now checks the admin's login and repairs a refusal itself through the server's bootstrap command, verifies, brakes a failed repair and announces it, and stops asking the server while refused. Ported to Go to change it.
32 lines
944 B
Go
32 lines
944 B
Go
package main
|
|
|
|
// The provisioner loop is carried, identical, by every Go provider until the Go SDK has it
|
|
// (harness.go). Two copies drift the moment one is fixed and the other is not — and the one left
|
|
// behind is the provider that fails a consumer without saying so (novox/hq ADR 0224). This holds
|
|
// them to one text. Skipped where postgres is not beside this module, as in a build of this one alone.
|
|
|
|
import (
|
|
"bytes"
|
|
"errors"
|
|
"io/fs"
|
|
"os"
|
|
"testing"
|
|
)
|
|
|
|
func TestTheHarnessIsTheSameAsPostgress(t *testing.T) {
|
|
theirs, err := os.ReadFile("../../../postgres/cmd/postgres-provider/harness.go")
|
|
if errors.Is(err, fs.ErrNotExist) {
|
|
t.Skip("postgres is not beside this module")
|
|
}
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
ours, err := os.ReadFile("harness.go")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if !bytes.Equal(ours, theirs) {
|
|
t.Fatal("harness.go differs from postgres/cmd/postgres-provider/harness.go: change both, identically")
|
|
}
|
|
}
|