diff --git a/internal/website/permstable/permstable.go b/internal/website/permstable/permstable.go index 52fcb1002d..72c6280108 100644 --- a/internal/website/permstable/permstable.go +++ b/internal/website/permstable/permstable.go @@ -76,6 +76,7 @@ func main() { session, target, user, + worker, ) fileContents, err := ioutil.ReadFile(permsFile) @@ -253,16 +254,9 @@ func sortedKeys(in map[string]string) []string { return out } -func clActions(typ string) []*Action { +func lActions(typ string) []*Action { listVersion := strings.TrimPrefix(strings.TrimPrefix(typ, "an "), "a ") return []*Action{ - { - Name: "create", - Description: fmt.Sprintf("Create %s", typ), - Examples: []string{ - "type=;actions=create", - }, - }, { Name: "list", Description: fmt.Sprintf("List %ss", listVersion), @@ -273,6 +267,18 @@ func clActions(typ string) []*Action { } } +func clActions(typ string) []*Action { + return append([]*Action{ + { + Name: "create", + Description: fmt.Sprintf("Create %s", typ), + Examples: []string{ + "type=;actions=create", + }, + }, + }, lActions(typ)...) +} + func rudActions(typ string, pin bool) []*Action { ret := []*Action{ { @@ -828,3 +834,37 @@ var user = &Resource{ }, }, } + +var worker = &Resource{ + Type: "Worker", + Scopes: []string{"Global"}, + Endpoints: []*Endpoint{ + { + Path: "/workers", + Params: map[string]string{ + "Type": "workers", + }, + Actions: append( + lActions("a worker"), + &Action{ + Name: "create:worker-led", + Description: "Create a worker using the worker-led workflow", + Examples: []string{ + "type=;actions=create", + "type=;actions=create:worker-led", + }, + }, + ), + }, + { + Path: "/workers/", + Params: map[string]string{ + "ID": "", + "Type": "workers", + }, + Actions: append( + rudActions("a worker", false), + ), + }, + }, +} diff --git a/website/content/docs/concepts/security/permissions/resource-table.mdx b/website/content/docs/concepts/security/permissions/resource-table.mdx index b44d00cebd..167621c1f3 100644 --- a/website/content/docs/concepts/security/permissions/resource-table.mdx +++ b/website/content/docs/concepts/security/permissions/resource-table.mdx @@ -1442,6 +1442,99 @@ documentation](https://www.boundaryproject.io/api-docs) for guidance. + + Worker + +
    +
  • Global
  • +
+ + + /workers + + +
    +
  • Type
  • +
      +
    • + workers +
    • +
    +
+ + +
    +
  • + list: List workers +
  • +
      +
    • + type=<type>;actions=list +
    • +
    +
  • + create:worker-led: Create a worker using the worker-led workflow +
  • +
      +
    • + type=<type>;actions=create +
    • +
    • + type=<type>;actions=create:worker-led +
    • +
    +
+ + + + + /workers/<id> + + +
    +
  • ID
  • +
      +
    • + <id> +
    • +
    +
  • Type
  • +
      +
    • + workers +
    • +
    +
+ + +
    +
  • + read: Read a worker +
  • +
      +
    • + id=<id>;actions=read +
    • +
    +
  • + update: Update a worker +
  • +
      +
    • + id=<id>;actions=update +
    • +
    +
  • + delete: Delete a worker +
  • +
      +
    • + id=<id>;actions=delete +
    • +
    +
+ +