Require the configured Home namespace for delegated note credentials
4 files changed,
+7
−5
go.mod+1 −1go.sum+2 −0internal/memoria/agent_access.go+2 −2internal/memoria/agent_integration_test.go+2 −2
CI passed — run details
diff --git a/go.mod b/go.mod| index 4261381..588b7a1 100644 |
| --- a/go.mod |
| +++ b/go.mod |
| @@ -5,7 +5,7 @@ go 1.26 |
| toolchain go1.26.5 |
| require ( |
| - amadan.net/oficina/agent-access.git v0.0.0-20261024224328-3966c68144d1 |
| + amadan.net/oficina/agent-access.git v0.0.0-20261024232549-8ed8ba826000 |
| amadan.net/oficina/estilo.git v0.0.0-20261001093750-530cb932e768 |
| amadan.net/oficina/home/connect v0.0.0-20261001093757-2bec942ddd0c |
| amadan.net/oficina/home/handoff v0.0.0-20260908102137-481d2d57f489 |
diff --git a/go.sum b/go.sum| index e0eec23..3178998 100644 |
| --- a/go.sum |
| +++ b/go.sum |
| @@ -1,5 +1,7 @@ |
| amadan.net/oficina/agent-access.git v0.0.0-20261024224328-3966c68144d1 h1:GknXgICfFlRNJTwXrZRdeTRS6DtQ37b3e7COQX/IxAs= |
| amadan.net/oficina/agent-access.git v0.0.0-20261024224328-3966c68144d1/go.mod h1:Ph9PIa3VE1IEaUzZiQH6D+IQ6HThWWGfVr0ecMMgrFA= |
| +amadan.net/oficina/agent-access.git v0.0.0-20261024232549-8ed8ba826000 h1:L07nc+dmLI7c1PBkSkbnrjOK5f8p6OBbA/yTxznxCAw= |
| +amadan.net/oficina/agent-access.git v0.0.0-20261024232549-8ed8ba826000/go.mod h1:Ph9PIa3VE1IEaUzZiQH6D+IQ6HThWWGfVr0ecMMgrFA= |
| amadan.net/oficina/estilo.git v0.0.0-20261001093750-530cb932e768 h1:bVscoa9fH5LdLDjlyecZhrX7JzWPT0blb57MH0FIm2U= |
| amadan.net/oficina/estilo.git v0.0.0-20261001093750-530cb932e768/go.mod h1:4u0jNBtIdMLOsJyrScfqoEuYDJF7BBM3qM9YWbzt6aw= |
| amadan.net/oficina/home/connect v0.0.0-20261001093757-2bec942ddd0c h1:3yxO2D8BxDLMGfFV2o6Sp9Z91yLnjDCIuRKHVWORa8A= |
diff --git a/internal/memoria/agent_access.go b/internal/memoria/agent_access.go| index 0657d39..8b3b01d 100644 |
| --- a/internal/memoria/agent_access.go |
| +++ b/internal/memoria/agent_access.go |
| @@ -21,10 +21,10 @@ func (a *app) WireAgentAccess(mux *http.ServeMux, cfg Config) error { |
| if cfg.AgentIssuer == "" && cfg.AgentTeam == "" { |
| return nil |
| } |
| - if a.home == nil || cfg.AgentTeam == "" || mux == nil { |
| + if a.home == nil || cfg.Home == nil || cfg.AgentTeam == "" || mux == nil { |
| return errors.New("memoria: agent access requires Home and a team") |
| } |
| - v, err := access.NewRemoteVerifier(cfg.AgentIssuer, cfg.Origin+"/api/v1") |
| + v, err := access.NewRemoteVerifier(cfg.AgentIssuer, cfg.Origin+"/api/v1", cfg.Home.Issuer) |
| if err != nil { |
| return errors.New("memoria: invalid agent access configuration") |
| } |
diff --git a/internal/memoria/agent_integration_test.go b/internal/memoria/agent_integration_test.go| index 10f8ab0..685f1cf 100644 |
| --- a/internal/memoria/agent_integration_test.go |
| +++ b/internal/memoria/agent_integration_test.go |
| @@ -60,7 +60,7 @@ func TestAgentGatewayToRealMemoria(t *testing.T) { |
| teams := func(context.Context, string) ([]grant.Team, error) { |
| return []grant.Team{{ID: "acme", Name: "Acme"}}, nil |
| } |
| - grants, err := grant.NewServer(grant.Config{Origin: issuer.URL, Resource: issuer.URL + "/mcp", Store: store, ConsentKey: []byte(strings.Repeat("k", 32)), Clients: []grant.Client{{ID: client.ClientID, Name: "Oficina CLI", Loopback: true}}, Scopes: map[string]string{"notes:read": "Read notes", "notes:write": "Create notes"}, Subject: func(*http.Request) string { return "" }, Teams: teams, ResourceTeams: func(ctx context.Context, subject, resource string) ([]grant.Team, error) { |
| + grants, err := grant.NewServer(grant.Config{IdentityIssuer: homeTestIssuer, Origin: issuer.URL, Resource: issuer.URL + "/mcp", Store: store, ConsentKey: []byte(strings.Repeat("k", 32)), Clients: []grant.Client{{ID: client.ClientID, Name: "Oficina CLI", Loopback: true}}, Scopes: map[string]string{"notes:read": "Read notes", "notes:write": "Create notes"}, Subject: func(*http.Request) string { return "" }, Teams: teams, ResourceTeams: func(ctx context.Context, subject, resource string) ([]grant.Team, error) { |
| if resource != appServer.URL+"/api/v1" { |
| return nil, nil |
| } |
| @@ -69,7 +69,7 @@ func TestAgentGatewayToRealMemoria(t *testing.T) { |
| if err != nil { |
| t.Fatal(err) |
| } |
| - remote, err := access.NewRemoteVerifier(issuer.URL, appServer.URL+"/api/v1") |
| + remote, err := access.NewRemoteVerifier(issuer.URL, appServer.URL+"/api/v1", homeTestIssuer) |
| if err != nil { |
| t.Fatal(err) |
| } |