Replace third-party owners with administrators
Some checks failed
github / Analyze (go) (push) Has been cancelled
github / Analyze (actions) (push) Has been cancelled
github / Analyze (javascript-typescript) (push) Has been cancelled
make / build-apps (push) Has been cancelled
make / probod binary (darwin/amd64) (push) Has been cancelled
make / probod binary (freebsd/amd64) (push) Has been cancelled
make / probod binary (linux/amd64) (push) Has been cancelled
make / probod binary (openbsd/amd64) (push) Has been cancelled
make / probod binary (windows/amd64) (push) Has been cancelled
make / probod binary (darwin/arm64) (push) Has been cancelled
make / probod binary (freebsd/arm64) (push) Has been cancelled
make / probod binary (linux/arm64) (push) Has been cancelled
make / probod binary (openbsd/arm64) (push) Has been cancelled
make / probo-agent (darwin/amd64) (push) Has been cancelled
make / probo-agent (freebsd/amd64) (push) Has been cancelled
make / probo-agent (linux/amd64) (push) Has been cancelled
make / probo-agent (windows/amd64) (push) Has been cancelled
make / probo-agent (darwin/arm64) (push) Has been cancelled
make / probo-agent (freebsd/arm64) (push) Has been cancelled
make / probo-agent (linux/arm64) (push) Has been cancelled
make / probo-agent (windows/arm64) (push) Has been cancelled
make / docker (amd64) (push) Has been cancelled
make / docker (arm64) (push) Has been cancelled
make / snapshot-scan (push) Has been cancelled
make / build-probod (push) Has been cancelled
make / build-probo-agent (push) Has been cancelled
make / lint-go (push) Has been cancelled
make / lint-js (push) Has been cancelled
make / lint-swift (push) Has been cancelled
make / lint-shell (push) Has been cancelled
make / test (push) Has been cancelled
make / test-e2e (push) Has been cancelled
trufflehog / scan (push) Has been cancelled

Migrate business and security owners into a shared administrators list across GraphQL, MCP, CLI, n8n, and the console.

Signed-off-by: Sacha Al Himdani <sacha@probo.com>
This commit is contained in:
Sacha Al Himdani
2026-07-27 12:24:43 +02:00
parent 084726dbad
commit 6a4f124adb
31 changed files with 808 additions and 601 deletions

View File

@@ -58,13 +58,14 @@ type createResponse struct {
func NewCmdCreate(f *cmdutil.Factory) *cobra.Command {
var (
flagOrg string
flagName string
flagCategory string
flagDescription string
flagLegalName string
flagAddress string
flagWebsite string
flagOrg string
flagName string
flagCategory string
flagDescription string
flagLegalName string
flagAddress string
flagWebsite string
flagAdministratorID []string
)
cmd := &cobra.Command{
@@ -178,6 +179,10 @@ func NewCmdCreate(f *cmdutil.Factory) *cobra.Command {
input["websiteUrl"] = flagWebsite
}
if len(flagAdministratorID) > 0 {
input["administratorIds"] = flagAdministratorID
}
data, err := client.Do(
createMutation,
map[string]any{"input": input},
@@ -210,6 +215,7 @@ func NewCmdCreate(f *cmdutil.Factory) *cobra.Command {
cmd.Flags().StringVar(&flagLegalName, "legal-name", "", "Legal name")
cmd.Flags().StringVar(&flagAddress, "address", "", "Headquarter address")
cmd.Flags().StringVar(&flagWebsite, "website", "", "Website URL")
cmd.Flags().StringArrayVar(&flagAdministratorID, "administrator-id", nil, "Administrator profile ID (can be repeated)")
return cmd
}

View File

@@ -32,7 +32,7 @@ import (
const updateMutation = `
mutation($input: UpdateThirdPartyInput!) {
updateThirdParty(input: $input) {
third_party {
thirdParty {
id
name
category
@@ -47,18 +47,19 @@ type updateResponse struct {
ID string `json:"id"`
Name string `json:"name"`
Category string `json:"category"`
} `json:"third_party"`
} `json:"thirdParty"`
} `json:"updateThirdParty"`
}
func NewCmdUpdate(f *cmdutil.Factory) *cobra.Command {
var (
flagName string
flagDescription string
flagCategory string
flagLegalName string
flagAddress string
flagWebsite string
flagName string
flagDescription string
flagCategory string
flagLegalName string
flagAddress string
flagWebsite string
flagAdministratorID []string
)
cmd := &cobra.Command{
@@ -112,6 +113,17 @@ func NewCmdUpdate(f *cmdutil.Factory) *cobra.Command {
input["websiteUrl"] = flagWebsite
}
if cmd.Flags().Changed("administrator-id") {
administratorIDs := make([]string, 0, len(flagAdministratorID))
for _, id := range flagAdministratorID {
if id != "" {
administratorIDs = append(administratorIDs, id)
}
}
input["administratorIds"] = administratorIDs
}
if len(input) == 1 {
return fmt.Errorf("at least one field must be specified for update")
}
@@ -147,6 +159,7 @@ func NewCmdUpdate(f *cmdutil.Factory) *cobra.Command {
cmd.Flags().StringVar(&flagLegalName, "legal-name", "", "Legal name")
cmd.Flags().StringVar(&flagAddress, "address", "", "Headquarter address")
cmd.Flags().StringVar(&flagWebsite, "website", "", "Website URL")
cmd.Flags().StringArrayVar(&flagAdministratorID, "administrator-id", nil, "Administrator profile ID (can be repeated; empty clears)")
return cmd
}

View File

@@ -42,6 +42,10 @@ query($id: ID!) {
legalName
headquarterAddress
websiteUrl
administrators {
id
fullName
}
createdAt
updatedAt
}
@@ -59,8 +63,12 @@ type viewResponse struct {
LegalName *string `json:"legalName"`
HeadquarterAddress *string `json:"headquarterAddress"`
WebsiteUrl *string `json:"websiteUrl"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
Administrators []struct {
ID string `json:"id"`
FullName string `json:"fullName"`
} `json:"administrators"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
} `json:"node"`
}
@@ -146,6 +154,24 @@ func NewCmdView(f *cmdutil.Factory) *cobra.Command {
_, _ = fmt.Fprintf(out, "%s%s\n", label.Render("Website:"), *v.WebsiteUrl)
}
if len(v.Administrators) > 0 {
_, _ = fmt.Fprintf(out, "%s", label.Render("Administrators:"))
for i, a := range v.Administrators {
if i > 0 {
_, _ = fmt.Fprint(out, ", ")
}
if a.FullName != "" {
_, _ = fmt.Fprintf(out, "%s (%s)", a.FullName, a.ID)
} else {
_, _ = fmt.Fprint(out, a.ID)
}
}
_, _ = fmt.Fprintln(out)
}
_, _ = fmt.Fprintln(out)
_, _ = fmt.Fprintf(out, "%s%s\n", label.Render("Created:"), cmdutil.FormatTime(v.CreatedAt))
_, _ = fmt.Fprintf(out, "%s%s\n", label.Render("Updated:"), cmdutil.FormatTime(v.UpdatedAt))