oficina / home Public

Clone
git clone https://amadan.net/oficina/home

Plain git — no account needed to clone.

Download

Download this file

1package operator
2
3import "testing"
4
5// Base joins canonical adoption (Paul, 2026-11-23: Base production at
6// https://base.oficina.works). A plan may adopt it into team oficina, alone
7// or with all seven other canonical apps, and the adoption binds only the
8// canonical host: never Base's old CARLOS host.
9func TestBaseIsAdoptableIntoTeamOficina(t *testing.T) {
10 f := newHTTPDirectory(t)
11 all := []string{"docs", "sheets", "slides", "calendar", "calls", "memoria", "equipo", "base"}
12 for _, apps := range [][]string{{"base"}, all} {
13 p := Plan{Version: 1, Purpose: "operator-plan", Role: "directory", Origin: f.engine.verifier.pins.Origin,
14 Installation: token(1), Registry: token(2), Device: token(3), PlanID: token(4), Kind: "add-apps", Apps: apps,
15 Label: "oficina", ExistingTeam: "Uk", Issued: f.now.Unix(), Expires: f.now.Unix() + PlanLifetime}
16 set := map[string]bool{}
17 for _, app := range all {
18 set[app] = true
19 }
20 if !p.valid(set) {
21 t.Fatalf("adoption of %v refused", apps)
22 }
23 }
24 if !routeScope("Uk", "oficina", "Uk", "base", "base", "https://base.oficina.works") {
25 t.Fatal("Base's canonical host refused")
26 }
27 for _, origin := range []string{"https://base.bds.oncarlos.com", "https://base.oficina.works/", "https://blue.base.oficina.works"} {
28 if routeScope("Uk", "oficina", "Uk", "base", "base", origin) {
29 t.Fatalf("adoption bound %s", origin)
30 }
31 }
32 // Ordinary provisioning still never takes the canonical host.
33 if routeScope("", "blue", "Bb", "base", "blue-base", "https://base.oficina.works") {
34 t.Fatal("a new team took Base's canonical host")
35 }
36}
37