diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index c47f1e6..d9e84d0 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -4,10 +4,6 @@ on:
pull_request:
release: { types: [ published ] }
-env:
- REGISTRY: ghcr.io
- IMAGE_NAME: ${{ github.repository }}
-
jobs:
lint:
name: Lint
@@ -15,116 +11,23 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- with: { go-version: '1.21' }
- - run: |
- mkdir -p ui/dist/img
- touch ui/dist/index.html ui/dist/favicon.ico ui/dist/manifest.json ui/dist/img/fake.png
- - uses: golangci/golangci-lint-action@v3
- with: { version: 'v1.54' }
+ with: { go-version: '1.22' }
+ - uses: oven-sh/setup-bun@v1
+
+ - run: make build-ui
+
+ - uses: golangci/golangci-lint-action@v6
+ with: { version: 'v1.59' }
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- - uses: actions/setup-node@v4
- with: { node-version: '14', cache: 'yarn', cache-dependency-path: 'ui/yarn.lock' }
- uses: actions/setup-go@v4
- with: { go-version: '1.21' }
- - run: |
- mkdir -p ui/dist/img
- touch ui/dist/index.html ui/dist/favicon.ico ui/dist/manifest.json ui/dist/img/fake.png
- - run: docker compose up --quiet-pull --detach
- working-directory: dev
- - run: go test -coverprofile=cover.out -coverpkg=./... ./...
- - run: go tool cover -func=cover.out
- - uses: codecov/codecov-action@v3
+ with: { go-version: '1.22' }
+ - uses: oven-sh/setup-bun@v1
- cypress:
- strategy:
- matrix:
- test: [ tickets, templates, playbooks ]
- auth: [ authelia ]
- runs-on: ubuntu-22.04
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-go@v4
- with: { go-version: '1.21' }
- - uses: actions/setup-node@v4
- with: { node-version: '14' }
- # run UI
- - run: |
- yarn install
- yarn serve &
- working-directory: ui
- - run: curl --head -X GET --retry 60 --retry-all-errors --retry-delay 10 http://localhost:8080
- # run containers
- - run: sed -i 's/host.docker.internal/172.17.0.1/g' dev/nginx.conf
- - run: docker compose up --quiet-pull --detach
- working-directory: dev
- if: matrix.auth == 'authelia'
- - run: curl --head -X GET --retry 60 --retry-all-errors --retry-delay 10 http://localhost:8082
- if: matrix.auth == 'authelia'
- # run catalyst
- - run: |
- mkdir -p ui/dist/img
- touch ui/dist/index.html ui/dist/favicon.ico ui/dist/manifest.json ui/dist/img/fake.png
- - run: go mod download
- - run: bash start_dev.sh &
- working-directory: dev
- if: matrix.auth == 'authelia'
- - run: curl --head -X GET --retry 60 --retry-all-errors --retry-delay 10 http://localhost:8000
- # run cypress
- - uses: cypress-io/github-action@v4
- env:
- CYPRESS_AUTH: ${{ matrix.auth }}
- CYPRESS_TEST: ${{ matrix.test }}
- with:
- browser: chrome
- working-directory: ui
+ - run: make build-ui
- build-npm:
- name: Build npm
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-node@v4
- with: { node-version: '14', cache: 'yarn', cache-dependency-path: 'ui/yarn.lock' }
- - run: yarn install && yarn build
- working-directory: ui
- - uses: actions/upload-artifact@v3
- with: { name: ui, path: ui/dist, retention-days: 1 }
-
- build:
- if: github.event_name != 'pull_request'
- name: Build
- runs-on: ubuntu-latest
- needs: [ build-npm, test ]
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-go@v4
- with: { go-version: '1.21' }
- - uses: actions/download-artifact@v3
- with: { name: ui, path: ui/dist }
- - name: Version
- if: github.ref_type == 'tag' && github.ref_name != ''
- run: |
- echo ${{ github.ref_name }}
- echo ${{ github.ref_name }} > VERSION
- - run: go build -o catalyst ./cmd/catalyst/.
- - uses: docker/login-action@v3
- with:
- registry: ${{ env.REGISTRY }}
- username: ${{ github.actor }}
- password: ${{ secrets.GITHUB_TOKEN }}
- - name: Extract metadata (tags, labels) for Docker
- id: meta
- uses: docker/metadata-action@v5
- with:
- images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- - uses: docker/build-push-action@v5
- with:
- context: .
- push: true
- tags: ${{ steps.meta.outputs.tags }}
- labels: ${{ steps.meta.outputs.labels }}
+ - run: make test
diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml
new file mode 100644
index 0000000..a19fe37
--- /dev/null
+++ b/.github/workflows/goreleaser.yml
@@ -0,0 +1,32 @@
+name: goreleaser
+
+on:
+ pull_request:
+ push:
+ tags:
+ - "*"
+
+permissions:
+ contents: write
+
+jobs:
+ goreleaser:
+ runs-on: ubuntu-latest
+ steps:
+ -
+ name: Checkout
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ -
+ name: Set up Go
+ uses: actions/setup-go@v5
+ -
+ name: Run GoReleaser
+ uses: goreleaser/goreleaser-action@v6
+ with:
+ distribution: goreleaser
+ version: '~> v2'
+ args: release --clean
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index d7f9689..35ed655 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,87 +1,36 @@
-.idea
-.antlr
-
-.DS_Store
-uploads
-gen
-
-*.bleve
-
-# Byte-compiled / optimized / DLL files
-__pycache__/
-*.py[cod]
-*$py.class
-
-# C extensions
-*.so
-
-# Distribution / packaging
-.Python
-env/
-build/
-develop-eggs/
-dist/
-downloads/
-eggs/
-.eggs/
-lib/
-lib64/
-parts/
-sdist/
-var/
-*.egg-info/
-.installed.cfg
-*.egg
-
-# PyInstaller
-# Usually these files are written by a python script from a template
-# before PyInstaller builds the exe, so as to inject date/other infos into it.
-*.manifest
-*.spec
-
-# Installer logs
-pip-log.txt
-pip-delete-this-directory.txt
-
-# Unit test / coverage reports
-htmlcov/
-.tox/
-.coverage
-.coverage.*
-.cache
-nosetests.xml
-coverage.xml
-*,cover
-.hypothesis/
-venv/
-.venv/
-.python-version
-.pytest_cache
-
-# Translations
-*.mo
-*.pot
-
-# Django stuff:
+# Logs
+logs
*.log
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+pnpm-debug.log*
+lerna-debug.log*
-# Sphinx documentation
-docs/_build/
-
-# PyBuilder
-target/
-
-#Ipython Notebook
-.ipynb_checkpoints
-
-# npm
-wwwroot/*.js
-typings
-dist
node_modules
+.DS_Store
+dist-ssr
+coverage
+*.local
-profile.cov
-cover.out
+/cypress/videos/
+/cypress/screenshots/
-generated/caql/parser/*.interp
-generated/caql/parser/*.tokens
+# Editor directories and files
+.vscode/*
+!.vscode/extensions.json
+.idea
+*.suo
+*.ntvs*
+*.njsproj
+*.sln
+*.sw?
+
+*.tsbuildinfo
+
+bin
+dist
+
+pb_data
+catalyst
+catalyst_data
diff --git a/.golangci.yml b/.golangci.yml
index 7476894..4349820 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -1,67 +1,9 @@
run:
- go: "1.19"
+ go: "1.22"
timeout: 5m
- skip-dirs:
- - generated
- - internal
linters:
- enable:
- - asciicheck
- - containedctx
- - decorder
- - dogsled
- - durationcheck
- - errchkjson
- - errname
- - errorlint
- - exhaustive
- - exportloopref
- - forbidigo
- - forcetypeassert
- - gci
- - gocritic
- - godot
- - gofmt
- - gofumpt
- - goheader
- - goimports
- - gomodguard
- - goprintffuncname
- - gosec
- - grouper
- - importas
- - ireturn
- - misspell
- - nakedret
- - nilnil
- - nlreturn
- - nolintlint
- - paralleltest
- - predeclared
- - promlinter
- - revive
- - tenv
- - thelper
- - unconvert
- - whitespace
-
+ enable-all: true
disable:
- # go 1.18
- - bodyclose
- - contextcheck
- - gosimple
- - ifshort
- - nilerr
- - noctx
- - rowserrcheck
- - sqlclosecheck
- - staticcheck
- - stylecheck
- - tparallel
- - unparam
- - unused
- - wastedassign
-
# complexity
- cyclop
- gocognit
@@ -72,19 +14,22 @@ linters:
# disable
- depguard
- dupl
- - exhaustivestruct
+ - err113
+ - execinquery
+ - exhaustruct
- funlen
- gochecknoglobals
- gochecknoinits
- goconst
- godox
- - goerr113
- gomnd
- gomoddirectives
+ - ireturn
- lll
- makezero
+ - mnd
- prealloc
- - structcheck
+ - tagalign
- tagliatelle
- testpackage
- varnamelen
@@ -96,28 +41,3 @@ linters-settings:
- standard
- default
- prefix(github.com/SecurityBrewery/catalyst)
- ireturn:
- allow:
- - error
- - context.Context
- - go-driver.Cursor
- - go-driver.Collection
- - go-driver.Database
- - go-driver.Client
- - chi.Router
-issues:
- exclude-rules:
- - path: caql
- text: "var-naming: don't use underscores"
- - path: database/user.go
- text: "G404"
- linters: [ gosec ]
- - path: caql/function.go
- text: "G404"
- linters: [ gosec ]
- - path: caql
- linters: [ forcetypeassert ]
- - text: github.com/go-chi/chi/v5.Router
- linters: [ ireturn ]
- - path: ui/ui.go
- linters: [ typecheck ]
diff --git a/.goreleaser.yaml b/.goreleaser.yaml
new file mode 100644
index 0000000..b1f881f
--- /dev/null
+++ b/.goreleaser.yaml
@@ -0,0 +1,30 @@
+version: 2
+
+before:
+ hooks:
+ - go mod tidy
+
+builds:
+ - env:
+ - CGO_ENABLED=0
+ goos:
+ - linux
+ - darwin
+
+archives:
+ - format: tar.gz
+ # this name template makes the OS and Arch compatible with the results of `uname`.
+ name_template: >-
+ {{ .ProjectName }}_
+ {{- title .Os }}_
+ {{- if eq .Arch "amd64" }}x86_64
+ {{- else if eq .Arch "386" }}i386
+ {{- else }}{{ .Arch }}{{ end }}
+ {{- if .Arm }}v{{ .Arm }}{{ end }}
+ # use zip for windows archives
+ format_overrides:
+ - goos: windows
+ format: zip
+
+changelog:
+ sort: asc
diff --git a/CODEOWNERS b/CODEOWNERS
deleted file mode 100644
index 5a1a35f..0000000
--- a/CODEOWNERS
+++ /dev/null
@@ -1 +0,0 @@
-* @cugu
diff --git a/Dockerfile b/Dockerfile
deleted file mode 100644
index 382ba7a..0000000
--- a/Dockerfile
+++ /dev/null
@@ -1,12 +0,0 @@
-FROM ubuntu:23.04
-
-RUN apt-get update -y && apt-get -y install curl gnupg2 software-properties-common
-RUN curl -OL https://download.arangodb.com/arangodb34/DEBIAN/Release.key
-RUN apt-key add Release.key
-RUN apt-add-repository 'deb https://download.arangodb.com/arangodb34/DEBIAN/ /'
-RUN apt-get update -y && apt-get -y install arangodb3
-
-COPY catalyst /app/catalyst
-CMD /app/catalyst
-
-EXPOSE 8000
diff --git a/Makefile b/Makefile
index e775977..6af92e8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,47 @@
-.PHONY: lint
-lint:
- golangci-lint run ./...
+.PHONY: install
+install:
+ @echo "Installing..."
+ go install github.com/bombsimon/wsl/v4/cmd...@master
+ go install mvdan.cc/gofumpt@latest
+ go install github.com/daixiang0/gci@latest
.PHONY: fmt
fmt:
+ @echo "Formatting..."
+ go mod tidy
+ go fmt ./...
gci write -s standard -s default -s "prefix(github.com/SecurityBrewery/catalyst)" .
- # gofumpt -l -w .
- # wsl --fix ./...
\ No newline at end of file
+ gofumpt -l -w .
+ wsl -fix ./... || true
+ cd ui && bun format
+
+.PHONY: lint
+lint:
+ golangci-lint version
+ golangci-lint run ./...
+
+.PHONY: test
+test:
+ @echo "Testing..."
+ go test -v ./...
+ cd ui && bun test
+
+.PHONY: build-ui
+build-ui:
+ @echo "Building..."
+ cd ui && bun install
+ cd ui && bun build-only
+
+.PHONY: dev
+dev:
+ @echo "Running..."
+ rm -rf catalyst_data
+ go run . bootstrap
+ go run . admin create admin@catalyst-soar.com 1234567890
+ go run . set-feature-flags dev
+ go run . fake-data
+ go run . serve
+
+.PHONY: dev-ui
+serve-ui:
+ cd ui && bun dev --port 3000
diff --git a/NOTICE b/NOTICE
deleted file mode 100644
index 3172bf2..0000000
--- a/NOTICE
+++ /dev/null
@@ -1,16 +0,0 @@
-The following components are included in this product:
-
-Badgerodon Collections
-https://github.com/badgerodon/collections
-Copyright (c) 2012 Caleb Doxsey
-Licensed under the MIT License
-
-go-toposort
-https://github.com/philopon/go-toposort
-Copyright (c) 2017 Hirotomo Moriwaki
-Licensed under the MIT License
-
-The Go programming language
-https://go.dev/
-Copyright (c) 2009 The Go Authors
-See https://go.dev/LICENSE for license details.
diff --git a/README.md b/README.md
index 3b3c3b4..e5720c4 100644
--- a/README.md
+++ b/README.md
@@ -1,97 +1,84 @@
-
+
+
+
+
Catalyst
Speed up your reactions
-Catalyst is an incident response platform or SOAR (Security Orchestration, Automation and Response) system. It can help
-you to automate your alert handling and incident response procedures.
+Catalyst is an incident response platform.
+It can help to automate your alert handling and incident response procedures.
## Features
### Ticket (Alert & Incident) Management
-
-
-Tickets are the core of Catalyst. They represent alerts, incidents, forensics
-investigations, threat hunts or any other event you want to handle in your
-organisation.
-
-### Ticket Templates
+Tickets are the core of Catalyst.
+They represent alerts, incidents, forensics investigations,
+threat hunts or any other event you want to handle in your organisation.
-
+
+
+
-Templates define the custom information for tickets. The core information for
-tickets like title, creation date or closing status is kept quite minimal and other
-information like criticality, description or MITRE ATT&CK information can be
-added individually.
+### Ticket Types
-### Conditional Custom Fields
+Templates define the custom information for tickets.
+The core information for tickets like title, creation date or closing status is kept quite minimal
+and other information like criticality, description or MITRE ATT&CK information can be added individually.
+
+### Timelines
+
+Timelines are used to document the progress of an investigation.
+They can be used to document the steps taken during an investigation, the findings or the results of the investigation.
+
+### Tasks
+
+Tasks are the smallest unit of work in Catalyst. They can be assigned to users and have a status.
+Tasks can be used to document the progress of an investigation or to assign work to different users.
-
-
+
+
+
-Custom Fields can be dependent on each other. So if you, for example choose
-"malware" as an incident type a custom field ask you to define it further as
-ransomware, worm, etc. which a "phishing" incident would ask for the number
-of received mails in that campaign.
+### Custom Fields
-### Playbooks
-
-
-
-
-
-Playbooks represent processes that can be attached to tickets. Playbooks can
-contain manual and automated tasks. Complex workflows with different workflow
-branches, parallel tasks and task dependencies can be modeled.
-
-### Automations
-
-
-
-
-
-Automations are scripts that automate tasks or enrich artifacts. Automations are
-run in their own Docker containers. This enables them to be created in different
-scripting languages and run securely in their own environment.
+Custom fields can be added to tickets to store additional information.
+They can be used to store information like the affected system, the attacker's IP address or the type of malware.
+Custom fields can be added to ticket types and are then available for all tickets of this type.
### Dashboards
+Catalyst comes with a dashboard that presents the most important information at a glance.
+
-
+
+
+
-Catalyst comes with a dashboard editor that allows you to create custom dashboards
-for your organisation. Dashboards can be created with line, bar, and pie charts.
+### Webhooks
+
+Catalyst can send webhooks to other systems.
+This can be used to trigger actions in other systems and create automated workflows.
### Users
-Catalyst has two different types of users, normal users accessing the platform
-via OIDC authentication and API keys for external script. A
-fine-grained access model is available for both types and allows to define
-possible actions for each user.
+Catalyst supports authentication via username and password
+or via OAuth2 with an external identity provider like Google, GitHub or GitLab.
-## License
+### More
-Copyright (c) 2021-present Jonas Plum
-
-Portions of this software are licensed as follows:
-
-* All third party components incorporated into Catalyst are licensed under the
- original license provided by the owner of the applicable component. Those
- files contain a license notice on top of the file and are listed in the
- [NOTICE](NOTICE) file.
-* Content outside the above-mentioned files above is
- available under the [GNU Affero General Public License v3.0](LICENSE).
+Catalyst supports a lot more features like: Links, Files, or Comments on tickets.
\ No newline at end of file
diff --git a/VERSION b/VERSION
deleted file mode 100644
index cb676de..0000000
--- a/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-0.0.0-dev
diff --git a/auth.go b/auth.go
deleted file mode 100644
index 0b3b8f8..0000000
--- a/auth.go
+++ /dev/null
@@ -1,108 +0,0 @@
-package catalyst
-
-import (
- "context"
- "crypto/sha256"
- "errors"
- "fmt"
-
- maut "github.com/jonas-plum/maut/auth"
-
- "github.com/SecurityBrewery/catalyst/database"
- "github.com/SecurityBrewery/catalyst/generated/model"
-)
-
-type catalystResolver struct {
- database *database.Database
-}
-
-func newCatalystResolver(db *database.Database) *catalystResolver {
- return &catalystResolver{
- database: db,
- }
-}
-
-func (c *catalystResolver) UserCreateIfNotExists(ctx context.Context, user *maut.User, password string) (err error) {
- if user != nil {
- if _, err := c.database.UserGet(ctx, user.ID); err == nil {
- return nil
- }
- }
-
- if user == nil || user.APIKey {
- // ignore error, because we don't care if the user already exists
- _, _ = c.database.UserCreateSetupAPIKey(ctx, password)
- } else {
- _, err = c.database.UserCreate(ctx, &model.UserForm{
- Apikey: user.APIKey,
- Blocked: user.Blocked,
- ID: user.ID,
- Roles: user.Roles,
- })
- if err != nil {
- return err
- }
-
- err = c.database.UserDataCreate(ctx, user.ID, &model.UserData{
- Email: user.Email,
- Image: nil,
- Name: user.Name,
- Timeformat: nil,
- })
- }
-
- return err
-}
-
-func (c *catalystResolver) User(ctx context.Context, userID string) (*maut.User, error) {
- user, err := c.database.UserGet(ctx, userID)
- if err != nil {
- return nil, err
- }
-
- return mapMautUser(user), nil
-}
-
-func (c *catalystResolver) UserAPIKeyByHash(ctx context.Context, key string) (*maut.User, error) {
- sha256Hash := fmt.Sprintf("%x", sha256.Sum256([]byte(key)))
- user, err := c.database.UserAPIKeyByHash(ctx, sha256Hash)
- if err != nil {
- return nil, err
- }
-
- return mapMautUser(user), nil
-}
-
-func (c *catalystResolver) UserByIDAndPassword(ctx context.Context, username string, password string) (*maut.User, error) {
- user, err := c.database.UserByIDAndPassword(ctx, username, password)
- if err != nil {
- return nil, err
- }
-
- return mapMautUser(user), nil
-}
-
-func (c *catalystResolver) Role(_ context.Context, roleID string) (r *maut.Role, err error) {
- switch roleID {
- case "admin":
- return Admin, nil
- case "engineer":
- return engineer, nil
- case "analyst":
- return analyst, nil
- }
-
- return nil, errors.New("role not found")
-}
-
-func mapMautUser(user *model.UserResponse) *maut.User {
- return &maut.User{
- ID: user.ID,
- APIKey: user.Apikey,
- Blocked: user.Blocked,
- // Email: user.Email, // TODO
- // Groups: user.Groups, // TODO
- // Name: user.Name, // TODO
- Roles: user.Roles,
- }
-}
diff --git a/bootstrapcmd.go b/bootstrapcmd.go
new file mode 100644
index 0000000..dd1b237
--- /dev/null
+++ b/bootstrapcmd.go
@@ -0,0 +1,50 @@
+package main
+
+import (
+ "log"
+
+ "github.com/pocketbase/dbx"
+ "github.com/pocketbase/pocketbase"
+ "github.com/pocketbase/pocketbase/migrations"
+ "github.com/pocketbase/pocketbase/migrations/logs"
+ "github.com/pocketbase/pocketbase/tools/migrate"
+ "github.com/spf13/cobra"
+)
+
+func bootstrapCmd(app *pocketbase.PocketBase) *cobra.Command {
+ return &cobra.Command{
+ Use: "bootstrap",
+ Run: func(_ *cobra.Command, _ []string) {
+ if err := app.Bootstrap(); err != nil {
+ log.Fatal(err)
+ }
+
+ if err := migrateDBs(app); err != nil {
+ log.Fatal(err)
+ }
+ },
+ }
+}
+
+type migration struct {
+ db *dbx.DB
+ migrations migrate.MigrationsList
+}
+
+func migrateDBs(app *pocketbase.PocketBase) error {
+ for _, m := range []migration{
+ {db: app.DB(), migrations: migrations.AppMigrations},
+ {db: app.LogsDB(), migrations: logs.LogsMigrations},
+ } {
+ runner, err := migrate.NewRunner(m.db, m.migrations)
+ if err != nil {
+ return err
+ }
+
+ if _, err := runner.Up(); err != nil {
+ return err
+ }
+ }
+
+ return nil
+}
diff --git a/bus/bus.go b/bus/bus.go
deleted file mode 100644
index ff707be..0000000
--- a/bus/bus.go
+++ /dev/null
@@ -1,69 +0,0 @@
-package bus
-
-import (
- "github.com/arangodb/go-driver"
-
- "github.com/SecurityBrewery/catalyst/generated/model"
-)
-
-type ResultMsg struct {
- Automation string `json:"automation"`
- Data map[string]any `json:"data,omitempty"`
- Target *model.Origin `json:"target"`
-}
-
-type RequestMsg struct {
- IDs []driver.DocumentID `json:"ids"`
- Function string `json:"function"`
- User string `json:"user"`
-}
-
-type JobMsg struct {
- ID string `json:"id"`
- Automation string `json:"automation"`
- Origin *model.Origin `json:"origin"`
- Message *model.Message `json:"message"`
-}
-
-type DatabaseUpdateType string
-
-const (
- DatabaseEntryRead DatabaseUpdateType = "read"
- DatabaseEntryCreated DatabaseUpdateType = "created"
- DatabaseEntryUpdated DatabaseUpdateType = "updated"
-)
-
-type DatabaseUpdateMsg struct {
- IDs []driver.DocumentID `json:"ids"`
- Type DatabaseUpdateType `json:"type"`
-}
-
-type Bus struct {
- ResultChannel *Channel[*ResultMsg]
- RequestChannel *Channel[*RequestMsg]
- JobChannel *Channel[*JobMsg]
- DatabaseChannel *Channel[*DatabaseUpdateMsg]
-}
-
-func New() *Bus {
- return &Bus{
- ResultChannel: &Channel[*ResultMsg]{},
- RequestChannel: &Channel[*RequestMsg]{},
- JobChannel: &Channel[*JobMsg]{},
- DatabaseChannel: &Channel[*DatabaseUpdateMsg]{},
- }
-}
-
-type Channel[T any] struct {
- Subscriber []func(T)
-}
-
-func (c *Channel[T]) Publish(msg T) {
- for _, s := range c.Subscriber {
- go s(msg)
- }
-}
-
-func (c *Channel[T]) Subscribe(handler func(T)) {
- c.Subscriber = append(c.Subscriber, handler)
-}
diff --git a/busservice/busservice.go b/busservice/busservice.go
deleted file mode 100644
index da951f9..0000000
--- a/busservice/busservice.go
+++ /dev/null
@@ -1,53 +0,0 @@
-package busservice
-
-import (
- "context"
- "log"
-
- maut "github.com/jonas-plum/maut/auth"
-
- "github.com/SecurityBrewery/catalyst/bus"
- "github.com/SecurityBrewery/catalyst/database"
- "github.com/SecurityBrewery/catalyst/generated/model"
- "github.com/SecurityBrewery/catalyst/generated/time"
-)
-
-type busService struct {
- db *database.Database
- apiURL string
- apiKey string
- catalystBus *bus.Bus
- network string
-}
-
-func New(apiURL, apikey, network string, catalystBus *bus.Bus, db *database.Database) {
- h := &busService{db: db, apiURL: apiURL, apiKey: apikey, network: network, catalystBus: catalystBus}
-
- catalystBus.RequestChannel.Subscribe(h.logRequest)
- catalystBus.ResultChannel.Subscribe(h.handleResult)
- catalystBus.JobChannel.Subscribe(h.handleJob)
-}
-
-func busContext() context.Context {
- // TODO: change roles?
- bot := &maut.User{ID: "bot", Roles: []string{maut.AdminRole}}
-
- return maut.UserContext(context.Background(), bot, nil) // TODO add permissions ?
-}
-
-func (h *busService) logRequest(msg *bus.RequestMsg) {
- var logEntries []*model.LogEntry
- for _, i := range msg.IDs {
- logEntries = append(logEntries, &model.LogEntry{
- Type: "request",
- Reference: i.String(),
- Creator: msg.User,
- Message: msg.Function,
- Created: time.Now().UTC(),
- })
- }
-
- if err := h.db.LogBatchCreate(busContext(), logEntries); err != nil {
- log.Println(err)
- }
-}
diff --git a/busservice/docker.go b/busservice/docker.go
deleted file mode 100644
index f7c4ec0..0000000
--- a/busservice/docker.go
+++ /dev/null
@@ -1,203 +0,0 @@
-package busservice
-
-import (
- "archive/tar"
- "bufio"
- "bytes"
- "context"
- "fmt"
- "io"
- "log"
-
- "github.com/docker/docker/api/types"
- "github.com/docker/docker/api/types/container"
- "github.com/docker/docker/client"
- "github.com/docker/docker/pkg/stdcopy"
-
- "github.com/SecurityBrewery/catalyst/database"
-)
-
-func createContainer(ctx context.Context, image, script, data, network string) (string, string, error) {
- cli, err := client.NewClientWithOpts(client.FromEnv)
- if err != nil {
- return "", "", err
- }
-
- logs, err := pullImage(ctx, cli, image)
- if err != nil {
- return "", logs, err
- }
-
- config := &container.Config{
- Image: image,
- Cmd: []string{"/script", data},
- WorkingDir: "/home",
- AttachStderr: true,
- AttachStdout: true,
- }
- hostConfig := &container.HostConfig{
- NetworkMode: container.NetworkMode(network),
- }
- resp, err := cli.ContainerCreate(ctx, config, hostConfig, nil, "")
- if err != nil {
- return "", logs, err
- }
-
- if err := copyFile(ctx, cli, "/script", script, resp.ID); err != nil {
- return "", logs, err
- }
-
- return resp.ID, logs, nil
-}
-
-func pullImage(ctx context.Context, cli *client.Client, image string) (string, error) {
- reader, err := cli.ImagePull(ctx, image, types.ImagePullOptions{})
- if err != nil {
- return "", err
- }
- defer reader.Close()
-
- buf := &bytes.Buffer{}
- _, err = io.Copy(buf, reader)
-
- return buf.String(), err
-}
-
-func copyFile(ctx context.Context, cli *client.Client, path string, contentString string, id string) error {
- tarBuf := &bytes.Buffer{}
- tw := tar.NewWriter(tarBuf)
- header := &tar.Header{Name: path, Mode: 0o755, Size: int64(len(contentString))}
- if err := tw.WriteHeader(header); err != nil {
- return err
- }
-
- if _, err := tw.Write([]byte(contentString)); err != nil {
- return err
- }
-
- if err := tw.Close(); err != nil {
- return err
- }
-
- return cli.CopyToContainer(ctx, id, "/", tarBuf, types.CopyToContainerOptions{})
-}
-
-func runDocker(ctx context.Context, jobID, containerID string, db *database.Database) (stdout []byte, stderr []byte, err error) {
- cli, err := client.NewClientWithOpts(client.FromEnv)
- if err != nil {
- return nil, nil, err
- }
-
- defer func(cli *client.Client, ctx context.Context, containerID string, options types.ContainerRemoveOptions) {
- err := cli.ContainerRemove(ctx, containerID, options)
- if err != nil {
- log.Println(err)
- }
- }(cli, ctx, containerID, types.ContainerRemoveOptions{Force: true})
-
- if err := cli.ContainerStart(ctx, containerID, types.ContainerStartOptions{}); err != nil {
- return nil, nil, err
- }
-
- stderrBuf, err := streamStdErr(ctx, cli, jobID, containerID, db)
- if err != nil {
- return nil, nil, err
- }
-
- if err := waitForContainer(ctx, cli, containerID, stderrBuf); err != nil {
- return nil, nil, err
- }
-
- output, err := getStdOut(ctx, cli, containerID)
- if err != nil {
- log.Println(err)
- }
-
- return output.Bytes(), stderrBuf.Bytes(), nil
-}
-
-func streamStdErr(ctx context.Context, cli *client.Client, jobID, containerID string, db *database.Database) (*bytes.Buffer, error) {
- stderrBuf := &bytes.Buffer{}
- containerLogs, err := cli.ContainerLogs(ctx, containerID, types.ContainerLogsOptions{ShowStderr: true, Follow: true})
- if err != nil {
- return nil, err
- }
- go func() {
- err := scanLines(ctx, jobID, containerLogs, stderrBuf, db)
- if err != nil {
- log.Println(err)
-
- return
- }
- if err := containerLogs.Close(); err != nil {
- log.Println(err)
-
- return
- }
- }()
-
- return stderrBuf, nil
-}
-
-func scanLines(ctx context.Context, jobID string, input io.ReadCloser, output io.Writer, db *database.Database) error {
- r, w := io.Pipe()
- go func() {
- _, err := stdcopy.StdCopy(w, w, input)
- if err != nil {
- log.Println(err)
-
- return
- }
- if err := w.Close(); err != nil {
- log.Println(err)
-
- return
- }
- }()
- s := bufio.NewScanner(r)
- for s.Scan() {
- b := s.Bytes()
- _, _ = output.Write(b)
- _, _ = output.Write([]byte("\n"))
-
- if err := db.JobLogAppend(ctx, jobID, string(b)+"\n"); err != nil {
- log.Println(err)
-
- continue
- }
- }
-
- return s.Err()
-}
-
-func waitForContainer(ctx context.Context, cli *client.Client, containerID string, stderrBuf *bytes.Buffer) error {
- statusCh, errCh := cli.ContainerWait(ctx, containerID, container.WaitConditionNotRunning)
- select {
- case err := <-errCh:
- if err != nil {
- return err
- }
- case exitStatus := <-statusCh:
- if exitStatus.StatusCode != 0 {
- return fmt.Errorf("container returned status code %d: stderr: %s", exitStatus.StatusCode, stderrBuf.String())
- }
- }
-
- return nil
-}
-
-func getStdOut(ctx context.Context, cli *client.Client, containerID string) (*bytes.Buffer, error) {
- output := &bytes.Buffer{}
- containerLogs, err := cli.ContainerLogs(ctx, containerID, types.ContainerLogsOptions{ShowStdout: true, Follow: true})
- if err != nil {
- return nil, err
- }
- defer containerLogs.Close()
-
- _, err = stdcopy.StdCopy(output, output, containerLogs)
- if err != nil {
- return nil, err
- }
-
- return output, nil
-}
diff --git a/busservice/job.go b/busservice/job.go
deleted file mode 100644
index b7661d5..0000000
--- a/busservice/job.go
+++ /dev/null
@@ -1,120 +0,0 @@
-package busservice
-
-import (
- "encoding/json"
- "fmt"
- "log"
-
- "github.com/SecurityBrewery/catalyst/bus"
- "github.com/SecurityBrewery/catalyst/generated/model"
-)
-
-func (h *busService) handleJob(automationMsg *bus.JobMsg) {
- ctx := busContext()
-
- job, err := h.db.JobCreate(ctx, automationMsg.ID, &model.JobForm{
- Automation: automationMsg.Automation,
- Payload: automationMsg.Message.Payload,
- Origin: automationMsg.Origin,
- })
- if err != nil {
- log.Println(err)
-
- return
- }
-
- automation, err := h.db.AutomationGet(ctx, automationMsg.Automation)
- if err != nil {
- log.Println(err)
-
- return
- }
-
- if automation.Script == "" {
- log.Println("automation is empty")
-
- return
- }
-
- if automationMsg.Message.Secrets == nil {
- automationMsg.Message.Secrets = map[string]string{}
- }
- automationMsg.Message.Secrets["catalyst_apikey"] = h.apiKey
- automationMsg.Message.Secrets["catalyst_apiurl"] = h.apiURL
-
- scriptMessage, err := json.Marshal(automationMsg.Message)
- if err != nil {
- log.Println(err)
-
- return
- }
-
- containerID, logs, err := createContainer(ctx, automation.Image, automation.Script, string(scriptMessage), h.network)
- if err != nil {
- log.Println(err)
-
- return
- }
-
- if _, err := h.db.JobUpdate(ctx, automationMsg.ID, &model.JobUpdate{
- Container: &containerID,
- Running: true,
- Output: job.Output,
- Log: &logs,
- Status: job.Status,
- }); err != nil {
- log.Println(err)
-
- return
- }
-
- var result map[string]any
-
- stdout, _, err := runDocker(ctx, automationMsg.ID, containerID, h.db)
- if err != nil {
- result = map[string]any{"error": fmt.Sprintf("error running script %s %s", err, string(stdout))}
- } else {
- var data map[string]any
- if err := json.Unmarshal(stdout, &data); err != nil {
- result = map[string]any{"error": string(stdout)}
- } else {
- result = data
- }
- }
-
- h.catalystBus.ResultChannel.Publish(&bus.ResultMsg{Automation: automationMsg.Automation, Data: result, Target: automationMsg.Origin})
-
- if err := h.db.JobComplete(ctx, automationMsg.ID, result); err != nil {
- log.Println(err)
-
- return
- }
-}
-
-/*
-func getAutomation(automationID string, config *Config) (*model.AutomationResponse, error) {
- req, err := http.NewRequest(http.MethodGet, config.CatalystAPIUrl+"/automations/"+automationID, nil)
- if err != nil {
- return nil, err
- }
-
- req.Header.Set("PRIVATE-TOKEN", config.CatalystAPIKey)
-
- resp, err := http.DefaultClient.Do(req)
- if err != nil {
- return nil, err
- }
- defer resp.Body.Close()
-
- b, err := io.ReadAll(resp.Body)
- if err != nil {
- return nil, err
- }
-
- var automation model.AutomationResponse
- if err := json.Unmarshal(b, &automation); err != nil {
- return nil, err
- }
- return &automation, nil
-}
-*/
diff --git a/busservice/result.go b/busservice/result.go
deleted file mode 100644
index c1357fe..0000000
--- a/busservice/result.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package busservice
-
-import (
- "log"
-
- "github.com/SecurityBrewery/catalyst/bus"
- "github.com/SecurityBrewery/catalyst/generated/model"
-)
-
-func (h *busService) handleResult(resultMsg *bus.ResultMsg) {
- if resultMsg.Target != nil {
- ctx := busContext()
- switch {
- case resultMsg.Target.TaskOrigin != nil:
- if _, err := h.db.TaskComplete(
- ctx,
- resultMsg.Target.TaskOrigin.TicketId,
- resultMsg.Target.TaskOrigin.PlaybookId,
- resultMsg.Target.TaskOrigin.TaskId,
- resultMsg.Data,
- ); err != nil {
- log.Println(err)
- }
- case resultMsg.Target.ArtifactOrigin != nil:
- enrichment := &model.EnrichmentForm{
- Data: resultMsg.Data,
- Name: resultMsg.Automation,
- }
- _, err := h.db.EnrichArtifact(ctx, resultMsg.Target.ArtifactOrigin.TicketId, resultMsg.Target.ArtifactOrigin.Artifact, enrichment)
- if err != nil {
- log.Println(err)
- }
- }
- }
-}
diff --git a/caql/blevebuilder.go b/caql/blevebuilder.go
deleted file mode 100644
index 547bed6..0000000
--- a/caql/blevebuilder.go
+++ /dev/null
@@ -1,155 +0,0 @@
-package caql
-
-import (
- "errors"
- "fmt"
- "strconv"
-
- "github.com/SecurityBrewery/catalyst/generated/caql/parser"
-)
-
-var ErrTooComplex = errors.New("unsupported features for index queries, use advanced search instead")
-
-type bleveBuilder struct {
- *parser.BaseCAQLParserListener
- stack []string
- err error
-}
-
-// push is a helper function for pushing new node to the listener Stack.
-func (s *bleveBuilder) push(i string) {
- s.stack = append(s.stack, i)
-}
-
-// pop is a helper function for poping a node from the listener Stack.
-func (s *bleveBuilder) pop() (n string) {
- // Check that we have nodes in the stack.
- size := len(s.stack)
- if size < 1 {
- panic(ErrStack)
- }
-
- // Pop the last value from the Stack.
- n, s.stack = s.stack[size-1], s.stack[:size-1]
-
- return
-}
-
-func (s *bleveBuilder) binaryPop() (any, any) {
- right, left := s.pop(), s.pop()
-
- return left, right
-}
-
-// ExitExpression is called when production expression is exited.
-func (s *bleveBuilder) ExitExpression(ctx *parser.ExpressionContext) {
- switch {
- case ctx.Value_literal() != nil:
- // pass
- case ctx.Reference() != nil:
- // pass
- case ctx.Operator_unary() != nil:
- s.err = ErrTooComplex
- case ctx.T_PLUS() != nil:
- fallthrough
- case ctx.T_MINUS() != nil:
- fallthrough
- case ctx.T_TIMES() != nil:
- fallthrough
- case ctx.T_DIV() != nil:
- fallthrough
- case ctx.T_MOD() != nil:
- s.err = ErrTooComplex
- case ctx.T_RANGE() != nil:
- s.err = ErrTooComplex
- case ctx.T_LT() != nil && ctx.GetEq_op() == nil:
- left, right := s.binaryPop()
- s.push(fmt.Sprintf("%s:<%s", left, right))
- case ctx.T_GT() != nil && ctx.GetEq_op() == nil:
- left, right := s.binaryPop()
- s.push(fmt.Sprintf("%s:>%s", left, right))
- case ctx.T_LE() != nil && ctx.GetEq_op() == nil:
- left, right := s.binaryPop()
- s.push(fmt.Sprintf("%s:<=%s", left, right))
- case ctx.T_GE() != nil && ctx.GetEq_op() == nil:
- left, right := s.binaryPop()
- s.push(fmt.Sprintf("%s:>=%s", left, right))
- case ctx.T_IN() != nil && ctx.GetEq_op() == nil:
- s.err = ErrTooComplex
- case ctx.T_EQ() != nil && ctx.GetEq_op() == nil:
- left, right := s.binaryPop()
- s.push(fmt.Sprintf("%s:%s", left, right))
- case ctx.T_NE() != nil && ctx.GetEq_op() == nil:
- left, right := s.binaryPop()
- s.push(fmt.Sprintf("-%s:%s", left, right))
- case ctx.T_ALL() != nil && ctx.GetEq_op() != nil:
- fallthrough
- case ctx.T_ANY() != nil && ctx.GetEq_op() != nil:
- fallthrough
- case ctx.T_NONE() != nil && ctx.GetEq_op() != nil:
- s.err = ErrTooComplex
- case ctx.T_ALL() != nil && ctx.T_NOT() != nil && ctx.T_IN() != nil:
- fallthrough
- case ctx.T_ANY() != nil && ctx.T_NOT() != nil && ctx.T_IN() != nil:
- fallthrough
- case ctx.T_NONE() != nil && ctx.T_NOT() != nil && ctx.T_IN() != nil:
- s.err = ErrTooComplex
- case ctx.T_LIKE() != nil:
- s.err = errors.New("index queries are like queries by default")
- case ctx.T_REGEX_MATCH() != nil:
- left, right := s.binaryPop()
- if ctx.T_NOT() != nil {
- s.err = ErrTooComplex
- } else {
- s.push(fmt.Sprintf("%s:/%s/", left, right))
- }
- case ctx.T_REGEX_NON_MATCH() != nil:
- s.err = errors.New("index query cannot contain regex non matches, use advanced search instead")
- case ctx.T_AND() != nil:
- left, right := s.binaryPop()
- s.push(fmt.Sprintf("%s %s", left, right))
- case ctx.T_OR() != nil:
- s.err = errors.New("index query cannot contain OR, use advanced search instead")
- case ctx.T_QUESTION() != nil && len(ctx.AllExpression()) == 3:
- s.err = errors.New("index query cannot contain ternary operations, use advanced search instead")
- case ctx.T_QUESTION() != nil && len(ctx.AllExpression()) == 2:
- s.err = errors.New("index query cannot contain ternary operations, use advanced search instead")
- default:
- panic("unknown expression")
- }
-}
-
-// ExitReference is called when production reference is exited.
-func (s *bleveBuilder) ExitReference(ctx *parser.ReferenceContext) {
- switch {
- case ctx.DOT() != nil:
- reference := s.pop()
-
- s.push(fmt.Sprintf("%s.%s", reference, ctx.T_STRING().GetText()))
- case ctx.T_STRING() != nil:
- s.push(ctx.T_STRING().GetText())
- case ctx.Compound_value() != nil:
- s.err = ErrTooComplex
- case ctx.Function_call() != nil:
- s.err = ErrTooComplex
- case ctx.T_OPEN() != nil:
- s.err = ErrTooComplex
- case ctx.T_ARRAY_OPEN() != nil:
- s.err = ErrTooComplex
- default:
- panic(fmt.Sprintf("unexpected value: %s", ctx.GetText()))
- }
-}
-
-// ExitValue_literal is called when production value_literal is exited.
-func (s *bleveBuilder) ExitValue_literal(ctx *parser.Value_literalContext) {
- if ctx.T_QUOTED_STRING() != nil {
- st, err := unquote(ctx.GetText())
- if err != nil {
- panic(err)
- }
- s.push(strconv.Quote(st))
- } else {
- s.push(ctx.GetText())
- }
-}
diff --git a/caql/blevebuilder_test.go b/caql/blevebuilder_test.go
deleted file mode 100644
index b0ca760..0000000
--- a/caql/blevebuilder_test.go
+++ /dev/null
@@ -1,60 +0,0 @@
-package caql_test
-
-import (
- "testing"
-
- "github.com/SecurityBrewery/catalyst/caql"
-)
-
-func TestBleveBuilder(t *testing.T) {
- t.Parallel()
-
- tests := []struct {
- name string
- saql string
- wantBleve string
- wantParseErr bool
- wantRebuildErr bool
- }{
- {name: "Search 1", saql: `"Bob"`, wantBleve: `"Bob"`},
- {name: "Search 2", saql: `"Bob" AND title == 'Name'`, wantBleve: `"Bob" title:"Name"`},
- {name: "Search 3", saql: `"Bob" OR title == 'Name'`, wantRebuildErr: true},
- {name: "Search 4", saql: `title == 'malware' AND 'wannacry'`, wantBleve: `title:"malware" "wannacry"`},
- }
- for _, tt := range tests {
- tt := tt
-
- parser := &caql.Parser{}
-
- t.Run(tt.name, func(t *testing.T) {
- t.Parallel()
-
- expr, err := parser.Parse(tt.saql)
- if (err != nil) != tt.wantParseErr {
- t.Errorf("Parse() error = %v, wantErr %v", err, tt.wantParseErr)
- if expr != nil {
- t.Error(expr.String())
- }
-
- return
- }
- if err != nil {
- return
- }
-
- got, err := expr.BleveString()
- if (err != nil) != tt.wantRebuildErr {
- t.Error(expr.String())
- t.Errorf("String() error = %v, wantErr %v", err, tt.wantParseErr)
-
- return
- }
- if err != nil {
- return
- }
- if got != tt.wantBleve {
- t.Errorf("String() got = %v, want %v", got, tt.wantBleve)
- }
- })
- }
-}
diff --git a/caql/builder.go b/caql/builder.go
deleted file mode 100644
index 62de3b7..0000000
--- a/caql/builder.go
+++ /dev/null
@@ -1,322 +0,0 @@
-package caql
-
-import (
- "fmt"
- "strconv"
- "strings"
-
- "golang.org/x/exp/slices"
-
- "github.com/SecurityBrewery/catalyst/generated/caql/parser"
-)
-
-type Searcher interface {
- Search(term string) (ids []string, err error)
-}
-
-type aqlBuilder struct {
- *parser.BaseCAQLParserListener
- searcher Searcher
- stack []string
- prefix string
-}
-
-// push is a helper function for pushing new node to the listener Stack.
-func (s *aqlBuilder) push(i string) {
- s.stack = append(s.stack, i)
-}
-
-// pop is a helper function for poping a node from the listener Stack.
-func (s *aqlBuilder) pop() (n string) {
- // Check that we have nodes in the stack.
- size := len(s.stack)
- if size < 1 {
- panic(ErrStack)
- }
-
- // Pop the last value from the Stack.
- n, s.stack = s.stack[size-1], s.stack[:size-1]
-
- return
-}
-
-func (s *aqlBuilder) binaryPop() (string, string) {
- right, left := s.pop(), s.pop()
-
- return left, right
-}
-
-// ExitExpression is called when production expression is exited.
-func (s *aqlBuilder) ExitExpression(ctx *parser.ExpressionContext) {
- switch {
- case ctx.Value_literal() != nil:
- if ctx.GetParent().GetParent() == nil {
- s.push(s.toBoolString(s.pop()))
- }
- case ctx.Reference() != nil:
- ref := s.pop()
- if ref == "d.id" {
- s.push("d._key")
- } else {
- s.push(ref)
- }
- // pass
- case ctx.Operator_unary() != nil:
- s.push(s.toBoolString(s.pop()))
-
- case ctx.T_PLUS() != nil:
- left, right := s.binaryPop()
- s.push(fmt.Sprintf("%s + %s", left, right))
- case ctx.T_MINUS() != nil:
- left, right := s.binaryPop()
- s.push(fmt.Sprintf("%s - %s", left, right))
- case ctx.T_TIMES() != nil:
- left, right := s.binaryPop()
- s.push(fmt.Sprintf("%s * %s", left, right))
- case ctx.T_DIV() != nil:
- left, right := s.binaryPop()
- s.push(fmt.Sprintf("%s / %s", left, right))
- case ctx.T_MOD() != nil:
- left, right := s.binaryPop()
- s.push(fmt.Sprintf("%s %% %s", left, right))
-
- case ctx.T_RANGE() != nil:
- left, right := s.binaryPop()
- s.push(fmt.Sprintf("%s..%s", left, right))
-
- case ctx.T_LT() != nil && ctx.GetEq_op() == nil:
- left, right := s.binaryPop()
- s.push(fmt.Sprintf("%s < %s", left, right))
- case ctx.T_GT() != nil && ctx.GetEq_op() == nil:
- left, right := s.binaryPop()
- s.push(fmt.Sprintf("%s > %s", left, right))
- case ctx.T_LE() != nil && ctx.GetEq_op() == nil:
- left, right := s.binaryPop()
- s.push(fmt.Sprintf("%s <= %s", left, right))
- case ctx.T_GE() != nil && ctx.GetEq_op() == nil:
- left, right := s.binaryPop()
- s.push(fmt.Sprintf("%s >= %s", left, right))
-
- case ctx.T_IN() != nil && ctx.GetEq_op() == nil:
- left, right := s.binaryPop()
- if ctx.T_NOT() != nil {
- s.push(fmt.Sprintf("%s NOT IN %s", left, right))
- } else {
- s.push(fmt.Sprintf("%s IN %s", left, right))
- }
-
- case ctx.T_EQ() != nil && ctx.GetEq_op() == nil:
- left, right := s.binaryPop()
- s.push(fmt.Sprintf("%s == %s", left, right))
- case ctx.T_NE() != nil && ctx.GetEq_op() == nil:
- left, right := s.binaryPop()
- s.push(fmt.Sprintf("%s != %s", left, right))
-
- case ctx.T_ALL() != nil && ctx.GetEq_op() != nil:
- right, left := s.pop(), s.pop()
- s.push(fmt.Sprintf("%s ALL %s %s", left, ctx.GetEq_op().GetText(), right))
- case ctx.T_ANY() != nil && ctx.GetEq_op() != nil:
- right, left := s.pop(), s.pop()
- s.push(fmt.Sprintf("%s ANY %s %s", left, ctx.GetEq_op().GetText(), right))
- case ctx.T_NONE() != nil && ctx.GetEq_op() != nil:
- right, left := s.pop(), s.pop()
- s.push(fmt.Sprintf("%s NONE %s %s", left, ctx.GetEq_op().GetText(), right))
-
- case ctx.T_ALL() != nil && ctx.T_NOT() != nil && ctx.T_IN() != nil:
- right, left := s.pop(), s.pop()
- s.push(fmt.Sprintf("%s ALL IN %s", left, right))
- case ctx.T_ANY() != nil && ctx.T_NOT() != nil && ctx.T_IN() != nil:
- right, left := s.pop(), s.pop()
- s.push(fmt.Sprintf("%s ANY IN %s", left, right))
- case ctx.T_NONE() != nil && ctx.T_NOT() != nil && ctx.T_IN() != nil:
- right, left := s.pop(), s.pop()
- s.push(fmt.Sprintf("%s NONE IN %s", left, right))
-
- case ctx.T_LIKE() != nil:
- left, right := s.binaryPop()
- if ctx.T_NOT() != nil {
- s.push(fmt.Sprintf("%s NOT LIKE %s", left, right))
- } else {
- s.push(fmt.Sprintf("%s LIKE %s", left, right))
- }
- case ctx.T_REGEX_MATCH() != nil:
- left, right := s.binaryPop()
- if ctx.T_NOT() != nil {
- s.push(fmt.Sprintf("%s NOT =~ %s", left, right))
- } else {
- s.push(fmt.Sprintf("%s =~ %s", left, right))
- }
- case ctx.T_REGEX_NON_MATCH() != nil:
- left, right := s.binaryPop()
- if ctx.T_NOT() != nil {
- s.push(fmt.Sprintf("%s NOT !~ %s", left, right))
- } else {
- s.push(fmt.Sprintf("%s !~ %s", left, right))
- }
-
- case ctx.T_AND() != nil:
- left, right := s.binaryPop()
- left = s.toBoolString(left)
- right = s.toBoolString(right)
- s.push(fmt.Sprintf("%s AND %s", left, right))
- case ctx.T_OR() != nil:
- left, right := s.binaryPop()
- left = s.toBoolString(left)
- right = s.toBoolString(right)
- s.push(fmt.Sprintf("%s OR %s", left, right))
-
- case ctx.T_QUESTION() != nil && len(ctx.AllExpression()) == 3:
- right, middle, left := s.pop(), s.pop(), s.pop()
- s.push(fmt.Sprintf("%s ? %s : %s", left, middle, right))
- case ctx.T_QUESTION() != nil && len(ctx.AllExpression()) == 2:
- right, left := s.pop(), s.pop()
- s.push(fmt.Sprintf("%s ? : %s", left, right))
-
- default:
- panic("unknown expression")
- }
-}
-
-func (s *aqlBuilder) toBoolString(v string) string {
- _, err := unquote(v)
- if err == nil {
- ids, err := s.searcher.Search(v)
- if err != nil {
- panic("invalid search " + err.Error())
- }
-
- return fmt.Sprintf(`d._key IN ["%s"]`, strings.Join(ids, `","`))
- }
-
- return v
-}
-
-// ExitOperator_unary is called when production operator_unary is exited.
-func (s *aqlBuilder) ExitOperator_unary(ctx *parser.Operator_unaryContext) {
- value := s.pop()
- switch {
- case ctx.T_PLUS() != nil:
- s.push(value)
- case ctx.T_MINUS() != nil:
- s.push(fmt.Sprintf("-%s", value))
- case ctx.T_NOT() != nil:
- s.push(fmt.Sprintf("NOT %s", value))
- default:
- panic(fmt.Sprintf("unexpected operation: %s", ctx.GetText()))
- }
-}
-
-// ExitReference is called when production reference is exited.
-func (s *aqlBuilder) ExitReference(ctx *parser.ReferenceContext) {
- switch {
- case ctx.DOT() != nil:
- reference := s.pop()
- if s.prefix != "" && !strings.HasPrefix(reference, s.prefix) {
- reference = s.prefix + reference
- }
- s.push(fmt.Sprintf("%s.%s", reference, ctx.T_STRING().GetText()))
- case ctx.T_STRING() != nil:
- reference := ctx.T_STRING().GetText()
- if s.prefix != "" && !strings.HasPrefix(reference, s.prefix) {
- reference = s.prefix + reference
- }
- s.push(reference)
- case ctx.Compound_value() != nil:
- // pass
- case ctx.Function_call() != nil:
- // pass
- case ctx.T_OPEN() != nil:
- s.push(fmt.Sprintf("(%s)", s.pop()))
- case ctx.T_ARRAY_OPEN() != nil:
- key := s.pop()
- reference := s.pop()
-
- s.push(fmt.Sprintf("%s[%s]", reference, key))
- default:
- panic(fmt.Sprintf("unexpected value: %s", ctx.GetText()))
- }
-}
-
-// ExitCompound_value is called when production compound_value is exited.
-func (s *aqlBuilder) ExitCompound_value(_ *parser.Compound_valueContext) {
- // pass
-}
-
-// ExitFunction_call is called when production function_call is exited.
-func (s *aqlBuilder) ExitFunction_call(ctx *parser.Function_callContext) {
- var array []string
- for range ctx.AllExpression() {
- // prepend element
- array = append([]string{s.pop()}, array...)
- }
- parameter := strings.Join(array, ", ")
-
- if !slices.Contains(functionNames, strings.ToUpper(ctx.T_STRING().GetText())) {
- panic("unknown function")
- }
-
- s.push(fmt.Sprintf("%s(%s)", strings.ToUpper(ctx.T_STRING().GetText()), parameter))
-}
-
-// ExitValue_literal is called when production value_literal is exited.
-func (s *aqlBuilder) ExitValue_literal(ctx *parser.Value_literalContext) {
- if ctx.T_QUOTED_STRING() != nil {
- st, err := unquote(ctx.GetText())
- if err != nil {
- panic(err)
- }
- s.push(strconv.Quote(st))
- } else {
- s.push(ctx.GetText())
- }
-}
-
-// ExitArray is called when production array is exited.
-func (s *aqlBuilder) ExitArray(ctx *parser.ArrayContext) {
- var elements []string
- for range ctx.AllExpression() {
- // elements = append(elements, s.pop())
- elements = append([]string{s.pop()}, elements...)
- }
- s.push("[" + strings.Join(elements, ", ") + "]")
-}
-
-// ExitObject is called when production object is exited.
-func (s *aqlBuilder) ExitObject(ctx *parser.ObjectContext) {
- var elements []string
- for range ctx.AllObject_element() {
- key, value := s.pop(), s.pop()
-
- elements = append([]string{fmt.Sprintf("%s: %v", key, value)}, elements...)
- }
- // s.push(object)
- s.push("{" + strings.Join(elements, ", ") + "}")
-}
-
-// ExitObject_element is called when production object_element is exited.
-func (s *aqlBuilder) ExitObject_element(ctx *parser.Object_elementContext) {
- switch {
- case ctx.T_STRING() != nil:
- s.push(ctx.GetText())
- s.push(ctx.GetText())
- case ctx.Object_element_name() != nil, ctx.T_ARRAY_OPEN() != nil:
- key, value := s.pop(), s.pop()
-
- s.push(key)
- s.push(value)
- default:
- panic(fmt.Sprintf("unexpected value: %s", ctx.GetText()))
- }
-}
-
-// ExitObject_element_name is called when production object_element_name is exited.
-func (s *aqlBuilder) ExitObject_element_name(ctx *parser.Object_element_nameContext) {
- switch {
- case ctx.T_STRING() != nil:
- s.push(ctx.T_STRING().GetText())
- case ctx.T_QUOTED_STRING() != nil:
- s.push(ctx.T_QUOTED_STRING().GetText())
- default:
- panic(fmt.Sprintf("unexpected value: %s", ctx.GetText()))
- }
-}
diff --git a/caql/errors.go b/caql/errors.go
deleted file mode 100644
index 40acff6..0000000
--- a/caql/errors.go
+++ /dev/null
@@ -1,8 +0,0 @@
-package caql
-
-import "errors"
-
-var (
- ErrStack = errors.New("unexpected operator stack")
- ErrUndefined = errors.New("variable not defined")
-)
diff --git a/caql/function.go b/caql/function.go
deleted file mode 100644
index b28a92b..0000000
--- a/caql/function.go
+++ /dev/null
@@ -1,742 +0,0 @@
-package caql
-
-import (
- "errors"
- "fmt"
- "math"
- "math/rand"
- "sort"
- "strings"
- "unicode/utf8"
-
- "github.com/imdario/mergo"
-
- "github.com/SecurityBrewery/catalyst/generated/caql/parser"
-)
-
-func (s *aqlInterpreter) function(ctx *parser.Function_callContext) {
- switch strings.ToUpper(ctx.T_STRING().GetText()) {
- default:
- s.appendErrors(errors.New("unknown function"))
-
- // Array https://www.arangodb.com/docs/stable/aql/functions-array.html
- case "APPEND":
- u := false
- if len(ctx.AllExpression()) == 3 {
- u = s.pop().(bool)
- }
- seen := map[any]bool{}
- values, anyArray := s.pop().([]any), s.pop().([]any)
-
- if u {
- for _, e := range anyArray {
- seen[e] = true
- }
- }
-
- for _, e := range values {
- _, ok := seen[e]
- if !ok || !u {
- seen[e] = true
- anyArray = append(anyArray, e)
- }
- }
- s.push(anyArray)
- case "COUNT_DISTINCT", "COUNT_UNIQUE":
- count := 0
- seen := map[any]bool{}
- array := s.pop().([]any)
- for _, e := range array {
- _, ok := seen[e]
- if !ok {
- seen[e] = true
- count++
- }
- }
- s.push(float64(count))
- case "FIRST":
- array := s.pop().([]any)
- if len(array) == 0 {
- s.push(nil)
- } else {
- s.push(array[0])
- }
- // case "FLATTEN":
- // case "INTERLEAVE":
- case "INTERSECTION":
- iset := NewSet(s.pop().([]any)...)
-
- for i := 1; i < len(ctx.AllExpression()); i++ {
- iset = iset.Intersection(NewSet(s.pop().([]any)...))
- }
-
- s.push(iset.Values())
- // case "JACCARD":
- case "LAST":
- array := s.pop().([]any)
- if len(array) == 0 {
- s.push(nil)
- } else {
- s.push(array[len(array)-1])
- }
- case "COUNT", "LENGTH":
- switch v := s.pop().(type) {
- case nil:
- s.push(float64(0))
- case bool:
- if v {
- s.push(float64(1))
- } else {
- s.push(float64(0))
- }
- case float64:
- s.push(float64(len(fmt.Sprint(v))))
- case string:
- s.push(float64(utf8.RuneCountInString(v)))
- case []any:
- s.push(float64(len(v)))
- case map[string]any:
- s.push(float64(len(v)))
- default:
- panic("unknown type")
- }
- case "MINUS":
- var sets []*Set
- for i := 0; i < len(ctx.AllExpression()); i++ {
- sets = append(sets, NewSet(s.pop().([]any)...))
- }
-
- iset := sets[len(sets)-1]
- // for i := len(sets)-1; i > 0; i-- {
- for i := 0; i < len(sets)-1; i++ {
- iset = iset.Minus(sets[i])
- }
-
- s.push(iset.Values())
- case "NTH":
- pos := s.pop().(float64)
- array := s.pop().([]any)
- if int(pos) >= len(array) || pos < 0 {
- s.push(nil)
- } else {
- s.push(array[int64(pos)])
- }
- // case "OUTERSECTION":
- // array := s.pop().([]interface{})
- // union := NewSet(array...)
- // intersection := NewSet(s.pop().([]interface{})...)
- // for i := 1; i < len(ctx.AllExpression()); i++ {
- // array = s.pop().([]interface{})
- // union = union.Union(NewSet(array...))
- // intersection = intersection.Intersection(NewSet(array...))
- // }
- // s.push(union.Minus(intersection).Values())
- case "POP":
- array := s.pop().([]any)
- s.push(array[:len(array)-1])
- case "POSITION", "CONTAINS_ARRAY":
- returnIndex := false
- if len(ctx.AllExpression()) == 3 {
- returnIndex = s.pop().(bool)
- }
- search := s.pop()
- array := s.pop().([]any)
-
- for idx, e := range array {
- if e == search {
- if returnIndex {
- s.push(float64(idx))
- } else {
- s.push(true)
- }
- }
- }
-
- if returnIndex {
- s.push(float64(-1))
- } else {
- s.push(false)
- }
- case "PUSH":
- u := false
- if len(ctx.AllExpression()) == 3 {
- u = s.pop().(bool)
- }
- element := s.pop()
- array := s.pop().([]any)
-
- if u && contains(array, element) {
- s.push(array)
- } else {
- s.push(append(array, element))
- }
- case "REMOVE_NTH":
- position := s.pop().(float64)
- anyArray := s.pop().([]any)
-
- if position < 0 {
- position = float64(len(anyArray) + int(position))
- }
-
- result := []any{}
- for idx, e := range anyArray {
- if idx != int(position) {
- result = append(result, e)
- }
- }
- s.push(result)
- case "REPLACE_NTH":
- defaultPaddingValue := ""
- if len(ctx.AllExpression()) == 4 {
- defaultPaddingValue = s.pop().(string)
- }
- replaceValue := s.pop().(string)
- position := s.pop().(float64)
- anyArray := s.pop().([]any)
-
- if position < 0 {
- position = float64(len(anyArray) + int(position))
- if position < 0 {
- position = 0
- }
- }
-
- switch {
- case int(position) < len(anyArray):
- anyArray[int(position)] = replaceValue
- case int(position) == len(anyArray):
- anyArray = append(anyArray, replaceValue)
- default:
- if defaultPaddingValue == "" {
- panic("missing defaultPaddingValue")
- }
- for len(anyArray) < int(position) {
- anyArray = append(anyArray, defaultPaddingValue)
- }
- anyArray = append(anyArray, replaceValue)
- }
-
- s.push(anyArray)
- case "REMOVE_VALUE":
- limit := math.Inf(1)
- if len(ctx.AllExpression()) == 3 {
- limit = s.pop().(float64)
- }
- value := s.pop()
- array := s.pop().([]any)
- result := []any{}
- for idx, e := range array {
- if e != value || float64(idx) > limit {
- result = append(result, e)
- }
- }
- s.push(result)
- case "REMOVE_VALUES":
- values := s.pop().([]any)
- array := s.pop().([]any)
- result := []any{}
- for _, e := range array {
- if !contains(values, e) {
- result = append(result, e)
- }
- }
- s.push(result)
- case "REVERSE":
- array := s.pop().([]any)
- var reverse []any
- for _, e := range array {
- reverse = append([]any{e}, reverse...)
- }
- s.push(reverse)
- case "SHIFT":
- s.push(s.pop().([]any)[1:])
- case "SLICE":
- length := float64(-1)
- full := true
- if len(ctx.AllExpression()) == 3 {
- length = s.pop().(float64)
- full = false
- }
- start := int64(s.pop().(float64))
- array := s.pop().([]any)
-
- if start < 0 {
- start = int64(len(array)) + start
- }
- if full {
- length = float64(int64(len(array)) - start)
- }
-
- end := int64(0)
- if length < 0 {
- end = int64(len(array)) + int64(length)
- } else {
- end = start + int64(length)
- }
- s.push(array[start:end])
- case "SORTED":
- array := s.pop().([]any)
- sort.Slice(array, func(i, j int) bool { return lt(array[i], array[j]) })
- s.push(array)
- case "SORTED_UNIQUE":
- array := s.pop().([]any)
- sort.Slice(array, func(i, j int) bool { return lt(array[i], array[j]) })
- s.push(unique(array))
- case "UNION":
- array := s.pop().([]any)
-
- for i := 1; i < len(ctx.AllExpression()); i++ {
- array = append(array, s.pop().([]any)...)
- }
-
- sort.Slice(array, func(i, j int) bool { return lt(array[i], array[j]) })
- s.push(array)
- case "UNION_DISTINCT":
- iset := NewSet(s.pop().([]any)...)
-
- for i := 1; i < len(ctx.AllExpression()); i++ {
- iset = iset.Union(NewSet(s.pop().([]any)...))
- }
-
- s.push(unique(iset.Values()))
- case "UNIQUE":
- s.push(unique(s.pop().([]any)))
- case "UNSHIFT":
- u := false
- if len(ctx.AllExpression()) == 3 {
- u = s.pop().(bool)
- }
- element := s.pop()
- array := s.pop().([]any)
- if u && contains(array, element) {
- s.push(array)
- } else {
- s.push(append([]any{element}, array...))
- }
-
- // Bit https://www.arangodb.com/docs/stable/aql/functions-bit.html
- // case "BIT_AND":
- // case "BIT_CONSTRUCT":
- // case "BIT_DECONSTRUCT":
- // case "BIT_FROM_STRING":
- // case "BIT_NEGATE":
- // case "BIT_OR":
- // case "BIT_POPCOUNT":
- // case "BIT_SHIFT_LEFT":
- // case "BIT_SHIFT_RIGHT":
- // case "BIT_TEST":
- // case "BIT_TO_STRING":
- // case "BIT_XOR":
-
- // Date https://www.arangodb.com/docs/stable/aql/functions-date.html
- // case "DATE_NOW":
- // case "DATE_ISO8601":
- // case "DATE_TIMESTAMP":
- // case "IS_DATESTRING":
-
- // case "DATE_DAYOFWEEK":
- // case "DATE_YEAR":
- // case "DATE_MONTH":
- // case "DATE_DAY":
- // case "DATE_HOUR":
- // case "DATE_MINUTE":
- // case "DATE_SECOND":
- // case "DATE_MILLISECOND":
-
- // case "DATE_DAYOFYEAR":
- // case "DATE_ISOWEEK":
- // case "DATE_LEAPYEAR":
- // case "DATE_QUARTER":
- // case "DATE_DAYS_IN_MONTH":
- // case "DATE_TRUNC":
- // case "DATE_ROUND":
- // case "DATE_FORMAT":
-
- // case "DATE_ADD":
- // case "DATE_SUBTRACT":
- // case "DATE_DIFF":
- // case "DATE_COMPARE":
-
- // Document https://www.arangodb.com/docs/stable/aql/functions-document.html
- case "ATTRIBUTES":
- if len(ctx.AllExpression()) == 3 {
- s.pop() // always sort
- }
- removeInternal := false
- if len(ctx.AllExpression()) >= 2 {
- removeInternal = s.pop().(bool)
- }
- var keys []any
- for k := range s.pop().(map[string]any) {
- isInternalKey := strings.HasPrefix(k, "_")
- if !removeInternal || !isInternalKey {
- keys = append(keys, k)
- }
- }
- sort.Slice(keys, func(i, j int) bool { return lt(keys[i], keys[j]) })
- s.push(keys)
- // case "COUNT":
- case "HAS":
- right, left := s.pop(), s.pop()
- _, ok := left.(map[string]any)[right.(string)]
- s.push(ok)
- // case "KEEP":
- // case "LENGTH":
- // case "MATCHES":
- case "MERGE":
- var docs []map[string]any
- if len(ctx.AllExpression()) == 1 {
- for _, doc := range s.pop().([]any) {
- docs = append([]map[string]any{doc.(map[string]any)}, docs...)
- }
- } else {
- for i := 0; i < len(ctx.AllExpression()); i++ {
- docs = append(docs, s.pop().(map[string]any))
- }
- }
-
- doc := docs[len(docs)-1]
- for i := len(docs) - 2; i >= 0; i-- {
- for k, v := range docs[i] {
- doc[k] = v
- }
- }
- s.push(doc)
- case "MERGE_RECURSIVE":
- var doc map[string]any
- for i := 0; i < len(ctx.AllExpression()); i++ {
- err := mergo.Merge(&doc, s.pop().(map[string]any))
- if err != nil {
- panic(err)
- }
- }
- s.push(doc)
- // case "PARSE_IDENTIFIER":
- // case "TRANSLATE":
- // case "UNSET":
- // case "UNSET_RECURSIVE":
- case "VALUES":
- removeInternal := false
- if len(ctx.AllExpression()) == 2 {
- removeInternal = s.pop().(bool)
- }
- var values []any
- for k, v := range s.pop().(map[string]any) {
- isInternalKey := strings.HasPrefix(k, "_")
- if !removeInternal || !isInternalKey {
- values = append(values, v)
- }
- }
- sort.Slice(values, func(i, j int) bool { return lt(values[i], values[j]) })
- s.push(values)
- // case "ZIP":
-
- // Numeric https://www.arangodb.com/docs/stable/aql/functions-numeric.html
- case "ABS":
- s.push(math.Abs(s.pop().(float64)))
- case "ACOS":
- v := s.pop().(float64)
- asin := math.Acos(v)
- if v > 1 || v < -1 {
- s.push(nil)
- } else {
- s.push(asin)
- }
- case "ASIN":
- v := s.pop().(float64)
- asin := math.Asin(v)
- if v > 1 || v < -1 {
- s.push(nil)
- } else {
- s.push(asin)
- }
- case "ATAN":
- s.push(math.Atan(s.pop().(float64)))
- case "ATAN2":
- s.push(math.Atan2(s.pop().(float64), s.pop().(float64)))
- case "AVERAGE", "AVG":
- count := 0
- sum := float64(0)
- array := s.pop().([]any)
- for _, element := range array {
- if element != nil {
- count++
- sum += toNumber(element)
- }
- }
- if count == 0 {
- s.push(nil)
- } else {
- s.push(sum / float64(count))
- }
- case "CEIL":
- s.push(math.Ceil(s.pop().(float64)))
- case "COS":
- s.push(math.Cos(s.pop().(float64)))
- case "DEGREES":
- s.push(s.pop().(float64) * 180 / math.Pi)
- case "EXP":
- s.push(math.Exp(s.pop().(float64)))
- case "EXP2":
- s.push(math.Exp2(s.pop().(float64)))
- case "FLOOR":
- s.push(math.Floor(s.pop().(float64)))
- case "LOG":
- l := math.Log(s.pop().(float64))
- if l <= 0 {
- s.push(nil)
- } else {
- s.push(l)
- }
- case "LOG2":
- l := math.Log2(s.pop().(float64))
- if l <= 0 {
- s.push(nil)
- } else {
- s.push(l)
- }
- case "LOG10":
- l := math.Log10(s.pop().(float64))
- if l <= 0 {
- s.push(nil)
- } else {
- s.push(l)
- }
- case "MAX":
- var set bool
- var max float64
- array := s.pop().([]any)
- for _, element := range array {
- if element != nil {
- if !set || toNumber(element) > max {
- max = toNumber(element)
- set = true
- }
- }
- }
- if set {
- s.push(max)
- } else {
- s.push(nil)
- }
- case "MEDIAN":
- array := s.pop().([]any)
- var numbers []float64
- for _, element := range array {
- if f, ok := element.(float64); ok {
- numbers = append(numbers, f)
- }
- }
-
- sort.Float64s(numbers) // sort the numbers
-
- middlePos := len(numbers) / 2
-
- switch {
- case len(numbers) == 0:
- s.push(nil)
- case len(numbers)%2 == 1:
- s.push(numbers[middlePos])
- default:
- s.push((numbers[middlePos-1] + numbers[middlePos]) / 2)
- }
- case "MIN":
- var set bool
- var min float64
- array := s.pop().([]any)
- for _, element := range array {
- if element != nil {
- if !set || toNumber(element) < min {
- min = toNumber(element)
- set = true
- }
- }
- }
- if set {
- s.push(min)
- } else {
- s.push(nil)
- }
- // case "PERCENTILE":
- case "PI":
- s.push(math.Pi)
- case "POW":
- right, left := s.pop(), s.pop()
- s.push(math.Pow(left.(float64), right.(float64)))
- case "PRODUCT":
- product := float64(1)
- array := s.pop().([]any)
- for _, element := range array {
- if element != nil {
- product *= toNumber(element)
- }
- }
- s.push(product)
- case "RADIANS":
- s.push(s.pop().(float64) * math.Pi / 180)
- case "RAND":
- s.push(rand.Float64())
- case "RANGE":
- var array []any
- var start, end, step float64
- if len(ctx.AllExpression()) == 2 {
- right, left := s.pop(), s.pop()
- start = math.Trunc(left.(float64))
- end = math.Trunc(right.(float64))
- step = 1
- } else {
- middle, right, left := s.pop(), s.pop(), s.pop()
- start = left.(float64)
- end = right.(float64)
- step = middle.(float64)
- }
- for i := start; i <= end; i += step {
- array = append(array, i)
- }
- s.push(array)
- case "ROUND":
- x := s.pop().(float64)
- t := math.Trunc(x)
- if math.Abs(x-t) == 0.5 {
- s.push(x + 0.5)
- } else {
- s.push(math.Round(x))
- }
- case "SIN":
- s.push(math.Sin(s.pop().(float64)))
- case "SQRT":
- s.push(math.Sqrt(s.pop().(float64)))
- // case "STDDEV_POPULATION":
- // case "STDDEV_SAMPLE":
- // case "STDDEV":
- case "SUM":
- sum := float64(0)
- array := s.pop().([]any)
- for _, element := range array {
- sum += toNumber(element)
- }
- s.push(sum)
- case "TAN":
- s.push(math.Tan(s.pop().(float64)))
- // case "VARIANCE_POPULATION", "VARIANCE":
- // case "VARIANCE_SAMPLE":
-
- // String https://www.arangodb.com/docs/stable/aql/functions-string.html
- // case "CHAR_LENGTH":
- // case "CONCAT":
- // case "CONCAT_SEPARATOR":
- // case "CONTAINS":
- // case "CRC32":
- // case "ENCODE_URI_COMPONENT":
- // case "FIND_FIRST":
- // case "FIND_LAST":
- // case "FNV64":
- // case "IPV4_FROM_NUMBER":
- // case "IPV4_TO_NUMBER":
- // case "IS_IPV4":
- // case "JSON_PARSE":
- // case "JSON_STRINGIFY":
- // case "LEFT":
- // case "LENGTH":
- // case "LEVENSHTEIN_DISTANCE":
- // case "LIKE":
- case "LOWER":
- s.push(strings.ToLower(s.pop().(string)))
- // case "LTRIM":
- // case "MD5":
- // case "NGRAM_POSITIONAL_SIMILARITY":
- // case "NGRAM_SIMILARITY":
- // case "RANDOM_TOKEN":
- // case "REGEX_MATCHES":
- // case "REGEX_SPLIT":
- // case "REGEX_TEST":
- // case "REGEX_REPLACE":
- // case "REVERSE":
- // case "RIGHT":
- // case "RTRIM":
- // case "SHA1":
- // case "SHA512":
- // case "SOUNDEX":
- // case "SPLIT":
- // case "STARTS_WITH":
- // case "SUBSTITUTE":
- // case "SUBSTRING":
- // case "TOKENS":
- // case "TO_BASE64":
- // case "TO_HEX":
- // case "TRIM":
- case "UPPER":
- s.push(strings.ToUpper(s.pop().(string)))
- // case "UUID":
-
- // Type cast https://www.arangodb.com/docs/stable/aql/functions-type-cast.html
- case "TO_BOOL":
- s.push(toBool(s.pop()))
- case "TO_NUMBER":
- s.push(toNumber(s.pop()))
- // case "TO_STRING":
- // case "TO_ARRAY":
- // case "TO_LIST":
-
- // case "IS_NULL":
- // case "IS_BOOL":
- // case "IS_NUMBER":
- // case "IS_STRING":
- // case "IS_ARRAY":
- // case "IS_LIST":
- // case "IS_OBJECT":
- // case "IS_DOCUMENT":
- // case "IS_DATESTRING":
- // case "IS_IPV4":
- // case "IS_KEY":
- // case "TYPENAME":
- }
-}
-
-func unique(array []any) []any {
- seen := map[any]bool{}
- var filtered []any
- for _, e := range array {
- _, ok := seen[e]
- if !ok {
- seen[e] = true
- filtered = append(filtered, e)
- }
- }
-
- return filtered
-}
-
-func contains(values []any, e any) bool {
- for _, v := range values {
- if e == v {
- return true
- }
- }
-
- return false
-}
-
-var functionNames = []string{
- "APPEND", "COUNT_DISTINCT", "COUNT_UNIQUE", "FIRST", "FLATTEN", "INTERLEAVE", "INTERSECTION", "JACCARD", "LAST",
- "COUNT", "LENGTH", "MINUS", "NTH", "OUTERSECTION", "POP", "POSITION", "CONTAINS_ARRAY", "PUSH", "REMOVE_NTH",
- "REPLACE_NTH", "REMOVE_VALUE", "REMOVE_VALUES", "REVERSE", "SHIFT", "SLICE", "SORTED", "SORTED_UNIQUE", "UNION",
- "UNION_DISTINCT", "UNIQUE", "UNSHIFT", "BIT_AND", "BIT_CONSTRUCT", "BIT_DECONSTRUCT", "BIT_FROM_STRING",
- "BIT_NEGATE", "BIT_OR", "BIT_POPCOUNT", "BIT_SHIFT_LEFT", "BIT_SHIFT_RIGHT", "BIT_TEST", "BIT_TO_STRING",
- "BIT_XOR", "DATE_NOW", "DATE_ISO8601", "DATE_TIMESTAMP", "IS_DATESTRING", "DATE_DAYOFWEEK", "DATE_YEAR",
- "DATE_MONTH", "DATE_DAY", "DATE_HOUR", "DATE_MINUTE", "DATE_SECOND", "DATE_MILLISECOND", "DATE_DAYOFYEAR",
- "DATE_ISOWEEK", "DATE_LEAPYEAR", "DATE_QUARTER", "DATE_DAYS_IN_MONTH", "DATE_TRUNC", "DATE_ROUND", "DATE_FORMAT",
- "DATE_ADD", "DATE_SUBTRACT", "DATE_DIFF", "DATE_COMPARE", "ATTRIBUTES", "COUNT", "HAS", "KEEP", "LENGTH",
- "MATCHES", "MERGE", "MERGE_RECURSIVE", "PARSE_IDENTIFIER", "TRANSLATE", "UNSET", "UNSET_RECURSIVE", "VALUES",
- "ZIP", "ABS", "ACOS", "ASIN", "ATAN", "ATAN2", "AVERAGE", "AVG", "CEIL", "COS", "DEGREES", "EXP", "EXP2", "FLOOR",
- "LOG", "LOG2", "LOG10", "MAX", "MEDIAN", "MIN", "PERCENTILE", "PI", "POW", "PRODUCT", "RADIANS", "RAND", "RANGE",
- "ROUND", "SIN", "SQRT", "STDDEV_POPULATION", "STDDEV_SAMPLE", "STDDEV", "SUM", "TAN", "VARIANCE_POPULATION",
- "VARIANCE", "VARIANCE_SAMPLE", "CHAR_LENGTH", "CONCAT", "CONCAT_SEPARATOR", "CONTAINS", "CRC32",
- "ENCODE_URI_COMPONENT", "FIND_FIRST", "FIND_LAST", "FNV64", "IPV4_FROM_NUMBER", "IPV4_TO_NUMBER", "IS_IPV4",
- "JSON_PARSE", "JSON_STRINGIFY", "LEFT", "LENGTH", "LEVENSHTEIN_DISTANCE", "LIKE", "LOWER", "LTRIM", "MD5",
- "NGRAM_POSITIONAL_SIMILARITY", "NGRAM_SIMILARITY", "RANDOM_TOKEN", "REGEX_MATCHES", "REGEX_SPLIT", "REGEX_TEST",
- "REGEX_REPLACE", "REVERSE", "RIGHT", "RTRIM", "SHA1", "SHA512", "SOUNDEX", "SPLIT", "STARTS_WITH", "SUBSTITUTE",
- "SUBSTRING", "TOKENS", "TO_BASE64", "TO_HEX", "TRIM", "UPPER", "UUID", "TO_BOOL", "TO_NUMBER", "TO_STRING",
- "TO_ARRAY", "TO_LIST", "IS_NULL", "IS_BOOL", "IS_NUMBER", "IS_STRING", "IS_ARRAY", "IS_LIST", "IS_OBJECT",
- "IS_DOCUMENT", "IS_DATESTRING", "IS_IPV4", "IS_KEY", "TYPENAME",
-}
diff --git a/caql/function_test.go b/caql/function_test.go
deleted file mode 100644
index c331fca..0000000
--- a/caql/function_test.go
+++ /dev/null
@@ -1,392 +0,0 @@
-package caql_test
-
-import (
- "encoding/json"
- "math"
- "reflect"
- "testing"
-
- "github.com/SecurityBrewery/catalyst/caql"
-)
-
-func TestFunctions(t *testing.T) {
- t.Parallel()
-
- tests := []struct {
- name string
- saql string
- wantRebuild string
- wantValue any
- wantParseErr bool
- wantRebuildErr bool
- wantEvalErr bool
- values string
- }{
- // https://www.arangodb.com/docs/3.7/aql/functions-array.html
- {name: "APPEND", saql: `APPEND([1, 2, 3], [5, 6, 9])`, wantRebuild: `APPEND([1, 2, 3], [5, 6, 9])`, wantValue: jsonParse(`[1, 2, 3, 5, 6, 9]`)},
- {name: "APPEND", saql: `APPEND([1, 2, 3], [3, 4, 5, 2, 9], true)`, wantRebuild: `APPEND([1, 2, 3], [3, 4, 5, 2, 9], true)`, wantValue: jsonParse(`[1, 2, 3, 4, 5, 9]`)},
- {name: "COUNT_DISTINCT", saql: `COUNT_DISTINCT([1, 2, 3])`, wantRebuild: `COUNT_DISTINCT([1, 2, 3])`, wantValue: 3},
- {name: "COUNT_DISTINCT", saql: `COUNT_DISTINCT(["yes", "no", "yes", "sauron", "no", "yes"])`, wantRebuild: `COUNT_DISTINCT(["yes", "no", "yes", "sauron", "no", "yes"])`, wantValue: 3},
- {name: "FIRST", saql: `FIRST([1, 2, 3])`, wantRebuild: `FIRST([1, 2, 3])`, wantValue: 1},
- {name: "FIRST", saql: `FIRST([])`, wantRebuild: `FIRST([])`, wantValue: nil},
- // {name: "FLATTEN", saql: `FLATTEN([1, 2, [3, 4], 5, [6, 7], [8, [9, 10]]])`, wantRebuild: `FLATTEN([1, 2, [3, 4], 5, [6, 7], [8, [9, 10]]])`, wantValue:},
- // {name: "FLATTEN", saql: `FLATTEN([1, 2, [3, 4], 5, [6, 7], [8, [9, 10]]], 2)`, wantRebuild: `FLATTEN([1, 2, [3, 4], 5, [6, 7], [8, [9, 10]]], 2)`, wantValue:},
- // {name: "INTERLEAVE", saql: `INTERLEAVE([1, 1, 1], [2, 2, 2], [3, 3, 3])`, wantRebuild: `INTERLEAVE([1, 1, 1], [2, 2, 2], [3, 3, 3])`, wantValue:},
- // {name: "INTERLEAVE", saql: `INTERLEAVE([1], [2, 2], [3, 3, 3])`, wantRebuild: `INTERLEAVE([1], [2, 2], [3, 3, 3])`, wantValue:},
- {name: "INTERSECTION", saql: `INTERSECTION([1,2,3,4,5], [2,3,4,5,6], [3,4,5,6,7])`, wantRebuild: `INTERSECTION([1, 2, 3, 4, 5], [2, 3, 4, 5, 6], [3, 4, 5, 6, 7])`, wantValue: jsonParse(`[3, 4, 5]`)},
- {name: "INTERSECTION", saql: `INTERSECTION([2,4,6], [8,10,12], [14,16,18])`, wantRebuild: `INTERSECTION([2, 4, 6], [8, 10, 12], [14, 16, 18])`, wantValue: jsonParse(`[]`)},
- // {name: "JACCARD", saql: `JACCARD([1,2,3,4], [3,4,5,6])`, wantRebuild: `JACCARD([1,2,3,4], [3,4,5,6])`, wantValue: 0.3333333333333333},
- // {name: "JACCARD", saql: `JACCARD([1,1,2,2,2,3], [2,2,3,4])`, wantRebuild: `JACCARD([1,1,2,2,2,3], [2,2,3,4])`, wantValue: 0.5},
- // {name: "JACCARD", saql: `JACCARD([1,2,3], [])`, wantRebuild: `JACCARD([1, 2, 3], [])`, wantValue: 0},
- // {name: "JACCARD", saql: `JACCARD([], [])`, wantRebuild: `JACCARD([], [])`, wantValue: 1},
- {name: "LAST", saql: `LAST([1,2,3,4,5])`, wantRebuild: `LAST([1, 2, 3, 4, 5])`, wantValue: 5},
- {name: "LENGTH", saql: `LENGTH("🥑")`, wantRebuild: `LENGTH("🥑")`, wantValue: 1},
- {name: "LENGTH", saql: `LENGTH(1234)`, wantRebuild: `LENGTH(1234)`, wantValue: 4},
- {name: "LENGTH", saql: `LENGTH([1,2,3,4,5,6,7])`, wantRebuild: `LENGTH([1, 2, 3, 4, 5, 6, 7])`, wantValue: 7},
- {name: "LENGTH", saql: `LENGTH(false)`, wantRebuild: `LENGTH(false)`, wantValue: 0},
- {name: "LENGTH", saql: `LENGTH({a:1, b:2, c:3, d:4, e:{f:5,g:6}})`, wantRebuild: `LENGTH({a: 1, b: 2, c: 3, d: 4, e: {f: 5, g: 6}})`, wantValue: 5},
- {name: "MINUS", saql: `MINUS([1,2,3,4], [3,4,5,6], [5,6,7,8])`, wantRebuild: `MINUS([1, 2, 3, 4], [3, 4, 5, 6], [5, 6, 7, 8])`, wantValue: jsonParse(`[1, 2]`)},
- {name: "NTH", saql: `NTH(["foo", "bar", "baz"], 2)`, wantRebuild: `NTH(["foo", "bar", "baz"], 2)`, wantValue: "baz"},
- {name: "NTH", saql: `NTH(["foo", "bar", "baz"], 3)`, wantRebuild: `NTH(["foo", "bar", "baz"], 3)`, wantValue: nil},
- {name: "NTH", saql: `NTH(["foo", "bar", "baz"], -1)`, wantRebuild: `NTH(["foo", "bar", "baz"], -1)`, wantValue: nil},
- // {name: "OUTERSECTION", saql: `OUTERSECTION([1, 2, 3], [2, 3, 4], [3, 4, 5])`, wantRebuild: `OUTERSECTION([1, 2, 3], [2, 3, 4], [3, 4, 5])`, wantValue: jsonParse(`[1, 5]`)},
- {name: "POP", saql: `POP([1, 2, 3, 4])`, wantRebuild: `POP([1, 2, 3, 4])`, wantValue: jsonParse(`[1, 2, 3]`)},
- {name: "POP", saql: `POP([1])`, wantRebuild: `POP([1])`, wantValue: jsonParse(`[]`)},
- {name: "POSITION", saql: `POSITION([2,4,6,8], 4)`, wantRebuild: `POSITION([2, 4, 6, 8], 4)`, wantValue: true},
- {name: "POSITION", saql: `POSITION([2,4,6,8], 4, true)`, wantRebuild: `POSITION([2, 4, 6, 8], 4, true)`, wantValue: 1},
- {name: "PUSH", saql: `PUSH([1, 2, 3], 4)`, wantRebuild: `PUSH([1, 2, 3], 4)`, wantValue: jsonParse(`[1, 2, 3, 4]`)},
- {name: "PUSH", saql: `PUSH([1, 2, 2, 3], 2, true)`, wantRebuild: `PUSH([1, 2, 2, 3], 2, true)`, wantValue: jsonParse(`[1, 2, 2, 3]`)},
- {name: "REMOVE_NTH", saql: `REMOVE_NTH(["a", "b", "c", "d", "e"], 1)`, wantRebuild: `REMOVE_NTH(["a", "b", "c", "d", "e"], 1)`, wantValue: jsonParse(`["a", "c", "d", "e"]`)},
- {name: "REMOVE_NTH", saql: `REMOVE_NTH(["a", "b", "c", "d", "e"], -2)`, wantRebuild: `REMOVE_NTH(["a", "b", "c", "d", "e"], -2)`, wantValue: jsonParse(`["a", "b", "c", "e"]`)},
- {name: "REPLACE_NTH", saql: `REPLACE_NTH(["a", "b", "c"], 1 , "z")`, wantRebuild: `REPLACE_NTH(["a", "b", "c"], 1, "z")`, wantValue: jsonParse(`["a", "z", "c"]`)},
- {name: "REPLACE_NTH", saql: `REPLACE_NTH(["a", "b", "c"], 3 , "z")`, wantRebuild: `REPLACE_NTH(["a", "b", "c"], 3, "z")`, wantValue: jsonParse(`["a", "b", "c", "z"]`)},
- {name: "REPLACE_NTH", saql: `REPLACE_NTH(["a", "b", "c"], 6, "z", "y")`, wantRebuild: `REPLACE_NTH(["a", "b", "c"], 6, "z", "y")`, wantValue: jsonParse(`["a", "b", "c", "y", "y", "y", "z"]`)},
- {name: "REPLACE_NTH", saql: `REPLACE_NTH(["a", "b", "c"], -1, "z")`, wantRebuild: `REPLACE_NTH(["a", "b", "c"], -1, "z")`, wantValue: jsonParse(`["a", "b", "z"]`)},
- {name: "REPLACE_NTH", saql: `REPLACE_NTH(["a", "b", "c"], -9, "z")`, wantRebuild: `REPLACE_NTH(["a", "b", "c"], -9, "z")`, wantValue: jsonParse(`["z", "b", "c"]`)},
- {name: "REMOVE_VALUE", saql: `REMOVE_VALUE(["a", "b", "b", "a", "c"], "a")`, wantRebuild: `REMOVE_VALUE(["a", "b", "b", "a", "c"], "a")`, wantValue: jsonParse(`["b", "b", "c"]`)},
- {name: "REMOVE_VALUE", saql: `REMOVE_VALUE(["a", "b", "b", "a", "c"], "a", 1)`, wantRebuild: `REMOVE_VALUE(["a", "b", "b", "a", "c"], "a", 1)`, wantValue: jsonParse(`["b", "b", "a", "c"]`)},
- {name: "REMOVE_VALUES", saql: `REMOVE_VALUES(["a", "a", "b", "c", "d", "e", "f"], ["a", "f", "d"])`, wantRebuild: `REMOVE_VALUES(["a", "a", "b", "c", "d", "e", "f"], ["a", "f", "d"])`, wantValue: jsonParse(`["b", "c", "e"]`)},
- {name: "REVERSE", saql: `REVERSE ([2,4,6,8,10])`, wantRebuild: `REVERSE([2, 4, 6, 8, 10])`, wantValue: jsonParse(`[10, 8, 6, 4, 2]`)},
- {name: "SHIFT", saql: `SHIFT([1, 2, 3, 4])`, wantRebuild: `SHIFT([1, 2, 3, 4])`, wantValue: jsonParse(`[2, 3, 4]`)},
- {name: "SHIFT", saql: `SHIFT([1])`, wantRebuild: `SHIFT([1])`, wantValue: jsonParse(`[]`)},
- {name: "SLICE", saql: `SLICE([1, 2, 3, 4, 5], 0, 1)`, wantRebuild: `SLICE([1, 2, 3, 4, 5], 0, 1)`, wantValue: jsonParse(`[1]`)},
- {name: "SLICE", saql: `SLICE([1, 2, 3, 4, 5], 1, 2)`, wantRebuild: `SLICE([1, 2, 3, 4, 5], 1, 2)`, wantValue: jsonParse(`[2, 3]`)},
- {name: "SLICE", saql: `SLICE([1, 2, 3, 4, 5], 3)`, wantRebuild: `SLICE([1, 2, 3, 4, 5], 3)`, wantValue: jsonParse(`[4, 5]`)},
- {name: "SLICE", saql: `SLICE([1, 2, 3, 4, 5], 1, -1)`, wantRebuild: `SLICE([1, 2, 3, 4, 5], 1, -1)`, wantValue: jsonParse(`[2, 3, 4]`)},
- {name: "SLICE", saql: `SLICE([1, 2, 3, 4, 5], 0, -2)`, wantRebuild: `SLICE([1, 2, 3, 4, 5], 0, -2)`, wantValue: jsonParse(`[1, 2, 3]`)},
- {name: "SLICE", saql: `SLICE([1, 2, 3, 4, 5], -3, 2)`, wantRebuild: `SLICE([1, 2, 3, 4, 5], -3, 2)`, wantValue: jsonParse(`[3, 4]`)},
- {name: "SORTED", saql: `SORTED([8,4,2,10,6])`, wantRebuild: `SORTED([8, 4, 2, 10, 6])`, wantValue: jsonParse(`[2, 4, 6, 8, 10]`)},
- {name: "SORTED_UNIQUE", saql: `SORTED_UNIQUE([8,4,2,10,6,2,8,6,4])`, wantRebuild: `SORTED_UNIQUE([8, 4, 2, 10, 6, 2, 8, 6, 4])`, wantValue: jsonParse(`[2, 4, 6, 8, 10]`)},
- {name: "UNION", saql: `UNION([1, 2, 3], [1, 2])`, wantRebuild: `UNION([1, 2, 3], [1, 2])`, wantValue: jsonParse(`[1, 1, 2, 2, 3]`)},
- {name: "UNION_DISTINCT", saql: `UNION_DISTINCT([1, 2, 3], [1, 2])`, wantRebuild: `UNION_DISTINCT([1, 2, 3], [1, 2])`, wantValue: jsonParse(`[1, 2, 3]`)},
- {name: "UNIQUE", saql: `UNIQUE([1,2,2,3,3,3,4,4,4,4,5,5,5,5,5])`, wantRebuild: `UNIQUE([1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5])`, wantValue: jsonParse(`[1, 2, 3, 4, 5]`)},
- {name: "UNSHIFT", saql: `UNSHIFT([1, 2, 3], 4)`, wantRebuild: `UNSHIFT([1, 2, 3], 4)`, wantValue: jsonParse(`[4, 1, 2, 3]`)},
- {name: "UNSHIFT", saql: `UNSHIFT([1, 2, 3], 2, true)`, wantRebuild: `UNSHIFT([1, 2, 3], 2, true)`, wantValue: jsonParse(`[1, 2, 3]`)},
-
- // https://www.arangodb.com/docs/3.7/aql/functions-bit.html
- // {name: "BIT_CONSTRUCT", saql: `BIT_CONSTRUCT([1, 2, 3])`, wantRebuild: `BIT_CONSTRUCT([1, 2, 3])`, wantValue: 14},
- // {name: "BIT_CONSTRUCT", saql: `BIT_CONSTRUCT([0, 4, 8])`, wantRebuild: `BIT_CONSTRUCT([0, 4, 8])`, wantValue: 273},
- // {name: "BIT_CONSTRUCT", saql: `BIT_CONSTRUCT([0, 1, 10, 31])`, wantRebuild: `BIT_CONSTRUCT([0, 1, 10, 31])`, wantValue: 2147484675},
- // {name: "BIT_DECONSTRUCT", saql: `BIT_DECONSTRUCT(14)`, wantRebuild: `BIT_DECONSTRUCT(14) `, wantValue: []interface{}{1, 2, 3}},
- // {name: "BIT_DECONSTRUCT", saql: `BIT_DECONSTRUCT(273)`, wantRebuild: `BIT_DECONSTRUCT(273)`, wantValue: []interface{}{0, 4, 8}},
- // {name: "BIT_DECONSTRUCT", saql: `BIT_DECONSTRUCT(2147484675)`, wantRebuild: `BIT_DECONSTRUCT(2147484675)`, wantValue: []interface{}{0, 1, 10, 31}},
- // {name: "BIT_FROM_STRING", saql: `BIT_FROM_STRING("0111")`, wantRebuild: `BIT_FROM_STRING("0111")`, wantValue: 7},
- // {name: "BIT_FROM_STRING", saql: `BIT_FROM_STRING("000000000000010")`, wantRebuild: `BIT_FROM_STRING("000000000000010")`, wantValue: 2},
- // {name: "BIT_FROM_STRING", saql: `BIT_FROM_STRING("11010111011101")`, wantRebuild: `BIT_FROM_STRING("11010111011101")`, wantValue: 13789},
- // {name: "BIT_FROM_STRING", saql: `BIT_FROM_STRING("100000000000000000000")`, wantRebuild: `BIT_FROM_STRING("100000000000000000000")`, wantValue: 1048756},
- // {name: "BIT_NEGATE", saql: `BIT_NEGATE(0, 8)`, wantRebuild: `BIT_NEGATE(0, 8)`, wantValue: 255},
- // {name: "BIT_NEGATE", saql: `BIT_NEGATE(0, 10)`, wantRebuild: `BIT_NEGATE(0, 10)`, wantValue: 1023},
- // {name: "BIT_NEGATE", saql: `BIT_NEGATE(3, 4)`, wantRebuild: `BIT_NEGATE(3, 4)`, wantValue: 12},
- // {name: "BIT_NEGATE", saql: `BIT_NEGATE(446359921, 32)`, wantRebuild: `BIT_NEGATE(446359921, 32)`, wantValue: 3848607374},
- // {name: "BIT_OR", saql: `BIT_OR([1, 4, 8, 16])`, wantRebuild: `BIT_OR([1, 4, 8, 16])`, wantValue: 29},
- // {name: "BIT_OR", saql: `BIT_OR([3, 7, 63])`, wantRebuild: `BIT_OR([3, 7, 63])`, wantValue: 63},
- // {name: "BIT_OR", saql: `BIT_OR([255, 127, null, 63])`, wantRebuild: `BIT_OR([255, 127, null, 63])`, wantValue: 255},
- // {name: "BIT_OR", saql: `BIT_OR(255, 127)`, wantRebuild: `BIT_OR(255, 127)`, wantValue: 255},
- // {name: "BIT_OR", saql: `BIT_OR("foo")`, wantRebuild: `BIT_OR("foo")`, wantValue: nil},
- // {name: "BIT_POPCOUNT", saql: `BIT_POPCOUNT(0)`, wantRebuild: `BIT_POPCOUNT(0)`, wantValue: 0},
- // {name: "BIT_POPCOUNT", saql: `BIT_POPCOUNT(255)`, wantRebuild: `BIT_POPCOUNT(255)`, wantValue: 8},
- // {name: "BIT_POPCOUNT", saql: `BIT_POPCOUNT(69399252)`, wantRebuild: `BIT_POPCOUNT(69399252)`, wantValue: 12},
- // {name: "BIT_POPCOUNT", saql: `BIT_POPCOUNT("foo")`, wantRebuild: `BIT_POPCOUNT("foo")`, wantValue: nil},
- // {name: "BIT_SHIFT_LEFT", saql: `BIT_SHIFT_LEFT(0, 1, 8)`, wantRebuild: `BIT_SHIFT_LEFT(0, 1, 8)`, wantValue: 0},
- // {name: "BIT_SHIFT_LEFT", saql: `BIT_SHIFT_LEFT(7, 1, 16)`, wantRebuild: `BIT_SHIFT_LEFT(7, 1, 16)`, wantValue: 14},
- // {name: "BIT_SHIFT_LEFT", saql: `BIT_SHIFT_LEFT(2, 10, 16)`, wantRebuild: `BIT_SHIFT_LEFT(2, 10, 16)`, wantValue: 2048},
- // {name: "BIT_SHIFT_LEFT", saql: `BIT_SHIFT_LEFT(878836, 16, 32)`, wantRebuild: `BIT_SHIFT_LEFT(878836, 16, 32)`, wantValue: 1760821248},
- // {name: "BIT_SHIFT_RIGHT", saql: `BIT_SHIFT_RIGHT(0, 1, 8)`, wantRebuild: `BIT_SHIFT_RIGHT(0, 1, 8)`, wantValue: 0},
- // {name: "BIT_SHIFT_RIGHT", saql: `BIT_SHIFT_RIGHT(33, 1, 16)`, wantRebuild: `BIT_SHIFT_RIGHT(33, 1, 16)`, wantValue: 16},
- // {name: "BIT_SHIFT_RIGHT", saql: `BIT_SHIFT_RIGHT(65536, 13, 16)`, wantRebuild: `BIT_SHIFT_RIGHT(65536, 13, 16)`, wantValue: 8},
- // {name: "BIT_SHIFT_RIGHT", saql: `BIT_SHIFT_RIGHT(878836, 4, 32)`, wantRebuild: `BIT_SHIFT_RIGHT(878836, 4, 32)`, wantValue: 54927},
- // {name: "BIT_TEST", saql: `BIT_TEST(0, 3)`, wantRebuild: `BIT_TEST(0, 3)`, wantValue: false},
- // {name: "BIT_TEST", saql: `BIT_TEST(255, 0)`, wantRebuild: `BIT_TEST(255, 0)`, wantValue: true},
- // {name: "BIT_TEST", saql: `BIT_TEST(7, 2)`, wantRebuild: `BIT_TEST(7, 2)`, wantValue: true},
- // {name: "BIT_TEST", saql: `BIT_TEST(255, 8)`, wantRebuild: `BIT_TEST(255, 8)`, wantValue: false},
- // {name: "BIT_TO_STRING", saql: `BIT_TO_STRING(7, 4)`, wantRebuild: `BIT_TO_STRING(7, 4)`, wantValue: "0111"},
- // {name: "BIT_TO_STRING", saql: `BIT_TO_STRING(255, 8)`, wantRebuild: `BIT_TO_STRING(255, 8)`, wantValue: "11111111"},
- // {name: "BIT_TO_STRING", saql: `BIT_TO_STRING(60, 8)`, wantRebuild: `BIT_TO_STRING(60, 8)`, wantValue: "00011110"},
- // {name: "BIT_TO_STRING", saql: `BIT_TO_STRING(1048576, 32)`, wantRebuild: `BIT_TO_STRING(1048576, 32)`, wantValue: "00000000000100000000000000000000"},
- // {name: "BIT_XOR", saql: `BIT_XOR([1, 4, 8, 16])`, wantRebuild: `BIT_XOR([1, 4, 8, 16])`, wantValue: 29},
- // {name: "BIT_XOR", saql: `BIT_XOR([3, 7, 63])`, wantRebuild: `BIT_XOR([3, 7, 63])`, wantValue: 59},
- // {name: "BIT_XOR", saql: `BIT_XOR([255, 127, null, 63])`, wantRebuild: `BIT_XOR([255, 127, null, 63])`, wantValue: 191},
- // {name: "BIT_XOR", saql: `BIT_XOR(255, 257)`, wantRebuild: `BIT_XOR(255, 257)`, wantValue: 510},
- // {name: "BIT_XOR", saql: `BIT_XOR("foo")`, wantRebuild: `BIT_XOR("foo")`, wantValue: nil},
-
- // https://www.arangodb.com/docs/3.7/aql/functions-date.html
- // DATE_TIMESTAMP("2014-05-07T14:19:09.522")
- // DATE_TIMESTAMP("2014-05-07T14:19:09.522Z")
- // DATE_TIMESTAMP("2014-05-07 14:19:09.522")
- // DATE_TIMESTAMP("2014-05-07 14:19:09.522Z")
- // DATE_TIMESTAMP(2014, 5, 7, 14, 19, 9, 522)
- // DATE_TIMESTAMP(1399472349522)
- // DATE_ISO8601("2014-05-07T14:19:09.522Z")
- // DATE_ISO8601("2014-05-07 14:19:09.522Z")
- // DATE_ISO8601(2014, 5, 7, 14, 19, 9, 522)
- // DATE_ISO8601(1399472349522)
- // {name: "DATE_TIMESTAMP", saql: `DATE_TIMESTAMP(2016, 12, -1)`, wantRebuild: `DATE_TIMESTAMP(2016, 12, -1)`, wantValue: nil},
- // {name: "DATE_TIMESTAMP", saql: `DATE_TIMESTAMP(2016, 2, 32)`, wantRebuild: `DATE_TIMESTAMP(2016, 2, 32)`, wantValue: 1456963200000},
- // {name: "DATE_TIMESTAMP", saql: `DATE_TIMESTAMP(1970, 1, 1, 26)`, wantRebuild: `DATE_TIMESTAMP(1970, 1, 1, 26)`, wantValue: 93600000},
- // {name: "DATE_TRUNC", saql: `DATE_TRUNC('2017-02-03', 'month')`, wantRebuild: `DATE_TRUNC('2017-02-03', 'month')`, wantValue: "2017-02-01T00:00:00.000Z"},
- // {name: "DATE_TRUNC", saql: `DATE_TRUNC('2017-02-03 04:05:06', 'hours')`, wantRebuild: `DATE_TRUNC('2017-02-03 04:05:06', 'hours')`, wantValue: "2017-02-03 04:00:00.000Z"},
- // {name: "DATE_ROUND", saql: `DATE_ROUND('2000-04-28T11:11:11.111Z', 1, 'day')`, wantRebuild: `DATE_ROUND('2000-04-28T11:11:11.111Z', 1, 'day')`, wantValue: "2000-04-28T00:00:00.000Z"},
- // {name: "DATE_ROUND", saql: `DATE_ROUND('2000-04-10T11:39:29Z', 15, 'minutes')`, wantRebuild: `DATE_ROUND('2000-04-10T11:39:29Z', 15, 'minutes')`, wantValue: "2000-04-10T11:30:00.000Z"},
- // {name: "DATE_FORMAT", saql: `DATE_FORMAT(DATE_NOW(), "%q/%yyyy")`, wantRebuild: `DATE_FORMAT(DATE_NOW(), "%q/%yyyy")`},
- // {name: "DATE_FORMAT", saql: `DATE_FORMAT(DATE_NOW(), "%dd.%mm.%yyyy %hh:%ii:%ss,%fff")`, wantRebuild: `DATE_FORMAT(DATE_NOW(), "%dd.%mm.%yyyy %hh:%ii:%ss,%fff")`, wantValue: "18.09.2015 15:30:49,374"},
- // {name: "DATE_FORMAT", saql: `DATE_FORMAT("1969", "Summer of '%yy")`, wantRebuild: `DATE_FORMAT("1969", "Summer of '%yy")`, wantValue: "Summer of '69"},
- // {name: "DATE_FORMAT", saql: `DATE_FORMAT("2016", "%%l = %l")`, wantRebuild: `DATE_FORMAT("2016", "%%l = %l")`, wantValue: "%l = 1"},
- // {name: "DATE_FORMAT", saql: `DATE_FORMAT("2016-03-01", "%xxx%")`, wantRebuild: `DATE_FORMAT("2016-03-01", "%xxx%")`, wantValue: "063, trailing % ignored"},
- // {name: "DATE_ADD", saql: `DATE_ADD(DATE_NOW(), -1, "day")`, wantRebuild: `DATE_ADD(DATE_NOW(), -1, "day")`, wantValue: "yesterday; also see DATE_SUBTRACT()"},
- // {name: "DATE_ADD", saql: `DATE_ADD(DATE_NOW(), 3, "months")`, wantRebuild: `DATE_ADD(DATE_NOW(), 3, "months")`, wantValue: "in three months"},
- // {name: "DATE_ADD", saql: `DATE_ADD(DATE_ADD("2015-04-01", 5, "years"), 1, "month")`, wantRebuild: `DATE_ADD(DATE_ADD("2015-04-01", 5, "years"), 1, "month")`, wantValue: "May 1st 2020"},
- // {name: "DATE_ADD", saql: `DATE_ADD("2015-04-01", 12*5 + 1, "months")`, wantRebuild: `DATE_ADD("2015-04-01", 12*5 + 1, "months")`, wantValue: "also May 1st 2020"},
- // {name: "DATE_ADD", saql: `DATE_ADD(DATE_TIMESTAMP(DATE_YEAR(DATE_NOW()), 12, 24), -4, "years")`, wantRebuild: `DATE_ADD(DATE_TIMESTAMP(DATE_YEAR(DATE_NOW()), 12, 24), -4, "years")`, wantValue: "Christmas four years ago"},
- // {name: "DATE_ADD", saql: `DATE_ADD(DATE_ADD("2016-02", "month", 1), -1, "day")`, wantRebuild: `DATE_ADD(DATE_ADD("2016-02", "month", 1), -1, "day")`, wantValue: "last day of February (29th, because 2016 is a leap year!)"},
- // {name: "DATE_ADD", saql: `DATE_ADD(DATE_NOW(), "P1Y")`, wantRebuild: `DATE_ADD(DATE_NOW(), "P1Y")`},
- // {name: "DATE_ADD", saql: `DATE_ADD(DATE_NOW(), "P3M2W")`, wantRebuild: `DATE_ADD(DATE_NOW(), "P3M2W")`},
- // {name: "DATE_ADD", saql: `DATE_ADD(DATE_NOW(), "P5DT26H")`, wantRebuild: `DATE_ADD(DATE_NOW(), "P5DT26H")`},
- // {name: "DATE_ADD", saql: `DATE_ADD("2000-01-01", "PT4H")`, wantRebuild: `DATE_ADD("2000-01-01", "PT4H")`},
- // {name: "DATE_ADD", saql: `DATE_ADD("2000-01-01", "PT30M44.4S"`, wantRebuild: `DATE_ADD("2000-01-01", "PT30M44.4S"`},
- // {name: "DATE_ADD", saql: `DATE_ADD("2000-01-01", "P1Y2M3W4DT5H6M7.89S"`, wantRebuild: `DATE_ADD("2000-01-01", "P1Y2M3W4DT5H6M7.89S"`},
- // {name: "DATE_SUBTRACT", saql: `DATE_SUBTRACT(DATE_NOW(), 1, "day")`, wantRebuild: `DATE_SUBTRACT(DATE_NOW(), 1, "day")`},
- // {name: "DATE_SUBTRACT", saql: `DATE_SUBTRACT(DATE_TIMESTAMP(DATE_YEAR(DATE_NOW()), 12, 24), 4, "years")`, wantRebuild: `DATE_SUBTRACT(DATE_TIMESTAMP(DATE_YEAR(DATE_NOW()), 12, 24), 4, "years")`},
- // {name: "DATE_SUBTRACT", saql: `DATE_SUBTRACT(DATE_ADD("2016-02", "month", 1), 1, "day")`, wantRebuild: `DATE_SUBTRACT(DATE_ADD("2016-02", "month", 1), 1, "day")`},
- // {name: "DATE_SUBTRACT", saql: `DATE_SUBTRACT(DATE_NOW(), "P4D")`, wantRebuild: `DATE_SUBTRACT(DATE_NOW(), "P4D")`},
- // {name: "DATE_SUBTRACT", saql: `DATE_SUBTRACT(DATE_NOW(), "PT1H3M")`, wantRebuild: `DATE_SUBTRACT(DATE_NOW(), "PT1H3M")`},
- // DATE_COMPARE("1985-04-04", DATE_NOW(), "months", "days")
- // DATE_COMPARE("1984-02-29", DATE_NOW(), "months", "days")
- // DATE_COMPARE("2001-01-01T15:30:45.678Z", "2001-01-01T08:08:08.008Z", "years", "days")
-
- // https://www.arangodb.com/docs/3.7/aql/functions-document.html
- {name: "ATTRIBUTES", saql: `ATTRIBUTES({"foo": "bar", "_key": "123", "_custom": "yes"})`, wantRebuild: `ATTRIBUTES({"foo": "bar", "_key": "123", "_custom": "yes"})`, wantValue: jsonParse(`["_custom", "_key", "foo"]`)},
- {name: "ATTRIBUTES", saql: `ATTRIBUTES({"foo": "bar", "_key": "123", "_custom": "yes"}, true)`, wantRebuild: `ATTRIBUTES({"foo": "bar", "_key": "123", "_custom": "yes"}, true)`, wantValue: jsonParse(`["foo"]`)},
- {name: "ATTRIBUTES", saql: `ATTRIBUTES({"foo": "bar", "_key": "123", "_custom": "yes"}, false, true)`, wantRebuild: `ATTRIBUTES({"foo": "bar", "_key": "123", "_custom": "yes"}, false, true)`, wantValue: jsonParse(`["_custom", "_key", "foo"]`)},
- {name: "HAS", saql: `HAS({name: "Jane"}, "name")`, wantRebuild: `HAS({name: "Jane"}, "name")`, wantValue: true},
- {name: "HAS", saql: `HAS({name: "Jane"}, "age")`, wantRebuild: `HAS({name: "Jane"}, "age")`, wantValue: false},
- {name: "HAS", saql: `HAS({name: null}, "name")`, wantRebuild: `HAS({name: null}, "name")`, wantValue: true},
- // KEEP(doc, "firstname", "name", "likes")
- // KEEP(doc, ["firstname", "name", "likes"])
- // MATCHES({name: "jane", age: 27, active: true}, {age: 27, active: true})
- // MATCHES({"test": 1}, [{"test": 1, "foo": "bar"}, {"foo": 1}, {"test": 1}], true)
- {name: "MERGE", saql: `MERGE({"user1": {"name": "Jane"}}, {"user2": {"name": "Tom"}})`, wantRebuild: `MERGE({"user1": {"name": "Jane"}}, {"user2": {"name": "Tom"}})`, wantValue: jsonParse(`{"user1": {"name": "Jane"}, "user2": {"name": "Tom"}}`)},
- {name: "MERGE", saql: `MERGE({"users": {"name": "Jane"}}, {"users": {"name": "Tom"}})`, wantRebuild: `MERGE({"users": {"name": "Jane"}}, {"users": {"name": "Tom"}})`, wantValue: jsonParse(`{"users": {"name": "Tom"}}`)},
- {name: "MERGE", saql: `MERGE([{foo: "bar"}, {quux: "quetzalcoatl", ruled: true}, {bar: "baz", foo: "done"}])`, wantRebuild: `MERGE([{foo: "bar"}, {quux: "quetzalcoatl", ruled: true}, {bar: "baz", foo: "done"}])`, wantValue: jsonParse(`{"foo": "done", "quux": "quetzalcoatl", "ruled": true, "bar": "baz"}`)},
- {name: "MERGE_RECURSIVE", saql: `MERGE_RECURSIVE({"user-1": {"name": "Jane", "livesIn": {"city": "LA"}}}, {"user-1": {"age": 42, "livesIn": {"state": "CA"}}})`, wantRebuild: `MERGE_RECURSIVE({"user-1": {"name": "Jane", "livesIn": {"city": "LA"}}}, {"user-1": {"age": 42, "livesIn": {"state": "CA"}}})`, wantValue: jsonParse(`{"user-1": {"name": "Jane", "livesIn": {"city": "LA", "state": "CA"}, "age": 42}}`)},
- // {name: "TRANSLATE", saql: `TRANSLATE("FR", {US: "United States", UK: "United Kingdom", FR: "France"})`, wantRebuild: `TRANSLATE("FR", {US: "United States", UK: "United Kingdom", FR: "France"})`, wantValue: "France"},
- // {name: "TRANSLATE", saql: `TRANSLATE(42, {foo: "bar", bar: "baz"})`, wantRebuild: `TRANSLATE(42, {foo: "bar", bar: "baz"})`, wantValue: 42},
- // {name: "TRANSLATE", saql: `TRANSLATE(42, {foo: "bar", bar: "baz"}, "not found!")`, wantRebuild: `TRANSLATE(42, {foo: "bar", bar: "baz"}, "not found!")`, wantValue: "not found!"},
- // UNSET(doc, "_id", "_key", "foo", "bar")
- // UNSET(doc, ["_id", "_key", "foo", "bar"])
- // UNSET_RECURSIVE(doc, "_id", "_key", "foo", "bar")
- // UNSET_RECURSIVE(doc, ["_id", "_key", "foo", "bar"])
- {name: "VALUES", saql: `VALUES({"_key": "users/jane", "name": "Jane", "age": 35})`, wantRebuild: `VALUES({"_key": "users/jane", "name": "Jane", "age": 35})`, wantValue: jsonParse(`[35, "Jane", "users/jane"]`)},
- {name: "VALUES", saql: `VALUES({"_key": "users/jane", "name": "Jane", "age": 35}, true)`, wantRebuild: `VALUES({"_key": "users/jane", "name": "Jane", "age": 35}, true)`, wantValue: jsonParse(`[35, "Jane"]`)},
- // {name: "ZIP", saql: `ZIP(["name", "active", "hobbies"], ["some user", true, ["swimming", "riding"]])`, wantRebuild: `ZIP(["name", "active", "hobbies"], ["some user", true, ["swimming", "riding"]])`, wantValue: jsonParse(`{"name": "some user", "active": true, "hobbies": ["swimming", "riding"]}`)},
-
- // https://www.arangodb.com/docs/3.7/aql/functions-numeric.html
- {name: "ABS", saql: `ABS(-5)`, wantRebuild: `ABS(-5)`, wantValue: 5},
- {name: "ABS", saql: `ABS(+5)`, wantRebuild: `ABS(5)`, wantValue: 5},
- {name: "ABS", saql: `ABS(3.5)`, wantRebuild: `ABS(3.5)`, wantValue: 3.5},
- {name: "ACOS", saql: `ACOS(-1)`, wantRebuild: `ACOS(-1)`, wantValue: 3.141592653589793},
- {name: "ACOS", saql: `ACOS(0)`, wantRebuild: `ACOS(0)`, wantValue: 1.5707963267948966},
- {name: "ACOS", saql: `ACOS(1)`, wantRebuild: `ACOS(1)`, wantValue: 0},
- {name: "ACOS", saql: `ACOS(2)`, wantRebuild: `ACOS(2)`, wantValue: nil},
- {name: "ASIN", saql: `ASIN(1)`, wantRebuild: `ASIN(1)`, wantValue: 1.5707963267948966},
- {name: "ASIN", saql: `ASIN(0)`, wantRebuild: `ASIN(0)`, wantValue: 0},
- {name: "ASIN", saql: `ASIN(-1)`, wantRebuild: `ASIN(-1)`, wantValue: -1.5707963267948966},
- {name: "ASIN", saql: `ASIN(2)`, wantRebuild: `ASIN(2)`, wantValue: nil},
- {name: "ATAN", saql: `ATAN(-1)`, wantRebuild: `ATAN(-1)`, wantValue: -0.7853981633974483},
- {name: "ATAN", saql: `ATAN(0)`, wantRebuild: `ATAN(0)`, wantValue: 0},
- {name: "ATAN", saql: `ATAN(10)`, wantRebuild: `ATAN(10)`, wantValue: 1.4711276743037347},
- {name: "AVERAGE", saql: `AVERAGE([5, 2, 9, 2])`, wantRebuild: `AVERAGE([5, 2, 9, 2])`, wantValue: 4.5},
- {name: "AVERAGE", saql: `AVERAGE([-3, -5, 2])`, wantRebuild: `AVERAGE([-3, -5, 2])`, wantValue: -2},
- {name: "AVERAGE", saql: `AVERAGE([999, 80, 4, 4, 4, 3, 3, 3])`, wantRebuild: `AVERAGE([999, 80, 4, 4, 4, 3, 3, 3])`, wantValue: 137.5},
- {name: "CEIL", saql: `CEIL(2.49)`, wantRebuild: `CEIL(2.49)`, wantValue: 3},
- {name: "CEIL", saql: `CEIL(2.50)`, wantRebuild: `CEIL(2.50)`, wantValue: 3},
- {name: "CEIL", saql: `CEIL(-2.50)`, wantRebuild: `CEIL(-2.50)`, wantValue: -2},
- {name: "CEIL", saql: `CEIL(-2.51)`, wantRebuild: `CEIL(-2.51)`, wantValue: -2},
- {name: "COS", saql: `COS(1)`, wantRebuild: `COS(1)`, wantValue: 0.5403023058681398},
- {name: "COS", saql: `COS(0)`, wantRebuild: `COS(0)`, wantValue: 1},
- {name: "COS", saql: `COS(-3.141592653589783)`, wantRebuild: `COS(-3.141592653589783)`, wantValue: -1},
- {name: "COS", saql: `COS(RADIANS(45))`, wantRebuild: `COS(RADIANS(45))`, wantValue: 0.7071067811865476},
- {name: "DEGREES", saql: `DEGREES(0.7853981633974483)`, wantRebuild: `DEGREES(0.7853981633974483)`, wantValue: 45},
- {name: "DEGREES", saql: `DEGREES(0)`, wantRebuild: `DEGREES(0)`, wantValue: 0},
- {name: "DEGREES", saql: `DEGREES(3.141592653589793)`, wantRebuild: `DEGREES(3.141592653589793)`, wantValue: 180},
- {name: "EXP", saql: `EXP(1)`, wantRebuild: `EXP(1)`, wantValue: 2.718281828459045},
- {name: "EXP", saql: `EXP(10)`, wantRebuild: `EXP(10)`, wantValue: 22026.46579480671},
- {name: "EXP", saql: `EXP(0)`, wantRebuild: `EXP(0)`, wantValue: 1},
- {name: "EXP2", saql: `EXP2(16)`, wantRebuild: `EXP2(16)`, wantValue: 65536},
- {name: "EXP2", saql: `EXP2(1)`, wantRebuild: `EXP2(1)`, wantValue: 2},
- {name: "EXP2", saql: `EXP2(0)`, wantRebuild: `EXP2(0)`, wantValue: 1},
- {name: "FLOOR", saql: `FLOOR(2.49)`, wantRebuild: `FLOOR(2.49)`, wantValue: 2},
- {name: "FLOOR", saql: `FLOOR(2.50)`, wantRebuild: `FLOOR(2.50)`, wantValue: 2},
- {name: "FLOOR", saql: `FLOOR(-2.50)`, wantRebuild: `FLOOR(-2.50)`, wantValue: -3},
- {name: "FLOOR", saql: `FLOOR(-2.51)`, wantRebuild: `FLOOR(-2.51)`, wantValue: -3},
- {name: "LOG", saql: `LOG(2.718281828459045)`, wantRebuild: `LOG(2.718281828459045)`, wantValue: 1},
- {name: "LOG", saql: `LOG(10)`, wantRebuild: `LOG(10)`, wantValue: 2.302585092994046},
- {name: "LOG", saql: `LOG(0)`, wantRebuild: `LOG(0)`, wantValue: nil},
- {name: "LOG2", saql: `LOG2(1024)`, wantRebuild: `LOG2(1024)`, wantValue: 10},
- {name: "LOG2", saql: `LOG2(8)`, wantRebuild: `LOG2(8)`, wantValue: 3},
- {name: "LOG2", saql: `LOG2(0)`, wantRebuild: `LOG2(0)`, wantValue: nil},
- {name: "LOG10", saql: `LOG10(10000)`, wantRebuild: `LOG10(10000)`, wantValue: 4},
- {name: "LOG10", saql: `LOG10(10)`, wantRebuild: `LOG10(10)`, wantValue: 1},
- {name: "LOG10", saql: `LOG10(0)`, wantRebuild: `LOG10(0)`, wantValue: nil},
- {name: "MAX", saql: `MAX([5, 9, -2, null, 1])`, wantRebuild: `MAX([5, 9, -2, null, 1])`, wantValue: 9},
- {name: "MAX", saql: `MAX([null, null])`, wantRebuild: `MAX([null, null])`, wantValue: nil},
- {name: "MEDIAN", saql: `MEDIAN([1, 2, 3])`, wantRebuild: `MEDIAN([1, 2, 3])`, wantValue: 2},
- {name: "MEDIAN", saql: `MEDIAN([1, 2, 3, 4])`, wantRebuild: `MEDIAN([1, 2, 3, 4])`, wantValue: 2.5},
- {name: "MEDIAN", saql: `MEDIAN([4, 2, 3, 1])`, wantRebuild: `MEDIAN([4, 2, 3, 1])`, wantValue: 2.5},
- {name: "MEDIAN", saql: `MEDIAN([999, 80, 4, 4, 4, 3, 3, 3])`, wantRebuild: `MEDIAN([999, 80, 4, 4, 4, 3, 3, 3])`, wantValue: 4},
- {name: "MIN", saql: `MIN([5, 9, -2, null, 1])`, wantRebuild: `MIN([5, 9, -2, null, 1])`, wantValue: -2},
- {name: "MIN", saql: `MIN([null, null])`, wantRebuild: `MIN([null, null])`, wantValue: nil},
- // {name: "PERCENTILE", saql: `PERCENTILE([1, 2, 3, 4], 50)`, wantRebuild: `PERCENTILE([1, 2, 3, 4], 50)`, wantValue: 2},
- // {name: "PERCENTILE", saql: `PERCENTILE([1, 2, 3, 4], 50, "rank")`, wantRebuild: `PERCENTILE([1, 2, 3, 4], 50, "rank")`, wantValue: 2},
- // {name: "PERCENTILE", saql: `PERCENTILE([1, 2, 3, 4], 50, "interpolation")`, wantRebuild: `PERCENTILE([1, 2, 3, 4], 50, "interpolation")`, wantValue: 2.5},
- {name: "PI", saql: `PI()`, wantRebuild: `PI()`, wantValue: 3.141592653589793},
- {name: "POW", saql: `POW(2, 4)`, wantRebuild: `POW(2, 4)`, wantValue: 16},
- {name: "POW", saql: `POW(5, -1)`, wantRebuild: `POW(5, -1)`, wantValue: 0.2},
- {name: "POW", saql: `POW(5, 0)`, wantRebuild: `POW(5, 0)`, wantValue: 1},
- {name: "PRODUCT", saql: `PRODUCT([1, 2, 3, 4])`, wantRebuild: `PRODUCT([1, 2, 3, 4])`, wantValue: 24},
- {name: "PRODUCT", saql: `PRODUCT([null, -5, 6])`, wantRebuild: `PRODUCT([null, -5, 6])`, wantValue: -30},
- {name: "PRODUCT", saql: `PRODUCT([])`, wantRebuild: `PRODUCT([])`, wantValue: 1},
- {name: "RADIANS", saql: `RADIANS(180)`, wantRebuild: `RADIANS(180)`, wantValue: 3.141592653589793},
- {name: "RADIANS", saql: `RADIANS(90)`, wantRebuild: `RADIANS(90)`, wantValue: 1.5707963267948966},
- {name: "RADIANS", saql: `RADIANS(0)`, wantRebuild: `RADIANS(0)`, wantValue: 0},
- // {name: "RAND", saql: `RAND()`, wantRebuild: `RAND()`, wantValue: 0.3503170117504508},
- // {name: "RAND", saql: `RAND()`, wantRebuild: `RAND()`, wantValue: 0.6138226173882478},
- {name: "RANGE", saql: `RANGE(1, 4)`, wantRebuild: `RANGE(1, 4)`, wantValue: []any{float64(1), float64(2), float64(3), float64(4)}},
- {name: "RANGE", saql: `RANGE(1, 4, 2)`, wantRebuild: `RANGE(1, 4, 2)`, wantValue: []any{float64(1), float64(3)}},
- {name: "RANGE", saql: `RANGE(1, 4, 3)`, wantRebuild: `RANGE(1, 4, 3)`, wantValue: []any{float64(1), float64(4)}},
- {name: "RANGE", saql: `RANGE(1.5, 2.5)`, wantRebuild: `RANGE(1.5, 2.5)`, wantValue: []any{float64(1), float64(2)}},
- {name: "RANGE", saql: `RANGE(1.5, 2.5, 1)`, wantRebuild: `RANGE(1.5, 2.5, 1)`, wantValue: []any{1.5, 2.5}},
- {name: "RANGE", saql: `RANGE(1.5, 2.5, 0.5)`, wantRebuild: `RANGE(1.5, 2.5, 0.5)`, wantValue: []any{1.5, 2.0, 2.5}},
- {name: "RANGE", saql: `RANGE(-0.75, 1.1, 0.5)`, wantRebuild: `RANGE(-0.75, 1.1, 0.5)`, wantValue: []any{-0.75, -0.25, 0.25, 0.75}},
- {name: "ROUND", saql: `ROUND(2.49)`, wantRebuild: `ROUND(2.49)`, wantValue: 2},
- {name: "ROUND", saql: `ROUND(2.50)`, wantRebuild: `ROUND(2.50)`, wantValue: 3},
- {name: "ROUND", saql: `ROUND(-2.50)`, wantRebuild: `ROUND(-2.50)`, wantValue: -2},
- {name: "ROUND", saql: `ROUND(-2.51)`, wantRebuild: `ROUND(-2.51)`, wantValue: -3},
- {name: "SQRT", saql: `SQRT(9)`, wantRebuild: `SQRT(9)`, wantValue: 3},
- {name: "SQRT", saql: `SQRT(2)`, wantRebuild: `SQRT(2)`, wantValue: 1.4142135623730951},
- {name: "POW", saql: `POW(4096, 1/4)`, wantRebuild: `POW(4096, 1 / 4)`, wantValue: 8},
- {name: "POW", saql: `POW(27, 1/3)`, wantRebuild: `POW(27, 1 / 3)`, wantValue: 3},
- {name: "POW", saql: `POW(9, 1/2)`, wantRebuild: `POW(9, 1 / 2)`, wantValue: 3},
- // {name: "STDDEV_POPULATION", saql: `STDDEV_POPULATION([1, 3, 6, 5, 2])`, wantRebuild: `STDDEV_POPULATION([1, 3, 6, 5, 2])`, wantValue: 1.854723699099141},
- // {name: "STDDEV_SAMPLE", saql: `STDDEV_SAMPLE([1, 3, 6, 5, 2])`, wantRebuild: `STDDEV_SAMPLE([1, 3, 6, 5, 2])`, wantValue: 2.0736441353327724},
- {name: "SUM", saql: `SUM([1, 2, 3, 4])`, wantRebuild: `SUM([1, 2, 3, 4])`, wantValue: 10},
- {name: "SUM", saql: `SUM([null, -5, 6])`, wantRebuild: `SUM([null, -5, 6])`, wantValue: 1},
- {name: "SUM", saql: `SUM([])`, wantRebuild: `SUM([])`, wantValue: 0},
- {name: "TAN", saql: `TAN(10)`, wantRebuild: `TAN(10)`, wantValue: 0.6483608274590866},
- {name: "TAN", saql: `TAN(5)`, wantRebuild: `TAN(5)`, wantValue: -3.380515006246586},
- {name: "TAN", saql: `TAN(0)`, wantRebuild: `TAN(0)`, wantValue: 0},
- // {name: "VARIANCE_POPULATION", saql: `VARIANCE_POPULATION([1, 3, 6, 5, 2])`, wantRebuild: `VARIANCE_POPULATION([1, 3, 6, 5, 2])`, wantValue: 3.4400000000000004},
- // {name: "VARIANCE_SAMPLE", saql: `VARIANCE_SAMPLE([1, 3, 6, 5, 2])`, wantRebuild: `VARIANCE_SAMPLE([1, 3, 6, 5, 2])`, wantValue: 4.300000000000001},
-
- // Errors
- {name: "Function Error 1", saql: "UNKNOWN(value)", wantRebuild: "UNKNOWN(value)", wantRebuildErr: true, wantEvalErr: true, values: `{"value": true}`},
- {name: "Function Error 2", saql: "ABS(value, value2)", wantRebuild: "ABS(value, value2)", wantEvalErr: true, values: `{"value": true, "value2": false}`},
- {name: "Function Error 3", saql: `ABS("abs")`, wantRebuild: `ABS("abs")`, wantEvalErr: true},
- }
- for _, tt := range tests {
- tt := tt
-
- parser := &caql.Parser{}
-
- t.Run(tt.name, func(t *testing.T) {
- t.Parallel()
-
- expr, err := parser.Parse(tt.saql)
- if (err != nil) != tt.wantParseErr {
- t.Errorf("Parse() error = %v, wantErr %v", err, tt.wantParseErr)
- if expr != nil {
- t.Error(expr.String())
- }
-
- return
- }
- if err != nil {
- return
- }
-
- got, err := expr.String()
- if (err != nil) != tt.wantRebuildErr {
- t.Error(expr.String())
- t.Errorf("String() error = %v, wantErr %v", err, tt.wantParseErr)
-
- return
- }
- if err != nil {
- return
- }
- if got != tt.wantRebuild {
- t.Errorf("String() got = %v, want %v", got, tt.wantRebuild)
- }
-
- var myJSON map[string]any
- if tt.values != "" {
- err = json.Unmarshal([]byte(tt.values), &myJSON)
- if err != nil {
- t.Fatal(err)
- }
- }
-
- value, err := expr.Eval(myJSON)
- if (err != nil) != tt.wantEvalErr {
- t.Error(expr.String())
- t.Errorf("Parse() error = %v, wantErr %v", err, tt.wantParseErr)
-
- return
- }
- if err != nil {
- return
- }
-
- wantValue := tt.wantValue
- if i, ok := wantValue.(int); ok {
- wantValue = float64(i)
- }
-
- valueFloat, ok := value.(float64)
- wantValueFloat, ok2 := wantValue.(float64)
- if ok && ok2 {
- if math.Abs(valueFloat-wantValueFloat) > 0.0001 {
- t.Error(expr.String())
- t.Errorf("Eval() got = %T %#v, want %T %#v", value, value, wantValue, wantValue)
- }
- } else {
- if !reflect.DeepEqual(value, wantValue) {
- t.Error(expr.String())
- t.Errorf("Eval() got = %T %#v, want %T %#v", value, value, wantValue, wantValue)
- }
- }
- })
- }
-}
-
-func jsonParse(s string) any {
- if s == "" {
- return nil
- }
- var j any
- err := json.Unmarshal([]byte(s), &j)
- if err != nil {
- panic(s + err.Error())
- }
-
- return j
-}
diff --git a/caql/interpreter.go b/caql/interpreter.go
deleted file mode 100644
index 73749c0..0000000
--- a/caql/interpreter.go
+++ /dev/null
@@ -1,351 +0,0 @@
-package caql
-
-import (
- "fmt"
- "strconv"
- "strings"
-
- "github.com/SecurityBrewery/catalyst/generated/caql/parser"
-)
-
-type aqlInterpreter struct {
- *parser.BaseCAQLParserListener
- values map[string]any
- stack []any
- errs []error
-}
-
-// push is a helper function for pushing new node to the listener Stack.
-func (s *aqlInterpreter) push(i any) {
- s.stack = append(s.stack, i)
-}
-
-// pop is a helper function for poping a node from the listener Stack.
-func (s *aqlInterpreter) pop() (n any) {
- // Check that we have nodes in the stack.
- size := len(s.stack)
- if size < 1 {
- s.appendErrors(ErrStack)
-
- return
- }
-
- // Pop the last value from the Stack.
- n, s.stack = s.stack[size-1], s.stack[:size-1]
-
- return
-}
-
-func (s *aqlInterpreter) binaryPop() (any, any) {
- right, left := s.pop(), s.pop()
-
- return left, right
-}
-
-// ExitExpression is called when production expression is exited.
-func (s *aqlInterpreter) ExitExpression(ctx *parser.ExpressionContext) {
- switch {
- case ctx.Value_literal() != nil:
- // pass
- case ctx.Reference() != nil:
- // pass
- case ctx.Operator_unary() != nil:
- // pass
-
- case ctx.T_PLUS() != nil:
- s.push(plus(s.binaryPop()))
- case ctx.T_MINUS() != nil:
- s.push(minus(s.binaryPop()))
- case ctx.T_TIMES() != nil:
- s.push(times(s.binaryPop()))
- case ctx.T_DIV() != nil:
- s.push(div(s.binaryPop()))
- case ctx.T_MOD() != nil:
- s.push(mod(s.binaryPop()))
- case ctx.T_RANGE() != nil:
- s.push(aqlrange(s.binaryPop()))
- case ctx.T_LT() != nil && ctx.GetEq_op() == nil:
- s.push(lt(s.binaryPop()))
- case ctx.T_GT() != nil && ctx.GetEq_op() == nil:
- s.push(gt(s.binaryPop()))
- case ctx.T_LE() != nil && ctx.GetEq_op() == nil:
- s.push(le(s.binaryPop()))
- case ctx.T_GE() != nil && ctx.GetEq_op() == nil:
- s.push(ge(s.binaryPop()))
- case ctx.T_IN() != nil && ctx.GetEq_op() == nil:
- s.push(maybeNot(ctx, in(s.binaryPop())))
- case ctx.T_EQ() != nil && ctx.GetEq_op() == nil:
- s.push(eq(s.binaryPop()))
- case ctx.T_NE() != nil && ctx.GetEq_op() == nil:
- s.push(ne(s.binaryPop()))
- case ctx.T_ALL() != nil && ctx.GetEq_op() != nil:
- right, left := s.pop(), s.pop()
- s.push(all(left.([]any), getOp(ctx.GetEq_op().GetTokenType()), right))
- case ctx.T_ANY() != nil && ctx.GetEq_op() != nil:
- right, left := s.pop(), s.pop()
- s.push(anyElement(left.([]any), getOp(ctx.GetEq_op().GetTokenType()), right))
- case ctx.T_NONE() != nil && ctx.GetEq_op() != nil:
- right, left := s.pop(), s.pop()
- s.push(none(left.([]any), getOp(ctx.GetEq_op().GetTokenType()), right))
- case ctx.T_ALL() != nil && ctx.T_NOT() != nil && ctx.T_IN() != nil:
- right, left := s.pop(), s.pop()
- s.push(all(left.([]any), in, right))
- case ctx.T_ANY() != nil && ctx.T_NOT() != nil && ctx.T_IN() != nil:
- right, left := s.pop(), s.pop()
- s.push(anyElement(left.([]any), in, right))
- case ctx.T_NONE() != nil && ctx.T_NOT() != nil && ctx.T_IN() != nil:
- right, left := s.pop(), s.pop()
- s.push(none(left.([]any), in, right))
- case ctx.T_LIKE() != nil:
- m, err := like(s.binaryPop())
- s.appendErrors(err)
- s.push(maybeNot(ctx, m))
- case ctx.T_REGEX_MATCH() != nil:
- m, err := regexMatch(s.binaryPop())
- s.appendErrors(err)
- s.push(maybeNot(ctx, m))
- case ctx.T_REGEX_NON_MATCH() != nil:
- m, err := regexNonMatch(s.binaryPop())
- s.appendErrors(err)
- s.push(maybeNot(ctx, m))
- case ctx.T_AND() != nil:
- s.push(and(s.binaryPop()))
- case ctx.T_OR() != nil:
- s.push(or(s.binaryPop()))
- case ctx.T_QUESTION() != nil && len(ctx.AllExpression()) == 3:
- right, middle, left := s.pop(), s.pop(), s.pop()
- s.push(ternary(left, middle, right))
- case ctx.T_QUESTION() != nil && len(ctx.AllExpression()) == 2:
- right, left := s.pop(), s.pop()
- s.push(ternary(left, nil, right))
- default:
- panic("unknown expression")
- }
-}
-
-func (s *aqlInterpreter) appendErrors(err error) {
- if err != nil {
- s.errs = append(s.errs, err)
- }
-}
-
-// ExitOperator_unary is called when production operator_unary is exited.
-func (s *aqlInterpreter) ExitOperator_unary(ctx *parser.Operator_unaryContext) {
- value := s.pop()
- switch {
- case ctx.T_PLUS() != nil:
- s.push(value.(float64))
- case ctx.T_MINUS() != nil:
- s.push(-value.(float64))
- case ctx.T_NOT() != nil:
- s.push(!toBool(value))
- default:
- panic(fmt.Sprintf("unexpected operation: %s", ctx.GetText()))
- }
-}
-
-// ExitReference is called when production reference is exited.
-func (s *aqlInterpreter) ExitReference(ctx *parser.ReferenceContext) {
- switch {
- case ctx.DOT() != nil:
- reference := s.pop()
-
- s.push(reference.(map[string]any)[ctx.T_STRING().GetText()])
- case ctx.T_STRING() != nil:
- s.push(s.getVar(ctx.T_STRING().GetText()))
- case ctx.Compound_value() != nil:
- // pass
- case ctx.Function_call() != nil:
- // pass
- case ctx.T_OPEN() != nil:
- // pass
- case ctx.T_ARRAY_OPEN() != nil:
- key := s.pop()
- reference := s.pop()
-
- if f, ok := key.(float64); ok {
- index := int(f)
- if index < 0 {
- index = len(reference.([]any)) + index
- }
-
- s.push(reference.([]any)[index])
-
- return
- }
-
- s.push(reference.(map[string]any)[key.(string)])
- default:
- panic(fmt.Sprintf("unexpected value: %s", ctx.GetText()))
- }
-}
-
-// ExitCompound_value is called when production compound_value is exited.
-func (s *aqlInterpreter) ExitCompound_value(_ *parser.Compound_valueContext) {
- // pass
-}
-
-// ExitFunction_call is called when production function_call is exited.
-func (s *aqlInterpreter) ExitFunction_call(ctx *parser.Function_callContext) {
- s.function(ctx)
-}
-
-// ExitValue_literal is called when production value_literal is exited.
-func (s *aqlInterpreter) ExitValue_literal(ctx *parser.Value_literalContext) {
- switch {
- case ctx.T_QUOTED_STRING() != nil:
- st, err := unquote(ctx.GetText())
- s.appendErrors(err)
- s.push(st)
- case ctx.T_INT() != nil:
- t := ctx.GetText()
-
- switch {
- case strings.HasPrefix(strings.ToLower(t), "0b"):
- i64, err := strconv.ParseInt(t[2:], 2, 64)
- s.appendErrors(err)
- s.push(float64(i64))
- case strings.HasPrefix(strings.ToLower(t), "0x"):
- i64, err := strconv.ParseInt(t[2:], 16, 64)
- s.appendErrors(err)
- s.push(float64(i64))
- default:
- i, err := strconv.Atoi(t)
- s.appendErrors(err)
- s.push(float64(i))
- }
- case ctx.T_FLOAT() != nil:
- i, err := strconv.ParseFloat(ctx.GetText(), 64)
- s.appendErrors(err)
- s.push(i)
- case ctx.T_NULL() != nil:
- s.push(nil)
- case ctx.T_TRUE() != nil:
- s.push(true)
- case ctx.T_FALSE() != nil:
- s.push(false)
- default:
- panic(fmt.Sprintf("unexpected value: %s", ctx.GetText()))
- }
-}
-
-// ExitArray is called when production array is exited.
-func (s *aqlInterpreter) ExitArray(ctx *parser.ArrayContext) {
- array := []any{}
- for range ctx.AllExpression() {
- // prepend element
- array = append([]any{s.pop()}, array...)
- }
- s.push(array)
-}
-
-// ExitObject is called when production object is exited.
-func (s *aqlInterpreter) ExitObject(ctx *parser.ObjectContext) {
- object := map[string]any{}
- for range ctx.AllObject_element() {
- key, value := s.pop(), s.pop()
-
- object[key.(string)] = value
- }
- s.push(object)
-}
-
-// ExitObject_element is called when production object_element is exited.
-func (s *aqlInterpreter) ExitObject_element(ctx *parser.Object_elementContext) {
- switch {
- case ctx.T_STRING() != nil:
- s.push(ctx.GetText())
- s.push(s.getVar(ctx.GetText()))
- case ctx.Object_element_name() != nil, ctx.T_ARRAY_OPEN() != nil:
- key, value := s.pop(), s.pop()
-
- s.push(key)
- s.push(value)
- default:
- panic(fmt.Sprintf("unexpected value: %s", ctx.GetText()))
- }
-}
-
-// ExitObject_element_name is called when production object_element_name is exited.
-func (s *aqlInterpreter) ExitObject_element_name(ctx *parser.Object_element_nameContext) {
- switch {
- case ctx.T_STRING() != nil:
- s.push(ctx.T_STRING().GetText())
- case ctx.T_QUOTED_STRING() != nil:
- st, err := unquote(ctx.T_QUOTED_STRING().GetText())
- if err != nil {
- s.appendErrors(fmt.Errorf("%w: %s", err, ctx.GetText()))
- }
- s.push(st)
- default:
- panic(fmt.Sprintf("unexpected value: %s", ctx.GetText()))
- }
-}
-
-func (s *aqlInterpreter) getVar(identifier string) any {
- v, ok := s.values[identifier]
- if !ok {
- s.appendErrors(ErrUndefined)
- }
-
- return v
-}
-
-func maybeNot(ctx *parser.ExpressionContext, m bool) bool {
- if ctx.T_NOT() != nil {
- return !m
- }
-
- return m
-}
-
-func getOp(tokenType int) func(left, right any) bool {
- switch tokenType {
- case parser.CAQLLexerT_EQ:
- return eq
- case parser.CAQLLexerT_NE:
- return ne
- case parser.CAQLLexerT_LT:
- return lt
- case parser.CAQLLexerT_GT:
- return gt
- case parser.CAQLLexerT_LE:
- return le
- case parser.CAQLLexerT_GE:
- return ge
- case parser.CAQLLexerT_IN:
- return in
- default:
- panic("unknown token type")
- }
-}
-
-func all(slice []any, op func(any, any) bool, expr any) bool {
- for _, e := range slice {
- if !op(e, expr) {
- return false
- }
- }
-
- return true
-}
-
-func anyElement(slice []any, op func(any, any) bool, expr any) bool {
- for _, e := range slice {
- if op(e, expr) {
- return true
- }
- }
-
- return false
-}
-
-func none(slice []any, op func(any, any) bool, expr any) bool {
- for _, e := range slice {
- if op(e, expr) {
- return false
- }
- }
-
- return true
-}
diff --git a/caql/operations.go b/caql/operations.go
deleted file mode 100644
index 552cb92..0000000
--- a/caql/operations.go
+++ /dev/null
@@ -1,520 +0,0 @@
-package caql
-
-import (
- "math"
- "regexp"
- "sort"
- "strconv"
- "strings"
-)
-
-// Logical operators https://www.arangodb.com/docs/3.7/aql/operators.html#logical-operators
-
-func or(left, right any) any {
- if toBool(left) {
- return left
- }
-
- return right
-}
-
-func and(left, right any) any {
- if !toBool(left) {
- return left
- }
-
- return right
-}
-
-func toBool(i any) bool {
- switch v := i.(type) {
- case nil:
- return false
- case bool:
- return v
- case int:
- return v != 0
- case float64:
- return v != 0
- case string:
- return v != ""
- case []any:
- return true
- case map[string]any:
- return true
- default:
- panic("bool conversion failed")
- }
-}
-
-// Arithmetic operators https://www.arangodb.com/docs/3.7/aql/operators.html#arithmetic-operators
-
-func plus(left, right any) float64 {
- return toNumber(left) + toNumber(right)
-}
-
-func minus(left, right any) float64 {
- return toNumber(left) - toNumber(right)
-}
-
-func times(left, right any) float64 {
- return round(toNumber(left) * toNumber(right))
-}
-
-func round(r float64) float64 {
- return math.Round(r*100000) / 100000
-}
-
-func div(left, right any) float64 {
- b := toNumber(right)
- if b == 0 {
- return 0
- }
-
- return round(toNumber(left) / b)
-}
-
-func mod(left, right any) float64 {
- return math.Mod(toNumber(left), toNumber(right))
-}
-
-func toNumber(i any) float64 {
- switch v := i.(type) {
- case nil:
- return 0
- case bool:
- if v {
- return 1
- }
-
- return 0
- case float64:
- switch {
- case math.IsNaN(v):
- return 0
- case math.IsInf(v, 0):
- return 0
- }
-
- return v
- case string:
- f, err := strconv.ParseFloat(strings.TrimSpace(v), 64)
- if err != nil {
- return 0
- }
-
- return f
- case []any:
- if len(v) == 0 {
- return 0
- }
- if len(v) == 1 {
- return toNumber(v[0])
- }
-
- return 0
- case map[string]any:
- return 0
- default:
- panic("number conversion error")
- }
-}
-
-// Logical operators https://www.arangodb.com/docs/3.7/aql/operators.html#logical-operators
-// Order https://www.arangodb.com/docs/3.7/aql/fundamentals-type-value-order.html
-
-func eq(left, right any) bool {
- leftV, rightV := typeValue(left), typeValue(right)
- if leftV != rightV {
- return false
- }
- switch l := left.(type) {
- case nil:
- return true
- case bool, float64, string:
- return left == right
- case []any:
- ra := right.([]any)
- max := len(l)
- if len(ra) > max {
- max = len(ra)
- }
- for i := 0; i < max; i++ {
- var li any
- var rai any
- if len(l) > i {
- li = l[i]
- }
- if len(ra) > i {
- rai = ra[i]
- }
-
- if !eq(li, rai) {
- return false
- }
- }
-
- return true
- case map[string]any:
- ro := right.(map[string]any)
-
- for _, key := range keys(l, ro) {
- var li any
- var rai any
- if lv, ok := l[key]; ok {
- li = lv
- }
- if rv, ok := ro[key]; ok {
- rai = rv
- }
-
- if !eq(li, rai) {
- return false
- }
- }
-
- return true
- default:
- panic("unknown type")
- }
-}
-
-func ne(left, right any) bool {
- return !eq(left, right)
-}
-
-func lt(left, right any) bool {
- leftV, rightV := typeValue(left), typeValue(right)
- if leftV != rightV {
- return leftV < rightV
- }
- switch l := left.(type) {
- case nil:
- return false
- case bool:
- return toNumber(l) < toNumber(right)
- case int:
- return l < right.(int)
- case float64:
- return l < right.(float64)
- case string:
- return l < right.(string)
- case []any:
- ra := right.([]any)
- max := len(l)
- if len(ra) > max {
- max = len(ra)
- }
- for i := 0; i < max; i++ {
- var li any
- var rai any
- if len(l) > i {
- li = l[i]
- }
- if len(ra) > i {
- rai = ra[i]
- }
-
- if !eq(li, rai) {
- return lt(li, rai)
- }
- }
-
- return false
- case map[string]any:
- ro := right.(map[string]any)
-
- for _, key := range keys(l, ro) {
- var li any
- var rai any
- if lv, ok := l[key]; ok {
- li = lv
- }
- if rv, ok := ro[key]; ok {
- rai = rv
- }
-
- if !eq(li, rai) {
- return lt(li, rai)
- }
- }
-
- return false
- default:
- panic("unknown type")
- }
-}
-
-func keys(l map[string]any, ro map[string]any) []string {
- var keys []string
- seen := map[string]bool{}
- for _, a := range []map[string]any{l, ro} {
- for k := range a {
- if _, ok := seen[k]; !ok {
- seen[k] = true
- keys = append(keys, k)
- }
- }
- }
- sort.Strings(keys)
-
- return keys
-}
-
-func gt(left, right any) bool {
- leftV, rightV := typeValue(left), typeValue(right)
- if leftV != rightV {
- return leftV > rightV
- }
- switch l := left.(type) {
- case nil:
- return false
- case bool:
- return toNumber(l) > toNumber(right)
- case int:
- return l > right.(int)
- case float64:
- return l > right.(float64)
- case string:
- return l > right.(string)
- case []any:
- ra := right.([]any)
- max := len(l)
- if len(ra) > max {
- max = len(ra)
- }
- for i := 0; i < max; i++ {
- var li any
- var rai any
- if len(l) > i {
- li = l[i]
- }
- if len(ra) > i {
- rai = ra[i]
- }
-
- if !eq(li, rai) {
- return gt(li, rai)
- }
- }
-
- return false
- case map[string]any:
- ro := right.(map[string]any)
-
- for _, key := range keys(l, ro) {
- var li any
- var rai any
- if lv, ok := l[key]; ok {
- li = lv
- }
- if rv, ok := ro[key]; ok {
- rai = rv
- }
-
- if !eq(li, rai) {
- return gt(li, rai)
- }
- }
-
- return false
- default:
- panic("unknown type")
- }
-}
-
-func le(left, right any) bool {
- leftV, rightV := typeValue(left), typeValue(right)
- if leftV != rightV {
- return leftV <= rightV
- }
- switch l := left.(type) {
- case nil:
- return false
- case bool:
- return toNumber(l) <= toNumber(right)
- case int:
- return l <= right.(int)
- case float64:
- return l <= right.(float64)
- case string:
- return l <= right.(string)
- case []any:
- ra := right.([]any)
- max := len(l)
- if len(ra) > max {
- max = len(ra)
- }
- for i := 0; i < max; i++ {
- var li any
- var rai any
- if len(l) > i {
- li = l[i]
- }
- if len(ra) > i {
- rai = ra[i]
- }
-
- if !eq(li, rai) {
- return le(li, rai)
- }
- }
-
- return true
- case map[string]any:
- ro := right.(map[string]any)
-
- for _, key := range keys(l, ro) {
- var li any
- var rai any
- if lv, ok := l[key]; ok {
- li = lv
- }
- if rv, ok := ro[key]; ok {
- rai = rv
- }
-
- if !eq(li, rai) {
- return lt(li, rai)
- }
- }
-
- return true
- default:
- panic("unknown type")
- }
-}
-
-func ge(left, right any) bool {
- leftV, rightV := typeValue(left), typeValue(right)
- if leftV != rightV {
- return leftV >= rightV
- }
- switch l := left.(type) {
- case nil:
- return false
- case bool:
- return toNumber(l) >= toNumber(right)
- case int:
- return l >= right.(int)
- case float64:
- return l >= right.(float64)
- case string:
- return l >= right.(string)
- case []any:
- ra := right.([]any)
- max := len(l)
- if len(ra) > max {
- max = len(ra)
- }
- for i := 0; i < max; i++ {
- var li any
- var rai any
- if len(l) > i {
- li = l[i]
- }
- if len(ra) > i {
- rai = ra[i]
- }
-
- if !eq(li, rai) {
- return ge(li, rai)
- }
- }
-
- return true
- case map[string]any:
- ro := right.(map[string]any)
-
- for _, key := range keys(l, ro) {
- var li any
- var rai any
- if lv, ok := l[key]; ok {
- li = lv
- }
- if rv, ok := ro[key]; ok {
- rai = rv
- }
-
- if !eq(li, rai) {
- return gt(li, rai)
- }
- }
-
- return true
- default:
- panic("unknown type")
- }
-}
-
-func in(left, right any) bool {
- a, ok := right.([]any)
- if !ok {
- return false
- }
- for _, v := range a {
- if left == v {
- return true
- }
- }
-
- return false
-}
-
-func like(left, right any) (bool, error) {
- return match(right.(string), left.(string))
-}
-
-func regexMatch(left, right any) (bool, error) {
- return regexp.Match(right.(string), []byte(left.(string)))
-}
-
-func regexNonMatch(left, right any) (bool, error) {
- m, err := regexp.Match(right.(string), []byte(left.(string)))
-
- return !m, err
-}
-
-func typeValue(v any) int {
- switch v.(type) {
- case nil:
- return 0
- case bool:
- return 1
- case float64, int:
- return 2
- case string:
- return 3
- case []any:
- return 4
- case map[string]any:
- return 5
- default:
- panic("unknown type")
- }
-}
-
-// Ternary operator https://www.arangodb.com/docs/3.7/aql/operators.html#ternary-operator
-
-func ternary(left, middle, right any) any {
- if toBool(left) {
- if middle != nil {
- return middle
- }
-
- return left
- }
-
- return right
-}
-
-// Range operators https://www.arangodb.com/docs/3.7/aql/operators.html#range-operator
-
-func aqlrange(left, right any) []float64 {
- var v []float64
- for i := int(left.(float64)); i <= int(right.(float64)); i++ {
- v = append(v, float64(i))
- }
-
- return v
-}
diff --git a/caql/parser.go b/caql/parser.go
deleted file mode 100644
index a2ec209..0000000
--- a/caql/parser.go
+++ /dev/null
@@ -1,121 +0,0 @@
-package caql
-
-import (
- "errors"
- "fmt"
- "strconv"
-
- "github.com/antlr/antlr4/runtime/Go/antlr"
-
- "github.com/SecurityBrewery/catalyst/generated/caql/parser"
-)
-
-type Parser struct {
- Searcher Searcher
- Prefix string
-}
-
-func (p *Parser) Parse(aql string) (t *Tree, err error) {
- defer func() {
- if r := recover(); r != nil {
- err = fmt.Errorf("%s", r)
- }
- }()
- // Set up the input
- inputStream := antlr.NewInputStream(aql)
-
- errorListener := &errorListener{}
-
- // Create the Lexer
- lexer := parser.NewCAQLLexer(inputStream)
- lexer.RemoveErrorListeners()
- lexer.AddErrorListener(errorListener)
- stream := antlr.NewCommonTokenStream(lexer, antlr.TokenDefaultChannel)
-
- // Create the Parser
- aqlParser := parser.NewCAQLParser(stream)
-
- aqlParser.RemoveErrorListeners()
- aqlParser.AddErrorListener(errorListener)
- aqlParser.SetErrorHandler(antlr.NewBailErrorStrategy())
- if errorListener.errs != nil {
- err = errorListener.errs[0]
- }
-
- return &Tree{aqlParser: aqlParser, parseContext: aqlParser.Parse(), searcher: p.Searcher, prefix: p.Prefix}, err
-}
-
-type Tree struct {
- parseContext parser.IParseContext
- aqlParser *parser.CAQLParser
- searcher Searcher
- prefix string
-}
-
-func (t *Tree) Eval(values map[string]any) (i any, err error) {
- defer func() {
- if r := recover(); r != nil {
- err = fmt.Errorf("%s", r)
- }
- }()
- interpreter := aqlInterpreter{values: values}
-
- antlr.ParseTreeWalkerDefault.Walk(&interpreter, t.parseContext)
-
- if interpreter.errs != nil {
- return nil, interpreter.errs[0]
- }
-
- return interpreter.stack[0], nil
-}
-
-func (t *Tree) String() (s string, err error) {
- defer func() {
- if r := recover(); r != nil {
- err = fmt.Errorf("%s", r)
- }
- }()
- builder := aqlBuilder{searcher: t.searcher, prefix: t.prefix}
-
- antlr.ParseTreeWalkerDefault.Walk(&builder, t.parseContext)
-
- return builder.stack[0], err
-}
-
-func (t *Tree) BleveString() (s string, err error) {
- defer func() {
- if r := recover(); r != nil {
- err = fmt.Errorf("%s", r)
- }
- }()
- builder := bleveBuilder{}
-
- antlr.ParseTreeWalkerDefault.Walk(&builder, t.parseContext)
-
- if builder.err != nil {
- return "", builder.err
- }
-
- return builder.stack[0], err
-}
-
-type errorListener struct {
- *antlr.DefaultErrorListener
- errs []error
-}
-
-func (el *errorListener) SyntaxError(_ antlr.Recognizer, _ any, line, column int, msg string, _ antlr.RecognitionException) {
- el.errs = append(el.errs, fmt.Errorf("line "+strconv.Itoa(line)+":"+strconv.Itoa(column)+" "+msg))
-}
-
-func (el *errorListener) ReportAmbiguity(_ antlr.Parser, _ *antlr.DFA, _, _ int, _ bool, _ *antlr.BitSet, _ antlr.ATNConfigSet) {
- el.errs = append(el.errs, errors.New("ReportAmbiguity"))
-}
-
-func (el *errorListener) ReportAttemptingFullContext(_ antlr.Parser, _ *antlr.DFA, _, _ int, _ *antlr.BitSet, _ antlr.ATNConfigSet) {
- el.errs = append(el.errs, errors.New("ReportAttemptingFullContext"))
-}
-
-func (el *errorListener) ReportContextSensitivity(_ antlr.Parser, _ *antlr.DFA, _, _, _ int, _ antlr.ATNConfigSet) {
- el.errs = append(el.errs, errors.New("ReportContextSensitivity"))
-}
diff --git a/caql/rql_test.go b/caql/rql_test.go
deleted file mode 100644
index 61a9cce..0000000
--- a/caql/rql_test.go
+++ /dev/null
@@ -1,362 +0,0 @@
-package caql_test
-
-import (
- "encoding/json"
- "reflect"
- "testing"
-
- "github.com/SecurityBrewery/catalyst/caql"
-)
-
-type MockSearcher struct{}
-
-func (m MockSearcher) Search(_ string) (ids []string, err error) {
- return []string{"1", "2", "3"}, nil
-}
-
-func TestParseSAQLEval(t *testing.T) {
- t.Parallel()
-
- tests := []struct {
- name string
- saql string
- wantRebuild string
- wantValue any
- wantParseErr bool
- wantRebuildErr bool
- wantEvalErr bool
- values string
- }{
- // Custom
- {name: "Compare 1", saql: "1 <= 2", wantRebuild: "1 <= 2", wantValue: true},
- {name: "Compare 2", saql: "1 >= 2", wantRebuild: "1 >= 2", wantValue: false},
- {name: "Compare 3", saql: "1 == 2", wantRebuild: "1 == 2", wantValue: false},
- {name: "Compare 4", saql: "1 > 2", wantRebuild: "1 > 2", wantValue: false},
- {name: "Compare 5", saql: "1 < 2", wantRebuild: "1 < 2", wantValue: true},
- {name: "Compare 6", saql: "1 != 2", wantRebuild: "1 != 2", wantValue: true},
-
- {name: "SymbolRef 1", saql: "name", wantRebuild: "name", wantValue: false, values: `{"name": false}`},
- {name: "SymbolRef 2", saql: "d.name", wantRebuild: "d.name", wantValue: false, values: `{"d": {"name": false}}`},
- {name: "SymbolRef 3", saql: "name == false", wantRebuild: "name == false", wantValue: true, values: `{"name": false}`},
- {name: "SymbolRef Error 1", saql: "name, title", wantParseErr: true},
- {name: "SymbolRef Error 2", saql: "unknown", wantRebuild: "unknown", wantValue: false, wantEvalErr: true, values: `{}`},
-
- {name: "Misc 1", saql: `active == true && age < 39`, wantRebuild: `active == true AND age < 39`, wantValue: true, values: `{"active": true, "age": 2}`},
- {name: "Misc 2", saql: `(attr == 10) AND foo == 'bar' OR NOT baz`, wantRebuild: `(attr == 10) AND foo == "bar" OR NOT baz`, wantValue: false, values: `{"attr": 2, "foo": "bar", "baz": true}`},
- {name: "Misc 3", saql: `attr == 10 AND (foo == 'bar' OR foo == 'baz')`, wantRebuild: `attr == 10 AND (foo == "bar" OR foo == "baz")`, wantValue: false, values: `{"attr": 2, "foo": "bar", "baz": true}`},
- {name: "Misc 4", saql: `5 > 1 AND "a" != "b"`, wantRebuild: `5 > 1 AND "a" != "b"`, wantValue: true},
-
- {name: "LIKE 1", saql: `"foo" LIKE "%f%"`, wantRebuild: `"foo" LIKE "%f%"`, wantValue: true},
- {name: "LIKE 2", saql: `"foo" NOT LIKE "%f%"`, wantRebuild: `"foo" NOT LIKE "%f%"`, wantValue: false},
- {name: "LIKE 3", saql: `NOT "foo" LIKE "%f%"`, wantRebuild: `NOT "foo" LIKE "%f%"`, wantValue: false},
-
- {name: "Summand 1", saql: "1 + 2", wantRebuild: "1 + 2", wantValue: 3},
- {name: "Summand 2", saql: "1 - 2", wantRebuild: "1 - 2", wantValue: -1},
-
- {name: "Factor 1", saql: "1 * 2", wantRebuild: "1 * 2", wantValue: 2},
- {name: "Factor 2", saql: "1 / 2", wantRebuild: "1 / 2", wantValue: 0.5},
- {name: "Factor 3", saql: "1.0 / 2.0", wantRebuild: "1.0 / 2.0", wantValue: 0.5},
- {name: "Factor 4", saql: "1 % 2", wantRebuild: "1 % 2", wantValue: 1},
-
- {name: "Term 1", saql: "(1 + 2) * 2", wantRebuild: "(1 + 2) * 2", wantValue: 6},
- {name: "Term 2", saql: "2 * (1 + 2)", wantRebuild: "2 * (1 + 2)", wantValue: 6},
-
- // https://www.arangodb.com/docs/3.7/aql/fundamentals-data-types.html
- {name: "Null 1", saql: `null`, wantRebuild: "null"},
- {name: "Bool 1", saql: `true`, wantRebuild: "true", wantValue: true},
- {name: "Bool 2", saql: `false`, wantRebuild: "false", wantValue: false},
- {name: "Numeric 1", saql: "1", wantRebuild: "1", wantValue: 1},
- {name: "Numeric 2", saql: "+1", wantRebuild: "1", wantValue: 1},
- {name: "Numeric 3", saql: "42", wantRebuild: "42", wantValue: 42},
- {name: "Numeric 4", saql: "-1", wantRebuild: "-1", wantValue: -1},
- {name: "Numeric 5", saql: "-42", wantRebuild: "-42", wantValue: -42},
- {name: "Numeric 6", saql: "1.23", wantRebuild: "1.23", wantValue: 1.23},
- {name: "Numeric 7", saql: "-99.99", wantRebuild: "-99.99", wantValue: -99.99},
- {name: "Numeric 8", saql: "0.5", wantRebuild: "0.5", wantValue: 0.5},
- {name: "Numeric 9", saql: ".5", wantRebuild: ".5", wantValue: 0.5},
- {name: "Numeric 10", saql: "-4.87e103", wantRebuild: "-4.87e103", wantValue: -4.87e+103},
- {name: "Numeric 11", saql: "0b10", wantRebuild: "0b10", wantValue: 2},
- {name: "Numeric 12", saql: "0x10", wantRebuild: "0x10", wantValue: 16},
- {name: "Numeric Error 1", saql: "1.", wantParseErr: true},
- {name: "Numeric Error 2", saql: "01.23", wantParseErr: true},
- {name: "Numeric Error 3", saql: "00.23", wantParseErr: true},
- {name: "Numeric Error 4", saql: "00", wantParseErr: true},
-
- // {name: "String 1", saql: `"yikes!"`, wantRebuild: `"yikes!"`, wantValue: "yikes!"},
- // {name: "String 2", saql: `"don't know"`, wantRebuild: `"don't know"`, wantValue: "don't know"},
- // {name: "String 3", saql: `"this is a \"quoted\" word"`, wantRebuild: `"this is a \"quoted\" word"`, wantValue: "this is a \"quoted\" word"},
- // {name: "String 4", saql: `"this is a longer string."`, wantRebuild: `"this is a longer string."`, wantValue: "this is a longer string."},
- // {name: "String 5", saql: `"the path separator on Windows is \\"`, wantRebuild: `"the path separator on Windows is \\"`, wantValue: "the path separator on Windows is \\"},
- // {name: "String 6", saql: `'yikes!'`, wantRebuild: `"yikes!"`, wantValue: "yikes!"},
- // {name: "String 7", saql: `'don\'t know'`, wantRebuild: `"don't know"`, wantValue: "don't know"},
- // {name: "String 8", saql: `'this is a "quoted" word'`, wantRebuild: `"this is a \"quoted\" word"`, wantValue: "this is a \"quoted\" word"},
- // {name: "String 9", saql: `'this is a longer string.'`, wantRebuild: `"this is a longer string."`, wantValue: "this is a longer string."},
- // {name: "String 10", saql: `'the path separator on Windows is \\'`, wantRebuild: `"the path separator on Windows is \\"`, wantValue: `the path separator on Windows is \`},
-
- {name: "Array 1", saql: "[]", wantRebuild: "[]", wantValue: []any{}},
- {name: "Array 2", saql: `[true]`, wantRebuild: `[true]`, wantValue: []any{true}},
- {name: "Array 3", saql: `[1, 2, 3]`, wantRebuild: `[1, 2, 3]`, wantValue: []any{float64(1), float64(2), float64(3)}},
- {
- name: "Array 4", saql: `[-99, "yikes!", [false, ["no"], []], 1]`, wantRebuild: `[-99, "yikes!", [false, ["no"], []], 1]`,
- wantValue: []any{-99.0, "yikes!", []any{false, []any{"no"}, []any{}}, float64(1)},
- },
- {name: "Array 5", saql: `[["fox", "marshal"]]`, wantRebuild: `[["fox", "marshal"]]`, wantValue: []any{[]any{"fox", "marshal"}}},
- {name: "Array 6", saql: `[1, 2, 3,]`, wantRebuild: `[1, 2, 3]`, wantValue: []any{float64(1), float64(2), float64(3)}},
-
- {name: "Array Error 1", saql: "(1,2,3)", wantParseErr: true},
- {name: "Array Access 1", saql: "u.friends[0]", wantRebuild: "u.friends[0]", wantValue: 7, values: `{"u": {"friends": [7,8,9]}}`},
- {name: "Array Access 2", saql: "u.friends[2]", wantRebuild: "u.friends[2]", wantValue: 9, values: `{"u": {"friends": [7,8,9]}}`},
- {name: "Array Access 3", saql: "u.friends[-1]", wantRebuild: "u.friends[-1]", wantValue: 9, values: `{"u": {"friends": [7,8,9]}}`},
- {name: "Array Access 4", saql: "u.friends[-2]", wantRebuild: "u.friends[-2]", wantValue: 8, values: `{"u": {"friends": [7,8,9]}}`},
-
- {name: "Object 1", saql: "{}", wantRebuild: "{}", wantValue: map[string]any{}},
- {name: "Object 2", saql: `{a: 1}`, wantRebuild: "{a: 1}", wantValue: map[string]any{"a": float64(1)}},
- {name: "Object 3", saql: `{'a': 1}`, wantRebuild: `{'a': 1}`, wantValue: map[string]any{"a": float64(1)}},
- {name: "Object 4", saql: `{"a": 1}`, wantRebuild: `{"a": 1}`, wantValue: map[string]any{"a": float64(1)}},
- {name: "Object 5", saql: `{'return': 1}`, wantRebuild: `{'return': 1}`, wantValue: map[string]any{"return": float64(1)}},
- {name: "Object 6", saql: `{"return": 1}`, wantRebuild: `{"return": 1}`, wantValue: map[string]any{"return": float64(1)}},
- {name: "Object 9", saql: `{a: 1,}`, wantRebuild: "{a: 1}", wantValue: map[string]any{"a": float64(1)}},
- {name: "Object 10", saql: `{"a": 1,}`, wantRebuild: `{"a": 1}`, wantValue: map[string]any{"a": float64(1)}},
- // {"Object 8", "{`return`: 1}", `{"return": 1}`, true},
- // {"Object 7", "{´return´: 1}", `{"return": 1}`, true},
- {name: "Object Error 1: return is a keyword", saql: `{like: 1}`, wantParseErr: true},
-
- {name: "Object Access 1", saql: "u.address.city.name", wantRebuild: "u.address.city.name", wantValue: "Munich", values: `{"u": {"address": {"city": {"name": "Munich"}}}}`},
- {name: "Object Access 2", saql: "u.friends[0].name.first", wantRebuild: "u.friends[0].name.first", wantValue: "Kevin", values: `{"u": {"friends": [{"name": {"first": "Kevin"}}]}}`},
- {name: "Object Access 3", saql: `u["address"]["city"]["name"]`, wantRebuild: `u["address"]["city"]["name"]`, wantValue: "Munich", values: `{"u": {"address": {"city": {"name": "Munich"}}}}`},
- {name: "Object Access 4", saql: `u["friends"][0]["name"]["first"]`, wantRebuild: `u["friends"][0]["name"]["first"]`, wantValue: "Kevin", values: `{"u": {"friends": [{"name": {"first": "Kevin"}}]}}`},
- {name: "Object Access 5", saql: "u._key", wantRebuild: "u._key", wantValue: false, values: `{"u": {"_key": false}}`},
-
- // This query language does not support binds
- // https://www.arangodb.com/docs/3.7/aql/fundamentals-bind-parameters.html
- // {name: "Bind 1", saql: "u.id == @id && u.name == @name", wantRebuild: `u.id == @id AND u.name == @name`, wantValue: true},
- // {name: "Bind 2", saql: "u.id == CONCAT('prefix', @id, 'suffix') && u.name == @name", wantRebuild: `u.id == CONCAT('prefix', @id, 'suffix') AND u.name == @name`, wantValue: false},
- // {name: "Bind 3", saql: "doc.@attr.@subattr", wantRebuild: `doc.@attr.@subattr`, wantValue: true, values: `{"doc": {"@attr": {"@subattr": true}}}`},
- // {name: "Bind 4", saql: "doc[@attr][@subattr]", wantRebuild: `doc[@attr][@subattr]`, wantValue: true, values: `{"doc": {"@attr": {"@subattr": true}}}`},
-
- // https://www.arangodb.com/docs/3.7/aql/fundamentals-type-value-order.html
- {name: "Compare 7", saql: `null < false`, wantRebuild: `null < false`, wantValue: true},
- {name: "Compare 8", saql: `null < true`, wantRebuild: `null < true`, wantValue: true},
- {name: "Compare 9", saql: `null < 1`, wantRebuild: `null < 1`, wantValue: true},
- {name: "Compare 10", saql: `null < ''`, wantRebuild: `null < ""`, wantValue: true},
- {name: "Compare 11", saql: `null < ' '`, wantRebuild: `null < " "`, wantValue: true},
- {name: "Compare 12", saql: `null < '3'`, wantRebuild: `null < "3"`, wantValue: true},
- {name: "Compare 13", saql: `null < 'abc'`, wantRebuild: `null < "abc"`, wantValue: true},
- {name: "Compare 14", saql: `null < []`, wantRebuild: `null < []`, wantValue: true},
- {name: "Compare 15", saql: `null < {}`, wantRebuild: `null < {}`, wantValue: true},
- {name: "Compare 16", saql: `false < true`, wantRebuild: `false < true`, wantValue: true},
- {name: "Compare 17", saql: `false < 5`, wantRebuild: `false < 5`, wantValue: true},
- {name: "Compare 18", saql: `false < ''`, wantRebuild: `false < ""`, wantValue: true},
- {name: "Compare 19", saql: `false < ' '`, wantRebuild: `false < " "`, wantValue: true},
- {name: "Compare 20", saql: `false < '7'`, wantRebuild: `false < "7"`, wantValue: true},
- {name: "Compare 21", saql: `false < 'abc'`, wantRebuild: `false < "abc"`, wantValue: true},
- {name: "Compare 22", saql: `false < []`, wantRebuild: `false < []`, wantValue: true},
- {name: "Compare 23", saql: `false < {}`, wantRebuild: `false < {}`, wantValue: true},
- {name: "Compare 24", saql: `true < 9`, wantRebuild: `true < 9`, wantValue: true},
- {name: "Compare 25", saql: `true < ''`, wantRebuild: `true < ""`, wantValue: true},
- {name: "Compare 26", saql: `true < ' '`, wantRebuild: `true < " "`, wantValue: true},
- {name: "Compare 27", saql: `true < '11'`, wantRebuild: `true < "11"`, wantValue: true},
- {name: "Compare 28", saql: `true < 'abc'`, wantRebuild: `true < "abc"`, wantValue: true},
- {name: "Compare 29", saql: `true < []`, wantRebuild: `true < []`, wantValue: true},
- {name: "Compare 30", saql: `true < {}`, wantRebuild: `true < {}`, wantValue: true},
- {name: "Compare 31", saql: `13 < ''`, wantRebuild: `13 < ""`, wantValue: true},
- {name: "Compare 32", saql: `15 < ' '`, wantRebuild: `15 < " "`, wantValue: true},
- {name: "Compare 33", saql: `17 < '18'`, wantRebuild: `17 < "18"`, wantValue: true},
- {name: "Compare 34", saql: `21 < 'abc'`, wantRebuild: `21 < "abc"`, wantValue: true},
- {name: "Compare 35", saql: `23 < []`, wantRebuild: `23 < []`, wantValue: true},
- {name: "Compare 36", saql: `25 < {}`, wantRebuild: `25 < {}`, wantValue: true},
- {name: "Compare 37", saql: `'' < ' '`, wantRebuild: `"" < " "`, wantValue: true},
- {name: "Compare 38", saql: `'' < '27'`, wantRebuild: `"" < "27"`, wantValue: true},
- {name: "Compare 39", saql: `'' < 'abc'`, wantRebuild: `"" < "abc"`, wantValue: true},
- {name: "Compare 40", saql: `'' < []`, wantRebuild: `"" < []`, wantValue: true},
- {name: "Compare 41", saql: `'' < {}`, wantRebuild: `"" < {}`, wantValue: true},
- {name: "Compare 42", saql: `[] < {}`, wantRebuild: `[] < {}`, wantValue: true},
- {name: "Compare 43", saql: `[] < [29]`, wantRebuild: `[] < [29]`, wantValue: true},
- {name: "Compare 44", saql: `[1] < [2]`, wantRebuild: `[1] < [2]`, wantValue: true},
- {name: "Compare 45", saql: `[1, 2] < [2]`, wantRebuild: `[1, 2] < [2]`, wantValue: true},
- {name: "Compare 46", saql: `[99, 99] < [100]`, wantRebuild: `[99, 99] < [100]`, wantValue: true},
- {name: "Compare 47", saql: `[false] < [true]`, wantRebuild: `[false] < [true]`, wantValue: true},
- {name: "Compare 48", saql: `[false, 1] < [false, '']`, wantRebuild: `[false, 1] < [false, ""]`, wantValue: true},
- {name: "Compare 49", saql: `{} < {"a": 1}`, wantRebuild: `{} < {"a": 1}`, wantValue: true},
- {name: "Compare 50", saql: `{} == {"a": null}`, wantRebuild: `{} == {"a": null}`, wantValue: true},
- {name: "Compare 51", saql: `{"a": 1} < {"a": 2}`, wantRebuild: `{"a": 1} < {"a": 2}`, wantValue: true},
- {name: "Compare 52", saql: `{"b": 1} < {"a": 0}`, wantRebuild: `{"b": 1} < {"a": 0}`, wantValue: true},
- {name: "Compare 53", saql: `{"a": {"c": true}} < {"a": {"c": 0}}`, wantRebuild: `{"a": {"c": true}} < {"a": {"c": 0}}`, wantValue: true},
- {name: "Compare 54", saql: `{"a": {"c": true, "a": 0}} < {"a": {"c": false, "a": 1}}`, wantRebuild: `{"a": {"c": true, "a": 0}} < {"a": {"c": false, "a": 1}}`, wantValue: true},
- {name: "Compare 55", saql: `{"a": 1, "b": 2} == {"b": 2, "a": 1}`, wantRebuild: `{"a": 1, "b": 2} == {"b": 2, "a": 1}`, wantValue: true},
-
- // https://www.arangodb.com/docs/3.7/aql/operators.html
- {name: "Compare 56", saql: `0 == null`, wantRebuild: `0 == null`, wantValue: false},
- {name: "Compare 57", saql: `1 > 0`, wantRebuild: `1 > 0`, wantValue: true},
- {name: "Compare 58", saql: `true != null`, wantRebuild: `true != null`, wantValue: true},
- {name: "Compare 59", saql: `45 <= "yikes!"`, wantRebuild: `45 <= "yikes!"`, wantValue: true},
- {name: "Compare 60", saql: `65 != "65"`, wantRebuild: `65 != "65"`, wantValue: true},
- {name: "Compare 61", saql: `65 == 65`, wantRebuild: `65 == 65`, wantValue: true},
- {name: "Compare 62", saql: `1.23 > 1.32`, wantRebuild: `1.23 > 1.32`, wantValue: false},
- {name: "Compare 63", saql: `1.5 IN [2, 3, 1.5]`, wantRebuild: `1.5 IN [2, 3, 1.5]`, wantValue: true},
- {name: "Compare 64", saql: `"foo" IN null`, wantRebuild: `"foo" IN null`, wantValue: false},
- {name: "Compare 65", saql: `42 NOT IN [17, 40, 50]`, wantRebuild: `42 NOT IN [17, 40, 50]`, wantValue: true},
- {name: "Compare 66", saql: `"abc" == "abc"`, wantRebuild: `"abc" == "abc"`, wantValue: true},
- {name: "Compare 67", saql: `"abc" == "ABC"`, wantRebuild: `"abc" == "ABC"`, wantValue: false},
- {name: "Compare 68", saql: `"foo" LIKE "f%"`, wantRebuild: `"foo" LIKE "f%"`, wantValue: true},
- {name: "Compare 69", saql: `"foo" NOT LIKE "f%"`, wantRebuild: `"foo" NOT LIKE "f%"`, wantValue: false},
- {name: "Compare 70", saql: `"foo" =~ "^f[o].$"`, wantRebuild: `"foo" =~ "^f[o].$"`, wantValue: true},
- {name: "Compare 71", saql: `"foo" !~ "[a-z]+bar$"`, wantRebuild: `"foo" !~ "[a-z]+bar$"`, wantValue: true},
-
- {name: "Compare 72", saql: `"abc" LIKE "a%"`, wantRebuild: `"abc" LIKE "a%"`, wantValue: true},
- {name: "Compare 73", saql: `"abc" LIKE "_bc"`, wantRebuild: `"abc" LIKE "_bc"`, wantValue: true},
- {name: "Compare 74", saql: `"a_b_foo" LIKE "a\\_b\\_foo"`, wantRebuild: `"a_b_foo" LIKE "a\\_b\\_foo"`, wantValue: true},
-
- // https://www.arangodb.com/docs/3.7/aql/operators.html#array-comparison-operators
- {name: "Compare Array 1", saql: `[1, 2, 3] ALL IN [2, 3, 4]`, wantRebuild: `[1, 2, 3] ALL IN [2, 3, 4]`, wantValue: false},
- {name: "Compare Array 2", saql: `[1, 2, 3] ALL IN [1, 2, 3]`, wantRebuild: `[1, 2, 3] ALL IN [1, 2, 3]`, wantValue: true},
- {name: "Compare Array 3", saql: `[1, 2, 3] NONE IN [3]`, wantRebuild: `[1, 2, 3] NONE IN [3]`, wantValue: false},
- {name: "Compare Array 4", saql: `[1, 2, 3] NONE IN [23, 42]`, wantRebuild: `[1, 2, 3] NONE IN [23, 42]`, wantValue: true},
- {name: "Compare Array 5", saql: `[1, 2, 3] ANY IN [4, 5, 6]`, wantRebuild: `[1, 2, 3] ANY IN [4, 5, 6]`, wantValue: false},
- {name: "Compare Array 6", saql: `[1, 2, 3] ANY IN [1, 42]`, wantRebuild: `[1, 2, 3] ANY IN [1, 42]`, wantValue: true},
- {name: "Compare Array 7", saql: `[1, 2, 3] ANY == 2`, wantRebuild: `[1, 2, 3] ANY == 2`, wantValue: true},
- {name: "Compare Array 8", saql: `[1, 2, 3] ANY == 4`, wantRebuild: `[1, 2, 3] ANY == 4`, wantValue: false},
- {name: "Compare Array 9", saql: `[1, 2, 3] ANY > 0`, wantRebuild: `[1, 2, 3] ANY > 0`, wantValue: true},
- {name: "Compare Array 10", saql: `[1, 2, 3] ANY <= 1`, wantRebuild: `[1, 2, 3] ANY <= 1`, wantValue: true},
- {name: "Compare Array 11", saql: `[1, 2, 3] NONE < 99`, wantRebuild: `[1, 2, 3] NONE < 99`, wantValue: false},
- {name: "Compare Array 12", saql: `[1, 2, 3] NONE > 10`, wantRebuild: `[1, 2, 3] NONE > 10`, wantValue: true},
- {name: "Compare Array 13", saql: `[1, 2, 3] ALL > 2`, wantRebuild: `[1, 2, 3] ALL > 2`, wantValue: false},
- {name: "Compare Array 14", saql: `[1, 2, 3] ALL > 0`, wantRebuild: `[1, 2, 3] ALL > 0`, wantValue: true},
- {name: "Compare Array 15", saql: `[1, 2, 3] ALL >= 3`, wantRebuild: `[1, 2, 3] ALL >= 3`, wantValue: false},
- {name: "Compare Array 16", saql: `["foo", "bar"] ALL != "moo"`, wantRebuild: `["foo", "bar"] ALL != "moo"`, wantValue: true},
- {name: "Compare Array 17", saql: `["foo", "bar"] NONE == "bar"`, wantRebuild: `["foo", "bar"] NONE == "bar"`, wantValue: false},
- {name: "Compare Array 18", saql: `["foo", "bar"] ANY == "foo"`, wantRebuild: `["foo", "bar"] ANY == "foo"`, wantValue: true},
-
- // https://www.arangodb.com/docs/3.7/aql/operators.html#logical-operators
- {name: "Logical 1", saql: "active == true OR age < 39", wantRebuild: "active == true OR age < 39", wantValue: true, values: `{"active": true, "age": 4}`},
- {name: "Logical 2", saql: "active == true || age < 39", wantRebuild: "active == true OR age < 39", wantValue: true, values: `{"active": true, "age": 4}`},
- {name: "Logical 3", saql: "active == true AND age < 39", wantRebuild: "active == true AND age < 39", wantValue: true, values: `{"active": true, "age": 4}`},
- {name: "Logical 4", saql: "active == true && age < 39", wantRebuild: "active == true AND age < 39", wantValue: true, values: `{"active": true, "age": 4}`},
- {name: "Logical 5", saql: "!active", wantRebuild: "NOT active", wantValue: false, values: `{"active": true}`},
- {name: "Logical 6", saql: "NOT active", wantRebuild: "NOT active", wantValue: false, values: `{"active": true}`},
- {name: "Logical 7", saql: "not active", wantRebuild: "NOT active", wantValue: false, values: `{"active": true}`},
- {name: "Logical 8", saql: "NOT NOT active", wantRebuild: "NOT NOT active", wantValue: true, values: `{"active": true}`},
-
- {name: "Logical 9", saql: `u.age > 15 && u.address.city != ""`, wantRebuild: `u.age > 15 AND u.address.city != ""`, wantValue: false, values: `{"u": {"age": 2, "address": {"city": "Munich"}}}`},
- {name: "Logical 10", saql: `true || false`, wantRebuild: `true OR false`, wantValue: true},
- {name: "Logical 11", saql: `NOT u.isInvalid`, wantRebuild: `NOT u.isInvalid`, wantValue: false, values: `{"u": {"isInvalid": true}}`},
- {name: "Logical 12", saql: `1 || ! 0`, wantRebuild: `1 OR NOT 0`, wantValue: 1},
-
- {name: "Logical 13", saql: `25 > 1 && 42 != 7`, wantRebuild: `25 > 1 AND 42 != 7`, wantValue: true},
- {name: "Logical 14", saql: `22 IN [23, 42] || 23 NOT IN [22, 7]`, wantRebuild: `22 IN [23, 42] OR 23 NOT IN [22, 7]`, wantValue: true},
- {name: "Logical 15", saql: `25 != 25`, wantRebuild: `25 != 25`, wantValue: false},
-
- {name: "Logical 16", saql: `1 || 7`, wantRebuild: `1 OR 7`, wantValue: 1},
- // {name: "Logical 17", saql: `null || "foo"`, wantRebuild: `null OR "foo"`, wantValue: "foo"},
- {name: "Logical 17", saql: `null || "foo"`, wantRebuild: `null OR d._key IN ["1","2","3"]`, wantValue: "foo", values: `{"d": {"_key": "1"}}`}, // eval != rebuild
- {name: "Logical 18", saql: `null && true`, wantRebuild: `null AND true`, wantValue: nil},
- {name: "Logical 19", saql: `true && 23`, wantRebuild: `true AND 23`, wantValue: 23},
-
- {name: "Logical 20", saql: "true == (6 < 8)", wantRebuild: "true == (6 < 8)", wantValue: true},
- {name: "Logical 21", saql: "true == 6 < 8", wantRebuild: "true == 6 < 8", wantValue: true}, // does not work in go
-
- // https://www.arangodb.com/docs/3.7/aql/operators.html#arithmetic-operators
- {name: "Arithmetic 1", saql: `1 + 1`, wantRebuild: `1 + 1`, wantValue: 2},
- {name: "Arithmetic 2", saql: `33 - 99`, wantRebuild: `33 - 99`, wantValue: -66},
- {name: "Arithmetic 3", saql: `12.4 * 4.5`, wantRebuild: `12.4 * 4.5`, wantValue: 55.8},
- {name: "Arithmetic 4", saql: `13.0 / 0.1`, wantRebuild: `13.0 / 0.1`, wantValue: 130.0},
- {name: "Arithmetic 5", saql: `23 % 7`, wantRebuild: `23 % 7`, wantValue: 2},
- {name: "Arithmetic 6", saql: `-15`, wantRebuild: `-15`, wantValue: -15},
- {name: "Arithmetic 7", saql: `+9.99`, wantRebuild: `9.99`, wantValue: 9.99},
-
- {name: "Arithmetic 8", saql: `1 + "a"`, wantRebuild: `1 + "a"`, wantValue: 1},
- {name: "Arithmetic 9", saql: `1 + "99"`, wantRebuild: `1 + "99"`, wantValue: 100},
- {name: "Arithmetic 10", saql: `1 + null`, wantRebuild: `1 + null`, wantValue: 1},
- {name: "Arithmetic 11", saql: `null + 1`, wantRebuild: `null + 1`, wantValue: 1},
- {name: "Arithmetic 12", saql: `3 + []`, wantRebuild: `3 + []`, wantValue: 3},
- {name: "Arithmetic 13", saql: `24 + [2]`, wantRebuild: `24 + [2]`, wantValue: 26},
- {name: "Arithmetic 14", saql: `24 + [2, 4]`, wantRebuild: `24 + [2, 4]`, wantValue: 24},
- {name: "Arithmetic 15", saql: `25 - null`, wantRebuild: `25 - null`, wantValue: 25},
- {name: "Arithmetic 16", saql: `17 - true`, wantRebuild: `17 - true`, wantValue: 16},
- {name: "Arithmetic 17", saql: `23 * {}`, wantRebuild: `23 * {}`, wantValue: 0},
- {name: "Arithmetic 18", saql: `5 * [7]`, wantRebuild: `5 * [7]`, wantValue: 35},
- {name: "Arithmetic 19", saql: `24 / "12"`, wantRebuild: `24 / "12"`, wantValue: 2},
- {name: "Arithmetic Error 1: Division by zero", saql: `1 / 0`, wantRebuild: `1 / 0`, wantValue: 0},
-
- // https://www.arangodb.com/docs/3.7/aql/operators.html#ternary-operator
- {name: "Ternary 1", saql: `u.age > 15 || u.active == true ? u.userId : null`, wantRebuild: `u.age > 15 OR u.active == true ? u.userId : null`, wantValue: 45, values: `{"u": {"active": true, "age": 2, "userId": 45}}`},
- {name: "Ternary 2", saql: `u.value ? : 'value is null, 0 or not present'`, wantRebuild: `u.value ? : "value is null, 0 or not present"`, wantValue: "value is null, 0 or not present", values: `{"u": {"value": 0}}`},
-
- // https://www.arangodb.com/docs/3.7/aql/operators.html#range-operator
- {name: "Range 1", saql: `2010..2013`, wantRebuild: `2010..2013`, wantValue: []float64{2010, 2011, 2012, 2013}},
- // {"Array operators 1", `u.friends[*].name`, `u.friends[*].name`, false},
-
- // Security
- {name: "Security 1", saql: `doc.value == 1 || true REMOVE doc IN collection //`, wantParseErr: true},
- {name: "Security 2", saql: `doc.value == 1 || true INSERT {foo: "bar"} IN collection //`, wantParseErr: true},
-
- // https://www.arangodb.com/docs/3.7/aql/operators.html#operator-precedence
- {name: "Precedence", saql: `2 > 15 && "a" != ""`, wantRebuild: `2 > 15 AND "a" != ""`, wantValue: false},
- }
- for _, tt := range tests {
- tt := tt
- parser := &caql.Parser{
- Searcher: &MockSearcher{},
- }
-
- t.Run(tt.name, func(t *testing.T) {
- t.Parallel()
-
- expr, err := parser.Parse(tt.saql)
- if (err != nil) != tt.wantParseErr {
- t.Errorf("Parse() error = %v, wantErr %v", err, tt.wantParseErr)
- if expr != nil {
- t.Error(expr.String())
- }
-
- return
- }
- if err != nil {
- return
- }
-
- got, err := expr.String()
- if (err != nil) != tt.wantRebuildErr {
- t.Error(expr.String())
- t.Errorf("String() error = %v, wantErr %v", err, tt.wantParseErr)
-
- return
- }
- if err != nil {
- return
- }
- if got != tt.wantRebuild {
- t.Errorf("String() got = %v, want %v", got, tt.wantRebuild)
- }
-
- var myJSON map[string]any
- if tt.values != "" {
- err = json.Unmarshal([]byte(tt.values), &myJSON)
- if err != nil {
- t.Fatal(err)
- }
- }
-
- value, err := expr.Eval(myJSON)
- if (err != nil) != tt.wantEvalErr {
- t.Error(expr.String())
- t.Errorf("Parse() error = %v, wantErr %v", err, tt.wantParseErr)
-
- return
- }
- if err != nil {
- return
- }
-
- wantValue := tt.wantValue
- if i, ok := wantValue.(int); ok {
- wantValue = float64(i)
- }
-
- if !reflect.DeepEqual(value, wantValue) {
- t.Error(expr.String())
- t.Errorf("Eval() got = %T %#v, want %T %#v", value, value, wantValue, wantValue)
- }
- })
- }
-}
diff --git a/caql/set.go b/caql/set.go
deleted file mode 100644
index 73db0b5..0000000
--- a/caql/set.go
+++ /dev/null
@@ -1,139 +0,0 @@
-// Adapted from https://github.com/badgerodon/collections under the MIT License
-// Original License:
-//
-// Copyright (c) 2012 Caleb Doxsey
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy of
-// this software and associated documentation files (the "Software"), to deal in
-// the Software without restriction, including without limitation the rights to
-// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-// the Software, and to permit persons to whom the Software is furnished to do so,
-// subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-package caql
-
-import (
- "sort"
-)
-
-type Set struct {
- hash map[any]nothing
-}
-
-type nothing struct{}
-
-func NewSet(initial ...any) *Set {
- s := &Set{make(map[any]nothing)}
-
- for _, v := range initial {
- s.Insert(v)
- }
-
- return s
-}
-
-func (s *Set) Difference(set *Set) *Set {
- n := make(map[any]nothing)
-
- for k := range s.hash {
- if _, exists := set.hash[k]; !exists {
- n[k] = nothing{}
- }
- }
-
- return &Set{n}
-}
-
-func (s *Set) Has(element any) bool {
- _, exists := s.hash[element]
-
- return exists
-}
-
-func (s *Set) Insert(element any) {
- s.hash[element] = nothing{}
-}
-
-func (s *Set) Intersection(set *Set) *Set {
- n := make(map[any]nothing)
-
- for k := range s.hash {
- if _, exists := set.hash[k]; exists {
- n[k] = nothing{}
- }
- }
-
- return &Set{n}
-}
-
-func (s *Set) Len() int {
- return len(s.hash)
-}
-
-func (s *Set) ProperSubsetOf(set *Set) bool {
- return s.SubsetOf(set) && s.Len() < set.Len()
-}
-
-func (s *Set) Remove(element any) {
- delete(s.hash, element)
-}
-
-func (s *Set) Minus(set *Set) *Set {
- n := make(map[any]nothing)
- for k := range s.hash {
- n[k] = nothing{}
- }
-
- for _, v := range set.Values() {
- delete(n, v)
- }
-
- return &Set{n}
-}
-
-func (s *Set) SubsetOf(set *Set) bool {
- if s.Len() > set.Len() {
- return false
- }
- for k := range s.hash {
- if _, exists := set.hash[k]; !exists {
- return false
- }
- }
-
- return true
-}
-
-func (s *Set) Union(set *Set) *Set {
- n := make(map[any]nothing)
-
- for k := range s.hash {
- n[k] = nothing{}
- }
- for k := range set.hash {
- n[k] = nothing{}
- }
-
- return &Set{n}
-}
-
-func (s *Set) Values() []any {
- values := []any{}
-
- for k := range s.hash {
- values = append(values, k)
- }
- sort.Slice(values, func(i, j int) bool { return lt(values[i], values[j]) })
-
- return values
-}
diff --git a/caql/set_test.go b/caql/set_test.go
deleted file mode 100644
index b03810b..0000000
--- a/caql/set_test.go
+++ /dev/null
@@ -1,97 +0,0 @@
-// Adapted from https://github.com/badgerodon/collections under the MIT License
-// Original License:
-//
-// Copyright (c) 2012 Caleb Doxsey
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy of
-// this software and associated documentation files (the "Software"), to deal in
-// the Software without restriction, including without limitation the rights to
-// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-// the Software, and to permit persons to whom the Software is furnished to do so,
-// subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-package caql
-
-import (
- "testing"
-)
-
-func Test(t *testing.T) {
- t.Parallel()
-
- s := NewSet()
-
- s.Insert(5)
-
- if s.Len() != 1 {
- t.Errorf("Length should be 1")
- }
-
- if !s.Has(5) {
- t.Errorf("Membership test failed")
- }
-
- s.Remove(5)
-
- if s.Len() != 0 {
- t.Errorf("Length should be 0")
- }
-
- if s.Has(5) {
- t.Errorf("The set should be empty")
- }
-
- // Difference
- s1 := NewSet(1, 2, 3, 4, 5, 6)
- s2 := NewSet(4, 5, 6)
- s3 := s1.Difference(s2)
-
- if s3.Len() != 3 {
- t.Errorf("Length should be 3")
- }
-
- if !(s3.Has(1) && s3.Has(2) && s3.Has(3)) {
- t.Errorf("Set should only contain 1, 2, 3")
- }
-
- // Intersection
- s3 = s1.Intersection(s2)
- if s3.Len() != 3 {
- t.Errorf("Length should be 3 after intersection")
- }
-
- if !(s3.Has(4) && s3.Has(5) && s3.Has(6)) {
- t.Errorf("Set should contain 4, 5, 6")
- }
-
- // Union
- s4 := NewSet(7, 8, 9)
- s3 = s2.Union(s4)
-
- if s3.Len() != 6 {
- t.Errorf("Length should be 6 after union")
- }
-
- if !(s3.Has(7)) {
- t.Errorf("Set should contain 4, 5, 6, 7, 8, 9")
- }
-
- // Subset
- if !s1.SubsetOf(s1) {
- t.Errorf("set should be a subset of itself")
- }
- // Proper Subset
- if s1.ProperSubsetOf(s1) {
- t.Errorf("set should not be a subset of itself")
- }
-}
diff --git a/caql/unquote.go b/caql/unquote.go
deleted file mode 100644
index bcfd3f1..0000000
--- a/caql/unquote.go
+++ /dev/null
@@ -1,82 +0,0 @@
-// Adapted from https://github.com/golang/go
-// Original License:
-//
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the https://go.dev/LICENSE file.
-
-package caql
-
-import (
- "strconv"
- "strings"
- "unicode/utf8"
-)
-
-// unquote interprets s as a single-quoted, double-quoted,
-// or backquoted string literal, returning the string value
-// that s quotes.
-func unquote(s string) (string, error) {
- n := len(s)
- if n < 2 {
- return "", strconv.ErrSyntax
- }
- quote := s[0]
- if quote != s[n-1] {
- return "", strconv.ErrSyntax
- }
- s = s[1 : n-1]
-
- if quote == '`' {
- if strings.ContainsRune(s, '`') {
- return "", strconv.ErrSyntax
- }
- if strings.ContainsRune(s, '\r') {
- // -1 because we know there is at least one \r to remove.
- buf := make([]byte, 0, len(s)-1)
- for i := 0; i < len(s); i++ {
- if s[i] != '\r' {
- buf = append(buf, s[i])
- }
- }
-
- return string(buf), nil
- }
-
- return s, nil
- }
- if quote != '"' && quote != '\'' {
- return "", strconv.ErrSyntax
- }
- if strings.ContainsRune(s, '\n') {
- return "", strconv.ErrSyntax
- }
-
- // Is it trivial? Avoid allocation.
- if !strings.ContainsRune(s, '\\') && !strings.ContainsRune(s, rune(quote)) {
- switch quote {
- case '"', '\'':
- if utf8.ValidString(s) {
- return s, nil
- }
- }
- }
-
- var runeTmp [utf8.UTFMax]byte
- buf := make([]byte, 0, 3*len(s)/2) // Try to avoid more allocations.
- for len(s) > 0 {
- c, multibyte, ss, err := strconv.UnquoteChar(s, quote)
- if err != nil {
- return "", err
- }
- s = ss
- if c < utf8.RuneSelf || !multibyte {
- buf = append(buf, byte(c))
- } else {
- n := utf8.EncodeRune(runeTmp[:], c)
- buf = append(buf, runeTmp[:n]...)
- }
- }
-
- return string(buf), nil
-}
diff --git a/caql/unquote_test.go b/caql/unquote_test.go
deleted file mode 100644
index 8fca868..0000000
--- a/caql/unquote_test.go
+++ /dev/null
@@ -1,126 +0,0 @@
-// Adapted from https://github.com/golang/go
-// Original License:
-//
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the https://go.dev/LICENSE file.
-
-package caql
-
-import (
- "errors"
- "strconv"
- "testing"
-)
-
-type quoteTest struct {
- in string
- out string
-}
-
-var quotetests = []quoteTest{
- {in: "\a\b\f\r\n\t\v", out: `"\a\b\f\r\n\t\v"`},
- {"\\", `"\\"`},
- {"abc\xffdef", `"abc\xffdef"`},
- {"\u263a", `"☺"`},
- {"\U0010ffff", `"\U0010ffff"`},
- {"\x04", `"\x04"`},
- // Some non-printable but graphic runes. Final column is double-quoted.
- {"!\u00a0!\u2000!\u3000!", `"!\u00a0!\u2000!\u3000!"`},
-}
-
-type unQuoteTest struct {
- in string
- out string
-}
-
-var unquotetests = []unQuoteTest{
- {`""`, ""},
- {`"a"`, "a"},
- {`"abc"`, "abc"},
- {`"☺"`, "☺"},
- {`"hello world"`, "hello world"},
- {`"\xFF"`, "\xFF"},
- {`"\377"`, "\377"},
- {`"\u1234"`, "\u1234"},
- {`"\U00010111"`, "\U00010111"},
- {`"\U0001011111"`, "\U0001011111"},
- {`"\a\b\f\n\r\t\v\\\""`, "\a\b\f\n\r\t\v\\\""},
- {`"'"`, "'"},
-
- {`'a'`, "a"},
- {`'☹'`, "☹"},
- {`'\a'`, "\a"},
- {`'\x10'`, "\x10"},
- {`'\377'`, "\377"},
- {`'\u1234'`, "\u1234"},
- {`'\U00010111'`, "\U00010111"},
- {`'\t'`, "\t"},
- {`' '`, " "},
- {`'\''`, "'"},
- {`'"'`, "\""},
-
- {"``", ``},
- {"`a`", `a`},
- {"`abc`", `abc`},
- {"`☺`", `☺`},
- {"`hello world`", `hello world`},
- {"`\\xFF`", `\xFF`},
- {"`\\377`", `\377`},
- {"`\\`", `\`},
- {"`\n`", "\n"},
- {"` `", ` `},
- {"` `", ` `},
- {"`a\rb`", "ab"},
-}
-
-var misquoted = []string{
- ``,
- `"`,
- `"a`,
- `"'`,
- `b"`,
- `"\"`,
- `"\9"`,
- `"\19"`,
- `"\129"`,
- `'\'`,
- `'\9'`,
- `'\19'`,
- `'\129'`,
- // `'ab'`,
- `"\x1!"`,
- `"\U12345678"`,
- `"\z"`,
- "`",
- "`xxx",
- "`\"",
- `"\'"`,
- `'\"'`,
- "\"\n\"",
- "\"\\n\n\"",
- "'\n'",
-}
-
-func TestUnquote(t *testing.T) {
- t.Parallel()
-
- for _, tt := range unquotetests {
- if out, err := unquote(tt.in); err != nil || out != tt.out {
- t.Errorf("unquote(%#q) = %q, %v want %q, nil", tt.in, out, err, tt.out)
- }
- }
-
- // run the quote tests too, backward
- for _, tt := range quotetests {
- if in, err := unquote(tt.out); in != tt.in {
- t.Errorf("unquote(%#q) = %q, %v, want %q, nil", tt.out, in, err, tt.in)
- }
- }
-
- for _, s := range misquoted {
- if out, err := unquote(s); out != "" || !errors.Is(err, strconv.ErrSyntax) {
- t.Errorf("unquote(%#q) = %q, %v want %q, %v", s, out, err, "", strconv.ErrSyntax)
- }
- }
-}
diff --git a/caql/wildcard.go b/caql/wildcard.go
deleted file mode 100644
index 1a4d4cb..0000000
--- a/caql/wildcard.go
+++ /dev/null
@@ -1,158 +0,0 @@
-// Adapted from https://github.com/golang/go
-// Original License:
-//
-// Copyright 2010 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the https://go.dev/LICENSE file.
-
-package caql
-
-import (
- "errors"
- "strings"
- "unicode/utf8"
-)
-
-// ErrBadPattern indicates a pattern was malformed.
-var ErrBadPattern = errors.New("syntax error in pattern")
-
-// match reports whether name matches the shell pattern.
-// The pattern syntax is:
-//
-// pattern:
-// { term }
-// term:
-// '%' matches any sequence of non-/ characters
-// '_' matches any single non-/ character
-// c matches character c (c != '%', '_', '\\')
-// '\\' c matches character c
-//
-// match requires pattern to match all of name, not just a substring.
-// The only possible returned error is ErrBadPattern, when pattern
-// is malformed.
-func match(pattern, name string) (matched bool, err error) {
-Pattern:
- for len(pattern) > 0 {
- var star bool
- var chunk string
- star, chunk, pattern = scanChunk(pattern)
- if star && chunk == "" {
- // Trailing * matches rest of string unless it has a /.
- return !strings.ContainsRune(name, '/'), nil
- }
- // Look for match at current position.
- t, ok, err := matchChunk(chunk, name)
- // if we're the last chunk, make sure we've exhausted the name
- // otherwise we'll give a false result even if we could still match
- // using the star
- if ok && (len(t) == 0 || len(pattern) > 0) {
- name = t
-
- continue
- }
- if err != nil {
- return false, err
- }
- if star {
- // Look for match skipping i+1 bytes.
- // Cannot skip /.
- for i := 0; i < len(name) && name[i] != '/'; i++ {
- t, ok, err := matchChunk(chunk, name[i+1:])
- if ok {
- // if we're the last chunk, make sure we exhausted the name
- if len(pattern) == 0 && len(t) > 0 {
- continue
- }
- name = t
-
- continue Pattern
- }
- if err != nil {
- return false, err
- }
- }
- }
- // Before returning false with no error,
- // check that the remainder of the pattern is syntactically valid.
- for len(pattern) > 0 {
- _, chunk, pattern = scanChunk(pattern)
- if _, _, err := matchChunk(chunk, ""); err != nil {
- return false, err
- }
- }
-
- return false, nil
- }
-
- return len(name) == 0, nil
-}
-
-// scanChunk gets the next segment of pattern, which is a non-star string
-// possibly preceded by a star.
-func scanChunk(pattern string) (star bool, chunk, rest string) {
- for len(pattern) > 0 && pattern[0] == '%' {
- pattern = pattern[1:]
- star = true
- }
- var i int
-Scan:
- for i = 0; i < len(pattern); i++ {
- switch pattern[i] {
- case '\\':
- // error check handled in matchChunk: bad pattern.
- if i+1 < len(pattern) {
- i++
- }
- case '%':
- break Scan
- }
- }
-
- return star, pattern[0:i], pattern[i:]
-}
-
-// matchChunk checks whether chunk matches the beginning of s.
-// If so, it returns the remainder of s (after the match).
-// Chunk is all single-character operators: literals, char classes, and ?.
-func matchChunk(chunk, s string) (rest string, ok bool, err error) {
- // failed records whether the match has failed.
- // After the match fails, the loop continues on processing chunk,
- // checking that the pattern is well-formed but no longer reading s.
- failed := false
- for len(chunk) > 0 {
- if !failed && len(s) == 0 {
- failed = true
- }
- switch chunk[0] {
- case '_':
- if !failed {
- if s[0] == '/' {
- failed = true
- }
- _, n := utf8.DecodeRuneInString(s)
- s = s[n:]
- }
- chunk = chunk[1:]
- case '\\':
- chunk = chunk[1:]
- if len(chunk) == 0 {
- return "", false, ErrBadPattern
- }
-
- fallthrough
- default:
- if !failed {
- if chunk[0] != s[0] {
- failed = true
- }
- s = s[1:]
- }
- chunk = chunk[1:]
- }
- }
- if failed {
- return "", false, nil
- }
-
- return s, true, nil
-}
diff --git a/caql/wildcard_test.go b/caql/wildcard_test.go
deleted file mode 100644
index 3e2bf96..0000000
--- a/caql/wildcard_test.go
+++ /dev/null
@@ -1,55 +0,0 @@
-// Adapted from https://github.com/golang/go
-// Original License:
-//
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the https://go.dev/LICENSE file.
-
-package caql
-
-import (
- "errors"
- "testing"
-)
-
-type MatchTest struct {
- pattern, s string
- match bool
- err error
-}
-
-var matchTests = []MatchTest{
- {"abc", "abc", true, nil},
- {"%", "abc", true, nil},
- {"%c", "abc", true, nil},
- {"a%", "a", true, nil},
- {"a%", "abc", true, nil},
- {"a%", "ab/c", false, nil},
- {"a%/b", "abc/b", true, nil},
- {"a%/b", "a/c/b", false, nil},
- {"a%b%c%d%e%/f", "axbxcxdxe/f", true, nil},
- {"a%b%c%d%e%/f", "axbxcxdxexxx/f", true, nil},
- {"a%b%c%d%e%/f", "axbxcxdxe/xxx/f", false, nil},
- {"a%b%c%d%e%/f", "axbxcxdxexxx/fff", false, nil},
- {"a%b_c%x", "abxbbxdbxebxczzx", true, nil},
- {"a%b_c%x", "abxbbxdbxebxczzy", false, nil},
- {"a\\%b", "a%b", true, nil},
- {"a\\%b", "ab", false, nil},
- {"a_b", "a☺b", true, nil},
- {"a___b", "a☺b", false, nil},
- {"a_b", "a/b", false, nil},
- {"a%b", "a/b", false, nil},
- {"\\", "a", false, ErrBadPattern},
- {"%x", "xxx", true, nil},
-}
-
-func TestMatch(t *testing.T) {
- t.Parallel()
-
- for _, tt := range matchTests {
- ok, err := match(tt.pattern, tt.s)
- if ok != tt.match || !errors.Is(err, tt.err) {
- t.Errorf("match(%#q, %#q) = %v, %v want %v, %v", tt.pattern, tt.s, ok, err, tt.match, tt.err)
- }
- }
-}
diff --git a/cmd.go b/cmd.go
new file mode 100644
index 0000000..1dea175
--- /dev/null
+++ b/cmd.go
@@ -0,0 +1,78 @@
+package main
+
+import (
+ "log"
+ "slices"
+
+ "github.com/pocketbase/pocketbase"
+ "github.com/pocketbase/pocketbase/models"
+ "github.com/spf13/cobra"
+
+ "github.com/SecurityBrewery/catalyst/fakedata"
+ "github.com/SecurityBrewery/catalyst/migrations"
+)
+
+func fakeDataCmd(app *pocketbase.PocketBase) *cobra.Command {
+ var userCount, ticketCount int
+
+ cmd := &cobra.Command{
+ Use: "fake-data",
+ Run: func(_ *cobra.Command, _ []string) {
+ if err := fakedata.Generate(app, userCount, ticketCount); err != nil {
+ log.Fatal(err)
+ }
+ },
+ }
+
+ cmd.PersistentFlags().IntVar(&userCount, "users", 10, "Number of users to generate")
+
+ cmd.PersistentFlags().IntVar(&ticketCount, "tickets", 100, "Number of tickets to generate")
+
+ return cmd
+}
+
+func setFeatureFlagsCmd(app *pocketbase.PocketBase) *cobra.Command {
+ return &cobra.Command{
+ Use: "set-feature-flags",
+ Run: func(_ *cobra.Command, args []string) {
+ featureCollection, err := app.Dao().FindCollectionByNameOrId(migrations.FeatureCollectionName)
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ featureRecords, err := app.Dao().FindRecordsByExpr(migrations.FeatureCollectionName)
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ var existingFlags []string
+
+ for _, featureRecord := range featureRecords {
+ // remove feature flags that are not in the args
+ if !slices.Contains(args, featureRecord.GetString("name")) {
+ if err := app.Dao().DeleteRecord(featureRecord); err != nil {
+ log.Fatal(err)
+ }
+
+ continue
+ }
+
+ existingFlags = append(existingFlags, featureRecord.GetString("name"))
+ }
+
+ for _, arg := range args {
+ if slices.Contains(existingFlags, arg) {
+ continue
+ }
+
+ // add feature flags that are not in the args
+ record := models.NewRecord(featureCollection)
+ record.Set("name", arg)
+
+ if err := app.Dao().SaveRecord(record); err != nil {
+ log.Fatal(err)
+ }
+ }
+ },
+ }
+}
diff --git a/cmd/catalyst-dev/images.go b/cmd/catalyst-dev/images.go
deleted file mode 100644
index 57def36..0000000
--- a/cmd/catalyst-dev/images.go
+++ /dev/null
@@ -1,6 +0,0 @@
-package main
-
-var (
- avatarEve = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IArs4c6QAAIABJREFUeF7lXQdUFcf3/p5iRRSUxBJjLz9jrFFjiz0axZ7YY4m9xFhiicZYY0fFDsbeS4wNe4saG/YWhCBIEQvYggJS/2f77OzM7nuAJjn/PccjPN7Ozs698917v3tnxha17ZBfSlLW6kAq1Mum/WxTf04FbMo3UmEjfhY/FX9Plf6Tf5Y+J9oSnkHeZ2hP/i7vc+J+G6Mt8TP1+VJ/TPsmtyE9juqb3I72HOP4GO6zye9v6IfWvtpHs7Ehx1wYQt14au9lOtbEuNPvRrZn0xTA/gGTxoY9YKISmCkHeR/xYrr2yM6rg0oKiaFo8oDaJ0zyXRWhGZVA9x4GIchjQAuSo/ySJlJjo3t/euIQgrYUJmNsqH6RSkBOalEBkhMFBDDRNPKlKMEbB4lEAg6q6JSA+I46QKRysZRN+rs0A8j7pd+ZSiArpR4lFISQ/mfNaOPn+ndSdZ2ptPr30CsBB1GodoyKoxe2Jje9Uqv9ZrYnyFp+56htR/ySE7OIJsBcmMYHGJBAB/eKcMgXJZXDiDi89oyCVhRAD/GSFPkzWlUaVQE5wqQUVBUyfZ+ihAw01MO2XklZ5ssSVe2a0RZIoJvIkhLYorYe8UtOkhRAubg2x0EoMtNCnlCVfqh90EafMDuMmUvZTUnYDJ/AgAR6BDIqiTaoTPSglY6HBBqUqL6JbpwpAXN9L7Udo/Lr29PQxzDWxFhJCiAgAM/BIz8300KmgyfDDKV5eofRDjNBOn+mgs5gYZIznpztTCGQporlRNPmivRjeLBuh5mwo488MyW+hqAASaIJYNlUwtYynT4rZ8zCXhmcRQK+mZEINYiKHaP9ElpReW2Z3Wdw0FjCoG288jt/XJg2W4cibNRiRg9yH5kCZvpTWttKe7aorUf9khKcRAUwhnKkANler87mMkwEr+O8cEhx6lhwq/oohtCUcOIsQ1jZDzGgkvWs1cEyhQL8UI0X+mqOmGR60xGyWji4moIwnvNk61G/5ATZB1AbMsKVzjYyZpgpzFAvZ5gFDGGYe9dk/0hbp/cNpOdwTAzDlKj+B/l+XCTg8SIWjpjOnBECUR0wRZmtHFxiDLhIwDDBujAVsD3ZclSOAvTawQ+lGDBtAUVGh8wIRTryyIKg0SMBY+booJ1UAiNks2au5DQZZ4syU+0nwbQ2uDwHraTEZNFQkOPbmIXAjHdgoqqoAAICkPZYdXh4SMDSTtrrZoVYRvKIS7aQdpERvpAmS4VQQ1jGc0JZcG8BwTokIN6D97kC6+Tk4CiVIRrg+gQWE4eMfJhMqd6ki6H/ky3HDCZAxxrpXkTGKdX5MnHKaA3kwjHlaJL3mdk2xcmhFFeCccUJI30DckaTKEbCMMuc0MhoNDPKeBnCLZq6NjWdig3goAbdFvO9GY68TlZK24QiPdl0zC9ZyQWQ2mzQVulmHvxpdl2ZXdRgGjx+8/aMJkhTtjTRxtzBt8oBcBTHcobpvXkWnJuRRe+MNn606ZhfqqgAJDxYOA80bUwMLo+MsGYa7eADqCiDRRYZlZRQRHtpYxmF3hptzGQa2bSxzn8ix5mh0EYfhSdTAmUebTrulyoygcpF0KzMWWvHzNWhB2FvOTkADTpJJZCfQ5sSri3mhHGqQ2nht1jOaDuQgJO4Ekc2jbQxb+KYJuNo5WASafL4CgqQIiaDTDJVXI/4HSaQmDQ0hVSqwrJYOV4CiZVXIGcOh/8wi1QMNDTLITb6T6rZU5WemKmMUFmZsuxQl5Wap9sDbJoCUOESMfPYdp+BBARiWDpEPCfG8KIkEjhmJljEjWVoZYkEHGHyYJ2JYG+DNtYjlPpYXv5GRivbo40KAuiJBY2pYzNZRgGbpGJJm2owK47k48mX5OXj+fSs1A1HkIDFMViRUPagh3namukAy/wAb2Lp72EoKWPcxfEQFECtB2A4FsbO8OJl3otzbCeTNjZqMc8JkuwqnzX7b9LGbOUSX5UeLxKhaZSRx4YpOyq0tj3aeFKrB1CNij6UM2/o/xNtTCo5yTEYHUz9TH2XtLHSRxJZ+bSx7eGGk34pahTAeCkLWlZhEE2LHLjIkhFMo3nG0ow2Jk2C0aGyjzaWZqfeNGm1FY7UThIOGidaMkMCdq2CeeWU2N7DjSf9UuR0sDQIehZNgVrNwTb6BOrfzLKB1CBZF1cwZhXHcdT10QakpqbgxevXiImLR0zca9wODUfwk8dwz+2CAq6uyO+aB64uOZHNKQuyZ3FCtqxOyJbFCc7ZsxnLzHjZRTMI5oWqtNkiohaNfbXHeydzA5Q/QZsDXkQify4hgBwGkgkQ+5wNM7uvh0uDksiDlC7lIQbUPyIcV4ODcTEgEGf9/RGfmCjqxXvvucPd3R1JiYlITEpCUmISEpMSER8fj5iYGKSkaIP54Xv50KxqRdT9qCzKFM6PfC65qGpheYJwZjy/wodfbmdEEA6fQZFYPJ+AGeXwqHthsj/c8LukAHRJMwXbhgeSWm4YEHKg2PDIs5FmBAcNgVF/v8DO8+ewx88PYVFRcHN1Rdu2rVChQnmULVMaZcqUhosoRPaVkpKCFy9e4Omz53jyOApnz57H76fO4Oq16+INVUsVQ/eGddGiRiV2oak823iMoTVqagUkEopJ/WSHqoQjSDOajlQbkygkyFxVAFbiglKCDCGLdB0glIOuzjGELbJSAbgdHoqZO3fgdlgonLJkwcABfdCuXWuUKV0KNo204Are6g8CMgSH3MeyZSuwd99+5M6ZE7XLlcb4Tq2R39VFv7bBQgk0ufJMJ6UE8vgwlYdZ8ay8DUVokeMsfoXMYGpOvu3hhlN6H4C5uMGcZuUnicyRQEIBEiHMaeMb90MwdOVyPI+JQd26teG1YA4KFMiPzJkzW8k0zX+PjY3FiZOn8OOEKXgW/RSd6tXEhC6tkSmTIiI7y+YYQjAKmUz3kuOi/ex4AomTpldM8MP1sgJQDpYa+tEdl3/n5fH5HnHaaeOYuDi0mP6T6NgJ8L5j20bkyZM7zUJN643HT/yOvn0HIy4+Hj5Dv0HDSuXkpizSyJa0MTlDjWynwR+zWIFkX7Wx7DxKCiD4AEY41imB7u/vhjZOTk7G7ktnMXnbJhQtWgT79+2Eu3u+tMovw+6b6+mFhYuWoX75MpjXvwtyZsumQqyeM/n308Y2QQEEJtDojTMKNbg+AcUOcuy3IgF71h28SUpAryWeCHryCCOGD8HQbwchU6ZMGSbE9DYUFh6O9u27IDH2NTaNHogi7wuKSVUF0+NFeuMMm2wdGhuZQr3CEf6AWcqe9A8erj8tVwTpSRk2sUPaaJNslokDx1ocynrxxlPGIJtLTuzYvhHFixdLr7zeyv1CKPl19z64evkKpvfqgBbVKupJIcrHsS5QNZoCfrWxGW1MoTnRD9rvskWuPa1fHUzG55yKWpUs0mm4iTOkhjf20ca1fxyG3HldcerkYdMw7q1I1cFGk5KSMH/BYvHfrG86on2dT4gW9B6+zpaTYTRjHKVGSP5Arxw8xBabosy12BQzbwKICiCaAKaweatXNA1jxfNGWGKUR1FOp6Skqaj2wyDkc8+HK5fP/qsg30ovBAWYM3cBfL77Bg0q/M9iSTejOEWX8OEl3Fg5B3a2VlIEkjEkIwzi58i1f/glJzpVN+b8WXkB4wxmhXJmBIiKRlTnUlJT0HH+FDi5ueDk8QNW4/2v/PvM2fOwcOFSrPu+P2qVKyn3kUdpWwmTmrXaoBp9DV0oTUxODhKQzr1NUQBlRLlIwOkAT6BmiyyV2S5Bk8Ddp+KnbatwPjQQly6eRo4cOf6VAranU1u27sDoUeNwcvZ4vO/qwvAJ5IlFC4dcsMlAR8OiWZ3ZoJbQO0AbywqgrQ5mzWimXSGTJOpiBgpyWHVwOk9Y0vI9l89i6q/rcPSIL8qVK2vPOP+rv9OjVz/cunwFeycNRx5nRZmplLA6cyyQgFkIq7w+FXXokIAk7zRUUAdOqQiKXCOYACoXwCSF9E6IgbeWnRbzVcZG7Y9PTMCnPw7E2DEjMWL4t/9qwdrbuTdv3qBh4xZwzZSKLWMHyfS0lV0nTG5Gl6Xp0FuTo+Bz2SLXnJX3B6B3yLAjK5VW2pjQ/p93bcCpoNu4cvkPZMmSxd4x/td/z98/AA0bN8eSwT3QtOrHmj+gRkSs9Qic8jh7q40pVLGHNpYUQKkHIENAhhaqtpvjwUtvySukoBBEDlcqjfkG8+fNQtcuHf/1QnW0g8NHjsGO7b/h+pKfxZoDenwsizgcRAJV/lRERzp9GkJL8pAVQN4ljNROyskQO69oIsOBMT7EOoE0euMyXI74C/53rjo6tv+J7wscQYWKNdC9Xg1826qJYYc0fbjsCG1snEzGyiyOD0A7iJGrBRNArAwiYIQZzzMXjqaNNv70x35Y7r0ILVo0+08INC2dXLzEG9NnzEHgL3ONW9GZTbgMpY15VcgCEbT6nOoE6jcp4K/2VUNFy8pe0vvUV8Wcvnsd3631wqPI4LSM63/mntevX6Nc+U+wdcwgfFy0MFMJ7MoBEHkG414NxDhzVkiL85pB9tkiVp/T1QOwK3J4cCLbEdpc0KGLIi7i874rZiA6JQ4Xz//+nxFmWjr68uVLNGrigSxJCTg8bax+40yz1U7kmHJpY30+QF8LY5aYItLXEasEBdD7ALzCUFWOGUAbN54+FEu8vdCoUYO0jOu/+p6wsHCsXbcJ+w8cQmTkQyQmJmJSt3boWr+2Y04yRwn0s9kqvNTQgZXgs2kKoK/OMV18SEYBRCf1eQEObSx/v+q4nvjzzlW4ubn+q4Vp1Tkh5t+9ex/Wrd+Mm7duQ6gzFP4JV/0K5fBz9w5iNXImYXpykmvp33sojbSxcFv4qvOiCTDy94xcAOX9O5ZA0szIX4/C0GnRBAQH3UHOnOmnfZOSkpGSkiwmj4R/Ql0grzZQEZBQbCL+EwQm/yy0I3ju4r/kZDx79gxRT6LxV9A9XLt+A9eu3cCjR491OpEtSxa45MyOvHly4YualTFp6UpsnfgDGlWqzCgkdWC7GnJi2UsbEw68hBKkb8Aut7NFrDrvl5zAywYytmk1KIHxIWZIICCL77U/8NOOFXgQ/leG1fOtXLUWkyZPF4Wankvoe7asWZA9a1Zkzyb9L6wXyO2cAy7OOVDQ3Q0lP8iPCiWKoHyJD8XPyatQ044oVegD7Jk2VVMAu4RpUmVFCVZfvs8q9pR9MzsSSBICJCh7BbPSlIwQj3RKOJkoQy6bgL+dficwffcaPHxwL0OqeBUB3LhxC9179kVKwhu0qvMJKpUuatCFLFmckDNbVuSg/uXMng0uOXMgV47sRMGn46q07/R59Jo4B0EbNshbv72F7WrsDR8to7RUwQRc9EsVt4ljV5gwyQoHQw2lbaWtfVf/wMRffRAZEZThOf9nz55jxMixOHzkGCqVLobuX3wmQrO767spIhVMR5bqzXB8/lxULVla1iATj9xiYydp8jtAGzMLUPnVxrbwXy6qawP10M0uIGBuaOggbXz01kWM3bI4Q00APVcjIh5g2vTZ2LPHV0RM5xzZRSgX4D2z4CtkzoTMcmn3rlmjkS+Pi+l0j37+EsM8l+H3y9cR9+YN3iQmIa9LLlQtVxobfx4HF+ec4v1CajvTJ59jVKeOGN+lK5UOdmRpOmlaeZyMeRWWGdOoWBVZAeQdQpQhIHLTGulghRBkKticNj7jfw3DNsxDRFggnJwUjtxxuHXkjvCIBzh79gL8/f0RGhaOQ4eOovSHBXF00U/IntU6CeVSp6XoMI7p2QkNqlVGsUL54bNzPxZv3YXXcfFYNm4YBnVoJXap9fCfEPX0BQ5Mn2WsyrFr9xCrRSR6v8vowJPMn/xdg6mWlEpSAKosnBkvSvrNXBWj1Qjas3A0Ff6RIei29CfcD/4T2bNnd0SO6fpudHQ02n/VDaEhIZjSrxN6eWQMB7Fy90EMnrEQXqMGY3DH1jhy4TI6jpmGe+s3SlGJYdyskIAx1vbafWa1MUMJZJNvC1/hpxWFWmQDVU2jEEK1U7S3StKPhAbGJsSj7pQ+CLx7A7lzm0NvuiQu3xwe/gCe87ywbftO0S/YMnU48uZ2zoim1TbW7juCPlM8kXz5CMIePUHRFl1xdvEilPuwKLXimGVa7UgEmdl2RZhqb/SRATdRJ6CRoADWBSH6DkpOHWGX5A5Iz2c4HARxpMSmdaf2xfkLJ5E/f/4MFQTZ2P37oZg5ax727PWFex5nrBw/GDU/LvPWnhf1/CXec8sDgU/IWdsDs/v3R6+mSqKLX/mTdt+LMsu0XCjYZ+5VqCqATnBKZ61SupLATeN+DvvV0nMYps2dipYeX2S4QPbuO4AlS71x8+ZtVCxVFCM6t0CR9/OifMl3t76gzYifgCQb1nw/Vttc04Cc7MJb9mER8liTLCwvR8Al7Iy0sYYABHywGCSjkLXZ7hhtLN3Xdel4VPqsGhZ5CWnS9F9PnkRh1uz52Oe7HzExr/B1s3r4oUdbuAuref+Ba9Xugxiz8Bf8tWYjZ8dyaj0hT5g6dGWUetuhBLwJKjmBPpcMFUHiM5mZKnPv0hEkWHBwEzaePZDmdLCQYLl0+YrI/t26dUcklJKTkzCgTSNMG/j1WxG5EOJ5bf4NY7xWiFTx0h++Ez1/Fu18869gVOrUHzd+WYXC+dwlq6nMXnFsrcvCrZHAaJrt3qRCMReSAvCygaRNt64RtFxORmhr4KNQdFk6zi4FSExMguDBR0VF4+ChI1i7biOeP3+B3DlzoPgH+TGgbRNMWOyDQu+545j3nLcifKFRwdH7ZpK+fZ8JI9C/vQfzmVlrNMOWCZPQsGJl6e/MiioW02rHWJPmRBamZo71vphaUs4qMQvzuSSngzk3KQ/i2hX5PrvoYT2y1JrSE3v2bkeVypV0A3jvXrC4QcPVazdw+vQfuH79BpKTU8R4vVThAqIn37lJbVT/qJR4nzAznao3g//O1SgjFl28natG9yG4dCdA13jZooVxd9da5gPr9x2JkgUKwbPvYPnvZFW04sAx0rm6rV0JuXDrLe0vOaf3crCF+VzRCkLMwkBSg3V2ibRlRmUwLhDRtLvV/GEoXaEMtm1drxvAkqUrIC4uDpVLFxP5/NoVyuKjYh+gZOECXMnej3yEYoX0f3/56jV+XrkRAfcj0KpeTfRo1RRC9i6tV6nW3XEv4qHu9jy5nPHi9B5mk1NWbMCizb8hcM0mKUPJY0w5hSGGsNte2phABB3ySNNFx+XoFYD6guVu2QwYYt8jPVhPTQI7Lh7BohPbEBx0WzeAo8f8iN92/oZ7vy5Jq6zE+4TM3MPoZ2ob/b9sCe/xw9KcgOo0dhq2Hz2l61OVsqVwdYs3s59nr99B3d7DELppO3Kpq52U0jhe9bQyQVhOoiZA/TgTKMFlGtm0saQAQjaQuwKFtfiQdboX+QAKCVQWS/lcekmBWq0xqRvOnz2hWwIuVNFUrVYHj/b/kmYF2Hn8DL4aPcVwvzBbhVmblivicRSqdh2EqOcvxNudMmfCCZ95+KxqBWZzKampcK7tgbPzl6BYwULaeYGcfQB5G3FJzjUhZPF3/gmp9ETTHE7jugNb2PKr4sIQgwdPM09kJ7ghi0lygrif7GD1iV3Rt28vTJ3yk24QCxQqgfHdW+G7zq3TIiuMXuADzw07DPeGH9yCwvnfS1Obyk2e63fg2d9/Y1iX9sifz820rcqdB6BRlaqY0LEnURFE+gJ6JHg7tDGJEAT3IKCyogCqfHTEDcn2mSGBfTkA4zZowMy9K3ElOkhEAfL6sGhZfFL6Qywe1ReuuXKJxRiOXAfPXUKLb8cZbnl6chfyWmT+HHmO1Xd7TZqD/WcuImDVJumr9JpKXWjIOPJFnYiMWo0MOCbXFrbsmrQ0jOwYs5CAQQfTW8uRLJWsUWZVxsLXI54/xpeLRuLmDT/kzesmZuvmzp2L9es3iHG9cgmVOcO7fYn+7Vug+AcFrcZd/HvpNj0RFP5A/W7tSuVxeuUCZM7M32rmQdQzdBg/H/s8x1qmiO3pxJlrt1Cvzwg83elLfF2rDxCHSUFUdfwY28mT6wQsfS95xuucemONpuigqwqgEBNmWspcqsQgNHgkkkoba5CUmJyIWlO7Y+6cGYh9/RJDhw5F0/p10blhLZQrXgTlixfB42fPIQykz6++OHfzDqYM7IkJfa3JnpjXsRjttQK3gkJQq2I5TB7QE7ksahCfPHuJit1H4cSSSfioeMaElNk+bY47K9fDzVlmJU3WVGb8LuekMkg/k+ZeUgD17GAGs0QpBNtZ1OcOHKWNv90wA7cfBiIkOAD7l83FFzX0vAA50wRF8Nq0Ezs9J9szAR3+TkxsHEp3+A5CkUitChmTOHq/8ZcY3LYthnoI6x+1sTKEeZzFG6Tp0BCVnUewQnKNFJIdydBl1ww8gDpqTHvlwIw3sVGkklwPvYtW03ti5eQx6NO6qfh4t/ptERMbi9SUVGTLmhURh7cir5w6TkxKRhant7c5ZPXe4zDky6bo5dHQYQVi3fDlqMk4feU27q7cpHcE1eiINaZyS1zamPInGCl6qQUi7FQ6R8o1dOk15iZRtBLoZzWLeWL5CCZHtxLm5FzAZXT1Gor4CwfFnb6da7cUy7ZKFC6I2ztW4or/X6j2UcbMRnsk+v2i9Qh+8Bi7Zo+25+uW37n8ZyDqfDMMkZt3m4RzlI02oY1FUGZsymG9CxkjGygogFQPwF8LyIYVCySwcCpJKJq8fT6CXtzF77944usJM7Hn93MQwjUBBVZNGoXebTI+ZWwmtTM3/EVH8Pbm+XDPoIhBqBMMWrsVeXLmopTAPHQ2SyDR8T7/yD4GEigOYujS62oyiLvNK4/np7hpnX3icgXUCiRbKkasmYJsrgnYOH0sNh88DleXXGhR91OxwkagXn//ZZ7lLMvoL3zcbST6tW6CYZ1aZEjTtqpNMLFnL3zXUvYDyIjJZPJpC3E1x1mhc/UKYH5kvRRtMFhGRQEMbBODeVKhh+q8HpI4HTUJXabvXIinSZHY7jleN9j7z1zAV2OmIu78u981bLXvCYxfvgURe73hlAGbUTfo9z2ePX+Fk7MXS+/I4wNorp4RIhrtejpo49ClN8UowGqffqXTloyhgQuwpo1P3j6Ln7bPxP2DG3UKcOAPP3h8Nx6pV49lyCy0txHByZy4YivW7P8d/lu94OaSNuqYfJ5QIDLFZwOuLVlnqAUwULc69OSs/OFsG+MQbSzoYeiSm+oeQVb5ZLuVQIIE3X526keMkvPHL6NQbUxzBP66EaVLaBk9Ic0rLrR4R6XjbcbMxmX/YAgcvvDsPXPG4NPyyuIOe9WH/b0XMa9QpHlXhKzdacciUcbCWlOySEFdXrUxP3dAKQBvFQoB60xGii4SdZw27rlkGBJtcTi5epYYAfwTlyD0P0MixDV/GX0Jawdyf9Yaj7fsh018PTJqkp00cuJQP+sQmieDNNDGttAlt9Rj44xnBpGCNyqB3rHQZrwKaZSt0+1XS5mKh88fo+m0LmjwaRXsniclhlIRA0Coq9dD8MlL19Gwulxlk9GScqC91FQgOPIRXsTEinULZr5CbFw8nOu0xJ2Vm/F+bjduIS3PxBo2iswg2tgWsuiWdni0oFkkOcGw5+r4MKp9aa9UMhnSHZIGE1rP0NbeS0egTvUymDykC1IRj1intXDKURNZY0rBBunsn/M3/4Tn+u1vjQm0R/7PY15j+7Fz2HTkDALDpAKR/m2bYGq/TtzbFQW4uWIDCuZx52wYZVHmTU0o0atXZKRzsqXPJRw11h1oqWRAVADy3ECdE0EoAO+EEEm61rSkwXNl3DNp21zsvXoIUSd+BWxxiM28GrBlRc6kjrDBFQ+iolHc42uM7dUJ0wZ/Y4+sMuw7YY+isf34ORzxu4nb98JEP4G8yhYthFPLjPUHyncUBQhZ/xtyZRPWEbISQrTAMoo2lto1oIvgSIoKQO0TaFz0QcI7Iy1Jayaz9Em7T2WxqMKI569eoOY4D1QsWwK+C3+Gu5hqz4TkFBe0HPYjDp+9iL7tWuCXn0amWbBdJy7ErXthyJ4tq1hjWMjdDYXc8+L9vLnF/5Ur7HE0gsIfIiAsEi9fxUKY9WaXlQIIOQa3+m0QuemAmP3TxoCY9dzFNuQks6KNSSViT0ySD5AVgFEVzIj1jbNYfpgyMryUJWVKzCjLV/GvUWlUE/FsP6XcWnDOhGvmd/3xQ6/0bShZwKNfmpXH7MYqZYrj4AI9j0F+XygPaztyIv703m7fmccUQihIqw4lZYKNn1PmnGU+BL0KWSiYAFkBVEGSM54BS++ANq4+pQP27d2BvG6uKFmyJOo3/AIh9wIRtiftZWLCmxRuPVAMLTP6Gt+jHb4zYQ2n+KzHRt8TODdvlfxoJWRjFXqkYTm4xboDA9cgM4O2kIW3KQWgEj0GJ0O2JyRTyGMNdZ/zSp8oWyhravP5/dHySw/MmjFVHDDlQIb01AkK7ZTrPNwSztOiHHvnjkUNuUyddf97jb5ElRJlsWnMNO3PvLo+UpgMJGDTw+TBkiQys3INGm0sKYC4MIQqPCSZJnVtALlggXgIRwHYnLX+PhukHbUUiFP6cdL/AlZe240zp46IHymFooHbFyK3vBlDWgTlvesIJq801goyheacC/ly5kRcYiLCX74wOH7KPfly58L1DZ6mKWohF7B02Ch0qNlUnwwyW2RL7sRCyoeMrGi5KelfgwkXZGfcrsYWsvCOenSsNggcRkm18RTRY+gEuQqGFfrJSmBCGz+PfYkWXv0R4H8dzrLACxUuhda1K8J73JC0yF69x8wPcMqUCV9X/gR9q32Koq5u0vZuAJ7FxeJkcBCmnjiK6Fi9Q/hT7y8x5Et+xjL8cRSKeXTDvdW74Jwth0WoLY2N8QQX+XOxN2T4p00oFlmkTCyNNtAQV/hMUwBmvEg81EBFmp+4pKWbAAAUcElEQVRyrXswM/5nIAiBJIITWGdGZ6xd44Mvmn0uNtembUcE3fXHnS1e6VKAK3eD4fH9TEMb2ZycsKvrN6hUkF9zKKBBn13bcCpE2uK2RKH8+MNnmunGUp8PHotz1+/g/pp98jM5ZpZOBIkTi1NnwSkt1znqBFlkVCp5kod43RE3i+Z5l+rkZpkBOtyjkSCdtHHbxYPRyKMR5s6ZLg6csEdf5aq1cHjBeFQqUzxdSjBg9grsOX1J18aJPoNQ1t2+kvESnjORhGQE7Vgs7jjGuwTxOdfywLyB3+GrmsJeAfryOWnI2AkfLW5/i7RxsJe/X0qik3xyKO196pkpI0lExpmMGU1pMGvhg+qdMrR94dF1uBh1G3+c1rKBFSt9iiLuLvD1NJZ8O6oRvacvx4Fz0lb1/arVxOTGUjma2fU8Lg5tNqxGWMxLnF0xDUXySyt/edfUXzZg0vJ1eLxZegd+0Qb/iHkWgWOYmGLrjlcb2yQF0LaJM0cCVpKHv42ZOigmyQsjw6i9yPmgqxixdQbCQwPUDSWvXLkGj1ZfYsvUYWj4iXISh5XY+H+fv8UXXtv2o5SbO8bXb4TaRYpBMAX0FfzsKbbcvAafSxdQsVQR7Jw5CsLegmZXQmIiPmjWGe3q1sfPXYex2Tiz0nrCJBqXfUvjxFMOSUE4yELQxpICCPsE8sI6Ey+VJzyuUIlZbtZxxV6FRIej0/JhuOx3BoULf6CO9Td9BuLS+fO4uHImnHOYC8Ee1YiMfo65G/dgy9GzEJzAMu7vobhrXmTJnFl0+P56Go3Hr2JQ5sOCGN7ZA23rVbdrf8Mfl6zGrLVbEbRyr+T8MU0mv5LH6LjJQueQdBLEOFgvKChAsrxRJNeLNPFKzWljIyxJnSTCSRPaODYhDg3ndMPe3dtRo0Y1VZZPnz5DzdoN0KZOFXgO7WGPjO36Tmz8G5EmPn87EH/JSR7hxq8a1UKxQu+heMH37WpH+FLA/XB83KEvpvUahG8attN7/ip+m3P9hjCaHLsMoo1twQv8tQ0idHVjNC/AXyZmjgTmuQM+Ekj31Z7RAWtWe6Np08a6wRf2+evVe4BIvwo07L/pEha9ftCsEwq7v4+9Py6V6xsoQoaaCGSGjuX5s1ZdWyXo7KGNbcEL7koIwKvi1YVwCttk9EqN+wBos9/sRAxFcPSCB8UkNZzbDfMWzEK7ttImjOTVo2c/HDl6HKG7lyNblnez4aQ9itZi6HgcOX8ZVxZtQYE87xlSv9pSeU4pOK0cpoUe6aONNQUgYIlHQohf4dK7Jl5sOmjjLxb0wg8TRqFnz27MsW/YqDnuBgRCYAiFzZ7/6Wv2mq34afla7JuyEJWLfCR1x6IOQgsNzUvz9RGTPMEsaGPeQV9KRGa7N+8utTCEpHvZJAQ7K8ib8Q4iAVU93GZJf/Qc0N30UMmy5SojC1JEOjYjKnjTqkTfz/fGgk07sfWHWahXrgbH7mvjYVaDyYRve5FAp3QW6w7uzQvg7BRqzA2oIGHG7LEYQwPlq2mvMkNU7aY83CaeX2P0uOHo3683Vy7CXgLJibEont8Vx709HV5KnlaBk/f1nToPQuXv5rGz0LB8Tem1DMgnvbcpwjKEJ407n343DRFphpei8206BVDeSPmSDu55laU8jbZP09VBVJdCaaiTmJyAurM66OhglrAEBZg/tAvmb9iBiCfROLRkFiqXVU7vzgjx8tsQqn2FZV9/Bofi8DQfVCzyP12yh7vYxmBOiaIPe80sabaJn2mzYxrdBc8LIM4NJIXGJ3jeCm0saz4ZFTx//RJfePXAwQO7DDuJKSIRDmbq03cwHvquEM/q6TttPtb7HkHPVs2wetKotyr9NXsOYcD0BShd+EPsHe8NZ7HUi1J8JvqZI4GOcdUhQjpoY7IdkmASEYCZDtZgmuf4GTYqIhkmUiPJBxo0VXsOHYmEPX2ADt6Dce3KORQsyN4hrHuPvjh2/AQe+mqFIkLVsLBl++v4eHEv/w6f18uwtQVCiOcfHIqKnfohky0TRnfsie++UMwTyxGW6XITR5iHEmlyuCmFsVoubrs3L1A7Nk4VjgV8k7OV80B9fG9VbWxUAuH+PdcPY/OdfbhgcrZghUo1UNQ1B3y9Jhpmu+CULd+xV6wAEnYXGdC+pbjimHegFA8uBBFGRkXD99QFjPLywavYONT+qDJWfvszXHMKp56xHGc9/8G2+wwkIBDDwJFY0sZke7wEkt6xt93zDJRNALmEixSIORIYnTerBJLcSRObpWhtr9UjUK91fUydPIEpm5iYGPFUzrM+U1C0AJulEw50mLVmGwRePvrFS3HhaaemDcSdvT4qXlRUCHrXMEHA9yMf48+Q+xBq+faeOif+7ubigo6fNUefJh1Q2E3b9Yu2ubzaSTPnTxwODkpwt+2lHUoD0nJSySTnE+RpggCykJgslGU+mqFEBvpSQxq9IqUiLjEeDT07wnfvr6hWrSpTAXbv2YeBg4aZbicnrPMTtnfddPC4uKNX/JsEvJ/XFaEPHyMhUduDSNh8IhWpeP73K92zhM0nMyETFvadiI8L/w9ZM2dhEjvKTSxmkxnhEBNAs/kk8nI4AVallvhwE6bRhDa2BXkG+aUkaOlgw0IC0/1sGIwgrTTM1a76FzWERjZg2e/rcCz0rJgIEk7dYF3f9B6I48eOImzPCh56i5/HJySg49hp2HfqvPo9odLHOWcOcQ2gsGxLqTwW1iEK5woJfxdyA4L5yJ4lG4K8hSNuzbNvbIbPJA6X4Z4H9Xrih4JuVeOMs9wR2tgWNDfIL1moBzCJW43bu9lDFqWPNq45qxVmz/oZPXt05Qq3Zu2GqFWqEBaM4HMEys1ChDBguhdW7krbUvP7PmfgpG5LQ2bwjMqsTm7GQlh2RlDqJXcrWUYRCTd3YC9ZJJsLWQGkegBevb5i41hUpDFk0aA/TV6sDRj961ScCfIzndXKH8/6TDPdQ5huZMuhk+g71VOc3Y5cu8etQLWSFexfBSUOKGfWMjOgsmV5x7SxTgEMCxBVVeYI1a4EErVJEcX0sfa8XXaKvfs2uQTNPzIQfwScR9je1Q4zf4JJ6Dd1PoTtZIUj4Oy5+n3eGZM6CUUdlJOrvg+JBOwVOaZV0qo5IKMHfZsG/kWZxSxzYCcS2ILm3JO3iXME1hmwx3PwDKZFXyVs3BdPapvnEf/54C7O/+WHPZf3o2QJV+yaL60bSMsV8uChyN3/euwMHkY/NW2igNt7GNisGxp+XAslCxTRkIDBlqryYEE37awpUiWrpmj0YN6jKQpzmZncBs8BVcadUABZuelOm5E4REdZ3q8EIKzVqbKQaYQhNZp47sV7l7DgwFLcDr+D129iVUFtmzUBHZum/+i3NwkJuBV0H8KWNGdv3MH1gCAIB0Dxrvx53FG1ZHmsHDJL/gpRi0fPZIYweXn8tNDGYvOUryF1yqK0XPUBRARQFoYo0GVP7Z8eBXhbwhpgS+6cWj/A6Dzd1lde3XAl5LpBHiG+Gw1nBKQFCeh7hIggPiERiUlJYnQg8P1CXT99NapQGxuGyxtYMe09uxjG7l3BSVKINJ3qxGGV5ltVW+l9DRkBZAVghmwUo6XhG7XLBYPypJkrcsY7QBuX/b4Sdu48jzbtaoh8v3B98L47Ig5tzQh529WGcB5w5kyZ8SYxQWQSTx4LRIPGpXHy5y0oXbCYtQfPQMJ0IwGJzjpTZP+6A1vQnGBdSRgZprDCEmMkQCIBIzzS2SL2Qged+aDqBS/cu4Qui3vixtVnyJPHDY0+/x+CgwPQ8rOa2DF3oni8+7u4Bs1cCO8d++Dmlg+nTgQhd25XfOFRCbbXsTgyab20gojhD7AiJ3UOMTx+PnQzYJ1ECAIVFBPA3eyDvC9wTrBfqnh8vL6mXHkZXpinQbusAFQHWCGg0SGxpo1n7fPEgYAT+OOUtBJHuHxWzMHSZTPw5k0sfuzTDW0a1EHF0m+nLlAo7py9divW7D2Mep81hfey35Azp7RlzdOnUahRqyDm9hyHjnU81M06tPCPwc7JE0JTWrbD+65oY1vgrGAxGcTlADhMoKYYxPwjYZ1nswyfc2yW0JYN+GJWK7Tq0hNDv9XnA968iceKlZ7w9d2GgMDbyJrFCZ+UK4P/FS+iduhNQiLmjxyA/Pm0jR8cQYsqXQbgesA9VKxYHSOHT0GD+s0Nty9e+jNWes/B+dm7kFtUDNa6fGKSkIkjWhmYNK8+LDR1tmkUsOOgalUBxDcjIYzDOfPYKul+4hgTAyI4Ths/e/UM1SfWwW+/nkPVKrW4souIuI+7Abfg53caEQ/uI/JhOArkL4RDh3ehQbVKOLnC8Z1GL9zyR62eQ5E1azYE+sdznx0fH4fanxVFq0r1Mb3b99L3dNGMSVmd0irPgSQnixpd8GoM2UhsWW0cMDNE2yRKp5EWtWQ6ZVHexL5dKRRlIUdVF8oA2HVlN5YeXY6QqFDcvvESuXLldmTyov1XtXH12nk458iOV2fJwxrsa0bYkkY46UO4dv92AZUrfcq9cdfujRjxfXf4Lz4GlxzyjmZMJ1cWEoWC+lltPu5Wdp21ibQZbWyTFICzQ4gulqQWdDAdGHmMLM0GIzwSRiE1BfMOemH5cW8Ih6wVK1oLj5/445NPqmPDusP2SU4+R7BkGSc1Ylg0ZgiGdm5n9/3CcXOu9dqo33dzc8e1y1Hc++vUK4ZXz59hdo8f4PFJI8NZwTzYlhpk7KRqcRSMCjL21GYqIlEX9xJIIYhUUAClIsj+jYm1RniFj2InKZOiIh4FeQ9fPMQs3znYf30/crsURPPGk1Dn0wHi1x89+RNzFlVB58598PPUZXYJsXffljhxcr/63VIffoC/9ghbtNp3TftlIyYu19PR436YgwH9jNvHL1k6HYsWz0DhQlXw7EUYXrwMR85sOTCmbX94VGuE913zqQtD9H4Te2cUrYfWSMA8Oo40P6IQeGG8HLYHzgw1yQYq9otklUyQgLmIhNA4RSFk50QgWeYdmg+fkytQpHB1eHw+Ff8rbVyhG3jvBLzXtEDLll/Bc84aODnxD3+MfvoENWoWVGe/MqBnVnmhbhXrxaRCjUDeBm3FFDF5OTu74NyZ+8iTR3MoDx/ZjYGDv0SvLltRpUIH8etv3rzCyT/m48ad3/Dw8W24OedG+1rN0O/zTvggX34mdyLNaEVQeqqcueDGLtqY4Xsw6gJsATNDxdXBzNU7Om0ysoPGsI7kpzVzoA4k0fEroVfw/eaReJUM9Oq6FSWK1jGdnhGR1+DlXRdued2wyGszPq1Rj/n9YcO74uDhvUhI0O/i0bp+bexZYJ03OHrhCpoOHqtru27NwbhxeycaNWqMhQuk078OHtqJQUO+Qstm09G0AXt3sJhXj3Hn7gGcOrcIkY9uoHX1JhjR+huULlRUap/mDRhnKtmXQJInmepbkA45j3uREUBSAGGDCJZdJrNaetvB3fZV9VbZOYCk5CSM3T4a+2/4on6dEWjVbDoyZ7aPzElOScT6bV/j+q1fUatWQ0ya4IWyZbVZHR4egvqNSmFIn+Nwz1sCF6+uw4GjWq1g2MEt+NDkzECh+CN/46/w7O8Y5MtbAm1bzEW50s2QNaszQkLPYYF3HfjuuYLfdm/A6jVeaNFkCr5obKxFZGnm/bAL2LZ7IB49vo3qpSpgatfhKF+kjGnkJJlRIyLwF5RIMrJ7ZZfgawTMkBTAntCFHwLys3ckkRQT/zfaLGyF1ymZMKTPUbznnraduJ8+D8HSVZ8j+uk9uLvnR88eQzF0yI/o1bsF7gU9xqghl9XCz+TkBNz8cw/WbumMPLlyikfQCDQy66rQsR+CI19i3LBbyO1SADZpV2f5SsWqjV/hlv8epKQkY+yw6/igAP9wK1b7wnE4kY9uYdWmrxD9NAifla+Ord97GVcQvQ3amPAHSN/MFjAjTNoggpy5DOdBRSwdbJlU+1I7XMW8iUHVSRVRqnh9fNdfKK/KmMt7bQsEBh1HUnKCiKnDB57hmpNZCysh8tFN8ci5KYN6qhtACT0ZNMMLK3cfw/xpcaYdEwTnnk86tTw91/3wC1j8SyOkJidg8ygv1ClXVRaBgwkkJuHGQAIObSwrABEGWpAYTLuvu4cwFfLnfz0KgIdXc9Sq3gdd2qdvo0feoCclvcGT6EAUKsA+x1e57+KVtdi+ZzCKFsiLC+sXI1+e3Fi0ZReGzV2KccNvo2D+8umRq8P3rtvaDVdubEbzqvWwoO8E5BZ5BBPyyEAOmUO+ZEaMMpE+F02AgAB0NpBRIk40QsK69MYEElA262bEDXRY1had2/0iKsC/4Xr1OhoLfT5DfFy4uOt46+ET0KndelSpmL5taNP6bkHBp7B+WzcgOQYbR85D1RLCqmIrJKAKQtKIBLaAGeHqDiE6B4JapctbgCi+NIc2Dn92H20Wt0D7Nt6oXsX6pM+0DmBa7hMQY/fB0Th9brEYw4/+9orDC0bS8lzePUL4uGVXX1y9sQ3eg6ahVQ3yzELWsTsU9Z5G2tgWMD1cPjBC6RqLgLCjXIza9vTpq2h4eDVB1Wp90ab5nIwcqwxt66zfClT6qC1y5bJ/+5cM7QDV2MFjU3Dw+GSMbNMb37fprV+DoESOGVhtLCsARQWTNXlkbMk8hVKxL5otik+MQ2PPOsibvyKG9DkCm+3tnfL5NoXxT7X9Z8BBCM5t86r1sXKotEeiYmpVcagMH4EODlcbA7a708P9UoR6AJqUINeRizBPOBLcEnIJPQZv6IM7T8Px40j/f2oM//PP/fvVI0ycURjdG7bBjK9HGsdfNr2kD2ZOzLGrjW13p0dI28QxhKxL71JOBs+zDI4KQsvFn2PM0CsoVKDif14Q/+QL3A87j/nLa/N9AstkkDxp1ZDcmEoWFSBZrggyevfmOX5RZ6hkw8eTSqByxY7o0VF/BuA/OZD/5Wf7HpmAIyen4+iUdfjow5I6n8CQZeSVnOuKVDSlEH76P3A3f+7a/V7/AAAAAElFTkSuQmCC"
- avatarKevin = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IArs4c6QAAIABJREFUeF7tfXV8Vcfz9nNxDV4oUqx4KS0upUjRtlCkeCktFHf34kFbNLgVSZDgxZ0iheAeSCBIIAQnaPT97NHdc3bPPfdG4Nf3e/pHw73H7s7sMzPPzM46Hq7a7hcdlbw0EAPtcOh/O7S/YwCHekYMHNTf0qfSv2Pk/1HX0387yDPo65RrpEvUv7XvlftR50jvqHzPvJfyfOn+2rvI16v/1r+jfqdyP/mW5ndj72ceH/a3ytdr9+K8h/Yb1WG0M87U2NLjzIyZ4f3FMjDLzaErADtgujCpz2kBcIXJE5pBOejraAVgPucpoC4kvmAMAjAoGitkVpjaqQbFNQuTVTBdoQXvS99Pmxz6JFInjVmY+iSymlBkcvHeUb6Glht9P8NEfrhqp19UZNLSppfgzU7OTGGQgEYIARJYaacICczIIQ+46V5OZrR8jSpEZzPaMGicmajdi/mtIkXUBcIgATMJaPQUIS57jqWwRehJT+TQVTv9oiOTSSbAWpg0QlAaL5q52uf0QNMCsH8/HtRaCVO3ItQgKrMxzpBAg3vafLiBBLQZ4I6Zouw2ZzRtJkzKwXmWI9Rnp190lKwAmmmiH8Yggdl+ytfwlEcwS2lBGCCSC4mUT2CCXO69eHbfDLtc2Kd/B+37KLOfa3qU8RH7EbSCUO9B+z0GdOH7SnbGWTCpuOOs3I8oQJSEABxI1QaYtn2iAVaVw44tVmHMBjqQUxOx91aVTrWB3MFXYFkXND04AlNg1ymkIZ9RAAOEc4WsKwGl24rjTI+tUXF4TqYNX0ZTaoEMLRXAakDoAebAkxmGaSjj/DiTwDhw6tSmWaOO9AjOzOY6vIxtpk0JZcsZR5g1BWb4FfgAGuzyHToV0kXoo/shvCjGyTgTMxbqs8svKkJ2AtlQzgibYgdKBKdyWMQJL0WfW0UZ2mwyoIcQgg3CZqYbMVm0OaMcPoGttfKRZMWyAb+GZ7Lv4CRkdWI6uSGwEJ2o3ysrgOIDKIMk9q45wmRmFZ8D4Gmv2eHkwJkIWTg2jado4rjbGY8hEKbA4TUpB2UiLB0x4+/TUJA1jTpHoaKEIczTwkE3zEao9y7NB2CJE/7NNLh0wQ5qSKDNQifabhGRMLON46wa/QFWCQwwySWgVDKLrwTOoyX74aWG/kaFtjWpDJNNM9csV6EqjzYuBrk5Qr13yyZAFQ4TLtl5SCycQhrWjSEQbSYMM0WDTiskoOHPDVgXzVwTOop8Ber36PdiHVF1wpmQSlMAO8JkFVVkjkWI6wjx3u0XQ0yAcJCpBxhtHa1NRgeLmu3/o42NEdYHRBvLCKDkAmhtNsGrrAjWwqSVheLt/4u0scEfYCHWONMVZ1g0yQwTiY1K2OjC5HCa/A2+nyakjUNW7vGLUXgAxtng2Gt7ZBFfCeLWdhrYMcrD/x9tTE9S57Sxg1UAXdtMA6mFiRwkoOGeCifl0PJ90sbO+HzKq+Z4+KxDaYN0ESRn9CyheTbLM1owa40JpHigjSUFiFZMgDBJwfG2dQ9W5Nj8/0Mbv3j9Gk/DXiJ3tszysIgcWCYut0Pc6GMrTiDxUuyiSUoTZco594kJkBTAgiXjmgM7D+ErgZnTF/xQCk1YRLKDLPz8hMhLZnL5BoW3qgs4fP4yGg+biDfh4WhcpTzG/NYCubJm5qZptVoGXkbSZSSgmVLWUVdRl41Y+NlFx/3l+/xilHSwBtcMU8fXMFM49J+mjVnoJr/9duhDdJ8+H/vPXFDBUPp/imTJMKVLG7SpW5XJyZsUmBsmmvl6cYjIR14r9OHRxpICRKv1AIzNtkjqMDNTZaXoQfrv0sYRUVHo67UQPvsOITwikhE+/Q+iBB1/qGWuNPrAaGNFAZR6AM2w28vsaXpgk5q1dHgsMo8JQRuL3003JaP+Wok/12wSCt34xUbPQfimVHG2RI4bSptts+xLWMC88j1LgZuRSvVJdJaXdXwpBRDZYedIYKRf+dw1C29mW+yEUWQcK7NvwX0HE9XLewe6zpC2pTGSpQ558gRTfTdi4d87EB1jSCA5UYWsGdPDf+VMJE6UyIQEZkbReSbTpKSKLyGMImwkkBz3l+/XTIA8o812SCcRWJhnnA2DxuocNO9+guc48SOESBDHtPHrt29x6MJFTF61FqeuBdie8bwT5/XriJY1v5a/eg+0sTOZOu4vIwogU8GMk6C9sCx0KxjWuXl6BhlSpCZIY82MPELOmEZBNpLLNIrJIv05+jtEx0Rj/9lz+Gvnbmw/4YfIqKhYCV69uHrJ4tg0frDyTxVNOZOCGh+e925mGkWIbTQdgnFW5Ou4v/yAX7SUCzAUJAgFxtoZGZYowdvOAbBwy4RIdNhpuh+tBIrSKMqjJ7SowRGlcJXfu+HwEfjs24vT1wPw+MWLOBE6fZO0qVLi3vpFejm8iCyiJlxCVhs77i87oBWFmuJUDqzzkECUH1AHwhbBZJjFrlYby4rIQwgWCYJCQzB93TpsOnoUL9+8ibOZbqU5t9cuRAaPVPopdkvtmPGPp2pjXQGU97PSUOMg0zlol8giauYy6OE+bcwr64pGNN68e4sD585h4qqVuHQrKM5nuJ0bnpw/BYU+yWFaMMNNICV0tfG9ZQf9Yuh6AGNZlhFeGVvthLgwZb+MpkKdnXFLGwfeD4bP/t1YvmcXHr14bkdG8XrOYa/xKJE/j/yMD6za2HHvr4NyNpARlihfTcellHOh2S+RE6fMeJFt55gaa5/A4OABkqCX79kB7/27cDPkfrwK1NWbn144FZ/mzKbTw4ZxECGBPKzqJGNDUNcSSGI+QVIA2QmkYdliRmqGnRO3C/L+8UkbP3j6BJ6rlmLDkUN4E/7OVdkkyPnXVs5BtozpFQTQUZAZF2GIqJzPyEeEpNTnqkUXVEHLaAToCmCYhVYLObUJT9+cXhjJ9QfoWjv6R7lHG/vfCUKnmRPhf/d2gjhy7mpKquTJcW/DUiSSvFq+kypyeKVxFvlIwhSywRmmeB0emjiCl/6jJIM4LJnVihIjEjhZVGFWGl0JWAjkmRnddvrfDUKD0QPw+AOw7XaU4rO8uXHEa6KyjpGeuc4d3oSoNpYUIDoiaWlRCCXDlPpTLapqpVPijzZ+9jIM3eZMwq7Tx+2M+wdzTvPqX2Nev67U0nm+EsRtxZRibWxUGzvuLf1Hqgp2p3CTv6JGUGXDKIdr1cab/z2A9tPHfTBCdeVFdk0ZjXJFCymXiEvOzbkB2lcwTzyNuBOYW5P5YHwCyn9TEcBsb2iHQlxnpkM7e765wMJo99l/y04JvfAhBo/DnqPnvMnYffpfV8b8gzk3W8YM8F8+V5mOVPMIk9DY3639AMN4yJ/zElrUhDKtuqLQm1EC5bWClx6Wy8KNdfkcgZhfTMDN21n1q2mO/KOMCHQ+6BqaeA7As1dhH4xAXXkRh8OBo7OmoGieTwSmkR07TScSuNrYQRRACgPVAkRF8Jq20cyUweuXZchXAlECiRb07UchePT8qTRABXPmQZoUKSVFmL11NcatXvhBe/fOlKFX4wYY9Wsrrv/0ITWpcAQvPqz0BzBCFMcbNzB7olpzdXBMix8VeBq8bBqW7NnIHcOcmT/C3Uehzsb3g/4+50eZcWmxAv0JXm2smwk7ZJEjePERvR6AJhuEpI6oRpCXduTAu/KMmw+CUWdER7x4/fKDFqa7L/dsiy+nOpj2ewR2P6GbVMgKYFwdzKcfWc+TFTiXzjQ5HawDE/bmFSr2b4VHL565O84fzHUpkyfHm3c6E/lww2okTZKY7RxmSJtbVRtr4xnftDFRAHV5uDAUdMrsWRQd0D4Fp9r40u0A1Bj22wcjSFdf5LNP8yDg9j2kSZUSj57piac/OndAu29JUag6CwQEl93qYMM4agtLGaTmIIxB6YwLUh3Bi46Yloe7Sj/apY3P3ryC7acOgcx8cpQp8BkqFC6BUr2a0K6kqzJ4L+dX/rI4pvTpiDJFC+Ni4E2UaNYBMVTNYCYPDwSsWMJ2JNFdfSXyYRM8Wokdx9dSnfI4p42DFx3V2sRxH8JEBbzqH05zSIP/0HxyLxy9ehZR0XFTZvVeJA4gSeLEmNSzPbo2a4BkSZMwr9G4/yis3/uP9lmyJEnwYP1q6d8iZyz27WrYpJ0ZwZWsqfQSunPIVBtLCmDoEKIzfDbifCo0tKKNTwdegqfvXJy5cQVvP9CsHS1REsenS5Man2TLgm7NG6DtD3WV6l6++l2/HYyCDdroiO8AQtevkZTGdpMKSlD6WPL8MWct/cxyMzONinLoCmCnalXWotjSxqNXeWHejlUfFOwTYefNkQ35c2ZHjXKl0KTG18iU3sMlsKneoR/2nzyrXbP696GoVbqkORHEoKozYQpmLpMN1M/hL+rlZGIVZXPcWXhUigI082RIM4q8e1GdH6sg5goYVbP3XziOVn/0c2mA4+Lk5EmTIn+u7Pg0Vw58lj8PShcrhDJFCyJn1iyxvv3mg8fwQ+/h2n3a1K6JaV07yWaAA8PmMaejJLqnAKsE1rLiVx2JWvs47iz8V18bSGkmG4bQxR/KywhJIUOiR1BtXG9MJ5wKvBTrQU+aJAnSpk6JtKlSSf/PlikjsmXOiI/V/2fOiKzk70wZkDVTBmRK59qsduUFo6KjkbFKA7x49Vq67Iv8+bF/6hR+JtBJ+pw7/op84pQ2lhRAKQvXDZh1zzpbtDGdW1DemKaNc7X7GmTAXD0I8hBn+4zPXBTKnQspUyR39Rbxen6NTv2x98QZ6Rm5s2bF2flztTpAkx22VUPB8QFEK36sqo0FzqiMAJITaIAOUXWqJkw+EogWidC0MQmXcrSt7LYgNvwxGg2qVXT7ejsXpq/SANtmjEPFEsW4p5PfUOGXHlg/ZSSyZ8mknbN40w60G0VmPeCROhVueXtTCsASYeqYi2a0ZjVik6hTkZorT8BxZ8Fx8epg5Q3c6ZErX8qnjX2PbkfPBWPtyMF0TrKkSfHi8GYQWx6fR4cxf2LBhm34vUNr9G3dRBKmejx/+Qr1ew3HiYtXEXZ4C5IQxk85nr4IQ6ZqjSROgJSBPdywHolUCXNnLqe20sD+8RFXnoCaQ+5mtbGsAMaVQVz60TDjjbDO6bxpcnwUhZi9bQXGrZ3jlvzqVCyD7bPGu3wtEcg+vzP4pmxJ29cu2rgdvabMxsvXb9CwWiXkz5UDd0JCsXrXARTIlQM750xE3uzZTPfLUKUBnoXJOY6A5ctASCE93R7LPsW2fC+Lqm6D3By3FxzX6wE0zKF8AE17FQWQfpahQISmM23Qxp6+c+C1bYVtQdAnDmjTDBN7tnf52rKtu+HRs2e4scW1574Lj8Da3Qexds8h+AfdRrH8edG8TjU0qFoRxAHlHV+26ISz/vKi0vMLFiBnFiXCoG00JUhRjC6JQ1BbYY4qdPkw92OeQyOyIkeiANHhxsWhrD8Ql/QjMQvDvKdiyV5fl4VILhjRoTVGdtIJFzs3WbhhG9qP+RPBu1Yje2bdXtu51p1zZvisR8/Js6VLLy1aLEUk/EoeViD87XnUCRc/tLHj9rwTug9Aw4uN7l5WVauy9lKoofxN/rfx+C50nT/SnbFFn9Y/4o/ecmxt5zh67hK+atsLXoO6o3OT+nYuifU5JLpJUlpOBD1ctwGJE+tunmXvhPdAGysKQG0YIWjEYLmJgSRt+7Txg2cPUarvD24NdP0qFbFp6min10ZGRmHiX6swzGuJROXOHNDN6TVxeYKjZA18lD4DrixeatgQi1fTJ25SwVRkW0wqEdfvrNqYUgD156v2nY0/zXaKtjk2W5VJiiJfl+u3Skz2zO7gF82XG5d8F2mn3wy+j63/HEe1Ml9ICZqwV2/w74XL6Dt1nsTdLx7RH01rVbF7e6fnkb4BD58+R+qUKZjIwHhhpqoNkf/jHNgxfpJux99Db2MZienJycpNVgDSJs4A13LoxychrKlIXqxr7giSr2NVhEeGOx1w4wnJkyXF66NbkUhquwIcv3AFTQeOwe0QvYwsX86P8Uu92ujVshHSUuGbyw8zXHA39CG+7zEM564FIlWKFJgxoCvaNqirT1Lq/Lm+WzBm/kpcmL9Y+VSZWJwQz5h8Mzt4vOqhuKGNHbfn+lEdQhTtMHny4rJlbVIbyQrTUjHWRCzdtxbDVv7plkxubFmOvDk+Zq4lxRhv34UjdcqUyOCRxq37Orsoz3etcOv+A+a0y+sWo0heUvnLHq/fvoPHV/UQuNwbHilTMQ0itDO5ff45awecLLjRfC2rEFFQbawoAN0sWtwnSBO2zYQRs+BUulivHCJr9z/5rZKzMed+T3gAwgck9EHsuvFoXrsqfMYPM31OTEXSMrWxYuhQ1C1VTvqeFZR8iTl7R8XwXJPBmaRWnIwz2lhGALlTKCswc8xoXLgh/wSadKBfju4WbvhcGa7ygxri7iPXl3J3a9YAMwc6d+q2HzmBZgPHIOz1Gwz+tQU8u7eLlc7wFODzAvlwbvV87n0LNvgFpfIXhFf33mZhOxOMYQGIfIN46G18a+4pNhtohBtKMdSXMCOBiM609niPXj2JplOcC9I4urmyZUHQ395IpHGs5vE/ey0QXzbvyHzRvXkDzIhFNJCxakMQqpc+1kwcjiY1+U6m5yJv+Gzfj4OTZ7Adwih+Xr2XuX0uXc1D1Vwqg+/yHkEC2tghKYAxG+g0S8VhCm0hAetUvosIx5d9vsWLN66XhgduWY58Bj+AFsyvIydj6eadjLDSp0mNp4fsN3o0qlXAnWBU+a0P7j18LH1Vo1xJ7Jw9UVn6bVbCCwE3UbJFJ9xYtkqKGszCZsNnHhHEbxDhbGs+jiNuRBAVgW7NOeVagwgBuUOjg7HbiM4ksqZAWgW0YwU8fWe5DM0t6lSHt+cQ4XXf9RiCbYdPMN+TMu03x7YjcWI5gnDnePMuHMfOX0L6NGlQolB+yzKxsFev4VG5PrZ6TkS5QkX1aIHpACoWljzZVVPKQwSRAhnG2YTiyvfkck0BFA3haiknq8dfEiYub5Juz2EaQ58/Rql+35lkkdHDA/WrVEDXZj8gOjoaR89fRu8pMr2qHjGn9whlOHvtZnQdP4P5PkuGdAjdu84dubt9DakTbFq5Ono3bKpFAryyLTarxzOdztFCfkkDj0PJla1NVHyKW3NOS/0BtF/opL2osa5cui6WtHH72QOx48xBZpCzZcyCJ2FPpXg7KioaSZMmRu0KpXH84lXcuCs7jnOG9ESnH+txhUNmX8VfeuBioN4ZbMnIAfilPlWrb7iSFHYSx7F00UKoWKKo20KnLxw8cxEOnTyPzSMmyh9zV/xSnzOhnGHbHeNYO2VfOYpk5HtueZ027R0sFCg31jeTRa7SxmdvXkY9z7bMgBMCp06FMvj2q7JSBdDuf09K5M+sQd2Rv15rPHkRJmXjwk/sEAqKcPLL/96Nyzdu4beG36Jg7pyWQv1zhS9GzVuGiMhIvIuIxPnV81FM7e7lpjrs/vcUanUZiLs+65EiaTKnTTS4MT2VR2HSygJl4U9SBR0kJZL/lv6UFMDUJUyf1VapShPcCEMb6oGCIpFqw5shICRI8uxnDuiOLk3FiZvp3uulPD05vMcPRYva1dwUj/iyJv1HY8+J03iwx9e0BsCVhz1+/gKZqzXCCa8FyJdVJ6/E7XX5ZeC8fQBMjCGDEPaqjR23vM4Y1gbaSOoYHRNBFlEYt2p74egQNX/XSoxZOwM7Zk1A7YqlcSP4Pgh87jzqJ5VnN65eGZN6ddDGXi26yJw+HYK2rmS8bFcEJDqXIAzh8/1WzEbpogVjdctCDX9BrwbN0PSr6rq5pCeLcVKYSCMelOtyslp3YLb71GQkbK2uACw0iO2Vsz5AbpAVDuDXmX1w6+lNXNv0F27eC8FnP/4G0rW7Y+PvJXv8cZZMqFmulCaISr/2wNFzl6V/N6tVFasmmNm42Egt9MkzZK3xI65uWCIVn8bmaD18Ah6EPoXPwDF6hTBDzQoQksu4KufSZoFjCmRy0NlOqTFw3Jp1xi86SqGCDfbBmRLIp/MLHbVbcRwV3jWVhzXGhN5tpMzdJ9+2RKHcOZEraxas2X1QqrtTkz+qIAg81+w0QJPLtpmeqFupbGzkxFw7YYkPPBf74PmhTSCrhGJzrNy+F22GT8Q9n81MbYCd3sZ0pik+aGPHLa9z1H4BTggETlrRrGmq5tnoe0OZks9718SZNbOlmv7c37aUoDfnR1mQskJdqQS8SN7cJhkQJ48IR+7BF/uDpJXrVCqDOl0HYc/x05jcuwP6tW4a6xuTxFDqit/h1vJ1SJ0iJUu5c3gVbWKpPyseaWNH0CxZAcwpSB2WVCSQXswqQWFEEBeqYL/oWws75owz2dsijdqi4hfFsOj3vrEWhNUNVJaPVPwSkmdyn45x6lx+9E1jzOnZD1WLKWbM1XCb0vE4pY1lBSBLw3ityGglcDdLZY82rjm6BZp9XxEjO/7MyKnYj+2QMV1a/LNoWrwqQHzfvHjT9qhc/HOMaUnlJ0Tb4NjgVeKMNg6aKSsA2yuYEjy3KtUiM0UVkfAcEVGB6ZCV47Hl9E48M3D1Z/wDQMq7yhRTe+3Ft6ji5/5ft+uNJ8/DcGACKYe3ZkxFZJEkdFOthi4rVSlEk5nnezmIApDl4aKyIS3+5BSJqENlRfywW9GIq41DnoWi/JB62DtvMqqWKhE/UniPd+0yfjrmr9+KEO+tVCho0WXNVEJOC1r5IfRiEIYscoE2Dpp5Xu4USttvg7CtKk60ywT167LfwEcURnEcMWgxtTOOXTuN48tmSb5ApOMCEsVkRyLEfyl3fOtGj0mzMHPVRjxcvZ2TGlYdZ7PfpYmCFxLGBW0cNOO80iJGoQZNuWpDrp95qEUewE3auNGkdjh54zzaNMyL2WOqIXHyQngXUghvwyMlWpcs0/q/eDAKYHKWBeG0O6VgLtLGDl0BZO0TIYHZdpsZw7iijf3vBWDD+fkYO8QDoU/eoGjdXVI+oHCeXDi7ah7I+sD/a4euACR3ISJo+EgQn7SxrADa6mD9Bdh0L/25GK40n8ANc8CjjR+HPcH349sg+HGIRAS9PLzlg1sOblcRa3YeAJJt9Jv6F3fBjHQfU59fTmm+DXZPvRev1Y+RNnYEzbggKwBvwwduOGK/2oStF7ToeC29MfW9gSePjI5E3s4VpKXYDat/ZXfMueeRtX6EmImvymHRy33RvCPKFymGsS1J63jaJ1KQ12RaKUSOR9rYcWPGRVOzaN3xMAjGWGzA8QfMTgsvp212CkXmQ0Wi8sO/RYXPi2DtpN9jpQA/DRuPOyEPcXCheyXp7j48e61mmNmtH74uXJKzCSdtfgXJOM4EMaV9rcgi2p+gJ3bQjIu6CRCcpG8R64wsogsbzKtRYkMbz9zrhfXHduL6pmXuykC67p8zF0Bi8nu71uDjzGTRpuvHu4gIfN60PY4smQ6SjXR2kA6iqSp8h5t/bULq5CnZUnAGZVWnWjB28UAbO25Mu0jtGsbad90hVD+n69LMMKYNhArhcUgbhzwLQdmB3yN0ry+yZFA2YHI28oLvSYHGmasBuLPdBymSkyINewfZLv7vf46hcb9RyJM9K04snw1SZubs8N6+F62Gjkfwim3UknJn+XobTrYoLe8CbawoAFkaRj2QiwQGKLdgpBjb79LiBjFtHBEVjmK9qmJqv87CMjBnglC/J4Is93NXnPUPhO/kEfiucjmkSCZWhPuPnmD7keNoN+oP6byRnX7GwF+a230cvus+BK9evcPagXLDKFe3xJMeFE+0saQAZG0gG2qwNlpXKOXl6VhTAEtGp850D+lXGdcTsCbGGHoOXTMKl+/54+RKtjjUtiQMJ5L1e6SyiNQcVi/zJcp+VkjqE0iOoHsheBr2EjuPnYR/0B2pJc3wDj+hZ4tGUl9guwdZrJqleiN4DxqLr4qo9t8Fh9gubWzwx2zTxjemXlbSweYVvprNVjRQ1kQyS802itHSeKKNrz24jhojWuDKusUozFmPZ1co9Hmk/cvpq9elti++ew6BFIKQI33aNMif82M0rPYValcsg5KFPzXVJNh5HqlOHjBtPi7N8UXKZEpHM1FhKHdRDmfRjSIH7fmxoI0dN6Ze1JeG0TcWxaQWZJF0OcMkxsKOGX4kUTryX50JTVD+i8JYPCLhm0zaETh9DkGWzNUboXnV2hjVvDNbPS2o6GUcbm3i0Sytgpy2IjAb1caBUy9zl4bR2mVGgvdHGx+6/g9++rO3VN9vxwFzVWhxef6aXQfQYvA4nPbyxsfp2D5BOpoqT6QTO4rgRd3Z+PsMWJfqiaqNHZICUFvHqlButs/mF31ftHHLWR3w9M1jXFyrN4qIS8HFxb3ehocjZflv0bZOfXi27ikonYtNDoCPBK7Sxo7AqVe0hSHG7Jw+EOIG0Wb6Un8xNu6Pu2rjh69CUHFwA3h7Dkbjb76OC3nF+T2qte+L89dv4vT0VUiRNLnTMjAugWbKpCpja0QICxZV2GJGdeQD/7yiN4sW2RU7oVwC08bT98zC1PVLcX/3Wnykbswc52J074Yk799p3DTs8pyD4rkKCruraybelNcXNYqWFUBU6m0i2ih5iia3I/DPq4JOoRaLQygC4n3SxtXG1EPYm9e4vc0byS3iePfE6N5Vp69cR9mfu6Jvk5/Q5/tfmQ2jeWvzGMdZeqR1KCy/FWeTDqdlZHy/TVEAuVew05awTskiWmninzaOiolE3i5lpeVbF9cudE9icXjV+es3UO7nbmherSYmtFKiFCoktt5ngYZ3atEHNwegtp8n58WONpYVwNAs2llixryZNG9r+NjTxmKl1O8dHv0WRXt+jYzpPRCwaVmcrxCyqx8Xrt/E583ao265Cljcdbw45Wth152v8OEghDRI7ofbigLQPYLoen6zVpqU4z3TxhFRESje72tpwwfSKezS2kUgXcIS8ti4/wga9h0vO4tkAAAOEklEQVSBumUqYnF30sdY5DTTNtyGMBOANnYE/uGvbR1rnNnm7J1qR+iaAFZJEpo2Dgi5iW9GNZaSRP2mzsOyv3fDa3APdEmArqAkp9B94kyQFvGDm/2GLrVb6nrHdewMs1WZveJxNiuJ9ABRryA3aGNJAbRNo4zhBeNFshW9QmXRXNuEoY0X7fPGujO+mg9Amjo3HTAaJQsXwF+jB+CzT/PGCxgs37pb6gccHhGBzcO9UCR7Afk59A4pgoSZOcuqXCpYZmcOEXXFYEk612ljR8Bkf23vYM3DNCV4aOjixPPvkTYuPagGmtSpBK9BPTRBP3j8FA36/I4Tl/xRqkgB7J07Oc4aRh48dR6thnoiOPQRfqxSDZN/GorkSUicr46Ldf8ebX44TZVTjmA80sayAkhbxxpWBzPpRx3m+e3LlbE37g9EIwiTI6DNhrkPjjqTVIny1x3EIDI6Cp92L40DC/5AFc5agsNnLqJer2FS737y+AW/90WberWkvj52F3xGx8TgxctXGDRzIeb5/i1dVzxffqzpNxNpU6TVGy0wzpizFdTUjKdRQiVntB/OTjZrJOCU6glkSKfrHQGTr3OygQYoo2DdvC6NI0zTD4ifauMnL5+i8si6eHnkbyHMk5Tv2IXeiI6JRtjL13j55o10btnPCksdSL4p96XUXZR08XoXHo7IqGgpO3j07CXsPOYHUgtAFObjTJnRrGod9KmrLO0yzGCGFndip/X6S6NPoCqOe8J0tdpYMleMAtD225SrZxHiQ6CNey0bCv+HF0DatVodakk2OYfsHEaETcwE2WmMlHfRvf9Irj+VtBGVA6TPUM6smVEsexHMak86lIs3ytChnZoQVnX9ynR22u/PZI7FfYOFW/lx9mzW/BVZARQToL0wJ99vcgjpHyqoBRQNQBzRxnm6lrC9gUTvP+Zg2kr3OoRlz5gVJyZvVNZMsJVTInZPUgjb5fGq+lrkXNT5F8e0sYwApmygkcShYZ7+zjUCIq5p4zzdSuDRvvW2d/gkjSNJA0l3jlsLDiNJInVzKKp3n3EmM76APG6iRTXizTcNy+moe8YlWSTd9vrkAItOobx+wZQDo+Eea7PskUVu0sYKquy+cABdFvVG+Am2G6gz4ZIWc3W7D8a1W3edncp8f2XmXnik0ncOM7JvbDjGoqNw3x9umMhRGmqceb6G5nK5QxsTBZCpYJ6jJqBzaY00ajxdnmT0KWgvV+T9cmyeJgnl3jEx0Wgxoy0ev7vvdpk4Kf/q5DkNj5+9sKUIhz19keejHE4KOunVvubJE2sk4EVV0tu7n0ByXJ8UoPkALCMlWtBBPzAuaGN7SHD/WQiu3Q/AppN/Y9uZXXgXGY4Nf4xCg2rutZxXpX7w1DlMXble2mWEOIZWR76sn6B9zRYoX/gL5M+aC4kTE5MgiP+N6Mj4BAbEtIsE1HkilJUfa67v5PYOlEzAREUBTF6pORQxwY9dJNBenKM8Ii+X+rzZjJ9xIvCUSTZWrWJtTWvDSaShJCkVJ02eg0MfSkvIyEE+v3LzNnO2R6o0ODVlM1IlJz1/WCXQhKBhs4XjqKIiVwloMogyK7QTzXU0aTMikqOC7tcnBsr9AdQX4DJUnKhA0XBu1wnGLMS+2rhgnxJInTYtnj9nZ2hcK4BIaUjDKLK4U5Onw4G0adOhVcXvMLSJutbPeuZpgGBg9VjUpYWsCJFrRsXd2azJIrMSOWQFUHwAgRLw27qItIzzOa0QLtLGgQ9uoOb47xHgH4FGTSri/Hk/SQ6/1q+DxSMTrjKY1PeROj9yzJzug8jISPTu2xo35x1C0iRkuTqnSMNom02I8P5pY0oBDILjQJLT9QCathqyhtIPNzhFNmnj333HYMVhHwQFyvdcvGQaRo/tDY80qXF760qkSxs/+wPRaPDqzVupaSQxCdu2nEGRInILmxq1iyL03l1cnrGLMQO6qTT+bl4I/X5pY8f1CTfYDiGiUEJoa+KXNq7uWReVatbFuDH6XsPPnj1B6za1cOHiKamPb/82zfDzdzWR3iMNUqegNmZwOBRWTwTu1p+T9YNdJ8zAsfOXkSf3pziw7zpzwZMnD1GqbFas7e+F8gW/NBR+cpJmykT4YGhjIjr/CTfMPIBFStNMXrB2i+8TmNf+yyNpXW0cERmOzweXwb/HgpExY2aTtB49CsVKn7nYvt0XAYFXERkZwZxDEjdkFVGhPK63eiWOH2lRV7jw5xg7ejZKl+JHGz16tcCBvX/jwrQdSEyIIsohFG2UoQEl7QDHBW1sMLWaWaI/N1D8CgLIFUFmB4KFbV54IeokooUdBrMgSUhVMCfVxhtPbkaflQMQeC0CiRPzN2qmJX7l6jm8ehmG+yF3sWvXRmzZuhpD2rXEuK5sK3o7eFC1fV+QELFcuSpY7X3A8pI8+R34rUZzjGzeS1MAXpj2IdLGCgKou4apNsoQOpjiT3rWxy1tHINoLD+8EksO/YU7T+5Ku4teu/IWydR1dTak9/r1KxT73AOEMCIm4unBTS6bAnqHsI3r/8UXJeSt33hH5ar5kD1lOqwbMNfmLmoW5oFDkElzxoIgi021scN/QhC/QwgDT85LxFl0YJ0fu9XGI9aPwjq/9XgXGYG6NUbiq3KdMH3e13jx8hYuX7C/sdS0GaMwbbq+OfW+eVOkrWXtHj0ne2GGzwbt9HTpMuDsqUdwOMx7Da31XYL+A9siWZKk8EiVFr2+b4ufqzZiN4wWhX4cdExo2tjh7xnkFxNFbR5N2QvnO3/QgnaPNibbx3Zb1h37Lu9D8uRp0arxYnxR/EdGVv1GpEGa1Clx/Fgwkkq7blgfBJLpg6R4Scdxu0fiUjVBCkHoY96c9ahdqyHz2ePHoShd7mP8UHcSKpXtiJ37x+Lwv7PxLpwUoDgwqHEn/FytMVInT06tLOYwrMYIKS4SSHZpY0kBjDuGaHy+oUqIqVI1CN/EJKpjpWfOdB9DvvYf/3/QdmFb5MxREk3qz0KeT8oLZfT7hFyA4w3WrjqIAgWKCc8bO64PFi6eavr+6cGN0pJvZwfZoKJOt8HMaYkSJUF0dCTji4SFPUfFyrmRNXMJ9OjA7ncUEfkWew5MxKnzPnj85Aaypc+Iyb8MwVdFSim7jBlCv/hAAru0sb/nLX63cKclyTQb5RptfO9ZMAauHoCTt86icb1p0uxxdkRFRWDZ6lY4c2Et2rTuhv79xiFNGg/msoiICBQtnhqVynXF9cADCL5/Vvu+fPEiOPbXTGePAb0/cPp0OVGhzG/4pnI/DB+fA1Wr1sAcL18EBQWgcZOKSJkiJ/p3O8k1DeqDXr95gh17R+PIiflInzIl+jVsj8YVasu9AoyThkJf+XrjTu70Z8oE5CoP/ztup3dJAdRdwwyOhm67eVy2k3Im44spDOCWs1swaO1A5M9XDS1/XIx0aV2r4b9ybTtWrP0FkVGvULNGfQzsPx45csh7CQwZ1hHePvMxY7z8viEPLmP3wfE4eWalNJjnVi9A8QLiKuGJS1dh0IyF+KxIPUno+fPqC09v3/XDH7PLo1XLDlizdgkKF6iLNs19kDSJzjtYaderV4+w/8hU7NrvifSpPdCmWiP0bdCOQQR6lY8pioinamOH/ziCAIoPYPBAhcwfsw0ppW3CunT5nLFbRmHF0eXo2m43CuSv7nQ2ik4gcOwfsAeLVzZBRORrZMuWExXKV8Omzd7o0eEQ8uRiTcmzF8FY6tMct+8cw9B2raQeP8aD8P21uwxE57a7UOhT8ybR5PzZi2vjTvAptGqyFMUKfWe7sJR+1tu3L3D4+Bxs3jEI2TJkwZah85E940fmlK56UTxXGzuuKgqgJSWMMGTRzsScQNJNgVF5fprXHCduHseI/oHIlDGf28I3XvjuXRj2HJqEvQcngUD28H4BQsGcPLMCy9a0lrajOb7cC+nSpJZuRzp4ko2dWjZehHKlyIJOq4P8RtbJdOfHRES8xsQZX+Lh4+voXKclhjbpwm8hy8gjNrQxx2STX3J13G3JBIj6+AvX/xvzztxQR575X474DMlTZcbwfteROPH77fP7IiwEsxZWR0joFVzyXSQ1hfKoXA9fFv8JrZoscUeWsbrm+KmlWLOpC9IkT4odI5YgZ+as1P0MRTqKMujqx8v70wtH1VuJq40VBdBNAJuepPPRAvLCCW3cZHZDhLx9i6F95B2+PpRj+ZqfcfLsCtT7ujyOnA/BiAE33turEZM2dW4lBAefglenUfi+dFW2pbwkeHkyyYedLCLtmOvXGBlfTQF4Tof8XLOHL33OOIz84tARm4Zh3Zn1mDLKPomTkFI4e2Etlvg0R79ufsiVvWRCPtr0LMJakmhh+95Rkjno8q2+ztClnkB0CG9SHMO6QjJ5r467oy0Pt1r0IaQbjQqi4NO0XZMw58AsjB1yHx5ps73XwbV6+JNnt5AxvXlHsvf1wn5nloOgU8PytTCr4whDSz5BNEY17DBPTho5zNXGjqtj7zitCWQLRjlwYqCNt17YjL6ru6FP53+RO1fc7eX3voSS0M+9/+Aixk/7HEVy5sPeMaQ3sgiFWYXQ9n3i1HKopsPYpMJxdWywvjRM+aUiJDDlsRWnRDMVDiDs7QuUHlMMTX+Yja/Kd07osftPPa/HYAcalq+JWR1HUkgQt9XGlALoUGGyOS5kA7v7dMD50CAM6X3pPyWM9/FjbgefxJRZZTCvyxjUK0N4k7hHAlkBNCbQYGOMToQC9WYkkLUyIPQa6s+qhT5djuGTHPKC4/8dsRuBHfvGYNvu37Fj5BIUz13Qhk/AKomoL5H6Vv8Pr634zbyiqzkAAAAASUVORK5CYII="
-)
diff --git a/cmd/catalyst-dev/main.go b/cmd/catalyst-dev/main.go
deleted file mode 100644
index f63ff0e..0000000
--- a/cmd/catalyst-dev/main.go
+++ /dev/null
@@ -1,79 +0,0 @@
-package main
-
-import (
- "context"
- "fmt"
- "log"
- "net/http"
- "time"
-
- "github.com/arangodb/go-driver"
- maut "github.com/jonas-plum/maut/auth"
-
- "github.com/SecurityBrewery/catalyst"
- "github.com/SecurityBrewery/catalyst/cmd"
- "github.com/SecurityBrewery/catalyst/generated/api"
- "github.com/SecurityBrewery/catalyst/generated/model"
- "github.com/SecurityBrewery/catalyst/generated/pointer"
- "github.com/SecurityBrewery/catalyst/hooks"
- "github.com/SecurityBrewery/catalyst/test"
-)
-
-func main() {
- log.SetFlags(log.LstdFlags | log.Lshortfile)
-
- config, err := cmd.ParseCatalystConfig()
- if err != nil {
- log.Fatal(err)
- }
-
- // create app and clear db after start
- theCatalyst, err := catalyst.New(&hooks.Hooks{
- DatabaseAfterConnectFuncs: []func(ctx context.Context, client driver.Client, name string){test.Clear},
- }, config)
- if err != nil {
- log.Fatal(err)
- }
-
- demoUser := &maut.User{ID: "demo", Roles: []string{maut.AdminRole}}
- ctx := maut.UserContext(context.Background(), demoUser, catalyst.Admin.Permissions)
- if err := test.SetupTestData(ctx, theCatalyst.DB); err != nil {
- log.Fatal(err)
- }
-
- _, _ = theCatalyst.DB.UserCreate(context.Background(), &model.UserForm{ID: "eve", Roles: []string{"admin"}})
- _ = theCatalyst.DB.UserDataCreate(context.Background(), "eve", &model.UserData{
- Name: pointer.String("Eve"),
- Email: pointer.String("eve@example.com"),
- Image: &avatarEve,
- })
- _, _ = theCatalyst.DB.UserCreate(context.Background(), &model.UserForm{ID: "kevin", Roles: []string{"admin"}})
- _ = theCatalyst.DB.UserDataCreate(context.Background(), "kevin", &model.UserData{
- Name: pointer.String("Kevin"),
- Email: pointer.String("kevin@example.com"),
- Image: &avatarKevin,
- })
-
- _, _ = theCatalyst.DB.UserCreate(context.Background(), &model.UserForm{ID: "tom", Roles: []string{"admin"}})
- _ = theCatalyst.DB.UserDataCreate(context.Background(), "tom", &model.UserData{
- Name: pointer.String("tom"),
- Email: pointer.String("tom@example.com"),
- Image: &avatarKevin,
- })
-
- // proxy static requests
- theCatalyst.Server.Get("/ui/*", func(writer http.ResponseWriter, request *http.Request) {
- log.Println("proxy request", request.URL.Path)
-
- api.Proxy("http://localhost:8080/")(writer, request)
- })
-
- server := &http.Server{
- Addr: fmt.Sprintf(":%d", config.Port),
- ReadHeaderTimeout: 3 * time.Second,
- Handler: theCatalyst.Server,
- }
- if err := server.ListenAndServe(); err != nil {
- log.Fatal(err)
- }
-}
diff --git a/cmd/catalyst/main.go b/cmd/catalyst/main.go
deleted file mode 100644
index 6f1a2a5..0000000
--- a/cmd/catalyst/main.go
+++ /dev/null
@@ -1,42 +0,0 @@
-package main
-
-import (
- "fmt"
- "io/fs"
- "log"
- "net/http"
- "time"
-
- "github.com/SecurityBrewery/catalyst"
- "github.com/SecurityBrewery/catalyst/cmd"
- "github.com/SecurityBrewery/catalyst/generated/api"
- "github.com/SecurityBrewery/catalyst/hooks"
- "github.com/SecurityBrewery/catalyst/ui"
-)
-
-func main() {
- log.SetFlags(log.LstdFlags | log.Lshortfile)
-
- config, err := cmd.ParseCatalystConfig()
- if err != nil {
- log.Fatal(err)
- }
-
- theCatalyst, err := catalyst.New(&hooks.Hooks{}, config)
- if err != nil {
- log.Fatal(err)
- }
-
- fsys, _ := fs.Sub(ui.UI, "dist")
- staticHandlerFunc := http.HandlerFunc(api.VueStatic(fsys))
- theCatalyst.Server.Get("/ui/*", http.StripPrefix("/ui", staticHandlerFunc).ServeHTTP)
-
- server := &http.Server{
- Addr: fmt.Sprintf(":%d", config.Port),
- ReadHeaderTimeout: 3 * time.Second,
- Handler: theCatalyst.Server,
- }
- if err := server.ListenAndServe(); err != nil {
- log.Fatal(err)
- }
-}
diff --git a/cmd/cmd.go b/cmd/cmd.go
deleted file mode 100644
index 7ffcc34..0000000
--- a/cmd/cmd.go
+++ /dev/null
@@ -1,120 +0,0 @@
-package cmd
-
-import (
- "errors"
-
- "github.com/alecthomas/kong"
- kongyaml "github.com/alecthomas/kong-yaml"
- "github.com/coreos/go-oidc/v3/oidc"
- maut "github.com/jonas-plum/maut/auth"
- "golang.org/x/exp/slices"
- "golang.org/x/oauth2"
-
- "github.com/SecurityBrewery/catalyst"
- "github.com/SecurityBrewery/catalyst/database"
- "github.com/SecurityBrewery/catalyst/storage"
-)
-
-type CLI struct {
- Secret string `env:"SECRET" required:"" help:"A random secret value (can be created with 'openssl rand -hex 32')"`
- ExternalAddress string `env:"EXTERNAL_ADDRESS" required:""`
- CatalystAddress string `env:"CATALYST_ADDRESS" default:"http://catalyst:8000"`
- Network string `env:"CATALYST_NETWORK" default:"catalyst"`
- Port int `env:"PORT" default:"8000"`
-
- AuthBlockNew bool `env:"AUTH_BLOCK_NEW" default:"true" help:"Block newly created users"`
- AuthDefaultRoles []string `env:"AUTH_DEFAULT_ROLES" help:"Default roles for new users"`
- AuthAdminUsers []string `env:"AUTH_ADMIN_USERS" help:"Username of admins"`
- InitialAPIKey string `env:"INITIAL_API_KEY"`
-
- // SimpleAuthEnable bool `env:"SIMPLE_AUTH_ENABLE" default:"true"`
- APIKeyAuthEnable bool `env:"API_KEY_AUTH_ENABLE" default:"true"`
-
- OIDCEnable bool `env:"OIDC_ENABLE" default:"true"`
- OIDCIssuer string `env:"OIDC_ISSUER"`
- AuthURL string `env:"OIDC_AUTH_URL"`
- OIDCClientID string `env:"OIDC_CLIENT_ID" default:"catalyst"`
- OIDCClientSecret string `env:"OIDC_CLIENT_SECRET"`
- OIDCScopes []string `env:"OIDC_SCOPES" help:"Additional scopes, ['oidc', 'profile', 'email'] are always added." placeholder:"customscopes"`
- OIDCClaimUsername string `env:"OIDC_CLAIM_USERNAME" default:"preferred_username" help:"username field in the OIDC claim"`
- OIDCClaimEmail string `env:"OIDC_CLAIM_EMAIL" default:"email" help:"email field in the OIDC claim"`
- OIDCClaimName string `env:"OIDC_CLAIM_NAME" default:"name" help:"name field in the OIDC claim"`
-
- IndexPath string `env:"INDEX_PATH" default:"index.bleve" help:"Path for the bleve index"`
-
- ArangoDBHost string `env:"ARANGO_DB_HOST" default:"http://arangodb:8529"`
- ArangoDBUser string `env:"ARANGO_DB_USER" default:"root"`
- ArangoDBPassword string `env:"ARANGO_DB_PASSWORD" required:""`
-
- S3Host string `env:"S3_HOST" default:"http://minio:9000" name:"s3-host"`
- S3User string `env:"S3_USER" default:"minio" name:"s3-user"`
- S3Password string `env:"S3_PASSWORD" required:"" name:"s3-password"`
- S3Region string `env:"S3_REGION" default:"us-east-1" name:"s3-region"`
-
- Version kong.VersionFlag `help:"Show version."`
-}
-
-func ParseCatalystConfig() (*catalyst.Config, error) {
- var cli CLI
- kong.Parse(
- &cli,
- kong.Configuration(kong.JSON, "/etc/catalyst.json", ".catalyst.json"),
- kong.Configuration(kongyaml.Loader, "/etc/catalyst.yaml", ".catalyst.yaml"),
- kong.Vars{"version": catalyst.GetVersion()},
- )
-
- if cli.OIDCEnable {
- if cli.OIDCIssuer == "" {
- return nil, errors.New("OIDC issuer not set")
- }
- if cli.OIDCClientSecret == "" {
- return nil, errors.New("OIDC client secret is required")
- }
- }
-
- return MapConfig(cli)
-}
-
-func MapConfig(cli CLI) (*catalyst.Config, error) {
- scopes := slices.Compact(append([]string{oidc.ScopeOpenID, "profile", "email"}, cli.OIDCScopes...))
- config := &catalyst.Config{
- IndexPath: cli.IndexPath,
- Network: cli.Network,
- DB: &database.Config{
- Host: cli.ArangoDBHost,
- User: cli.ArangoDBUser,
- Password: cli.ArangoDBPassword,
- },
- Storage: &storage.Config{Host: cli.S3Host, User: cli.S3User, Region: cli.S3Region, Password: cli.S3Password},
- ExternalAddress: cli.ExternalAddress,
- InternalAddress: cli.CatalystAddress,
- Port: cli.Port,
- Auth: &maut.Config{
- CookieSecret: []byte(cli.Secret),
- SimpleAuthEnable: false, // cli.SimpleAuthEnable,
- APIKeyAuthEnable: cli.APIKeyAuthEnable,
- OIDCAuthEnable: cli.OIDCEnable,
- // InitialUser: "",
- // InitialPassword: "",
- InitialAPIKey: cli.InitialAPIKey,
- OIDCIssuer: cli.OIDCIssuer,
- AuthURL: cli.AuthURL,
- OAuth2: &oauth2.Config{
- ClientID: cli.OIDCClientID,
- ClientSecret: cli.OIDCClientSecret,
- RedirectURL: cli.ExternalAddress + "/auth/callback",
- Scopes: scopes,
- },
- UserCreateConfig: &maut.UserCreateConfig{
- AuthBlockNew: cli.AuthBlockNew,
- AuthDefaultRoles: cli.AuthDefaultRoles,
- AuthAdminUsers: cli.AuthAdminUsers,
- OIDCClaimUsername: cli.OIDCClaimUsername,
- OIDCClaimEmail: cli.OIDCClaimEmail,
- OIDCClaimName: cli.OIDCClaimName,
- },
- },
- }
-
- return config, nil
-}
diff --git a/dag/dag.go b/dag/dag.go
deleted file mode 100644
index 37d5041..0000000
--- a/dag/dag.go
+++ /dev/null
@@ -1,164 +0,0 @@
-// Adapted from https://github.com/philopon/go-toposort under the MIT License
-// Original License:
-//
-// Copyright (c) 2017 Hirotomo Moriwaki
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy of
-// this software and associated documentation files (the "Software"), to deal in
-// the Software without restriction, including without limitation the rights to
-// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-// the Software, and to permit persons to whom the Software is furnished to do so,
-// subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-package dag
-
-import (
- "errors"
- "sort"
-
- "golang.org/x/exp/maps"
- "golang.org/x/exp/slices"
-)
-
-type Graph struct {
- nodes []string
-
- outputs map[string]map[string]struct{}
-
- // node: number of parents
- inputs map[string]int
-}
-
-func NewGraph() *Graph {
- return &Graph{
- nodes: []string{},
- inputs: make(map[string]int),
- outputs: make(map[string]map[string]struct{}),
- }
-}
-
-func (g *Graph) AddNode(name string) error {
- g.nodes = append(g.nodes, name)
-
- if _, ok := g.outputs[name]; ok {
- return errors.New("duplicate detected")
- }
- g.outputs[name] = make(map[string]struct{})
- g.inputs[name] = 0
-
- return nil
-}
-
-func (g *Graph) AddNodes(names ...string) error {
- for _, name := range names {
- if err := g.AddNode(name); err != nil {
- return err
- }
- }
-
- return nil
-}
-
-func (g *Graph) AddEdge(from, to string) error {
- m, ok := g.outputs[from]
- if !ok {
- return errors.New("node does not exist")
- }
-
- m[to] = struct{}{}
- g.inputs[to]++
-
- return nil
-}
-
-func (g *Graph) Toposort() ([]string, error) {
- outputs := map[string]map[string]struct{}{}
- for key, value := range g.outputs {
- outputs[key] = map[string]struct{}{}
- for k, v := range value {
- outputs[key][k] = v
- }
- }
-
- L := make([]string, 0, len(g.nodes))
- S := make([]string, 0, len(g.nodes))
-
- sort.Strings(g.nodes)
- for _, n := range g.nodes {
- if g.inputs[n] == 0 {
- S = append(S, n)
- }
- }
-
- for len(S) > 0 {
- var n string
- n, S = S[0], S[1:]
- L = append(L, n)
-
- ms := make([]string, len(outputs[n]))
- keys := maps.Keys(outputs[n])
- slices.Sort(keys)
- for _, k := range keys {
- m := k
- // i := outputs[n][m]
- // ms[i-1] = m
- ms = append(ms, m)
- }
-
- for _, m := range ms {
- delete(outputs[n], m)
- g.inputs[m]--
-
- if g.inputs[m] == 0 {
- S = append(S, m)
- }
- }
- }
-
- N := 0
- for _, v := range g.inputs {
- N += v
- }
-
- if N > 0 {
- return L, errors.New("cycle detected")
- }
-
- return L, nil
-}
-
-func (g *Graph) GetParents(id string) []string {
- var parents []string
- for node, targets := range g.outputs {
- if _, ok := targets[id]; ok {
- parents = append(parents, node)
- }
- }
- sort.Strings(parents)
-
- return parents
-}
-
-func (g *Graph) GetRoot() (string, error) {
- var roots []string
- for n, parents := range g.inputs {
- if parents == 0 {
- roots = append(roots, n)
- }
- }
- if len(roots) != 1 {
- return "", errors.New("more than one root")
- }
-
- return roots[0], nil
-}
diff --git a/dag/dag_test.go b/dag/dag_test.go
deleted file mode 100644
index d089283..0000000
--- a/dag/dag_test.go
+++ /dev/null
@@ -1,256 +0,0 @@
-// Adapted from https://github.com/philopon/go-toposort under the MIT License
-// Original License:
-//
-// Copyright (c) 2017 Hirotomo Moriwaki
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy of
-// this software and associated documentation files (the "Software"), to deal in
-// the Software without restriction, including without limitation the rights to
-// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-// the Software, and to permit persons to whom the Software is furnished to do so,
-// subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-package dag_test
-
-import (
- "reflect"
- "testing"
-
- "github.com/stretchr/testify/assert"
- "golang.org/x/exp/slices"
-
- "github.com/SecurityBrewery/catalyst/dag"
-)
-
-type Edge struct {
- From string
- To string
-}
-
-func TestDuplicatedNode(t *testing.T) {
- t.Parallel()
-
- graph := dag.NewGraph()
- assert.NoError(t, graph.AddNode("a"))
- assert.Error(t, graph.AddNode("a"))
-}
-
-func TestWikipedia(t *testing.T) {
- t.Parallel()
-
- graph := dag.NewGraph()
- assert.NoError(t, graph.AddNodes("2", "3", "5", "7", "8", "9", "10", "11"))
-
- edges := []Edge{
- {"7", "8"},
- {"7", "11"},
-
- {"5", "11"},
-
- {"3", "8"},
- {"3", "10"},
-
- {"11", "2"},
- {"11", "9"},
- {"11", "10"},
-
- {"8", "9"},
- }
-
- for _, e := range edges {
- assert.NoError(t, graph.AddEdge(e.From, e.To))
- }
-
- result, err := graph.Toposort()
- if err != nil {
- t.Errorf("closed path detected in no closed pathed graph")
- }
-
- for _, e := range edges {
- if i, j := slices.Index(result, e.From), slices.Index(result, e.To); i > j {
- t.Errorf("dependency failed: not satisfy %v(%v) > %v(%v)", e.From, i, e.To, j)
- }
- }
-}
-
-func TestCycle(t *testing.T) {
- t.Parallel()
-
- graph := dag.NewGraph()
- assert.NoError(t, graph.AddNodes("1", "2", "3"))
-
- assert.NoError(t, graph.AddEdge("1", "2"))
- assert.NoError(t, graph.AddEdge("2", "3"))
- assert.NoError(t, graph.AddEdge("3", "1"))
-
- if _, err := graph.Toposort(); err == nil {
- t.Errorf("closed path not detected in closed pathed graph")
- }
-}
-
-func TestGraph_GetParents(t *testing.T) {
- t.Parallel()
-
- type fields struct {
- nodes []string
- edges map[string]string
- }
- type args struct {
- id string
- }
- tests := []struct {
- name string
- fields fields
- args args
- want []string
- }{
- {"parents 2", fields{nodes: []string{"1", "2", "3"}, edges: map[string]string{"1": "2", "2": "3"}}, args{id: "2"}, []string{"1"}},
- {"parents 3", fields{nodes: []string{"1", "2", "3"}, edges: map[string]string{"1": "3", "2": "3"}}, args{id: "3"}, []string{"1", "2"}},
- }
- for _, tt := range tests {
- tt := tt
- t.Run(tt.name, func(t *testing.T) {
- t.Parallel()
-
- g := dag.NewGraph()
- for _, node := range tt.fields.nodes {
- assert.NoError(t, g.AddNode(node))
- }
- for from, to := range tt.fields.edges {
- assert.NoError(t, g.AddEdge(from, to))
- }
-
- if got := g.GetParents(tt.args.id); !reflect.DeepEqual(got, tt.want) {
- t.Errorf("GetParents() = %v, want %v", got, tt.want)
- }
- })
- }
-}
-
-func TestDAG_AddNode(t *testing.T) {
- t.Parallel()
-
- dag := dag.NewGraph()
-
- v := "1"
- assert.NoError(t, dag.AddNode(v))
-
- assert.Error(t, dag.AddNode(v))
-}
-
-func TestDAG_AddEdge(t *testing.T) {
- t.Parallel()
-
- dag := dag.NewGraph()
- assert.NoError(t, dag.AddNode("0"))
- assert.NoError(t, dag.AddNode("1"))
- assert.NoError(t, dag.AddNode("2"))
- assert.NoError(t, dag.AddNode("3"))
-
- // add a single edge and inspect the graph
- assert.NoError(t, dag.AddEdge("1", "2"))
-
- if parents := dag.GetParents("2"); len(parents) != 1 {
- t.Errorf("GetParents(v2) = %d, want 1", len(parents))
- }
-
- assert.NoError(t, dag.AddEdge("2", "3"))
-
- _ = dag.AddEdge("0", "1")
-}
-
-func TestDAG_GetParents(t *testing.T) {
- t.Parallel()
-
- dag := dag.NewGraph()
- assert.NoError(t, dag.AddNode("1"))
- assert.NoError(t, dag.AddNode("2"))
- assert.NoError(t, dag.AddNode("3"))
- _ = dag.AddEdge("1", "3")
- _ = dag.AddEdge("2", "3")
-
- parents := dag.GetParents("3")
- if length := len(parents); length != 2 {
- t.Errorf("GetParents(v3) = %d, want 2", length)
- }
-}
-
-func TestDAG_GetDescendants(t *testing.T) {
- t.Parallel()
-
- dag := dag.NewGraph()
- assert.NoError(t, dag.AddNode("1"))
- assert.NoError(t, dag.AddNode("2"))
- assert.NoError(t, dag.AddNode("3"))
- assert.NoError(t, dag.AddNode("4"))
-
- assert.NoError(t, dag.AddEdge("1", "2"))
- assert.NoError(t, dag.AddEdge("2", "3"))
- assert.NoError(t, dag.AddEdge("2", "4"))
-}
-
-func TestDAG_Topsort(t *testing.T) {
- t.Parallel()
-
- dag := dag.NewGraph()
- assert.NoError(t, dag.AddNode("1"))
- assert.NoError(t, dag.AddNode("2"))
- assert.NoError(t, dag.AddNode("3"))
- assert.NoError(t, dag.AddNode("4"))
-
- assert.NoError(t, dag.AddEdge("1", "2"))
- assert.NoError(t, dag.AddEdge("2", "3"))
- assert.NoError(t, dag.AddEdge("2", "4"))
-
- desc, _ := dag.Toposort()
- assert.Equal(t, desc, []string{"1", "2", "3", "4"})
-}
-
-func TestDAG_TopsortStable(t *testing.T) {
- t.Parallel()
-
- dag := dag.NewGraph()
- assert.NoError(t, dag.AddNode("1"))
- assert.NoError(t, dag.AddNode("2"))
- assert.NoError(t, dag.AddNode("3"))
-
- assert.NoError(t, dag.AddEdge("1", "2"))
- assert.NoError(t, dag.AddEdge("1", "3"))
-
- desc, _ := dag.Toposort()
- assert.Equal(t, desc, []string{"1", "2", "3"})
-}
-
-func TestDAG_TopsortStable2(t *testing.T) {
- t.Parallel()
-
- dag := dag.NewGraph()
-
- assert.NoError(t, dag.AddNodes("block-ioc", "block-iocs", "block-sender", "board", "fetch-iocs", "escalate", "extract-iocs", "mail-available", "search-email-gateway"))
- assert.NoError(t, dag.AddEdge("block-iocs", "block-ioc"))
- assert.NoError(t, dag.AddEdge("block-sender", "extract-iocs"))
- assert.NoError(t, dag.AddEdge("board", "escalate"))
- assert.NoError(t, dag.AddEdge("board", "mail-available"))
- assert.NoError(t, dag.AddEdge("fetch-iocs", "block-iocs"))
- assert.NoError(t, dag.AddEdge("extract-iocs", "fetch-iocs"))
- assert.NoError(t, dag.AddEdge("mail-available", "block-sender"))
- assert.NoError(t, dag.AddEdge("mail-available", "extract-iocs"))
- assert.NoError(t, dag.AddEdge("mail-available", "search-email-gateway"))
- assert.NoError(t, dag.AddEdge("search-email-gateway", "extract-iocs"))
-
- sorted, err := dag.Toposort()
- assert.NoError(t, err)
-
- want := []string{"board", "escalate", "mail-available", "block-sender", "search-email-gateway", "extract-iocs", "fetch-iocs", "block-iocs", "block-ioc"}
- assert.Equal(t, want, sorted)
-}
diff --git a/database/artifact.go b/database/artifact.go
deleted file mode 100644
index 43a4f03..0000000
--- a/database/artifact.go
+++ /dev/null
@@ -1,102 +0,0 @@
-package database
-
-import (
- "context"
- "fmt"
-
- "github.com/arangodb/go-driver"
-
- "github.com/SecurityBrewery/catalyst/bus"
- "github.com/SecurityBrewery/catalyst/database/busdb"
- "github.com/SecurityBrewery/catalyst/generated/model"
- "github.com/SecurityBrewery/catalyst/generated/time"
-)
-
-func (db *Database) ArtifactGet(ctx context.Context, id int64, name string) (*model.Artifact, error) {
- ticketFilterQuery, ticketFilterVars, err := db.Hooks.TicketWriteFilter(ctx)
- if err != nil {
- return nil, err
- }
-
- query := `LET d = DOCUMENT(@@collection, @ID)
- ` + ticketFilterQuery + `
- FOR a in NOT_NULL(d.artifacts, [])
- FILTER a.name == @name
- RETURN a`
- cursor, _, err := db.Query(ctx, query, mergeMaps(ticketFilterVars, map[string]any{
- "@collection": TicketCollectionName,
- "ID": fmt.Sprint(id),
- "name": name,
- }), busdb.ReadOperation)
- if err != nil {
- return nil, err
- }
- defer cursor.Close()
-
- var doc model.Artifact
- _, err = cursor.ReadDocument(ctx, &doc)
- if err != nil {
- return nil, err
- }
-
- return &doc, nil
-}
-
-func (db *Database) ArtifactUpdate(ctx context.Context, id int64, name string, artifact *model.Artifact) (*model.TicketWithTickets, error) {
- ticketFilterQuery, ticketFilterVars, err := db.Hooks.TicketWriteFilter(ctx)
- if err != nil {
- return nil, err
- }
-
- query := `LET d = DOCUMENT(@@collection, @ID)
- ` + ticketFilterQuery + `
- FOR a IN NOT_NULL(d.artifacts, [])
- FILTER a.name == @name
- LET newartifacts = APPEND(REMOVE_VALUE(d.artifacts, a), @artifact)
- UPDATE d WITH { "artifacts": newartifacts } IN @@collection
- RETURN NEW`
-
- return db.ticketGetQuery(ctx, id, query, mergeMaps(map[string]any{
- "@collection": TicketCollectionName,
- "ID": id,
- "name": name,
- "artifact": artifact,
- }, ticketFilterVars), &busdb.Operation{
- Type: bus.DatabaseEntryUpdated,
- Ids: []driver.DocumentID{
- driver.DocumentID(fmt.Sprintf("%s/%d", TicketCollectionName, id)),
- },
- })
-}
-
-func (db *Database) EnrichArtifact(ctx context.Context, id int64, name string, enrichmentForm *model.EnrichmentForm) (*model.TicketWithTickets, error) {
- enrichment := model.Enrichment{Created: time.Now().UTC(), Data: enrichmentForm.Data, Name: enrichmentForm.Name}
-
- ticketFilterQuery, ticketFilterVars, err := db.Hooks.TicketWriteFilter(ctx)
- if err != nil {
- return nil, err
- }
-
- query := `LET d = DOCUMENT(@@collection, @ID)
- ` + ticketFilterQuery + `
- FOR a IN NOT_NULL(d.artifacts, [])
- FILTER a.name == @name
- LET enrichments = NOT_NULL(a.enrichments, {})
- LET newenrichments = MERGE(enrichments, ZIP( [@enrichmentname], [@enrichment]) )
- LET newartifacts = APPEND(REMOVE_VALUE(d.artifacts, a), MERGE(a, { "enrichments": newenrichments }))
- UPDATE d WITH { "artifacts": newartifacts } IN @@collection
- RETURN NEW`
-
- return db.ticketGetQuery(ctx, id, query, mergeMaps(map[string]any{
- "@collection": TicketCollectionName,
- "ID": id,
- "name": name,
- "enrichmentname": enrichment.Name,
- "enrichment": enrichment,
- }, ticketFilterVars), &busdb.Operation{
- Type: bus.DatabaseEntryUpdated,
- Ids: []driver.DocumentID{
- driver.DocumentID(fmt.Sprintf("%s/%d", TicketCollectionName, id)),
- },
- })
-}
diff --git a/database/automation.go b/database/automation.go
deleted file mode 100644
index d331b90..0000000
--- a/database/automation.go
+++ /dev/null
@@ -1,100 +0,0 @@
-package database
-
-import (
- "context"
- "errors"
-
- "github.com/arangodb/go-driver"
-
- "github.com/SecurityBrewery/catalyst/database/busdb"
- "github.com/SecurityBrewery/catalyst/generated/model"
-)
-
-func toAutomation(doc *model.AutomationForm) *model.Automation {
- return &model.Automation{
- Image: doc.Image,
- Script: doc.Script,
- Schema: doc.Schema,
- Type: doc.Type,
- }
-}
-
-func toAutomationResponse(id string, doc model.Automation) *model.AutomationResponse {
- return &model.AutomationResponse{
- ID: id,
- Image: doc.Image,
- Script: doc.Script,
- Schema: doc.Schema,
- Type: doc.Type,
- }
-}
-
-func (db *Database) AutomationCreate(ctx context.Context, automation *model.AutomationForm) (*model.AutomationResponse, error) {
- if automation == nil {
- return nil, errors.New("requires automation")
- }
- if automation.ID == "" {
- return nil, errors.New("requires automation ID")
- }
-
- var doc model.Automation
- newctx := driver.WithReturnNew(ctx, &doc)
-
- meta, err := db.automationCollection.CreateDocument(ctx, newctx, automation.ID, toAutomation(automation))
- if err != nil {
- return nil, err
- }
-
- return toAutomationResponse(meta.Key, doc), nil
-}
-
-func (db *Database) AutomationGet(ctx context.Context, id string) (*model.AutomationResponse, error) {
- var doc model.Automation
- meta, err := db.automationCollection.ReadDocument(ctx, id, &doc)
- if err != nil {
- return nil, err
- }
-
- return toAutomationResponse(meta.Key, doc), nil
-}
-
-func (db *Database) AutomationUpdate(ctx context.Context, id string, automation *model.AutomationForm) (*model.AutomationResponse, error) {
- var doc model.Automation
- ctx = driver.WithReturnNew(ctx, &doc)
-
- meta, err := db.automationCollection.ReplaceDocument(ctx, id, toAutomation(automation))
- if err != nil {
- return nil, err
- }
-
- return toAutomationResponse(meta.Key, doc), nil
-}
-
-func (db *Database) AutomationDelete(ctx context.Context, id string) error {
- _, err := db.automationCollection.RemoveDocument(ctx, id)
-
- return err
-}
-
-func (db *Database) AutomationList(ctx context.Context) ([]*model.AutomationResponse, error) {
- query := "FOR d IN @@collection SORT d._key ASC RETURN UNSET(d, 'script')"
- cursor, _, err := db.Query(ctx, query, map[string]any{"@collection": AutomationCollectionName}, busdb.ReadOperation)
- if err != nil {
- return nil, err
- }
- defer cursor.Close()
- var docs []*model.AutomationResponse
- for {
- var doc model.Automation
- meta, err := cursor.ReadDocument(ctx, &doc)
- if driver.IsNoMoreDocuments(err) {
- break
- } else if err != nil {
- return nil, err
- }
-
- docs = append(docs, toAutomationResponse(meta.Key, doc))
- }
-
- return docs, err
-}
diff --git a/database/busdb/busdb.go b/database/busdb/busdb.go
deleted file mode 100644
index 9dd8a9c..0000000
--- a/database/busdb/busdb.go
+++ /dev/null
@@ -1,195 +0,0 @@
-package busdb
-
-import (
- "context"
- "errors"
-
- "github.com/arangodb/go-driver"
-
- "github.com/SecurityBrewery/catalyst/bus"
- "github.com/SecurityBrewery/catalyst/generated/api"
- "github.com/SecurityBrewery/catalyst/generated/model"
-)
-
-// BusDatabase
-// 1. Save entry to log
-// 2. Send update ticket to bus
-// 3. Add document to index
-type BusDatabase struct {
- internal driver.Database
- logCollection driver.Collection
- bus *bus.Bus
- // index *index.Index
-}
-
-func NewDatabase(ctx context.Context, internal driver.Database, b *bus.Bus) (*BusDatabase, error) {
- logCollection, err := internal.Collection(ctx, LogCollectionName)
- if err != nil {
- return nil, err
- }
-
- return &BusDatabase{
- internal: internal,
- logCollection: logCollection,
- bus: b,
- }, nil
-}
-
-type Operation struct {
- Type bus.DatabaseUpdateType
- Ids []driver.DocumentID
-}
-
-var (
- CreateOperation = &Operation{Type: bus.DatabaseEntryCreated}
- ReadOperation = &Operation{Type: bus.DatabaseEntryRead}
-)
-
-func (db *BusDatabase) Query(ctx context.Context, query string, vars map[string]any, operation *Operation) (cur driver.Cursor, logs *model.LogEntry, err error) {
- defer func() { err = toHTTPErr(err) }()
-
- cur, err = db.internal.Query(ctx, query, vars)
- if err != nil {
- return nil, nil, err
- }
-
- switch {
- case operation.Type == bus.DatabaseEntryCreated, operation.Type == bus.DatabaseEntryUpdated:
- db.bus.DatabaseChannel.Publish(&bus.DatabaseUpdateMsg{IDs: operation.Ids, Type: operation.Type})
- }
-
- return cur, logs, err
-}
-
-func (db *BusDatabase) Remove(ctx context.Context) (err error) {
- defer func() { err = toHTTPErr(err) }()
-
- return db.internal.Remove(ctx)
-}
-
-func (db *BusDatabase) Collection(ctx context.Context, name string) (col driver.Collection, err error) {
- defer func() { err = toHTTPErr(err) }()
-
- return db.internal.Collection(ctx, name)
-}
-
-type Collection[T any] struct {
- internal driver.Collection
- db *BusDatabase
-}
-
-func NewCollection[T any](internal driver.Collection, db *BusDatabase) *Collection[T] {
- return &Collection[T]{internal: internal, db: db}
-}
-
-func (c *Collection[T]) CreateDocument(_, newctx context.Context, key string, document *T) (meta driver.DocumentMeta, err error) {
- defer func() { err = toHTTPErr(err) }()
-
- meta, err = c.internal.CreateDocument(newctx, &Keyed[T]{Key: key, Doc: document})
- if err != nil {
- return meta, err
- }
-
- c.db.bus.DatabaseChannel.Publish(&bus.DatabaseUpdateMsg{IDs: []driver.DocumentID{meta.ID}, Type: bus.DatabaseEntryCreated})
-
- return meta, nil
-}
-
-func (c *Collection[T]) CreateEdge(_, newctx context.Context, edge *driver.EdgeDocument) (meta driver.DocumentMeta, err error) {
- defer func() { err = toHTTPErr(err) }()
-
- meta, err = c.internal.CreateDocument(newctx, edge)
- if err != nil {
- return meta, err
- }
-
- c.db.bus.DatabaseChannel.Publish(&bus.DatabaseUpdateMsg{IDs: []driver.DocumentID{meta.ID}, Type: bus.DatabaseEntryCreated})
-
- return meta, nil
-}
-
-func (c *Collection[T]) CreateEdges(ctx context.Context, edges []*driver.EdgeDocument) (meta driver.DocumentMetaSlice, err error) {
- defer func() { err = toHTTPErr(err) }()
-
- metas, errs, err := c.internal.CreateDocuments(ctx, edges)
- if err != nil {
- return nil, err
- }
- if errs.FirstNonNil() != nil {
- return nil, errs.FirstNonNil()
- }
-
- var ids []driver.DocumentID
- for _, meta := range metas {
- ids = append(ids, meta.ID)
- }
-
- c.db.bus.DatabaseChannel.Publish(&bus.DatabaseUpdateMsg{IDs: ids, Type: bus.DatabaseEntryCreated})
-
- return metas, nil
-}
-
-func (c *Collection[T]) DocumentExists(ctx context.Context, id string) (exists bool, err error) {
- defer func() { err = toHTTPErr(err) }()
-
- return c.internal.DocumentExists(ctx, id)
-}
-
-func (c *Collection[T]) ReadDocument(ctx context.Context, key string, result *T) (meta driver.DocumentMeta, err error) {
- defer func() { err = toHTTPErr(err) }()
-
- meta, err = c.internal.ReadDocument(ctx, key, result)
-
- return
-}
-
-func (c *Collection[T]) UpdateDocument(ctx context.Context, key string, update any) (meta driver.DocumentMeta, err error) {
- defer func() { err = toHTTPErr(err) }()
-
- meta, err = c.internal.UpdateDocument(ctx, key, update)
- if err != nil {
- return meta, err
- }
-
- c.db.bus.DatabaseChannel.Publish(&bus.DatabaseUpdateMsg{IDs: []driver.DocumentID{meta.ID}, Type: bus.DatabaseEntryUpdated})
-
- return meta, nil
-}
-
-func (c *Collection[T]) ReplaceDocument(ctx context.Context, key string, document *T) (meta driver.DocumentMeta, err error) {
- defer func() { err = toHTTPErr(err) }()
-
- meta, err = c.internal.ReplaceDocument(ctx, key, document)
- if err != nil {
- return meta, err
- }
-
- c.db.bus.DatabaseChannel.Publish(&bus.DatabaseUpdateMsg{IDs: []driver.DocumentID{meta.ID}, Type: bus.DatabaseEntryUpdated})
-
- return meta, nil
-}
-
-func (c *Collection[T]) RemoveDocument(ctx context.Context, formatInt string) (meta driver.DocumentMeta, err error) {
- defer func() { err = toHTTPErr(err) }()
-
- return c.internal.RemoveDocument(ctx, formatInt)
-}
-
-func (c *Collection[T]) Truncate(ctx context.Context) (err error) {
- defer func() { err = toHTTPErr(err) }()
-
- return c.internal.Truncate(ctx)
-}
-
-func toHTTPErr(err error) error {
- if err != nil {
- ae := driver.ArangoError{}
- if errors.As(err, &ae) {
- return &api.HTTPError{Status: ae.Code, Internal: err}
- }
-
- return err
- }
-
- return nil
-}
diff --git a/database/busdb/keyed.go b/database/busdb/keyed.go
deleted file mode 100644
index be98c37..0000000
--- a/database/busdb/keyed.go
+++ /dev/null
@@ -1,25 +0,0 @@
-package busdb
-
-import "encoding/json"
-
-type Keyed[T any] struct {
- Key string
- Doc *T
-}
-
-func (p *Keyed[T]) MarshalJSON() ([]byte, error) {
- b, err := json.Marshal(p.Doc)
- if err != nil {
- panic(err)
- }
-
- var m map[string]any
- err = json.Unmarshal(b, &m)
- if err != nil {
- panic(err)
- }
-
- m["_key"] = p.Key
-
- return json.Marshal(m)
-}
diff --git a/database/busdb/log.go b/database/busdb/log.go
deleted file mode 100644
index 6908a53..0000000
--- a/database/busdb/log.go
+++ /dev/null
@@ -1,90 +0,0 @@
-package busdb
-
-import (
- "context"
- "errors"
- "strings"
-
- "github.com/arangodb/go-driver"
- maut "github.com/jonas-plum/maut/auth"
-
- "github.com/SecurityBrewery/catalyst/bus"
- "github.com/SecurityBrewery/catalyst/generated/model"
- "github.com/SecurityBrewery/catalyst/generated/time"
-)
-
-const LogCollectionName = "logs"
-
-func (db *BusDatabase) LogCreate(ctx context.Context, logType, reference, message string) (*model.LogEntry, error) {
- user, _, ok := maut.UserFromContext(ctx)
- if !ok {
- return nil, errors.New("no user in context")
- }
-
- logentry := &model.LogEntry{
- Type: logType,
- Reference: reference,
- Created: time.Now().UTC(),
- Creator: user.ID,
- Message: message,
- }
-
- doc := model.LogEntry{}
- _, err := db.logCollection.CreateDocument(driver.WithReturnNew(ctx, &doc), logentry)
- if err != nil {
- return nil, err
- }
-
- return &doc, nil
-}
-
-func (db *BusDatabase) LogBatchCreate(ctx context.Context, logentries []*model.LogEntry) error {
- var ids []driver.DocumentID
- for _, entry := range logentries {
- if strings.HasPrefix(entry.Reference, "tickets/") {
- ids = append(ids, driver.DocumentID(entry.Reference))
- }
- }
- if ids != nil {
- go db.bus.DatabaseChannel.Publish(&bus.DatabaseUpdateMsg{
- IDs: ids,
- Type: bus.DatabaseEntryCreated,
- })
- }
-
- _, errs, err := db.logCollection.CreateDocuments(ctx, logentries)
- if err != nil {
- return err
- }
- err = errs.FirstNonNil()
- if err != nil {
- return err
- }
-
- return nil
-}
-
-func (db *BusDatabase) LogList(ctx context.Context, reference string) ([]*model.LogEntry, error) {
- query := "FOR d IN @@collection FILTER d.reference == @reference SORT d.created DESC RETURN d"
- cursor, err := db.internal.Query(ctx, query, map[string]any{
- "@collection": LogCollectionName,
- "reference": reference,
- })
- if err != nil {
- return nil, err
- }
- defer cursor.Close()
- var docs []*model.LogEntry
- for {
- var doc model.LogEntry
- _, err := cursor.ReadDocument(ctx, &doc)
- if driver.IsNoMoreDocuments(err) {
- break
- } else if err != nil {
- return nil, err
- }
- docs = append(docs, &doc)
- }
-
- return docs, err
-}
diff --git a/database/dashboard.go b/database/dashboard.go
deleted file mode 100644
index eba844f..0000000
--- a/database/dashboard.go
+++ /dev/null
@@ -1,119 +0,0 @@
-package database
-
-import (
- "context"
- "errors"
- "fmt"
-
- "github.com/arangodb/go-driver"
- "github.com/iancoleman/strcase"
-
- "github.com/SecurityBrewery/catalyst/caql"
- "github.com/SecurityBrewery/catalyst/database/busdb"
- "github.com/SecurityBrewery/catalyst/generated/model"
-)
-
-func toDashboardResponse(key string, doc *model.Dashboard) *model.DashboardResponse {
- return &model.DashboardResponse{
- ID: key,
- Name: doc.Name,
- Widgets: doc.Widgets,
- }
-}
-
-func (db *Database) DashboardCreate(ctx context.Context, dashboard *model.Dashboard) (*model.DashboardResponse, error) {
- if dashboard == nil {
- return nil, errors.New("requires dashboard")
- }
- if dashboard.Name == "" {
- return nil, errors.New("requires dashboard name")
- }
-
- if err := db.parseWidgets(dashboard); err != nil {
- return nil, err
- }
-
- var doc model.Dashboard
- newctx := driver.WithReturnNew(ctx, &doc)
-
- meta, err := db.dashboardCollection.CreateDocument(ctx, newctx, strcase.ToKebab(dashboard.Name), dashboard)
- if err != nil {
- return nil, err
- }
-
- return toDashboardResponse(meta.Key, &doc), nil
-}
-
-func (db *Database) DashboardGet(ctx context.Context, id string) (*model.DashboardResponse, error) {
- var doc model.Dashboard
- meta, err := db.dashboardCollection.ReadDocument(ctx, id, &doc)
- if err != nil {
- return nil, err
- }
-
- return toDashboardResponse(meta.Key, &doc), nil
-}
-
-func (db *Database) DashboardUpdate(ctx context.Context, id string, dashboard *model.Dashboard) (*model.DashboardResponse, error) {
- if err := db.parseWidgets(dashboard); err != nil {
- return nil, err
- }
-
- var doc model.Dashboard
- ctx = driver.WithReturnNew(ctx, &doc)
-
- meta, err := db.dashboardCollection.ReplaceDocument(ctx, id, dashboard)
- if err != nil {
- return nil, err
- }
-
- return toDashboardResponse(meta.Key, &doc), nil
-}
-
-func (db *Database) DashboardDelete(ctx context.Context, id string) error {
- _, err := db.dashboardCollection.RemoveDocument(ctx, id)
-
- return err
-}
-
-func (db *Database) DashboardList(ctx context.Context) ([]*model.DashboardResponse, error) {
- query := "FOR d IN @@collection RETURN d"
- cursor, _, err := db.Query(ctx, query, map[string]any{"@collection": DashboardCollectionName}, busdb.ReadOperation)
- if err != nil {
- return nil, err
- }
- defer cursor.Close()
- var docs []*model.DashboardResponse
- for {
- var doc model.Dashboard
- meta, err := cursor.ReadDocument(ctx, &doc)
- if driver.IsNoMoreDocuments(err) {
- break
- } else if err != nil {
- return nil, err
- }
- docs = append(docs, toDashboardResponse(meta.Key, &doc))
- }
-
- return docs, err
-}
-
-func (db *Database) parseWidgets(dashboard *model.Dashboard) error {
- for _, widget := range dashboard.Widgets {
- parser := &caql.Parser{Searcher: db.Index, Prefix: "d."}
-
- _, err := parser.Parse(widget.Aggregation)
- if err != nil {
- return fmt.Errorf("invalid aggregation query (%s): syntax error", widget.Aggregation)
- }
-
- if widget.Filter != nil {
- _, err := parser.Parse(*widget.Filter)
- if err != nil {
- return fmt.Errorf("invalid filter query (%s): syntax error", *widget.Filter)
- }
- }
- }
-
- return nil
-}
diff --git a/database/db.go b/database/db.go
deleted file mode 100644
index edfd775..0000000
--- a/database/db.go
+++ /dev/null
@@ -1,241 +0,0 @@
-package database
-
-import (
- "context"
- "errors"
- "fmt"
- "log"
- "time"
-
- "github.com/arangodb/go-driver"
- "github.com/arangodb/go-driver/http"
-
- "github.com/SecurityBrewery/catalyst/bus"
- "github.com/SecurityBrewery/catalyst/database/busdb"
- "github.com/SecurityBrewery/catalyst/database/migrations"
- "github.com/SecurityBrewery/catalyst/generated/model"
- "github.com/SecurityBrewery/catalyst/hooks"
- "github.com/SecurityBrewery/catalyst/index"
-)
-
-const (
- Name = "catalyst"
- TicketCollectionName = "tickets"
- TemplateCollectionName = "templates"
- PlaybookCollectionName = "playbooks"
- AutomationCollectionName = "automations"
- UserDataCollectionName = "userdata"
- UserCollectionName = "users"
- TicketTypeCollectionName = "tickettypes"
- JobCollectionName = "jobs"
- SettingsCollectionName = "settings"
- DashboardCollectionName = "dashboards"
-
- TicketArtifactsGraphName = "Graph"
- RelatedTicketsCollectionName = "related"
-)
-
-type Database struct {
- *busdb.BusDatabase
- Index *index.Index
- bus *bus.Bus
- Hooks *hooks.Hooks
-
- templateCollection *busdb.Collection[model.TicketTemplate]
- ticketCollection *busdb.Collection[model.Ticket]
- playbookCollection *busdb.Collection[model.PlaybookTemplate]
- automationCollection *busdb.Collection[model.Automation]
- userdataCollection *busdb.Collection[model.UserData]
- userCollection *busdb.Collection[model.User]
- tickettypeCollection *busdb.Collection[model.TicketType]
- jobCollection *busdb.Collection[model.Job]
- settingsCollection *busdb.Collection[model.Settings]
- dashboardCollection *busdb.Collection[model.Dashboard]
-
- relatedCollection *busdb.Collection[driver.EdgeDocument]
- // containsCollection *busdb.Collection
-}
-
-type Config struct {
- Host string
- User string
- Password string
- Name string
-}
-
-func New(ctx context.Context, index *index.Index, bus *bus.Bus, hooks *hooks.Hooks, config *Config) (*Database, error) {
- name := config.Name
- if config.Name == "" {
- name = Name
- }
-
- var err error
- var client driver.Client
- for {
- deadline, ok := ctx.Deadline()
- if ok && time.Until(deadline) < 0 {
- return nil, context.DeadlineExceeded
- }
-
- client, err = getClient(ctx, config)
- if err == nil {
- break
- }
-
- if errors.Is(err, context.DeadlineExceeded) {
- return nil, errors.New("could not load database, connection timed out")
- }
-
- log.Printf("could not connect to database: %s, retrying in 10 seconds\n", err)
- time.Sleep(time.Second * 10)
- }
-
- hooks.DatabaseAfterConnect(ctx, client, name)
-
- arangoDB, err := SetupDB(ctx, client, name)
- if err != nil {
- return nil, fmt.Errorf("DB setup failed: %w", err)
- }
-
- if err = migrations.PerformMigrations(ctx, arangoDB); err != nil {
- return nil, fmt.Errorf("migrations failed: %w", err)
- }
-
- ticketCollection, err := arangoDB.Collection(ctx, TicketCollectionName)
- if err != nil {
- return nil, err
- }
- templateCollection, err := arangoDB.Collection(ctx, TemplateCollectionName)
- if err != nil {
- return nil, err
- }
- playbookCollection, err := arangoDB.Collection(ctx, PlaybookCollectionName)
- if err != nil {
- return nil, err
- }
- relatedCollection, err := arangoDB.Collection(ctx, RelatedTicketsCollectionName)
- if err != nil {
- return nil, err
- }
- automationCollection, err := arangoDB.Collection(ctx, AutomationCollectionName)
- if err != nil {
- return nil, err
- }
- userdataCollection, err := arangoDB.Collection(ctx, UserDataCollectionName)
- if err != nil {
- return nil, err
- }
- userCollection, err := arangoDB.Collection(ctx, UserCollectionName)
- if err != nil {
- return nil, err
- }
- tickettypeCollection, err := arangoDB.Collection(ctx, TicketTypeCollectionName)
- if err != nil {
- return nil, err
- }
- jobCollection, err := arangoDB.Collection(ctx, JobCollectionName)
- if err != nil {
- return nil, err
- }
- settingsCollection, err := arangoDB.Collection(ctx, SettingsCollectionName)
- if err != nil {
- return nil, err
- }
- dashboardCollection, err := arangoDB.Collection(ctx, DashboardCollectionName)
- if err != nil {
- return nil, err
- }
-
- hookedDB, err := busdb.NewDatabase(ctx, arangoDB, bus)
- if err != nil {
- return nil, err
- }
-
- db := &Database{
- BusDatabase: hookedDB,
- bus: bus,
- Index: index,
- Hooks: hooks,
- templateCollection: busdb.NewCollection[model.TicketTemplate](templateCollection, hookedDB),
- ticketCollection: busdb.NewCollection[model.Ticket](ticketCollection, hookedDB),
- playbookCollection: busdb.NewCollection[model.PlaybookTemplate](playbookCollection, hookedDB),
- automationCollection: busdb.NewCollection[model.Automation](automationCollection, hookedDB),
- userdataCollection: busdb.NewCollection[model.UserData](userdataCollection, hookedDB),
- userCollection: busdb.NewCollection[model.User](userCollection, hookedDB),
- tickettypeCollection: busdb.NewCollection[model.TicketType](tickettypeCollection, hookedDB),
- jobCollection: busdb.NewCollection[model.Job](jobCollection, hookedDB),
- settingsCollection: busdb.NewCollection[model.Settings](settingsCollection, hookedDB),
- dashboardCollection: busdb.NewCollection[model.Dashboard](dashboardCollection, hookedDB),
- relatedCollection: busdb.NewCollection[driver.EdgeDocument](relatedCollection, hookedDB),
- }
-
- return db, nil
-}
-
-func getClient(ctx context.Context, config *Config) (driver.Client, error) {
- conn, err := http.NewConnection(http.ConnectionConfig{Endpoints: []string{config.Host}})
- if err != nil {
- return nil, err
- }
-
- client, err := driver.NewClient(driver.ClientConfig{
- Connection: conn,
- Authentication: driver.BasicAuthentication(config.User, config.Password),
- })
- if err != nil {
- return nil, err
- }
-
- if _, err := client.Version(ctx); err != nil {
- return nil, err
- }
-
- return client, nil
-}
-
-func SetupDB(ctx context.Context, client driver.Client, dbName string) (driver.Database, error) {
- databaseExists, err := client.DatabaseExists(ctx, dbName)
- if err != nil {
- return nil, fmt.Errorf("could not check if database exists: %w", err)
- }
-
- var db driver.Database
- if !databaseExists {
- db, err = client.CreateDatabase(ctx, dbName, nil)
- } else {
- db, err = client.Database(ctx, dbName)
- }
- if err != nil {
- return nil, fmt.Errorf("could not create database: %w", err)
- }
-
- collectionExists, err := db.CollectionExists(ctx, migrations.MigrationCollection)
- if err != nil {
- return nil, fmt.Errorf("could not check if collection exists: %w", err)
- }
-
- if !collectionExists {
- if _, err := db.CreateCollection(ctx, migrations.MigrationCollection, &driver.CreateCollectionOptions{
- KeyOptions: &driver.CollectionKeyOptions{AllowUserKeys: true},
- }); err != nil {
- log.Println(err)
- }
- }
-
- return db, nil
-}
-
-func (db *Database) Truncate(ctx context.Context) {
- _ = db.templateCollection.Truncate(ctx)
- _ = db.ticketCollection.Truncate(ctx)
- _ = db.playbookCollection.Truncate(ctx)
- _ = db.automationCollection.Truncate(ctx)
- _ = db.userdataCollection.Truncate(ctx)
- _ = db.userCollection.Truncate(ctx)
- _ = db.tickettypeCollection.Truncate(ctx)
- _ = db.jobCollection.Truncate(ctx)
- _ = db.relatedCollection.Truncate(ctx)
- _ = db.settingsCollection.Truncate(ctx)
- _ = db.dashboardCollection.Truncate(ctx)
- // db.containsCollection.Truncate(ctx)
-}
diff --git a/database/job.go b/database/job.go
deleted file mode 100644
index 7a1a880..0000000
--- a/database/job.go
+++ /dev/null
@@ -1,230 +0,0 @@
-package database
-
-import (
- "context"
- "encoding/json"
- "errors"
- "fmt"
-
- "github.com/arangodb/go-driver"
- "github.com/docker/docker/client"
-
- "github.com/SecurityBrewery/catalyst/bus"
- "github.com/SecurityBrewery/catalyst/caql"
- "github.com/SecurityBrewery/catalyst/database/busdb"
- "github.com/SecurityBrewery/catalyst/generated/model"
-)
-
-func toJob(doc *model.JobForm) *model.Job {
- return &model.Job{
- Automation: doc.Automation,
- Payload: doc.Payload,
- Origin: doc.Origin,
- Running: true,
- Status: "created",
- }
-}
-
-func (db *Database) toJobResponse(ctx context.Context, key string, doc *model.Job, update bool) (*model.JobResponse, error) {
- cli, err := client.NewClientWithOpts(client.FromEnv)
- if err != nil {
- return nil, err
- }
- defer cli.Close()
-
- status := doc.Status
-
- if doc.Running {
- inspect, err := cli.ContainerInspect(ctx, key)
- if err != nil || inspect.State == nil {
- if update {
- _, _ = db.JobUpdate(ctx, key, &model.JobUpdate{
- Status: doc.Status,
- Running: false,
- })
- }
- } else if doc.Status != inspect.State.Status {
- status = inspect.State.Status
- if update {
- _, _ = db.JobUpdate(ctx, key, &model.JobUpdate{
- Status: status,
- Running: doc.Running,
- })
- }
- }
- }
-
- return &model.JobResponse{
- Automation: doc.Automation,
- ID: key,
- Log: doc.Log,
- Payload: doc.Payload,
- Origin: doc.Origin,
- Output: doc.Output,
- Status: status,
- Container: doc.Container,
- }, nil
-}
-
-func (db *Database) JobCreate(ctx context.Context, id string, job *model.JobForm) (*model.JobResponse, error) {
- if job == nil {
- return nil, errors.New("requires job")
- }
-
- var doc model.Job
- newctx := driver.WithReturnNew(ctx, &doc)
-
- meta, err := db.jobCollection.CreateDocument(ctx, newctx, id, toJob(job))
- if err != nil {
- return nil, err
- }
-
- return db.toJobResponse(ctx, meta.Key, &doc, true)
-}
-
-func (db *Database) JobGet(ctx context.Context, id string) (*model.JobResponse, error) {
- var doc model.Job
- meta, err := db.jobCollection.ReadDocument(ctx, id, &doc)
- if err != nil {
- return nil, err
- }
-
- return db.toJobResponse(ctx, meta.Key, &doc, true)
-}
-
-func (db *Database) JobUpdate(ctx context.Context, id string, job *model.JobUpdate) (*model.JobResponse, error) {
- var doc model.Job
- ctx = driver.WithReturnNew(ctx, &doc)
-
- meta, err := db.jobCollection.UpdateDocument(ctx, id, job)
- if err != nil {
- return nil, err
- }
-
- return db.toJobResponse(ctx, meta.Key, &doc, true)
-}
-
-func (db *Database) JobLogAppend(ctx context.Context, id string, logLine string) error {
- query := `LET d = DOCUMENT(@@collection, @ID)
- UPDATE d WITH { "log": CONCAT(NOT_NULL(d.log, ""), @logline) } IN @@collection`
- cur, _, err := db.Query(ctx, query, map[string]any{
- "@collection": JobCollectionName,
- "ID": id,
- "logline": logLine,
- }, &busdb.Operation{
- Type: bus.DatabaseEntryUpdated,
- Ids: []driver.DocumentID{
- driver.DocumentID(fmt.Sprintf("%s/%s", JobCollectionName, id)),
- },
- })
- if err != nil {
- return err
- }
- defer cur.Close()
-
- return nil
-}
-
-func (db *Database) JobComplete(ctx context.Context, id string, out any) error {
- query := `LET d = DOCUMENT(@@collection, @ID)
- UPDATE d WITH { "output": @out, "status": "completed", "running": false } IN @@collection`
- cur, _, err := db.Query(ctx, query, map[string]any{
- "@collection": JobCollectionName,
- "ID": id,
- "out": out,
- }, &busdb.Operation{
- Type: bus.DatabaseEntryUpdated,
- Ids: []driver.DocumentID{
- driver.DocumentID(fmt.Sprintf("%s/%s", JobCollectionName, id)),
- },
- })
- if err != nil {
- return err
- }
- defer cur.Close()
-
- return nil
-}
-
-func (db *Database) JobDelete(ctx context.Context, id string) error {
- _, err := db.jobCollection.RemoveDocument(ctx, id)
-
- return err
-}
-
-func (db *Database) JobList(ctx context.Context) ([]*model.JobResponse, error) {
- query := "FOR d IN @@collection RETURN d"
- cursor, _, err := db.Query(ctx, query, map[string]any{"@collection": JobCollectionName}, busdb.ReadOperation)
- if err != nil {
- return nil, err
- }
- defer cursor.Close()
- var docs []*model.JobResponse
- for {
- var doc model.Job
- meta, err := cursor.ReadDocument(ctx, &doc)
- if driver.IsNoMoreDocuments(err) {
- break
- } else if err != nil {
- return nil, err
- }
-
- job, err := db.toJobResponse(ctx, meta.Key, &doc, false)
- if err != nil {
- return nil, err
- }
-
- docs = append(docs, job)
- }
-
- return docs, err
-}
-
-func publishJobMapping(id, automation string, contextStructs *model.Context, origin *model.Origin, payloadMapping map[string]string, db *Database) error {
- msg, err := generatePayload(payloadMapping, contextStructs)
- if err != nil {
- return fmt.Errorf("message generation failed: %w", err)
- }
-
- db.bus.JobChannel.Publish(&bus.JobMsg{
- ID: id,
- Automation: automation,
- Origin: origin,
- Message: &model.Message{
- Context: contextStructs,
- Payload: msg,
- },
- })
-
- return nil
-}
-
-func generatePayload(msgMapping map[string]string, contextStructs *model.Context) (map[string]any, error) {
- contextJSON, err := json.Marshal(contextStructs)
- if err != nil {
- return nil, err
- }
-
- automationContext := map[string]any{}
- err = json.Unmarshal(contextJSON, &automationContext)
- if err != nil {
- return nil, err
- }
-
- parser := caql.Parser{}
- msg := map[string]any{}
- for arg, expr := range msgMapping {
- tree, err := parser.Parse(expr)
- if err != nil {
- return nil, err
- }
-
- v, err := tree.Eval(automationContext)
- if err != nil {
- return nil, err
- }
- msg[arg] = v
- }
-
- return msg, nil
-}
diff --git a/database/migrations/automations/comment.py b/database/migrations/automations/comment.py
deleted file mode 100644
index 6a5c9bf..0000000
--- a/database/migrations/automations/comment.py
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/env python
-
-import subprocess
-import sys
-
-subprocess.call(
- [sys.executable, "-m", "pip", "install", "requests"],
- stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL,
-)
-
-import json
-import requests
-
-
-def run(msg):
- if "ticket" in msg["context"]:
- headers = {"PRIVATE-TOKEN": msg["secrets"]["catalyst_apikey"]}
- url = "%s/tickets/%d/comments" % (msg["secrets"]["catalyst_apiurl"], msg["context"]["ticket"]["id"])
- data = {'message': msg["payload"]["default"], 'creator': 'automation'}
- requests.post(url, json=data, headers=headers).json()
-
- return {"done": True}
-
-
-print(json.dumps(run(json.loads(sys.argv[1]))))
diff --git a/database/migrations/automations/hash.sha1.py b/database/migrations/automations/hash.sha1.py
deleted file mode 100755
index 799ba06..0000000
--- a/database/migrations/automations/hash.sha1.py
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/usr/bin/env python
-
-import sys
-import json
-import hashlib
-
-
-def run(msg):
- sha1 = hashlib.sha1(msg['payload']['default'].encode('utf-8'))
- return {"hash": sha1.hexdigest()}
-
-
-print(json.dumps(run(json.loads(sys.argv[1]))))
diff --git a/database/migrations/automations/vt.hash.py b/database/migrations/automations/vt.hash.py
deleted file mode 100644
index 270c605..0000000
--- a/database/migrations/automations/vt.hash.py
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/usr/bin/env python
-
-import subprocess
-import sys
-
-subprocess.call(
- [sys.executable, "-m", "pip", "install", "requests"],
- stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL,
-)
-
-import json
-import requests
-
-
-def run(msg):
- api_key = msg['secrets']['vt_api_key'].encode('utf-8')
- resource = msg['payload']['default'].encode('utf-8')
- params = {'apikey': api_key, 'resource': resource}
- return requests.get("https://www.virustotal.com/vtapi/v2/file/report", params=params).json()
-
-
-print(json.dumps(run(json.loads(sys.argv[1]))))
diff --git a/database/migrations/content.go b/database/migrations/content.go
deleted file mode 100644
index 80042a4..0000000
--- a/database/migrations/content.go
+++ /dev/null
@@ -1,21 +0,0 @@
-package migrations
-
-import _ "embed"
-
-//go:embed templates/default.json
-var DefaultTemplateSchema string
-
-//go:embed automations/hash.sha1.py
-var SHA1HashAutomation string
-
-//go:embed automations/vt.hash.py
-var VTHashAutomation string
-
-//go:embed automations/comment.py
-var CommentAutomation string
-
-//go:embed playbooks/phishing.yml
-var PhishingPlaybook string
-
-//go:embed playbooks/simple.yaml
-var SimplePlaybook string
diff --git a/database/migrations/migrations.go b/database/migrations/migrations.go
deleted file mode 100644
index 7881ebe..0000000
--- a/database/migrations/migrations.go
+++ /dev/null
@@ -1,247 +0,0 @@
-package migrations
-
-import (
- "context"
- "fmt"
-
- "github.com/arangodb/go-driver"
-
- "github.com/SecurityBrewery/catalyst/database/busdb"
- "github.com/SecurityBrewery/catalyst/generated/model"
- "github.com/SecurityBrewery/catalyst/generated/pointer"
-)
-
-const MigrationCollection string = "migrations"
-
-type Migration interface {
- MID() string
- Migrate(ctx context.Context, driver driver.Database) error
-}
-
-func generateMigrations() ([]Migration, error) {
- // content here should never change
- return []Migration{
- &createCollection{ID: "create-log-collection", Name: "logs", DataType: "log", Schema: `{"properties":{"created":{"format":"date-time","type":"string"},"creator":{"type":"string"},"message":{"type":"string"},"reference":{"type":"string"}},"required":["created","creator","message","reference"],"type":"object"}`},
- &createCollection{ID: "create-ticket-collection", Name: "tickets", DataType: "ticket", Schema: `{"properties":{"artifacts":{"items":{"properties":{"enrichments":{"additionalProperties":{"properties":{"created":{"format":"date-time","type":"string"},"data":{"example":{"hash":"b7a067a742c20d07a7456646de89bc2d408a1153"},"properties":{},"type":"object"},"name":{"example":"hash.sha1","type":"string"}},"required":["created","data","name"],"type":"object"},"type":"object"},"name":{"example":"2.2.2.2","type":"string"},"status":{"example":"Unknown","type":"string"},"type":{"type":"string"}},"required":["name"],"type":"object"},"type":"array"},"comments":{"items":{"properties":{"created":{"format":"date-time","type":"string"},"creator":{"type":"string"},"message":{"type":"string"}},"required":["created","creator","message"],"type":"object"},"type":"array"},"created":{"format":"date-time","type":"string"},"details":{"example":{"description":"my little incident"},"properties":{},"type":"object"},"files":{"items":{"properties":{"key":{"example":"myfile","type":"string"},"name":{"example":"notes.docx","type":"string"}},"required":["key","name"],"type":"object"},"type":"array"},"modified":{"format":"date-time","type":"string"},"name":{"example":"WannyCry","type":"string"},"owner":{"example":"bob","type":"string"},"playbooks":{"additionalProperties":{"properties":{"name":{"example":"Phishing","type":"string"},"tasks":{"additionalProperties":{"properties":{"automation":{"type":"string"},"closed":{"format":"date-time","type":"string"},"created":{"format":"date-time","type":"string"},"data":{"properties":{},"type":"object"},"done":{"type":"boolean"},"join":{"example":false,"type":"boolean"},"payload":{"additionalProperties":{"type":"string"},"type":"object"},"name":{"example":"Inform user","type":"string"},"next":{"additionalProperties":{"type":"string"},"type":"object"},"owner":{"type":"string"},"schema":{"properties":{},"type":"object"},"type":{"enum":["task","input","automation"],"example":"task","type":"string"}},"required":["created","done","name","type"],"type":"object"},"type":"object"}},"required":["name","tasks"],"type":"object"},"type":"object"},"read":{"example":["bob"],"items":{"type":"string"},"type":"array"},"references":{"items":{"properties":{"href":{"example":"https://cve.mitre.org/cgi-bin/cvename.cgi?name=cve-2017-0144","type":"string"},"name":{"example":"CVE-2017-0144","type":"string"}},"required":["href","name"],"type":"object"},"type":"array"},"schema":{"example":"{}","type":"string"},"status":{"example":"open","type":"string"},"type":{"example":"incident","type":"string"},"write":{"example":["alice"],"items":{"type":"string"},"type":"array"}},"required":["created","modified","name","schema","status","type"],"type":"object"}`},
- &createCollection{ID: "create-template-collection", Name: "templates", DataType: "template", Schema: `{"properties":{"name":{"type":"string"},"schema":{"type":"string"}},"required":["name","schema"],"type":"object"}`},
- &createCollection{ID: "create-playbook-collection", Name: "playbooks", DataType: "playbook", Schema: `{"properties":{"name":{"type":"string"},"yaml":{"type":"string"}},"required":["name","yaml"],"type":"object"}`},
- &createCollection{ID: "create-automation-collection", Name: "automations", DataType: "automation", Schema: `{"properties":{"image":{"type":"string"},"script":{"type":"string"}},"required":["image","script"],"type":"object"}`},
- &createCollection{ID: "create-userdata-collection", Name: "userdata", DataType: "userdata", Schema: `{"properties":{"email":{"type":"string"},"image":{"type":"string"},"name":{"type":"string"},"timeformat":{"title":"Time Format (https://moment.github.io/luxon/docs/manual/formatting.html#table-of-tokens)","type":"string"}},"type":"object"}`},
- &createCollection{ID: "create-tickettype-collection", Name: "tickettypes", DataType: "tickettype", Schema: `{"properties":{"default_groups":{"items":{"type":"string"},"type":"array"},"default_playbooks":{"items":{"type":"string"},"type":"array"},"default_template":{"type":"string"},"icon":{"type":"string"},"name":{"type":"string"}},"required":["default_playbooks","default_template","icon","name"],"type":"object"}`},
- &createCollection{ID: "create-user-collection", Name: "users", DataType: "user", Schema: `{"properties":{"apikey":{"type":"boolean"},"blocked":{"type":"boolean"},"roles":{"items":{"type":"string"},"type":"array"},"sha256":{"type":"string"}},"required":["apikey","blocked","roles"],"type":"object"}`},
-
- &createGraph{ID: "create-ticket-graph", Name: "Graph", EdgeDefinitions: []driver.EdgeDefinition{{Collection: "related", From: []string{"tickets"}, To: []string{"tickets"}}}},
-
- &createDocument[busdb.Keyed[model.TicketTemplate]]{ID: "create-template-default", Collection: "templates", Document: &busdb.Keyed[model.TicketTemplate]{Key: "default", Doc: &model.TicketTemplate{Schema: DefaultTemplateSchema, Name: "Default"}}},
- &createDocument[busdb.Keyed[model.Automation]]{ID: "create-automation-vt.hash", Collection: "automations", Document: &busdb.Keyed[model.Automation]{Key: "vt.hash", Doc: &model.Automation{Image: "docker.io/python:3", Script: VTHashAutomation}}},
- &createDocument[busdb.Keyed[model.Automation]]{ID: "create-automation-comment", Collection: "automations", Document: &busdb.Keyed[model.Automation]{Key: "comment", Doc: &model.Automation{Image: "docker.io/python:3", Script: CommentAutomation}}},
- &createDocument[busdb.Keyed[model.Automation]]{ID: "create-automation-hash.sha1", Collection: "automations", Document: &busdb.Keyed[model.Automation]{Key: "hash.sha1", Doc: &model.Automation{Image: "docker.io/python:3", Script: SHA1HashAutomation}}},
- &createDocument[busdb.Keyed[model.PlaybookTemplate]]{ID: "create-playbook-phishing", Collection: "playbooks", Document: &busdb.Keyed[model.PlaybookTemplate]{Key: "phishing", Doc: &model.PlaybookTemplate{Name: "Phishing", Yaml: PhishingPlaybook}}},
- &createDocument[busdb.Keyed[model.TicketType]]{ID: "create-tickettype-alert", Collection: "tickettypes", Document: &busdb.Keyed[model.TicketType]{Key: "alert", Doc: &model.TicketType{Name: "Alerts", Icon: "mdi-alert", DefaultTemplate: "default", DefaultPlaybooks: []string{}, DefaultGroups: nil}}},
- &createDocument[busdb.Keyed[model.TicketType]]{ID: "create-tickettype-incident", Collection: "tickettypes", Document: &busdb.Keyed[model.TicketType]{Key: "incident", Doc: &model.TicketType{Name: "Incidents", Icon: "mdi-radioactive", DefaultTemplate: "default", DefaultPlaybooks: []string{}, DefaultGroups: nil}}},
- &createDocument[busdb.Keyed[model.TicketType]]{ID: "create-tickettype-investigation", Collection: "tickettypes", Document: &busdb.Keyed[model.TicketType]{Key: "investigation", Doc: &model.TicketType{Name: "Forensic Investigations", Icon: "mdi-fingerprint", DefaultTemplate: "default", DefaultPlaybooks: []string{}, DefaultGroups: nil}}},
- &createDocument[busdb.Keyed[model.TicketType]]{ID: "create-tickettype-hunt", Collection: "tickettypes", Document: &busdb.Keyed[model.TicketType]{Key: "hunt", Doc: &model.TicketType{Name: "Threat Hunting", Icon: "mdi-target", DefaultTemplate: "default", DefaultPlaybooks: []string{}, DefaultGroups: nil}}},
-
- &updateSchema{ID: "update-automation-collection-1", Name: "automations", DataType: "automation", Schema: `{"properties":{"image":{"type":"string"},"script":{"type":"string"}},"required":["image","script"],"type":"object"}`},
- &updateDocument[model.Automation]{ID: "update-automation-vt.hash-1", Collection: "automations", Key: "vt.hash", Document: &model.Automation{Image: "docker.io/python:3", Script: VTHashAutomation, Schema: pointer.String(`{"title":"Input","type":"object","properties":{"default":{"type":"string","title":"Value"}},"required":["default"]}`), Type: []string{"global", "artifact", "playbook"}}},
- &updateDocument[model.Automation]{ID: "update-automation-comment-1", Collection: "automations", Key: "comment", Document: &model.Automation{Image: "docker.io/python:3", Script: CommentAutomation, Type: []string{"playbook"}}},
- &updateDocument[model.Automation]{ID: "update-automation-hash.sha1-1", Collection: "automations", Key: "hash.sha1", Document: &model.Automation{Image: "docker.io/python:3", Script: SHA1HashAutomation, Schema: pointer.String(`{"title":"Input","type":"object","properties":{"default":{"type":"string","title":"Value"}},"required":["default"]}`), Type: []string{"global", "artifact", "playbook"}}},
-
- &createCollection{ID: "create-job-collection", Name: "jobs", DataType: "job", Schema: `{"properties":{"automation":{"type":"string"},"log":{"type":"string"},"payload":{},"origin":{"properties":{"artifact_origin":{"properties":{"artifact":{"type":"string"},"ticket_id":{"format":"int64","type":"integer"}},"required":["artifact","ticket_id"],"type":"object"},"task_origin":{"properties":{"playbook_id":{"type":"string"},"task_id":{"type":"string"},"ticket_id":{"format":"int64","type":"integer"}},"required":["playbook_id","task_id","ticket_id"],"type":"object"}},"type":"object"},"output":{"properties":{},"type":"object"},"running":{"type":"boolean"},"status":{"type":"string"}},"required":["automation","running","status"],"type":"object"}`},
-
- &createDocument[busdb.Keyed[model.PlaybookTemplate]]{ID: "create-playbook-simple", Collection: "playbooks", Document: &busdb.Keyed[model.PlaybookTemplate]{Key: "simple", Doc: &model.PlaybookTemplate{Name: "Simple", Yaml: SimplePlaybook}}},
-
- &createCollection{ID: "create-settings-collection", Name: "settings", DataType: "settings", Schema: `{"type":"object","properties":{"artifactStates":{"title":"Artifact States","items":{"type":"object","properties":{"color":{"title":"Color","type":"string","enum":["error","info","success","warning"]},"icon":{"title":"Icon (https://materialdesignicons.com)","type":"string"},"id":{"title":"ID","type":"string"},"name":{"title":"Name","type":"string"}},"required":["id","name","icon"]},"type":"array"},"artifactKinds":{"title":"Artifact Kinds","items":{"type":"object","properties":{"color":{"title":"Color","type":"string","enum":["error","info","success","warning"]},"icon":{"title":"Icon (https://materialdesignicons.com)","type":"string"},"id":{"title":"ID","type":"string"},"name":{"title":"Name","type":"string"}},"required":["id","name","icon"]},"type":"array"},"timeformat":{"title":"Time Format","type":"string"}},"required":["timeformat","artifactKinds","artifactStates"]}`},
- &createDocument[busdb.Keyed[model.Settings]]{ID: "create-settings-global", Collection: "settings", Document: &busdb.Keyed[model.Settings]{Key: "global", Doc: &model.Settings{ArtifactStates: []*model.Type{{Icon: "mdi-help-circle-outline", ID: "unknown", Name: "Unknown", Color: pointer.String(model.TypeColorInfo)}, {Icon: "mdi-skull", ID: "malicious", Name: "Malicious", Color: pointer.String(model.TypeColorError)}, {Icon: "mdi-check", ID: "clean", Name: "Clean", Color: pointer.String(model.TypeColorSuccess)}}, ArtifactKinds: []*model.Type{{Icon: "mdi-server", ID: "asset", Name: "Asset"}, {Icon: "mdi-bullseye", ID: "ioc", Name: "IOC"}}, Timeformat: "YYYY-MM-DDThh:mm:ss"}}},
-
- &updateSchema{ID: "update-ticket-collection", Name: "tickets", DataType: "ticket", Schema: `{"properties":{"artifacts":{"items":{"properties":{"enrichments":{"additionalProperties":{"properties":{"created":{"format":"date-time","type":"string"},"data":{"example":{"hash":"b7a067a742c20d07a7456646de89bc2d408a1153"},"properties":{},"type":"object"},"name":{"example":"hash.sha1","type":"string"}},"required":["created","data","name"],"type":"object"},"type":"object"},"name":{"example":"2.2.2.2","type":"string"},"status":{"example":"Unknown","type":"string"},"type":{"type":"string"},"kind":{"type":"string"}},"required":["name"],"type":"object"},"type":"array"},"comments":{"items":{"properties":{"created":{"format":"date-time","type":"string"},"creator":{"type":"string"},"message":{"type":"string"}},"required":["created","creator","message"],"type":"object"},"type":"array"},"created":{"format":"date-time","type":"string"},"details":{"example":{"description":"my little incident"},"properties":{},"type":"object"},"files":{"items":{"properties":{"key":{"example":"myfile","type":"string"},"name":{"example":"notes.docx","type":"string"}},"required":["key","name"],"type":"object"},"type":"array"},"modified":{"format":"date-time","type":"string"},"name":{"example":"WannyCry","type":"string"},"owner":{"example":"bob","type":"string"},"playbooks":{"additionalProperties":{"properties":{"name":{"example":"Phishing","type":"string"},"tasks":{"additionalProperties":{"properties":{"automation":{"type":"string"},"closed":{"format":"date-time","type":"string"},"created":{"format":"date-time","type":"string"},"data":{"properties":{},"type":"object"},"done":{"type":"boolean"},"join":{"example":false,"type":"boolean"},"payload":{"additionalProperties":{"type":"string"},"type":"object"},"name":{"example":"Inform user","type":"string"},"next":{"additionalProperties":{"type":"string"},"type":"object"},"owner":{"type":"string"},"schema":{"properties":{},"type":"object"},"type":{"enum":["task","input","automation"],"example":"task","type":"string"}},"required":["created","done","name","type"],"type":"object"},"type":"object"}},"required":["name","tasks"],"type":"object"},"type":"object"},"read":{"example":["bob"],"items":{"type":"string"},"type":"array"},"references":{"items":{"properties":{"href":{"example":"https://cve.mitre.org/cgi-bin/cvename.cgi?name=cve-2017-0144","type":"string"},"name":{"example":"CVE-2017-0144","type":"string"}},"required":["href","name"],"type":"object"},"type":"array"},"schema":{"example":"{}","type":"string"},"status":{"example":"open","type":"string"},"type":{"example":"incident","type":"string"},"write":{"example":["alice"],"items":{"type":"string"},"type":"array"}},"required":["created","modified","name","schema","status","type"],"type":"object"}`},
-
- &createCollection{ID: "create-dashboard-collection", Name: "dashboards", DataType: "dashboards", Schema: `{"type":"object","properties":{"name":{"type":"string"},"widgets":{"items":{"type":"object","properties":{"aggregation":{"type":"string"},"filter":{"type":"string"},"name":{"type":"string"},"type":{"enum":[ "bar", "line", "pie" ]},"width": { "type": "integer", "minimum": 1, "maximum": 12 }},"required":["name","aggregation", "type", "width"]},"type":"array"}},"required":["name","widgets"]}`},
-
- &updateDocument[model.Settings]{ID: "update-settings-global-1", Collection: "settings", Key: "global", Document: &model.Settings{ArtifactStates: []*model.Type{{Icon: "mdi-help-circle-outline", ID: "unknown", Name: "Unknown", Color: pointer.String(model.TypeColorInfo)}, {Icon: "mdi-skull", ID: "malicious", Name: "Malicious", Color: pointer.String(model.TypeColorError)}, {Icon: "mdi-check", ID: "clean", Name: "Clean", Color: pointer.String(model.TypeColorSuccess)}}, ArtifactKinds: []*model.Type{{Icon: "mdi-server", ID: "asset", Name: "Asset"}, {Icon: "mdi-bullseye", ID: "ioc", Name: "IOC"}}, Timeformat: "yyyy-MM-dd hh:mm:ss"}},
-
- &mapRoles{ID: "simplify-roles"},
- }, nil
-}
-
-func loadSchema(dataType, jsonschema string) (*driver.CollectionSchemaOptions, error) {
- ticketCollectionSchema := &driver.CollectionSchemaOptions{Level: driver.CollectionSchemaLevelStrict, Message: fmt.Sprintf("Validation of %s failed", dataType)}
-
- err := ticketCollectionSchema.LoadRule([]byte(jsonschema))
-
- return ticketCollectionSchema, err
-}
-
-type migration struct {
- Key string `json:"_key"`
-}
-
-func PerformMigrations(ctx context.Context, db driver.Database) error {
- collection, err := db.Collection(ctx, MigrationCollection)
- if err != nil {
- return err
- }
-
- migrations, err := generateMigrations()
- if err != nil {
- return fmt.Errorf("could not generate migrations: %w", err)
- }
-
- for _, m := range migrations {
- migrationRan, err := collection.DocumentExists(ctx, m.MID())
- if err != nil {
- return err
- }
-
- if !migrationRan {
- if err := m.Migrate(ctx, db); err != nil {
- return fmt.Errorf("migration %s failed: %w", m.MID(), err)
- }
-
- if _, err := collection.CreateDocument(ctx, &migration{Key: m.MID()}); err != nil {
- return fmt.Errorf("could not save %s migration document: %w", m.MID(), err)
- }
- }
- }
-
- return nil
-}
-
-type createCollection struct {
- ID string
- Name string
- DataType string
- Schema string
-}
-
-func (m *createCollection) MID() string {
- return m.ID
-}
-
-func (m *createCollection) Migrate(ctx context.Context, db driver.Database) error {
- schema, err := loadSchema(m.DataType, m.Schema)
- if err != nil {
- return err
- }
-
- _, err = db.CreateCollection(ctx, m.Name, &driver.CreateCollectionOptions{
- Schema: schema,
- })
-
- return err
-}
-
-type updateSchema struct {
- ID string
- Name string
- DataType string
- Schema string
-}
-
-func (m *updateSchema) MID() string {
- return m.ID
-}
-
-func (m *updateSchema) Migrate(ctx context.Context, db driver.Database) error {
- schema, err := loadSchema(m.DataType, m.Schema)
- if err != nil {
- return err
- }
-
- col, err := db.Collection(ctx, m.Name)
- if err != nil {
- return err
- }
-
- err = col.SetProperties(ctx, driver.SetCollectionPropertiesOptions{
- Schema: schema,
- })
-
- return err
-}
-
-type createGraph struct {
- ID string
- Name string
- EdgeDefinitions []driver.EdgeDefinition
-}
-
-func (m *createGraph) MID() string {
- return m.ID
-}
-
-func (m *createGraph) Migrate(ctx context.Context, db driver.Database) error {
- _, err := db.CreateGraph(ctx, m.Name, &driver.CreateGraphOptions{
- EdgeDefinitions: m.EdgeDefinitions,
- })
-
- return err
-}
-
-type createDocument[T any] struct {
- ID string
- Collection string
- Document *T
-}
-
-func (m *createDocument[T]) MID() string {
- return m.ID
-}
-
-func (m *createDocument[T]) Migrate(ctx context.Context, driver driver.Database) error {
- collection, err := driver.Collection(ctx, m.Collection)
- if err != nil {
- return err
- }
-
- _, err = collection.CreateDocument(ctx, m.Document)
-
- return err
-}
-
-type updateDocument[T any] struct {
- ID string
- Collection string
- Key string
- Document *T
-}
-
-func (m *updateDocument[T]) MID() string {
- return m.ID
-}
-
-func (m *updateDocument[T]) Migrate(ctx context.Context, driver driver.Database) error {
- collection, err := driver.Collection(ctx, m.Collection)
- if err != nil {
- return err
- }
-
- exists, err := collection.DocumentExists(ctx, m.Key)
- if err != nil {
- return err
- }
-
- if !exists {
- _, err = collection.CreateDocument(ctx, m.Document)
-
- return err
- }
-
- _, err = collection.ReplaceDocument(ctx, m.Key, m.Document)
-
- return err
-}
-
-type mapRoles struct {
- ID string
-}
-
-func (m mapRoles) MID() string {
- return m.ID
-}
-
-func (m mapRoles) Migrate(ctx context.Context, driver driver.Database) error {
- _, err := driver.Query(ctx, "FOR u IN users UPDATE u WITH {roles: u.roles[*].name} IN users", nil)
-
- return err
-}
diff --git a/database/migrations/playbooks/phishing.yml b/database/migrations/playbooks/phishing.yml
deleted file mode 100644
index 0934b95..0000000
--- a/database/migrations/playbooks/phishing.yml
+++ /dev/null
@@ -1,85 +0,0 @@
-name: Phishing
-tasks:
- board:
- name: Board Involvement?
- description: Is a board member involved?
- type: input
- schema:
- properties:
- boardInvolved:
- default: false
- title: A board member is involved.
- type: boolean
- required:
- - boardInvolved
- title: Board Involvement?
- type: object
- next:
- escalate: "boardInvolved == true"
- mail-available: "boardInvolved == false"
-
- escalate:
- name: Escalate to CISO
- description: Please escalate the task to the CISO
- type: task
-
- mail-available:
- name: Mail available
- type: input
- schema:
- oneOf:
- - properties:
- mail:
- title: Mail
- type: string
- x-display: textarea
- schemaKey:
- const: 'yes'
- type: string
- required:
- - mail
- title: 'Yes'
- - properties:
- schemaKey:
- const: 'no'
- type: string
- title: 'No'
- title: Mail available
- type: object
- next:
- block-sender: "schemaKey == 'yes'"
- extract-iocs: "schemaKey == 'yes'"
- search-email-gateway: "schemaKey == 'no'"
-
- search-email-gateway:
- name: Search email gateway
- description: Please search email-gateway for the phishing mail.
- type: task
- next:
- extract-iocs:
-
- block-sender:
- name: Block sender
- type: task
- next:
- extract-iocs:
-
- extract-iocs:
- name: Extract IOCs
- description: Please insert the IOCs
- type: input
- schema:
- properties:
- iocs:
- items:
- type: string
- title: IOCs
- type: array
- title: Extract IOCs
- type: object
- next:
- block-iocs:
-
- block-iocs:
- name: Block IOCs
- type: task
diff --git a/database/migrations/playbooks/simple.yaml b/database/migrations/playbooks/simple.yaml
deleted file mode 100644
index 5046453..0000000
--- a/database/migrations/playbooks/simple.yaml
+++ /dev/null
@@ -1,37 +0,0 @@
-name: Simple
-tasks:
- input:
- name: Enter something to hash
- type: input
- schema:
- title: Something
- type: object
- properties:
- something:
- type: string
- title: Something
- default: ""
- next:
- hash: "something != ''"
-
- hash:
- name: Hash the something
- type: automation
- automation: hash.sha1
- payload:
- default: "playbook.tasks['input'].data['something']"
- next:
- comment: "hash != ''"
-
- comment:
- name: Comment the hash
- type: automation
- automation: comment
- payload:
- default: "playbook.tasks['hash'].data['hash']"
- next:
- done: "done"
-
- done:
- name: You can close this case now
- type: task
diff --git a/database/migrations/templates/default.json b/database/migrations/templates/default.json
deleted file mode 100644
index 20a186e..0000000
--- a/database/migrations/templates/default.json
+++ /dev/null
@@ -1,79 +0,0 @@
-{
- "definitions": {},
- "$schema": "http://json-schema.org/draft-07/schema#",
- "$id": "https://example.com/object1618746510.json",
- "title": "Default",
- "type": "object",
- "required": [
- "severity",
- "description",
- "tlp"
- ],
- "properties": {
- "severity": {
- "$id": "#root/severity",
- "title": "Severity",
- "type": "string",
- "default": "Medium",
- "x-cols": 6,
- "x-class": "pr-2",
- "x-display": "icon",
- "x-itemIcon": "icon",
- "oneOf": [
- {
- "const": "Low",
- "title": "Low",
- "icon": "mdi-chevron-up"
- },
- {
- "const": "Medium",
- "title": "Medium",
- "icon": "mdi-chevron-double-up"
- },
- {
- "const": "High",
- "title": "High",
- "icon": "mdi-chevron-triple-up"
- }
- ]
- },
- "tlp": {
- "$id": "#root/tlp",
- "title": "TLP",
- "type": "string",
- "x-cols": 6,
- "x-class": "pr-2",
- "x-display": "icon",
- "x-itemIcon": "icon",
- "oneOf": [
- {
- "const": "White",
- "title": "White",
- "icon": "mdi-alpha-w"
- },
- {
- "const": "Green",
- "title": "Green",
- "icon": "mdi-alpha-g"
- },
- {
- "const": "Amber",
- "title": "Amber",
- "icon": "mdi-alpha-a"
- },
- {
- "const": "Red",
- "title": "Red",
- "icon": "mdi-alpha-r"
- }
- ]
- },
- "description": {
- "$id": "#root/description",
- "title": "Description",
- "type": "string",
- "x-display": "textarea",
- "x-class": "pr-2"
- }
- }
-}
diff --git a/database/playbook.go b/database/playbook.go
deleted file mode 100644
index d3bb120..0000000
--- a/database/playbook.go
+++ /dev/null
@@ -1,160 +0,0 @@
-package database
-
-import (
- "context"
- "errors"
-
- "github.com/arangodb/go-driver"
- "github.com/iancoleman/strcase"
- "github.com/icza/dyno"
- "gopkg.in/yaml.v3"
-
- "github.com/SecurityBrewery/catalyst/database/busdb"
- "github.com/SecurityBrewery/catalyst/generated/model"
- "github.com/SecurityBrewery/catalyst/generated/time"
-)
-
-type PlaybookYAML struct {
- Name string `yaml:"name"`
- Tasks map[string]TaskYAML `yaml:"tasks"`
-}
-
-type TaskYAML struct {
- Name string `yaml:"name"`
- Type string `yaml:"type"`
- Schema any `yaml:"schema"`
- Automation string `yaml:"automation"`
- Payload map[string]string `yaml:"payload"`
- Next map[string]string `yaml:"next"`
- Join bool `yaml:"join"`
-}
-
-func toPlaybooks(docs []*model.PlaybookTemplateForm) (map[string]*model.Playbook, error) {
- playbooks := map[string]*model.Playbook{}
- for _, doc := range docs {
- playbook, err := toPlaybook(doc)
- if err != nil {
- return nil, err
- }
- if doc.ID != nil {
- playbooks[*doc.ID] = playbook
- } else {
- playbooks[strcase.ToKebab(playbook.Name)] = playbook
- }
- }
-
- return playbooks, nil
-}
-
-func toPlaybook(doc *model.PlaybookTemplateForm) (*model.Playbook, error) {
- ticketPlaybook := &model.Playbook{}
- err := yaml.Unmarshal([]byte(doc.Yaml), ticketPlaybook)
- if err != nil {
- return nil, err
- }
- for idx, task := range ticketPlaybook.Tasks {
- if task.Schema != nil {
- schema, ok := dyno.ConvertMapI2MapS(task.Schema).(map[string]any)
- if ok {
- task.Schema = schema
- } else {
- return nil, errors.New("could not convert schema")
- }
- }
- task.Created = time.Now().UTC()
- ticketPlaybook.Tasks[idx] = task
- }
-
- return ticketPlaybook, nil
-}
-
-func toPlaybookTemplateResponse(key string, doc *model.PlaybookTemplate) *model.PlaybookTemplateResponse {
- return &model.PlaybookTemplateResponse{ID: key, Name: doc.Name, Yaml: doc.Yaml}
-}
-
-func (db *Database) PlaybookCreate(ctx context.Context, playbook *model.PlaybookTemplateForm) (*model.PlaybookTemplateResponse, error) {
- if playbook == nil {
- return nil, errors.New("requires playbook")
- }
-
- var playbookYAML PlaybookYAML
- err := yaml.Unmarshal([]byte(playbook.Yaml), &playbookYAML)
- if err != nil {
- return nil, err
- }
-
- if playbookYAML.Name == "" {
- return nil, errors.New("requires template name")
- }
- p := model.PlaybookTemplate{Name: playbookYAML.Name, Yaml: playbook.Yaml}
-
- var doc model.PlaybookTemplate
- newctx := driver.WithReturnNew(ctx, &doc)
-
- meta, err := db.playbookCollection.CreateDocument(ctx, newctx, strcase.ToKebab(playbookYAML.Name), &p)
- if err != nil {
- return nil, err
- }
-
- return toPlaybookTemplateResponse(meta.Key, &doc), nil
-}
-
-func (db *Database) PlaybookGet(ctx context.Context, id string) (*model.PlaybookTemplateResponse, error) {
- doc := model.PlaybookTemplate{}
- meta, err := db.playbookCollection.ReadDocument(ctx, id, &doc)
- if err != nil {
- return nil, err
- }
-
- return toPlaybookTemplateResponse(meta.Key, &doc), nil
-}
-
-func (db *Database) PlaybookDelete(ctx context.Context, id string) error {
- _, err := db.playbookCollection.RemoveDocument(ctx, id)
-
- return err
-}
-
-func (db *Database) PlaybookUpdate(ctx context.Context, id string, playbook *model.PlaybookTemplateForm) (*model.PlaybookTemplateResponse, error) {
- var pb PlaybookYAML
- err := yaml.Unmarshal([]byte(playbook.Yaml), &pb)
- if err != nil {
- return nil, err
- }
-
- if pb.Name == "" {
- return nil, errors.New("requires template name")
- }
-
- var doc model.PlaybookTemplate
- ctx = driver.WithReturnNew(ctx, &doc)
-
- meta, err := db.playbookCollection.ReplaceDocument(ctx, id, &model.PlaybookTemplate{Name: pb.Name, Yaml: playbook.Yaml})
- if err != nil {
- return nil, err
- }
-
- return toPlaybookTemplateResponse(meta.Key, &doc), nil
-}
-
-func (db *Database) PlaybookList(ctx context.Context) ([]*model.PlaybookTemplateResponse, error) {
- query := "FOR d IN @@collection RETURN d"
- cursor, _, err := db.Query(ctx, query, map[string]any{"@collection": PlaybookCollectionName}, busdb.ReadOperation)
- if err != nil {
- return nil, err
- }
- defer cursor.Close()
- var docs []*model.PlaybookTemplateResponse
- for {
- var doc model.PlaybookTemplate
- meta, err := cursor.ReadDocument(ctx, &doc)
- if driver.IsNoMoreDocuments(err) {
- break
- } else if err != nil {
- return nil, err
- }
- docs = append(docs, toPlaybookTemplateResponse(meta.Key, &doc))
- }
-
- return docs, err
-}
diff --git a/database/playbookutils.go b/database/playbookutils.go
deleted file mode 100644
index 63993c0..0000000
--- a/database/playbookutils.go
+++ /dev/null
@@ -1,186 +0,0 @@
-package database
-
-import (
- "errors"
- "fmt"
- "log"
- "sort"
-
- "github.com/SecurityBrewery/catalyst/caql"
- "github.com/SecurityBrewery/catalyst/dag"
- "github.com/SecurityBrewery/catalyst/generated/model"
-)
-
-func playbookGraph(playbook *model.Playbook) (*dag.Graph, error) {
- d := dag.NewGraph()
-
- var taskIDs []string
- for taskID := range playbook.Tasks {
- taskIDs = append(taskIDs, taskID)
- }
- sort.Strings(taskIDs)
-
- for _, taskID := range taskIDs {
- if err := d.AddNode(taskID); err != nil {
- return nil, errors.New("could not add node")
- }
- }
- for _, taskID := range taskIDs {
- task := playbook.Tasks[taskID]
- for next := range task.Next {
- if err := d.AddEdge(taskID, next); err != nil {
- return nil, errors.New("could not add edge")
- }
- }
- }
-
- return d, nil
-}
-
-func toTaskResponse(playbook *model.Playbook, taskID string, order int, graph *dag.Graph) (*model.TaskResponse, error) {
- task, ok := playbook.Tasks[taskID]
- if !ok {
- return nil, fmt.Errorf("task %s not found", taskID)
- }
-
- tr := &model.TaskResponse{
- Automation: task.Automation,
- Closed: task.Closed,
- Created: task.Created,
- Data: task.Data,
- Done: task.Done,
- Join: task.Join,
- Payload: task.Payload,
- Name: task.Name,
- Next: task.Next,
- Owner: task.Owner,
- Schema: task.Schema,
- Type: task.Type,
- // Active: active,
- // Order: v.Order,
- }
-
- tr.Order = int64(order)
-
- taskActive, _ := active(playbook, taskID, graph, task)
- tr.Active = taskActive
-
- return tr, nil
-}
-
-func activePlaybook(playbook *model.Playbook, taskID string) (bool, error) {
- task, ok := playbook.Tasks[taskID]
- if !ok {
- return false, fmt.Errorf("playbook does not contain tasks %s", taskID)
- }
-
- d, err := playbookGraph(playbook)
- if err != nil {
- return false, err
- }
-
- return active(playbook, taskID, d, task)
-}
-
-func active(playbook *model.Playbook, taskID string, d *dag.Graph, task *model.Task) (bool, error) {
- if task.Done {
- return false, nil
- }
-
- parents := d.GetParents(taskID)
-
- if len(parents) == 0 {
- return true, nil // valid(&task)
- }
-
- if task.Join != nil && *task.Join {
- for _, parent := range parents {
- parentTask := playbook.Tasks[parent]
- if !parentTask.Done {
- return false, nil
- }
- requirement := parentTask.Next[taskID]
-
- b, err := evalRequirement(requirement, parentTask.Data)
- if err != nil {
- return false, err
- }
-
- if !b {
- return false, nil
- }
- }
-
- return true, nil
- }
-
- for _, parent := range parents {
- parentTask := playbook.Tasks[parent]
- if !parentTask.Done {
- // return false, nil
- continue
- }
- requirement := parentTask.Next[taskID]
-
- b, err := evalRequirement(requirement, parentTask.Data)
- if err != nil {
- continue
- }
-
- if b {
- return true, nil
- }
- }
-
- return false, nil
-}
-
-func evalRequirement(aql string, data any) (bool, error) {
- if aql == "" {
- return true, nil
- }
-
- parser := caql.Parser{}
- tree, err := parser.Parse(aql)
- if err != nil {
- return false, err
- }
-
- var dataMap map[string]any
- if data != nil {
- if dataMapX, ok := data.(map[string]any); ok {
- dataMap = dataMapX
- } else {
- log.Println("wrong data type for task data")
- }
- }
-
- v, err := tree.Eval(dataMap)
- if err != nil {
- return false, err
- }
-
- if b, ok := v.(bool); ok {
- return b, nil
- }
-
- return false, err
-}
-
-/*
-// "github.com/qri-io/jsonschema"
-func valid(task *model.Task) (bool, error) {
- schema, err := json.Marshal(task.Schema)
- if err != nil {
- return false, err
- }
-
- rs := &jsonschema.Schema{}
- if err := json.Unmarshal(schema, rs); err != nil {
- return false, err
- }
-
- state := rs.Validate(context.Background(), task.Data)
- return len(*state.Errs) > 0, nil
-}
-*/
diff --git a/database/playbookutils_test.go b/database/playbookutils_test.go
deleted file mode 100644
index eea4615..0000000
--- a/database/playbookutils_test.go
+++ /dev/null
@@ -1,147 +0,0 @@
-package database
-
-import (
- "testing"
-
- "github.com/stretchr/testify/assert"
-
- "github.com/SecurityBrewery/catalyst/generated/model"
-)
-
-var playbook2 = &model.Playbook{
- Name: "Phishing",
- Tasks: map[string]*model.Task{
- "board": {Next: map[string]string{
- "escalate": "boardInvolved == true",
- "acquire-mail": "boardInvolved == false",
- }},
- "escalate": {},
- "acquire-mail": {Next: map[string]string{
- "extract-iocs": "schemaKey == 'yes'",
- "block-sender": "schemaKey == 'yes'",
- "search-email-gateway": "schemaKey == 'no'",
- }},
- "extract-iocs": {Next: map[string]string{"fetch-iocs": ""}},
- "fetch-iocs": {Next: map[string]string{"block-iocs": ""}},
- "search-email-gateway": {Next: map[string]string{"block-iocs": ""}},
- "block-sender": {Next: map[string]string{"block-iocs": ""}},
- "block-iocs": {Next: map[string]string{"block-ioc": ""}},
- "block-ioc": {},
- },
-}
-
-var playbook3 = &model.Playbook{
- Name: "Phishing",
- Tasks: map[string]*model.Task{
- "board": {Next: map[string]string{
- "escalate": "boardInvolved == true",
- "acquire-mail": "boardInvolved == false",
- }, Data: map[string]any{"boardInvolved": true}, Done: true},
- "escalate": {},
- "acquire-mail": {Next: map[string]string{
- "extract-iocs": "schemaKey == 'yes'",
- "block-sender": "schemaKey == 'yes'",
- "search-email-gateway": "schemaKey == 'no'",
- }},
- "extract-iocs": {Next: map[string]string{"fetch-iocs": ""}},
- "fetch-iocs": {Next: map[string]string{"block-iocs": ""}},
- "search-email-gateway": {Next: map[string]string{"block-iocs": ""}},
- "block-sender": {Next: map[string]string{"block-iocs": ""}},
- "block-iocs": {Next: map[string]string{"block-ioc": ""}},
- "block-ioc": {},
- },
-}
-
-var playbook4 = &model.Playbook{
- Name: "Malware",
- Tasks: map[string]*model.Task{
- "file-or-hash": {Next: map[string]string{
- "enter-hash": "file == 'Hash'",
- "upload": "file == 'File'",
- }},
- "enter-hash": {Next: map[string]string{
- "virustotal": "hash != ''",
- }},
- "upload": {Next: map[string]string{
- "hash": "malware",
- }},
- "hash": {Next: map[string]string{"virustotal": ""}},
- "virustotal": {},
- },
-}
-
-func Test_canBeCompleted(t *testing.T) {
- t.Parallel()
-
- type args struct {
- playbook *model.Playbook
- taskID string
- }
- tests := []struct {
- name string
- args args
- want bool
- wantErr bool
- }{
- {"playbook2 board", args{playbook: playbook2, taskID: "board"}, true, false},
- {"playbook2 escalate", args{playbook: playbook2, taskID: "escalate"}, false, false},
- {"playbook2 acquire-mail", args{playbook: playbook2, taskID: "acquire-mail"}, false, false},
- {"playbook2 block-ioc", args{playbook: playbook2, taskID: "block-ioc"}, false, false},
- {"playbook3 board", args{playbook: playbook3, taskID: "board"}, false, false},
- {"playbook3 escalate", args{playbook: playbook3, taskID: "escalate"}, true, false},
- {"playbook3 acquire-mail", args{playbook: playbook3, taskID: "acquire-mail"}, false, false},
- {"playbook3 block-ioc", args{playbook: playbook3, taskID: "block-ioc"}, false, false},
- }
- for _, tt := range tests {
- tt := tt
- t.Run(tt.name, func(t *testing.T) {
- t.Parallel()
-
- got, err := activePlaybook(tt.args.playbook, tt.args.taskID)
- if (err != nil) != tt.wantErr {
- t.Errorf("activePlaybook() error = %v, wantErr %v", err, tt.wantErr)
-
- return
- }
- if got != tt.want {
- t.Errorf("activePlaybook() got = %v, want %v", got, tt.want)
- }
- })
- }
-}
-
-func Test_playbookOrder(t *testing.T) {
- t.Parallel()
-
- type args struct {
- playbook *model.Playbook
- }
- tests := []struct {
- name string
- args args
- want []string
- wantErr bool
- }{
- {"playbook4", args{playbook: playbook4}, []string{"file-or-hash", "enter-hash", "upload", "hash", "virustotal"}, false},
- }
- for _, tt := range tests {
- tt := tt
- t.Run(tt.name, func(t *testing.T) {
- t.Parallel()
-
- got, err := toPlaybookResponse(tt.args.playbook)
- if (err != nil) != tt.wantErr {
- t.Errorf("activePlaybook() error = %v, wantErr %v", err, tt.wantErr)
-
- return
- }
-
- names := make([]string, len(got.Tasks))
- for name, task := range got.Tasks {
- names[task.Order] = name
- }
-
- assert.Equal(t, tt.want, names)
- })
- }
-}
diff --git a/database/relationships.go b/database/relationships.go
deleted file mode 100644
index 44c5078..0000000
--- a/database/relationships.go
+++ /dev/null
@@ -1,51 +0,0 @@
-package database
-
-import (
- "context"
- "errors"
- "strconv"
-
- "github.com/arangodb/go-driver"
-
- "github.com/SecurityBrewery/catalyst/bus"
- "github.com/SecurityBrewery/catalyst/database/busdb"
-)
-
-func (db *Database) RelatedCreate(ctx context.Context, id, id2 int64) error {
- if id == id2 {
- return errors.New("tickets cannot relate to themself")
- }
-
- _, err := db.relatedCollection.CreateEdge(ctx, ctx, &driver.EdgeDocument{
- From: driver.DocumentID(TicketCollectionName + "/" + strconv.Itoa(int(id))),
- To: driver.DocumentID(TicketCollectionName + "/" + strconv.Itoa(int(id2))),
- })
-
- return err
-}
-
-func (db *Database) RelatedBatchCreate(ctx context.Context, edges []*driver.EdgeDocument) error {
- _, err := db.relatedCollection.CreateEdges(ctx, edges)
-
- return err
-}
-
-func (db *Database) RelatedRemove(ctx context.Context, id, id2 int64) error {
- q := `
- FOR d in @@collection
- FILTER (d._from == @id && d._to == @id2) || (d._to == @id && d._from == @id2)
- REMOVE d in @@collection`
- _, _, err := db.Query(ctx, q, map[string]any{
- "@collection": RelatedTicketsCollectionName,
- "id": driver.DocumentID(TicketCollectionName + "/" + strconv.Itoa(int(id))),
- "id2": driver.DocumentID(TicketCollectionName + "/" + strconv.Itoa(int(id2))),
- }, &busdb.Operation{
- Type: bus.DatabaseEntryUpdated,
- Ids: []driver.DocumentID{
- driver.DocumentID(TicketCollectionName + "/" + strconv.Itoa(int(id))),
- driver.DocumentID(TicketCollectionName + "/" + strconv.Itoa(int(id2))),
- },
- })
-
- return err
-}
diff --git a/database/settings.go b/database/settings.go
deleted file mode 100644
index e58a7dc..0000000
--- a/database/settings.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package database
-
-import (
- "context"
-
- "github.com/SecurityBrewery/catalyst/generated/model"
-)
-
-func (db *Database) Settings(ctx context.Context) (*model.Settings, error) {
- settings := &model.Settings{}
- if _, err := db.settingsCollection.ReadDocument(ctx, "global", settings); err != nil {
- return nil, err
- }
-
- return settings, nil
-}
-
-func (db *Database) SaveSettings(ctx context.Context, settings *model.Settings) (*model.Settings, error) {
- exists, err := db.settingsCollection.DocumentExists(ctx, "global")
- if err != nil {
- return nil, err
- }
-
- if exists {
- if _, err := db.settingsCollection.ReplaceDocument(ctx, "global", settings); err != nil {
- return nil, err
- }
- } else {
- if _, err := db.settingsCollection.CreateDocument(ctx, ctx, "global", settings); err != nil {
- return nil, err
- }
- }
-
- return settings, nil
-}
diff --git a/database/statistics.go b/database/statistics.go
deleted file mode 100644
index fbc004a..0000000
--- a/database/statistics.go
+++ /dev/null
@@ -1,91 +0,0 @@
-package database
-
-import (
- "context"
- "fmt"
-
- "github.com/SecurityBrewery/catalyst/caql"
- "github.com/SecurityBrewery/catalyst/database/busdb"
- "github.com/SecurityBrewery/catalyst/generated/model"
-)
-
-func (db *Database) Statistics(ctx context.Context) (*model.Statistics, error) {
- query := `RETURN {
- tickets_per_type: MERGE(FOR d in tickets
- COLLECT type = d.type WITH COUNT INTO typecount
- RETURN ZIP([type], [typecount])),
-
- unassigned: FIRST(FOR d in tickets
- FILTER d.status == "open" AND !d.owner
- COLLECT WITH COUNT INTO length
- RETURN length),
-
- open_tickets_per_user: MERGE(FOR d in tickets
- FILTER d.status == "open"
- COLLECT user = d.owner WITH COUNT INTO usercount
- RETURN ZIP([user], [usercount])),
-
- tickets_per_week: MERGE(FOR d in tickets
- COLLECT week = CONCAT(DATE_YEAR(d.created), "-", DATE_ISOWEEK(d.created) < 10 ? "0" : "", DATE_ISOWEEK(d.created)) WITH COUNT INTO weekcount
- RETURN ZIP([week], [weekcount])),
- }`
-
- cur, _, err := db.Query(ctx, query, nil, busdb.ReadOperation)
- if err != nil {
- return nil, err
- }
- defer cur.Close()
-
- statistics := model.Statistics{}
- if _, err := cur.ReadDocument(ctx, &statistics); err != nil {
- return nil, err
- }
-
- return &statistics, nil
-}
-
-func (db *Database) WidgetData(ctx context.Context, aggregation string, filter *string) (map[string]any, error) {
- parser := &caql.Parser{Searcher: db.Index, Prefix: "d."}
-
- queryTree, err := parser.Parse(aggregation)
- if err != nil {
- return nil, fmt.Errorf("invalid aggregation query (%s): syntax error", aggregation)
- }
- aggregationString, err := queryTree.String()
- if err != nil {
- return nil, fmt.Errorf("invalid widget aggregation query (%s): %w", aggregation, err)
- }
- aggregation = aggregationString
-
- filterQ := ""
- if filter != nil && *filter != "" {
- queryTree, err := parser.Parse(*filter)
- if err != nil {
- return nil, fmt.Errorf("invalid filter query (%s): syntax error", *filter)
- }
- filterString, err := queryTree.String()
- if err != nil {
- return nil, fmt.Errorf("invalid widget filter query (%s): %w", *filter, err)
- }
-
- filterQ = "FILTER " + filterString
- }
-
- query := `RETURN MERGE(FOR d in tickets
- ` + filterQ + `
- COLLECT field = ` + aggregation + ` WITH COUNT INTO count
- RETURN ZIP([field], [count]))`
-
- cur, _, err := db.Query(ctx, query, nil, busdb.ReadOperation)
- if err != nil {
- return nil, err
- }
- defer cur.Close()
-
- statistics := map[string]any{}
- if _, err := cur.ReadDocument(ctx, &statistics); err != nil {
- return nil, err
- }
-
- return statistics, nil
-}
diff --git a/database/task.go b/database/task.go
deleted file mode 100644
index 81654e5..0000000
--- a/database/task.go
+++ /dev/null
@@ -1,67 +0,0 @@
-package database
-
-import (
- "context"
-
- "github.com/arangodb/go-driver"
-
- "github.com/SecurityBrewery/catalyst/database/busdb"
- "github.com/SecurityBrewery/catalyst/generated/model"
-)
-
-type playbookResponse struct {
- PlaybookID string `json:"playbook_id"`
- PlaybookName string `json:"playbook_name"`
- Playbook model.Playbook `json:"playbook"`
- TicketID int64 `json:"ticket_id"`
- TicketName string `json:"ticket_name"`
-}
-
-func (db *Database) TaskList(ctx context.Context) ([]*model.TaskWithContext, error) {
- ticketFilterQuery, ticketFilterVars, err := db.Hooks.TicketWriteFilter(ctx)
- if err != nil {
- return nil, err
- }
-
- query := `FOR d IN @@collection
- ` + ticketFilterQuery + `
- FILTER d.status == 'open'
- FOR playbook IN NOT_NULL(VALUES(d.playbooks), [])
- RETURN { ticket_id: TO_NUMBER(d._key), ticket_name: d.name, playbook_id: POSITION(d.playbooks, playbook, true), playbook_name: playbook.name, playbook: playbook }`
- cursor, _, err := db.Query(ctx, query, mergeMaps(ticketFilterVars, map[string]any{
- "@collection": TicketCollectionName,
- }), busdb.ReadOperation)
- if err != nil {
- return nil, err
- }
- defer cursor.Close()
- var docs []*model.TaskWithContext
- for {
- var doc playbookResponse
- _, err := cursor.ReadDocument(ctx, &doc)
- if driver.IsNoMoreDocuments(err) {
- break
- } else if err != nil {
- return nil, err
- }
-
- playbook, err := toPlaybookResponse(&doc.Playbook)
- if err != nil {
- return nil, err
- }
-
- for _, task := range playbook.Tasks {
- if task.Active {
- docs = append(docs, &model.TaskWithContext{
- PlaybookId: doc.PlaybookID,
- PlaybookName: doc.PlaybookName,
- Task: task,
- TicketId: doc.TicketID,
- TicketName: doc.TicketName,
- })
- }
- }
- }
-
- return docs, err
-}
diff --git a/database/template.go b/database/template.go
deleted file mode 100644
index 11c4af0..0000000
--- a/database/template.go
+++ /dev/null
@@ -1,89 +0,0 @@
-package database
-
-import (
- "context"
- "errors"
-
- "github.com/arangodb/go-driver"
- "github.com/iancoleman/strcase"
-
- "github.com/SecurityBrewery/catalyst/database/busdb"
- "github.com/SecurityBrewery/catalyst/generated/model"
-)
-
-func toTicketTemplate(doc *model.TicketTemplateForm) *model.TicketTemplate {
- return &model.TicketTemplate{Name: doc.Name, Schema: doc.Schema}
-}
-
-func toTicketTemplateResponse(key string, doc *model.TicketTemplate) *model.TicketTemplateResponse {
- return &model.TicketTemplateResponse{ID: key, Name: doc.Name, Schema: doc.Schema}
-}
-
-func (db *Database) TemplateCreate(ctx context.Context, template *model.TicketTemplateForm) (*model.TicketTemplateResponse, error) {
- if template == nil {
- return nil, errors.New("requires template")
- }
- if template.Name == "" {
- return nil, errors.New("requires template name")
- }
-
- var doc model.TicketTemplate
- newctx := driver.WithReturnNew(ctx, &doc)
-
- meta, err := db.templateCollection.CreateDocument(ctx, newctx, strcase.ToKebab(template.Name), toTicketTemplate(template))
- if err != nil {
- return nil, err
- }
-
- return toTicketTemplateResponse(meta.Key, &doc), nil
-}
-
-func (db *Database) TemplateGet(ctx context.Context, id string) (*model.TicketTemplateResponse, error) {
- var doc model.TicketTemplate
- meta, err := db.templateCollection.ReadDocument(ctx, id, &doc)
- if err != nil {
- return nil, err
- }
-
- return toTicketTemplateResponse(meta.Key, &doc), nil
-}
-
-func (db *Database) TemplateUpdate(ctx context.Context, id string, template *model.TicketTemplateForm) (*model.TicketTemplateResponse, error) {
- var doc model.TicketTemplate
- ctx = driver.WithReturnNew(ctx, &doc)
-
- meta, err := db.templateCollection.ReplaceDocument(ctx, id, toTicketTemplate(template))
- if err != nil {
- return nil, err
- }
-
- return toTicketTemplateResponse(meta.Key, &doc), nil
-}
-
-func (db *Database) TemplateDelete(ctx context.Context, id string) error {
- _, err := db.templateCollection.RemoveDocument(ctx, id)
-
- return err
-}
-
-func (db *Database) TemplateList(ctx context.Context) ([]*model.TicketTemplateResponse, error) {
- query := "FOR d IN @@collection RETURN d"
- cursor, _, err := db.Query(ctx, query, map[string]any{"@collection": TemplateCollectionName}, busdb.ReadOperation)
- if err != nil {
- return nil, err
- }
- defer cursor.Close()
- var docs []*model.TicketTemplateResponse
- for {
- var doc model.TicketTemplate
- meta, err := cursor.ReadDocument(ctx, &doc)
- if driver.IsNoMoreDocuments(err) {
- break
- } else if err != nil {
- return nil, err
- }
- docs = append(docs, toTicketTemplateResponse(meta.Key, &doc))
- }
-
- return docs, err
-}
diff --git a/database/template_test.go b/database/template_test.go
deleted file mode 100644
index 92560a0..0000000
--- a/database/template_test.go
+++ /dev/null
@@ -1,211 +0,0 @@
-package database_test
-
-import (
- "testing"
-
- "github.com/stretchr/testify/assert"
-
- "github.com/SecurityBrewery/catalyst/database/migrations"
- "github.com/SecurityBrewery/catalyst/generated/model"
- "github.com/SecurityBrewery/catalyst/test"
-)
-
-var (
- template1 = &model.TicketTemplateForm{
- Schema: migrations.DefaultTemplateSchema,
- Name: "Template 1",
- }
- default1 = &model.TicketTemplateForm{
- Schema: migrations.DefaultTemplateSchema,
- Name: "Default",
- }
-)
-
-func TestDatabase_TemplateCreate(t *testing.T) {
- t.Parallel()
-
- type args struct {
- template *model.TicketTemplateForm
- }
- tests := []struct {
- name string
- args args
- wantErr bool
- }{
- {name: "Normal", args: args{template: template1}},
- {name: "Duplicate", args: args{template: default1}, wantErr: true},
- {name: "Nil template", args: args{}, wantErr: true},
- {name: "Template without fields", args: args{template: &model.TicketTemplateForm{}}, wantErr: true},
- {name: "Only name", args: args{template: &model.TicketTemplateForm{Name: "name"}}, wantErr: false},
- }
- for _, tt := range tests {
- tt := tt
- t.Run(tt.name, func(t *testing.T) {
- t.Parallel()
-
- _, _, _, _, _, db, cleanup, err := test.DB(t)
- if err != nil {
- t.Fatal(err)
- }
- defer cleanup()
-
- if _, err := db.TemplateCreate(test.Context(), tt.args.template); (err != nil) != tt.wantErr {
- t.Errorf("TemplateCreate() error = %v, wantErr %v", err, tt.wantErr)
- }
- })
- }
-}
-
-func TestDatabase_TemplateDelete(t *testing.T) {
- t.Parallel()
-
- type args struct {
- id string
- }
- tests := []struct {
- name string
- args args
- wantErr bool
- }{
- {name: "Normal", args: args{"default"}},
- {name: "Not existing", args: args{"foobar"}, wantErr: true},
- }
- for _, tt := range tests {
- tt := tt
- t.Run(tt.name, func(t *testing.T) {
- t.Parallel()
-
- _, _, _, _, _, db, cleanup, err := test.DB(t)
- if err != nil {
- t.Fatal(err)
- }
- defer cleanup()
-
- if _, err := db.TemplateCreate(test.Context(), template1); err != nil {
- t.Errorf("TemplateCreate() error = %v", err)
- }
-
- if err := db.TemplateDelete(test.Context(), tt.args.id); (err != nil) != tt.wantErr {
- t.Errorf("TemplateDelete() error = %v, wantErr %v", err, tt.wantErr)
- }
- })
- }
-}
-
-func TestDatabase_TemplateGet(t *testing.T) {
- t.Parallel()
-
- type args struct {
- id string
- }
- tests := []struct {
- name string
- args args
- want *model.TicketTemplateResponse
- wantErr bool
- }{
- {name: "Normal", args: args{id: "default"}, want: &model.TicketTemplateResponse{ID: "default", Name: "Default", Schema: migrations.DefaultTemplateSchema}},
- {name: "Not existing", args: args{id: "foobar"}, wantErr: true},
- }
- for _, tt := range tests {
- tt := tt
- t.Run(tt.name, func(t *testing.T) {
- t.Parallel()
-
- _, _, _, _, _, db, cleanup, err := test.DB(t)
- if err != nil {
- t.Fatal(err)
- }
- defer cleanup()
-
- if _, err := db.TemplateCreate(test.Context(), template1); err != nil {
- t.Errorf("TemplateCreate() error = %v", err)
- }
-
- got, err := db.TemplateGet(test.Context(), tt.args.id)
- if (err != nil) != tt.wantErr {
- t.Errorf("TemplateGet() error = %v, wantErr %v", err, tt.wantErr)
-
- return
- }
- if err != nil {
- return
- }
-
- assert.Equal(t, got, tt.want)
- })
- }
-}
-
-func TestDatabase_TemplateList(t *testing.T) {
- t.Parallel()
-
- tests := []struct {
- name string
- want []*model.TicketTemplateResponse
- wantErr bool
- }{
- {name: "Normal", want: []*model.TicketTemplateResponse{{ID: "default", Name: "Default", Schema: migrations.DefaultTemplateSchema}, {ID: "template-1", Name: template1.Name, Schema: template1.Schema}}},
- }
- for _, tt := range tests {
- tt := tt
- t.Run(tt.name, func(t *testing.T) {
- t.Parallel()
-
- _, _, _, _, _, db, cleanup, err := test.DB(t)
- if err != nil {
- t.Fatal(err)
- }
- defer cleanup()
-
- if _, err := db.TemplateCreate(test.Context(), template1); err != nil {
- t.Errorf("TemplateCreate() error = %v", err)
- }
-
- got, err := db.TemplateList(test.Context())
- if (err != nil) != tt.wantErr {
- t.Errorf("TemplateList() error = %v, wantErr %v", err, tt.wantErr)
-
- return
- }
- assert.Equal(t, got, tt.want)
- })
- }
-}
-
-func TestDatabase_TemplateUpdate(t *testing.T) {
- t.Parallel()
-
- type args struct {
- id string
- template *model.TicketTemplateForm
- }
- tests := []struct {
- name string
- args args
- wantErr bool
- }{
- {name: "Normal", args: args{"default", template1}},
- {name: "Not existing", args: args{"foobar", template1}, wantErr: true},
- }
- for _, tt := range tests {
- tt := tt
- t.Run(tt.name, func(t *testing.T) {
- t.Parallel()
-
- _, _, _, _, _, db, cleanup, err := test.DB(t)
- if err != nil {
- t.Fatal(err)
- }
- defer cleanup()
-
- if _, err := db.TemplateCreate(test.Context(), template1); err != nil {
- t.Errorf("TemplateCreate() error = %v", err)
- }
-
- if _, err := db.TemplateUpdate(test.Context(), tt.args.id, tt.args.template); (err != nil) != tt.wantErr {
- t.Errorf("TemplateUpdate() error = %v, wantErr %v", err, tt.wantErr)
- }
- })
- }
-}
diff --git a/database/ticket.go b/database/ticket.go
deleted file mode 100644
index b2d89e9..0000000
--- a/database/ticket.go
+++ /dev/null
@@ -1,624 +0,0 @@
-package database
-
-import (
- "context"
- "encoding/json"
- "errors"
- "fmt"
- "sort"
- "strconv"
- "strings"
- "sync"
-
- "github.com/arangodb/go-driver"
- "github.com/xeipuuv/gojsonschema"
-
- "github.com/SecurityBrewery/catalyst/bus"
- "github.com/SecurityBrewery/catalyst/caql"
- "github.com/SecurityBrewery/catalyst/database/busdb"
- "github.com/SecurityBrewery/catalyst/generated/model"
- "github.com/SecurityBrewery/catalyst/generated/time"
- "github.com/SecurityBrewery/catalyst/index"
-)
-
-func toTicket(ticketForm *model.TicketForm) (any, error) {
- playbooks, err := toPlaybooks(ticketForm.Playbooks)
- if err != nil {
- return nil, err
- }
-
- ticket := &model.Ticket{
- Artifacts: ticketForm.Artifacts,
- Comments: ticketForm.Comments,
- Details: ticketForm.Details,
- Files: ticketForm.Files,
- Name: ticketForm.Name,
- Owner: ticketForm.Owner,
- Playbooks: playbooks,
- Read: ticketForm.Read,
- References: ticketForm.References,
- Status: ticketForm.Status,
- Type: ticketForm.Type,
- Write: ticketForm.Write,
- // ID: ticketForm.ID,
- // Created: ticketForm.Created,
- // Modified: ticketForm.Modified,
- // Schema: ticketForm.Schema,
- }
-
- if ticketForm.Created != nil {
- ticket.Created = *ticketForm.Created
- } else {
- ticket.Created = time.Now().UTC()
- }
- if ticketForm.Modified != nil {
- ticket.Modified = *ticketForm.Modified
- } else {
- ticket.Modified = time.Now().UTC()
- }
- if ticketForm.Schema != nil {
- ticket.Schema = *ticketForm.Schema
- } else {
- ticket.Schema = "{}"
- }
- if ticketForm.Status == "" {
- ticket.Status = "open"
- }
- if ticketForm.ID != nil {
- return &busdb.Keyed[model.Ticket]{Key: strconv.FormatInt(*ticketForm.ID, 10), Doc: ticket}, nil
- }
-
- return ticket, nil
-}
-
-func toTicketResponses(tickets []*model.TicketSimpleResponse) ([]*model.TicketResponse, error) {
- var extendedTickets []*model.TicketResponse
- for _, simple := range tickets {
- tr, err := toTicketResponse(simple)
- if err != nil {
- return nil, err
- }
- extendedTickets = append(extendedTickets, tr)
- }
-
- return extendedTickets, nil
-}
-
-func toTicketResponse(ticket *model.TicketSimpleResponse) (*model.TicketResponse, error) {
- playbooks, err := toPlaybookResponses(ticket.Playbooks)
- if err != nil {
- return nil, err
- }
-
- return &model.TicketResponse{
- ID: ticket.ID,
- Artifacts: ticket.Artifacts,
- Comments: ticket.Comments,
- Created: ticket.Created,
- Details: ticket.Details,
- Files: ticket.Files,
- Modified: ticket.Modified,
- Name: ticket.Name,
- Owner: ticket.Owner,
- Playbooks: playbooks,
- Read: ticket.Read,
- References: ticket.References,
- Schema: ticket.Schema,
- Status: ticket.Status,
- Type: ticket.Type,
- Write: ticket.Write,
- }, nil
-}
-
-func toTicketSimpleResponse(key string, ticket *model.Ticket) (*model.TicketSimpleResponse, error) {
- id, err := strconv.ParseInt(key, 10, 64)
- if err != nil {
- return nil, err
- }
-
- return &model.TicketSimpleResponse{
- Artifacts: ticket.Artifacts,
- Comments: ticket.Comments,
- Created: ticket.Created,
- Details: ticket.Details,
- Files: ticket.Files,
- ID: id,
- Modified: ticket.Modified,
- Name: ticket.Name,
- Owner: ticket.Owner,
- Playbooks: ticket.Playbooks,
- Read: ticket.Read,
- References: ticket.References,
- Schema: ticket.Schema,
- Status: ticket.Status,
- Type: ticket.Type,
- Write: ticket.Write,
- }, nil
-}
-
-func toTicketWithTickets(ticketResponse *model.TicketResponse, tickets, correlatedTickets []*model.TicketSimpleResponse, logs []*model.LogEntry) *model.TicketWithTickets {
- return &model.TicketWithTickets{
- Artifacts: ticketResponse.Artifacts,
- Comments: ticketResponse.Comments,
- Created: ticketResponse.Created,
- Details: ticketResponse.Details,
- Files: ticketResponse.Files,
- ID: ticketResponse.ID,
- Modified: ticketResponse.Modified,
- Name: ticketResponse.Name,
- Owner: ticketResponse.Owner,
- Playbooks: ticketResponse.Playbooks,
- Read: ticketResponse.Read,
- References: ticketResponse.References,
- Schema: ticketResponse.Schema,
- Status: ticketResponse.Status,
- Type: ticketResponse.Type,
- Write: ticketResponse.Write,
-
- Logs: logs,
- Tickets: tickets,
- CorrelatedTickets: correlatedTickets,
- }
-}
-
-func toPlaybookResponses(playbooks map[string]*model.Playbook) (map[string]*model.PlaybookResponse, error) {
- pr := map[string]*model.PlaybookResponse{}
- var err error
- for k, v := range playbooks {
- pr[k], err = toPlaybookResponse(v)
- if err != nil {
- return nil, err
- }
- }
-
- return pr, nil
-}
-
-func toPlaybookResponse(playbook *model.Playbook) (*model.PlaybookResponse, error) {
- graph, err := playbookGraph(playbook)
- if err != nil {
- return nil, err
- }
-
- re := &model.PlaybookResponse{
- Name: playbook.Name,
- Tasks: map[string]*model.TaskResponse{},
- }
-
- results, err := graph.Toposort()
- if err != nil {
- return nil, err
- }
-
- i := 0
- for _, taskID := range results {
- rootTask, err := toTaskResponse(playbook, taskID, i, graph)
- if err != nil {
- return nil, err
- }
- re.Tasks[taskID] = rootTask
- i++
- }
-
- return re, nil
-}
-
-func (db *Database) TicketBatchCreate(ctx context.Context, ticketForms []*model.TicketForm) ([]*model.TicketResponse, error) {
- update, err := db.Hooks.IngestionFilter(ctx, db.Index)
- if err != nil {
- return nil, err
- }
-
- var dbTickets []any
- for _, ticketForm := range ticketForms {
- ticket, err := toTicket(ticketForm)
- if err != nil {
- return nil, err
- }
-
- if err := validate(ticket, model.TicketSchema); err != nil {
- return nil, err
- }
-
- dbTickets = append(dbTickets, ticket)
- }
-
- ticketFilterQuery, ticketFilterVars, err := db.Hooks.TicketWriteFilter(ctx)
- if err != nil {
- return nil, err
- }
-
- query := `FOR d IN @tickets
- ` + ticketFilterQuery + `
- LET updates = ` + update + `
- LET newdoc = LENGTH(updates) != 0 ? APPLY("MERGE_RECURSIVE", APPEND([d], updates)) : d
- LET keyeddoc = HAS(newdoc, "id") ? MERGE(newdoc, {"_key": TO_STRING(newdoc.id)}) : newdoc
- LET noiddoc = UNSET(keyeddoc, "id")
- INSERT noiddoc INTO @@collection
- RETURN NEW`
- apiTickets, _, err := db.ticketListQuery(ctx, query, mergeMaps(map[string]any{
- "tickets": dbTickets,
- }, ticketFilterVars), busdb.CreateOperation)
- if err != nil {
- return nil, err
- }
-
- if err = batchIndex(db.Index, apiTickets); err != nil {
- return nil, err
- }
-
- var ids []driver.DocumentID
- for _, apiTicket := range apiTickets {
- ids = append(ids, driver.NewDocumentID(TicketCollectionName, fmt.Sprint(apiTicket.ID)))
- }
-
- db.bus.DatabaseChannel.Publish(&bus.DatabaseUpdateMsg{
- IDs: ids,
- Type: bus.DatabaseEntryCreated,
- })
-
- ticketResponses, err := toTicketResponses(apiTickets)
- if err != nil {
- return nil, err
- }
-
- for _, ticketResponse := range ticketResponses {
- for playbookID := range ticketResponse.Playbooks {
- if err := runRootTask(ticketResponse, playbookID, db); err != nil {
- return nil, err
- }
- }
- }
-
- return ticketResponses, nil
-}
-
-func (db *Database) IndexRebuild(ctx context.Context) error {
- if err := db.Index.Truncate(); err != nil {
- return err
- }
-
- tickets, _, err := db.ticketListQuery(ctx, "FOR d IN @@collection RETURN d", nil, busdb.ReadOperation)
- if err != nil {
- return err
- }
-
- return batchIndex(db.Index, tickets)
-}
-
-func batchIndex(index *index.Index, tickets []*model.TicketSimpleResponse) error {
- var wg sync.WaitGroup
- var batch []*model.TicketSimpleResponse
- for _, ticket := range tickets {
- batch = append(batch, ticket)
-
- if len(batch) > 100 {
- wg.Add(1)
- go func(docs []*model.TicketSimpleResponse) {
- index.Index(docs)
- wg.Done()
- }(batch)
- batch = []*model.TicketSimpleResponse{}
- }
- }
- wg.Wait()
-
- return nil
-}
-
-func (db *Database) TicketGet(ctx context.Context, ticketID int64) (*model.TicketWithTickets, error) {
- ticketFilterQuery, ticketFilterVars, err := db.Hooks.TicketReadFilter(ctx)
- if err != nil {
- return nil, err
- }
-
- return db.ticketGetQuery(ctx, ticketID, `LET d = DOCUMENT(@@collection, @ID) `+ticketFilterQuery+` RETURN d`, ticketFilterVars, busdb.ReadOperation)
-}
-
-func (db *Database) ticketGetQuery(ctx context.Context, ticketID int64, query string, bindVars map[string]any, operation *busdb.Operation) (*model.TicketWithTickets, error) {
- if bindVars == nil {
- bindVars = map[string]any{}
- }
- bindVars["@collection"] = TicketCollectionName
- if ticketID != 0 {
- bindVars["ID"] = fmt.Sprint(ticketID)
- }
-
- cur, _, err := db.Query(ctx, query, bindVars, operation)
- if err != nil {
- return nil, err
- }
- defer cur.Close()
-
- ticket := model.Ticket{}
- meta, err := cur.ReadDocument(ctx, &ticket)
- if err != nil {
- return nil, err
- }
-
- ticketSimpleResponse, err := toTicketSimpleResponse(meta.Key, &ticket)
- if err != nil {
- return nil, err
- }
-
- // index
- go db.Index.Index([]*model.TicketSimpleResponse{ticketSimpleResponse})
-
- ticketFilterQuery, ticketFilterVars, err := db.Hooks.TicketReadFilter(ctx)
- if err != nil {
- return nil, err
- }
-
- // tickets
- ticketsQuery := `FOR vertex, edge IN OUTBOUND
- DOCUMENT(@@tickets, @ID)
- GRAPH @graph
- FILTER IS_SAME_COLLECTION(@@collection, vertex)
- FILTER vertex != null
- LET d = DOCUMENT(@@collection, edge["_to"])
- ` + ticketFilterQuery + `
- RETURN d`
-
- outTickets, _, err := db.ticketListQuery(ctx, ticketsQuery, mergeMaps(map[string]any{
- "ID": fmt.Sprint(ticketID),
- "graph": TicketArtifactsGraphName,
- "@tickets": TicketCollectionName,
- }, ticketFilterVars), busdb.ReadOperation)
- if err != nil {
- return nil, err
- }
-
- ticketsQuery = `FOR vertex, edge IN INBOUND
- DOCUMENT(@@tickets, @ID)
- GRAPH @graph
- FILTER IS_SAME_COLLECTION(@@collection, vertex)
- FILTER vertex != null
- LET d = DOCUMENT(@@collection, edge["_from"])
- ` + ticketFilterQuery + `
- RETURN d`
-
- inTickets, _, err := db.ticketListQuery(ctx, ticketsQuery, mergeMaps(map[string]any{
- "ID": fmt.Sprint(ticketID),
- "graph": TicketArtifactsGraphName,
- "@tickets": TicketCollectionName,
- }, ticketFilterVars), busdb.ReadOperation)
- if err != nil {
- return nil, err
- }
-
- var artifactNames []string
- for _, artifact := range ticketSimpleResponse.Artifacts {
- artifactNames = append(artifactNames, artifact.Name)
- }
- ticketsQuery = `FOR d IN @@collection
- FILTER d._key != @ID
- ` + ticketFilterQuery + `
- FOR a IN NOT_NULL(d.artifacts, [])
- FILTER POSITION(@artifacts, a.name)
- RETURN d`
- sameArtifactTickets, _, err := db.ticketListQuery(ctx, ticketsQuery, mergeMaps(map[string]any{
- "ID": fmt.Sprint(ticketID),
- "artifacts": artifactNames,
- }, ticketFilterVars), busdb.ReadOperation)
- if err != nil {
- return nil, err
- }
-
- tickets := outTickets
- tickets = append(tickets, inTickets...)
- sort.Slice(tickets, func(i, j int) bool {
- return tickets[i].ID < tickets[j].ID
- })
-
- ticketResponse, err := toTicketResponse(ticketSimpleResponse)
- if err != nil {
- return nil, err
- }
-
- logs, err := db.LogList(ctx, fmt.Sprintf("%s/%d", TicketCollectionName, ticketID))
- if err != nil {
- return nil, err
- }
-
- return toTicketWithTickets(ticketResponse, tickets, sameArtifactTickets, logs), nil
-}
-
-func (db *Database) TicketUpdate(ctx context.Context, ticketID int64, ticket *model.Ticket) (*model.TicketWithTickets, error) {
- ticketFilterQuery, ticketFilterVars, err := db.Hooks.TicketWriteFilter(ctx)
- if err != nil {
- return nil, err
- }
-
- query := `LET d = DOCUMENT(@@collection, @ID)
- ` + ticketFilterQuery + `
- REPLACE d WITH @ticket IN @@collection
- RETURN NEW`
- ticket.Modified = time.Now().UTC() // TODO make setable?
-
- return db.ticketGetQuery(ctx, ticketID, query, mergeMaps(map[string]any{"ticket": ticket}, ticketFilterVars), &busdb.Operation{
- Type: bus.DatabaseEntryUpdated, Ids: []driver.DocumentID{
- driver.NewDocumentID(TicketCollectionName, strconv.FormatInt(ticketID, 10)),
- },
- })
-}
-
-func (db *Database) TicketDelete(ctx context.Context, ticketID int64) error {
- _, err := db.TicketGet(ctx, ticketID)
- if err != nil {
- return err
- }
-
- _, err = db.ticketCollection.RemoveDocument(ctx, strconv.FormatInt(ticketID, 10))
- if err != nil {
- return err
- }
-
- return nil
-}
-
-func (db *Database) TicketList(ctx context.Context, ticketType string, query string, sorts []string, desc []bool, offset, count int64) (*model.TicketList, error) {
- binVars := map[string]any{}
-
- typeString := ""
- if ticketType != "" {
- typeString = "FILTER d.type == @type "
- binVars["type"] = ticketType
- }
-
- filterString := ""
- if query != "" {
- parser := &caql.Parser{Searcher: db.Index, Prefix: "d."}
- queryTree, err := parser.Parse(query)
- if err != nil {
- return nil, errors.New("invalid filter query: syntax error")
- }
- filterString, err = queryTree.String()
- if err != nil {
- return nil, fmt.Errorf("invalid filter query: %w", err)
- }
- filterString = "FILTER " + filterString
- }
-
- documentCount, err := db.TicketCount(ctx, typeString, filterString, binVars)
- if err != nil {
- return nil, err
- }
-
- sortQ := sortQuery(sorts, desc, binVars)
- binVars["offset"] = offset
- binVars["count"] = count
-
- ticketFilterQuery, ticketFilterVars, err := db.Hooks.TicketReadFilter(ctx)
- if err != nil {
- return nil, err
- }
-
- q := `FOR d IN @@collection
- ` + ticketFilterQuery + `
- ` + sortQ + `
- ` + typeString + `
- ` + filterString + `
- LIMIT @offset, @count
- SORT d._key ASC
- RETURN d`
- // RETURN KEEP(d, "_key", "id", "name", "type", "created")`
- ticketList, _, err := db.ticketListQuery(ctx, q, mergeMaps(binVars, ticketFilterVars), busdb.ReadOperation)
-
- return &model.TicketList{
- Count: documentCount,
- Tickets: ticketList,
- }, err
- // return map[string]interface{}{"tickets": ticketList, "count": documentCount}, err
-}
-
-func (db *Database) ticketListQuery(ctx context.Context, query string, bindVars map[string]any, operation *busdb.Operation) ([]*model.TicketSimpleResponse, *model.LogEntry, error) {
- if bindVars == nil {
- bindVars = map[string]any{}
- }
- bindVars["@collection"] = TicketCollectionName
-
- cursor, logEntry, err := db.Query(ctx, query, bindVars, operation)
- if err != nil {
- return nil, nil, err
- }
- defer cursor.Close()
-
- var docs []*model.TicketSimpleResponse
- for {
- doc := model.Ticket{}
- meta, err := cursor.ReadDocument(ctx, &doc)
- if driver.IsNoMoreDocuments(err) {
- break
- } else if err != nil {
- return nil, nil, err
- }
-
- resp, err := toTicketSimpleResponse(meta.Key, &doc)
- if err != nil {
- return nil, nil, err
- }
-
- docs = append(docs, resp)
- }
-
- return docs, logEntry, nil
-}
-
-func (db *Database) TicketCount(ctx context.Context, typequery, filterquery string, bindVars map[string]any) (int, error) {
- if bindVars == nil {
- bindVars = map[string]any{}
- }
- bindVars["@collection"] = TicketCollectionName
-
- ticketFilterQuery, ticketFilterVars, err := db.Hooks.TicketReadFilter(ctx)
- if err != nil {
- return 0, err
- }
-
- countQuery := `RETURN LENGTH(FOR d IN @@collection ` + ticketFilterQuery + " " + typequery + " " + filterquery + ` RETURN 1)`
- cursor, _, err := db.Query(ctx, countQuery, mergeMaps(bindVars, ticketFilterVars), busdb.ReadOperation)
- if err != nil {
- return 0, err
- }
- documentCount := 0
- _, err = cursor.ReadDocument(ctx, &documentCount)
- if err != nil {
- return 0, err
- }
- cursor.Close()
-
- return documentCount, nil
-}
-
-func sortQuery(paramsSort []string, paramsDesc []bool, bindVars map[string]any) string {
- sortQuery := ""
- if len(paramsSort) > 0 {
- var sorts []string
- for i, column := range paramsSort {
- colsort := fmt.Sprintf("d.@column%d", i)
- if len(paramsDesc) > i && paramsDesc[i] {
- colsort += " DESC"
- }
- sorts = append(sorts, colsort)
- bindVars[fmt.Sprintf("column%d", i)] = column
- }
- sortQuery = "SORT " + strings.Join(sorts, ", ")
- }
-
- return sortQuery
-}
-
-func mergeMaps(a map[string]any, b map[string]any) map[string]any {
- merged := map[string]any{}
- for k, v := range a {
- merged[k] = v
- }
- for k, v := range b {
- merged[k] = v
- }
-
- return merged
-}
-
-func validate(e any, schema *gojsonschema.Schema) error {
- b, err := json.Marshal(e)
- if err != nil {
- return err
- }
-
- res, err := schema.Validate(gojsonschema.NewStringLoader(string(b)))
- if err != nil {
- return err
- }
-
- if len(res.Errors()) > 0 {
- var l []string
- for _, e := range res.Errors() {
- l = append(l, e.String())
- }
-
- return fmt.Errorf("validation failed: %v", strings.Join(l, ", "))
- }
-
- return nil
-}
diff --git a/database/ticket_field.go b/database/ticket_field.go
deleted file mode 100644
index 41ac4f2..0000000
--- a/database/ticket_field.go
+++ /dev/null
@@ -1,295 +0,0 @@
-package database
-
-import (
- "context"
- "errors"
- "fmt"
-
- "github.com/arangodb/go-driver"
- "github.com/iancoleman/strcase"
- maut "github.com/jonas-plum/maut/auth"
- "github.com/mingrammer/commonregex"
-
- "github.com/SecurityBrewery/catalyst/bus"
- "github.com/SecurityBrewery/catalyst/database/busdb"
- "github.com/SecurityBrewery/catalyst/generated/model"
- "github.com/SecurityBrewery/catalyst/generated/pointer"
- "github.com/SecurityBrewery/catalyst/generated/time"
-)
-
-func (db *Database) AddArtifact(ctx context.Context, id int64, artifact *model.Artifact) (*model.TicketWithTickets, error) {
- ticketFilterQuery, ticketFilterVars, err := db.Hooks.TicketWriteFilter(ctx)
- if err != nil {
- return nil, err
- }
-
- if artifact.Status == nil {
- artifact.Status = pointer.String("unknown")
- }
-
- if artifact.Type == nil {
- artifact.Type = pointer.String(inferType(artifact.Name))
- }
-
- query := `LET d = DOCUMENT(@@collection, @ID)
- ` + ticketFilterQuery + `
- UPDATE d WITH { "modified": @now, "artifacts": PUSH(NOT_NULL(d.artifacts, []), @artifact) } IN @@collection
- RETURN NEW`
-
- return db.ticketGetQuery(ctx, id, query, mergeMaps(map[string]any{"artifact": artifact, "now": time.Now().UTC()}, ticketFilterVars), &busdb.Operation{
- Type: bus.DatabaseEntryUpdated,
- Ids: []driver.DocumentID{
- driver.DocumentID(fmt.Sprintf("%s/%d", TicketCollectionName, id)),
- },
- })
-}
-
-func inferType(name string) string {
- switch {
- case commonregex.IPRegex.MatchString(name):
- return "ip"
- case commonregex.LinkRegex.MatchString(name):
- return "url"
- case commonregex.EmailRegex.MatchString(name):
- return "email"
- case commonregex.MD5HexRegex.MatchString(name):
- return "md5"
- case commonregex.SHA1HexRegex.MatchString(name):
- return "sha1"
- case commonregex.SHA256HexRegex.MatchString(name):
- return "sha256"
- }
-
- return "unknown"
-}
-
-func (db *Database) RemoveArtifact(ctx context.Context, id int64, name string) (*model.TicketWithTickets, error) {
- ticketFilterQuery, ticketFilterVars, err := db.Hooks.TicketWriteFilter(ctx)
- if err != nil {
- return nil, err
- }
-
- query := `LET d = DOCUMENT(@@collection, @ID)
- ` + ticketFilterQuery + `
- FOR a IN NOT_NULL(d.artifacts, [])
- FILTER a.name == @name
- LET newartifacts = REMOVE_VALUE(d.artifacts, a)
- UPDATE d WITH { "modified": @now, "artifacts": newartifacts } IN @@collection
- RETURN NEW`
-
- return db.ticketGetQuery(ctx, id, query, mergeMaps(map[string]any{"name": name, "now": time.Now().UTC()}, ticketFilterVars), &busdb.Operation{
- Type: bus.DatabaseEntryUpdated,
- Ids: []driver.DocumentID{
- driver.DocumentID(fmt.Sprintf("%s/%d", TicketCollectionName, id)),
- },
- })
-}
-
-func (db *Database) SetTemplate(ctx context.Context, id int64, schema string) (*model.TicketWithTickets, error) {
- ticketFilterQuery, ticketFilterVars, err := db.Hooks.TicketWriteFilter(ctx)
- if err != nil {
- return nil, err
- }
-
- query := `LET d = DOCUMENT(@@collection, @ID)
- ` + ticketFilterQuery + `
- UPDATE d WITH { "schema": @schema } IN @@collection
- RETURN NEW`
-
- return db.ticketGetQuery(ctx, id, query, mergeMaps(map[string]any{"schema": schema}, ticketFilterVars), &busdb.Operation{
- Type: bus.DatabaseEntryUpdated,
- Ids: []driver.DocumentID{
- driver.DocumentID(fmt.Sprintf("%s/%d", TicketCollectionName, id)),
- },
- })
-}
-
-func (db *Database) AddComment(ctx context.Context, id int64, comment *model.CommentForm) (*model.TicketWithTickets, error) {
- ticketFilterQuery, ticketFilterVars, err := db.Hooks.TicketWriteFilter(ctx)
- if err != nil {
- return nil, err
- }
-
- if comment.Creator == nil || *comment.Creator == "" {
- user, _, exists := maut.UserFromContext(ctx)
- if !exists {
- return nil, errors.New("no user in context")
- }
-
- comment.Creator = pointer.String(user.ID)
- }
-
- if comment.Created == nil {
- comment.Created = pointer.Time(time.Now().UTC())
- }
-
- query := `LET d = DOCUMENT(@@collection, @ID)
- ` + ticketFilterQuery + `
- UPDATE d WITH { "modified": @now, "comments": PUSH(NOT_NULL(d.comments, []), @comment) } IN @@collection
- RETURN NEW`
-
- return db.ticketGetQuery(ctx, id, query, mergeMaps(map[string]any{"comment": comment, "now": time.Now().UTC()}, ticketFilterVars), &busdb.Operation{
- Type: bus.DatabaseEntryUpdated,
- Ids: []driver.DocumentID{
- driver.DocumentID(fmt.Sprintf("%s/%d", TicketCollectionName, id)),
- },
- })
-}
-
-func (db *Database) RemoveComment(ctx context.Context, id int64, commentID int64) (*model.TicketWithTickets, error) {
- ticketFilterQuery, ticketFilterVars, err := db.Hooks.TicketWriteFilter(ctx)
- if err != nil {
- return nil, err
- }
-
- query := `LET d = DOCUMENT(@@collection, @ID)
- ` + ticketFilterQuery + `
- UPDATE d WITH { "modified": @now, "comments": REMOVE_NTH(d.comments, @commentID) } IN @@collection
- RETURN NEW`
-
- return db.ticketGetQuery(ctx, id, query, mergeMaps(map[string]any{"commentID": commentID, "now": time.Now().UTC()}, ticketFilterVars), &busdb.Operation{
- Type: bus.DatabaseEntryUpdated,
- Ids: []driver.DocumentID{
- driver.DocumentID(fmt.Sprintf("%s/%d", TicketCollectionName, id)),
- },
- })
-}
-
-func (db *Database) SetReferences(ctx context.Context, id int64, references []*model.Reference) (*model.TicketWithTickets, error) {
- ticketFilterQuery, ticketFilterVars, err := db.Hooks.TicketWriteFilter(ctx)
- if err != nil {
- return nil, err
- }
-
- query := `LET d = DOCUMENT(@@collection, @ID)
- ` + ticketFilterQuery + `
- UPDATE d WITH { "modified": @now, "references": @references } IN @@collection
- RETURN NEW`
-
- return db.ticketGetQuery(ctx, id, query, mergeMaps(map[string]any{"references": references, "now": time.Now().UTC()}, ticketFilterVars), &busdb.Operation{
- Type: bus.DatabaseEntryUpdated,
- Ids: []driver.DocumentID{
- driver.DocumentID(fmt.Sprintf("%s/%d", TicketCollectionName, id)),
- },
- })
-}
-
-func (db *Database) AddFile(ctx context.Context, id int64, file *model.File) (*model.TicketWithTickets, error) {
- ticketFilterQuery, ticketFilterVars, err := db.Hooks.TicketWriteFilter(ctx)
- if err != nil {
- return nil, err
- }
-
- query := `LET d = DOCUMENT(@@collection, @ID)
- ` + ticketFilterQuery + `
- UPDATE d WITH { "modified": @now, "files": APPEND(NOT_NULL(d.files, []), [@file]) } IN @@collection
- RETURN NEW`
-
- return db.ticketGetQuery(ctx, id, query, mergeMaps(map[string]any{"file": file, "now": time.Now().UTC()}, ticketFilterVars), &busdb.Operation{
- Type: bus.DatabaseEntryUpdated,
- Ids: []driver.DocumentID{
- driver.DocumentID(fmt.Sprintf("%s/%d", TicketCollectionName, id)),
- },
- })
-}
-
-func (db *Database) AddTicketPlaybook(ctx context.Context, id int64, playbookTemplate *model.PlaybookTemplateForm) (*model.TicketWithTickets, error) {
- pb, err := toPlaybook(playbookTemplate)
- if err != nil {
- return nil, err
- }
-
- ticketFilterQuery, ticketFilterVars, err := db.Hooks.TicketWriteFilter(ctx)
- if err != nil {
- return nil, err
- }
-
- playbookID := strcase.ToKebab(pb.Name)
- if playbookTemplate.ID != nil {
- playbookID = *playbookTemplate.ID
- }
-
- parentTicket, err := db.TicketGet(ctx, id)
- if err != nil {
- return nil, err
- }
-
- query := `FOR d IN @@collection
- ` + ticketFilterQuery + `
- FILTER d._key == @ID
- LET newplaybook = ZIP( [@playbookID], [@playbook] )
- LET newplaybooks = MERGE(NOT_NULL(d.playbooks, {}), newplaybook)
- LET newticket = MERGE(d, { "modified": @now, "playbooks": newplaybooks })
- REPLACE d WITH newticket IN @@collection
- RETURN NEW`
- ticket, err := db.ticketGetQuery(ctx, id, query, mergeMaps(map[string]any{
- "playbook": pb,
- "playbookID": findName(parentTicket.Playbooks, playbookID),
- "now": time.Now().UTC(),
- }, ticketFilterVars), &busdb.Operation{
- Type: bus.DatabaseEntryUpdated,
- Ids: []driver.DocumentID{
- driver.NewDocumentID(TicketCollectionName, fmt.Sprintf("%d", id)),
- },
- })
- if err != nil {
- return nil, err
- }
-
- if err := runRootTask(extractTicketResponse(ticket), playbookID, db); err != nil {
- return nil, err
- }
-
- return ticket, nil
-}
-
-func findName(playbooks map[string]*model.PlaybookResponse, name string) string {
- if _, ok := playbooks[name]; !ok {
- return name
- }
-
- for i := 0; ; i++ {
- try := fmt.Sprintf("%s%d", name, i)
- if _, ok := playbooks[try]; !ok {
- return try
- }
- }
-}
-
-func runRootTask(ticket *model.TicketResponse, playbookID string, db *Database) error {
- playbook := ticket.Playbooks[playbookID]
-
- for id, task := range playbook.Tasks {
- if task.Order == 0 && task.Type == model.TaskTypeAutomation {
- if err := runTask(ticket.ID, playbookID, id, task, ticket, db); err != nil {
- return err
- }
- }
- }
-
- return nil
-}
-
-func (db *Database) RemoveTicketPlaybook(ctx context.Context, id int64, playbookID string) (*model.TicketWithTickets, error) {
- ticketFilterQuery, ticketFilterVars, err := db.Hooks.TicketWriteFilter(ctx)
- if err != nil {
- return nil, err
- }
-
- query := `FOR d IN @@collection
- ` + ticketFilterQuery + `
- FILTER d._key == @ID
- LET newplaybooks = UNSET(d.playbooks, @playbookID)
- REPLACE d WITH MERGE(d, { "modified": @now, "playbooks": newplaybooks }) IN @@collection
- RETURN NEW`
-
- return db.ticketGetQuery(ctx, id, query, mergeMaps(map[string]any{
- "playbookID": playbookID,
- "now": time.Now().UTC(),
- }, ticketFilterVars), &busdb.Operation{
- Type: bus.DatabaseEntryUpdated,
- Ids: []driver.DocumentID{
- driver.NewDocumentID(TicketCollectionName, fmt.Sprintf("%d", id)),
- },
- })
-}
diff --git a/database/ticket_task.go b/database/ticket_task.go
deleted file mode 100644
index 2c0b8da..0000000
--- a/database/ticket_task.go
+++ /dev/null
@@ -1,225 +0,0 @@
-package database
-
-import (
- "context"
- "errors"
- "fmt"
- "log"
-
- "github.com/arangodb/go-driver"
- "github.com/google/uuid"
-
- "github.com/SecurityBrewery/catalyst/bus"
- "github.com/SecurityBrewery/catalyst/database/busdb"
- "github.com/SecurityBrewery/catalyst/generated/model"
- "github.com/SecurityBrewery/catalyst/generated/time"
-)
-
-func (db *Database) TaskGet(ctx context.Context, id int64, playbookID string, taskID string) (*model.TicketWithTickets, *model.PlaybookResponse, *model.TaskWithContext, error) {
- inc, err := db.TicketGet(ctx, id)
- if err != nil {
- return nil, nil, nil, err
- }
-
- playbook, ok := inc.Playbooks[playbookID]
- if !ok {
- return nil, nil, nil, errors.New("playbook does not exist")
- }
-
- task, ok := playbook.Tasks[taskID]
- if !ok {
- return nil, nil, nil, errors.New("task does not exist")
- }
-
- return inc, playbook, &model.TaskWithContext{
- PlaybookId: playbookID,
- PlaybookName: playbook.Name,
- TaskId: taskID,
- Task: task,
- TicketId: id,
- TicketName: inc.Name,
- }, nil
-}
-
-func (db *Database) TaskComplete(ctx context.Context, id int64, playbookID string, taskID string, data any) (*model.TicketWithTickets, error) {
- inc, err := db.TicketGet(ctx, id)
- if err != nil {
- return nil, err
- }
-
- completable := inc.Playbooks[playbookID].Tasks[taskID].Active
- if !completable {
- return nil, errors.New("cannot be completed")
- }
-
- ticketFilterQuery, ticketFilterVars, err := db.Hooks.TicketWriteFilter(ctx)
- if err != nil {
- return nil, err
- }
-
- query := `LET d = DOCUMENT(@@collection, @ID)
- ` + ticketFilterQuery + `
- LET playbook = d.playbooks[@playbookID]
- LET task = playbook.tasks[@taskID]
- LET newtask = MERGE(task, {"data": NOT_NULL(@data, {}), "done": true, closed: @closed })
- LET newtasks = MERGE(playbook.tasks, { @taskID: newtask } )
- LET newplaybook = MERGE(playbook, {"tasks": newtasks})
- LET newplaybooks = MERGE(d.playbooks, { @playbookID: newplaybook } )
-
- UPDATE d WITH { "modified": @now, "playbooks": newplaybooks } IN @@collection
- RETURN NEW`
- ticket, err := db.ticketGetQuery(ctx, id, query, mergeMaps(map[string]any{
- "playbookID": playbookID,
- "taskID": taskID,
- "data": data,
- "closed": time.Now().UTC(),
- "now": time.Now().UTC(),
- }, ticketFilterVars), &busdb.Operation{
- Type: bus.DatabaseEntryUpdated,
- Ids: []driver.DocumentID{
- driver.NewDocumentID(TicketCollectionName, fmt.Sprintf("%d", id)),
- },
- })
- if err != nil {
- return nil, err
- }
-
- playbook := ticket.Playbooks[playbookID]
- task := playbook.Tasks[taskID]
-
- runNextTasks(id, playbookID, task.Next, task.Data, extractTicketResponse(ticket), db)
-
- return ticket, nil
-}
-
-func extractTicketResponse(ticket *model.TicketWithTickets) *model.TicketResponse {
- return &model.TicketResponse{
- Artifacts: ticket.Artifacts,
- Comments: ticket.Comments,
- Created: ticket.Created,
- Details: ticket.Details,
- Files: ticket.Files,
- ID: ticket.ID,
- Modified: ticket.Modified,
- Name: ticket.Name,
- Owner: ticket.Owner,
- Playbooks: ticket.Playbooks,
- Read: ticket.Read,
- References: ticket.References,
- Schema: ticket.Schema,
- Status: ticket.Status,
- Type: ticket.Type,
- Write: ticket.Write,
- }
-}
-
-func (db *Database) TaskUpdateOwner(ctx context.Context, id int64, playbookID string, taskID string, owner string) (*model.TicketWithTickets, error) {
- ticketFilterQuery, ticketFilterVars, err := db.Hooks.TicketWriteFilter(ctx)
- if err != nil {
- return nil, err
- }
-
- query := `LET d = DOCUMENT(@@collection, @ID)
- ` + ticketFilterQuery + `
- LET playbook = d.playbooks[@playbookID]
- LET task = playbook.tasks[@taskID]
- LET newtask = MERGE(task, {"owner": @owner })
- LET newtasks = MERGE(playbook.tasks, { @taskID: newtask } )
- LET newplaybook = MERGE(playbook, {"tasks": newtasks})
- LET newplaybooks = MERGE(d.playbooks, { @playbookID: newplaybook } )
-
- UPDATE d WITH { "modified": @now, "playbooks": newplaybooks } IN @@collection
- RETURN NEW`
- ticket, err := db.ticketGetQuery(ctx, id, query, mergeMaps(map[string]any{
- "playbookID": playbookID,
- "taskID": taskID,
- "owner": owner,
- "now": time.Now().UTC(),
- }, ticketFilterVars), &busdb.Operation{
- Type: bus.DatabaseEntryUpdated,
- Ids: []driver.DocumentID{
- driver.NewDocumentID(TicketCollectionName, fmt.Sprintf("%d", id)),
- },
- })
- if err != nil {
- return nil, err
- }
-
- return ticket, nil
-}
-
-func (db *Database) TaskUpdateData(ctx context.Context, id int64, playbookID string, taskID string, data map[string]any) (*model.TicketWithTickets, error) {
- ticketFilterQuery, ticketFilterVars, err := db.Hooks.TicketWriteFilter(ctx)
- if err != nil {
- return nil, err
- }
-
- query := `LET d = DOCUMENT(@@collection, @ID)
- ` + ticketFilterQuery + `
- LET playbook = d.playbooks[@playbookID]
- LET task = playbook.tasks[@taskID]
- LET newtask = MERGE(task, {"data": @data })
- LET newtasks = MERGE(playbook.tasks, { @taskID: newtask } )
- LET newplaybook = MERGE(playbook, {"tasks": newtasks})
- LET newplaybooks = MERGE(d.playbooks, { @playbookID: newplaybook } )
-
- UPDATE d WITH { "modified": @now, "playbooks": newplaybooks } IN @@collection
- RETURN NEW`
- ticket, err := db.ticketGetQuery(ctx, id, query, mergeMaps(map[string]any{
- "playbookID": playbookID,
- "taskID": taskID,
- "data": data,
- "now": time.Now().UTC(),
- }, ticketFilterVars), &busdb.Operation{
- Type: bus.DatabaseEntryUpdated,
- Ids: []driver.DocumentID{
- driver.NewDocumentID(TicketCollectionName, fmt.Sprintf("%d", id)),
- },
- })
- if err != nil {
- return nil, err
- }
-
- return ticket, nil
-}
-
-func (db *Database) TaskRun(ctx context.Context, id int64, playbookID string, taskID string) error {
- ticket, _, task, err := db.TaskGet(ctx, id, playbookID, taskID)
- if err != nil {
- return err
- }
-
- if task.Task.Type == model.TaskTypeAutomation {
- if err := runTask(id, playbookID, taskID, task.Task, extractTicketResponse(ticket), db); err != nil {
- return err
- }
- }
-
- return nil
-}
-
-func runNextTasks(id int64, playbookID string, next map[string]string, data any, ticket *model.TicketResponse, db *Database) {
- for nextTaskID, requirement := range next {
- nextTask := ticket.Playbooks[playbookID].Tasks[nextTaskID]
- if nextTask.Type == model.TaskTypeAutomation {
- b, err := evalRequirement(requirement, data)
- if err != nil {
- continue
- }
- if b {
- if err := runTask(id, playbookID, nextTaskID, nextTask, ticket, db); err != nil {
- log.Println(err)
- }
- }
- }
- }
-}
-
-func runTask(ticketID int64, playbookID string, taskID string, task *model.TaskResponse, ticket *model.TicketResponse, db *Database) error {
- playbook := ticket.Playbooks[playbookID]
- msgContext := &model.Context{Playbook: playbook, Task: task, Ticket: ticket}
- origin := &model.Origin{TaskOrigin: &model.TaskOrigin{TaskId: taskID, PlaybookId: playbookID, TicketId: ticketID}}
- jobID := uuid.NewString()
-
- return publishJobMapping(jobID, *task.Automation, msgContext, origin, task.Payload, db)
-}
diff --git a/database/tickettype.go b/database/tickettype.go
deleted file mode 100644
index a617d9a..0000000
--- a/database/tickettype.go
+++ /dev/null
@@ -1,102 +0,0 @@
-package database
-
-import (
- "context"
- "errors"
-
- "github.com/arangodb/go-driver"
- "github.com/iancoleman/strcase"
-
- "github.com/SecurityBrewery/catalyst/database/busdb"
- "github.com/SecurityBrewery/catalyst/generated/model"
-)
-
-func toTicketType(doc *model.TicketTypeForm) *model.TicketType {
- return &model.TicketType{
- Name: doc.Name,
- Icon: doc.Icon,
- DefaultPlaybooks: doc.DefaultPlaybooks,
- DefaultTemplate: doc.DefaultTemplate,
- DefaultGroups: doc.DefaultGroups,
- }
-}
-
-func toTicketTypeResponse(key string, doc *model.TicketType) *model.TicketTypeResponse {
- return &model.TicketTypeResponse{
- ID: key,
- Name: doc.Name,
- Icon: doc.Icon,
- DefaultPlaybooks: doc.DefaultPlaybooks,
- DefaultTemplate: doc.DefaultTemplate,
- DefaultGroups: doc.DefaultGroups,
- }
-}
-
-func (db *Database) TicketTypeCreate(ctx context.Context, tickettype *model.TicketTypeForm) (*model.TicketTypeResponse, error) {
- if tickettype == nil {
- return nil, errors.New("requires ticket type")
- }
- if tickettype.Name == "" {
- return nil, errors.New("requires ticket type name")
- }
-
- var doc model.TicketType
- newctx := driver.WithReturnNew(ctx, &doc)
-
- meta, err := db.tickettypeCollection.CreateDocument(ctx, newctx, strcase.ToKebab(tickettype.Name), toTicketType(tickettype))
- if err != nil {
- return nil, err
- }
-
- return toTicketTypeResponse(meta.Key, &doc), nil
-}
-
-func (db *Database) TicketTypeGet(ctx context.Context, id string) (*model.TicketTypeResponse, error) {
- var doc model.TicketType
- meta, err := db.tickettypeCollection.ReadDocument(ctx, id, &doc)
- if err != nil {
- return nil, err
- }
-
- return toTicketTypeResponse(meta.Key, &doc), nil
-}
-
-func (db *Database) TicketTypeUpdate(ctx context.Context, id string, tickettype *model.TicketTypeForm) (*model.TicketTypeResponse, error) {
- var doc model.TicketType
- ctx = driver.WithReturnNew(ctx, &doc)
-
- meta, err := db.tickettypeCollection.ReplaceDocument(ctx, id, toTicketType(tickettype))
- if err != nil {
- return nil, err
- }
-
- return toTicketTypeResponse(meta.Key, &doc), nil
-}
-
-func (db *Database) TicketTypeDelete(ctx context.Context, id string) error {
- _, err := db.tickettypeCollection.RemoveDocument(ctx, id)
-
- return err
-}
-
-func (db *Database) TicketTypeList(ctx context.Context) ([]*model.TicketTypeResponse, error) {
- query := "FOR d IN @@collection RETURN d"
- cursor, _, err := db.Query(ctx, query, map[string]any{"@collection": TicketTypeCollectionName}, busdb.ReadOperation)
- if err != nil {
- return nil, err
- }
- defer cursor.Close()
- var docs []*model.TicketTypeResponse
- for {
- var doc model.TicketType
- meta, err := cursor.ReadDocument(ctx, &doc)
- if driver.IsNoMoreDocuments(err) {
- break
- } else if err != nil {
- return nil, err
- }
- docs = append(docs, toTicketTypeResponse(meta.Key, &doc))
- }
-
- return docs, err
-}
diff --git a/database/user.go b/database/user.go
deleted file mode 100644
index f485441..0000000
--- a/database/user.go
+++ /dev/null
@@ -1,233 +0,0 @@
-package database
-
-import (
- "context"
- "crypto/sha256"
- "errors"
- "fmt"
- "log"
- "math/rand"
-
- "github.com/arangodb/go-driver"
- "github.com/iancoleman/strcase"
- maut "github.com/jonas-plum/maut/auth"
-
- "github.com/SecurityBrewery/catalyst/database/busdb"
- "github.com/SecurityBrewery/catalyst/generated/model"
- "github.com/SecurityBrewery/catalyst/generated/pointer"
- "github.com/SecurityBrewery/catalyst/generated/time"
-)
-
-var letters = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_")
-
-func init() {
- rand.Seed(time.Now().UnixNano())
-}
-
-func generateKey() string {
- b := make([]rune, 32)
- for i := range b {
- b[i] = letters[rand.Intn(len(letters))]
- }
-
- return string(b)
-}
-
-func toUser(user *model.UserForm, sha256 *string) *model.User {
- u := &model.User{
- Blocked: user.Blocked,
- Roles: user.Roles,
- Sha256: sha256,
- Apikey: user.Apikey,
- }
-
- // log.Println(u)
- // b, _ := json.Marshal(u)
- // loader := gojsonschema.NewBytesLoader(b)
- // res, err := model.UserSchema.Validate(loader)
- // if err != nil {
- // log.Println(err)
- // }
- // log.Println(res.Errors())
-
- return u
-}
-
-func toUserResponse(key string, user *model.User) *model.UserResponse {
- return &model.UserResponse{
- ID: key,
- Roles: user.Roles,
- Blocked: user.Blocked,
- Apikey: user.Apikey,
- }
-}
-
-func toNewUserResponse(key string, user *model.User, secret *string) *model.NewUserResponse {
- return &model.NewUserResponse{
- ID: key,
- Roles: user.Roles,
- Secret: secret,
- Blocked: user.Blocked,
- }
-}
-
-func (db *Database) UserGetOrCreate(ctx context.Context, newUser *model.UserForm) (*model.UserResponse, error) {
- user, err := db.UserGet(ctx, newUser.ID)
- if err != nil {
- newUser, err := db.UserCreate(ctx, newUser)
- if err != nil {
- return nil, err
- }
-
- return &model.UserResponse{ID: newUser.ID, Roles: newUser.Roles, Blocked: newUser.Blocked}, nil
- }
-
- return user, nil
-}
-
-func (db *Database) UserCreate(ctx context.Context, newUser *model.UserForm) (*model.NewUserResponse, error) {
- var key, sha256Hash *string
- if newUser.Apikey {
- key, sha256Hash = generateAPIKey()
- }
-
- var doc model.User
- newctx := driver.WithReturnNew(ctx, &doc)
- meta, err := db.userCollection.CreateDocument(ctx, newctx, newUser.ID, toUser(newUser, sha256Hash))
- if err != nil {
- return nil, err
- }
-
- return toNewUserResponse(meta.Key, &doc, key), nil
-}
-
-func (db *Database) UserCreateSetupAPIKey(ctx context.Context, key string) (*model.UserResponse, error) {
- newUser := &model.UserForm{
- ID: "setup",
- Roles: []string{maut.AdminRole},
- Apikey: true,
- Blocked: false,
- }
- sha256Hash := pointer.String(fmt.Sprintf("%x", sha256.Sum256([]byte(key))))
-
- var doc model.User
- newctx := driver.WithReturnNew(ctx, &doc)
- meta, err := db.userCollection.CreateDocument(ctx, newctx, strcase.ToKebab(newUser.ID), toUser(newUser, sha256Hash))
- if err != nil {
- return nil, err
- }
-
- return toUserResponse(meta.Key, &doc), nil
-}
-
-func (db *Database) UserUpdate(ctx context.Context, id string, user *model.UserForm) (*model.UserResponse, error) {
- var doc model.User
- _, err := db.userCollection.ReadDocument(ctx, id, &doc)
- if err != nil {
- return nil, err
- }
-
- if doc.Apikey {
- return nil, errors.New("cannot update an API key")
- }
-
- ctx = driver.WithReturnNew(ctx, &doc)
-
- user.ID = id
-
- meta, err := db.userCollection.ReplaceDocument(ctx, id, toUser(user, nil))
- if err != nil {
- return nil, err
- }
-
- return toUserResponse(meta.Key, &doc), nil
-}
-
-func (db *Database) UserGet(ctx context.Context, id string) (*model.UserResponse, error) {
- var doc model.User
- meta, err := db.userCollection.ReadDocument(ctx, id, &doc)
- if err != nil {
- return nil, err
- }
-
- return toUserResponse(meta.Key, &doc), nil
-}
-
-func (db *Database) UserDelete(ctx context.Context, id string) error {
- _, err := db.userCollection.RemoveDocument(ctx, id)
-
- return err
-}
-
-func (db *Database) UserList(ctx context.Context) ([]*model.UserResponse, error) {
- query := "FOR d IN @@collection RETURN d"
- cursor, _, err := db.Query(ctx, query, map[string]any{"@collection": UserCollectionName}, busdb.ReadOperation)
- if err != nil {
- return nil, err
- }
- defer cursor.Close()
- var docs []*model.UserResponse
- for {
- var doc model.User
- meta, err := cursor.ReadDocument(ctx, &doc)
- if driver.IsNoMoreDocuments(err) {
- break
- } else if err != nil {
- return nil, err
- }
- doc.Sha256 = nil
- docs = append(docs, toUserResponse(meta.Key, &doc))
- }
-
- return docs, err
-}
-
-func (db *Database) UserAPIKeyByHash(ctx context.Context, sha256 string) (*model.UserResponse, error) {
- query := `FOR d in @@collection
- FILTER d.apikey && d.sha256 == @sha256
- RETURN d`
-
- vars := map[string]any{"@collection": UserCollectionName, "sha256": sha256}
- cursor, _, err := db.Query(ctx, query, vars, busdb.ReadOperation)
- if err != nil {
- return nil, err
- }
- defer cursor.Close()
-
- var doc model.User
- meta, err := cursor.ReadDocument(ctx, &doc)
- if err != nil {
- return nil, err
- }
-
- return toUserResponse(meta.Key, &doc), err
-}
-
-func (db *Database) UserByIDAndPassword(ctx context.Context, id, password string) (*model.UserResponse, error) {
- log.Println("UserByIDAndPassword", id, password)
- query := `FOR d in @@collection
- FILTER d._key == @id && !d.apikey && d.sha512 == SHA512(CONCAT(d.salt, @password))
- RETURN d`
-
- vars := map[string]any{"@collection": UserCollectionName, "id": id, "password": password}
- cursor, _, err := db.Query(ctx, query, vars, busdb.ReadOperation)
- if err != nil {
- return nil, err
- }
- defer cursor.Close()
-
- var doc model.User
- meta, err := cursor.ReadDocument(ctx, &doc)
- if err != nil {
- return nil, err
- }
-
- return toUserResponse(meta.Key, &doc), err
-}
-
-func generateAPIKey() (key, sha256Hash *string) {
- newKey := generateKey()
- sha256Hash = pointer.String(fmt.Sprintf("%x", sha256.Sum256([]byte(newKey))))
-
- return &newKey, sha256Hash
-}
diff --git a/database/userdata.go b/database/userdata.go
deleted file mode 100644
index 75464cb..0000000
--- a/database/userdata.go
+++ /dev/null
@@ -1,87 +0,0 @@
-package database
-
-import (
- "context"
- "errors"
-
- "github.com/arangodb/go-driver"
-
- "github.com/SecurityBrewery/catalyst/database/busdb"
- "github.com/SecurityBrewery/catalyst/generated/model"
-)
-
-func toUserDataResponse(key string, doc *model.UserData) *model.UserDataResponse {
- return &model.UserDataResponse{
- Email: doc.Email,
- ID: key,
- Image: doc.Image,
- Name: doc.Name,
- Timeformat: doc.Timeformat,
- }
-}
-
-func (db *Database) UserDataCreate(ctx context.Context, id string, userdata *model.UserData) error {
- if userdata == nil {
- return errors.New("requires setting")
- }
- if id == "" {
- return errors.New("requires username")
- }
-
- _, err := db.userdataCollection.CreateDocument(ctx, ctx, id, userdata)
-
- return err
-}
-
-func (db *Database) UserDataGetOrCreate(ctx context.Context, id string, newUserData *model.UserData) (*model.UserDataResponse, error) {
- setting, err := db.UserDataGet(ctx, id)
- if err != nil {
- return toUserDataResponse(id, newUserData), db.UserDataCreate(ctx, id, newUserData)
- }
-
- return setting, nil
-}
-
-func (db *Database) UserDataGet(ctx context.Context, id string) (*model.UserDataResponse, error) {
- var doc model.UserData
- meta, err := db.userdataCollection.ReadDocument(ctx, id, &doc)
- if err != nil {
- return nil, err
- }
-
- return toUserDataResponse(meta.Key, &doc), err
-}
-
-func (db *Database) UserDataList(ctx context.Context) ([]*model.UserDataResponse, error) {
- query := "FOR d IN @@collection SORT d.username ASC RETURN d"
- cursor, _, err := db.Query(ctx, query, map[string]any{"@collection": UserDataCollectionName}, busdb.ReadOperation)
- if err != nil {
- return nil, err
- }
- defer cursor.Close()
- var docs []*model.UserDataResponse
- for {
- var doc model.UserData
- meta, err := cursor.ReadDocument(ctx, &doc)
- if driver.IsNoMoreDocuments(err) {
- break
- } else if err != nil {
- return nil, err
- }
- docs = append(docs, toUserDataResponse(meta.Key, &doc))
- }
-
- return docs, err
-}
-
-func (db *Database) UserDataUpdate(ctx context.Context, id string, userdata *model.UserData) (*model.UserDataResponse, error) {
- var doc model.UserData
- ctx = driver.WithReturnNew(ctx, &doc)
-
- meta, err := db.userdataCollection.ReplaceDocument(ctx, id, userdata)
- if err != nil {
- return nil, err
- }
-
- return toUserDataResponse(meta.Key, &doc), nil
-}
diff --git a/database/userdata_test.go b/database/userdata_test.go
deleted file mode 100644
index 95cfee1..0000000
--- a/database/userdata_test.go
+++ /dev/null
@@ -1,176 +0,0 @@
-package database_test
-
-import (
- "testing"
-
- "github.com/stretchr/testify/assert"
-
- "github.com/SecurityBrewery/catalyst/generated/model"
- "github.com/SecurityBrewery/catalyst/generated/pointer"
- "github.com/SecurityBrewery/catalyst/test"
-)
-
-var bob = &model.UserData{
- Email: pointer.String("bob@example.org"),
- Name: pointer.String("Bob"),
-}
-
-var bobResponse = &model.UserDataResponse{
- ID: "bob",
- Email: pointer.String("bob@example.org"),
- Name: pointer.String("Bob"),
-}
-
-func TestDatabase_UserDataCreate(t *testing.T) {
- t.Parallel()
-
- type args struct {
- id string
- setting *model.UserData
- }
- tests := []struct {
- name string
- args args
- wantErr bool
- }{
- {name: "Normal setting", args: args{id: "bob", setting: bob}, wantErr: false},
- {name: "Nil setting", args: args{id: "bob"}, wantErr: true},
- {name: "UserData without settingname", args: args{id: ""}, wantErr: true},
- {name: "Only settingname", args: args{id: "bob"}, wantErr: true},
- }
- for _, tt := range tests {
- tt := tt
- t.Run(tt.name, func(t *testing.T) {
- t.Parallel()
-
- _, _, _, _, _, db, cleanup, err := test.DB(t)
- if err != nil {
- t.Fatal(err)
- }
- defer cleanup()
-
- if err := db.UserDataCreate(test.Context(), tt.args.id, tt.args.setting); (err != nil) != tt.wantErr {
- t.Errorf("settingCreate() error = %v, wantErr %v", err, tt.wantErr)
- }
- })
- }
-}
-
-func TestDatabase_UserDataGet(t *testing.T) {
- t.Parallel()
-
- type args struct {
- id string
- }
- tests := []struct {
- name string
- args args
- want *model.UserDataResponse
- wantErr bool
- }{
- {name: "Normal get", args: args{id: "bob"}, want: bobResponse},
- {name: "Not existing", args: args{id: "foo"}, wantErr: true},
- }
- for _, tt := range tests {
- tt := tt
- t.Run(tt.name, func(t *testing.T) {
- t.Parallel()
-
- _, _, _, _, _, db, cleanup, err := test.DB(t)
- if err != nil {
- t.Fatal(err)
- }
- defer cleanup()
-
- if err := db.UserDataCreate(test.Context(), "bob", bob); err != nil {
- t.Errorf("settingCreate() error = %v", err)
- }
-
- got, err := db.UserDataGet(test.Context(), tt.args.id)
- if (err != nil) != tt.wantErr {
- t.Errorf("UserDataGet() error = %v, wantErr %v", err, tt.wantErr)
-
- return
- }
- if err != nil {
- return
- }
-
- assert.Equal(t, tt.want, got)
- })
- }
-}
-
-func TestDatabase_UserDataList(t *testing.T) {
- t.Parallel()
-
- tests := []struct {
- name string
- want []*model.UserDataResponse
- wantErr bool
- }{
- {name: "Normal list", want: []*model.UserDataResponse{bobResponse}},
- }
- for _, tt := range tests {
- tt := tt
- t.Run(tt.name, func(t *testing.T) {
- t.Parallel()
-
- _, _, _, _, _, db, cleanup, err := test.DB(t)
- if err != nil {
- t.Fatal(err)
- }
- defer cleanup()
-
- if err := db.UserDataCreate(test.Context(), "bob", bob); err != nil {
- t.Errorf("settingCreate() error = %v", err)
- }
-
- got, err := db.UserDataList(test.Context())
- if (err != nil) != tt.wantErr {
- t.Errorf("UserDataList() error = %v, wantErr %v", err, tt.wantErr)
-
- return
- }
-
- assert.Equal(t, tt.want, got)
- })
- }
-}
-
-func TestDatabase_UserDataUpdate(t *testing.T) {
- t.Parallel()
-
- type args struct {
- id string
- setting *model.UserData
- }
- tests := []struct {
- name string
- args args
- wantErr bool
- }{
- {name: "Normal", args: args{id: "bob", setting: bob}},
- {name: "Not existing", args: args{id: "foo"}, wantErr: true},
- }
- for _, tt := range tests {
- tt := tt
- t.Run(tt.name, func(t *testing.T) {
- t.Parallel()
-
- _, _, _, _, _, db, cleanup, err := test.DB(t)
- if err != nil {
- t.Fatal(err)
- }
- defer cleanup()
-
- if err := db.UserDataCreate(test.Context(), "bob", bob); err != nil {
- t.Errorf("settingCreate() error = %v", err)
- }
-
- if _, err := db.UserDataUpdate(test.Context(), tt.args.id, tt.args.setting); (err != nil) != tt.wantErr {
- t.Errorf("UserDataUpdate() error = %v, wantErr %v", err, tt.wantErr)
- }
- })
- }
-}
diff --git a/definition/CAQLLexer.g4 b/definition/CAQLLexer.g4
deleted file mode 100644
index 45def35..0000000
--- a/definition/CAQLLexer.g4
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2020 by Martin Mirchev
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
- * associated documentation files (the "Software"), to deal in the Software without restriction,
- * including without limitation the rights to use, copy, modify, merge, publish, distribute,
- * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all copies or
- * substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
- * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Project : sqlite-parser; an ANTLR4 grammar for SQLite https://github.com/bkiers/sqlite-parser
- * Developed by : Bart Kiers, bart@big-o.nl
- */
-
-// $antlr-format alignTrailingComments on, columnLimit 150, maxEmptyLinesToKeep 1, reflowComments off, useTab off
-// $antlr-format allowShortRulesOnASingleLine on, alignSemicolons ownLine
-
-lexer grammar CAQLLexer;
-
-channels { ERRORCHANNEL }
-
-
-DOT: '.';
-
-// https://github.com/arangodb/arangodb/blob/devel/arangod/Aql/grammar.y
-T_REGEX_MATCH: '=~'; // "~= operator"
-T_REGEX_NON_MATCH: '!~'; // "~! operator"
-
-T_EQ: '=='; // "== operator";
-T_NE: '!='; // "!= operator";
-T_LT: '<'; // "< operator";
-T_GT: '>'; // "> operator";
-T_LE: '<='; // "<= operator";
-T_GE: '>='; // ">= operator";
-
-T_PLUS: '+'; // "+ operator"
-T_MINUS: '-'; // "- operator"
-T_TIMES: '*'; // "* operator"
-T_DIV: '/'; // "/ operator"
-T_MOD: '%'; // "% operator"
-
-T_QUESTION: '?'; // "?"
-T_COLON: ':'; // ":"
-T_SCOPE: '::'; // "::"
-T_RANGE: '..'; // ".."
-
-T_COMMA: ','; // ","
-T_OPEN: '('; // "("
-T_CLOSE: ')'; // ")"
-T_OBJECT_OPEN: '{'; // "{"
-T_OBJECT_CLOSE: '}'; // "}"
-T_ARRAY_OPEN: '['; // "["
-T_ARRAY_CLOSE: ']'; // "]"
-
-
-// https://www.arangodb.com/docs/stable/aql/fundamentals-syntax.html#keywords
-T_AGGREGATE: A G G R E G A T E;
-T_ALL: A L L;
-T_AND: (A N D | '&&');
-T_ANY: A N Y;
-T_ASC: A S C;
-T_COLLECT: C O L L E C T;
-T_DESC: D E S C;
-T_DISTINCT: D I S T I N C T;
-T_FALSE: F A L S E;
-T_FILTER: F I L T E R;
-T_FOR: F O R;
-T_GRAPH: G R A P H;
-T_IN: I N;
-T_INBOUND: I N B O U N D;
-T_INSERT: I N S E R T;
-T_INTO: I N T O;
-T_K_SHORTEST_PATHS: K '_' S H O R T E S T '_' P A T H S;
-T_LET: L E T;
-T_LIKE: L I K E;
-T_LIMIT: L I M I T;
-T_NONE: N O N E;
-T_NOT: (N O T | '!');
-T_NULL: N U L L;
-T_OR: (O R | '||');
-T_OUTBOUND: O U T B O U N D;
-T_REMOVE: R E M O V E;
-T_REPLACE: R E P L A C E;
-T_RETURN: R E T U R N;
-T_SHORTEST_PATH: S H O R T E S T '_' P A T H;
-T_SORT: S O R T;
-T_TRUE: T R U E;
-T_UPDATE: U P D A T E;
-T_UPSERT: U P S E R T;
-T_WITH: W I T H;
-
-T_KEEP: K E E P;
-T_COUNT: C O U N T;
-T_OPTIONS: O P T I O N S;
-T_PRUNE: P R U N E;
-T_SEARCH: S E A R C H;
-T_TO: T O;
-
-T_CURRENT: C U R R E N T;
-T_NEW: N E W;
-T_OLD: O L D;
-
-T_STRING: [a-zA-Z_] [a-zA-Z_0-9]*;
-
-T_INT: [1-9] DIGIT* | '0' | '0x' HEX_DIGIT+ | '0b' [0-1]+;
-T_FLOAT: ( [1-9] DIGIT* | '0' )? '.' DIGIT+ (E [-+]? DIGIT+)?;
-
-T_PARAMETER: '@' T_STRING;
-
-T_QUOTED_STRING: ('\'' ('\\'. | '\'\'' | ~('\'' | '\\'))* '\'' | '"' ( '\\'. | '""' | ~('"'| '\\') )* '"');
-
-SINGLE_LINE_COMMENT: '//' ~[\r\n]* (('\r'? '\n') | EOF) -> channel(HIDDEN);
-
-MULTILINE_COMMENT: '/*' .*? '*/' -> channel(HIDDEN);
-
-SPACES: [ \u000B\t\r\n] -> channel(HIDDEN);
-
-UNEXPECTED_CHAR: .;
-
-fragment HEX_DIGIT: [0-9a-fA-F];
-fragment DIGIT: [0-9];
-
-fragment A: [aA];
-fragment B: [bB];
-fragment C: [cC];
-fragment D: [dD];
-fragment E: [eE];
-fragment F: [fF];
-fragment G: [gG];
-fragment H: [hH];
-fragment I: [iI];
-fragment J: [jJ];
-fragment K: [kK];
-fragment L: [lL];
-fragment M: [mM];
-fragment N: [nN];
-fragment O: [oO];
-fragment P: [pP];
-fragment Q: [qQ];
-fragment R: [rR];
-fragment S: [sS];
-fragment T: [tT];
-fragment U: [uU];
-fragment V: [vV];
-fragment W: [wW];
-fragment X: [xX];
-fragment Y: [yY];
-fragment Z: [zZ];
-
-ERROR_RECONGNIGION: . -> channel(ERRORCHANNEL);
diff --git a/definition/CAQLParser.g4 b/definition/CAQLParser.g4
deleted file mode 100644
index ffa84a7..0000000
--- a/definition/CAQLParser.g4
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2014 by Bart Kiers
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
- * associated documentation files (the "Software"), to deal in the Software without restriction,
- * including without limitation the rights to use, copy, modify, merge, publish, distribute,
- * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all copies or
- * substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
- * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Project : sqlite-parser; an ANTLR4 grammar for SQLite https://github.com/bkiers/sqlite-parser
- * Developed by:
- * Bart Kiers, bart@big-o.nl
- * Martin Mirchev, marti_2203@abv.bg
- * Mike Lische, mike@lischke-online.de
- */
-
-// $antlr-format alignTrailingComments on, columnLimit 130, minEmptyLines 1, maxEmptyLinesToKeep 1, reflowComments off
-// $antlr-format useTab off, allowShortRulesOnASingleLine off, allowShortBlocksOnASingleLine on, alignSemicolons ownLine
-
-parser grammar CAQLParser;
-
-options {
- tokenVocab = CAQLLexer;
-}
-
-parse: expression EOF
-;
-
-expression:
- value_literal
- | reference
- | operator_unary
- | expression (T_PLUS|T_MINUS) expression
- | expression (T_TIMES|T_DIV|T_MOD) expression
- | expression T_RANGE expression
- | expression (T_LT|T_GT|T_LE|T_GE) expression
- | expression T_NOT? T_IN expression
- | expression (T_EQ|T_NE) expression
- | expression (T_ALL|T_ANY|T_NONE) eq_op=(T_EQ|T_NE|T_LT|T_GT|T_LE|T_GE|T_IN) expression
- | expression (T_ALL|T_ANY|T_NONE) T_NOT T_IN expression
- | expression T_NOT? (T_LIKE|T_REGEX_MATCH|T_REGEX_NON_MATCH) expression
- | expression T_AND expression
- | expression T_OR expression
- | expression T_QUESTION expression T_COLON expression
- | expression T_QUESTION T_COLON expression
-;
-
-operator_unary: (
- T_PLUS expression
- | T_MINUS expression
- | T_NOT expression
-);
-
-reference:
- T_STRING
- | compound_value
- | function_call
- | T_OPEN expression T_CLOSE
- | reference DOT T_STRING
- | reference T_ARRAY_OPEN expression T_ARRAY_CLOSE
-;
-
-compound_value: (
- array
- | object
-);
-
-function_call: (
- T_STRING T_OPEN expression? (T_COMMA expression)*? T_COMMA? T_CLOSE
-);
-
-value_literal: (
- T_QUOTED_STRING
- | T_INT
- | T_FLOAT
- | T_NULL
- | T_TRUE
- | T_FALSE
-);
-
-array:(
- T_ARRAY_OPEN expression? (T_COMMA expression)*? T_COMMA? T_ARRAY_CLOSE
-);
-
-object:
- T_OBJECT_OPEN object_element? (T_COMMA object_element)* T_COMMA? T_OBJECT_CLOSE
-;
-
-object_element:(
- T_STRING
- | object_element_name T_COLON expression
- | T_ARRAY_OPEN expression T_ARRAY_CLOSE T_COLON expression
-);
-
-object_element_name:(
- T_STRING
- | T_QUOTED_STRING
-);
diff --git a/definition/artifacts.yaml b/definition/artifacts.yaml
deleted file mode 100644
index f597890..0000000
--- a/definition/artifacts.yaml
+++ /dev/null
@@ -1,30 +0,0 @@
-swagger: "2.0"
-info: { version: "", title: "" }
-
-paths: { }
-
-definitions:
- Artifact:
- type: object
- required: [ name ]
- properties:
- name: { type: string, example: "2.2.2.2" }
- type: { type: string }
- kind: { type: string }
- status: { type: string, example: "Unknown" }
- enrichments: { type: object, additionalProperties: { $ref: "#/definitions/Enrichment" } }
-
- EnrichmentForm:
- type: object
- required: [ name, data ]
- properties:
- name: { type: string, example: "hash.sha1" }
- data: { type: object, example: { "hash": "b7a067a742c20d07a7456646de89bc2d408a1153" } }
-
- Enrichment:
- type: object
- required: [ name, data, created ]
- properties:
- name: { type: string, example: "hash.sha1" }
- data: { type: object, example: { "hash": "b7a067a742c20d07a7456646de89bc2d408a1153" } }
- created: { type: string, format: "date-time", example: "1985-04-12T23:20:50.52Z" }
diff --git a/definition/automation.yaml b/definition/automation.yaml
deleted file mode 100644
index a0ee2c4..0000000
--- a/definition/automation.yaml
+++ /dev/null
@@ -1,160 +0,0 @@
-swagger: "2.0"
-info: { version: "", title: "" }
-
-paths:
- /automations:
- get:
- tags: [ "automations" ]
- summary: "List automations"
- operationId: "listAutomations"
- responses:
- "200":
- description: "successful operation"
- schema: { type: array, items: { $ref: "#/definitions/AutomationResponse" } }
- examples:
- test:
- - id: comment
- image: "docker.io/python:3"
- script: ""
- type: [ playbook ]
- - id: hash.sha1
- image: "docker.io/python:3"
- script: ""
- type: [ global, artifact, playbook ]
- schema: "{\"title\":\"Input\",\"type\":\"object\",\"properties\":{\"default\":{\"type\":\"string\",\"title\":\"Value\"}},\"required\":[\"default\"]}"
- - id: vt.hash
- image: "docker.io/python:3"
- script: ""
- type: [ global, artifact, playbook ]
- schema: "{\"title\":\"Input\",\"type\":\"object\",\"properties\":{\"default\":{\"type\":\"string\",\"title\":\"Value\"}},\"required\":[\"default\"]}"
- security: [ { roles: [ "automation:read" ] } ]
- post:
- tags: [ "automations" ]
- summary: "Create a new automation"
- operationId: "createAutomation"
- parameters:
- - { name: "automation", in: "body", description: "New automation", required: true, schema: { $ref: "#/definitions/AutomationForm" }, x-example: { id: "hash-sha-256", image: "docker.io/python:3", script: "import sys\nimport json\nimport hashlib\n\n\ndef run(msg):\n sha256 = hashlib.sha256(msg['payload']['default'].encode('utf-8'))\n return {'hash': sha256.hexdigest()}\n\n\nprint(json.dumps(run(json.loads(sys.argv[1]))))\n", type: [ global ] } }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/AutomationResponse" }
- examples:
- test:
- id: "hash-sha-256"
- image: "docker.io/python:3"
- type: [ global ]
- script: |
- import sys
- import json
- import hashlib
-
-
- def run(msg):
- sha256 = hashlib.sha256(msg['payload']['default'].encode('utf-8'))
- return {'hash': sha256.hexdigest()}
-
-
- print(json.dumps(run(json.loads(sys.argv[1]))))
-
- security: [ { roles: [ "automation:write" ] } ]
-
- /automations/{id}:
- get:
- tags: [ "automations" ]
- summary: "Get a single automation"
- operationId: "getAutomation"
- parameters:
- - { name: "id", in: "path", description: "Automation ID", required: true, type: string, x-example: "hash.sha1" }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/AutomationResponse" }
- examples:
- test:
- id: hash.sha1
- image: "docker.io/python:3"
- type: [ global, artifact, playbook ]
- schema: "{\"title\":\"Input\",\"type\":\"object\",\"properties\":{\"default\":{\"type\":\"string\",\"title\":\"Value\"}},\"required\":[\"default\"]}"
- script: |
- #!/usr/bin/env python
-
- import sys
- import json
- import hashlib
-
-
- def run(msg):
- sha1 = hashlib.sha1(msg['payload']['default'].encode('utf-8'))
- return {"hash": sha1.hexdigest()}
-
-
- print(json.dumps(run(json.loads(sys.argv[1]))))
- security: [ { roles: [ "automation:read" ] } ]
- put:
- tags: [ "automations" ]
- summary: "Update an existing automation"
- operationId: "updateAutomation"
- parameters:
- - { name: "id", in: "path", description: "Automation ID", required: true, type: string, x-example: "hash.sha1" }
- - { name: "automation", in: "body", description: "Automation object that needs to be added", required: true, schema: { $ref: "#/definitions/AutomationForm" }, x-example: { id: hash.sha1, image: "docker.io/python:3", script: "import sys\nimport json\nimport hashlib\n\n\ndef run(msg):\n sha1 = hashlib.sha1(msg['payload'].encode('utf-8'))\n return {'hash': sha1.hexdigest()}\n\n\nprint(json.dumps(run(json.loads(sys.argv[1]))))\n", type: [ global, artifact, playbook ] } }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/AutomationResponse" }
- examples:
- test:
- id: hash.sha1
- image: "docker.io/python:3"
- type: [ global, artifact, playbook ]
- script: |
- import sys
- import json
- import hashlib
-
-
- def run(msg):
- sha1 = hashlib.sha1(msg['payload'].encode('utf-8'))
- return {'hash': sha1.hexdigest()}
-
-
- print(json.dumps(run(json.loads(sys.argv[1]))))
- security: [ { roles: [ "automation:write" ] } ]
- delete:
- tags: [ "automations" ]
- summary: "Delete a automation"
- operationId: "deleteAutomation"
- parameters:
- - { name: "id", in: "path", description: "Automation ID", required: true, type: string, x-example: "hash.sha1" }
- responses:
- "204": { description: "successful operation" }
- security: [ { roles: [ "automation:write" ] } ]
-
-definitions:
- AutomationForm:
- type: object
- required: [ id, image, script, type ]
- properties:
- id: { type: string }
- image: { type: string }
- script: { type: string }
- type: { type: array, items: { type: string, enum: [ artifact, playbook, global ] } }
- schema: { type: string, example: "{}" }
-
- Automation:
- type: object
- required: [ image, script, type ]
- properties:
- image: { type: string }
- script: { type: string }
- type: { type: array, items: { type: string, enum: [ artifact, playbook, global ] } }
- schema: { type: string, example: "{}" }
-
- AutomationResponse:
- type: object
- required: [ id, image, script, type ]
- properties:
- id: { type: string }
- image: { type: string }
- script: { type: string }
- type: { type: array, items: { type: string, enum: [ artifact, playbook, global ] } }
- schema: { type: string, example: "{}" }
diff --git a/definition/dashboards.yaml b/definition/dashboards.yaml
deleted file mode 100644
index 7445cff..0000000
--- a/definition/dashboards.yaml
+++ /dev/null
@@ -1,167 +0,0 @@
-swagger: "2.0"
-info: { version: "", title: "" }
-
-paths:
- /statistics:
- get:
- tags: [ "statistics" ]
- summary: "Get statistics"
- operationId: "getStatistics"
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: '#/definitions/Statistics' }
- examples:
- test:
- unassigned: 0
- open_tickets_per_user: { }
- tickets_per_week: { "2021-39": 3 }
- tickets_per_type: { "alert": 2, "incident": 1 }
- security: [ { roles: [ "ticket:read" ] } ]
-
- /dashboards:
- get:
- tags: [ "dashboards" ]
- summary: "List dashboards"
- operationId: "listDashboards"
- responses:
- "200":
- description: "successful operation"
- schema: { type: array, items: { $ref: "#/definitions/DashboardResponse" } }
- examples:
- test:
- - id: simple
- name: Simple
- widgets:
- - name: "open_tickets_per_user"
- aggregation: "owner"
- filter: 'status == "open"'
- type: "bar"
- width: 4
- - name: "tickets_per_week"
- aggregation: 'CONCAT(DATE_YEAR(created), "-", DATE_ISOWEEK(created) < 10 ? "0" : "", DATE_ISOWEEK(created))'
- type: "line"
- width: 8
- security: [ { roles: [ "dashboard:read" ] } ]
- post:
- tags: [ "dashboards" ]
- summary: "Create a new dashboard"
- operationId: "createDashboard"
- parameters:
- - { name: "template", in: "body", description: "New template", required: true, schema: { $ref: "#/definitions/Dashboard" }, x-example: { name: "My Dashboard", widgets: [ ] } }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/DashboardResponse" }
- examples:
- test:
- id: "my-dashboard"
- name: "My Dashboard"
- widgets: []
- security: [ { roles: [ "dashboard:write" ] } ]
-
- /dashboards/{id}:
- get:
- tags: [ "dashboards" ]
- summary: "Get a single dashboard"
- operationId: "getDashboard"
- parameters:
- - { name: "id", in: "path", description: "Dashboard ID", required: true, type: string, x-example: "simple" }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/DashboardResponse" }
- examples:
- test:
- id: simple
- name: Simple
- widgets:
- - name: "open_tickets_per_user"
- aggregation: "owner"
- filter: 'status == "open"'
- type: "bar"
- width: 4
- - name: "tickets_per_week"
- aggregation: 'CONCAT(DATE_YEAR(created), "-", DATE_ISOWEEK(created) < 10 ? "0" : "", DATE_ISOWEEK(created))'
- type: "line"
- width: 8
- security: [ { roles: [ "dashboard:read" ] } ]
- put:
- tags: [ "dashboards" ]
- summary: "Update an existing dashboard"
- operationId: "updateDashboard"
- parameters:
- - { name: "id", in: "path", description: "Dashboard ID", required: true, type: string, x-example: "simple" }
- - { name: "dashboard", in: "body", description: "Dashboard object that needs to be added", required: true, schema: { $ref: "#/definitions/Dashboard" }, x-example: { name: "Simple", widgets: [] } }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/DashboardResponse" }
- examples:
- test:
- id: simple
- name: Simple
- widgets: []
- security: [ { roles: [ "dashboard:write" ] } ]
- delete:
- tags: [ "dashboards" ]
- summary: "Delete a dashboard"
- operationId: "deleteDashboard"
- parameters:
- - { name: "id", in: "path", description: "Dashboard ID", required: true, type: string, x-example: "simple" }
- responses:
- "204": { description: "successful operation" }
- security: [ { roles: [ "dashboard:write" ] } ]
-
- /dashboard/data:
- get:
- tags: [ "dashboards" ]
- summary: "Get widget data"
- operationId: "dashboardData"
- parameters:
- - { name: "aggregation", in: "query", description: "Aggregation", required: true, type: string, x-example: "type" }
- - { name: "filter", in: "query", description: "Filter", type: string, x-example: 'status == "closed"' }
- responses:
- "200":
- description: "successful operation"
- schema: { type: object }
- examples:
- test:
- alert: 2
- incident: 1
- security: [ { roles: [ "dashboard:read" ] } ]
-
-definitions:
- Statistics:
- type: object
- required: [ unassigned, open_tickets_per_user, tickets_per_week, tickets_per_type ]
- properties:
- unassigned: { type: integer }
- open_tickets_per_user: { type: object, additionalProperties: { type: integer } }
- tickets_per_week: { type: object, additionalProperties: { type: integer } }
- tickets_per_type: { type: object, additionalProperties: { type: integer } }
-
- Dashboard:
- type: object
- required: [ name, widgets ]
- properties:
- name: { type: string }
- widgets: { type: array, items: { $ref: "#/definitions/Widget" } }
-
- DashboardResponse:
- type: object
- required: [ id, name, widgets ]
- properties:
- id: { type: string }
- name: { type: string }
- widgets: { type: array, items: { $ref: "#/definitions/Widget" } }
-
- Widget:
- type: object
- required: [ name, type, aggregation, width ]
- properties:
- name: { type: string }
- type: { type: string, enum: [ "bar", "line", "pie" ] }
- filter: { type: string }
- aggregation: { type: string }
- width: { type: integer, minimum: 1, maximum: 12 }
\ No newline at end of file
diff --git a/definition/enterprise/graph.yaml b/definition/enterprise/graph.yaml
deleted file mode 100644
index 0060149..0000000
--- a/definition/enterprise/graph.yaml
+++ /dev/null
@@ -1,52 +0,0 @@
-swagger: "2.0"
-info: { version: "", title: "" }
-
-paths:
- /graph/{col}/{id}:
- get:
- tags: [ "graph" ]
- summary: "Graph"
- operationId: "graph"
- parameters:
- - { name: "col", in: "path", description: "Graph Start", required: true, type: string, x-example: "tickets" }
- - { name: "id", in: "path", description: "Graph Start", required: true, type: string, x-example: "88" }
- - { name: "depth", in: "query", description: "Graph Start", required: true, type: integer, x-example: 1 }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/Graph" }
- examples:
- test:
- nodes:
- - { id: "artifacts/94d5cab6f5fe3422a447ab15436e7a672bc0c09a", name: "94d5cab6f5fe3422a447ab15436e7a672bc0c09a" }
- - { id: "artifacts/http%3A%2F%2Fwww.customerviral.io%2Fscalable%2Fvertical%2Fkiller", name: "http://www.customerviral.io/scalable/vertical/killer" }
- - { id: "artifacts/leadreintermediate.io", name: "leadreintermediate.io" }
- - { id: "tickets/88", name: "live zebra" }
- links:
- - { id: "296239", sid: "tickets/88", tid: "artifacts/http%3A%2F%2Fwww.customerviral.io%2Fscalable%2Fvertical%2Fkiller" }
- - { id: "296240", sid: "tickets/88", tid: "artifacts/leadreintermediate.io" }
- - { id: "296242", sid: "tickets/88", tid: "artifacts/94d5cab6f5fe3422a447ab15436e7a672bc0c09a" }
- security: [ { roles: [ "ticket:read" ] } ]
-
-definitions:
- Graph:
- type: object
- properties:
- nodes: { type: array, items: { $ref: "#/definitions/Node" } }
- links: { type: array, items: { $ref: "#/definitions/Link" } }
-
- Node:
- type: object
- required: [ id, name ]
- properties:
- id: { type: string }
- name: { type: string }
-
- Link:
- type: object
- required: [ id, tid, sid ]
- properties:
- id: { type: string }
- # name: { type: string }
- tid: { type: string }
- sid: { type: string }
diff --git a/definition/enterprise/groups.yaml b/definition/enterprise/groups.yaml
deleted file mode 100644
index 6a2f91a..0000000
--- a/definition/enterprise/groups.yaml
+++ /dev/null
@@ -1,84 +0,0 @@
-swagger: "2.0"
-info: { version: "", title: "" }
-
-paths:
- /groups:
- get:
- tags: [ "groups" ]
- summary: "List groups"
- operationId: "listGroups"
- responses:
- "200":
- description: "successful operation"
- schema: { type: array, items: { $ref: "#/definitions/Group" } }
- security: [ { roles: [ "group:read" ] } ]
- post:
- tags: [ "groups" ]
- summary: "Create a new group"
- operationId: "createGroup"
- parameters:
- - { name: "group", in: "body", description: "New group", required: true, schema: { $ref: "#/definitions/GroupForm" } }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/GroupResponse" }
- security: [ { roles: [ "group:write" ] } ]
-
- /groups/{id}:
- get:
- tags: [ "groups" ]
- summary: "Get a single group"
- operationId: "getGroup"
- parameters:
- - { name: "id", in: "path", description: "Group ID", required: true, type: string }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/GroupResponse" }
- security: [ { roles: [ "group:read" ] } ]
- put:
- tags: [ "groups" ]
- summary: "Update an existing group"
- operationId: "updateGroup"
- parameters:
- - { name: "id", in: "path", description: "Group ID", required: true, type: string }
- - { name: "group", in: "body", description: "Group object that needs to be added", required: true, schema: { $ref: "#/definitions/Group" } }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/Group" }
- security: [ { roles: [ "group:write" ] } ]
- delete:
- tags: [ "groups" ]
- summary: "Delete a group"
- operationId: "deleteGroup"
- parameters:
- - { name: "id", in: "path", description: "Group ID", required: true, type: string }
- responses:
- "204": { description: "successful operation" }
- security: [ { roles: [ "group:write" ] } ]
-
-definitions:
- GroupForm:
- type: object
- required: [ name, users ]
- properties:
- id: { type: string }
- name: { type: string }
- users: { type: array, items: { type: string } }
-
- Group:
- type: object
- required: [ name, users ]
- properties:
- name: { type: string }
- users: { type: array, items: { type: string } }
-
-
- GroupResponse:
- type: object
- required: [ id, name, users ]
- properties:
- id: { type: string }
- name: { type: string }
- users: { type: array, items: { type: string } }
diff --git a/definition/enterprise/rules.yaml b/definition/enterprise/rules.yaml
deleted file mode 100644
index 6fdffa0..0000000
--- a/definition/enterprise/rules.yaml
+++ /dev/null
@@ -1,110 +0,0 @@
-swagger: "2.0"
-info: { version: "", title: "" }
-
-paths:
- /rules:
- get:
- tags: [ "rules" ]
- summary: "List rules"
- operationId: "listRules"
- responses:
- "200":
- description: "successful operation"
- schema: { type: array, items: { $ref: "#/definitions/RuleResponse" } }
- examples:
- test:
- - id: ignore-alerts
- name: Ignore Alerts
- condition: "type == 'alert'"
- update: { "status": "closed" }
- security: [ { roles: [ "rule:read" ] } ]
- post:
- tags: [ "rules" ]
- summary: "Create a rule"
- operationId: "createRule"
- parameters:
- - { name: "rule", in: "body", description: "New rule", required: true, schema: { $ref: "#/definitions/RuleForm" }, x-example: { name: "Ignore all Alerts", condition: "type == 'alert'", update: { "status": "closed" } } }
- responses:
- "200":
- description: "successful operation"
- schema: { type: array, items: { $ref: "#/definitions/RuleResponse" } }
- examples:
- test:
- id: ignore-all-alerts
- name: Ignore all Alerts
- condition: "type == 'alert'"
- update: { "status": "closed" }
- security: [ { roles: [ "rule:write" ] } ]
-
- /rules/{id}:
- get:
- tags: [ "rules" ]
- summary: "Get a single rule"
- operationId: "getRule"
- parameters:
- - { name: "id", in: "path", description: "Rule name", required: true, type: string, x-example: "ignore-alerts" }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/RuleResponse" }
- examples:
- test:
- id: ignore-alerts
- name: Ignore Alerts
- condition: "type == 'alert'"
- update: { "status": "closed" }
- security: [ { roles: [ "rule:read" ] } ]
- put:
- tags: [ "rules" ]
- summary: "Update an existing ticket rule"
- operationId: "updateRule"
- parameters:
- - { name: "id", in: "path", description: "Rule ID", required: true, type: string, x-example: "ignore-alerts" }
- - { name: "rule", in: "body", description: "Updated rule", required: true, schema: { $ref: "#/definitions/RuleForm" }, x-example: { name: "Ignore Alerts", condition: "type == 'alert'", update: { "status": "invalid" } } }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/RuleResponse" }
- examples:
- test:
- id: ignore-alerts
- name: Ignore Alerts
- condition: "type == 'alert'"
- update: { "status": "invalid" }
- security: [ { roles: [ "rule:write" ] } ]
- delete:
- tags: [ "rules" ]
- summary: "Delete a rule"
- operationId: "deleteRule"
- parameters:
- - { name: "id", in: "path", description: "Rule name", required: true, type: string, x-example: "ignore-alerts" }
- responses:
- "204": { description: "successful operation" }
- security: [ { roles: [ "rule:write" ] } ]
-
-definitions:
- RuleForm:
- type: object
- required: [ name, condition, update ]
- properties:
- id: { type: string }
- name: { type: string }
- condition: { type: string }
- update: { type: object }
-
- Rule:
- type: object
- required: [ name, condition, update ]
- properties:
- name: { type: string }
- condition: { type: string }
- update: { type: object }
-
- RuleResponse:
- type: object
- required: [ id, name, condition, update ]
- properties:
- id: { type: string }
- name: { type: string }
- condition: { type: string }
- update: { type: object }
diff --git a/definition/jobs.yaml b/definition/jobs.yaml
deleted file mode 100644
index 495bbb1..0000000
--- a/definition/jobs.yaml
+++ /dev/null
@@ -1,144 +0,0 @@
-swagger: "2.0"
-info: { version: "", title: "" }
-
-paths:
- /jobs:
- get:
- tags: [ "jobs" ]
- summary: "List jobs"
- operationId: "listJobs"
- responses:
- "200":
- description: "successful operation"
- schema: { type: array, items: { $ref: "#/definitions/JobResponse" } }
- examples:
- test:
- - id: "b81c2366-ea37-43d2-b61b-03afdc21d985"
- automation: "hash.sha1"
- payload: "test"
- status: "created"
- security: [ { roles: [ "job:read" ] } ]
- post:
- tags: [ "jobs" ]
- summary: "Start a new job"
- operationId: "runJob"
- parameters:
- - { name: "job", in: "body", description: "New job", required: true, schema: { $ref: "#/definitions/JobForm" }, x-example: { automation: "hash.sha1", payload: "test" } }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/JobResponse" }
- examples:
- test: { id: "87390749-2125-4a87-91c5-da7e3f9bebf1", automation: "hash.sha1", payload: "test", status: "created" }
- security: [ { roles: [ "job:write" ] } ]
-
- /jobs/{id}:
- get:
- tags: [ "jobs" ]
- summary: "Get a single job"
- operationId: "getJob"
- parameters:
- - { name: "id", in: "path", description: "Job ID", required: true, type: string, x-example: "b81c2366-ea37-43d2-b61b-03afdc21d985" }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/JobResponse" }
- examples:
- test: { id: "b81c2366-ea37-43d2-b61b-03afdc21d985", automation: "hash.sha1", payload: "test", status: "created" }
- security: [ { roles: [ "job:read" ] } ]
- put:
- tags: [ "jobs" ]
- summary: "Update an existing job"
- operationId: "updateJob"
- parameters:
- - { name: "id", in: "path", description: "Job ID", required: true, type: string, x-example: "b81c2366-ea37-43d2-b61b-03afdc21d985" }
- - { name: "job", in: "body", description: "Job object that needs to be added", required: true, schema: { $ref: "#/definitions/JobUpdate" }, x-example: { status: "failed", running: false } }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/JobResponse" }
- examples:
- test: { id: "b81c2366-ea37-43d2-b61b-03afdc21d985", automation: "hash.sha1", payload: "test", status: "failed" }
-
- security: [ { roles: [ "job:write" ] } ]
-
-definitions:
- Message:
- type: object
- properties:
- payload: { }
- secrets: { type: object, additionalProperties: { type: string } }
- context: { $ref: "#/definitions/Context" }
-
- Context:
- type: object
- properties:
- artifact: { $ref: "#/definitions/Artifact" }
- playbook: { $ref: "#/definitions/PlaybookResponse" }
- task: { $ref: "#/definitions/TaskResponse" }
- ticket: { $ref: "#/definitions/TicketResponse" }
-
- Origin:
- type: object
- properties:
- task_origin: { $ref: "#/definitions/TaskOrigin" }
- artifact_origin: { $ref: "#/definitions/ArtifactOrigin" }
-
- TaskOrigin:
- type: object
- required: [ ticket_id, playbook_id, task_id ]
- properties:
- ticket_id: { type: integer, format: int64 }
- playbook_id: { type: string }
- task_id: { type: string }
-
- ArtifactOrigin:
- type: object
- required: [ ticket_id, artifact ]
- properties:
- ticket_id: { type: integer, format: int64 }
- artifact: { type: string }
-
- JobForm:
- type: object
- required: [ automation ]
- properties:
- automation: { type: string }
- payload: { }
- origin: { $ref: "#/definitions/Origin" }
-
- JobUpdate:
- type: object
- required: [ running, status ]
- properties:
- container: { type: string }
- running: { type: boolean }
- status: { type: string }
- log: { type: string }
- output: { type: object }
-
- Job:
- type: object
- required: [ automation, running, status ]
- properties:
- automation: { type: string }
- container: { type: string }
- payload: { }
- running: { type: boolean }
- status: { type: string }
- log: { type: string }
- output: { type: object }
- origin: { $ref: "#/definitions/Origin" }
-
- JobResponse:
- type: object
- required: [ id, automation, status ]
- properties:
- id: { type: string }
- automation: { type: string }
- container: { type: string }
- status: { type: string }
- payload: { }
- log: { type: string }
- output: { type: object }
- origin: { $ref: "#/definitions/Origin" }
diff --git a/definition/logs.yaml b/definition/logs.yaml
deleted file mode 100644
index 2337dc4..0000000
--- a/definition/logs.yaml
+++ /dev/null
@@ -1,31 +0,0 @@
-swagger: "2.0"
-info: { version: "", title: "" }
-
-paths:
-
- /logs/{reference}:
- get:
- tags: [ "logs" ]
- summary: "Get log entries"
- operationId: "getLogs"
- parameters:
- - { name: "reference", in: "path", description: "Reference", required: true, type: string, x-example: "tickets%2F294511" }
- responses:
- "200":
- description: "successful operation"
- schema: { type: array, items: { $ref: "#/definitions/LogEntry" } }
- examples:
- test:
- - { type: "manual", "created": "2021-12-12T12:12:12.000000012Z","creator": "bob","reference": "tickets/294511","message": "Fail run account resist lend solve incident centre priority temperature. Cause change distribution examine location technique shape partner milk customer. Rail tea plate soil report cook railway interpretation breath action. Exercise dream accept park conclusion addition shoot assistance may answer. Gold writer link stop combine hear power name commitment operation. Determine lifespan support grow degree henry exclude detail set religion. Direct library policy convention chain retain discover ride walk student. Gather proposal select march aspect play noise avoid encourage employ. Assessment preserve transport combine wish influence income guess run stand. Charge limit crime ignore statement foundation study issue stop claim." }
- security: [ { roles: [ "log:read" ] } ]
-
-definitions:
- LogEntry:
- type: object
- required: [ type, reference, creator, created, message ]
- properties:
- type: { type: string }
- reference: { type: string }
- creator: { type: string }
- created: { type: string, format: "date-time" }
- message: { type: string }
diff --git a/definition/playbooks.yaml b/definition/playbooks.yaml
deleted file mode 100644
index 2a92a67..0000000
--- a/definition/playbooks.yaml
+++ /dev/null
@@ -1,199 +0,0 @@
-swagger: "2.0"
-info: { version: "", title: "" }
-
-paths:
- /playbooks:
- get:
- tags: [ "playbooks" ]
- summary: "List playbooks"
- operationId: "listPlaybooks"
- responses:
- "200":
- description: "successful operation"
- schema: { type: array, items: { $ref: "#/definitions/PlaybookTemplateResponse" } }
- examples:
- test:
- - id: phishing
- name: Phishing
- yaml: "name: Phishing\ntasks:\n board:\n name: Board Involvement?\n description: Is a board member involved?\n type: input\n schema:\n properties:\n boardInvolved:\n default: false\n title: A board member is involved.\n type: boolean\n required:\n - boardInvolved\n title: Board Involvement?\n type: object\n next:\n escalate: \"boardInvolved == true\"\n mail-available: \"boardInvolved == false\"\n\n escalate:\n name: Escalate to CISO\n description: Please escalate the task to the CISO\n type: task\n\n mail-available:\n name: Mail available\n type: input\n schema:\n oneOf:\n - properties:\n mail:\n title: Mail\n type: string\n x-display: textarea\n schemaKey:\n const: 'yes'\n type: string\n required:\n - mail\n title: 'Yes'\n - properties:\n schemaKey:\n const: 'no'\n type: string\n title: 'No'\n title: Mail available\n type: object\n next:\n block-sender: \"schemaKey == 'yes'\"\n extract-iocs: \"schemaKey == 'yes'\"\n search-email-gateway: \"schemaKey == 'no'\"\n\n search-email-gateway:\n name: Search email gateway\n description: Please search email-gateway for the phishing mail.\n type: task\n next:\n extract-iocs:\n\n block-sender:\n name: Block sender\n type: task\n next:\n extract-iocs:\n\n extract-iocs:\n name: Extract IOCs\n description: Please insert the IOCs\n type: input\n schema:\n properties:\n iocs:\n items:\n type: string\n title: IOCs\n type: array\n title: Extract IOCs\n type: object\n next:\n block-iocs:\n\n block-iocs:\n name: Block IOCs\n type: task\n"
- - id: simple
- name: Simple
- yaml: "name: Simple\ntasks:\n input:\n name: Enter something to hash\n type: input\n schema:\n title: Something\n type: object\n properties:\n something:\n type: string\n title: Something\n default: \"\"\n next:\n hash: \"something != ''\"\n\n hash:\n name: Hash the something\n type: automation\n automation: hash.sha1\n payload:\n default: \"playbook.tasks['input'].data['something']\"\n next:\n comment: \"hash != ''\"\n\n comment:\n name: Comment the hash\n type: automation\n automation: comment\n payload:\n default: \"playbook.tasks['hash'].data['hash']\"\n next:\n done: \"done\"\n\n done:\n name: You can close this case now\n type: task\n"
- security: [ { roles: [ "playbook:read" ] } ]
- post:
- tags: [ "playbooks" ]
- summary: "Create a playbook"
- operationId: "createPlaybook"
- parameters:
- - { name: "playbook", in: "body", description: "New playbook", required: true, schema: { $ref: "#/definitions/PlaybookTemplateForm" }, x-example: { yaml: "name: Simple2\ntasks:\n input:\n name: Upload malware if possible\n type: input\n schema:\n title: Malware\n type: object\n properties:\n malware:\n type: string\n title: Select malware\n default: \"\"\n next:\n hash: \"malware != ''\"\n\n hash:\n name: Hash the malware\n type: automation\n automation: hash.sha1\n payload:\n default: \"playbook.tasks['input'].data['malware']\"\n next:\n escalate:\n\n escalate:\n name: Escalate to malware team\n type: task\n" } }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/PlaybookTemplateResponse" }
- examples:
- test:
- id: simple-2
- name: Simple2
- yaml: |
- name: Simple2
- tasks:
- input:
- name: Upload malware if possible
- type: input
- schema:
- title: Malware
- type: object
- properties:
- malware:
- type: string
- title: Select malware
- default: ""
- next:
- hash: "malware != ''"
-
- hash:
- name: Hash the malware
- type: automation
- automation: hash.sha1
- payload:
- default: "playbook.tasks['input'].data['malware']"
- next:
- escalate:
-
- escalate:
- name: Escalate to malware team
- type: task
- security: [ { roles: [ "playbook:write" ] } ]
-
- /playbooks/{id}:
- get:
- tags: [ "playbooks" ]
- summary: "Get a single playbook"
- operationId: "getPlaybook"
- parameters:
- - { name: "id", in: "path", description: "Playbook name", required: true, type: string, x-example: "simple" }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/PlaybookTemplateResponse" }
- examples:
- test:
- id: simple
- name: Simple
- yaml: |
- name: Simple
- tasks:
- input:
- name: Enter something to hash
- type: input
- schema:
- title: Something
- type: object
- properties:
- something:
- type: string
- title: Something
- default: ""
- next:
- hash: "something != ''"
-
- hash:
- name: Hash the something
- type: automation
- automation: hash.sha1
- payload:
- default: "playbook.tasks['input'].data['something']"
- next:
- comment: "hash != ''"
-
- comment:
- name: Comment the hash
- type: automation
- automation: comment
- payload:
- default: "playbook.tasks['hash'].data['hash']"
- next:
- done: "done"
-
- done:
- name: You can close this case now
- type: task
-
- security: [ { roles: [ "playbook:read" ] } ]
- put:
- tags: [ "playbooks" ]
- summary: "Update an existing ticket playbook"
- operationId: "updatePlaybook"
- parameters:
- - { name: "id", in: "path", description: "Playbook ID", required: true, type: string, x-example: "simple" }
- - { name: "playbook", in: "body", description: "Updated playbook", required: true, schema: { $ref: "#/definitions/PlaybookTemplateForm" }, x-example: { yaml: "name: Simple\ntasks:\n input:\n name: Upload malware if possible\n type: input\n schema:\n title: Malware\n type: object\n properties:\n malware:\n type: string\n title: Select malware\n default: \"\"\n next:\n hash: \"malware != ''\"\n\n hash:\n name: Hash the malware\n type: automation\n automation: hash.sha1\n payload:\n default: \"playbook.tasks['input'].data['malware']\"\n next:\n escalate:\n\n escalate:\n name: Escalate to malware team\n type: task\n" } }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/PlaybookTemplateResponse" }
- examples:
- test:
- id: simple
- name: Simple
- yaml: |
- name: Simple
- tasks:
- input:
- name: Upload malware if possible
- type: input
- schema:
- title: Malware
- type: object
- properties:
- malware:
- type: string
- title: Select malware
- default: ""
- next:
- hash: "malware != ''"
-
- hash:
- name: Hash the malware
- type: automation
- automation: hash.sha1
- payload:
- default: "playbook.tasks['input'].data['malware']"
- next:
- escalate:
-
- escalate:
- name: Escalate to malware team
- type: task
- security: [ { roles: [ "playbook:write" ] } ]
- delete:
- tags: [ "playbooks" ]
- summary: "Delete a playbook"
- operationId: "deletePlaybook"
- parameters:
- - { name: "id", in: "path", description: "Playbook name", required: true, type: string, x-example: "simple" }
- responses:
- "204": { description: "successful operation" }
- security: [ { roles: [ "playbook:write" ] } ]
-
-definitions:
- PlaybookTemplateForm:
- type: object
- required: [ yaml ]
- properties:
- id: { type: string }
- yaml: { type: string }
-
- PlaybookTemplate:
- type: object
- required: [ name, yaml ]
- properties:
- name: { type: string }
- yaml: { type: string }
-
- PlaybookTemplateResponse:
- type: object
- required: [ id, name, yaml ]
- properties:
- id: { type: string }
- name: { type: string }
- yaml: { type: string }
diff --git a/definition/settings.yaml b/definition/settings.yaml
deleted file mode 100644
index 2564233..0000000
--- a/definition/settings.yaml
+++ /dev/null
@@ -1,89 +0,0 @@
-swagger: "2.0"
-info: { version: "", title: "" }
-
-paths:
- /settings:
- get:
- tags: [ "settings" ]
- summary: "Get settings"
- operationId: "getSettings"
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/SettingsResponse" }
- examples:
- test:
- version: "0.0.0-test"
- tier: community
- timeformat: "yyyy-MM-dd hh:mm:ss"
- ticketTypes:
- - { icon: "mdi-alert", id: "alert", name: "Alerts", default_template: "default", default_playbooks: [ ] }
- - { icon: "mdi-radioactive", id: "incident", name: "Incidents", default_template: "default", default_playbooks: [ ] }
- - { icon: "mdi-fingerprint", id: "investigation", name: "Forensic Investigations", default_template: "default", default_playbooks: [ ] }
- - { icon: "mdi-target", id: "hunt", name: "Threat Hunting", default_template: "default", default_playbooks: [ ] }
- artifactKinds:
- - { icon: "mdi-server", id: "asset", name: "Asset" }
- - { icon: "mdi-bullseye", id: "ioc", name: "IOC" }
- artifactStates:
- - { icon: "mdi-help-circle-outline", id: "unknown", name: "Unknown", color: "info" }
- - { icon: "mdi-skull", id: "malicious", name: "Malicious", color: "error" }
- - { icon: "mdi-check", id: "clean", name: "Clean", color: "success" }
- security: [ { roles: [ "settings:read" ] } ]
- post:
- tags: [ "settings" ]
- summary: "Save settings"
- operationId: "saveSettings"
- parameters:
- - { name: "settings", in: "body", description: "Save settings", required: true, schema: { $ref: "#/definitions/Settings" }, x-example: { timeformat: "yyyy-MM-dd hh:mm:ss", artifactKinds: [ { icon: "mdi-server", id: "asset", name: "Asset" }, { icon: "mdi-bullseye", id: "ioc", name: "IOC" } ], artifactStates: [ { icon: "mdi-help-circle-outline", id: "unknown", name: "Unknown", color: "info" },{ icon: "mdi-skull", id: "malicious", name: "Malicious", color: "error" },{ icon: "mdi-check", id: "clean", name: "Clean", color: "success" } ] } }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/SettingsResponse" }
- examples:
- test:
- version: "0.0.0-test"
- tier: community
- timeformat: "yyyy-MM-dd hh:mm:ss"
- ticketTypes:
- - { icon: "mdi-alert", id: "alert", name: "Alerts", default_template: "default", default_playbooks: [ ] }
- - { icon: "mdi-radioactive", id: "incident", name: "Incidents", default_template: "default", default_playbooks: [ ] }
- - { icon: "mdi-fingerprint", id: "investigation", name: "Forensic Investigations", default_template: "default", default_playbooks: [ ] }
- - { icon: "mdi-target", id: "hunt", name: "Threat Hunting", default_template: "default", default_playbooks: [ ] }
- artifactKinds:
- - { icon: "mdi-server", id: "asset", name: "Asset" }
- - { icon: "mdi-bullseye", id: "ioc", name: "IOC" }
- artifactStates:
- - { icon: "mdi-help-circle-outline", id: "unknown", name: "Unknown", color: "info" }
- - { icon: "mdi-skull", id: "malicious", name: "Malicious", color: "error" }
- - { icon: "mdi-check", id: "clean", name: "Clean", color: "success" }
- security: [ { roles: [ "settings:write" ] } ]
-
-definitions:
- Settings:
- type: object
- required: [ timeformat, artifactKinds, artifactStates ]
- properties:
- timeformat: { title: "Time Format", type: string }
- artifactKinds: { title: "Artifact Kinds", type: array, items: { $ref: "#/definitions/Type" } }
- artifactStates: { title: "Artifact States", type: array, items: { $ref: "#/definitions/Type" } }
-
- SettingsResponse:
- type: object
- required: [ version, tier, timeformat, ticketTypes, artifactKinds, artifactStates ]
- properties:
- version: { title: "Version", type: string }
- tier: { title: "Tier", type: string, enum: [ "community", "enterprise" ] }
- timeformat: { title: "Time Format", type: string }
- ticketTypes: { title: "Ticket Types", type: array, items: { $ref: "#/definitions/TicketTypeResponse" } }
- artifactKinds: { title: "Artifact Kinds", type: array, items: { $ref: "#/definitions/Type" } }
- artifactStates: { title: "Artifact States", type: array, items: { $ref: "#/definitions/Type" } }
- roles: { title: "Roles", type: array, items: { type: string } }
-
- Type:
- type: object
- required: [ id, name, icon ]
- properties:
- id: { title: ID, type: string, x-cols: 3, x-class: pr-2 }
- name: { title: Name, type: string, x-cols: 3, x-class: pr-2 }
- icon: { title: "Icon (https://materialdesignicons.com)", type: string, x-cols: 3, x-class: pr-2 }
- color: { title: Color, type: string, x-cols: 3, enum: [ error, info, success, warning ] }
diff --git a/definition/swagger.yaml b/definition/swagger.yaml
deleted file mode 100644
index 24d9a98..0000000
--- a/definition/swagger.yaml
+++ /dev/null
@@ -1,18 +0,0 @@
-swagger: "2.0"
-info:
- version: "0.0.3"
- title: "Catalyst"
- description: API for the catalyst incident response platform.
-
-host: "."
-basePath: "/api"
-schemes:
- # - "https"
- - "http"
-
-consumes: [ "application/json" ]
-produces: [ "application/json" ]
-
-paths: {}
-
-definitions: {}
diff --git a/definition/tasks.yaml b/definition/tasks.yaml
deleted file mode 100644
index 73da5a8..0000000
--- a/definition/tasks.yaml
+++ /dev/null
@@ -1,82 +0,0 @@
-swagger: "2.0"
-info: { version: "", title: "" }
-
-paths:
- /tasks:
- get:
- tags: [ "tasks" ]
- summary: "List tasks"
- operationId: "listTasks"
- responses:
- "200":
- description: "successful operation"
- schema: { type: array, items: { $ref: "#/definitions/TaskWithContext" } }
- examples:
- test: [ ]
- security: [ { roles: [ "ticket:read" ] } ]
-
-definitions:
- Task:
- type: object
- required: [ name, type, done, created ]
- properties:
- name: { type: string, example: "Inform user" }
- type: { type: string, enum: [ task, input, automation ], example: "task" }
- done: { type: boolean }
-
- owner: { type: string }
- data: { type: object }
-
- # automation
- automation: { type: string }
- payload: { type: object, additionalProperties: { type: string } }
-
- # input
- schema: { type: object }
-
- # workflow
- join: { type: boolean, example: false }
- next: { type: object, additionalProperties: { type: string } }
-
- created: { type: string, format: "date-time", example: "1985-04-12T23:20:50.52Z" }
- closed: { type: string, format: "date-time", example: "1985-04-12T23:20:50.52Z" }
-
- TaskResponse:
- type: object
- required: [ name, type, done, created, order, active ]
- properties:
- name: { type: string, example: "Inform user" }
- type: { type: string, enum: [ task, input, automation ], example: "task" }
- done: { type: boolean }
-
- owner: { type: string }
- data: { type: object }
-
- # automation
- automation: { type: string }
- payload: { type: object, additionalProperties: { type: string } }
-
- # input
- schema: { type: object }
-
- # workflow
- join: { type: boolean, example: false }
- next: { type: object, additionalProperties: { type: string } }
-
- created: { type: string, format: "date-time", example: "1985-04-12T23:20:50.52Z" }
- closed: { type: string, format: "date-time", example: "1985-04-12T23:20:50.52Z" }
-
- # helper
- order: { type: number, format: "int64", example: 2 }
- active: { type: boolean, example: false }
-
- TaskWithContext:
- type: object
- required: [ ticket_id, ticket_name, playbook_id, playbook_name, task_id, task ]
- properties:
- ticket_id: { type: number, format: "int64" }
- ticket_name: { type: string }
- playbook_id: { type: string }
- playbook_name: { type: string }
- task_id: { type: string }
- task: { $ref: '#/definitions/TaskResponse' }
diff --git a/definition/templates.yaml b/definition/templates.yaml
deleted file mode 100644
index b000dd4..0000000
--- a/definition/templates.yaml
+++ /dev/null
@@ -1,104 +0,0 @@
-swagger: "2.0"
-info: { version: "", title: "" }
-
-paths:
- /templates:
- get:
- tags: [ "templates" ]
- summary: "List templates"
- operationId: "listTemplates"
- responses:
- "200":
- description: "successful operation"
- schema: { type: array, items: { $ref: "#/definitions/TicketTemplateResponse" } }
- examples:
- test:
- - id: default
- name: Default
- schema: "{\n \"definitions\": {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://example.com/object1618746510.json\",\n \"title\": \"Default\",\n \"type\": \"object\",\n \"required\": [\n \"severity\",\n \"description\",\n \"tlp\"\n ],\n \"properties\": {\n \"severity\": {\n \"$id\": \"#root/severity\",\n \"title\": \"Severity\",\n \"type\": \"string\",\n \"default\": \"Medium\",\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"Low\",\n \"title\": \"Low\",\n \"icon\": \"mdi-chevron-up\"\n },\n {\n \"const\": \"Medium\",\n \"title\": \"Medium\",\n \"icon\": \"mdi-chevron-double-up\"\n },\n {\n \"const\": \"High\",\n \"title\": \"High\",\n \"icon\": \"mdi-chevron-triple-up\"\n }\n ]\n },\n \"tlp\": {\n \"$id\": \"#root/tlp\",\n \"title\": \"TLP\",\n \"type\": \"string\",\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"White\",\n \"title\": \"White\",\n \"icon\": \"mdi-alpha-w\"\n },\n {\n \"const\": \"Green\",\n \"title\": \"Green\",\n \"icon\": \"mdi-alpha-g\"\n },\n {\n \"const\": \"Amber\",\n \"title\": \"Amber\",\n \"icon\": \"mdi-alpha-a\"\n },\n {\n \"const\": \"Red\",\n \"title\": \"Red\",\n \"icon\": \"mdi-alpha-r\"\n }\n ]\n },\n \"description\": {\n \"$id\": \"#root/description\",\n \"title\": \"Description\",\n \"type\": \"string\",\n \"x-display\": \"textarea\",\n \"x-class\": \"pr-2\"\n }\n }\n}\n"
- security: [ { roles: [ "template:read" ] } ]
- post:
- tags: [ "templates" ]
- summary: "Create a new template"
- operationId: "createTemplate"
- parameters:
- - { name: "template", in: "body", description: "New template", required: true, schema: { $ref: "#/definitions/TicketTemplateForm" }, x-example: { name: "My Template", schema: "{\n \"definitions\": {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://example.com/object1618746510.json\",\n \"title\": \"Event\",\n \"type\": \"object\",\n \"required\": [\n \"severity\",\n \"description\",\n \"tlp\"\n ],\n \"properties\": {\n \"severity\": {\n \"$id\": \"#root/severity\",\n \"title\": \"Severity\",\n \"type\": \"string\",\n \"default\": \"Medium\",\n \"nx-enum\": [\n \"Low\",\n \"Medium\",\n \"High\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"Low\",\n \"title\": \"Low\",\n \"icon\": \"mdi-chevron-up\"\n },\n {\n \"const\": \"Medium\",\n \"title\": \"Medium\",\n \"icon\": \"mdi-chevron-double-up\"\n },\n {\n \"const\": \"High\",\n \"title\": \"High\",\n \"icon\": \"mdi-chevron-triple-up\"\n }\n ]\n },\n \"tlp\": {\n \"$id\": \"#root/tlp\",\n \"title\": \"TLP\",\n \"type\": \"string\",\n \"nx-enum\": [\n \"White\",\n \"Green\",\n \"Amber\",\n \"Red\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"White\",\n \"title\": \"White\",\n \"icon\": \"mdi-alpha-w\"\n },\n {\n \"const\": \"Green\",\n \"title\": \"Green\",\n \"icon\": \"mdi-alpha-g\"\n },\n {\n \"const\": \"Amber\",\n \"title\": \"Amber\",\n \"icon\": \"mdi-alpha-a\"\n },\n {\n \"const\": \"Red\",\n \"title\": \"Red\",\n \"icon\": \"mdi-alpha-r\"\n }\n ]\n },\n \"description\": {\n \"$id\": \"#root/description\",\n \"title\": \"Description\",\n \"type\": \"string\",\n \"x-display\": \"textarea\",\n \"x-class\": \"pr-2\"\n }\n }\n}\n" } }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/TicketTemplateResponse" }
- examples:
- test:
- id: "my-template"
- name: "My Template"
- schema: "{\n \"definitions\": {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://example.com/object1618746510.json\",\n \"title\": \"Event\",\n \"type\": \"object\",\n \"required\": [\n \"severity\",\n \"description\",\n \"tlp\"\n ],\n \"properties\": {\n \"severity\": {\n \"$id\": \"#root/severity\",\n \"title\": \"Severity\",\n \"type\": \"string\",\n \"default\": \"Medium\",\n \"nx-enum\": [\n \"Low\",\n \"Medium\",\n \"High\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"Low\",\n \"title\": \"Low\",\n \"icon\": \"mdi-chevron-up\"\n },\n {\n \"const\": \"Medium\",\n \"title\": \"Medium\",\n \"icon\": \"mdi-chevron-double-up\"\n },\n {\n \"const\": \"High\",\n \"title\": \"High\",\n \"icon\": \"mdi-chevron-triple-up\"\n }\n ]\n },\n \"tlp\": {\n \"$id\": \"#root/tlp\",\n \"title\": \"TLP\",\n \"type\": \"string\",\n \"nx-enum\": [\n \"White\",\n \"Green\",\n \"Amber\",\n \"Red\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"White\",\n \"title\": \"White\",\n \"icon\": \"mdi-alpha-w\"\n },\n {\n \"const\": \"Green\",\n \"title\": \"Green\",\n \"icon\": \"mdi-alpha-g\"\n },\n {\n \"const\": \"Amber\",\n \"title\": \"Amber\",\n \"icon\": \"mdi-alpha-a\"\n },\n {\n \"const\": \"Red\",\n \"title\": \"Red\",\n \"icon\": \"mdi-alpha-r\"\n }\n ]\n },\n \"description\": {\n \"$id\": \"#root/description\",\n \"title\": \"Description\",\n \"type\": \"string\",\n \"x-display\": \"textarea\",\n \"x-class\": \"pr-2\"\n }\n }\n}\n"
- security: [ { roles: [ "template:write" ] } ]
-
- /templates/{id}:
- get:
- tags: [ "templates" ]
- summary: "Get a single template"
- operationId: "getTemplate"
- parameters:
- - { name: "id", in: "path", description: "Template ID", required: true, type: string, x-example: "default" }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/TicketTemplateResponse" }
- examples:
- test:
- id: default
- name: Default
- schema: "{\n \"definitions\": {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://example.com/object1618746510.json\",\n \"title\": \"Default\",\n \"type\": \"object\",\n \"required\": [\n \"severity\",\n \"description\",\n \"tlp\"\n ],\n \"properties\": {\n \"severity\": {\n \"$id\": \"#root/severity\",\n \"title\": \"Severity\",\n \"type\": \"string\",\n \"default\": \"Medium\",\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"Low\",\n \"title\": \"Low\",\n \"icon\": \"mdi-chevron-up\"\n },\n {\n \"const\": \"Medium\",\n \"title\": \"Medium\",\n \"icon\": \"mdi-chevron-double-up\"\n },\n {\n \"const\": \"High\",\n \"title\": \"High\",\n \"icon\": \"mdi-chevron-triple-up\"\n }\n ]\n },\n \"tlp\": {\n \"$id\": \"#root/tlp\",\n \"title\": \"TLP\",\n \"type\": \"string\",\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"White\",\n \"title\": \"White\",\n \"icon\": \"mdi-alpha-w\"\n },\n {\n \"const\": \"Green\",\n \"title\": \"Green\",\n \"icon\": \"mdi-alpha-g\"\n },\n {\n \"const\": \"Amber\",\n \"title\": \"Amber\",\n \"icon\": \"mdi-alpha-a\"\n },\n {\n \"const\": \"Red\",\n \"title\": \"Red\",\n \"icon\": \"mdi-alpha-r\"\n }\n ]\n },\n \"description\": {\n \"$id\": \"#root/description\",\n \"title\": \"Description\",\n \"type\": \"string\",\n \"x-display\": \"textarea\",\n \"x-class\": \"pr-2\"\n }\n }\n}\n"
- security: [ { roles: [ "template:read" ] } ]
- put:
- tags: [ "templates" ]
- summary: "Update an existing template"
- operationId: "updateTemplate"
- parameters:
- - { name: "id", in: "path", description: "Template ID", required: true, type: string, x-example: "default" }
- - { name: "template", in: "body", description: "Template object that needs to be added", required: true, schema: { $ref: "#/definitions/TicketTemplateForm" }, x-example: { name: "My Template", schema: "{\n \"definitions\": {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://example.com/object1618746510.json\",\n \"title\": \"Event\",\n \"type\": \"object\",\n \"required\": [\n \"severity\",\n \"description\",\n \"tlp\"\n ],\n \"properties\": {\n \"severity\": {\n \"$id\": \"#root/severity\",\n \"title\": \"Severity\",\n \"type\": \"string\",\n \"default\": \"Medium\",\n \"nx-enum\": [\n \"Low\",\n \"Medium\",\n \"High\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"Low\",\n \"title\": \"Low\",\n \"icon\": \"mdi-chevron-up\"\n },\n {\n \"const\": \"Medium\",\n \"title\": \"Medium\",\n \"icon\": \"mdi-chevron-double-up\"\n },\n {\n \"const\": \"High\",\n \"title\": \"High\",\n \"icon\": \"mdi-chevron-triple-up\"\n }\n ]\n },\n \"tlp\": {\n \"$id\": \"#root/tlp\",\n \"title\": \"TLP\",\n \"type\": \"string\",\n \"nx-enum\": [\n \"White\",\n \"Green\",\n \"Amber\",\n \"Red\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"White\",\n \"title\": \"White\",\n \"icon\": \"mdi-alpha-w\"\n },\n {\n \"const\": \"Green\",\n \"title\": \"Green\",\n \"icon\": \"mdi-alpha-g\"\n },\n {\n \"const\": \"Amber\",\n \"title\": \"Amber\",\n \"icon\": \"mdi-alpha-a\"\n },\n {\n \"const\": \"Red\",\n \"title\": \"Red\",\n \"icon\": \"mdi-alpha-r\"\n }\n ]\n },\n \"description\": {\n \"$id\": \"#root/description\",\n \"title\": \"Description\",\n \"type\": \"string\",\n \"x-display\": \"textarea\",\n \"x-class\": \"pr-2\"\n }\n }\n}\n" } }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/TicketTemplateResponse" }
- examples:
- test:
- id: default
- name: "My Template"
- schema: "{\n \"definitions\": {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://example.com/object1618746510.json\",\n \"title\": \"Event\",\n \"type\": \"object\",\n \"required\": [\n \"severity\",\n \"description\",\n \"tlp\"\n ],\n \"properties\": {\n \"severity\": {\n \"$id\": \"#root/severity\",\n \"title\": \"Severity\",\n \"type\": \"string\",\n \"default\": \"Medium\",\n \"nx-enum\": [\n \"Low\",\n \"Medium\",\n \"High\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"Low\",\n \"title\": \"Low\",\n \"icon\": \"mdi-chevron-up\"\n },\n {\n \"const\": \"Medium\",\n \"title\": \"Medium\",\n \"icon\": \"mdi-chevron-double-up\"\n },\n {\n \"const\": \"High\",\n \"title\": \"High\",\n \"icon\": \"mdi-chevron-triple-up\"\n }\n ]\n },\n \"tlp\": {\n \"$id\": \"#root/tlp\",\n \"title\": \"TLP\",\n \"type\": \"string\",\n \"nx-enum\": [\n \"White\",\n \"Green\",\n \"Amber\",\n \"Red\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"White\",\n \"title\": \"White\",\n \"icon\": \"mdi-alpha-w\"\n },\n {\n \"const\": \"Green\",\n \"title\": \"Green\",\n \"icon\": \"mdi-alpha-g\"\n },\n {\n \"const\": \"Amber\",\n \"title\": \"Amber\",\n \"icon\": \"mdi-alpha-a\"\n },\n {\n \"const\": \"Red\",\n \"title\": \"Red\",\n \"icon\": \"mdi-alpha-r\"\n }\n ]\n },\n \"description\": {\n \"$id\": \"#root/description\",\n \"title\": \"Description\",\n \"type\": \"string\",\n \"x-display\": \"textarea\",\n \"x-class\": \"pr-2\"\n }\n }\n}\n"
-
- security: [ { roles: [ "template:write" ] } ]
- delete:
- tags: [ "templates" ]
- summary: "Delete a template"
- operationId: "deleteTemplate"
- parameters:
- - { name: "id", in: "path", description: "Template ID", required: true, type: string, x-example: "default" }
- responses:
- "204": { description: "successful operation" }
- security: [ { roles: [ "template:write" ] } ]
-
-definitions:
- TicketTemplateForm:
- type: object
- required: [ name, schema ]
- properties:
- id: { type: string }
- name: { type: string }
- schema: { type: string }
-
- TicketTemplate:
- type: object
- required: [ name, schema ]
- properties:
- name: { type: string }
- schema: { type: string }
-
- TicketTemplateResponse:
- type: object
- required: [ id, name, schema ]
- properties:
- id: { type: string }
- name: { type: string }
- schema: { type: string }
diff --git a/definition/tickets.yaml b/definition/tickets.yaml
deleted file mode 100644
index 8a99bd1..0000000
--- a/definition/tickets.yaml
+++ /dev/null
@@ -1,1117 +0,0 @@
-swagger: "2.0"
-info: { version: "", title: "" }
-
-paths:
- /tickets:
- get:
- tags: [ "tickets" ]
- summary: "List tickets"
- operationId: "listTickets"
- parameters:
- - { name: "type", in: "query", description: "Ticket Type", type: string }
- - { name: "offset", in: "query", description: "Offset of the list", type: integer, default: 0 }
- - { name: "count", in: "query", description: "Number of tickets", type: integer, maximum: 100, default: 25 }
- - { name: "sort", in: "query", description: "Sort columns", type: array, items: { type: string } } #, example: [ "name", "id" ]
- - { name: "desc", in: "query", description: "Sort descending", type: array, items: { type: boolean } } #, example: [ false, true ]
- - { name: "query", in: "query", description: "Search query", type: string }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: '#/definitions/TicketList' }
- examples:
- test:
- count: 3
- tickets:
- - id: 8123
- created: "2021-10-02T16:04:59.078206Z"
- modified: "2021-10-02T16:04:59.078206Z"
- name: "live zebra"
- owner: "demo"
- playbooks:
- phishing:
- name: "Phishing"
- tasks:
- "block-iocs": { created: "2021-12-12T12:12:12.000000012Z", done: false, name: "Block IOCs", type: "task" }
- "block-sender": { created: "2021-12-12T12:12:12.000000012Z", done: false, name: "Block sender","next": { "extract-iocs": "" }, type: "task" }
- "board": { created: "2021-12-12T12:12:12.000000012Z", done: false, name: "Board Involvement?","next": { "escalate": "boardInvolved == true","mail-available": "boardInvolved == false" },"schema": { "properties": { "boardInvolved": { "default": false, "title": "A board member is involved.", type: "boolean" } }, "required": [ "boardInvolved" ], "title": "Board Involvement?", type: "object" }, type: "input" }
- "escalate": { created: "2021-12-12T12:12:12.000000012Z", done: false, name: "Escalate to CISO", type: "task" }
- "extract-iocs": { created: "2021-12-12T12:12:12.000000012Z", done: false, name: "Extract IOCs", "next": { "block-iocs": "" },"schema": { "properties": { "iocs": { "items": { type: "string" },"title": "IOCs", type: "array" } }, "title": "Extract IOCs", type: "object" }, type: "input" }
- "mail-available": { created: "2021-12-12T12:12:12.000000012Z", done: false, name: "Mail available","next": { "block-sender": "schemaKey == 'yes'", "extract-iocs": "schemaKey == 'yes'", "search-email-gateway": "schemaKey == 'no'" },"schema": { "oneOf": [ { "properties": { "mail": { "title": "Mail", type: "string", "x-display": "textarea" }, "schemaKey": { "const": "yes", type: "string" } },"required": [ "mail" ], "title": "Yes" },{ "properties": { "schemaKey": { "const": "no", type: "string" } },"title": "No" } ],"title": "Mail available", type: "object" }, type: "input" }
- "search-email-gateway": { created: "2021-12-12T12:12:12.000000012Z", done: false, name: "Search email gateway","next": { "extract-iocs": "" }, type: "task" }
- references:
- - { href: "https://www.leadmaximize.net/e-services/back-end", name: "performance" }
- - { href: "http://www.corporateinteractive.name/rich", name: "autumn" }
- - { href: "https://www.corporateintuitive.org/intuitive/platforms/integrate", name: "suggest" }
- "schema": "{\n \"definitions\": {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://example.com/object1618746510.json\",\n \"title\": \"Event\",\n \"type\": \"object\",\n \"required\": [\n \"severity\",\n \"description\",\n \"tlp\"\n ],\n \"properties\": {\n \"severity\": {\n \"$id\": \"#root/severity\",\n \"title\": \"Severity\",\n \"type\": \"string\",\n \"default\": \"Medium\",\n \"nx-enum\": [\n \"Low\",\n \"Medium\",\n \"High\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"Low\",\n \"title\": \"Low\",\n \"icon\": \"mdi-chevron-up\"\n },\n {\n \"const\": \"Medium\",\n \"title\": \"Medium\",\n \"icon\": \"mdi-chevron-double-up\"\n },\n {\n \"const\": \"High\",\n \"title\": \"High\",\n \"icon\": \"mdi-chevron-triple-up\"\n }\n ]\n },\n \"tlp\": {\n \"$id\": \"#root/tlp\",\n \"title\": \"TLP\",\n \"type\": \"string\",\n \"nx-enum\": [\n \"White\",\n \"Green\",\n \"Amber\",\n \"Red\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"White\",\n \"title\": \"White\",\n \"icon\": \"mdi-alpha-w\"\n },\n {\n \"const\": \"Green\",\n \"title\": \"Green\",\n \"icon\": \"mdi-alpha-g\"\n },\n {\n \"const\": \"Amber\",\n \"title\": \"Amber\",\n \"icon\": \"mdi-alpha-a\"\n },\n {\n \"const\": \"Red\",\n \"title\": \"Red\",\n \"icon\": \"mdi-alpha-r\"\n }\n ]\n },\n \"description\": {\n \"$id\": \"#root/description\",\n \"title\": \"Description\",\n \"type\": \"string\",\n \"x-display\": \"textarea\",\n \"x-class\": \"pr-2\"\n }\n }\n}\n"
- status: "closed"
- type: "incident"
- artifacts:
- - { name: "94d5cab6f5fe3422a447ab15436e7a672bc0c09a", status: "unknown" }
- - { name: "http://www.customerviral.io/scalable/vertical/killer", status: "clean" }
- - { name: "leadreintermediate.io", status: "malicious" }
- - { id: 8125, created: "2021-10-02T16:04:59.078186Z", modified: "2021-10-02T16:04:59.078186Z",name: "phishing from selenafadel@von.com detected", owner: "demo", references: [ { href: "https://www.seniorleading-edge.name/users/efficient", name: "recovery" },{ href: "http://www.dynamicseamless.com/clicks-and-mortar", name: "force" },{ href: "http://www.leadscalable.biz/envisioneer", name: "fund" } ],"schema": "{}", status: "closed", type: "alert" }
- - { id: 8126, created: "2021-10-02T16:04:59.078186Z", modified: "2021-10-02T16:04:59.078186Z", name: "Surfaceintroduce virus detected", owner: "demo", references: [ { href: "http://www.centralworld-class.io/synthesize", name: "university" },{ href: "https://www.futurevirtual.org/supply-chains/markets/sticky/iterate", name: "goal" },{ href: "http://www.chiefsyndicate.io/action-items", name: "unemployment" } ],"schema": "{}", status: "closed", type: "alert" }
- security: [ { roles: [ "ticket:read" ] } ]
- post:
- tags: [ "tickets" ]
- summary: "Create a new ticket"
- operationId: "createTicket"
- parameters:
- - { name: "ticket", in: "body", description: "New ticket", required: true, schema: { $ref: "#/definitions/TicketForm" }, x-example: { id: 123, owner: bob, name: "Wannacry infection", status: "open", type: "incident" } }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/TicketResponse" }
- examples:
- test:
- id: 123
- name: "Wannacry infection"
- type: "incident"
- status: "open"
- created: "2021-12-12T12:12:12.000000012Z"
- modified: "2021-12-12T12:12:12.000000012Z"
- owner: "bob"
- schema: "{}"
- security: [ { roles: [ "ticket:write" ] } ]
-
- /tickets/batch:
- post:
- tags: [ "tickets" ]
- summary: "Create a new tickets in batch"
- operationId: "createTicketBatch"
- parameters:
- - { name: "ticket", in: "body", description: "New ticket", required: true, schema: { $ref: "#/definitions/TicketFormArray" }, x-example: [ { id: 123, owner: bob, name: "Wannacry infection", status: "open", type: "incident" } ] }
- responses:
- "204": { description: "successful operation" }
- security: [ { roles: [ "ticket:write" ] } ]
-
- /tickets/{id}:
- get:
- tags: [ "tickets" ]
- summary: "Get a single ticket"
- operationId: "getTicket"
- parameters:
- - { name: "id", in: "path", description: "Ticket ID", required: true, type: integer, format: "int64", x-example: 8125 }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/TicketWithTickets" }
- examples:
- test:
- id: 8125
- created: "2021-10-02T16:04:59.078186Z"
- modified: "2021-10-02T16:04:59.078186Z"
- name: "phishing from selenafadel@von.com detected"
- owner: "demo"
- references:
- - href: "https://www.seniorleading-edge.name/users/efficient"
- name: "recovery"
- - href: "http://www.dynamicseamless.com/clicks-and-mortar"
- name: "force"
- - href: "http://www.leadscalable.biz/envisioneer"
- name: "fund"
- schema: "{}"
- status: "closed"
- type: "alert"
- tickets:
- - { id: 8126, created: "2021-10-02T16:04:59.078186Z", modified: "2021-10-02T16:04:59.078186Z", name: "Surfaceintroduce virus detected", owner: "demo", references: [ { href: "http://www.centralworld-class.io/synthesize", name: "university" },{ href: "https://www.futurevirtual.org/supply-chains/markets/sticky/iterate", name: "goal" },{ href: "http://www.chiefsyndicate.io/action-items", name: "unemployment" } ],"schema": "{}", status: "closed", type: "alert" }
- security: [ { roles: [ "ticket:read" ] } ]
- put:
- tags: [ "tickets" ]
- summary: "Update an existing ticket"
- operationId: "updateTicket"
- parameters:
- - { name: "id", in: "path", description: "Ticket ID", required: true, type: integer, format: "int64", x-example: 8125 }
- - { name: "ticket", in: "body", description: "Updated ticket", required: true, schema: { $ref: "#/definitions/Ticket" }, x-example: { "created": "2021-12-12T12:12:12.000000012Z",modified: "2021-12-12T12:12:12.000000012Z", name: "phishing from selenafadel@von.org detected", owner: "demo", references: [ { href: "https://www.seniorleading-edge.name/users/efficient", name: "recovery" },{ href: "http://www.dynamicseamless.com/clicks-and-mortar", name: "force" },{ href: "http://www.leadscalable.biz/envisioneer", name: "fund" } ], schema: "{}", status: "closed", type: "alert" } }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/TicketWithTickets" }
- examples:
- test:
- id: 8125
- created: "2021-12-12T12:12:12.000000012Z"
- modified: "2021-12-12T12:12:12.000000012Z"
- name: "phishing from selenafadel@von.org detected"
- owner: "demo"
- references:
- - href: "https://www.seniorleading-edge.name/users/efficient"
- name: "recovery"
- - href: "http://www.dynamicseamless.com/clicks-and-mortar"
- name: "force"
- - href: "http://www.leadscalable.biz/envisioneer"
- name: "fund"
- schema: "{}"
- status: "closed"
- type: "alert"
- tickets:
- - { id: 8126, created: "2021-10-02T16:04:59.078186Z", modified: "2021-10-02T16:04:59.078186Z", name: "Surfaceintroduce virus detected", owner: "demo", references: [ { href: "http://www.centralworld-class.io/synthesize", name: "university" },{ href: "https://www.futurevirtual.org/supply-chains/markets/sticky/iterate", name: "goal" },{ href: "http://www.chiefsyndicate.io/action-items", name: "unemployment" } ],"schema": "{}", status: "closed", type: "alert" }
- security: [ { roles: [ "ticket:write" ] } ]
- delete:
- tags: [ "tickets" ]
- summary: "Delete an ticket"
- operationId: "deleteTicket"
- parameters:
- - { name: "id", in: "path", description: "Ticket ID", required: true, type: integer, format: "int64", x-example: 8125 }
- responses:
- "204": { description: "successful operation" }
- security: [ { roles: [ "ticket:delete" ] } ]
-
- /tickets/{id}/tickets:
- patch:
- tags: [ "tickets" ]
- summary: "Link an ticket to an ticket"
- operationId: "linkTicket"
- parameters:
- - { name: "id", in: "path", description: "Ticket ID", required: true, type: integer, format: "int64", x-example: 8126 }
- - { name: "linkedID", in: "body", description: "Added ticket ID", required: true, schema: { type: integer, format: "int64" }, x-example: 8123 }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/TicketWithTickets" }
- examples:
- test:
- id: 8126
- created: "2021-10-02T16:04:59.078186Z"
- modified: "2021-10-02T16:04:59.078186Z"
- name: "Surfaceintroduce virus detected"
- owner: "demo"
- references:
- - { "href": "http://www.centralworld-class.io/synthesize", "name": "university" }
- - { "href": "https://www.futurevirtual.org/supply-chains/markets/sticky/iterate", "name": "goal" }
- - { "href": "http://www.chiefsyndicate.io/action-items", "name": "unemployment" }
- schema: "{}"
- status: "closed"
- type: "alert"
- tickets:
- - id: 8123
- created: "2021-10-02T16:04:59.078206Z"
- modified: "2021-10-02T16:04:59.078206Z"
- name: "live zebra"
- owner: "demo"
- playbooks:
- phishing:
- name: "Phishing"
- tasks:
- "block-iocs": { created: "2021-12-12T12:12:12.000000012Z", done: false, name: "Block IOCs", type: "task" }
- "block-sender": { created: "2021-12-12T12:12:12.000000012Z", done: false, name: "Block sender","next": { "extract-iocs": "" }, type: "task" }
- "board": { created: "2021-12-12T12:12:12.000000012Z", done: false, name: "Board Involvement?","next": { "escalate": "boardInvolved == true","mail-available": "boardInvolved == false" },"schema": { "properties": { "boardInvolved": { "default": false, "title": "A board member is involved.", type: "boolean" } }, "required": [ "boardInvolved" ], "title": "Board Involvement?", type: "object" }, type: "input" }
- "escalate": { created: "2021-12-12T12:12:12.000000012Z", done: false, name: "Escalate to CISO", type: "task" }
- "extract-iocs": { created: "2021-12-12T12:12:12.000000012Z", done: false, name: "Extract IOCs", "next": { "block-iocs": "" },"schema": { "properties": { "iocs": { "items": { type: "string" },"title": "IOCs", type: "array" } }, "title": "Extract IOCs", type: "object" }, type: "input" }
- "mail-available": { created: "2021-12-12T12:12:12.000000012Z", done: false, name: "Mail available","next": { "block-sender": "schemaKey == 'yes'", "extract-iocs": "schemaKey == 'yes'", "search-email-gateway": "schemaKey == 'no'" },"schema": { "oneOf": [ { "properties": { "mail": { "title": "Mail", type: "string", "x-display": "textarea" }, "schemaKey": { "const": "yes", type: "string" } },"required": [ "mail" ], "title": "Yes" },{ "properties": { "schemaKey": { "const": "no", type: "string" } },"title": "No" } ],"title": "Mail available", type: "object" }, type: "input" }
- "search-email-gateway": { created: "2021-12-12T12:12:12.000000012Z", done: false, name: "Search email gateway","next": { "extract-iocs": "" }, type: "task" }
- references:
- - { href: "https://www.leadmaximize.net/e-services/back-end", name: "performance" }
- - { href: "http://www.corporateinteractive.name/rich", name: "autumn" }
- - { href: "https://www.corporateintuitive.org/intuitive/platforms/integrate", name: "suggest" }
- "schema": "{\n \"definitions\": {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://example.com/object1618746510.json\",\n \"title\": \"Event\",\n \"type\": \"object\",\n \"required\": [\n \"severity\",\n \"description\",\n \"tlp\"\n ],\n \"properties\": {\n \"severity\": {\n \"$id\": \"#root/severity\",\n \"title\": \"Severity\",\n \"type\": \"string\",\n \"default\": \"Medium\",\n \"nx-enum\": [\n \"Low\",\n \"Medium\",\n \"High\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"Low\",\n \"title\": \"Low\",\n \"icon\": \"mdi-chevron-up\"\n },\n {\n \"const\": \"Medium\",\n \"title\": \"Medium\",\n \"icon\": \"mdi-chevron-double-up\"\n },\n {\n \"const\": \"High\",\n \"title\": \"High\",\n \"icon\": \"mdi-chevron-triple-up\"\n }\n ]\n },\n \"tlp\": {\n \"$id\": \"#root/tlp\",\n \"title\": \"TLP\",\n \"type\": \"string\",\n \"nx-enum\": [\n \"White\",\n \"Green\",\n \"Amber\",\n \"Red\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"White\",\n \"title\": \"White\",\n \"icon\": \"mdi-alpha-w\"\n },\n {\n \"const\": \"Green\",\n \"title\": \"Green\",\n \"icon\": \"mdi-alpha-g\"\n },\n {\n \"const\": \"Amber\",\n \"title\": \"Amber\",\n \"icon\": \"mdi-alpha-a\"\n },\n {\n \"const\": \"Red\",\n \"title\": \"Red\",\n \"icon\": \"mdi-alpha-r\"\n }\n ]\n },\n \"description\": {\n \"$id\": \"#root/description\",\n \"title\": \"Description\",\n \"type\": \"string\",\n \"x-display\": \"textarea\",\n \"x-class\": \"pr-2\"\n }\n }\n}\n"
- status: "closed"
- type: "incident"
- artifacts:
- - { name: "94d5cab6f5fe3422a447ab15436e7a672bc0c09a", status: "unknown" }
- - { name: "http://www.customerviral.io/scalable/vertical/killer", status: "clean" }
- - { name: "leadreintermediate.io", status: "malicious" }
- - id: 8125
- created: "2021-10-02T16:04:59.078186Z"
- modified: "2021-10-02T16:04:59.078186Z"
- name: "phishing from selenafadel@von.com detected"
- owner: "demo"
- references:
- - { href: "https://www.seniorleading-edge.name/users/efficient", name: "recovery" }
- - { href: "http://www.dynamicseamless.com/clicks-and-mortar", name: "force" }
- - { href: "http://www.leadscalable.biz/envisioneer", name: "fund" }
- "schema": "{}"
- status: "closed"
- type: "alert"
- security: [ { roles: [ "ticket:write" ] } ]
- delete:
- tags: [ "tickets" ]
- summary: "Unlink an ticket to an ticket"
- operationId: "unlinkTicket"
- parameters:
- - { name: "id", in: "path", description: "Ticket ID", required: true, type: integer, format: "int64", x-example: 8126 }
- - { name: "linkedID", in: "body", description: "Added ticket ID", required: true, schema: { type: integer, format: "int64" }, x-example: 8125 }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/TicketWithTickets" }
- examples:
- test:
- id: 8126
- created: "2021-10-02T16:04:59.078186Z"
- modified: "2021-10-02T16:04:59.078186Z"
- name: "Surfaceintroduce virus detected"
- owner: "demo"
- references:
- - { href: "http://www.centralworld-class.io/synthesize", name: "university" }
- - { href: "https://www.futurevirtual.org/supply-chains/markets/sticky/iterate", name: "goal" }
- - { href: "http://www.chiefsyndicate.io/action-items", name: "unemployment" }
- "schema": "{}"
- status: "closed"
- type: "alert"
- security: [ { roles: [ "ticket:write" ] } ]
-
- /tickets/{id}/comments:
- post:
- tags: [ "tickets" ]
- summary: "Add ticket comment"
- operationId: "addComment"
- parameters:
- - { name: "id", in: "path", description: "Ticket ID", required: true, type: integer, format: "int64", x-example: 8125 }
- - { name: "comment", in: "body", description: "Ticket comment", required: true, schema: { $ref: "#/definitions/CommentForm" } , x-example: { message: "My first comment" } }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/TicketWithTickets" }
- examples:
- test:
- id: 8125
- created: "2021-10-02T16:04:59.078186Z"
- modified: "2021-12-12T12:12:12.000000012Z"
- name: "phishing from selenafadel@von.com detected"
- owner: "demo"
- comments:
- - created: "2021-12-12T12:12:12.000000012Z"
- creator: "bob"
- message: "My first comment"
- references:
- - { href: "https://www.seniorleading-edge.name/users/efficient", name: "recovery" }
- - { href: "http://www.dynamicseamless.com/clicks-and-mortar", name: "force" }
- - { href: "http://www.leadscalable.biz/envisioneer", name: "fund" }
- "schema": "{}"
- status: "closed"
- type: "alert"
- tickets:
- - { id: 8126, created: "2021-10-02T16:04:59.078186Z", modified: "2021-10-02T16:04:59.078186Z", name: "Surfaceintroduce virus detected", owner: "demo", references: [ { href: "http://www.centralworld-class.io/synthesize", name: "university" },{ href: "https://www.futurevirtual.org/supply-chains/markets/sticky/iterate", name: "goal" },{ href: "http://www.chiefsyndicate.io/action-items", name: "unemployment" } ],"schema": "{}", status: "closed", type: "alert" }
- security: [ { roles: [ "ticket:write" ] } ]
-
- /tickets/{id}/comments/{commentID}:
- delete:
- tags: [ "tickets" ]
- summary: "Remove an comment from an ticket"
- description: "Comment will be removed from the ticket."
- operationId: "removeComment"
- parameters:
- - { name: "id", in: "path", description: "Ticket ID", required: true, type: integer, format: "int64", x-example: 8123 }
- - { name: "commentID", in: "path", description: "Comment ID to remove", required: true, type: integer, x-example: 0 }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/TicketWithTickets" }
- examples:
- test:
- id: 8123
- created: "2021-10-02T16:04:59.078206Z"
- modified: "2021-12-12T12:12:12.000000012Z"
- name: "live zebra"
- owner: "demo"
- playbooks:
- phishing:
- name: "Phishing"
- tasks:
- "block-iocs": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 6, name: "Block IOCs", type: "task" }
- "block-sender": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 3, name: "Block sender","next": { "extract-iocs": "" }, type: "task" }
- "board": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": true, "order": 0, name: "Board Involvement?","next": { "escalate": "boardInvolved == true","mail-available": "boardInvolved == false" },"schema": { "properties": { "boardInvolved": { "default": false, "title": "A board member is involved.", type: "boolean" } }, "required": [ "boardInvolved" ], "title": "Board Involvement?", type: "object" }, type: "input" }
- "escalate": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 1, name: "Escalate to CISO", type: "task" }
- "extract-iocs": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 5, name: "Extract IOCs", "next": { "block-iocs": "" },"schema": { "properties": { "iocs": { "items": { type: "string" },"title": "IOCs", type: "array" } }, "title": "Extract IOCs", type: "object" }, type: "input" }
- "mail-available": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 2, name: "Mail available","next": { "block-sender": "schemaKey == 'yes'", "extract-iocs": "schemaKey == 'yes'", "search-email-gateway": "schemaKey == 'no'" },"schema": { "oneOf": [ { "properties": { "mail": { "title": "Mail", type: "string", "x-display": "textarea" }, "schemaKey": { "const": "yes", type: "string" } },"required": [ "mail" ], "title": "Yes" },{ "properties": { "schemaKey": { "const": "no", type: "string" } },"title": "No" } ],"title": "Mail available", type: "object" }, type: "input" }
- "search-email-gateway": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 4, name: "Search email gateway","next": { "extract-iocs": "" }, type: "task" }
- references:
- - { href: "https://www.leadmaximize.net/e-services/back-end", name: "performance" }
- - { href: "http://www.corporateinteractive.name/rich", name: "autumn" }
- - { href: "https://www.corporateintuitive.org/intuitive/platforms/integrate", name: "suggest" }
- "schema": "{\n \"definitions\": {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://example.com/object1618746510.json\",\n \"title\": \"Event\",\n \"type\": \"object\",\n \"required\": [\n \"severity\",\n \"description\",\n \"tlp\"\n ],\n \"properties\": {\n \"severity\": {\n \"$id\": \"#root/severity\",\n \"title\": \"Severity\",\n \"type\": \"string\",\n \"default\": \"Medium\",\n \"nx-enum\": [\n \"Low\",\n \"Medium\",\n \"High\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"Low\",\n \"title\": \"Low\",\n \"icon\": \"mdi-chevron-up\"\n },\n {\n \"const\": \"Medium\",\n \"title\": \"Medium\",\n \"icon\": \"mdi-chevron-double-up\"\n },\n {\n \"const\": \"High\",\n \"title\": \"High\",\n \"icon\": \"mdi-chevron-triple-up\"\n }\n ]\n },\n \"tlp\": {\n \"$id\": \"#root/tlp\",\n \"title\": \"TLP\",\n \"type\": \"string\",\n \"nx-enum\": [\n \"White\",\n \"Green\",\n \"Amber\",\n \"Red\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"White\",\n \"title\": \"White\",\n \"icon\": \"mdi-alpha-w\"\n },\n {\n \"const\": \"Green\",\n \"title\": \"Green\",\n \"icon\": \"mdi-alpha-g\"\n },\n {\n \"const\": \"Amber\",\n \"title\": \"Amber\",\n \"icon\": \"mdi-alpha-a\"\n },\n {\n \"const\": \"Red\",\n \"title\": \"Red\",\n \"icon\": \"mdi-alpha-r\"\n }\n ]\n },\n \"description\": {\n \"$id\": \"#root/description\",\n \"title\": \"Description\",\n \"type\": \"string\",\n \"x-display\": \"textarea\",\n \"x-class\": \"pr-2\"\n }\n }\n}\n"
- status: "closed"
- type: "incident"
- artifacts:
- - { name: "94d5cab6f5fe3422a447ab15436e7a672bc0c09a", status: "unknown" }
- - { name: "http://www.customerviral.io/scalable/vertical/killer", status: "clean" }
- - { name: "leadreintermediate.io", status: "malicious" }
- security: [ { roles: [ "ticket:write" ] } ]
-
- /tickets/{id}/references:
- put:
- tags: [ "tickets" ]
- summary: "Set ticket references"
- operationId: "setReferences"
- parameters:
- - { name: "id", in: "path", description: "Ticket ID", required: true, type: integer, format: "int64", x-example: 8125 }
- - { name: "references", in: "body", description: "All ticket references", required: true, schema: { $ref: "#/definitions/ReferenceArray" }, x-example: [ { href: "http://www.leadscalable.biz/envisioneer", name: "fund" } ] }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/TicketWithTickets" }
- examples:
- test:
- id: 8125
- created: "2021-10-02T16:04:59.078186Z"
- modified: "2021-12-12T12:12:12.000000012Z"
- name: "phishing from selenafadel@von.com detected"
- owner: "demo"
- references: [ { href: "http://www.leadscalable.biz/envisioneer", name: "fund" } ]
- "schema": "{}"
- status: "closed"
- type: "alert"
- tickets:
- - { id: 8126, created: "2021-10-02T16:04:59.078186Z", modified: "2021-10-02T16:04:59.078186Z", name: "Surfaceintroduce virus detected", owner: "demo", references: [ { href: "http://www.centralworld-class.io/synthesize", name: "university" },{ href: "https://www.futurevirtual.org/supply-chains/markets/sticky/iterate", name: "goal" },{ href: "http://www.chiefsyndicate.io/action-items", name: "unemployment" } ],"schema": "{}", status: "closed", type: "alert" }
- security: [ { roles: [ "ticket:write" ] } ]
-
- /tickets/{id}/schema:
- put:
- tags: [ "tickets" ]
- summary: "Set ticket schema"
- operationId: "setSchema"
- parameters:
- - { name: "id", in: "path", description: "Ticket ID", required: true, type: integer, format: "int64", x-example: 8125 }
- - { name: "schema", in: "body", description: "New ticket schema", required: true, schema: { type: string }, x-example: "{}" }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/TicketWithTickets" }
- examples:
- test:
- id: 8125
- created: "2021-10-02T16:04:59.078186Z"
- modified: "2021-10-02T16:04:59.078186Z"
- name: "phishing from selenafadel@von.com detected"
- owner: "demo"
- references:
- - { href: "https://www.seniorleading-edge.name/users/efficient", name: "recovery" }
- - { href: "http://www.dynamicseamless.com/clicks-and-mortar", name: "force" }
- - { href: "http://www.leadscalable.biz/envisioneer", name: "fund" }
- "schema": "{}"
- status: "closed"
- type: "alert"
- tickets:
- - { id: 8126, created: "2021-10-02T16:04:59.078186Z", modified: "2021-10-02T16:04:59.078186Z", name: "Surfaceintroduce virus detected", owner: "demo", references: [ { href: "http://www.centralworld-class.io/synthesize", name: "university" },{ href: "https://www.futurevirtual.org/supply-chains/markets/sticky/iterate", name: "goal" },{ href: "http://www.chiefsyndicate.io/action-items", name: "unemployment" } ],"schema": "{}", status: "closed", type: "alert" }
- security: [ { roles: [ "ticket:write" ] } ]
-
- /tickets/{id}/playbooks:
- post:
- tags: [ "tickets" ]
- summary: "Add a new ticket playbook"
- operationId: "addTicketPlaybook"
- parameters:
- - { name: "id", in: "path", description: "Ticket ID", required: true, type: integer, format: "int64", x-example: 8125 }
- - { name: "playbook", in: "body", description: "Ticket playbook object that needs to be added", required: true, schema: { $ref: "#/definitions/PlaybookTemplateForm" }, x-example: { yaml: "name: Simple\ntasks:\n input:\n name: Upload malware if possible\n type: input\n schema:\n title: Malware\n type: object\n properties:\n malware:\n type: string\n title: Select malware\n default: \"\"\n next:\n hash: \"malware != ''\"\n\n hash:\n name: Hash the malware\n type: automation\n automation: hash.sha1\n payload:\n default: \"playbook.tasks['input'].data['malware']\"\n next:\n escalate:\n\n escalate:\n name: Escalate to malware team\n type: task\n" } }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/TicketWithTickets" }
- examples:
- test:
- id: 8125
- name: phishing from selenafadel@von.com detected
- owner: demo
- type: "alert"
- status: "closed"
- created: "2021-10-02T16:04:59.078186Z"
- modified: "2021-12-12T12:12:12.000000012Z"
- schema: "{}"
- tickets:
- - { id: 8126, created: "2021-10-02T16:04:59.078186Z", modified: "2021-10-02T16:04:59.078186Z", name: "Surfaceintroduce virus detected", owner: "demo", references: [ { href: "http://www.centralworld-class.io/synthesize", name: "university" },{ href: "https://www.futurevirtual.org/supply-chains/markets/sticky/iterate", name: "goal" },{ href: "http://www.chiefsyndicate.io/action-items", name: "unemployment" } ],"schema": "{}", status: "closed", type: "alert" }
- references:
- - { href: "https://www.seniorleading-edge.name/users/efficient", name: recovery }
- - { href: "http://www.dynamicseamless.com/clicks-and-mortar", name: force }
- - { href: "http://www.leadscalable.biz/envisioneer", name: fund }
- playbooks:
- simple:
- name: Simple
- tasks:
- input:
- active: true
- done: false
- created: "2021-12-12T12:12:12.000000012Z"
- order: 0
- name: Upload malware if possible
- type: input
- schema:
- title: Malware
- type: object
- properties:
- malware:
- type: string
- title: Select malware
- default: ""
- next:
- hash: "malware != ''"
-
- hash:
- active: false
- done: false
- created: "2021-12-12T12:12:12.000000012Z"
- order: 1
- name: Hash the malware
- type: automation
- automation: hash.sha1
- payload:
- default: "playbook.tasks['input'].data['malware']"
- next:
- escalate: ""
-
- escalate:
- active: false
- done: false
- created: "2021-12-12T12:12:12.000000012Z"
- order: 2
- name: Escalate to malware team
- type: task
- security: [ { roles: [ "ticket:write" ] } ]
-
- /tickets/{id}/playbooks/{playbookID}:
- delete:
- tags: [ "tickets" ]
- summary: "Remove an ticket playbook"
- operationId: "removeTicketPlaybook"
- parameters:
- - { name: "id", in: "path", description: "Ticket ID", required: true, type: integer, format: "int64", x-example: 8123 }
- - { name: "playbookID", in: "path", description: "Playbook ID", required: true, type: string, x-example: "phishing" }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/TicketWithTickets" }
- examples:
- test:
- id: 8123
- name: "live zebra"
- type: "incident"
- status: "closed"
- created: "2021-10-02T16:04:59.078206Z"
- modified: "2021-12-12T12:12:12.000000012Z"
- owner: "demo"
- references:
- - { href: "https://www.leadmaximize.net/e-services/back-end", name: performance }
- - { href: "http://www.corporateinteractive.name/rich", name: autumn }
- - { href: "https://www.corporateintuitive.org/intuitive/platforms/integrate", name: suggest }
- schema: |
- {
- "definitions": {},
- "$schema": "http://json-schema.org/draft-07/schema#",
- "$id": "https://example.com/object1618746510.json",
- "title": "Event",
- "type": "object",
- "required": [
- "severity",
- "description",
- "tlp"
- ],
- "properties": {
- "severity": {
- "$id": "#root/severity",
- "title": "Severity",
- "type": "string",
- "default": "Medium",
- "nx-enum": [
- "Low",
- "Medium",
- "High"
- ],
- "x-cols": 6,
- "x-class": "pr-2",
- "x-display": "icon",
- "x-itemIcon": "icon",
- "oneOf": [
- {
- "const": "Low",
- "title": "Low",
- "icon": "mdi-chevron-up"
- },
- {
- "const": "Medium",
- "title": "Medium",
- "icon": "mdi-chevron-double-up"
- },
- {
- "const": "High",
- "title": "High",
- "icon": "mdi-chevron-triple-up"
- }
- ]
- },
- "tlp": {
- "$id": "#root/tlp",
- "title": "TLP",
- "type": "string",
- "nx-enum": [
- "White",
- "Green",
- "Amber",
- "Red"
- ],
- "x-cols": 6,
- "x-class": "pr-2",
- "x-display": "icon",
- "x-itemIcon": "icon",
- "oneOf": [
- {
- "const": "White",
- "title": "White",
- "icon": "mdi-alpha-w"
- },
- {
- "const": "Green",
- "title": "Green",
- "icon": "mdi-alpha-g"
- },
- {
- "const": "Amber",
- "title": "Amber",
- "icon": "mdi-alpha-a"
- },
- {
- "const": "Red",
- "title": "Red",
- "icon": "mdi-alpha-r"
- }
- ]
- },
- "description": {
- "$id": "#root/description",
- "title": "Description",
- "type": "string",
- "x-display": "textarea",
- "x-class": "pr-2"
- }
- }
- }
- artifacts:
- - { name: "94d5cab6f5fe3422a447ab15436e7a672bc0c09a", status: "unknown" }
- - { name: "http://www.customerviral.io/scalable/vertical/killer", status: "clean" }
- - { name: "leadreintermediate.io", status: "malicious" }
- security: [ { roles: [ "ticket:write" ] } ]
-
- /tickets/{id}/playbooks/{playbookID}/task/{taskID}:
- put:
- tags: [ "tickets" ]
- summary: "Set a ticket playbook task data"
- operationId: "setTaskData"
- parameters:
- - { name: "id", in: "path", description: "Ticket ID", required: true, type: integer, format: "int64", x-example: 8123 }
- - { name: "playbookID", in: "path", description: "Playbook ID", required: true, type: string, x-example: "phishing" }
- - { name: "taskID", in: "path", description: "Task ID", required: true, type: string, x-example: "board" }
- - { name: "data", in: "body", description: "Task data", required: true, schema: { type: object }, x-example: { boardInvolved: true } }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/TicketWithTickets" }
- examples:
- test:
- id: 8123
- created: "2021-10-02T16:04:59.078206Z"
- modified: "2021-12-12T12:12:12.000000012Z"
- name: "live zebra"
- owner: "demo"
- playbooks:
- phishing:
- name: "Phishing"
- tasks:
- "block-iocs": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 6, name: "Block IOCs", type: "task" }
- "block-sender": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 3, name: "Block sender","next": { "extract-iocs": "" }, type: "task" }
- "board": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": true, "order": 0, name: "Board Involvement?","next": { "escalate": "boardInvolved == true","mail-available": "boardInvolved == false" },"schema": { "properties": { "boardInvolved": { "default": false, "title": "A board member is involved.", type: "boolean" } }, "required": [ "boardInvolved" ], "title": "Board Involvement?", type: "object" }, type: "input", data: { boardInvolved: true } }
- "escalate": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 1, name: "Escalate to CISO", type: "task" }
- "extract-iocs": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 5, name: "Extract IOCs", "next": { "block-iocs": "" },"schema": { "properties": { "iocs": { "items": { type: "string" },"title": "IOCs", type: "array" } }, "title": "Extract IOCs", type: "object" }, type: "input" }
- "mail-available": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 2, name: "Mail available","next": { "block-sender": "schemaKey == 'yes'", "extract-iocs": "schemaKey == 'yes'", "search-email-gateway": "schemaKey == 'no'" },"schema": { "oneOf": [ { "properties": { "mail": { "title": "Mail", type: "string", "x-display": "textarea" }, "schemaKey": { "const": "yes", type: "string" } },"required": [ "mail" ], "title": "Yes" },{ "properties": { "schemaKey": { "const": "no", type: "string" } },"title": "No" } ],"title": "Mail available", type: "object" }, type: "input" }
- "search-email-gateway": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 4, name: "Search email gateway","next": { "extract-iocs": "" }, type: "task" }
- references:
- - { href: "https://www.leadmaximize.net/e-services/back-end", name: "performance" }
- - { href: "http://www.corporateinteractive.name/rich", name: "autumn" }
- - { href: "https://www.corporateintuitive.org/intuitive/platforms/integrate", name: "suggest" }
- "schema": "{\n \"definitions\": {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://example.com/object1618746510.json\",\n \"title\": \"Event\",\n \"type\": \"object\",\n \"required\": [\n \"severity\",\n \"description\",\n \"tlp\"\n ],\n \"properties\": {\n \"severity\": {\n \"$id\": \"#root/severity\",\n \"title\": \"Severity\",\n \"type\": \"string\",\n \"default\": \"Medium\",\n \"nx-enum\": [\n \"Low\",\n \"Medium\",\n \"High\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"Low\",\n \"title\": \"Low\",\n \"icon\": \"mdi-chevron-up\"\n },\n {\n \"const\": \"Medium\",\n \"title\": \"Medium\",\n \"icon\": \"mdi-chevron-double-up\"\n },\n {\n \"const\": \"High\",\n \"title\": \"High\",\n \"icon\": \"mdi-chevron-triple-up\"\n }\n ]\n },\n \"tlp\": {\n \"$id\": \"#root/tlp\",\n \"title\": \"TLP\",\n \"type\": \"string\",\n \"nx-enum\": [\n \"White\",\n \"Green\",\n \"Amber\",\n \"Red\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"White\",\n \"title\": \"White\",\n \"icon\": \"mdi-alpha-w\"\n },\n {\n \"const\": \"Green\",\n \"title\": \"Green\",\n \"icon\": \"mdi-alpha-g\"\n },\n {\n \"const\": \"Amber\",\n \"title\": \"Amber\",\n \"icon\": \"mdi-alpha-a\"\n },\n {\n \"const\": \"Red\",\n \"title\": \"Red\",\n \"icon\": \"mdi-alpha-r\"\n }\n ]\n },\n \"description\": {\n \"$id\": \"#root/description\",\n \"title\": \"Description\",\n \"type\": \"string\",\n \"x-display\": \"textarea\",\n \"x-class\": \"pr-2\"\n }\n }\n}\n"
- status: "closed"
- type: "incident"
- artifacts:
- - { name: "94d5cab6f5fe3422a447ab15436e7a672bc0c09a", status: "unknown" }
- - { name: "http://www.customerviral.io/scalable/vertical/killer", status: "clean" }
- - { name: "leadreintermediate.io", status: "malicious" }
- security: [ { roles: [ "ticket:write" ] } ]
-
- /tickets/{id}/playbooks/{playbookID}/task/{taskID}/owner:
- put:
- tags: [ "tickets" ]
- summary: "Set a ticket playbook task owner"
- operationId: "setTaskOwner"
- parameters:
- - { name: "id", in: "path", description: "Ticket ID", required: true, type: integer, format: "int64", x-example: 8123 }
- - { name: "playbookID", in: "path", description: "Playbook ID", required: true, type: string, x-example: "phishing" }
- - { name: "taskID", in: "path", description: "Task ID", required: true, type: string, x-example: "board" }
- - { name: "owner", in: "body", description: "Task owner", required: true, schema: { type: string }, x-example: "eve" }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/TicketWithTickets" }
- examples:
- test:
- id: 8123
- created: "2021-10-02T16:04:59.078206Z"
- modified: "2021-12-12T12:12:12.000000012Z"
- name: "live zebra"
- owner: "demo"
- playbooks:
- phishing:
- name: "Phishing"
- tasks:
- "block-iocs": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 6, name: "Block IOCs", type: "task" }
- "block-sender": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 3, name: "Block sender","next": { "extract-iocs": "" }, type: "task" }
- "board": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": true, "order": 0, name: "Board Involvement?","next": { "escalate": "boardInvolved == true","mail-available": "boardInvolved == false" },"schema": { "properties": { "boardInvolved": { "default": false, "title": "A board member is involved.", type: "boolean" } }, "required": [ "boardInvolved" ], "title": "Board Involvement?", type: "object" }, type: "input", owner: "eve" }
- "escalate": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 1, name: "Escalate to CISO", type: "task" }
- "extract-iocs": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 5, name: "Extract IOCs", "next": { "block-iocs": "" },"schema": { "properties": { "iocs": { "items": { type: "string" },"title": "IOCs", type: "array" } }, "title": "Extract IOCs", type: "object" }, type: "input" }
- "mail-available": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 2, name: "Mail available","next": { "block-sender": "schemaKey == 'yes'", "extract-iocs": "schemaKey == 'yes'", "search-email-gateway": "schemaKey == 'no'" },"schema": { "oneOf": [ { "properties": { "mail": { "title": "Mail", type: "string", "x-display": "textarea" }, "schemaKey": { "const": "yes", type: "string" } },"required": [ "mail" ], "title": "Yes" },{ "properties": { "schemaKey": { "const": "no", type: "string" } },"title": "No" } ],"title": "Mail available", type: "object" }, type: "input" }
- "search-email-gateway": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 4, name: "Search email gateway","next": { "extract-iocs": "" }, type: "task" }
- references:
- - { href: "https://www.leadmaximize.net/e-services/back-end", name: "performance" }
- - { href: "http://www.corporateinteractive.name/rich", name: "autumn" }
- - { href: "https://www.corporateintuitive.org/intuitive/platforms/integrate", name: "suggest" }
- "schema": "{\n \"definitions\": {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://example.com/object1618746510.json\",\n \"title\": \"Event\",\n \"type\": \"object\",\n \"required\": [\n \"severity\",\n \"description\",\n \"tlp\"\n ],\n \"properties\": {\n \"severity\": {\n \"$id\": \"#root/severity\",\n \"title\": \"Severity\",\n \"type\": \"string\",\n \"default\": \"Medium\",\n \"nx-enum\": [\n \"Low\",\n \"Medium\",\n \"High\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"Low\",\n \"title\": \"Low\",\n \"icon\": \"mdi-chevron-up\"\n },\n {\n \"const\": \"Medium\",\n \"title\": \"Medium\",\n \"icon\": \"mdi-chevron-double-up\"\n },\n {\n \"const\": \"High\",\n \"title\": \"High\",\n \"icon\": \"mdi-chevron-triple-up\"\n }\n ]\n },\n \"tlp\": {\n \"$id\": \"#root/tlp\",\n \"title\": \"TLP\",\n \"type\": \"string\",\n \"nx-enum\": [\n \"White\",\n \"Green\",\n \"Amber\",\n \"Red\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"White\",\n \"title\": \"White\",\n \"icon\": \"mdi-alpha-w\"\n },\n {\n \"const\": \"Green\",\n \"title\": \"Green\",\n \"icon\": \"mdi-alpha-g\"\n },\n {\n \"const\": \"Amber\",\n \"title\": \"Amber\",\n \"icon\": \"mdi-alpha-a\"\n },\n {\n \"const\": \"Red\",\n \"title\": \"Red\",\n \"icon\": \"mdi-alpha-r\"\n }\n ]\n },\n \"description\": {\n \"$id\": \"#root/description\",\n \"title\": \"Description\",\n \"type\": \"string\",\n \"x-display\": \"textarea\",\n \"x-class\": \"pr-2\"\n }\n }\n}\n"
- status: "closed"
- type: "incident"
- artifacts:
- - { name: "94d5cab6f5fe3422a447ab15436e7a672bc0c09a", status: "unknown" }
- - { name: "http://www.customerviral.io/scalable/vertical/killer", status: "clean" }
- - { name: "leadreintermediate.io", status: "malicious" }
- security: [ { roles: [ "ticket:write" ] } ]
-
- /tickets/{id}/playbooks/{playbookID}/task/{taskID}/complete:
- put:
- tags: [ "tickets" ]
- summary: "Complete ticket playbook task"
- operationId: "completeTask"
- parameters:
- - { name: "id", in: "path", description: "Ticket ID", required: true, type: integer, format: "int64", x-example: 8123 }
- - { name: "playbookID", in: "path", description: "Playbook ID", required: true, type: string, x-example: "phishing" }
- - { name: "taskID", in: "path", description: "Task ID", required: true, type: string, x-example: "board" }
- - { name: "data", in: "body", description: "Ticket playbook object that needs to be added", required: true, schema: { type: object }, x-example: { boardInvolved: true } }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/TicketWithTickets" }
- examples:
- test:
- id: 8123
- created: "2021-10-02T16:04:59.078206Z"
- modified: "2021-12-12T12:12:12.000000012Z"
- name: "live zebra"
- owner: "demo"
- playbooks:
- phishing:
- name: "Phishing"
- tasks:
- "block-iocs": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 6, name: "Block IOCs", type: "task" }
- "block-sender": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 3, name: "Block sender","next": { "extract-iocs": "" }, type: "task" }
- "board": { created: "2021-12-12T12:12:12.000000012Z", closed: "2021-12-12T12:12:12.000000012Z", done: true, "active": false, "order": 0, name: "Board Involvement?","next": { "escalate": "boardInvolved == true","mail-available": "boardInvolved == false" },"schema": { "properties": { "boardInvolved": { "default": false, "title": "A board member is involved.", type: "boolean" } }, "required": [ "boardInvolved" ], "title": "Board Involvement?", type: "object" }, type: "input", data: { boardInvolved: true } }
- "escalate": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": true, "order": 1, name: "Escalate to CISO", type: "task" }
- "extract-iocs": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 5, name: "Extract IOCs", "next": { "block-iocs": "" },"schema": { "properties": { "iocs": { "items": { type: "string" },"title": "IOCs", type: "array" } }, "title": "Extract IOCs", type: "object" }, type: "input" }
- "mail-available": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 2, name: "Mail available","next": { "block-sender": "schemaKey == 'yes'", "extract-iocs": "schemaKey == 'yes'", "search-email-gateway": "schemaKey == 'no'" },"schema": { "oneOf": [ { "properties": { "mail": { "title": "Mail", type: "string", "x-display": "textarea" }, "schemaKey": { "const": "yes", type: "string" } },"required": [ "mail" ], "title": "Yes" },{ "properties": { "schemaKey": { "const": "no", type: "string" } },"title": "No" } ],"title": "Mail available", type: "object" }, type: "input" }
- "search-email-gateway": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 4, name: "Search email gateway","next": { "extract-iocs": "" }, type: "task" }
- references:
- - { href: "https://www.leadmaximize.net/e-services/back-end", name: "performance" }
- - { href: "http://www.corporateinteractive.name/rich", name: "autumn" }
- - { href: "https://www.corporateintuitive.org/intuitive/platforms/integrate", name: "suggest" }
- "schema": "{\n \"definitions\": {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://example.com/object1618746510.json\",\n \"title\": \"Event\",\n \"type\": \"object\",\n \"required\": [\n \"severity\",\n \"description\",\n \"tlp\"\n ],\n \"properties\": {\n \"severity\": {\n \"$id\": \"#root/severity\",\n \"title\": \"Severity\",\n \"type\": \"string\",\n \"default\": \"Medium\",\n \"nx-enum\": [\n \"Low\",\n \"Medium\",\n \"High\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"Low\",\n \"title\": \"Low\",\n \"icon\": \"mdi-chevron-up\"\n },\n {\n \"const\": \"Medium\",\n \"title\": \"Medium\",\n \"icon\": \"mdi-chevron-double-up\"\n },\n {\n \"const\": \"High\",\n \"title\": \"High\",\n \"icon\": \"mdi-chevron-triple-up\"\n }\n ]\n },\n \"tlp\": {\n \"$id\": \"#root/tlp\",\n \"title\": \"TLP\",\n \"type\": \"string\",\n \"nx-enum\": [\n \"White\",\n \"Green\",\n \"Amber\",\n \"Red\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"White\",\n \"title\": \"White\",\n \"icon\": \"mdi-alpha-w\"\n },\n {\n \"const\": \"Green\",\n \"title\": \"Green\",\n \"icon\": \"mdi-alpha-g\"\n },\n {\n \"const\": \"Amber\",\n \"title\": \"Amber\",\n \"icon\": \"mdi-alpha-a\"\n },\n {\n \"const\": \"Red\",\n \"title\": \"Red\",\n \"icon\": \"mdi-alpha-r\"\n }\n ]\n },\n \"description\": {\n \"$id\": \"#root/description\",\n \"title\": \"Description\",\n \"type\": \"string\",\n \"x-display\": \"textarea\",\n \"x-class\": \"pr-2\"\n }\n }\n}\n"
- status: "closed"
- type: "incident"
- artifacts:
- - { name: "94d5cab6f5fe3422a447ab15436e7a672bc0c09a", status: "unknown" }
- - { name: "http://www.customerviral.io/scalable/vertical/killer", status: "clean" }
- - { name: "leadreintermediate.io", status: "malicious" }
- security: [ { roles: [ "ticket:write" ] } ]
-
- /tickets/{id}/playbooks/{playbookID}/task/{taskID}/run:
- post:
- tags: [ "tickets" ]
- summary: "Run ticket playbook task"
- operationId: "runTask"
- parameters:
- - { name: "id", in: "path", description: "Ticket ID", required: true, type: integer, format: "int64", x-example: 8123 }
- - { name: "playbookID", in: "path", description: "Playbook ID", required: true, type: string, x-example: "phishing" }
- - { name: "taskID", in: "path", description: "Task ID", required: true, type: string, x-example: "board" }
- responses:
- "204": { description: "successful operation" }
- security: [ { roles: [ "ticket:write" ] } ]
-
- /tickets/{id}/artifacts:
- post:
- tags: [ "tickets" ]
- summary: "Add a single artifact"
- operationId: "addArtifact"
- parameters:
- - { name: "id", in: "path", description: "Ticket ID", required: true, type: integer, format: "int64", x-example: 8123 }
- - { name: "artifact", in: "body", description: "Artifact object that needs to be added", required: true, schema: { $ref: "#/definitions/Artifact" }, x-example: { name: "2.2.2.2" } }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/TicketWithTickets" }
- examples:
- test:
- id: 8123
- created: "2021-10-02T16:04:59.078206Z"
- modified: "2021-12-12T12:12:12.000000012Z"
- name: "live zebra"
- owner: "demo"
- playbooks:
- phishing:
- name: "Phishing"
- tasks:
- "block-iocs": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 6, name: "Block IOCs", type: "task" }
- "block-sender": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 3, name: "Block sender","next": { "extract-iocs": "" }, type: "task" }
- "board": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": true, "order": 0, name: "Board Involvement?","next": { "escalate": "boardInvolved == true","mail-available": "boardInvolved == false" },"schema": { "properties": { "boardInvolved": { "default": false, "title": "A board member is involved.", type: "boolean" } }, "required": [ "boardInvolved" ], "title": "Board Involvement?", type: "object" }, type: "input" }
- "escalate": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 1, name: "Escalate to CISO", type: "task" }
- "extract-iocs": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 5, name: "Extract IOCs", "next": { "block-iocs": "" },"schema": { "properties": { "iocs": { "items": { type: "string" },"title": "IOCs", type: "array" } }, "title": "Extract IOCs", type: "object" }, type: "input" }
- "mail-available": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 2, name: "Mail available","next": { "block-sender": "schemaKey == 'yes'", "extract-iocs": "schemaKey == 'yes'", "search-email-gateway": "schemaKey == 'no'" },"schema": { "oneOf": [ { "properties": { "mail": { "title": "Mail", type: "string", "x-display": "textarea" }, "schemaKey": { "const": "yes", type: "string" } },"required": [ "mail" ], "title": "Yes" },{ "properties": { "schemaKey": { "const": "no", type: "string" } },"title": "No" } ],"title": "Mail available", type: "object" }, type: "input" }
- "search-email-gateway": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 4, name: "Search email gateway","next": { "extract-iocs": "" }, type: "task" }
- references:
- - { href: "https://www.leadmaximize.net/e-services/back-end", name: "performance" }
- - { href: "http://www.corporateinteractive.name/rich", name: "autumn" }
- - { href: "https://www.corporateintuitive.org/intuitive/platforms/integrate", name: "suggest" }
- "schema": "{\n \"definitions\": {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://example.com/object1618746510.json\",\n \"title\": \"Event\",\n \"type\": \"object\",\n \"required\": [\n \"severity\",\n \"description\",\n \"tlp\"\n ],\n \"properties\": {\n \"severity\": {\n \"$id\": \"#root/severity\",\n \"title\": \"Severity\",\n \"type\": \"string\",\n \"default\": \"Medium\",\n \"nx-enum\": [\n \"Low\",\n \"Medium\",\n \"High\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"Low\",\n \"title\": \"Low\",\n \"icon\": \"mdi-chevron-up\"\n },\n {\n \"const\": \"Medium\",\n \"title\": \"Medium\",\n \"icon\": \"mdi-chevron-double-up\"\n },\n {\n \"const\": \"High\",\n \"title\": \"High\",\n \"icon\": \"mdi-chevron-triple-up\"\n }\n ]\n },\n \"tlp\": {\n \"$id\": \"#root/tlp\",\n \"title\": \"TLP\",\n \"type\": \"string\",\n \"nx-enum\": [\n \"White\",\n \"Green\",\n \"Amber\",\n \"Red\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"White\",\n \"title\": \"White\",\n \"icon\": \"mdi-alpha-w\"\n },\n {\n \"const\": \"Green\",\n \"title\": \"Green\",\n \"icon\": \"mdi-alpha-g\"\n },\n {\n \"const\": \"Amber\",\n \"title\": \"Amber\",\n \"icon\": \"mdi-alpha-a\"\n },\n {\n \"const\": \"Red\",\n \"title\": \"Red\",\n \"icon\": \"mdi-alpha-r\"\n }\n ]\n },\n \"description\": {\n \"$id\": \"#root/description\",\n \"title\": \"Description\",\n \"type\": \"string\",\n \"x-display\": \"textarea\",\n \"x-class\": \"pr-2\"\n }\n }\n}\n"
- status: "closed"
- type: "incident"
- artifacts:
- - { name: "94d5cab6f5fe3422a447ab15436e7a672bc0c09a", status: "unknown" }
- - { name: "http://www.customerviral.io/scalable/vertical/killer", status: "clean" }
- - { name: "leadreintermediate.io", status: "malicious" }
- - { name: "2.2.2.2", status: "unknown", type: "ip" }
- security: [ { roles: [ "ticket:write" ] } ]
-
- /tickets/{id}/artifacts/{name}:
- get:
- tags: [ "tickets" ]
- summary: "Get a single artifact"
- operationId: "getArtifact"
- parameters:
- - { name: "id", in: "path", description: "Ticket ID", required: true, type: integer, format: "int64", x-example: 8123 }
- - { name: "name", in: "path", required: true, type: string, x-example: "leadreintermediate.io" }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/Artifact" }
- examples:
- test: { name: "leadreintermediate.io", status: "malicious" }
- security: [ { roles: [ "ticket:write" ] } ]
- put:
- tags: [ "tickets" ]
- summary: "Set a single artifact"
- operationId: "setArtifact"
- parameters:
- - { name: "id", in: "path", description: "Ticket ID", required: true, type: integer, format: "int64", x-example: 8123 }
- - { name: "name", in: "path", required: true, type: string, x-example: "leadreintermediate.io" }
- - { name: "artifact", in: "body", required: true, schema: { $ref: "#/definitions/Artifact" }, x-example: { name: "leadreintermediate.io", status: "clean" } }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/TicketWithTickets" }
- examples:
- test:
- id: 8123
- created: "2021-10-02T16:04:59.078206Z"
- modified: "2021-10-02T16:04:59.078206Z"
- name: "live zebra"
- owner: "demo"
- playbooks:
- phishing:
- name: "Phishing"
- tasks:
- "block-iocs": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 6, name: "Block IOCs", type: "task" }
- "block-sender": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 3, name: "Block sender","next": { "extract-iocs": "" }, type: "task" }
- "board": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": true, "order": 0, name: "Board Involvement?","next": { "escalate": "boardInvolved == true","mail-available": "boardInvolved == false" },"schema": { "properties": { "boardInvolved": { "default": false, "title": "A board member is involved.", type: "boolean" } }, "required": [ "boardInvolved" ], "title": "Board Involvement?", type: "object" }, type: "input" }
- "escalate": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 1, name: "Escalate to CISO", type: "task" }
- "extract-iocs": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 5, name: "Extract IOCs", "next": { "block-iocs": "" },"schema": { "properties": { "iocs": { "items": { type: "string" },"title": "IOCs", type: "array" } }, "title": "Extract IOCs", type: "object" }, type: "input" }
- "mail-available": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 2, name: "Mail available","next": { "block-sender": "schemaKey == 'yes'", "extract-iocs": "schemaKey == 'yes'", "search-email-gateway": "schemaKey == 'no'" },"schema": { "oneOf": [ { "properties": { "mail": { "title": "Mail", type: "string", "x-display": "textarea" }, "schemaKey": { "const": "yes", type: "string" } },"required": [ "mail" ], "title": "Yes" },{ "properties": { "schemaKey": { "const": "no", type: "string" } },"title": "No" } ],"title": "Mail available", type: "object" }, type: "input" }
- "search-email-gateway": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 4, name: "Search email gateway","next": { "extract-iocs": "" }, type: "task" }
- references:
- - { href: "https://www.leadmaximize.net/e-services/back-end", name: "performance" }
- - { href: "http://www.corporateinteractive.name/rich", name: "autumn" }
- - { href: "https://www.corporateintuitive.org/intuitive/platforms/integrate", name: "suggest" }
- "schema": "{\n \"definitions\": {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://example.com/object1618746510.json\",\n \"title\": \"Event\",\n \"type\": \"object\",\n \"required\": [\n \"severity\",\n \"description\",\n \"tlp\"\n ],\n \"properties\": {\n \"severity\": {\n \"$id\": \"#root/severity\",\n \"title\": \"Severity\",\n \"type\": \"string\",\n \"default\": \"Medium\",\n \"nx-enum\": [\n \"Low\",\n \"Medium\",\n \"High\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"Low\",\n \"title\": \"Low\",\n \"icon\": \"mdi-chevron-up\"\n },\n {\n \"const\": \"Medium\",\n \"title\": \"Medium\",\n \"icon\": \"mdi-chevron-double-up\"\n },\n {\n \"const\": \"High\",\n \"title\": \"High\",\n \"icon\": \"mdi-chevron-triple-up\"\n }\n ]\n },\n \"tlp\": {\n \"$id\": \"#root/tlp\",\n \"title\": \"TLP\",\n \"type\": \"string\",\n \"nx-enum\": [\n \"White\",\n \"Green\",\n \"Amber\",\n \"Red\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"White\",\n \"title\": \"White\",\n \"icon\": \"mdi-alpha-w\"\n },\n {\n \"const\": \"Green\",\n \"title\": \"Green\",\n \"icon\": \"mdi-alpha-g\"\n },\n {\n \"const\": \"Amber\",\n \"title\": \"Amber\",\n \"icon\": \"mdi-alpha-a\"\n },\n {\n \"const\": \"Red\",\n \"title\": \"Red\",\n \"icon\": \"mdi-alpha-r\"\n }\n ]\n },\n \"description\": {\n \"$id\": \"#root/description\",\n \"title\": \"Description\",\n \"type\": \"string\",\n \"x-display\": \"textarea\",\n \"x-class\": \"pr-2\"\n }\n }\n}\n"
- status: "closed"
- type: "incident"
- artifacts:
- - { name: "94d5cab6f5fe3422a447ab15436e7a672bc0c09a", status: "unknown" }
- - { name: "http://www.customerviral.io/scalable/vertical/killer", status: "clean" }
- - { name: "leadreintermediate.io", status: "clean" }
- security: [ { roles: [ "ticket:write" ] } ]
- delete:
- tags: [ "tickets" ]
- summary: "Remove an artifact"
- operationId: "removeArtifact"
- parameters:
- - { name: "id", in: "path", description: "Ticket ID", required: true, type: integer, format: "int64", x-example: 8123 }
- - { name: "name", in: "path", required: true, type: string, x-example: "leadreintermediate.io" }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/TicketWithTickets" }
- examples:
- test:
- id: 8123
- created: "2021-10-02T16:04:59.078206Z"
- modified: "2021-12-12T12:12:12.000000012Z"
- name: "live zebra"
- owner: "demo"
- playbooks:
- phishing:
- name: "Phishing"
- tasks:
- "block-iocs": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 6, name: "Block IOCs", type: "task" }
- "block-sender": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 3, name: "Block sender","next": { "extract-iocs": "" }, type: "task" }
- "board": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": true, "order": 0, name: "Board Involvement?","next": { "escalate": "boardInvolved == true","mail-available": "boardInvolved == false" },"schema": { "properties": { "boardInvolved": { "default": false, "title": "A board member is involved.", type: "boolean" } }, "required": [ "boardInvolved" ], "title": "Board Involvement?", type: "object" }, type: "input" }
- "escalate": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 1, name: "Escalate to CISO", type: "task" }
- "extract-iocs": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 5, name: "Extract IOCs", "next": { "block-iocs": "" },"schema": { "properties": { "iocs": { "items": { type: "string" },"title": "IOCs", type: "array" } }, "title": "Extract IOCs", type: "object" }, type: "input" }
- "mail-available": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 2, name: "Mail available","next": { "block-sender": "schemaKey == 'yes'", "extract-iocs": "schemaKey == 'yes'", "search-email-gateway": "schemaKey == 'no'" },"schema": { "oneOf": [ { "properties": { "mail": { "title": "Mail", type: "string", "x-display": "textarea" }, "schemaKey": { "const": "yes", type: "string" } },"required": [ "mail" ], "title": "Yes" },{ "properties": { "schemaKey": { "const": "no", type: "string" } },"title": "No" } ],"title": "Mail available", type: "object" }, type: "input" }
- "search-email-gateway": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 4, name: "Search email gateway","next": { "extract-iocs": "" }, type: "task" }
- references:
- - { href: "https://www.leadmaximize.net/e-services/back-end", name: "performance" }
- - { href: "http://www.corporateinteractive.name/rich", name: "autumn" }
- - { href: "https://www.corporateintuitive.org/intuitive/platforms/integrate", name: "suggest" }
- "schema": "{\n \"definitions\": {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://example.com/object1618746510.json\",\n \"title\": \"Event\",\n \"type\": \"object\",\n \"required\": [\n \"severity\",\n \"description\",\n \"tlp\"\n ],\n \"properties\": {\n \"severity\": {\n \"$id\": \"#root/severity\",\n \"title\": \"Severity\",\n \"type\": \"string\",\n \"default\": \"Medium\",\n \"nx-enum\": [\n \"Low\",\n \"Medium\",\n \"High\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"Low\",\n \"title\": \"Low\",\n \"icon\": \"mdi-chevron-up\"\n },\n {\n \"const\": \"Medium\",\n \"title\": \"Medium\",\n \"icon\": \"mdi-chevron-double-up\"\n },\n {\n \"const\": \"High\",\n \"title\": \"High\",\n \"icon\": \"mdi-chevron-triple-up\"\n }\n ]\n },\n \"tlp\": {\n \"$id\": \"#root/tlp\",\n \"title\": \"TLP\",\n \"type\": \"string\",\n \"nx-enum\": [\n \"White\",\n \"Green\",\n \"Amber\",\n \"Red\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"White\",\n \"title\": \"White\",\n \"icon\": \"mdi-alpha-w\"\n },\n {\n \"const\": \"Green\",\n \"title\": \"Green\",\n \"icon\": \"mdi-alpha-g\"\n },\n {\n \"const\": \"Amber\",\n \"title\": \"Amber\",\n \"icon\": \"mdi-alpha-a\"\n },\n {\n \"const\": \"Red\",\n \"title\": \"Red\",\n \"icon\": \"mdi-alpha-r\"\n }\n ]\n },\n \"description\": {\n \"$id\": \"#root/description\",\n \"title\": \"Description\",\n \"type\": \"string\",\n \"x-display\": \"textarea\",\n \"x-class\": \"pr-2\"\n }\n }\n}\n"
- status: "closed"
- type: "incident"
- artifacts:
- - { name: "94d5cab6f5fe3422a447ab15436e7a672bc0c09a", status: "unknown" }
- - { name: "http://www.customerviral.io/scalable/vertical/killer", status: "clean" }
- security: [ { roles: [ "ticket:write" ] } ]
-
- /tickets/{id}/artifacts/{name}/run/{automation}:
- post:
- tags: [ "tickets" ]
- summary: "Run automation on a single artifact"
- operationId: "runArtifact"
- parameters:
- - { name: "id", in: "path", description: "Ticket ID", required: true, type: integer, format: "int64", x-example: 8123 }
- - { name: "name", in: "path", required: true, type: string, x-example: "leadreintermediate.io" }
- - { name: "automation", in: "path", required: true, type: string, x-example: "hash.sha1" }
- responses:
- "204": { description: "successful operation" }
- security: [ { roles: [ "ticket:write" ] } ]
-
- /tickets/{id}/artifacts/{name}/enrich:
- post:
- tags: [ "tickets" ]
- summary: "Enrich a single artifact"
- operationId: "enrichArtifact"
- parameters:
- - { name: "id", in: "path", description: "Ticket ID", required: true, type: integer, format: "int64", x-example: 8123 }
- - { name: "name", in: "path", required: true, type: string, x-example: "leadreintermediate.io" }
- - { name: "data", in: "body", required: true, schema: { $ref: "#/definitions/EnrichmentForm" }, x-example: { name: "hash.sha1", data: { "hash": "b7a067a742c20d07a7456646de89bc2d408a1153" } } }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/TicketWithTickets" }
- examples:
- test:
- id: 8123
- created: "2021-10-02T16:04:59.078206Z"
- modified: "2021-10-02T16:04:59.078206Z"
- name: "live zebra"
- owner: "demo"
- playbooks:
- phishing:
- name: "Phishing"
- tasks:
- "block-iocs": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 6, name: "Block IOCs", type: "task" }
- "block-sender": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 3, name: "Block sender","next": { "extract-iocs": "" }, type: "task" }
- "board": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": true, "order": 0, name: "Board Involvement?","next": { "escalate": "boardInvolved == true","mail-available": "boardInvolved == false" },"schema": { "properties": { "boardInvolved": { "default": false, "title": "A board member is involved.", type: "boolean" } }, "required": [ "boardInvolved" ], "title": "Board Involvement?", type: "object" }, type: "input" }
- "escalate": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 1, name: "Escalate to CISO", type: "task" }
- "extract-iocs": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 5, name: "Extract IOCs", "next": { "block-iocs": "" },"schema": { "properties": { "iocs": { "items": { type: "string" },"title": "IOCs", type: "array" } }, "title": "Extract IOCs", type: "object" }, type: "input" }
- "mail-available": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 2, name: "Mail available","next": { "block-sender": "schemaKey == 'yes'", "extract-iocs": "schemaKey == 'yes'", "search-email-gateway": "schemaKey == 'no'" },"schema": { "oneOf": [ { "properties": { "mail": { "title": "Mail", type: "string", "x-display": "textarea" }, "schemaKey": { "const": "yes", type: "string" } },"required": [ "mail" ], "title": "Yes" },{ "properties": { "schemaKey": { "const": "no", type: "string" } },"title": "No" } ],"title": "Mail available", type: "object" }, type: "input" }
- "search-email-gateway": { created: "2021-12-12T12:12:12.000000012Z", done: false, "active": false, "order": 4, name: "Search email gateway","next": { "extract-iocs": "" }, type: "task" }
- references:
- - { href: "https://www.leadmaximize.net/e-services/back-end", name: "performance" }
- - { href: "http://www.corporateinteractive.name/rich", name: "autumn" }
- - { href: "https://www.corporateintuitive.org/intuitive/platforms/integrate", name: "suggest" }
- "schema": "{\n \"definitions\": {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://example.com/object1618746510.json\",\n \"title\": \"Event\",\n \"type\": \"object\",\n \"required\": [\n \"severity\",\n \"description\",\n \"tlp\"\n ],\n \"properties\": {\n \"severity\": {\n \"$id\": \"#root/severity\",\n \"title\": \"Severity\",\n \"type\": \"string\",\n \"default\": \"Medium\",\n \"nx-enum\": [\n \"Low\",\n \"Medium\",\n \"High\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"Low\",\n \"title\": \"Low\",\n \"icon\": \"mdi-chevron-up\"\n },\n {\n \"const\": \"Medium\",\n \"title\": \"Medium\",\n \"icon\": \"mdi-chevron-double-up\"\n },\n {\n \"const\": \"High\",\n \"title\": \"High\",\n \"icon\": \"mdi-chevron-triple-up\"\n }\n ]\n },\n \"tlp\": {\n \"$id\": \"#root/tlp\",\n \"title\": \"TLP\",\n \"type\": \"string\",\n \"nx-enum\": [\n \"White\",\n \"Green\",\n \"Amber\",\n \"Red\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"White\",\n \"title\": \"White\",\n \"icon\": \"mdi-alpha-w\"\n },\n {\n \"const\": \"Green\",\n \"title\": \"Green\",\n \"icon\": \"mdi-alpha-g\"\n },\n {\n \"const\": \"Amber\",\n \"title\": \"Amber\",\n \"icon\": \"mdi-alpha-a\"\n },\n {\n \"const\": \"Red\",\n \"title\": \"Red\",\n \"icon\": \"mdi-alpha-r\"\n }\n ]\n },\n \"description\": {\n \"$id\": \"#root/description\",\n \"title\": \"Description\",\n \"type\": \"string\",\n \"x-display\": \"textarea\",\n \"x-class\": \"pr-2\"\n }\n }\n}\n"
- status: "closed"
- type: "incident"
- artifacts:
- - { name: "94d5cab6f5fe3422a447ab15436e7a672bc0c09a", status: "unknown" }
- - { name: "http://www.customerviral.io/scalable/vertical/killer", status: "clean" }
- - { name: "leadreintermediate.io", status: "malicious", enrichments: { hash.sha1: { name: "hash.sha1", created: "2021-12-12T12:12:12.000000012Z", data: { "hash": "b7a067a742c20d07a7456646de89bc2d408a1153" } } } }
- security: [ { roles: [ "ticket:write" ] } ]
-
-definitions:
- TicketFormArray:
- type: array
- items: { $ref: "#/definitions/TicketForm" }
-
- TicketForm:
- type: object
- required: [ name, type, status ]
- properties:
- id: { type: integer, format: int64, example: 123 }
- name: { type: string, example: WannyCry }
- type: { type: string, example: incident }
- status: { type: string, example: "open" }
-
- owner: { type: string, example: "bob" }
- write: { type: array, items: { type: string }, example: [ "alice" ] }
- read: { type: array, items: { type: string }, example: [ "bob" ] }
-
- schema: { type: string, example: "{}" }
- details: { type: object, example: { "description": "my little incident" } }
-
- references: { type: array, items: { $ref: '#/definitions/Reference' } }
- playbooks: { type: array, items: { $ref: '#/definitions/PlaybookTemplateForm' } }
- files: { type: array, items: { $ref: '#/definitions/File' } }
- comments: { type: array, items: { $ref: '#/definitions/Comment' } }
- artifacts: { type: array, items: { $ref: "#/definitions/Artifact" } }
-
- created: { type: string, format: "date-time", example: "1985-04-12T23:20:50.52Z" }
- modified: { type: string, format: "date-time", example: "1985-04-12T23:20:50.52Z" }
-
- Ticket:
- type: object
- required: [ name, type, status, created, modified, schema ]
- properties:
- name: { type: string, example: WannyCry }
- type: { type: string, example: incident }
- status: { type: string, example: "open" }
-
- owner: { type: string, example: "bob" }
- write: { type: array, items: { type: string }, example: [ "alice" ] }
- read: { type: array, items: { type: string }, example: [ "bob" ] }
-
- schema: { type: string, example: "{}" }
- details: { type: object, example: { "description": "my little incident" } }
-
- references: { type: array, items: { $ref: '#/definitions/Reference' } }
- playbooks: { type: object, additionalProperties: { $ref: '#/definitions/Playbook' } }
- files: { type: array, items: { $ref: '#/definitions/File' } }
- comments: { type: array, items: { $ref: '#/definitions/Comment' } }
- artifacts: { type: array, items: { $ref: "#/definitions/Artifact" } }
-
- created: { type: string, format: "date-time", example: "1985-04-12T23:20:50.52Z" }
- modified: { type: string, format: "date-time", example: "1985-04-12T23:20:50.52Z" }
-
- TicketResponse:
- type: object
- required: [ id, name, type, status, created, modified, schema ]
- properties:
- id: { type: integer, format: int64, example: 123 }
- name: { type: string, example: WannyCry }
- type: { type: string, example: incident }
- status: { type: string, example: "open" }
-
- owner: { type: string, example: "bob" }
- write: { type: array, items: { type: string }, example: [ "alice" ] }
- read: { type: array, items: { type: string }, example: [ "bob" ] }
-
- schema: { type: string, example: "{}" }
- details: { type: object, example: { "description": "my little incident" } }
-
- references: { type: array, items: { $ref: '#/definitions/Reference' } }
- playbooks: { type: object, additionalProperties: { $ref: '#/definitions/PlaybookResponse' } }
- files: { type: array, items: { $ref: '#/definitions/File' } }
- comments: { type: array, items: { $ref: '#/definitions/Comment' } }
- artifacts: { type: array, items: { $ref: "#/definitions/Artifact" } }
-
- created: { type: string, format: "date-time", example: "1985-04-12T23:20:50.52Z" }
- modified: { type: string, format: "date-time", example: "1985-04-12T23:20:50.52Z" }
-
- TicketSimpleResponse:
- type: object
- required: [ id, name, type, status, created, modified, schema ]
- properties:
- id: { type: integer, format: int64, example: 123 }
- name: { type: string, example: WannyCry }
- type: { type: string, example: incident }
- status: { type: string, example: "open" }
-
- owner: { type: string, example: "bob" }
- write: { type: array, items: { type: string }, example: [ "alice" ] }
- read: { type: array, items: { type: string }, example: [ "bob" ] }
-
- schema: { type: string, example: "{}" }
- details: { type: object, example: { "description": "my little incident" } }
-
- references: { type: array, items: { $ref: '#/definitions/Reference' } }
- playbooks: { type: object, additionalProperties: { $ref: '#/definitions/Playbook' } }
- files: { type: array, items: { $ref: '#/definitions/File' } }
- comments: { type: array, items: { $ref: '#/definitions/Comment' } }
- artifacts: { type: array, items: { $ref: "#/definitions/Artifact" } }
-
- created: { type: string, format: "date-time", example: "1985-04-12T23:20:50.52Z" }
- modified: { type: string, format: "date-time", example: "1985-04-12T23:20:50.52Z" }
-
- TicketWithTickets:
- type: object
- required: [ id, name, type, status, created, modified, schema ]
- properties:
- id: { type: integer, format: int64, example: 123 }
- name: { type: string, example: WannyCry }
- type: { type: string, example: incident }
- status: { type: string, example: "open" }
-
- owner: { type: string, example: "bob" }
- write: { type: array, items: { type: string }, example: [ "alice" ] }
- read: { type: array, items: { type: string }, example: [ "bob" ] }
-
- schema: { type: string, example: "{}" }
- details: { type: object, example: { "description": "my little incident" } }
-
- references: { type: array, items: { $ref: '#/definitions/Reference' } }
- playbooks: { type: object, additionalProperties: { $ref: '#/definitions/PlaybookResponse' } }
- files: { type: array, items: { $ref: '#/definitions/File' } }
- comments: { type: array, items: { $ref: '#/definitions/Comment' } }
- artifacts: { type: array, items: { $ref: "#/definitions/Artifact" } }
-
- logs: { type: array, items: { $ref: '#/definitions/LogEntry' } }
-
- created: { type: string, format: "date-time", example: "1985-04-12T23:20:50.52Z" }
- modified: { type: string, format: "date-time", example: "1985-04-12T23:20:50.52Z" }
-
- tickets: { type: array, items: { $ref: "#/definitions/TicketSimpleResponse" } }
- correlated_tickets: { type: array, items: { $ref: "#/definitions/TicketSimpleResponse" } }
-
- TicketList:
- type: object
- required: [ tickets, count ]
- properties:
- tickets: { type: array, items: { $ref: "#/definitions/TicketSimpleResponse" } }
- count: { type: number, example: 3 }
-
- CommentForm:
- type: object
- required: [ message ]
- properties:
- creator: { type: string }
- created: { type: string, format: "date-time" }
- message: { type: string }
-
- Comment:
- type: object
- required: [ creator, created, message ]
- properties:
- creator: { type: string }
- created: { type: string, format: "date-time" }
- message: { type: string }
-
- ReferenceArray:
- type: array
- items: { $ref: '#/definitions/Reference' }
-
- Reference:
- type: object
- required: [ name, href ]
- properties:
- name: { type: string, example: "CVE-2017-0144" }
- href: { type: string, example: "https://cve.mitre.org/cgi-bin/cvename.cgi?name=cve-2017-0144" }
-
- File:
- type: object
- required: [ key, name ]
- properties:
- key: { type: string, example: "myfile" }
- name: { type: string, example: "notes.docx" }
-
- Playbook:
- type: object
- required: [ name, tasks ]
- properties:
- name: { type: string, example: "Phishing" }
- tasks: { type: object, additionalProperties: { $ref: '#/definitions/Task' } }
-
- PlaybookResponse:
- type: object
- required: [ name, tasks ]
- properties:
- name: { type: string, example: "Phishing" }
- tasks: { type: object, additionalProperties: { $ref: '#/definitions/TaskResponse' } }
diff --git a/definition/tickettype.yaml b/definition/tickettype.yaml
deleted file mode 100644
index 3c8b491..0000000
--- a/definition/tickettype.yaml
+++ /dev/null
@@ -1,121 +0,0 @@
-swagger: "2.0"
-info: { version: "", title: "" }
-
-
-paths:
- /tickettypes:
- get:
- tags: [ "tickettypes" ]
- summary: "List tickettypes"
- operationId: "listTicketTypes"
- responses:
- "200":
- description: "successful operation"
- schema: { type: array, items: { $ref: "#/definitions/TicketTypeResponse" } }
- examples:
- test:
- - { icon: "mdi-alert", id: "alert", name: "Alerts", default_template: "default", default_playbooks: [ ] }
- - { icon: "mdi-radioactive", id: "incident", name: "Incidents", default_template: "default", default_playbooks: [ ] }
- - { icon: "mdi-fingerprint", id: "investigation", name: "Forensic Investigations", default_template: "default", default_playbooks: [ ] }
- - { icon: "mdi-target", id: "hunt", name: "Threat Hunting", default_template: "default", default_playbooks: [ ] }
- security: [ { roles: [ "tickettype:read" ] } ]
- post:
- tags: [ "tickettypes" ]
- summary: "Create a new tickettype"
- operationId: "createTicketType"
- parameters:
- - { name: "tickettype", in: "body", description: "New tickettype", required: true, schema: { $ref: "#/definitions/TicketTypeForm" }, x-example: { name: "TI Tickets", icon: "mdi-newspaper-variant-outline", default_template: "default", default_playbooks: [ ] } }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/TicketTypeResponse" }
- examples:
- test:
- id: "ti-tickets"
- name: "TI Tickets"
- icon: "mdi-newspaper-variant-outline"
- default_template: "default"
- default_playbooks: [ ]
- security: [ { roles: [ "tickettype:write" ] } ]
-
- /tickettypes/{id}:
- get:
- tags: [ "tickettypes" ]
- summary: "Get a single tickettype"
- operationId: "getTicketType"
- parameters:
- - { name: "id", in: "path", description: "TicketType ID", required: true, type: string, x-example: "alert" }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/TicketTypeResponse" }
- examples:
- test:
- icon: "mdi-alert"
- id: "alert"
- name: "Alerts"
- default_template: "default"
- default_playbooks: [ ]
- security: [ { roles: [ "tickettype:read" ] } ]
- put:
- tags: [ "tickettypes" ]
- summary: "Update an existing tickettype"
- operationId: "updateTicketType"
- parameters:
- - { name: "id", in: "path", description: "TicketType ID", required: true, type: string, x-example: "alert" }
- - { name: "tickettype", in: "body", description: "TicketType object that needs to be added", required: true, schema: { $ref: "#/definitions/TicketTypeForm" }, x-example: { icon: "mdi-bell", id: "alert", name: "Alerts", default_template: "default", default_playbooks: [ ] } }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/TicketTypeResponse" }
- examples:
- test:
- icon: "mdi-bell"
- id: "alert"
- name: "Alerts"
- default_template: "default"
- default_playbooks: [ ]
-
- security: [ { roles: [ "tickettype:write" ] } ]
- delete:
- tags: [ "tickettypes" ]
- summary: "Delete a tickettype"
- operationId: "deleteTicketType"
- parameters:
- - { name: "id", in: "path", description: "TicketType ID", required: true, type: string, x-example: "alert" }
- responses:
- "204": { description: "successful operation" }
- security: [ { roles: [ "tickettype:write" ] } ]
-
-definitions:
- TicketTypeForm:
- type: object
- required: [ name, icon, default_template, default_playbooks ]
- properties:
- id: { type: string }
- icon: { type: string }
- name: { type: string }
- default_template: { type: string }
- default_playbooks: { type: array, items: { type: string } }
- default_groups: { type: array, items: { type: string } }
-
- TicketType:
- type: object
- required: [ name, icon, default_template, default_playbooks ]
- properties:
- icon: { type: string }
- name: { type: string }
- default_template: { type: string }
- default_playbooks: { type: array, items: { type: string } }
- default_groups: { type: array, items: { type: string } }
-
- TicketTypeResponse:
- type: object
- required: [ id, name, icon, default_template, default_playbooks ]
- properties:
- id: { type: string }
- icon: { type: string }
- name: { type: string }
- default_template: { type: string }
- default_playbooks: { type: array, items: { type: string } }
- default_groups: { type: array, items: { type: string } }
diff --git a/definition/userdata.yaml b/definition/userdata.yaml
deleted file mode 100644
index 449fbca..0000000
--- a/definition/userdata.yaml
+++ /dev/null
@@ -1,94 +0,0 @@
-swagger: "2.0"
-info: { version: "", title: "" }
-
-paths:
- /currentuserdata:
- get:
- tags: [ "userdata" ]
- summary: "Get current user data"
- operationId: "currentUserData"
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/UserDataResponse" }
- examples:
- test: { id: bob, name: "Bob Bad", email: "bob@example.org" }
- security: [ { roles: [ "currentuserdata:read" ] } ]
- put:
- tags: [ "userdata" ]
- summary: "Update current user data"
- operationId: "updateCurrentUserData"
- parameters:
- - { name: "userdata", in: "body", description: "User data object that needs to be added", required: true, schema: { $ref: "#/definitions/UserData" }, x-example: { name: "Bob Bad", email: "bob@example.org" } }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/UserDataResponse" }
- examples:
- test: { id: bob, name: "Bob Bad", email: "bob@example.org" }
- security: [ { roles: [ "currentuserdata:write" ] } ]
-
- /userdata:
- get:
- tags: [ "userdata" ]
- summary: "List userdata"
- operationId: "listUserData"
- responses:
- "200":
- description: "successful operation"
- schema: { type: array, items: { $ref: "#/definitions/UserDataResponse" } }
- examples:
- test:
- - { id: bob, name: "Bob Bad", email: "bob@example.org" }
- security: [ { roles: [ "userdata:read" ] } ]
-
- /userdata/{id}:
- get:
- tags: [ "userdata" ]
- summary: "Get a single user data"
- operationId: "getUserData"
- parameters:
- - { name: "id", in: "path", description: "User Data ID", required: true, type: string, x-example: "bob" }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/UserDataResponse" }
- examples:
- test:
- id: bob
- name: "Bob Bad"
- email: "bob@example.org"
- security: [ { roles: [ "userdata:read" ] } ]
- put:
- tags: [ "userdata" ]
- summary: "Update an existing user data"
- operationId: "updateUserData"
- parameters:
- - { name: "id", in: "path", description: "User Data ID", required: true, type: string, x-example: "bob" }
- - { name: "userdata", in: "body", description: "User data object that needs to be added", required: true, schema: { $ref: "#/definitions/UserData" }, x-example: { name: "Bob Bad", email: "bob@example.org", blocked: false } }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/UserDataResponse" }
- examples:
- test: { id: bob, name: "Bob Bad", email: "bob@example.org" }
- security: [ { roles: [ "userdata:write" ] } ]
-
-definitions:
- UserData:
- type: object
- properties:
- name: { type: string, x-example: "Robert Smith" }
- email: { type: string, x-example: "bob@example.org" }
- image: { type: string, x-display: "custom-avatar" }
- timeformat: { title: "Time Format (https://moment.github.io/luxon/docs/manual/formatting.html#table-of-tokens)", type: string }
-
- UserDataResponse:
- type: object
- required: [ id ]
- properties:
- id: { type: string }
- name: { type: string, x-example: "Robert Smith" }
- email: { type: string, x-example: "bob@example.org" }
- image: { type: string, x-display: "custom-avatar" }
- timeformat: { title: "Time Format (https://moment.github.io/luxon/docs/manual/formatting.html#table-of-tokens)", type: string }
diff --git a/definition/users.yaml b/definition/users.yaml
deleted file mode 100644
index 1f6482c..0000000
--- a/definition/users.yaml
+++ /dev/null
@@ -1,122 +0,0 @@
-swagger: "2.0"
-info: { version: "", title: "" }
-
-paths:
- /currentuser:
- get:
- tags: [ "users" ]
- summary: "Get current user"
- operationId: "currentUser"
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/UserResponse" }
- examples:
- test: { id: bob, roles: [ "admin" ], blocked: false, apikey: false }
- security: [ { roles: [ "currentuser:read" ] } ]
-
- /users:
- get:
- tags: [ "users" ]
- summary: "List users"
- operationId: "listUsers"
- responses:
- "200":
- description: "successful operation"
- schema: { type: array, items: { $ref: "#/definitions/UserResponse" } }
- examples:
- test:
- - { id: bob, blocked: false, roles: [ "admin" ], apikey: false }
- - { id: script, roles: [ "engineer" ], blocked: false, apikey: true }
- security: [ { roles: [ "user:read" ] } ]
- post:
- tags: [ "users" ]
- summary: "Create user"
- operationId: "createUser"
- parameters:
- - { name: "user", in: "body", description: "user object that needs to be added", required: true, schema: { $ref: "#/definitions/UserForm" }, x-example: { id: "syncscript", roles: [ "analyst" ], blocked: false, apikey: true } }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/NewUserResponse" }
- examples:
- test: { id: "syncscript", roles: [ "analyst" ], secret: "v39bOuobnlEljfWzjAgoKzhmnh1xSMxH", blocked: false }
- security: [ { roles: [ "user:write" ] } ]
- /users/{id}:
- get:
- tags: [ "users" ]
- summary: "Get a single user"
- operationId: "getUser"
- parameters:
- - { name: "id", in: "path", description: "user ID", required: true, type: string, x-example: "script" }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/UserResponse" }
- examples:
- test: { id: "script", roles: [ "engineer" ], blocked: false, apikey: true }
- security: [ { roles: [ "user:read" ] } ]
- put:
- tags: [ "users" ]
- summary: "Update user"
- operationId: "updateUser"
- parameters:
- - { name: "id", in: "path", description: "Template ID", required: true, type: string, x-example: "bob" }
- - { name: "user", in: "body", description: "user object that needs to be added", required: true, schema: { $ref: "#/definitions/UserForm" }, x-example: { id: "syncscript", roles: [ "analyst", "admin" ], blocked: false, apikey: false } }
- responses:
- "200":
- description: "successful operation"
- schema: { $ref: "#/definitions/UserResponse" }
- examples:
- test:
- id: bob
- roles: [ "analyst", "admin" ]
- apikey: false
- blocked: false
- security: [ { roles: [ "user:write" ] } ]
- delete:
- tags: [ "users" ]
- summary: "Delete user"
- operationId: "deleteUser"
- parameters:
- - { name: "id", in: "path", description: "user ID", required: true, type: string, x-example: "script" }
- responses:
- "204": { description: "successful operation" }
- security: [ { roles: [ "user:write" ] } ]
-
-definitions:
- UserForm:
- type: object
- required: [ id, blocked, roles, apikey ]
- properties:
- id: { type: string }
- blocked: { type: boolean }
- apikey: { type: boolean }
- roles: { type: array, items: { type: string } }
-
- User:
- type: object
- required: [ blocked, apikey, roles ]
- properties:
- blocked: { type: boolean }
- apikey: { type: boolean }
- roles: { type: array, items: { type: string } }
- sha256: { type: string } # for api keys
-
- UserResponse:
- type: object
- required: [ id, blocked, roles, apikey ]
- properties:
- id: { type: string }
- blocked: { type: boolean }
- apikey: { type: boolean }
- roles: { type: array, items: { type: string } }
-
- NewUserResponse:
- type: object
- required: [ id, blocked, roles ]
- properties:
- id: { type: string }
- blocked: { type: boolean }
- roles: { type: array, items: { type: string } }
- secret: { type: string }
diff --git a/dev/authelia/configuration.yml b/dev/authelia/configuration.yml
deleted file mode 100644
index cafc7aa..0000000
--- a/dev/authelia/configuration.yml
+++ /dev/null
@@ -1,42 +0,0 @@
----
-server:
- host: 0.0.0.0
- port: 8082
-default_redirection_url: "http://localhost/auth/callback"
-
-log:
- format: text
-
-authentication_backend:
- file:
- path: /config/users_database.yml
-
-access_control:
- default_policy: one_factor
-
-session:
- domain: localhost
-
-storage:
- local:
- path: /config/db.sqlite3
-
-notifier:
- filesystem:
- filename: /config/notification.txt
-
-identity_providers:
- oidc:
- cors:
- # allowed_origins_from_client_redirect_uris: true
- allowed_origins: [ "*" ]
- clients:
- - id: "catalyst"
- description: API
- secret: "secret"
- public: false
- authorization_policy: one_factor
- scopes: [ openid, email, profile ]
- redirect_uris:
- - "http://localhost/auth/callback"
- userinfo_signing_algorithm: none
diff --git a/dev/authelia/private.pem b/dev/authelia/private.pem
deleted file mode 100644
index ea61ba2..0000000
--- a/dev/authelia/private.pem
+++ /dev/null
@@ -1,51 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIIJKQIBAAKCAgEA0OYfHDBvLOMQHjGb2bZGZh6j+nfWihAVWAycCR5ZOGwaRQuW
-Z0iFzkDlsj0ENG65H5DkRB1mu93LXi7yzLs7Iu4mNQDtLH2EPN1HzgmwxIevL+Ud
-6H6wCZQrZxp9bah/BKjChfURDK7gmUzY0F/sbi1upI4uVuwUrMsYroKBS4R4crHm
-mqH1ACY8pih/d/4tpsGTs0ruLkFd5dGh/Vopcx7U4iPBxTL8SvkcUQ3TYqTjcKaV
-Zb8DoiKaGmVRUFEqYtiBPykC0MNRDK8DZTuIbwZPQM0c3OWCGm2JPR6qQfgCacyY
-JirsuN9gCMxXVCjLcaxCgWiftvhnr9YpdOYkX4ROY9qo4JNGN6Pd8Q5qX5GvSwa9
-fdtMn0shCyv2MRgSq2SfZ5+DT3eUUrDQkNQoHOxxR9VPdYcPFDNLgAbydwnrlqwZ
-X9rnaKuoRaJ6N4rOgJoaUR3LVXs8QrIGcJx9VRplm2NuElsDMm7fkAEEs2y/yAeW
-qjkVnwITCKB9qoMSjpj8KpjHYdXWZqdTJWNLdKLK3iH/2lpp71utobSNLjdojifN
-wmdQNzdVwAg56R7+YDDyCPEBsPO89s8b2E8SuYF2A9KRTD5Usd3k5aaMkaLrf4bu
-igpW7MBWwE9HQjMSgX8HxHsBDl/TGhK/c/GsTBN9UlUD1MFi9yn5PmtL+lcCAwEA
-AQKCAgBfm+NDOJu5lJbs6tGk3DruRDnSygRkHiZWrTbBKaW2ICwJy9rjnJq5IpS+
-dhS1lrOd0efXkQlTFJkemyg/MbZIL21HNwxWH4BlhvV1RJQl7t/scNW2cj1JtQoE
-X2hmxwaTcFXPj7Fk96kOINDe1fhVGPAZ2oU0/UodJ7s9K7fXg2LJQ8kCnvuOPPHn
-LoPgvHHSb6iVF8dZXkuGguK8HQb5jHPsqGboRYSZH9io9EX6UPNTvLqF3d3g2Ctl
-x1dnBi77HJJTAQcr2yj+QB+ytoOkJOQjCX2bUGOyis2ULrPIC6W3HI/KcDz2BC5k
-+HlDqIQsm6W4qtTmnlx+auuAeFDOnr2lpPt4hVlyq3jkkSUqrcYs9NBsPdXz+80K
-+NzRnv9EytHsliZJd4hUxwyh6y0BEo9QqgrpjlTFxYmRTGzZUu9qtcSCcVg9saZy
-vvJxFuzs5zDBqL44pMbNF/NB6fDYgkDEUOdAO6QVl6lPc3sYJcyQ0JNR2cWwlCq7
-EaamUJwTcCzUIT1ych/lYzVXqFF12urPavrqsaMbFHOQIRC9mjMgnm/eHZXB744e
-nhe7YFL94fxvMD+Ekr+3tVFskVfYYUwuQnUOCwxprnZXQxSAiABhbANBg4LOzBqP
-0yWSK7yrvjC0ktnt3q9NRtY8zRrZypric++zbhLddGdxydVCGQKCAQEA83f2WnZd
-UdbP2XhDoY/hYoVm48mgn81neElxxwalom39BJ4meHGAeDq6XDOZtRn2tiiAh+HJ
-JHU7twtHlHttkSjqP0a7zVCHbIostJZRLZRa1bAlu9hjynuHmMu3/7AcNJhYV1gH
-cJTFo4w4EkFUT3zcuMrJpkWbJ+syDNa+x22Vx/YR0Wk7PPVE32lXzOYx4KYk8R8g
-B7PvePJW3wPaWSC5sgPzmbpnbHTEP8pRN9N173IFF0S00wwV5Pea3ltOB5R2ALkZ
-pkTo/ck5xmcEwEk8DZsybe/uE/gyBoSRhOEqCbgxb/qkq/guYaHo7lvjGRjhgF16
-3orwBStzjZCjNQKCAQEA26anyawLGKgIix2eQAXO7GxPmQToWdp5JGZr9u7bnGrp
-Q5qJBe4gx26WgDa17zonAD9YgE7Fv5WV/zjqiI06wNSDostz6OayUsn5tttFWlVv
-QlBWBspQu8alhCq4OgxMfhxXEGQtWrqc3TlJMebEsiTlrqP7bnvpGwADVGuhUyQ7
-t+L9oQ8SBgcJ+gGOc0P3GDPGni36itqxYNO/e1edkQAsdQh5TEsTsT1uNxPXOvv9
-PMK0QhP/jECBjjQ8MAuMnYalQl0y8WqqQPgGKUHlx20Aydy9IBUTWpG2t0Gxcike
-WncXomBJSEXppp8uNiz5gqKqyq4ODFZa14FlbZ5s2wKCAQEA6zmdxGzTYHxgOEXf
-Ybq3EQ6+B5oIHBzBuQ+MY7PiV3pYmBuMI5XVf1OONgKMoNJC8F9VPvM/+H9jgEff
-km9lvnd/Sj82tvj0vkMJSjhomdbZo9cZvdElKL4Mle1NCjXGKnJ993VPStAR2x9g
-FRMVN+70+XzDMmfRrdGoe4sGq3sO2TC+qko3N3/oWMlYUNiem+MpkeR2d7q6xWmt
-0K3SSYY6ouj6dC4KOljeOptnuL4PFZZdoMt6wOTOSneHIwmn697d23j6dQ/i4z+F
-GFDz4CthX+vv3xOOO7Dx9CYkyfMZQGa7LOtGKfgQJ7fcal5QnTDSvciTK2uk1fnT
-HJT/eQKCAQABbl2Lf9Z2q6malm/QhPkrKy19lr2Y0EaXyR8M9dNyenPYn+oiosGN
-6xeJ8FFRJLTaWI9QDrNVIzld91X328u1M+1Do0W3D8G7rls1KMqT4xidev6Efs71
-2j571PdsUWYyMCcVEUIGZE7fVh829wTzEDB66dCakK4dIevjoevkKclF0nHKmdmJ
-NoSHH3l5IMk8XCIAJ9aJDxG2ysplmFWLe0/O12ZK6/ZN4lOUgkmVtcyZl78q6wxw
-Mn9lmMuHmJuq7xSmkQri7cn8MGGB5U8E9J3bstd8nQaKQYbKPOBWGRR8jGgYA76W
-fPYfwsu/SJ27jynDtkybIfjnjI1HoI+fAoIBAQCMrcRGmksweAgFs/fq24pYxV/K
-oF98txTINrV7MJQamDfpzqlCML9Vo8WFk56BRGj9NqOU+kgvi3aTfRhN5kSeE6y/
-Kb/u89dVYhKpzr2zAy9/msup8yPKD9sT/c7S3DJRlNp5DXy48MSntz0+k710SaYe
-1GXOwfch8WwkkVpgWY/08WRuNbRbD7Jmkqjz/PtcirkewljpWn+05kUSqAgEyBfy
-kCahABRtdH0FAMQjzqb5kS/g0K4BEje9ie81wvtd3r2b89WSgBDFCno/Oq8hKEC0
-DP828OmbLWSiRvnYCcKxVaWnDvsgFTALySB89dQpTGEWFoHC1XbNJgnwg/9l
------END RSA PRIVATE KEY-----
diff --git a/dev/authelia/users_database.yml b/dev/authelia/users_database.yml
deleted file mode 100644
index 2e16b9d..0000000
--- a/dev/authelia/users_database.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-users:
- alice@example.com:
- displayname: Alice
- password: "$argon2id$v=19$m=65536,t=3,p=4$S3hTSS90U1QycjNEWURZTw$aJP1fI/byC/3A7NCz5lyrXR7NS+l+1YMnqj5qFopZRk"
- email: alice@example.com
- bob@example.com:
- displayname: "Bob"
- password: "$argon2id$v=19$m=65536,t=3,p=4$amxRcURFVUk4TlhPOXFmWg$sPRsvGg9rrqefRp0fFA7wQG3O8OcMnQhj4IckHYPEz8"
- email: bob@example.com
- admin@example.com:
- displayname: "Admin"
- password: "$argon2id$v=19$m=65536,t=3,p=4$SFBXa1BXblNZKytoZ1ZLYQ$JruWROu9opYmcPNw1cIiHms4k4466DqrKIPvJe94nfA"
- email: admin@example.com
\ No newline at end of file
diff --git a/dev/docker-compose.yml b/dev/docker-compose.yml
deleted file mode 100644
index e4136dc..0000000
--- a/dev/docker-compose.yml
+++ /dev/null
@@ -1,40 +0,0 @@
-version: '2.4'
-services:
- nginx:
- image: nginx:1.25
- volumes:
- - ./nginx.conf:/etc/nginx/nginx.conf:ro
- ports: [ "80:80", "8529:8529", "9000:9000", "8082:8082", "9003:9003" ]
- networks: [ catalyst ]
-
- arangodb:
- image: arangodb/arangodb:3.8.1
- environment:
- ARANGO_ROOT_PASSWORD: foobar
- networks: [ catalyst ]
-
- minio:
- image: minio/minio:RELEASE.2021-12-10T23-03-39Z
- environment:
- MINIO_ROOT_USER: minio
- MINIO_ROOT_PASSWORD: minio123
- command: server /data -console-address ":9003"
- networks: [ catalyst ]
-
- authelia:
- image: authelia/authelia:4
- environment:
- AUTHELIA_JWT_SECRET: "AUTHELIA_JWT_SECRET"
- AUTHELIA_IDENTITY_PROVIDERS_OIDC_ISSUER_PRIVATE_KEY_FILE: "/config/private.pem"
- AUTHELIA_IDENTITY_PROVIDERS_OIDC_HMAC_SECRET: "AUTHELIA_HMAC_SECRET"
- AUTHELIA_STORAGE_ENCRYPTION_KEY: "AUTHELIA_STORAGE_ENCRYPTION_KEY"
- AUTHELIA_SESSION_SECRET: "AUTHELIA_SESSION_SECRET"
- volumes:
- - ./authelia/configuration.yml:/config/configuration.yml
- - ./authelia/users_database.yml:/config/users_database.yml
- - ./authelia/private.pem:/config/private.pem
- networks: [ catalyst ]
-
-networks:
- catalyst:
- name: catalyst
diff --git a/dev/nginx.conf b/dev/nginx.conf
deleted file mode 100644
index e28e93c..0000000
--- a/dev/nginx.conf
+++ /dev/null
@@ -1,117 +0,0 @@
-user www-data;
-worker_processes 5;
-error_log /var/log/nginx/error.log;
-
-events {
- worker_connections 4096;
-}
-
-http {
- include mime.types;
- index index.html index.htm;
-
- log_format main '$remote_addr - $remote_user [$time_local] $status '
- '"$request" $body_bytes_sent "$http_referer" '
- '"$http_user_agent" "$http_x_forwarded_for"';
- access_log /var/log/nginx/access.log main;
-
- server {
- listen 80 default_server;
- server_name _;
-
- location / {
- resolver 127.0.0.11 valid=30s;
- set $upstream_catalyst host.docker.internal;
- proxy_pass http://$upstream_catalyst:8000;
- }
-
- location /wss {
- resolver 127.0.0.11 valid=30s;
- set $upstream_catalyst host.docker.internal;
- proxy_pass http://$upstream_catalyst:8000;
-
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
- proxy_read_timeout 86400;
- }
- }
-
- server {
- listen 8529 default_server;
- server_name _;
-
- location / {
- resolver 127.0.0.11 valid=30s;
- set $upstream_arangodb arangodb;
- proxy_pass http://$upstream_arangodb:8529;
- }
- }
-
- server {
- listen 9000 default_server;
- server_name _;
-
- location / {
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header Host $http_host;
-
- proxy_connect_timeout 300;
- # Default is HTTP/1, keepalive is only enabled in HTTP/1.1
- proxy_http_version 1.1;
- proxy_set_header Connection "";
- chunked_transfer_encoding off;
-
- resolver 127.0.0.11 valid=30s;
- set $upstream_minio minio;
- proxy_pass http://$upstream_minio:9000;
- }
- }
-
- server {
- listen 8082 default_server;
- server_name _;
-
- location / {
- resolver 127.0.0.11 valid=30s;
- set $upstream_authelia authelia;
- proxy_pass http://$upstream_authelia:8082;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header X-Forwarded-Host $http_host;
- proxy_set_header X-Forwarded-Uri $request_uri;
- proxy_set_header X-Forwarded-Ssl on;
- proxy_http_version 1.1;
- proxy_set_header Connection "";
- proxy_cache_bypass $cookie_session;
- proxy_no_cache $cookie_session;
- proxy_buffers 64 256k;
- }
- }
-
- server {
- listen 9003 default_server;
- server_name _;
-
- location / {
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header Host $http_host;
-
- proxy_connect_timeout 300;
- # Default is HTTP/1, keepalive is only enabled in HTTP/1.1
- proxy_http_version 1.1;
- proxy_set_header Connection "";
- chunked_transfer_encoding off;
-
- resolver 127.0.0.11 valid=30s;
- set $upstream_minio minio;
- proxy_pass http://$upstream_minio:9003;
- }
- }
-}
diff --git a/dev/start_dev.sh b/dev/start_dev.sh
deleted file mode 100755
index da300e7..0000000
--- a/dev/start_dev.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-set -e
-
-export SECRET=4ef5b29539b70233dd40c02a1799d25079595565e05a193b09da2c3e60ada1cd
-
-export SIMPLE_AUTH_ENABLE=false
-export OIDC_ENABLE=true
-export OIDC_ISSUER=http://localhost:8082
-export OIDC_CLIENT_SECRET=secret
-
-export ARANGO_DB_HOST=http://localhost:8529
-export ARANGO_DB_PASSWORD=foobar
-export S3_HOST=http://localhost:9000
-export S3_REGION=eu-central-1
-export S3_PASSWORD=minio123
-
-export AUTH_BLOCK_NEW=false
-export AUTH_DEFAULT_ROLES=analyst,admin
-
-export EXTERNAL_ADDRESS=http://localhost
-export CATALYST_ADDRESS=http://host.docker.internal
-export INITIAL_API_KEY=d0169af94c40981eb4452a42fae536b6caa9be3a
-
-go run ../cmd/catalyst-dev/*.go
diff --git a/docs/screenshots/automation.png b/docs/screenshots/automation.png
deleted file mode 100644
index 5c011cb..0000000
Binary files a/docs/screenshots/automation.png and /dev/null differ
diff --git a/docs/screenshots/cond_custom_1.png b/docs/screenshots/cond_custom_1.png
deleted file mode 100644
index c833337..0000000
Binary files a/docs/screenshots/cond_custom_1.png and /dev/null differ
diff --git a/docs/screenshots/cond_custom_2.png b/docs/screenshots/cond_custom_2.png
deleted file mode 100644
index dff8050..0000000
Binary files a/docs/screenshots/cond_custom_2.png and /dev/null differ
diff --git a/docs/screenshots/conditional_custom_field_a.png b/docs/screenshots/conditional_custom_field_a.png
deleted file mode 100644
index 8b16eef..0000000
Binary files a/docs/screenshots/conditional_custom_field_a.png and /dev/null differ
diff --git a/docs/screenshots/conditional_custom_field_b.png b/docs/screenshots/conditional_custom_field_b.png
deleted file mode 100644
index 86012de..0000000
Binary files a/docs/screenshots/conditional_custom_field_b.png and /dev/null differ
diff --git a/docs/screenshots/dashboard.png b/docs/screenshots/dashboard.png
index 8c4629b..ad7072e 100644
Binary files a/docs/screenshots/dashboard.png and b/docs/screenshots/dashboard.png differ
diff --git a/docs/screenshots/details.png b/docs/screenshots/details.png
deleted file mode 100644
index 7fc82e4..0000000
Binary files a/docs/screenshots/details.png and /dev/null differ
diff --git a/docs/screenshots/phishing_playbook.png b/docs/screenshots/phishing_playbook.png
deleted file mode 100644
index 7660390..0000000
Binary files a/docs/screenshots/phishing_playbook.png and /dev/null differ
diff --git a/docs/screenshots/playbooks.png b/docs/screenshots/playbooks.png
deleted file mode 100644
index 8394dde..0000000
Binary files a/docs/screenshots/playbooks.png and /dev/null differ
diff --git a/docs/screenshots/playbooks_focus.png b/docs/screenshots/playbooks_focus.png
deleted file mode 100644
index f776f24..0000000
Binary files a/docs/screenshots/playbooks_focus.png and /dev/null differ
diff --git a/docs/screenshots/roles.png b/docs/screenshots/roles.png
deleted file mode 100644
index e747945..0000000
Binary files a/docs/screenshots/roles.png and /dev/null differ
diff --git a/docs/screenshots/script.png b/docs/screenshots/script.png
deleted file mode 100644
index 51a6d31..0000000
Binary files a/docs/screenshots/script.png and /dev/null differ
diff --git a/docs/screenshots/tasks.png b/docs/screenshots/tasks.png
new file mode 100644
index 0000000..08f9cd6
Binary files /dev/null and b/docs/screenshots/tasks.png differ
diff --git a/docs/screenshots/template.png b/docs/screenshots/template.png
deleted file mode 100644
index 12660c7..0000000
Binary files a/docs/screenshots/template.png and /dev/null differ
diff --git a/docs/screenshots/ticket.png b/docs/screenshots/ticket.png
index 8c0c4ef..b6b8525 100644
Binary files a/docs/screenshots/ticket.png and b/docs/screenshots/ticket.png differ
diff --git a/fakedata/records.go b/fakedata/records.go
new file mode 100644
index 0000000..7fdd0d0
--- /dev/null
+++ b/fakedata/records.go
@@ -0,0 +1,224 @@
+package fakedata
+
+import (
+ "fmt"
+ "strings"
+ "time"
+
+ "github.com/brianvoe/gofakeit/v7"
+ "github.com/pocketbase/pocketbase"
+ "github.com/pocketbase/pocketbase/daos"
+ "github.com/pocketbase/pocketbase/models"
+ "github.com/pocketbase/pocketbase/tools/security"
+
+ "github.com/SecurityBrewery/catalyst/migrations"
+)
+
+const (
+ minimumUserCount = 1
+ minimumTicketCount = 1
+)
+
+func Generate(app *pocketbase.PocketBase, userCount, ticketCount int) error {
+ if userCount < minimumUserCount {
+ userCount = minimumUserCount
+ }
+
+ if ticketCount < minimumTicketCount {
+ ticketCount = minimumTicketCount
+ }
+
+ types, err := app.Dao().FindRecordsByExpr(migrations.TypeCollectionName)
+ if err != nil {
+ return err
+ }
+
+ users := userRecords(app.Dao(), userCount)
+ tickets := ticketRecords(app.Dao(), users, types, ticketCount)
+ webhooks := webhookRecords(app.Dao())
+
+ for _, records := range [][]*models.Record{users, tickets, webhooks} {
+ for _, record := range records {
+ if err := app.Dao().SaveRecord(record); err != nil {
+ app.Logger().Error(err.Error())
+ }
+ }
+ }
+
+ return nil
+}
+
+func userRecords(dao *daos.Dao, count int) []*models.Record {
+ collection, err := dao.FindCollectionByNameOrId(migrations.UserCollectionName)
+ if err != nil {
+ panic(err)
+ }
+
+ var records []*models.Record
+
+ // create the test user
+ if _, err := dao.FindRecordById(migrations.UserCollectionName, "u_test"); err != nil {
+ record := models.NewRecord(collection)
+ record.SetId("u_test")
+ _ = record.SetUsername("u_test")
+ _ = record.SetPassword("1234567890")
+ record.Set("name", gofakeit.Name())
+ record.Set("email", "user@catalyst-soar.com")
+ _ = record.SetVerified(true)
+
+ records = append(records, record)
+ }
+
+ for range count - 1 {
+ record := models.NewRecord(collection)
+ record.SetId("u_" + security.PseudorandomString(10))
+ _ = record.SetUsername("u_" + security.RandomStringWithAlphabet(5, "123456789"))
+ _ = record.SetPassword("1234567890")
+ record.Set("name", gofakeit.Name())
+ record.Set("email", gofakeit.Username()+"@catalyst-soar.com")
+ _ = record.SetVerified(true)
+
+ records = append(records, record)
+ }
+
+ return records
+}
+
+func ticketRecords(dao *daos.Dao, users, types []*models.Record, count int) []*models.Record {
+ collection, err := dao.FindCollectionByNameOrId(migrations.TicketCollectionName)
+ if err != nil {
+ panic(err)
+ }
+
+ var records []*models.Record
+
+ created := time.Now()
+ number := gofakeit.Number(200*count, 300*count)
+
+ for range count {
+ number -= gofakeit.Number(100, 200)
+ created = created.Add(time.Duration(-gofakeit.Number(13, 37)) * time.Hour)
+
+ record := models.NewRecord(collection)
+ record.SetId("t_" + security.PseudorandomString(10))
+
+ updated := gofakeit.DateRange(created, time.Now())
+
+ ticketType := random(types)
+
+ record.Set("created", created.Format("2006-01-02T15:04:05Z"))
+ record.Set("updated", updated.Format("2006-01-02T15:04:05Z"))
+
+ record.Set("name", fmt.Sprintf("%s-%d", strings.ToUpper(ticketType.GetString("singular")), number))
+ record.Set("type", ticketType.GetId())
+ record.Set("description", fakeTicketDescription())
+ record.Set("open", gofakeit.Bool())
+ record.Set("schema", `{"type":"object","properties":{"tlp":{"title":"TLP","type":"string"}}}`)
+ record.Set("state", `{"tlp":"AMBER"}`)
+ record.Set("owner", random(users).GetId())
+
+ records = append(records, record)
+
+ // Add comments
+ for range gofakeit.IntN(5) {
+ commentCollection, err := dao.FindCollectionByNameOrId(migrations.CommentCollectionName)
+ if err != nil {
+ panic(err)
+ }
+
+ commentCreated := gofakeit.DateRange(created, time.Now())
+ commentUpdated := gofakeit.DateRange(commentCreated, time.Now())
+
+ commentRecord := models.NewRecord(commentCollection)
+ commentRecord.SetId("c_" + security.PseudorandomString(10))
+ commentRecord.Set("created", commentCreated.Format("2006-01-02T15:04:05Z"))
+ commentRecord.Set("updated", commentUpdated.Format("2006-01-02T15:04:05Z"))
+ commentRecord.Set("ticket", record.GetId())
+ commentRecord.Set("author", random(users).GetId())
+ commentRecord.Set("message", fakeTicketComment())
+
+ records = append(records, commentRecord)
+ }
+
+ // Add timeline
+ for range gofakeit.IntN(5) {
+ timelineCollection, err := dao.FindCollectionByNameOrId(migrations.TimelineCollectionName)
+ if err != nil {
+ panic(err)
+ }
+
+ timelineCreated := gofakeit.DateRange(created, time.Now())
+ timelineUpdated := gofakeit.DateRange(timelineCreated, time.Now())
+
+ timelineRecord := models.NewRecord(timelineCollection)
+ timelineRecord.SetId("tl_" + security.PseudorandomString(10))
+ timelineRecord.Set("created", timelineCreated.Format("2006-01-02T15:04:05Z"))
+ timelineRecord.Set("updated", timelineUpdated.Format("2006-01-02T15:04:05Z"))
+ timelineRecord.Set("ticket", record.GetId())
+ timelineRecord.Set("time", gofakeit.DateRange(created, time.Now()).Format("2006-01-02T15:04:05Z"))
+ timelineRecord.Set("message", fakeTicketTimelineMessage())
+
+ records = append(records, timelineRecord)
+ }
+
+ // Add tasks
+ for range gofakeit.IntN(5) {
+ taskCollection, err := dao.FindCollectionByNameOrId(migrations.TaskCollectionName)
+ if err != nil {
+ panic(err)
+ }
+
+ taskCreated := gofakeit.DateRange(created, time.Now())
+ taskUpdated := gofakeit.DateRange(taskCreated, time.Now())
+
+ taskRecord := models.NewRecord(taskCollection)
+ taskRecord.SetId("ts_" + security.PseudorandomString(10))
+ taskRecord.Set("created", taskCreated.Format("2006-01-02T15:04:05Z"))
+ taskRecord.Set("updated", taskUpdated.Format("2006-01-02T15:04:05Z"))
+ taskRecord.Set("ticket", record.GetId())
+ taskRecord.Set("name", fakeTicketTask())
+ taskRecord.Set("open", gofakeit.Bool())
+ taskRecord.Set("owner", random(users).GetId())
+
+ records = append(records, taskRecord)
+ }
+
+ // Add links
+ for range gofakeit.IntN(5) {
+ linkCollection, err := dao.FindCollectionByNameOrId(migrations.LinkCollectionName)
+ if err != nil {
+ panic(err)
+ }
+
+ linkCreated := gofakeit.DateRange(created, time.Now())
+ linkUpdated := gofakeit.DateRange(linkCreated, time.Now())
+
+ linkRecord := models.NewRecord(linkCollection)
+ linkRecord.SetId("l_" + security.PseudorandomString(10))
+ linkRecord.Set("created", linkCreated.Format("2006-01-02T15:04:05Z"))
+ linkRecord.Set("updated", linkUpdated.Format("2006-01-02T15:04:05Z"))
+ linkRecord.Set("ticket", record.GetId())
+ linkRecord.Set("url", gofakeit.URL())
+ linkRecord.Set("name", random([]string{"Blog", "Forum", "Wiki", "Documentation"}))
+
+ records = append(records, linkRecord)
+ }
+ }
+
+ return records
+}
+
+func webhookRecords(dao *daos.Dao) []*models.Record {
+ collection, err := dao.FindCollectionByNameOrId(migrations.WebhookCollectionName)
+ if err != nil {
+ panic(err)
+ }
+
+ record := models.NewRecord(collection)
+ record.SetId("w_" + security.PseudorandomString(10))
+ record.Set("name", "Test Webhook")
+ record.Set("collection", "tickets")
+ record.Set("destination", "http://localhost:8080/webhook")
+
+ return []*models.Record{record}
+}
diff --git a/fakedata/text.go b/fakedata/text.go
new file mode 100644
index 0000000..ea6b486
--- /dev/null
+++ b/fakedata/text.go
@@ -0,0 +1,106 @@
+package fakedata
+
+import "github.com/brianvoe/gofakeit/v7"
+
+func fakeTicketDescription() string {
+ return random([]string{
+ "Unauthorized access attempt detected in the main server room.",
+ "Multiple failed login attempts from an unknown IP address.",
+ "Suspicious file download flagged by antivirus software.",
+ "User account locked due to repeated incorrect password entries.",
+ "Unusual network activity observed on the internal firewall.",
+ "Phishing email reported by several employees.",
+ "Sensitive data transfer detected outside the approved hours.",
+ "Malware infection found on a workstation in the finance department.",
+ "Unauthorized device connected to the company network.",
+ "Brute-force attack attempt on the admin account detected.",
+ "Security patch required for vulnerability in outdated software.",
+ "External IP address attempting to probe network ports.",
+ "Suspicious behavior detected by user in HR department.",
+ "Unauthorized software installation on company laptop.",
+ "Access control system malfunction at the main entrance.",
+ "DDoS attack detected on company web server.",
+ "Unusual outbound traffic to a known malicious domain.",
+ "Potential insider threat flagged by behavior analysis tool.",
+ "Compromised credentials detected on dark web.",
+ "Encryption key rotation required for compliance with security policy.",
+ })
+}
+
+func fakeTicketComment() string {
+ return random([]string{
+ "Ticket opened by user.",
+ "Initial investigation started.",
+ "Further analysis required.",
+ "Escalated to security team.",
+ "Action taken to mitigate risk.",
+ "Resolution in progress.",
+ "User notified of incident.",
+ "Security incident confirmed.",
+ "Containment measures implemented.",
+ "Root cause analysis underway.",
+ "Forensic investigation initiated.",
+ "Data breach confirmed.",
+ "Incident response team activated.",
+ "Legal counsel consulted.",
+ "Public relations notified.",
+ "Regulatory authorities informed.",
+ "Compensation plan developed.",
+ "Press release drafted.",
+ "Media monitoring in progress.",
+ "Post-incident review scheduled.",
+ })
+}
+
+func fakeTicketTimelineMessage() string {
+ return random([]string{
+ "Initial investigation started.",
+ "Further analysis required.",
+ "Escalated to security team.",
+ "Action taken to mitigate risk.",
+ "Resolution in progress.",
+ "User notified of incident.",
+ "Security incident confirmed.",
+ "Containment measures implemented.",
+ "Root cause analysis underway.",
+ "Forensic investigation initiated.",
+ "Data breach confirmed.",
+ "Incident response team activated.",
+ "Legal counsel consulted.",
+ "Public relations notified.",
+ "Regulatory authorities informed.",
+ "Compensation plan developed.",
+ "Press release drafted.",
+ "Media monitoring in progress.",
+ "Post-incident review scheduled.",
+ })
+}
+
+func fakeTicketTask() string {
+ return random([]string{
+ "Interview witnesses.",
+ "Review security camera footage.",
+ "Analyze network traffic logs.",
+ "Scan for malware on affected systems.",
+ "Check for unauthorized software installations.",
+ "Conduct vulnerability assessment.",
+ "Implement security patch.",
+ "Change firewall rules.",
+ "Reset compromised credentials.",
+ "Isolate infected systems.",
+ "Monitor for further suspicious activity.",
+ "Coordinate with law enforcement.",
+ "Notify affected customers.",
+ "Prepare incident report.",
+ "Update security policies.",
+ "Train employees on security best practices.",
+ "Conduct post-incident review.",
+ "Implement lessons learned.",
+ "Improve incident response procedures.",
+ "Enhance security awareness program.",
+ })
+}
+
+func random[T any](e []T) T {
+ return e[gofakeit.IntN(len(e))]
+}
diff --git a/file.go b/file.go
deleted file mode 100644
index 0f77641..0000000
--- a/file.go
+++ /dev/null
@@ -1,191 +0,0 @@
-package catalyst
-
-import (
- "context"
- "errors"
- "fmt"
- "io"
- "log"
- "net/http"
- "strconv"
-
- "github.com/arangodb/go-driver"
- "github.com/aws/aws-sdk-go/aws"
- "github.com/aws/aws-sdk-go/service/s3"
- "github.com/aws/aws-sdk-go/service/s3/s3manager"
- "github.com/go-chi/chi/v5"
- maut "github.com/jonas-plum/maut/auth"
- tusd "github.com/tus/tusd/pkg/handler"
- "github.com/tus/tusd/pkg/s3store"
-
- "github.com/SecurityBrewery/catalyst/bus"
- "github.com/SecurityBrewery/catalyst/database"
- "github.com/SecurityBrewery/catalyst/generated/api"
- "github.com/SecurityBrewery/catalyst/generated/model"
- "github.com/SecurityBrewery/catalyst/storage"
-)
-
-func tusdUpload(db *database.Database, catalystBus *bus.Bus, client *s3.S3, external string) http.HandlerFunc {
- return func(w http.ResponseWriter, r *http.Request) {
- ticketID := chi.URLParam(r, "ticketID")
- if ticketID == "" {
- api.JSONErrorStatus(w, http.StatusBadRequest, errors.New("ticketID not given"))
-
- return
- }
-
- if err := storage.CreateBucket(client, ticketID); err != nil {
- api.JSONErrorStatus(w, http.StatusBadRequest, fmt.Errorf("could not create bucket: %w", err))
-
- return
- }
-
- store := s3store.New("catalyst-"+ticketID, client)
-
- composer := tusd.NewStoreComposer()
- store.UseIn(composer)
-
- handler, err := tusd.NewUnroutedHandler(tusd.Config{
- BasePath: external + "/api/files/" + ticketID + "/tusd/",
- StoreComposer: composer,
- NotifyCompleteUploads: true,
- })
- if err != nil {
- api.JSONErrorStatus(w, http.StatusBadRequest, fmt.Errorf("could not create tusd handler: %w", err))
-
- return
- }
-
- userID := "unknown"
- user, _, ok := maut.UserFromContext(r.Context())
- if ok {
- userID = user.ID
- }
-
- go func() {
- event := <-handler.CompleteUploads
-
- id, err := strconv.ParseInt(ticketID, 10, 64)
- if err != nil {
- return
- }
-
- file := &model.File{Key: event.Upload.Storage["Key"], Name: event.Upload.MetaData["filename"]}
-
- ctx := context.Background()
- doc, err := db.AddFile(ctx, id, file)
- if err != nil {
- log.Println(err)
-
- return
- }
-
- catalystBus.RequestChannel.Publish(&bus.RequestMsg{
- User: userID,
- Function: "LinkFiles",
- IDs: []driver.DocumentID{driver.DocumentID(fmt.Sprintf("tickets/%d", doc.ID))},
- })
- }()
-
- switch r.Method {
- case http.MethodHead:
- handler.HeadFile(w, r)
- case http.MethodPost:
- handler.PostFile(w, r)
- case http.MethodPatch:
- handler.PatchFile(w, r)
- default:
- api.JSONErrorStatus(w, http.StatusInternalServerError, errors.New("unknown method"))
- }
- }
-}
-
-func upload(db *database.Database, client *s3.S3, uploader *s3manager.Uploader) http.HandlerFunc {
- return func(w http.ResponseWriter, r *http.Request) {
- ticketID := chi.URLParam(r, "ticketID")
- if ticketID == "" {
- api.JSONErrorStatus(w, http.StatusBadRequest, errors.New("ticketID not given"))
-
- return
- }
-
- file, header, err := r.FormFile("file")
- if err != nil {
- api.JSONErrorStatus(w, http.StatusBadRequest, err)
-
- return
- }
- defer file.Close()
-
- if err := storage.CreateBucket(client, ticketID); err != nil {
- api.JSONErrorStatus(w, http.StatusBadRequest, fmt.Errorf("could not create bucket: %w", err))
-
- return
- }
-
- _, err = uploader.Upload(&s3manager.UploadInput{
- Bucket: aws.String("catalyst-" + ticketID),
- Key: aws.String(header.Filename),
- Body: file,
- })
- if err != nil {
- api.JSONErrorStatus(w, http.StatusBadRequest, err)
-
- return
- }
-
- id, err := strconv.ParseInt(ticketID, 10, 64)
- if err != nil {
- api.JSONErrorStatus(w, http.StatusBadRequest, err)
-
- return
- }
-
- _, err = db.AddFile(r.Context(), id, &model.File{
- Key: header.Filename,
- Name: header.Filename,
- })
- if err != nil {
- api.JSONErrorStatus(w, http.StatusBadRequest, err)
-
- return
- }
- }
-}
-
-func download(downloader *s3manager.Downloader) http.HandlerFunc {
- return func(w http.ResponseWriter, r *http.Request) {
- ticketID := chi.URLParam(r, "ticketID")
- if ticketID == "" {
- api.JSONErrorStatus(w, http.StatusBadRequest, errors.New("ticketID not given"))
-
- return
- }
-
- key := chi.URLParam(r, "key")
- if key == "" {
- api.JSONErrorStatus(w, http.StatusBadRequest, errors.New("key not given"))
-
- return
- }
-
- buf := sequentialWriter{w}
-
- downloader.Concurrency = 1
- _, err := downloader.Download(buf, &s3.GetObjectInput{
- Bucket: aws.String("catalyst-" + ticketID),
- Key: aws.String(key),
- })
- if err != nil {
- api.JSONErrorStatus(w, http.StatusInternalServerError, err)
- }
- }
-}
-
-type sequentialWriter struct {
- w io.Writer
-}
-
-func (fw sequentialWriter) WriteAt(p []byte, _ int64) (n int, err error) {
- return fw.w.Write(p)
-}
diff --git a/flags.go b/flags.go
new file mode 100644
index 0000000..d1aea9d
--- /dev/null
+++ b/flags.go
@@ -0,0 +1,22 @@
+package main
+
+import (
+ "github.com/pocketbase/pocketbase/core"
+
+ "github.com/SecurityBrewery/catalyst/migrations"
+)
+
+func flags(app core.App) ([]string, error) {
+ records, err := app.Dao().FindRecordsByExpr(migrations.FeatureCollectionName)
+ if err != nil {
+ return nil, err
+ }
+
+ var flags []string
+
+ for _, r := range records {
+ flags = append(flags, r.GetString("name"))
+ }
+
+ return flags, nil
+}
diff --git a/generate.sh b/generate.sh
deleted file mode 100644
index 7f1c3ec..0000000
--- a/generate.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-set -e
-
-rm -rf generated
-
-mkdir generated
-spruce merge definition/*.yaml >generated/community.yml
-spruce merge definition/*.yaml definition/enterprise/*.yaml >generated/catalyst.yml
-
-echo generate caql parser and lexer
-cd definition || exit
-# antlr 4.10.1
-antlr -Dlanguage=Go -o ../generated/caql/parser CAQLParser.g4 CAQLLexer.g4
-antlr -Dlanguage=JavaScript -o ../ui/src/suggestions/grammar CAQLParser.g4 CAQLLexer.g4
-cd ..
-
-echo generate json
-# openapi-generator 6.0.0
-openapi-generator generate -i generated/community.yml -o generated -g openapi
-mv generated/openapi.json generated/community.json
-openapi-generator generate -i generated/catalyst.yml -o generated -g openapi
-mv generated/openapi.json generated/catalyst.json
-
-echo generate server and tests
-swagger-go-chi generated/community.yml generated
-rm -rf generated/auth generated/cli
-find generated -type f -name "*.go" -print0 | xargs -0 sed -i '' -e 's#"github.com/go-chi/chi"#"github.com/go-chi/chi/v5"#g'
-
-echo generate typescript client
-openapi-generator generate -i generated/catalyst.yml -o ui/src/client -g typescript-axios --artifact-version 1.0.0-SNAPSHOT
-
-rm -rf gen
-rm -rf generated/models/old
-rm -rf generated/.openapi-generator generated/.openapi-generator-ignore generated/README.md
-rm -rf ui/src/client/.openapi-generator ui/src/client/git_push.sh ui/src/client/.gitignore ui/src/client/.openapi-generator-ignore
-
-gofmt -w -r 'interface{} -> any' .
-go mod tidy
-gci write --Section Standard --Section Default --Section "Prefix(github.com/SecurityBrewery/catalyst)" .
-cd ../..
diff --git a/generated/api/api.go b/generated/api/api.go
deleted file mode 100755
index ddd24b2..0000000
--- a/generated/api/api.go
+++ /dev/null
@@ -1,192 +0,0 @@
-package api
-
-import (
- "bytes"
- "encoding/json"
- "errors"
- "fmt"
- "net/http"
- "strconv"
-
- "github.com/go-chi/chi/v5"
- "github.com/xeipuuv/gojsonschema"
-)
-
-type HTTPError struct {
- Status int
- Internal error
-}
-
-func (e *HTTPError) Error() string {
- return fmt.Sprintf("HTTPError(%d): %s", e.Status, e.Internal)
-}
-
-func (e *HTTPError) Unwrap() error {
- return e.Internal
-}
-
-func parseURLInt64(r *http.Request, s string) (int64, error) {
- i, err := strconv.ParseInt(chi.URLParam(r, s), 10, 64)
- if err != nil {
- return 0, fmt.Errorf("%w", &HTTPError{http.StatusUnprocessableEntity, err})
- }
- return i, nil
-}
-
-func parseURLInt(r *http.Request, s string) (int, error) {
- i, err := strconv.Atoi(chi.URLParam(r, s))
- if err != nil {
- return 0, fmt.Errorf("%w", &HTTPError{http.StatusUnprocessableEntity, err})
- }
- return i, nil
-}
-
-func parseQueryInt(r *http.Request, s string) (int, error) {
- i, err := strconv.Atoi(r.URL.Query().Get(s))
- if err != nil {
- return 0, fmt.Errorf("%w", &HTTPError{http.StatusUnprocessableEntity, err})
- }
- return i, nil
-}
-
-func parseQueryBool(r *http.Request, s string) (bool, error) {
- b, err := strconv.ParseBool(r.URL.Query().Get(s))
- if err != nil {
- return false, fmt.Errorf("%w", &HTTPError{http.StatusUnprocessableEntity, err})
- }
- return b, nil
-}
-
-func parseQueryStringArray(r *http.Request, key string) ([]string, error) {
- stringArray, ok := r.URL.Query()[key]
- if !ok {
- return nil, nil
- }
- return removeEmpty(stringArray), nil
-}
-
-func removeEmpty(l []string) []string {
- var stringArray []string
- for _, s := range l {
- if s == "" {
- continue
- }
- stringArray = append(stringArray, s)
- }
-
- return stringArray
-}
-
-func parseQueryBoolArray(r *http.Request, key string) ([]bool, error) {
- stringArray, ok := r.URL.Query()[key]
- if !ok {
- return nil, nil
- }
- var boolArray []bool
- for _, s := range stringArray {
- if s == "" {
- continue
- }
- b, err := strconv.ParseBool(s)
- if err != nil {
- return nil, fmt.Errorf("%w", &HTTPError{http.StatusUnprocessableEntity, err})
- }
- boolArray = append(boolArray, b)
- }
-
- return boolArray, nil
-}
-
-func parseQueryOptionalInt(r *http.Request, key string) (*int, error) {
- s := r.URL.Query().Get(key)
- if s == "" {
- return nil, nil
- }
-
- i, err := strconv.Atoi(s)
- if err != nil {
- return nil, fmt.Errorf("%w", &HTTPError{http.StatusUnprocessableEntity, err})
- }
- return &i, nil
-}
-
-func parseQueryOptionalStringArray(r *http.Request, key string) ([]string, error) {
- return parseQueryStringArray(r, key)
-}
-
-func parseQueryOptionalBoolArray(r *http.Request, key string) ([]bool, error) {
- return parseQueryBoolArray(r, key)
-}
-
-func parseBody(b []byte, i any) error {
- dec := json.NewDecoder(bytes.NewBuffer(b))
- err := dec.Decode(i)
- if err != nil {
- return fmt.Errorf("%w", &HTTPError{http.StatusUnprocessableEntity, err})
- }
- return nil
-}
-
-func JSONError(w http.ResponseWriter, err error) {
- JSONErrorStatus(w, http.StatusInternalServerError, err)
-}
-
-func JSONErrorStatus(w http.ResponseWriter, status int, err error) {
- w.WriteHeader(status)
- b, _ := json.Marshal(map[string]string{"error": err.Error()})
- w.Write(b)
-}
-
-func response(w http.ResponseWriter, v any, err error) {
- if err != nil {
- var httpError *HTTPError
- if errors.As(err, &httpError) {
- JSONErrorStatus(w, httpError.Status, httpError.Internal)
- return
- }
- JSONError(w, err)
- return
- }
-
- if v == nil {
- w.WriteHeader(http.StatusNoContent)
- return
- }
- w.WriteHeader(http.StatusOK)
- b, _ := json.Marshal(v)
- w.Write(b)
-}
-
-func validateSchema(body []byte, schema *gojsonschema.Schema, w http.ResponseWriter) bool {
- jl := gojsonschema.NewBytesLoader(body)
- validationResult, err := schema.Validate(jl)
- if err != nil {
- JSONError(w, err)
- return true
- }
- if !validationResult.Valid() {
- w.WriteHeader(http.StatusUnprocessableEntity)
-
- var validationErrors []string
- for _, valdiationError := range validationResult.Errors() {
- validationErrors = append(validationErrors, valdiationError.String())
- }
-
- b, _ := json.Marshal(map[string]any{"error": "wrong input", "errors": validationErrors})
- w.Write(b)
- return true
- }
- return false
-}
-
-func NilMiddleware() func(next http.Handler) http.Handler {
- return func(next http.Handler) http.Handler {
- return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- next.ServeHTTP(w, r)
- })
- }
-}
-
-func IgnoreRoles(_ []string) func(next http.Handler) http.Handler {
- return NilMiddleware()
-}
diff --git a/generated/api/server.go b/generated/api/server.go
deleted file mode 100755
index 2bd1186..0000000
--- a/generated/api/server.go
+++ /dev/null
@@ -1,1235 +0,0 @@
-package api
-
-import (
- "context"
- "io"
- "net/http"
-
- "github.com/go-chi/chi/v5"
-
- "github.com/SecurityBrewery/catalyst/generated/model"
-)
-
-type Service interface {
- ListAutomations(context.Context) ([]*model.AutomationResponse, error)
- CreateAutomation(context.Context, *model.AutomationForm) (*model.AutomationResponse, error)
- GetAutomation(context.Context, string) (*model.AutomationResponse, error)
- UpdateAutomation(context.Context, string, *model.AutomationForm) (*model.AutomationResponse, error)
- DeleteAutomation(context.Context, string) error
- CurrentUser(context.Context) (*model.UserResponse, error)
- CurrentUserData(context.Context) (*model.UserDataResponse, error)
- UpdateCurrentUserData(context.Context, *model.UserData) (*model.UserDataResponse, error)
- DashboardData(context.Context, string, *string) (map[string]any, error)
- ListDashboards(context.Context) ([]*model.DashboardResponse, error)
- CreateDashboard(context.Context, *model.Dashboard) (*model.DashboardResponse, error)
- GetDashboard(context.Context, string) (*model.DashboardResponse, error)
- UpdateDashboard(context.Context, string, *model.Dashboard) (*model.DashboardResponse, error)
- DeleteDashboard(context.Context, string) error
- ListJobs(context.Context) ([]*model.JobResponse, error)
- RunJob(context.Context, *model.JobForm) (*model.JobResponse, error)
- GetJob(context.Context, string) (*model.JobResponse, error)
- UpdateJob(context.Context, string, *model.JobUpdate) (*model.JobResponse, error)
- GetLogs(context.Context, string) ([]*model.LogEntry, error)
- ListPlaybooks(context.Context) ([]*model.PlaybookTemplateResponse, error)
- CreatePlaybook(context.Context, *model.PlaybookTemplateForm) (*model.PlaybookTemplateResponse, error)
- GetPlaybook(context.Context, string) (*model.PlaybookTemplateResponse, error)
- UpdatePlaybook(context.Context, string, *model.PlaybookTemplateForm) (*model.PlaybookTemplateResponse, error)
- DeletePlaybook(context.Context, string) error
- GetSettings(context.Context) (*model.SettingsResponse, error)
- SaveSettings(context.Context, *model.Settings) (*model.SettingsResponse, error)
- GetStatistics(context.Context) (*model.Statistics, error)
- ListTasks(context.Context) ([]*model.TaskWithContext, error)
- ListTemplates(context.Context) ([]*model.TicketTemplateResponse, error)
- CreateTemplate(context.Context, *model.TicketTemplateForm) (*model.TicketTemplateResponse, error)
- GetTemplate(context.Context, string) (*model.TicketTemplateResponse, error)
- UpdateTemplate(context.Context, string, *model.TicketTemplateForm) (*model.TicketTemplateResponse, error)
- DeleteTemplate(context.Context, string) error
- ListTickets(context.Context, *string, *int, *int, []string, []bool, *string) (*model.TicketList, error)
- CreateTicket(context.Context, *model.TicketForm) (*model.TicketResponse, error)
- CreateTicketBatch(context.Context, *model.TicketFormArray) error
- GetTicket(context.Context, int64) (*model.TicketWithTickets, error)
- UpdateTicket(context.Context, int64, *model.Ticket) (*model.TicketWithTickets, error)
- DeleteTicket(context.Context, int64) error
- AddArtifact(context.Context, int64, *model.Artifact) (*model.TicketWithTickets, error)
- GetArtifact(context.Context, int64, string) (*model.Artifact, error)
- SetArtifact(context.Context, int64, string, *model.Artifact) (*model.TicketWithTickets, error)
- RemoveArtifact(context.Context, int64, string) (*model.TicketWithTickets, error)
- EnrichArtifact(context.Context, int64, string, *model.EnrichmentForm) (*model.TicketWithTickets, error)
- RunArtifact(context.Context, int64, string, string) error
- AddComment(context.Context, int64, *model.CommentForm) (*model.TicketWithTickets, error)
- RemoveComment(context.Context, int64, int) (*model.TicketWithTickets, error)
- AddTicketPlaybook(context.Context, int64, *model.PlaybookTemplateForm) (*model.TicketWithTickets, error)
- RemoveTicketPlaybook(context.Context, int64, string) (*model.TicketWithTickets, error)
- SetTaskData(context.Context, int64, string, string, map[string]any) (*model.TicketWithTickets, error)
- CompleteTask(context.Context, int64, string, string, map[string]any) (*model.TicketWithTickets, error)
- SetTaskOwner(context.Context, int64, string, string, string) (*model.TicketWithTickets, error)
- RunTask(context.Context, int64, string, string) error
- SetReferences(context.Context, int64, *model.ReferenceArray) (*model.TicketWithTickets, error)
- SetSchema(context.Context, int64, string) (*model.TicketWithTickets, error)
- LinkTicket(context.Context, int64, int64) (*model.TicketWithTickets, error)
- UnlinkTicket(context.Context, int64, int64) (*model.TicketWithTickets, error)
- ListTicketTypes(context.Context) ([]*model.TicketTypeResponse, error)
- CreateTicketType(context.Context, *model.TicketTypeForm) (*model.TicketTypeResponse, error)
- GetTicketType(context.Context, string) (*model.TicketTypeResponse, error)
- UpdateTicketType(context.Context, string, *model.TicketTypeForm) (*model.TicketTypeResponse, error)
- DeleteTicketType(context.Context, string) error
- ListUserData(context.Context) ([]*model.UserDataResponse, error)
- GetUserData(context.Context, string) (*model.UserDataResponse, error)
- UpdateUserData(context.Context, string, *model.UserData) (*model.UserDataResponse, error)
- ListUsers(context.Context) ([]*model.UserResponse, error)
- CreateUser(context.Context, *model.UserForm) (*model.NewUserResponse, error)
- GetUser(context.Context, string) (*model.UserResponse, error)
- UpdateUser(context.Context, string, *model.UserForm) (*model.UserResponse, error)
- DeleteUser(context.Context, string) error
-}
-
-func NewServer(service Service, roleAuth func([]string) func(http.Handler) http.Handler, middlewares ...func(http.Handler) http.Handler) chi.Router {
- r := chi.NewRouter()
- r.Use(middlewares...)
-
- s := &server{service}
-
- r.With(roleAuth([]string{"automation:read"})).Get("/automations", s.listAutomationsHandler)
- r.With(roleAuth([]string{"automation:write"})).Post("/automations", s.createAutomationHandler)
- r.With(roleAuth([]string{"automation:read"})).Get("/automations/{id}", s.getAutomationHandler)
- r.With(roleAuth([]string{"automation:write"})).Put("/automations/{id}", s.updateAutomationHandler)
- r.With(roleAuth([]string{"automation:write"})).Delete("/automations/{id}", s.deleteAutomationHandler)
- r.With(roleAuth([]string{"currentuser:read"})).Get("/currentuser", s.currentUserHandler)
- r.With(roleAuth([]string{"currentuserdata:read"})).Get("/currentuserdata", s.currentUserDataHandler)
- r.With(roleAuth([]string{"currentuserdata:write"})).Put("/currentuserdata", s.updateCurrentUserDataHandler)
- r.With(roleAuth([]string{"dashboard:read"})).Get("/dashboard/data", s.dashboardDataHandler)
- r.With(roleAuth([]string{"dashboard:read"})).Get("/dashboards", s.listDashboardsHandler)
- r.With(roleAuth([]string{"dashboard:write"})).Post("/dashboards", s.createDashboardHandler)
- r.With(roleAuth([]string{"dashboard:read"})).Get("/dashboards/{id}", s.getDashboardHandler)
- r.With(roleAuth([]string{"dashboard:write"})).Put("/dashboards/{id}", s.updateDashboardHandler)
- r.With(roleAuth([]string{"dashboard:write"})).Delete("/dashboards/{id}", s.deleteDashboardHandler)
- r.With(roleAuth([]string{"job:read"})).Get("/jobs", s.listJobsHandler)
- r.With(roleAuth([]string{"job:write"})).Post("/jobs", s.runJobHandler)
- r.With(roleAuth([]string{"job:read"})).Get("/jobs/{id}", s.getJobHandler)
- r.With(roleAuth([]string{"job:write"})).Put("/jobs/{id}", s.updateJobHandler)
- r.With(roleAuth([]string{"log:read"})).Get("/logs/{reference}", s.getLogsHandler)
- r.With(roleAuth([]string{"playbook:read"})).Get("/playbooks", s.listPlaybooksHandler)
- r.With(roleAuth([]string{"playbook:write"})).Post("/playbooks", s.createPlaybookHandler)
- r.With(roleAuth([]string{"playbook:read"})).Get("/playbooks/{id}", s.getPlaybookHandler)
- r.With(roleAuth([]string{"playbook:write"})).Put("/playbooks/{id}", s.updatePlaybookHandler)
- r.With(roleAuth([]string{"playbook:write"})).Delete("/playbooks/{id}", s.deletePlaybookHandler)
- r.With(roleAuth([]string{"settings:read"})).Get("/settings", s.getSettingsHandler)
- r.With(roleAuth([]string{"settings:write"})).Post("/settings", s.saveSettingsHandler)
- r.With(roleAuth([]string{"ticket:read"})).Get("/statistics", s.getStatisticsHandler)
- r.With(roleAuth([]string{"ticket:read"})).Get("/tasks", s.listTasksHandler)
- r.With(roleAuth([]string{"template:read"})).Get("/templates", s.listTemplatesHandler)
- r.With(roleAuth([]string{"template:write"})).Post("/templates", s.createTemplateHandler)
- r.With(roleAuth([]string{"template:read"})).Get("/templates/{id}", s.getTemplateHandler)
- r.With(roleAuth([]string{"template:write"})).Put("/templates/{id}", s.updateTemplateHandler)
- r.With(roleAuth([]string{"template:write"})).Delete("/templates/{id}", s.deleteTemplateHandler)
- r.With(roleAuth([]string{"ticket:read"})).Get("/tickets", s.listTicketsHandler)
- r.With(roleAuth([]string{"ticket:write"})).Post("/tickets", s.createTicketHandler)
- r.With(roleAuth([]string{"ticket:write"})).Post("/tickets/batch", s.createTicketBatchHandler)
- r.With(roleAuth([]string{"ticket:read"})).Get("/tickets/{id}", s.getTicketHandler)
- r.With(roleAuth([]string{"ticket:write"})).Put("/tickets/{id}", s.updateTicketHandler)
- r.With(roleAuth([]string{"ticket:delete"})).Delete("/tickets/{id}", s.deleteTicketHandler)
- r.With(roleAuth([]string{"ticket:write"})).Post("/tickets/{id}/artifacts", s.addArtifactHandler)
- r.With(roleAuth([]string{"ticket:write"})).Get("/tickets/{id}/artifacts/{name}", s.getArtifactHandler)
- r.With(roleAuth([]string{"ticket:write"})).Put("/tickets/{id}/artifacts/{name}", s.setArtifactHandler)
- r.With(roleAuth([]string{"ticket:write"})).Delete("/tickets/{id}/artifacts/{name}", s.removeArtifactHandler)
- r.With(roleAuth([]string{"ticket:write"})).Post("/tickets/{id}/artifacts/{name}/enrich", s.enrichArtifactHandler)
- r.With(roleAuth([]string{"ticket:write"})).Post("/tickets/{id}/artifacts/{name}/run/{automation}", s.runArtifactHandler)
- r.With(roleAuth([]string{"ticket:write"})).Post("/tickets/{id}/comments", s.addCommentHandler)
- r.With(roleAuth([]string{"ticket:write"})).Delete("/tickets/{id}/comments/{commentID}", s.removeCommentHandler)
- r.With(roleAuth([]string{"ticket:write"})).Post("/tickets/{id}/playbooks", s.addTicketPlaybookHandler)
- r.With(roleAuth([]string{"ticket:write"})).Delete("/tickets/{id}/playbooks/{playbookID}", s.removeTicketPlaybookHandler)
- r.With(roleAuth([]string{"ticket:write"})).Put("/tickets/{id}/playbooks/{playbookID}/task/{taskID}", s.setTaskDataHandler)
- r.With(roleAuth([]string{"ticket:write"})).Put("/tickets/{id}/playbooks/{playbookID}/task/{taskID}/complete", s.completeTaskHandler)
- r.With(roleAuth([]string{"ticket:write"})).Put("/tickets/{id}/playbooks/{playbookID}/task/{taskID}/owner", s.setTaskOwnerHandler)
- r.With(roleAuth([]string{"ticket:write"})).Post("/tickets/{id}/playbooks/{playbookID}/task/{taskID}/run", s.runTaskHandler)
- r.With(roleAuth([]string{"ticket:write"})).Put("/tickets/{id}/references", s.setReferencesHandler)
- r.With(roleAuth([]string{"ticket:write"})).Put("/tickets/{id}/schema", s.setSchemaHandler)
- r.With(roleAuth([]string{"ticket:write"})).Patch("/tickets/{id}/tickets", s.linkTicketHandler)
- r.With(roleAuth([]string{"ticket:write"})).Delete("/tickets/{id}/tickets", s.unlinkTicketHandler)
- r.With(roleAuth([]string{"tickettype:read"})).Get("/tickettypes", s.listTicketTypesHandler)
- r.With(roleAuth([]string{"tickettype:write"})).Post("/tickettypes", s.createTicketTypeHandler)
- r.With(roleAuth([]string{"tickettype:read"})).Get("/tickettypes/{id}", s.getTicketTypeHandler)
- r.With(roleAuth([]string{"tickettype:write"})).Put("/tickettypes/{id}", s.updateTicketTypeHandler)
- r.With(roleAuth([]string{"tickettype:write"})).Delete("/tickettypes/{id}", s.deleteTicketTypeHandler)
- r.With(roleAuth([]string{"userdata:read"})).Get("/userdata", s.listUserDataHandler)
- r.With(roleAuth([]string{"userdata:read"})).Get("/userdata/{id}", s.getUserDataHandler)
- r.With(roleAuth([]string{"userdata:write"})).Put("/userdata/{id}", s.updateUserDataHandler)
- r.With(roleAuth([]string{"user:read"})).Get("/users", s.listUsersHandler)
- r.With(roleAuth([]string{"user:write"})).Post("/users", s.createUserHandler)
- r.With(roleAuth([]string{"user:read"})).Get("/users/{id}", s.getUserHandler)
- r.With(roleAuth([]string{"user:write"})).Put("/users/{id}", s.updateUserHandler)
- r.With(roleAuth([]string{"user:write"})).Delete("/users/{id}", s.deleteUserHandler)
- return r
-}
-
-type server struct {
- service Service
-}
-
-func (s *server) listAutomationsHandler(w http.ResponseWriter, r *http.Request) {
- result, err := s.service.ListAutomations(r.Context())
- response(w, result, err)
-}
-
-func (s *server) createAutomationHandler(w http.ResponseWriter, r *http.Request) {
- body, err := io.ReadAll(r.Body)
- if err != nil {
- JSONError(w, err)
- return
- }
-
- if validateSchema(body, model.AutomationFormSchema, w) {
- return
- }
-
- var automationP *model.AutomationForm
- if err := parseBody(body, &automationP); err != nil {
- JSONError(w, err)
- return
- }
-
- result, err := s.service.CreateAutomation(r.Context(), automationP)
- response(w, result, err)
-}
-
-func (s *server) getAutomationHandler(w http.ResponseWriter, r *http.Request) {
- idP := chi.URLParam(r, "id")
-
- result, err := s.service.GetAutomation(r.Context(), idP)
- response(w, result, err)
-}
-
-func (s *server) updateAutomationHandler(w http.ResponseWriter, r *http.Request) {
- idP := chi.URLParam(r, "id")
-
- body, err := io.ReadAll(r.Body)
- if err != nil {
- JSONError(w, err)
- return
- }
-
- if validateSchema(body, model.AutomationFormSchema, w) {
- return
- }
-
- var automationP *model.AutomationForm
- if err := parseBody(body, &automationP); err != nil {
- JSONError(w, err)
- return
- }
-
- result, err := s.service.UpdateAutomation(r.Context(), idP, automationP)
- response(w, result, err)
-}
-
-func (s *server) deleteAutomationHandler(w http.ResponseWriter, r *http.Request) {
- idP := chi.URLParam(r, "id")
-
- response(w, nil, s.service.DeleteAutomation(r.Context(), idP))
-}
-
-func (s *server) currentUserHandler(w http.ResponseWriter, r *http.Request) {
- result, err := s.service.CurrentUser(r.Context())
- response(w, result, err)
-}
-
-func (s *server) currentUserDataHandler(w http.ResponseWriter, r *http.Request) {
- result, err := s.service.CurrentUserData(r.Context())
- response(w, result, err)
-}
-
-func (s *server) updateCurrentUserDataHandler(w http.ResponseWriter, r *http.Request) {
- body, err := io.ReadAll(r.Body)
- if err != nil {
- JSONError(w, err)
- return
- }
-
- if validateSchema(body, model.UserDataSchema, w) {
- return
- }
-
- var userdataP *model.UserData
- if err := parseBody(body, &userdataP); err != nil {
- JSONError(w, err)
- return
- }
-
- result, err := s.service.UpdateCurrentUserData(r.Context(), userdataP)
- response(w, result, err)
-}
-
-func (s *server) dashboardDataHandler(w http.ResponseWriter, r *http.Request) {
- aggregationP := r.URL.Query().Get("aggregation")
-
- filterP := r.URL.Query().Get("filter")
-
- result, err := s.service.DashboardData(r.Context(), aggregationP, &filterP)
- response(w, result, err)
-}
-
-func (s *server) listDashboardsHandler(w http.ResponseWriter, r *http.Request) {
- result, err := s.service.ListDashboards(r.Context())
- response(w, result, err)
-}
-
-func (s *server) createDashboardHandler(w http.ResponseWriter, r *http.Request) {
- body, err := io.ReadAll(r.Body)
- if err != nil {
- JSONError(w, err)
- return
- }
-
- if validateSchema(body, model.DashboardSchema, w) {
- return
- }
-
- var templateP *model.Dashboard
- if err := parseBody(body, &templateP); err != nil {
- JSONError(w, err)
- return
- }
-
- result, err := s.service.CreateDashboard(r.Context(), templateP)
- response(w, result, err)
-}
-
-func (s *server) getDashboardHandler(w http.ResponseWriter, r *http.Request) {
- idP := chi.URLParam(r, "id")
-
- result, err := s.service.GetDashboard(r.Context(), idP)
- response(w, result, err)
-}
-
-func (s *server) updateDashboardHandler(w http.ResponseWriter, r *http.Request) {
- idP := chi.URLParam(r, "id")
-
- body, err := io.ReadAll(r.Body)
- if err != nil {
- JSONError(w, err)
- return
- }
-
- if validateSchema(body, model.DashboardSchema, w) {
- return
- }
-
- var dashboardP *model.Dashboard
- if err := parseBody(body, &dashboardP); err != nil {
- JSONError(w, err)
- return
- }
-
- result, err := s.service.UpdateDashboard(r.Context(), idP, dashboardP)
- response(w, result, err)
-}
-
-func (s *server) deleteDashboardHandler(w http.ResponseWriter, r *http.Request) {
- idP := chi.URLParam(r, "id")
-
- response(w, nil, s.service.DeleteDashboard(r.Context(), idP))
-}
-
-func (s *server) listJobsHandler(w http.ResponseWriter, r *http.Request) {
- result, err := s.service.ListJobs(r.Context())
- response(w, result, err)
-}
-
-func (s *server) runJobHandler(w http.ResponseWriter, r *http.Request) {
- body, err := io.ReadAll(r.Body)
- if err != nil {
- JSONError(w, err)
- return
- }
-
- if validateSchema(body, model.JobFormSchema, w) {
- return
- }
-
- var jobP *model.JobForm
- if err := parseBody(body, &jobP); err != nil {
- JSONError(w, err)
- return
- }
-
- result, err := s.service.RunJob(r.Context(), jobP)
- response(w, result, err)
-}
-
-func (s *server) getJobHandler(w http.ResponseWriter, r *http.Request) {
- idP := chi.URLParam(r, "id")
-
- result, err := s.service.GetJob(r.Context(), idP)
- response(w, result, err)
-}
-
-func (s *server) updateJobHandler(w http.ResponseWriter, r *http.Request) {
- idP := chi.URLParam(r, "id")
-
- body, err := io.ReadAll(r.Body)
- if err != nil {
- JSONError(w, err)
- return
- }
-
- if validateSchema(body, model.JobUpdateSchema, w) {
- return
- }
-
- var jobP *model.JobUpdate
- if err := parseBody(body, &jobP); err != nil {
- JSONError(w, err)
- return
- }
-
- result, err := s.service.UpdateJob(r.Context(), idP, jobP)
- response(w, result, err)
-}
-
-func (s *server) getLogsHandler(w http.ResponseWriter, r *http.Request) {
- referenceP := chi.URLParam(r, "reference")
-
- result, err := s.service.GetLogs(r.Context(), referenceP)
- response(w, result, err)
-}
-
-func (s *server) listPlaybooksHandler(w http.ResponseWriter, r *http.Request) {
- result, err := s.service.ListPlaybooks(r.Context())
- response(w, result, err)
-}
-
-func (s *server) createPlaybookHandler(w http.ResponseWriter, r *http.Request) {
- body, err := io.ReadAll(r.Body)
- if err != nil {
- JSONError(w, err)
- return
- }
-
- if validateSchema(body, model.PlaybookTemplateFormSchema, w) {
- return
- }
-
- var playbookP *model.PlaybookTemplateForm
- if err := parseBody(body, &playbookP); err != nil {
- JSONError(w, err)
- return
- }
-
- result, err := s.service.CreatePlaybook(r.Context(), playbookP)
- response(w, result, err)
-}
-
-func (s *server) getPlaybookHandler(w http.ResponseWriter, r *http.Request) {
- idP := chi.URLParam(r, "id")
-
- result, err := s.service.GetPlaybook(r.Context(), idP)
- response(w, result, err)
-}
-
-func (s *server) updatePlaybookHandler(w http.ResponseWriter, r *http.Request) {
- idP := chi.URLParam(r, "id")
-
- body, err := io.ReadAll(r.Body)
- if err != nil {
- JSONError(w, err)
- return
- }
-
- if validateSchema(body, model.PlaybookTemplateFormSchema, w) {
- return
- }
-
- var playbookP *model.PlaybookTemplateForm
- if err := parseBody(body, &playbookP); err != nil {
- JSONError(w, err)
- return
- }
-
- result, err := s.service.UpdatePlaybook(r.Context(), idP, playbookP)
- response(w, result, err)
-}
-
-func (s *server) deletePlaybookHandler(w http.ResponseWriter, r *http.Request) {
- idP := chi.URLParam(r, "id")
-
- response(w, nil, s.service.DeletePlaybook(r.Context(), idP))
-}
-
-func (s *server) getSettingsHandler(w http.ResponseWriter, r *http.Request) {
- result, err := s.service.GetSettings(r.Context())
- response(w, result, err)
-}
-
-func (s *server) saveSettingsHandler(w http.ResponseWriter, r *http.Request) {
- body, err := io.ReadAll(r.Body)
- if err != nil {
- JSONError(w, err)
- return
- }
-
- if validateSchema(body, model.SettingsSchema, w) {
- return
- }
-
- var settingsP *model.Settings
- if err := parseBody(body, &settingsP); err != nil {
- JSONError(w, err)
- return
- }
-
- result, err := s.service.SaveSettings(r.Context(), settingsP)
- response(w, result, err)
-}
-
-func (s *server) getStatisticsHandler(w http.ResponseWriter, r *http.Request) {
- result, err := s.service.GetStatistics(r.Context())
- response(w, result, err)
-}
-
-func (s *server) listTasksHandler(w http.ResponseWriter, r *http.Request) {
- result, err := s.service.ListTasks(r.Context())
- response(w, result, err)
-}
-
-func (s *server) listTemplatesHandler(w http.ResponseWriter, r *http.Request) {
- result, err := s.service.ListTemplates(r.Context())
- response(w, result, err)
-}
-
-func (s *server) createTemplateHandler(w http.ResponseWriter, r *http.Request) {
- body, err := io.ReadAll(r.Body)
- if err != nil {
- JSONError(w, err)
- return
- }
-
- if validateSchema(body, model.TicketTemplateFormSchema, w) {
- return
- }
-
- var templateP *model.TicketTemplateForm
- if err := parseBody(body, &templateP); err != nil {
- JSONError(w, err)
- return
- }
-
- result, err := s.service.CreateTemplate(r.Context(), templateP)
- response(w, result, err)
-}
-
-func (s *server) getTemplateHandler(w http.ResponseWriter, r *http.Request) {
- idP := chi.URLParam(r, "id")
-
- result, err := s.service.GetTemplate(r.Context(), idP)
- response(w, result, err)
-}
-
-func (s *server) updateTemplateHandler(w http.ResponseWriter, r *http.Request) {
- idP := chi.URLParam(r, "id")
-
- body, err := io.ReadAll(r.Body)
- if err != nil {
- JSONError(w, err)
- return
- }
-
- if validateSchema(body, model.TicketTemplateFormSchema, w) {
- return
- }
-
- var templateP *model.TicketTemplateForm
- if err := parseBody(body, &templateP); err != nil {
- JSONError(w, err)
- return
- }
-
- result, err := s.service.UpdateTemplate(r.Context(), idP, templateP)
- response(w, result, err)
-}
-
-func (s *server) deleteTemplateHandler(w http.ResponseWriter, r *http.Request) {
- idP := chi.URLParam(r, "id")
-
- response(w, nil, s.service.DeleteTemplate(r.Context(), idP))
-}
-
-func (s *server) listTicketsHandler(w http.ResponseWriter, r *http.Request) {
- typeP := r.URL.Query().Get("type")
-
- offsetP, err := parseQueryOptionalInt(r, "offset")
- if err != nil {
- JSONError(w, err)
- return
- }
-
- countP, err := parseQueryOptionalInt(r, "count")
- if err != nil {
- JSONError(w, err)
- return
- }
-
- sortP, err := parseQueryOptionalStringArray(r, "sort")
- if err != nil {
- JSONError(w, err)
- return
- }
-
- descP, err := parseQueryOptionalBoolArray(r, "desc")
- if err != nil {
- JSONError(w, err)
- return
- }
-
- queryP := r.URL.Query().Get("query")
-
- result, err := s.service.ListTickets(r.Context(), &typeP, offsetP, countP, sortP, descP, &queryP)
- response(w, result, err)
-}
-
-func (s *server) createTicketHandler(w http.ResponseWriter, r *http.Request) {
- body, err := io.ReadAll(r.Body)
- if err != nil {
- JSONError(w, err)
- return
- }
-
- if validateSchema(body, model.TicketFormSchema, w) {
- return
- }
-
- var ticketP *model.TicketForm
- if err := parseBody(body, &ticketP); err != nil {
- JSONError(w, err)
- return
- }
-
- result, err := s.service.CreateTicket(r.Context(), ticketP)
- response(w, result, err)
-}
-
-func (s *server) createTicketBatchHandler(w http.ResponseWriter, r *http.Request) {
- body, err := io.ReadAll(r.Body)
- if err != nil {
- JSONError(w, err)
- return
- }
-
- if validateSchema(body, model.TicketFormArraySchema, w) {
- return
- }
-
- var ticketP *model.TicketFormArray
- if err := parseBody(body, &ticketP); err != nil {
- JSONError(w, err)
- return
- }
-
- response(w, nil, s.service.CreateTicketBatch(r.Context(), ticketP))
-}
-
-func (s *server) getTicketHandler(w http.ResponseWriter, r *http.Request) {
- idP, err := parseURLInt64(r, "id")
- if err != nil {
- JSONError(w, err)
- return
- }
-
- result, err := s.service.GetTicket(r.Context(), idP)
- response(w, result, err)
-}
-
-func (s *server) updateTicketHandler(w http.ResponseWriter, r *http.Request) {
- idP, err := parseURLInt64(r, "id")
- if err != nil {
- JSONError(w, err)
- return
- }
-
- body, err := io.ReadAll(r.Body)
- if err != nil {
- JSONError(w, err)
- return
- }
-
- if validateSchema(body, model.TicketSchema, w) {
- return
- }
-
- var ticketP *model.Ticket
- if err := parseBody(body, &ticketP); err != nil {
- JSONError(w, err)
- return
- }
-
- result, err := s.service.UpdateTicket(r.Context(), idP, ticketP)
- response(w, result, err)
-}
-
-func (s *server) deleteTicketHandler(w http.ResponseWriter, r *http.Request) {
- idP, err := parseURLInt64(r, "id")
- if err != nil {
- JSONError(w, err)
- return
- }
-
- response(w, nil, s.service.DeleteTicket(r.Context(), idP))
-}
-
-func (s *server) addArtifactHandler(w http.ResponseWriter, r *http.Request) {
- idP, err := parseURLInt64(r, "id")
- if err != nil {
- JSONError(w, err)
- return
- }
-
- body, err := io.ReadAll(r.Body)
- if err != nil {
- JSONError(w, err)
- return
- }
-
- if validateSchema(body, model.ArtifactSchema, w) {
- return
- }
-
- var artifactP *model.Artifact
- if err := parseBody(body, &artifactP); err != nil {
- JSONError(w, err)
- return
- }
-
- result, err := s.service.AddArtifact(r.Context(), idP, artifactP)
- response(w, result, err)
-}
-
-func (s *server) getArtifactHandler(w http.ResponseWriter, r *http.Request) {
- idP, err := parseURLInt64(r, "id")
- if err != nil {
- JSONError(w, err)
- return
- }
-
- nameP := chi.URLParam(r, "name")
-
- result, err := s.service.GetArtifact(r.Context(), idP, nameP)
- response(w, result, err)
-}
-
-func (s *server) setArtifactHandler(w http.ResponseWriter, r *http.Request) {
- idP, err := parseURLInt64(r, "id")
- if err != nil {
- JSONError(w, err)
- return
- }
-
- nameP := chi.URLParam(r, "name")
-
- body, err := io.ReadAll(r.Body)
- if err != nil {
- JSONError(w, err)
- return
- }
-
- if validateSchema(body, model.ArtifactSchema, w) {
- return
- }
-
- var artifactP *model.Artifact
- if err := parseBody(body, &artifactP); err != nil {
- JSONError(w, err)
- return
- }
-
- result, err := s.service.SetArtifact(r.Context(), idP, nameP, artifactP)
- response(w, result, err)
-}
-
-func (s *server) removeArtifactHandler(w http.ResponseWriter, r *http.Request) {
- idP, err := parseURLInt64(r, "id")
- if err != nil {
- JSONError(w, err)
- return
- }
-
- nameP := chi.URLParam(r, "name")
-
- result, err := s.service.RemoveArtifact(r.Context(), idP, nameP)
- response(w, result, err)
-}
-
-func (s *server) enrichArtifactHandler(w http.ResponseWriter, r *http.Request) {
- idP, err := parseURLInt64(r, "id")
- if err != nil {
- JSONError(w, err)
- return
- }
-
- nameP := chi.URLParam(r, "name")
-
- body, err := io.ReadAll(r.Body)
- if err != nil {
- JSONError(w, err)
- return
- }
-
- if validateSchema(body, model.EnrichmentFormSchema, w) {
- return
- }
-
- var dataP *model.EnrichmentForm
- if err := parseBody(body, &dataP); err != nil {
- JSONError(w, err)
- return
- }
-
- result, err := s.service.EnrichArtifact(r.Context(), idP, nameP, dataP)
- response(w, result, err)
-}
-
-func (s *server) runArtifactHandler(w http.ResponseWriter, r *http.Request) {
- idP, err := parseURLInt64(r, "id")
- if err != nil {
- JSONError(w, err)
- return
- }
-
- nameP := chi.URLParam(r, "name")
-
- automationP := chi.URLParam(r, "automation")
-
- response(w, nil, s.service.RunArtifact(r.Context(), idP, nameP, automationP))
-}
-
-func (s *server) addCommentHandler(w http.ResponseWriter, r *http.Request) {
- idP, err := parseURLInt64(r, "id")
- if err != nil {
- JSONError(w, err)
- return
- }
-
- body, err := io.ReadAll(r.Body)
- if err != nil {
- JSONError(w, err)
- return
- }
-
- if validateSchema(body, model.CommentFormSchema, w) {
- return
- }
-
- var commentP *model.CommentForm
- if err := parseBody(body, &commentP); err != nil {
- JSONError(w, err)
- return
- }
-
- result, err := s.service.AddComment(r.Context(), idP, commentP)
- response(w, result, err)
-}
-
-func (s *server) removeCommentHandler(w http.ResponseWriter, r *http.Request) {
- idP, err := parseURLInt64(r, "id")
- if err != nil {
- JSONError(w, err)
- return
- }
-
- commentIDP, err := parseURLInt(r, "commentID")
- if err != nil {
- JSONError(w, err)
- return
- }
-
- result, err := s.service.RemoveComment(r.Context(), idP, commentIDP)
- response(w, result, err)
-}
-
-func (s *server) addTicketPlaybookHandler(w http.ResponseWriter, r *http.Request) {
- idP, err := parseURLInt64(r, "id")
- if err != nil {
- JSONError(w, err)
- return
- }
-
- body, err := io.ReadAll(r.Body)
- if err != nil {
- JSONError(w, err)
- return
- }
-
- if validateSchema(body, model.PlaybookTemplateFormSchema, w) {
- return
- }
-
- var playbookP *model.PlaybookTemplateForm
- if err := parseBody(body, &playbookP); err != nil {
- JSONError(w, err)
- return
- }
-
- result, err := s.service.AddTicketPlaybook(r.Context(), idP, playbookP)
- response(w, result, err)
-}
-
-func (s *server) removeTicketPlaybookHandler(w http.ResponseWriter, r *http.Request) {
- idP, err := parseURLInt64(r, "id")
- if err != nil {
- JSONError(w, err)
- return
- }
-
- playbookIDP := chi.URLParam(r, "playbookID")
-
- result, err := s.service.RemoveTicketPlaybook(r.Context(), idP, playbookIDP)
- response(w, result, err)
-}
-
-func (s *server) setTaskDataHandler(w http.ResponseWriter, r *http.Request) {
- idP, err := parseURLInt64(r, "id")
- if err != nil {
- JSONError(w, err)
- return
- }
-
- playbookIDP := chi.URLParam(r, "playbookID")
-
- taskIDP := chi.URLParam(r, "taskID")
-
- body, err := io.ReadAll(r.Body)
- if err != nil {
- JSONError(w, err)
- return
- }
-
- var dataP map[string]any
- if err := parseBody(body, &dataP); err != nil {
- JSONError(w, err)
- return
- }
-
- result, err := s.service.SetTaskData(r.Context(), idP, playbookIDP, taskIDP, dataP)
- response(w, result, err)
-}
-
-func (s *server) completeTaskHandler(w http.ResponseWriter, r *http.Request) {
- idP, err := parseURLInt64(r, "id")
- if err != nil {
- JSONError(w, err)
- return
- }
-
- playbookIDP := chi.URLParam(r, "playbookID")
-
- taskIDP := chi.URLParam(r, "taskID")
-
- body, err := io.ReadAll(r.Body)
- if err != nil {
- JSONError(w, err)
- return
- }
-
- var dataP map[string]any
- if err := parseBody(body, &dataP); err != nil {
- JSONError(w, err)
- return
- }
-
- result, err := s.service.CompleteTask(r.Context(), idP, playbookIDP, taskIDP, dataP)
- response(w, result, err)
-}
-
-func (s *server) setTaskOwnerHandler(w http.ResponseWriter, r *http.Request) {
- idP, err := parseURLInt64(r, "id")
- if err != nil {
- JSONError(w, err)
- return
- }
-
- playbookIDP := chi.URLParam(r, "playbookID")
-
- taskIDP := chi.URLParam(r, "taskID")
-
- body, err := io.ReadAll(r.Body)
- if err != nil {
- JSONError(w, err)
- return
- }
-
- var ownerP string
- if err := parseBody(body, &ownerP); err != nil {
- JSONError(w, err)
- return
- }
-
- result, err := s.service.SetTaskOwner(r.Context(), idP, playbookIDP, taskIDP, ownerP)
- response(w, result, err)
-}
-
-func (s *server) runTaskHandler(w http.ResponseWriter, r *http.Request) {
- idP, err := parseURLInt64(r, "id")
- if err != nil {
- JSONError(w, err)
- return
- }
-
- playbookIDP := chi.URLParam(r, "playbookID")
-
- taskIDP := chi.URLParam(r, "taskID")
-
- response(w, nil, s.service.RunTask(r.Context(), idP, playbookIDP, taskIDP))
-}
-
-func (s *server) setReferencesHandler(w http.ResponseWriter, r *http.Request) {
- idP, err := parseURLInt64(r, "id")
- if err != nil {
- JSONError(w, err)
- return
- }
-
- body, err := io.ReadAll(r.Body)
- if err != nil {
- JSONError(w, err)
- return
- }
-
- if validateSchema(body, model.ReferenceArraySchema, w) {
- return
- }
-
- var referencesP *model.ReferenceArray
- if err := parseBody(body, &referencesP); err != nil {
- JSONError(w, err)
- return
- }
-
- result, err := s.service.SetReferences(r.Context(), idP, referencesP)
- response(w, result, err)
-}
-
-func (s *server) setSchemaHandler(w http.ResponseWriter, r *http.Request) {
- idP, err := parseURLInt64(r, "id")
- if err != nil {
- JSONError(w, err)
- return
- }
-
- body, err := io.ReadAll(r.Body)
- if err != nil {
- JSONError(w, err)
- return
- }
-
- var schemaP string
- if err := parseBody(body, &schemaP); err != nil {
- JSONError(w, err)
- return
- }
-
- result, err := s.service.SetSchema(r.Context(), idP, schemaP)
- response(w, result, err)
-}
-
-func (s *server) linkTicketHandler(w http.ResponseWriter, r *http.Request) {
- idP, err := parseURLInt64(r, "id")
- if err != nil {
- JSONError(w, err)
- return
- }
-
- body, err := io.ReadAll(r.Body)
- if err != nil {
- JSONError(w, err)
- return
- }
-
- var linkedIDP int64
- if err := parseBody(body, &linkedIDP); err != nil {
- JSONError(w, err)
- return
- }
-
- result, err := s.service.LinkTicket(r.Context(), idP, linkedIDP)
- response(w, result, err)
-}
-
-func (s *server) unlinkTicketHandler(w http.ResponseWriter, r *http.Request) {
- idP, err := parseURLInt64(r, "id")
- if err != nil {
- JSONError(w, err)
- return
- }
-
- body, err := io.ReadAll(r.Body)
- if err != nil {
- JSONError(w, err)
- return
- }
-
- var linkedIDP int64
- if err := parseBody(body, &linkedIDP); err != nil {
- JSONError(w, err)
- return
- }
-
- result, err := s.service.UnlinkTicket(r.Context(), idP, linkedIDP)
- response(w, result, err)
-}
-
-func (s *server) listTicketTypesHandler(w http.ResponseWriter, r *http.Request) {
- result, err := s.service.ListTicketTypes(r.Context())
- response(w, result, err)
-}
-
-func (s *server) createTicketTypeHandler(w http.ResponseWriter, r *http.Request) {
- body, err := io.ReadAll(r.Body)
- if err != nil {
- JSONError(w, err)
- return
- }
-
- if validateSchema(body, model.TicketTypeFormSchema, w) {
- return
- }
-
- var tickettypeP *model.TicketTypeForm
- if err := parseBody(body, &tickettypeP); err != nil {
- JSONError(w, err)
- return
- }
-
- result, err := s.service.CreateTicketType(r.Context(), tickettypeP)
- response(w, result, err)
-}
-
-func (s *server) getTicketTypeHandler(w http.ResponseWriter, r *http.Request) {
- idP := chi.URLParam(r, "id")
-
- result, err := s.service.GetTicketType(r.Context(), idP)
- response(w, result, err)
-}
-
-func (s *server) updateTicketTypeHandler(w http.ResponseWriter, r *http.Request) {
- idP := chi.URLParam(r, "id")
-
- body, err := io.ReadAll(r.Body)
- if err != nil {
- JSONError(w, err)
- return
- }
-
- if validateSchema(body, model.TicketTypeFormSchema, w) {
- return
- }
-
- var tickettypeP *model.TicketTypeForm
- if err := parseBody(body, &tickettypeP); err != nil {
- JSONError(w, err)
- return
- }
-
- result, err := s.service.UpdateTicketType(r.Context(), idP, tickettypeP)
- response(w, result, err)
-}
-
-func (s *server) deleteTicketTypeHandler(w http.ResponseWriter, r *http.Request) {
- idP := chi.URLParam(r, "id")
-
- response(w, nil, s.service.DeleteTicketType(r.Context(), idP))
-}
-
-func (s *server) listUserDataHandler(w http.ResponseWriter, r *http.Request) {
- result, err := s.service.ListUserData(r.Context())
- response(w, result, err)
-}
-
-func (s *server) getUserDataHandler(w http.ResponseWriter, r *http.Request) {
- idP := chi.URLParam(r, "id")
-
- result, err := s.service.GetUserData(r.Context(), idP)
- response(w, result, err)
-}
-
-func (s *server) updateUserDataHandler(w http.ResponseWriter, r *http.Request) {
- idP := chi.URLParam(r, "id")
-
- body, err := io.ReadAll(r.Body)
- if err != nil {
- JSONError(w, err)
- return
- }
-
- if validateSchema(body, model.UserDataSchema, w) {
- return
- }
-
- var userdataP *model.UserData
- if err := parseBody(body, &userdataP); err != nil {
- JSONError(w, err)
- return
- }
-
- result, err := s.service.UpdateUserData(r.Context(), idP, userdataP)
- response(w, result, err)
-}
-
-func (s *server) listUsersHandler(w http.ResponseWriter, r *http.Request) {
- result, err := s.service.ListUsers(r.Context())
- response(w, result, err)
-}
-
-func (s *server) createUserHandler(w http.ResponseWriter, r *http.Request) {
- body, err := io.ReadAll(r.Body)
- if err != nil {
- JSONError(w, err)
- return
- }
-
- if validateSchema(body, model.UserFormSchema, w) {
- return
- }
-
- var userP *model.UserForm
- if err := parseBody(body, &userP); err != nil {
- JSONError(w, err)
- return
- }
-
- result, err := s.service.CreateUser(r.Context(), userP)
- response(w, result, err)
-}
-
-func (s *server) getUserHandler(w http.ResponseWriter, r *http.Request) {
- idP := chi.URLParam(r, "id")
-
- result, err := s.service.GetUser(r.Context(), idP)
- response(w, result, err)
-}
-
-func (s *server) updateUserHandler(w http.ResponseWriter, r *http.Request) {
- idP := chi.URLParam(r, "id")
-
- body, err := io.ReadAll(r.Body)
- if err != nil {
- JSONError(w, err)
- return
- }
-
- if validateSchema(body, model.UserFormSchema, w) {
- return
- }
-
- var userP *model.UserForm
- if err := parseBody(body, &userP); err != nil {
- JSONError(w, err)
- return
- }
-
- result, err := s.service.UpdateUser(r.Context(), idP, userP)
- response(w, result, err)
-}
-
-func (s *server) deleteUserHandler(w http.ResponseWriter, r *http.Request) {
- idP := chi.URLParam(r, "id")
-
- response(w, nil, s.service.DeleteUser(r.Context(), idP))
-}
diff --git a/generated/api/static.go b/generated/api/static.go
deleted file mode 100755
index 1afe231..0000000
--- a/generated/api/static.go
+++ /dev/null
@@ -1,40 +0,0 @@
-package api
-
-import (
- "io/fs"
- "net/http"
- "net/http/httputil"
- "net/url"
- "strings"
-)
-
-func VueStatic(fsys fs.FS) func(w http.ResponseWriter, r *http.Request) {
- return func(w http.ResponseWriter, r *http.Request) {
- handler := http.FileServer(http.FS(fsys))
-
- if strings.HasPrefix(r.URL.Path, "/static/") {
- handler = http.StripPrefix("/static/", handler)
- } else {
- r.URL.Path = "/"
- }
-
- handler.ServeHTTP(w, r)
- }
-}
-
-func Static(fsys fs.FS) func(w http.ResponseWriter, r *http.Request) {
- return func(w http.ResponseWriter, r *http.Request) {
- http.FileServer(http.FS(fsys)).ServeHTTP(w, r)
- }
-}
-
-func Proxy(dest string) func(w http.ResponseWriter, r *http.Request) {
- return func(w http.ResponseWriter, r *http.Request) {
- u, _ := url.Parse(dest)
- proxy := httputil.NewSingleHostReverseProxy(u)
-
- r.Host = r.URL.Host
-
- proxy.ServeHTTP(w, r)
- }
-}
diff --git a/generated/api/test_api.go b/generated/api/test_api.go
deleted file mode 100755
index 2286176..0000000
--- a/generated/api/test_api.go
+++ /dev/null
@@ -1,650 +0,0 @@
-package api
-
-import "time"
-
-type Args struct {
- Method string
- URL string
- Data any
-}
-type Want struct {
- Status int
- Body any
-}
-
-var Tests = []struct {
- Name string
- Args Args
- Want Want
-}{
-
- {
- Name: "ListAutomations",
- Args: Args{Method: "Get", URL: "/automations"},
- Want: Want{
- Status: 200,
- Body: []any{map[string]any{"id": "comment", "image": "docker.io/python:3", "script": "", "type": []any{"playbook"}}, map[string]any{"id": "hash.sha1", "image": "docker.io/python:3", "schema": "{\"title\":\"Input\",\"type\":\"object\",\"properties\":{\"default\":{\"type\":\"string\",\"title\":\"Value\"}},\"required\":[\"default\"]}", "script": "", "type": []any{"global", "artifact", "playbook"}}, map[string]any{"id": "vt.hash", "image": "docker.io/python:3", "schema": "{\"title\":\"Input\",\"type\":\"object\",\"properties\":{\"default\":{\"type\":\"string\",\"title\":\"Value\"}},\"required\":[\"default\"]}", "script": "", "type": []any{"global", "artifact", "playbook"}}},
- },
- },
-
- {
- Name: "CreateAutomation",
- Args: Args{Method: "Post", URL: "/automations", Data: map[string]any{"id": "hash-sha-256", "image": "docker.io/python:3", "script": "import sys\nimport json\nimport hashlib\n\n\ndef run(msg):\n sha256 = hashlib.sha256(msg['payload']['default'].encode('utf-8'))\n return {'hash': sha256.hexdigest()}\n\n\nprint(json.dumps(run(json.loads(sys.argv[1]))))\n", "type": []any{"global"}}},
- Want: Want{
- Status: 200,
- Body: map[string]any{"id": "hash-sha-256", "image": "docker.io/python:3", "script": "import sys\nimport json\nimport hashlib\n\n\ndef run(msg):\n sha256 = hashlib.sha256(msg['payload']['default'].encode('utf-8'))\n return {'hash': sha256.hexdigest()}\n\n\nprint(json.dumps(run(json.loads(sys.argv[1]))))\n", "type": []any{"global"}},
- },
- },
-
- {
- Name: "GetAutomation",
- Args: Args{Method: "Get", URL: "/automations/hash.sha1"},
- Want: Want{
- Status: 200,
- Body: map[string]any{"id": "hash.sha1", "image": "docker.io/python:3", "schema": "{\"title\":\"Input\",\"type\":\"object\",\"properties\":{\"default\":{\"type\":\"string\",\"title\":\"Value\"}},\"required\":[\"default\"]}", "script": "#!/usr/bin/env python\n\nimport sys\nimport json\nimport hashlib\n\n\ndef run(msg):\n sha1 = hashlib.sha1(msg['payload']['default'].encode('utf-8'))\n return {\"hash\": sha1.hexdigest()}\n\n\nprint(json.dumps(run(json.loads(sys.argv[1]))))\n", "type": []any{"global", "artifact", "playbook"}},
- },
- },
-
- {
- Name: "UpdateAutomation",
- Args: Args{Method: "Put", URL: "/automations/hash.sha1", Data: map[string]any{"id": "hash.sha1", "image": "docker.io/python:3", "script": "import sys\nimport json\nimport hashlib\n\n\ndef run(msg):\n sha1 = hashlib.sha1(msg['payload'].encode('utf-8'))\n return {'hash': sha1.hexdigest()}\n\n\nprint(json.dumps(run(json.loads(sys.argv[1]))))\n", "type": []any{"global", "artifact", "playbook"}}},
- Want: Want{
- Status: 200,
- Body: map[string]any{"id": "hash.sha1", "image": "docker.io/python:3", "script": "import sys\nimport json\nimport hashlib\n\n\ndef run(msg):\n sha1 = hashlib.sha1(msg['payload'].encode('utf-8'))\n return {'hash': sha1.hexdigest()}\n\n\nprint(json.dumps(run(json.loads(sys.argv[1]))))\n", "type": []any{"global", "artifact", "playbook"}},
- },
- },
-
- {
- Name: "DeleteAutomation",
- Args: Args{Method: "Delete", URL: "/automations/hash.sha1"},
- Want: Want{
- Status: 204,
- Body: nil,
- },
- },
-
- {
- Name: "CurrentUser",
- Args: Args{Method: "Get", URL: "/currentuser"},
- Want: Want{
- Status: 200,
- Body: map[string]any{"apikey": false, "blocked": false, "id": "bob", "roles": []any{"admin"}},
- },
- },
-
- {
- Name: "CurrentUserData",
- Args: Args{Method: "Get", URL: "/currentuserdata"},
- Want: Want{
- Status: 200,
- Body: map[string]any{"email": "bob@example.org", "id": "bob", "name": "Bob Bad"},
- },
- },
-
- {
- Name: "UpdateCurrentUserData",
- Args: Args{Method: "Put", URL: "/currentuserdata", Data: map[string]any{"email": "bob@example.org", "name": "Bob Bad"}},
- Want: Want{
- Status: 200,
- Body: map[string]any{"email": "bob@example.org", "id": "bob", "name": "Bob Bad"},
- },
- },
-
- {
- Name: "DashboardData",
- Args: Args{Method: "Get", URL: "/dashboard/data?aggregation=type&filter=status+%3D%3D+%22closed%22"},
- Want: Want{
- Status: 200,
- Body: map[string]any{"alert": 2, "incident": 1},
- },
- },
-
- {
- Name: "ListDashboards",
- Args: Args{Method: "Get", URL: "/dashboards"},
- Want: Want{
- Status: 200,
- Body: []any{map[string]any{"id": "simple", "name": "Simple", "widgets": []any{map[string]any{"aggregation": "owner", "filter": "status == \"open\"", "name": "open_tickets_per_user", "type": "bar", "width": 4}, map[string]any{"aggregation": "CONCAT(DATE_YEAR(created), \"-\", DATE_ISOWEEK(created) < 10 ? \"0\" : \"\", DATE_ISOWEEK(created))", "name": "tickets_per_week", "type": "line", "width": 8}}}},
- },
- },
-
- {
- Name: "CreateDashboard",
- Args: Args{Method: "Post", URL: "/dashboards", Data: map[string]any{"name": "My Dashboard", "widgets": []any{}}},
- Want: Want{
- Status: 200,
- Body: map[string]any{"id": "my-dashboard", "name": "My Dashboard", "widgets": []any{}},
- },
- },
-
- {
- Name: "GetDashboard",
- Args: Args{Method: "Get", URL: "/dashboards/simple"},
- Want: Want{
- Status: 200,
- Body: map[string]any{"id": "simple", "name": "Simple", "widgets": []any{map[string]any{"aggregation": "owner", "filter": "status == \"open\"", "name": "open_tickets_per_user", "type": "bar", "width": 4}, map[string]any{"aggregation": "CONCAT(DATE_YEAR(created), \"-\", DATE_ISOWEEK(created) < 10 ? \"0\" : \"\", DATE_ISOWEEK(created))", "name": "tickets_per_week", "type": "line", "width": 8}}},
- },
- },
-
- {
- Name: "UpdateDashboard",
- Args: Args{Method: "Put", URL: "/dashboards/simple", Data: map[string]any{"name": "Simple", "widgets": []any{}}},
- Want: Want{
- Status: 200,
- Body: map[string]any{"id": "simple", "name": "Simple", "widgets": []any{}},
- },
- },
-
- {
- Name: "DeleteDashboard",
- Args: Args{Method: "Delete", URL: "/dashboards/simple"},
- Want: Want{
- Status: 204,
- Body: nil,
- },
- },
-
- {
- Name: "ListJobs",
- Args: Args{Method: "Get", URL: "/jobs"},
- Want: Want{
- Status: 200,
- Body: []any{map[string]any{"automation": "hash.sha1", "id": "b81c2366-ea37-43d2-b61b-03afdc21d985", "payload": "test", "status": "created"}},
- },
- },
-
- {
- Name: "RunJob",
- Args: Args{Method: "Post", URL: "/jobs", Data: map[string]any{"automation": "hash.sha1", "payload": "test"}},
- Want: Want{
- Status: 200,
- Body: map[string]any{"automation": "hash.sha1", "id": "87390749-2125-4a87-91c5-da7e3f9bebf1", "payload": "test", "status": "created"},
- },
- },
-
- {
- Name: "GetJob",
- Args: Args{Method: "Get", URL: "/jobs/b81c2366-ea37-43d2-b61b-03afdc21d985"},
- Want: Want{
- Status: 200,
- Body: map[string]any{"automation": "hash.sha1", "id": "b81c2366-ea37-43d2-b61b-03afdc21d985", "payload": "test", "status": "created"},
- },
- },
-
- {
- Name: "UpdateJob",
- Args: Args{Method: "Put", URL: "/jobs/b81c2366-ea37-43d2-b61b-03afdc21d985", Data: map[string]any{"running": false, "status": "failed"}},
- Want: Want{
- Status: 200,
- Body: map[string]any{"automation": "hash.sha1", "id": "b81c2366-ea37-43d2-b61b-03afdc21d985", "payload": "test", "status": "failed"},
- },
- },
-
- {
- Name: "GetLogs",
- Args: Args{Method: "Get", URL: "/logs/tickets%252F294511"},
- Want: Want{
- Status: 200,
- Body: []any{map[string]any{"created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "creator": "bob", "message": "Fail run account resist lend solve incident centre priority temperature. Cause change distribution examine location technique shape partner milk customer. Rail tea plate soil report cook railway interpretation breath action. Exercise dream accept park conclusion addition shoot assistance may answer. Gold writer link stop combine hear power name commitment operation. Determine lifespan support grow degree henry exclude detail set religion. Direct library policy convention chain retain discover ride walk student. Gather proposal select march aspect play noise avoid encourage employ. Assessment preserve transport combine wish influence income guess run stand. Charge limit crime ignore statement foundation study issue stop claim.", "reference": "tickets/294511", "type": "manual"}},
- },
- },
-
- {
- Name: "ListPlaybooks",
- Args: Args{Method: "Get", URL: "/playbooks"},
- Want: Want{
- Status: 200,
- Body: []any{map[string]any{"id": "phishing", "name": "Phishing", "yaml": "name: Phishing\ntasks:\n board:\n name: Board Involvement?\n description: Is a board member involved?\n type: input\n schema:\n properties:\n boardInvolved:\n default: false\n title: A board member is involved.\n type: boolean\n required:\n - boardInvolved\n title: Board Involvement?\n type: object\n next:\n escalate: \"boardInvolved == true\"\n mail-available: \"boardInvolved == false\"\n\n escalate:\n name: Escalate to CISO\n description: Please escalate the task to the CISO\n type: task\n\n mail-available:\n name: Mail available\n type: input\n schema:\n oneOf:\n - properties:\n mail:\n title: Mail\n type: string\n x-display: textarea\n schemaKey:\n const: 'yes'\n type: string\n required:\n - mail\n title: 'Yes'\n - properties:\n schemaKey:\n const: 'no'\n type: string\n title: 'No'\n title: Mail available\n type: object\n next:\n block-sender: \"schemaKey == 'yes'\"\n extract-iocs: \"schemaKey == 'yes'\"\n search-email-gateway: \"schemaKey == 'no'\"\n\n search-email-gateway:\n name: Search email gateway\n description: Please search email-gateway for the phishing mail.\n type: task\n next:\n extract-iocs:\n\n block-sender:\n name: Block sender\n type: task\n next:\n extract-iocs:\n\n extract-iocs:\n name: Extract IOCs\n description: Please insert the IOCs\n type: input\n schema:\n properties:\n iocs:\n items:\n type: string\n title: IOCs\n type: array\n title: Extract IOCs\n type: object\n next:\n block-iocs:\n\n block-iocs:\n name: Block IOCs\n type: task\n"}, map[string]any{"id": "simple", "name": "Simple", "yaml": "name: Simple\ntasks:\n input:\n name: Enter something to hash\n type: input\n schema:\n title: Something\n type: object\n properties:\n something:\n type: string\n title: Something\n default: \"\"\n next:\n hash: \"something != ''\"\n\n hash:\n name: Hash the something\n type: automation\n automation: hash.sha1\n payload:\n default: \"playbook.tasks['input'].data['something']\"\n next:\n comment: \"hash != ''\"\n\n comment:\n name: Comment the hash\n type: automation\n automation: comment\n payload:\n default: \"playbook.tasks['hash'].data['hash']\"\n next:\n done: \"done\"\n\n done:\n name: You can close this case now\n type: task\n"}},
- },
- },
-
- {
- Name: "CreatePlaybook",
- Args: Args{Method: "Post", URL: "/playbooks", Data: map[string]any{"yaml": "name: Simple2\ntasks:\n input:\n name: Upload malware if possible\n type: input\n schema:\n title: Malware\n type: object\n properties:\n malware:\n type: string\n title: Select malware\n default: \"\"\n next:\n hash: \"malware != ''\"\n\n hash:\n name: Hash the malware\n type: automation\n automation: hash.sha1\n payload:\n default: \"playbook.tasks['input'].data['malware']\"\n next:\n escalate:\n\n escalate:\n name: Escalate to malware team\n type: task\n"}},
- Want: Want{
- Status: 200,
- Body: map[string]any{"id": "simple-2", "name": "Simple2", "yaml": "name: Simple2\ntasks:\n input:\n name: Upload malware if possible\n type: input\n schema:\n title: Malware\n type: object\n properties:\n malware:\n type: string\n title: Select malware\n default: \"\"\n next:\n hash: \"malware != ''\"\n\n hash:\n name: Hash the malware\n type: automation\n automation: hash.sha1\n payload:\n default: \"playbook.tasks['input'].data['malware']\"\n next:\n escalate:\n\n escalate:\n name: Escalate to malware team\n type: task\n"},
- },
- },
-
- {
- Name: "GetPlaybook",
- Args: Args{Method: "Get", URL: "/playbooks/simple"},
- Want: Want{
- Status: 200,
- Body: map[string]any{"id": "simple", "name": "Simple", "yaml": "name: Simple\ntasks:\n input:\n name: Enter something to hash\n type: input\n schema:\n title: Something\n type: object\n properties:\n something:\n type: string\n title: Something\n default: \"\"\n next:\n hash: \"something != ''\"\n\n hash:\n name: Hash the something\n type: automation\n automation: hash.sha1\n payload:\n default: \"playbook.tasks['input'].data['something']\"\n next:\n comment: \"hash != ''\"\n\n comment:\n name: Comment the hash\n type: automation\n automation: comment\n payload:\n default: \"playbook.tasks['hash'].data['hash']\"\n next:\n done: \"done\"\n\n done:\n name: You can close this case now\n type: task\n"},
- },
- },
-
- {
- Name: "UpdatePlaybook",
- Args: Args{Method: "Put", URL: "/playbooks/simple", Data: map[string]any{"yaml": "name: Simple\ntasks:\n input:\n name: Upload malware if possible\n type: input\n schema:\n title: Malware\n type: object\n properties:\n malware:\n type: string\n title: Select malware\n default: \"\"\n next:\n hash: \"malware != ''\"\n\n hash:\n name: Hash the malware\n type: automation\n automation: hash.sha1\n payload:\n default: \"playbook.tasks['input'].data['malware']\"\n next:\n escalate:\n\n escalate:\n name: Escalate to malware team\n type: task\n"}},
- Want: Want{
- Status: 200,
- Body: map[string]any{"id": "simple", "name": "Simple", "yaml": "name: Simple\ntasks:\n input:\n name: Upload malware if possible\n type: input\n schema:\n title: Malware\n type: object\n properties:\n malware:\n type: string\n title: Select malware\n default: \"\"\n next:\n hash: \"malware != ''\"\n\n hash:\n name: Hash the malware\n type: automation\n automation: hash.sha1\n payload:\n default: \"playbook.tasks['input'].data['malware']\"\n next:\n escalate:\n\n escalate:\n name: Escalate to malware team\n type: task\n"},
- },
- },
-
- {
- Name: "DeletePlaybook",
- Args: Args{Method: "Delete", URL: "/playbooks/simple"},
- Want: Want{
- Status: 204,
- Body: nil,
- },
- },
-
- {
- Name: "GetSettings",
- Args: Args{Method: "Get", URL: "/settings"},
- Want: Want{
- Status: 200,
- Body: map[string]any{"artifactKinds": []any{map[string]any{"icon": "mdi-server", "id": "asset", "name": "Asset"}, map[string]any{"icon": "mdi-bullseye", "id": "ioc", "name": "IOC"}}, "artifactStates": []any{map[string]any{"color": "info", "icon": "mdi-help-circle-outline", "id": "unknown", "name": "Unknown"}, map[string]any{"color": "error", "icon": "mdi-skull", "id": "malicious", "name": "Malicious"}, map[string]any{"color": "success", "icon": "mdi-check", "id": "clean", "name": "Clean"}}, "ticketTypes": []any{map[string]any{"default_playbooks": []any{}, "default_template": "default", "icon": "mdi-alert", "id": "alert", "name": "Alerts"}, map[string]any{"default_playbooks": []any{}, "default_template": "default", "icon": "mdi-radioactive", "id": "incident", "name": "Incidents"}, map[string]any{"default_playbooks": []any{}, "default_template": "default", "icon": "mdi-fingerprint", "id": "investigation", "name": "Forensic Investigations"}, map[string]any{"default_playbooks": []any{}, "default_template": "default", "icon": "mdi-target", "id": "hunt", "name": "Threat Hunting"}}, "tier": "community", "timeformat": "yyyy-MM-dd hh:mm:ss", "version": "0.0.0-test"},
- },
- },
-
- {
- Name: "SaveSettings",
- Args: Args{Method: "Post", URL: "/settings", Data: map[string]any{"artifactKinds": []any{map[string]any{"icon": "mdi-server", "id": "asset", "name": "Asset"}, map[string]any{"icon": "mdi-bullseye", "id": "ioc", "name": "IOC"}}, "artifactStates": []any{map[string]any{"color": "info", "icon": "mdi-help-circle-outline", "id": "unknown", "name": "Unknown"}, map[string]any{"color": "error", "icon": "mdi-skull", "id": "malicious", "name": "Malicious"}, map[string]any{"color": "success", "icon": "mdi-check", "id": "clean", "name": "Clean"}}, "timeformat": "yyyy-MM-dd hh:mm:ss"}},
- Want: Want{
- Status: 200,
- Body: map[string]any{"artifactKinds": []any{map[string]any{"icon": "mdi-server", "id": "asset", "name": "Asset"}, map[string]any{"icon": "mdi-bullseye", "id": "ioc", "name": "IOC"}}, "artifactStates": []any{map[string]any{"color": "info", "icon": "mdi-help-circle-outline", "id": "unknown", "name": "Unknown"}, map[string]any{"color": "error", "icon": "mdi-skull", "id": "malicious", "name": "Malicious"}, map[string]any{"color": "success", "icon": "mdi-check", "id": "clean", "name": "Clean"}}, "ticketTypes": []any{map[string]any{"default_playbooks": []any{}, "default_template": "default", "icon": "mdi-alert", "id": "alert", "name": "Alerts"}, map[string]any{"default_playbooks": []any{}, "default_template": "default", "icon": "mdi-radioactive", "id": "incident", "name": "Incidents"}, map[string]any{"default_playbooks": []any{}, "default_template": "default", "icon": "mdi-fingerprint", "id": "investigation", "name": "Forensic Investigations"}, map[string]any{"default_playbooks": []any{}, "default_template": "default", "icon": "mdi-target", "id": "hunt", "name": "Threat Hunting"}}, "tier": "community", "timeformat": "yyyy-MM-dd hh:mm:ss", "version": "0.0.0-test"},
- },
- },
-
- {
- Name: "GetStatistics",
- Args: Args{Method: "Get", URL: "/statistics"},
- Want: Want{
- Status: 200,
- Body: map[string]any{"open_tickets_per_user": map[string]any{}, "tickets_per_type": map[string]any{"alert": 2, "incident": 1}, "tickets_per_week": map[string]any{"2021-39": 3}, "unassigned": 0},
- },
- },
-
- {
- Name: "ListTasks",
- Args: Args{Method: "Get", URL: "/tasks"},
- Want: Want{
- Status: 200,
- Body: nil,
- },
- },
-
- {
- Name: "ListTemplates",
- Args: Args{Method: "Get", URL: "/templates"},
- Want: Want{
- Status: 200,
- Body: []any{map[string]any{"id": "default", "name": "Default", "schema": "{\n \"definitions\": {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://example.com/object1618746510.json\",\n \"title\": \"Default\",\n \"type\": \"object\",\n \"required\": [\n \"severity\",\n \"description\",\n \"tlp\"\n ],\n \"properties\": {\n \"severity\": {\n \"$id\": \"#root/severity\",\n \"title\": \"Severity\",\n \"type\": \"string\",\n \"default\": \"Medium\",\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"Low\",\n \"title\": \"Low\",\n \"icon\": \"mdi-chevron-up\"\n },\n {\n \"const\": \"Medium\",\n \"title\": \"Medium\",\n \"icon\": \"mdi-chevron-double-up\"\n },\n {\n \"const\": \"High\",\n \"title\": \"High\",\n \"icon\": \"mdi-chevron-triple-up\"\n }\n ]\n },\n \"tlp\": {\n \"$id\": \"#root/tlp\",\n \"title\": \"TLP\",\n \"type\": \"string\",\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"White\",\n \"title\": \"White\",\n \"icon\": \"mdi-alpha-w\"\n },\n {\n \"const\": \"Green\",\n \"title\": \"Green\",\n \"icon\": \"mdi-alpha-g\"\n },\n {\n \"const\": \"Amber\",\n \"title\": \"Amber\",\n \"icon\": \"mdi-alpha-a\"\n },\n {\n \"const\": \"Red\",\n \"title\": \"Red\",\n \"icon\": \"mdi-alpha-r\"\n }\n ]\n },\n \"description\": {\n \"$id\": \"#root/description\",\n \"title\": \"Description\",\n \"type\": \"string\",\n \"x-display\": \"textarea\",\n \"x-class\": \"pr-2\"\n }\n }\n}\n"}},
- },
- },
-
- {
- Name: "CreateTemplate",
- Args: Args{Method: "Post", URL: "/templates", Data: map[string]any{"name": "My Template", "schema": "{\n \"definitions\": {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://example.com/object1618746510.json\",\n \"title\": \"Event\",\n \"type\": \"object\",\n \"required\": [\n \"severity\",\n \"description\",\n \"tlp\"\n ],\n \"properties\": {\n \"severity\": {\n \"$id\": \"#root/severity\",\n \"title\": \"Severity\",\n \"type\": \"string\",\n \"default\": \"Medium\",\n \"nx-enum\": [\n \"Low\",\n \"Medium\",\n \"High\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"Low\",\n \"title\": \"Low\",\n \"icon\": \"mdi-chevron-up\"\n },\n {\n \"const\": \"Medium\",\n \"title\": \"Medium\",\n \"icon\": \"mdi-chevron-double-up\"\n },\n {\n \"const\": \"High\",\n \"title\": \"High\",\n \"icon\": \"mdi-chevron-triple-up\"\n }\n ]\n },\n \"tlp\": {\n \"$id\": \"#root/tlp\",\n \"title\": \"TLP\",\n \"type\": \"string\",\n \"nx-enum\": [\n \"White\",\n \"Green\",\n \"Amber\",\n \"Red\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"White\",\n \"title\": \"White\",\n \"icon\": \"mdi-alpha-w\"\n },\n {\n \"const\": \"Green\",\n \"title\": \"Green\",\n \"icon\": \"mdi-alpha-g\"\n },\n {\n \"const\": \"Amber\",\n \"title\": \"Amber\",\n \"icon\": \"mdi-alpha-a\"\n },\n {\n \"const\": \"Red\",\n \"title\": \"Red\",\n \"icon\": \"mdi-alpha-r\"\n }\n ]\n },\n \"description\": {\n \"$id\": \"#root/description\",\n \"title\": \"Description\",\n \"type\": \"string\",\n \"x-display\": \"textarea\",\n \"x-class\": \"pr-2\"\n }\n }\n}\n"}},
- Want: Want{
- Status: 200,
- Body: map[string]any{"id": "my-template", "name": "My Template", "schema": "{\n \"definitions\": {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://example.com/object1618746510.json\",\n \"title\": \"Event\",\n \"type\": \"object\",\n \"required\": [\n \"severity\",\n \"description\",\n \"tlp\"\n ],\n \"properties\": {\n \"severity\": {\n \"$id\": \"#root/severity\",\n \"title\": \"Severity\",\n \"type\": \"string\",\n \"default\": \"Medium\",\n \"nx-enum\": [\n \"Low\",\n \"Medium\",\n \"High\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"Low\",\n \"title\": \"Low\",\n \"icon\": \"mdi-chevron-up\"\n },\n {\n \"const\": \"Medium\",\n \"title\": \"Medium\",\n \"icon\": \"mdi-chevron-double-up\"\n },\n {\n \"const\": \"High\",\n \"title\": \"High\",\n \"icon\": \"mdi-chevron-triple-up\"\n }\n ]\n },\n \"tlp\": {\n \"$id\": \"#root/tlp\",\n \"title\": \"TLP\",\n \"type\": \"string\",\n \"nx-enum\": [\n \"White\",\n \"Green\",\n \"Amber\",\n \"Red\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"White\",\n \"title\": \"White\",\n \"icon\": \"mdi-alpha-w\"\n },\n {\n \"const\": \"Green\",\n \"title\": \"Green\",\n \"icon\": \"mdi-alpha-g\"\n },\n {\n \"const\": \"Amber\",\n \"title\": \"Amber\",\n \"icon\": \"mdi-alpha-a\"\n },\n {\n \"const\": \"Red\",\n \"title\": \"Red\",\n \"icon\": \"mdi-alpha-r\"\n }\n ]\n },\n \"description\": {\n \"$id\": \"#root/description\",\n \"title\": \"Description\",\n \"type\": \"string\",\n \"x-display\": \"textarea\",\n \"x-class\": \"pr-2\"\n }\n }\n}\n"},
- },
- },
-
- {
- Name: "GetTemplate",
- Args: Args{Method: "Get", URL: "/templates/default"},
- Want: Want{
- Status: 200,
- Body: map[string]any{"id": "default", "name": "Default", "schema": "{\n \"definitions\": {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://example.com/object1618746510.json\",\n \"title\": \"Default\",\n \"type\": \"object\",\n \"required\": [\n \"severity\",\n \"description\",\n \"tlp\"\n ],\n \"properties\": {\n \"severity\": {\n \"$id\": \"#root/severity\",\n \"title\": \"Severity\",\n \"type\": \"string\",\n \"default\": \"Medium\",\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"Low\",\n \"title\": \"Low\",\n \"icon\": \"mdi-chevron-up\"\n },\n {\n \"const\": \"Medium\",\n \"title\": \"Medium\",\n \"icon\": \"mdi-chevron-double-up\"\n },\n {\n \"const\": \"High\",\n \"title\": \"High\",\n \"icon\": \"mdi-chevron-triple-up\"\n }\n ]\n },\n \"tlp\": {\n \"$id\": \"#root/tlp\",\n \"title\": \"TLP\",\n \"type\": \"string\",\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"White\",\n \"title\": \"White\",\n \"icon\": \"mdi-alpha-w\"\n },\n {\n \"const\": \"Green\",\n \"title\": \"Green\",\n \"icon\": \"mdi-alpha-g\"\n },\n {\n \"const\": \"Amber\",\n \"title\": \"Amber\",\n \"icon\": \"mdi-alpha-a\"\n },\n {\n \"const\": \"Red\",\n \"title\": \"Red\",\n \"icon\": \"mdi-alpha-r\"\n }\n ]\n },\n \"description\": {\n \"$id\": \"#root/description\",\n \"title\": \"Description\",\n \"type\": \"string\",\n \"x-display\": \"textarea\",\n \"x-class\": \"pr-2\"\n }\n }\n}\n"},
- },
- },
-
- {
- Name: "UpdateTemplate",
- Args: Args{Method: "Put", URL: "/templates/default", Data: map[string]any{"name": "My Template", "schema": "{\n \"definitions\": {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://example.com/object1618746510.json\",\n \"title\": \"Event\",\n \"type\": \"object\",\n \"required\": [\n \"severity\",\n \"description\",\n \"tlp\"\n ],\n \"properties\": {\n \"severity\": {\n \"$id\": \"#root/severity\",\n \"title\": \"Severity\",\n \"type\": \"string\",\n \"default\": \"Medium\",\n \"nx-enum\": [\n \"Low\",\n \"Medium\",\n \"High\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"Low\",\n \"title\": \"Low\",\n \"icon\": \"mdi-chevron-up\"\n },\n {\n \"const\": \"Medium\",\n \"title\": \"Medium\",\n \"icon\": \"mdi-chevron-double-up\"\n },\n {\n \"const\": \"High\",\n \"title\": \"High\",\n \"icon\": \"mdi-chevron-triple-up\"\n }\n ]\n },\n \"tlp\": {\n \"$id\": \"#root/tlp\",\n \"title\": \"TLP\",\n \"type\": \"string\",\n \"nx-enum\": [\n \"White\",\n \"Green\",\n \"Amber\",\n \"Red\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"White\",\n \"title\": \"White\",\n \"icon\": \"mdi-alpha-w\"\n },\n {\n \"const\": \"Green\",\n \"title\": \"Green\",\n \"icon\": \"mdi-alpha-g\"\n },\n {\n \"const\": \"Amber\",\n \"title\": \"Amber\",\n \"icon\": \"mdi-alpha-a\"\n },\n {\n \"const\": \"Red\",\n \"title\": \"Red\",\n \"icon\": \"mdi-alpha-r\"\n }\n ]\n },\n \"description\": {\n \"$id\": \"#root/description\",\n \"title\": \"Description\",\n \"type\": \"string\",\n \"x-display\": \"textarea\",\n \"x-class\": \"pr-2\"\n }\n }\n}\n"}},
- Want: Want{
- Status: 200,
- Body: map[string]any{"id": "default", "name": "My Template", "schema": "{\n \"definitions\": {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://example.com/object1618746510.json\",\n \"title\": \"Event\",\n \"type\": \"object\",\n \"required\": [\n \"severity\",\n \"description\",\n \"tlp\"\n ],\n \"properties\": {\n \"severity\": {\n \"$id\": \"#root/severity\",\n \"title\": \"Severity\",\n \"type\": \"string\",\n \"default\": \"Medium\",\n \"nx-enum\": [\n \"Low\",\n \"Medium\",\n \"High\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"Low\",\n \"title\": \"Low\",\n \"icon\": \"mdi-chevron-up\"\n },\n {\n \"const\": \"Medium\",\n \"title\": \"Medium\",\n \"icon\": \"mdi-chevron-double-up\"\n },\n {\n \"const\": \"High\",\n \"title\": \"High\",\n \"icon\": \"mdi-chevron-triple-up\"\n }\n ]\n },\n \"tlp\": {\n \"$id\": \"#root/tlp\",\n \"title\": \"TLP\",\n \"type\": \"string\",\n \"nx-enum\": [\n \"White\",\n \"Green\",\n \"Amber\",\n \"Red\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"White\",\n \"title\": \"White\",\n \"icon\": \"mdi-alpha-w\"\n },\n {\n \"const\": \"Green\",\n \"title\": \"Green\",\n \"icon\": \"mdi-alpha-g\"\n },\n {\n \"const\": \"Amber\",\n \"title\": \"Amber\",\n \"icon\": \"mdi-alpha-a\"\n },\n {\n \"const\": \"Red\",\n \"title\": \"Red\",\n \"icon\": \"mdi-alpha-r\"\n }\n ]\n },\n \"description\": {\n \"$id\": \"#root/description\",\n \"title\": \"Description\",\n \"type\": \"string\",\n \"x-display\": \"textarea\",\n \"x-class\": \"pr-2\"\n }\n }\n}\n"},
- },
- },
-
- {
- Name: "DeleteTemplate",
- Args: Args{Method: "Delete", URL: "/templates/default"},
- Want: Want{
- Status: 204,
- Body: nil,
- },
- },
-
- {
- Name: "ListTickets",
- Args: Args{Method: "Get", URL: "/tickets"},
- Want: Want{
- Status: 200,
- Body: map[string]any{"count": 3, "tickets": []any{map[string]any{"artifacts": []any{map[string]any{"name": "94d5cab6f5fe3422a447ab15436e7a672bc0c09a", "status": "unknown"}, map[string]any{"name": "http://www.customerviral.io/scalable/vertical/killer", "status": "clean"}, map[string]any{"name": "leadreintermediate.io", "status": "malicious"}}, "created": time.Date(2021, time.October, 2, 16, 4, 59, 78206000, time.UTC), "id": 8123, "modified": time.Date(2021, time.October, 2, 16, 4, 59, 78206000, time.UTC), "name": "live zebra", "owner": "demo", "playbooks": map[string]any{"phishing": map[string]any{"name": "Phishing", "tasks": map[string]any{"block-iocs": map[string]any{"created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Block IOCs", "type": "task"}, "block-sender": map[string]any{"created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Block sender", "next": map[string]any{"extract-iocs": ""}, "type": "task"}, "board": map[string]any{"created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Board Involvement?", "next": map[string]any{"escalate": "boardInvolved == true", "mail-available": "boardInvolved == false"}, "schema": map[string]any{"properties": map[string]any{"boardInvolved": map[string]any{"default": false, "title": "A board member is involved.", "type": "boolean"}}, "required": []any{"boardInvolved"}, "title": "Board Involvement?", "type": "object"}, "type": "input"}, "escalate": map[string]any{"created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Escalate to CISO", "type": "task"}, "extract-iocs": map[string]any{"created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Extract IOCs", "next": map[string]any{"block-iocs": ""}, "schema": map[string]any{"properties": map[string]any{"iocs": map[string]any{"items": map[string]any{"type": "string"}, "title": "IOCs", "type": "array"}}, "title": "Extract IOCs", "type": "object"}, "type": "input"}, "mail-available": map[string]any{"created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Mail available", "next": map[string]any{"block-sender": "schemaKey == 'yes'", "extract-iocs": "schemaKey == 'yes'", "search-email-gateway": "schemaKey == 'no'"}, "schema": map[string]any{"oneOf": []any{map[string]any{"properties": map[string]any{"mail": map[string]any{"title": "Mail", "type": "string", "x-display": "textarea"}, "schemaKey": map[string]any{"const": "yes", "type": "string"}}, "required": []any{"mail"}, "title": "Yes"}, map[string]any{"properties": map[string]any{"schemaKey": map[string]any{"const": "no", "type": "string"}}, "title": "No"}}, "title": "Mail available", "type": "object"}, "type": "input"}, "search-email-gateway": map[string]any{"created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Search email gateway", "next": map[string]any{"extract-iocs": ""}, "type": "task"}}}}, "references": []any{map[string]any{"href": "https://www.leadmaximize.net/e-services/back-end", "name": "performance"}, map[string]any{"href": "http://www.corporateinteractive.name/rich", "name": "autumn"}, map[string]any{"href": "https://www.corporateintuitive.org/intuitive/platforms/integrate", "name": "suggest"}}, "schema": "{\n \"definitions\": {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://example.com/object1618746510.json\",\n \"title\": \"Event\",\n \"type\": \"object\",\n \"required\": [\n \"severity\",\n \"description\",\n \"tlp\"\n ],\n \"properties\": {\n \"severity\": {\n \"$id\": \"#root/severity\",\n \"title\": \"Severity\",\n \"type\": \"string\",\n \"default\": \"Medium\",\n \"nx-enum\": [\n \"Low\",\n \"Medium\",\n \"High\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"Low\",\n \"title\": \"Low\",\n \"icon\": \"mdi-chevron-up\"\n },\n {\n \"const\": \"Medium\",\n \"title\": \"Medium\",\n \"icon\": \"mdi-chevron-double-up\"\n },\n {\n \"const\": \"High\",\n \"title\": \"High\",\n \"icon\": \"mdi-chevron-triple-up\"\n }\n ]\n },\n \"tlp\": {\n \"$id\": \"#root/tlp\",\n \"title\": \"TLP\",\n \"type\": \"string\",\n \"nx-enum\": [\n \"White\",\n \"Green\",\n \"Amber\",\n \"Red\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"White\",\n \"title\": \"White\",\n \"icon\": \"mdi-alpha-w\"\n },\n {\n \"const\": \"Green\",\n \"title\": \"Green\",\n \"icon\": \"mdi-alpha-g\"\n },\n {\n \"const\": \"Amber\",\n \"title\": \"Amber\",\n \"icon\": \"mdi-alpha-a\"\n },\n {\n \"const\": \"Red\",\n \"title\": \"Red\",\n \"icon\": \"mdi-alpha-r\"\n }\n ]\n },\n \"description\": {\n \"$id\": \"#root/description\",\n \"title\": \"Description\",\n \"type\": \"string\",\n \"x-display\": \"textarea\",\n \"x-class\": \"pr-2\"\n }\n }\n}\n", "status": "closed", "type": "incident"}, map[string]any{"created": time.Date(2021, time.October, 2, 16, 4, 59, 78186000, time.UTC), "id": 8125, "modified": time.Date(2021, time.October, 2, 16, 4, 59, 78186000, time.UTC), "name": "phishing from selenafadel@von.com detected", "owner": "demo", "references": []any{map[string]any{"href": "https://www.seniorleading-edge.name/users/efficient", "name": "recovery"}, map[string]any{"href": "http://www.dynamicseamless.com/clicks-and-mortar", "name": "force"}, map[string]any{"href": "http://www.leadscalable.biz/envisioneer", "name": "fund"}}, "schema": "{}", "status": "closed", "type": "alert"}, map[string]any{"created": time.Date(2021, time.October, 2, 16, 4, 59, 78186000, time.UTC), "id": 8126, "modified": time.Date(2021, time.October, 2, 16, 4, 59, 78186000, time.UTC), "name": "Surfaceintroduce virus detected", "owner": "demo", "references": []any{map[string]any{"href": "http://www.centralworld-class.io/synthesize", "name": "university"}, map[string]any{"href": "https://www.futurevirtual.org/supply-chains/markets/sticky/iterate", "name": "goal"}, map[string]any{"href": "http://www.chiefsyndicate.io/action-items", "name": "unemployment"}}, "schema": "{}", "status": "closed", "type": "alert"}}},
- },
- },
-
- {
- Name: "CreateTicket",
- Args: Args{Method: "Post", URL: "/tickets", Data: map[string]any{"id": 123, "name": "Wannacry infection", "owner": "bob", "status": "open", "type": "incident"}},
- Want: Want{
- Status: 200,
- Body: map[string]any{"created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "id": 123, "modified": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "name": "Wannacry infection", "owner": "bob", "schema": "{}", "status": "open", "type": "incident"},
- },
- },
-
- {
- Name: "CreateTicketBatch",
- Args: Args{Method: "Post", URL: "/tickets/batch", Data: []any{map[string]any{"id": 123, "name": "Wannacry infection", "owner": "bob", "status": "open", "type": "incident"}}},
- Want: Want{
- Status: 204,
- Body: nil,
- },
- },
-
- {
- Name: "GetTicket",
- Args: Args{Method: "Get", URL: "/tickets/8125"},
- Want: Want{
- Status: 200,
- Body: map[string]any{"created": time.Date(2021, time.October, 2, 16, 4, 59, 78186000, time.UTC), "id": 8125, "modified": time.Date(2021, time.October, 2, 16, 4, 59, 78186000, time.UTC), "name": "phishing from selenafadel@von.com detected", "owner": "demo", "references": []any{map[string]any{"href": "https://www.seniorleading-edge.name/users/efficient", "name": "recovery"}, map[string]any{"href": "http://www.dynamicseamless.com/clicks-and-mortar", "name": "force"}, map[string]any{"href": "http://www.leadscalable.biz/envisioneer", "name": "fund"}}, "schema": "{}", "status": "closed", "tickets": []any{map[string]any{"created": time.Date(2021, time.October, 2, 16, 4, 59, 78186000, time.UTC), "id": 8126, "modified": time.Date(2021, time.October, 2, 16, 4, 59, 78186000, time.UTC), "name": "Surfaceintroduce virus detected", "owner": "demo", "references": []any{map[string]any{"href": "http://www.centralworld-class.io/synthesize", "name": "university"}, map[string]any{"href": "https://www.futurevirtual.org/supply-chains/markets/sticky/iterate", "name": "goal"}, map[string]any{"href": "http://www.chiefsyndicate.io/action-items", "name": "unemployment"}}, "schema": "{}", "status": "closed", "type": "alert"}}, "type": "alert"},
- },
- },
-
- {
- Name: "UpdateTicket",
- Args: Args{Method: "Put", URL: "/tickets/8125", Data: map[string]any{"created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "modified": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "name": "phishing from selenafadel@von.org detected", "owner": "demo", "references": []any{map[string]any{"href": "https://www.seniorleading-edge.name/users/efficient", "name": "recovery"}, map[string]any{"href": "http://www.dynamicseamless.com/clicks-and-mortar", "name": "force"}, map[string]any{"href": "http://www.leadscalable.biz/envisioneer", "name": "fund"}}, "schema": "{}", "status": "closed", "type": "alert"}},
- Want: Want{
- Status: 200,
- Body: map[string]any{"created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "id": 8125, "modified": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "name": "phishing from selenafadel@von.org detected", "owner": "demo", "references": []any{map[string]any{"href": "https://www.seniorleading-edge.name/users/efficient", "name": "recovery"}, map[string]any{"href": "http://www.dynamicseamless.com/clicks-and-mortar", "name": "force"}, map[string]any{"href": "http://www.leadscalable.biz/envisioneer", "name": "fund"}}, "schema": "{}", "status": "closed", "tickets": []any{map[string]any{"created": time.Date(2021, time.October, 2, 16, 4, 59, 78186000, time.UTC), "id": 8126, "modified": time.Date(2021, time.October, 2, 16, 4, 59, 78186000, time.UTC), "name": "Surfaceintroduce virus detected", "owner": "demo", "references": []any{map[string]any{"href": "http://www.centralworld-class.io/synthesize", "name": "university"}, map[string]any{"href": "https://www.futurevirtual.org/supply-chains/markets/sticky/iterate", "name": "goal"}, map[string]any{"href": "http://www.chiefsyndicate.io/action-items", "name": "unemployment"}}, "schema": "{}", "status": "closed", "type": "alert"}}, "type": "alert"},
- },
- },
-
- {
- Name: "DeleteTicket",
- Args: Args{Method: "Delete", URL: "/tickets/8125"},
- Want: Want{
- Status: 204,
- Body: nil,
- },
- },
-
- {
- Name: "AddArtifact",
- Args: Args{Method: "Post", URL: "/tickets/8123/artifacts", Data: map[string]any{"name": "2.2.2.2"}},
- Want: Want{
- Status: 200,
- Body: map[string]any{"artifacts": []any{map[string]any{"name": "94d5cab6f5fe3422a447ab15436e7a672bc0c09a", "status": "unknown"}, map[string]any{"name": "http://www.customerviral.io/scalable/vertical/killer", "status": "clean"}, map[string]any{"name": "leadreintermediate.io", "status": "malicious"}, map[string]any{"name": "2.2.2.2", "status": "unknown", "type": "ip"}}, "created": time.Date(2021, time.October, 2, 16, 4, 59, 78206000, time.UTC), "id": 8123, "modified": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "name": "live zebra", "owner": "demo", "playbooks": map[string]any{"phishing": map[string]any{"name": "Phishing", "tasks": map[string]any{"block-iocs": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Block IOCs", "order": 6, "type": "task"}, "block-sender": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Block sender", "next": map[string]any{"extract-iocs": ""}, "order": 3, "type": "task"}, "board": map[string]any{"active": true, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Board Involvement?", "next": map[string]any{"escalate": "boardInvolved == true", "mail-available": "boardInvolved == false"}, "order": 0, "schema": map[string]any{"properties": map[string]any{"boardInvolved": map[string]any{"default": false, "title": "A board member is involved.", "type": "boolean"}}, "required": []any{"boardInvolved"}, "title": "Board Involvement?", "type": "object"}, "type": "input"}, "escalate": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Escalate to CISO", "order": 1, "type": "task"}, "extract-iocs": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Extract IOCs", "next": map[string]any{"block-iocs": ""}, "order": 5, "schema": map[string]any{"properties": map[string]any{"iocs": map[string]any{"items": map[string]any{"type": "string"}, "title": "IOCs", "type": "array"}}, "title": "Extract IOCs", "type": "object"}, "type": "input"}, "mail-available": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Mail available", "next": map[string]any{"block-sender": "schemaKey == 'yes'", "extract-iocs": "schemaKey == 'yes'", "search-email-gateway": "schemaKey == 'no'"}, "order": 2, "schema": map[string]any{"oneOf": []any{map[string]any{"properties": map[string]any{"mail": map[string]any{"title": "Mail", "type": "string", "x-display": "textarea"}, "schemaKey": map[string]any{"const": "yes", "type": "string"}}, "required": []any{"mail"}, "title": "Yes"}, map[string]any{"properties": map[string]any{"schemaKey": map[string]any{"const": "no", "type": "string"}}, "title": "No"}}, "title": "Mail available", "type": "object"}, "type": "input"}, "search-email-gateway": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Search email gateway", "next": map[string]any{"extract-iocs": ""}, "order": 4, "type": "task"}}}}, "references": []any{map[string]any{"href": "https://www.leadmaximize.net/e-services/back-end", "name": "performance"}, map[string]any{"href": "http://www.corporateinteractive.name/rich", "name": "autumn"}, map[string]any{"href": "https://www.corporateintuitive.org/intuitive/platforms/integrate", "name": "suggest"}}, "schema": "{\n \"definitions\": {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://example.com/object1618746510.json\",\n \"title\": \"Event\",\n \"type\": \"object\",\n \"required\": [\n \"severity\",\n \"description\",\n \"tlp\"\n ],\n \"properties\": {\n \"severity\": {\n \"$id\": \"#root/severity\",\n \"title\": \"Severity\",\n \"type\": \"string\",\n \"default\": \"Medium\",\n \"nx-enum\": [\n \"Low\",\n \"Medium\",\n \"High\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"Low\",\n \"title\": \"Low\",\n \"icon\": \"mdi-chevron-up\"\n },\n {\n \"const\": \"Medium\",\n \"title\": \"Medium\",\n \"icon\": \"mdi-chevron-double-up\"\n },\n {\n \"const\": \"High\",\n \"title\": \"High\",\n \"icon\": \"mdi-chevron-triple-up\"\n }\n ]\n },\n \"tlp\": {\n \"$id\": \"#root/tlp\",\n \"title\": \"TLP\",\n \"type\": \"string\",\n \"nx-enum\": [\n \"White\",\n \"Green\",\n \"Amber\",\n \"Red\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"White\",\n \"title\": \"White\",\n \"icon\": \"mdi-alpha-w\"\n },\n {\n \"const\": \"Green\",\n \"title\": \"Green\",\n \"icon\": \"mdi-alpha-g\"\n },\n {\n \"const\": \"Amber\",\n \"title\": \"Amber\",\n \"icon\": \"mdi-alpha-a\"\n },\n {\n \"const\": \"Red\",\n \"title\": \"Red\",\n \"icon\": \"mdi-alpha-r\"\n }\n ]\n },\n \"description\": {\n \"$id\": \"#root/description\",\n \"title\": \"Description\",\n \"type\": \"string\",\n \"x-display\": \"textarea\",\n \"x-class\": \"pr-2\"\n }\n }\n}\n", "status": "closed", "type": "incident"},
- },
- },
-
- {
- Name: "GetArtifact",
- Args: Args{Method: "Get", URL: "/tickets/8123/artifacts/leadreintermediate.io"},
- Want: Want{
- Status: 200,
- Body: map[string]any{"name": "leadreintermediate.io", "status": "malicious"},
- },
- },
-
- {
- Name: "SetArtifact",
- Args: Args{Method: "Put", URL: "/tickets/8123/artifacts/leadreintermediate.io", Data: map[string]any{"name": "leadreintermediate.io", "status": "clean"}},
- Want: Want{
- Status: 200,
- Body: map[string]any{"artifacts": []any{map[string]any{"name": "94d5cab6f5fe3422a447ab15436e7a672bc0c09a", "status": "unknown"}, map[string]any{"name": "http://www.customerviral.io/scalable/vertical/killer", "status": "clean"}, map[string]any{"name": "leadreintermediate.io", "status": "clean"}}, "created": time.Date(2021, time.October, 2, 16, 4, 59, 78206000, time.UTC), "id": 8123, "modified": time.Date(2021, time.October, 2, 16, 4, 59, 78206000, time.UTC), "name": "live zebra", "owner": "demo", "playbooks": map[string]any{"phishing": map[string]any{"name": "Phishing", "tasks": map[string]any{"block-iocs": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Block IOCs", "order": 6, "type": "task"}, "block-sender": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Block sender", "next": map[string]any{"extract-iocs": ""}, "order": 3, "type": "task"}, "board": map[string]any{"active": true, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Board Involvement?", "next": map[string]any{"escalate": "boardInvolved == true", "mail-available": "boardInvolved == false"}, "order": 0, "schema": map[string]any{"properties": map[string]any{"boardInvolved": map[string]any{"default": false, "title": "A board member is involved.", "type": "boolean"}}, "required": []any{"boardInvolved"}, "title": "Board Involvement?", "type": "object"}, "type": "input"}, "escalate": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Escalate to CISO", "order": 1, "type": "task"}, "extract-iocs": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Extract IOCs", "next": map[string]any{"block-iocs": ""}, "order": 5, "schema": map[string]any{"properties": map[string]any{"iocs": map[string]any{"items": map[string]any{"type": "string"}, "title": "IOCs", "type": "array"}}, "title": "Extract IOCs", "type": "object"}, "type": "input"}, "mail-available": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Mail available", "next": map[string]any{"block-sender": "schemaKey == 'yes'", "extract-iocs": "schemaKey == 'yes'", "search-email-gateway": "schemaKey == 'no'"}, "order": 2, "schema": map[string]any{"oneOf": []any{map[string]any{"properties": map[string]any{"mail": map[string]any{"title": "Mail", "type": "string", "x-display": "textarea"}, "schemaKey": map[string]any{"const": "yes", "type": "string"}}, "required": []any{"mail"}, "title": "Yes"}, map[string]any{"properties": map[string]any{"schemaKey": map[string]any{"const": "no", "type": "string"}}, "title": "No"}}, "title": "Mail available", "type": "object"}, "type": "input"}, "search-email-gateway": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Search email gateway", "next": map[string]any{"extract-iocs": ""}, "order": 4, "type": "task"}}}}, "references": []any{map[string]any{"href": "https://www.leadmaximize.net/e-services/back-end", "name": "performance"}, map[string]any{"href": "http://www.corporateinteractive.name/rich", "name": "autumn"}, map[string]any{"href": "https://www.corporateintuitive.org/intuitive/platforms/integrate", "name": "suggest"}}, "schema": "{\n \"definitions\": {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://example.com/object1618746510.json\",\n \"title\": \"Event\",\n \"type\": \"object\",\n \"required\": [\n \"severity\",\n \"description\",\n \"tlp\"\n ],\n \"properties\": {\n \"severity\": {\n \"$id\": \"#root/severity\",\n \"title\": \"Severity\",\n \"type\": \"string\",\n \"default\": \"Medium\",\n \"nx-enum\": [\n \"Low\",\n \"Medium\",\n \"High\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"Low\",\n \"title\": \"Low\",\n \"icon\": \"mdi-chevron-up\"\n },\n {\n \"const\": \"Medium\",\n \"title\": \"Medium\",\n \"icon\": \"mdi-chevron-double-up\"\n },\n {\n \"const\": \"High\",\n \"title\": \"High\",\n \"icon\": \"mdi-chevron-triple-up\"\n }\n ]\n },\n \"tlp\": {\n \"$id\": \"#root/tlp\",\n \"title\": \"TLP\",\n \"type\": \"string\",\n \"nx-enum\": [\n \"White\",\n \"Green\",\n \"Amber\",\n \"Red\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"White\",\n \"title\": \"White\",\n \"icon\": \"mdi-alpha-w\"\n },\n {\n \"const\": \"Green\",\n \"title\": \"Green\",\n \"icon\": \"mdi-alpha-g\"\n },\n {\n \"const\": \"Amber\",\n \"title\": \"Amber\",\n \"icon\": \"mdi-alpha-a\"\n },\n {\n \"const\": \"Red\",\n \"title\": \"Red\",\n \"icon\": \"mdi-alpha-r\"\n }\n ]\n },\n \"description\": {\n \"$id\": \"#root/description\",\n \"title\": \"Description\",\n \"type\": \"string\",\n \"x-display\": \"textarea\",\n \"x-class\": \"pr-2\"\n }\n }\n}\n", "status": "closed", "type": "incident"},
- },
- },
-
- {
- Name: "RemoveArtifact",
- Args: Args{Method: "Delete", URL: "/tickets/8123/artifacts/leadreintermediate.io"},
- Want: Want{
- Status: 200,
- Body: map[string]any{"artifacts": []any{map[string]any{"name": "94d5cab6f5fe3422a447ab15436e7a672bc0c09a", "status": "unknown"}, map[string]any{"name": "http://www.customerviral.io/scalable/vertical/killer", "status": "clean"}}, "created": time.Date(2021, time.October, 2, 16, 4, 59, 78206000, time.UTC), "id": 8123, "modified": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "name": "live zebra", "owner": "demo", "playbooks": map[string]any{"phishing": map[string]any{"name": "Phishing", "tasks": map[string]any{"block-iocs": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Block IOCs", "order": 6, "type": "task"}, "block-sender": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Block sender", "next": map[string]any{"extract-iocs": ""}, "order": 3, "type": "task"}, "board": map[string]any{"active": true, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Board Involvement?", "next": map[string]any{"escalate": "boardInvolved == true", "mail-available": "boardInvolved == false"}, "order": 0, "schema": map[string]any{"properties": map[string]any{"boardInvolved": map[string]any{"default": false, "title": "A board member is involved.", "type": "boolean"}}, "required": []any{"boardInvolved"}, "title": "Board Involvement?", "type": "object"}, "type": "input"}, "escalate": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Escalate to CISO", "order": 1, "type": "task"}, "extract-iocs": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Extract IOCs", "next": map[string]any{"block-iocs": ""}, "order": 5, "schema": map[string]any{"properties": map[string]any{"iocs": map[string]any{"items": map[string]any{"type": "string"}, "title": "IOCs", "type": "array"}}, "title": "Extract IOCs", "type": "object"}, "type": "input"}, "mail-available": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Mail available", "next": map[string]any{"block-sender": "schemaKey == 'yes'", "extract-iocs": "schemaKey == 'yes'", "search-email-gateway": "schemaKey == 'no'"}, "order": 2, "schema": map[string]any{"oneOf": []any{map[string]any{"properties": map[string]any{"mail": map[string]any{"title": "Mail", "type": "string", "x-display": "textarea"}, "schemaKey": map[string]any{"const": "yes", "type": "string"}}, "required": []any{"mail"}, "title": "Yes"}, map[string]any{"properties": map[string]any{"schemaKey": map[string]any{"const": "no", "type": "string"}}, "title": "No"}}, "title": "Mail available", "type": "object"}, "type": "input"}, "search-email-gateway": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Search email gateway", "next": map[string]any{"extract-iocs": ""}, "order": 4, "type": "task"}}}}, "references": []any{map[string]any{"href": "https://www.leadmaximize.net/e-services/back-end", "name": "performance"}, map[string]any{"href": "http://www.corporateinteractive.name/rich", "name": "autumn"}, map[string]any{"href": "https://www.corporateintuitive.org/intuitive/platforms/integrate", "name": "suggest"}}, "schema": "{\n \"definitions\": {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://example.com/object1618746510.json\",\n \"title\": \"Event\",\n \"type\": \"object\",\n \"required\": [\n \"severity\",\n \"description\",\n \"tlp\"\n ],\n \"properties\": {\n \"severity\": {\n \"$id\": \"#root/severity\",\n \"title\": \"Severity\",\n \"type\": \"string\",\n \"default\": \"Medium\",\n \"nx-enum\": [\n \"Low\",\n \"Medium\",\n \"High\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"Low\",\n \"title\": \"Low\",\n \"icon\": \"mdi-chevron-up\"\n },\n {\n \"const\": \"Medium\",\n \"title\": \"Medium\",\n \"icon\": \"mdi-chevron-double-up\"\n },\n {\n \"const\": \"High\",\n \"title\": \"High\",\n \"icon\": \"mdi-chevron-triple-up\"\n }\n ]\n },\n \"tlp\": {\n \"$id\": \"#root/tlp\",\n \"title\": \"TLP\",\n \"type\": \"string\",\n \"nx-enum\": [\n \"White\",\n \"Green\",\n \"Amber\",\n \"Red\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"White\",\n \"title\": \"White\",\n \"icon\": \"mdi-alpha-w\"\n },\n {\n \"const\": \"Green\",\n \"title\": \"Green\",\n \"icon\": \"mdi-alpha-g\"\n },\n {\n \"const\": \"Amber\",\n \"title\": \"Amber\",\n \"icon\": \"mdi-alpha-a\"\n },\n {\n \"const\": \"Red\",\n \"title\": \"Red\",\n \"icon\": \"mdi-alpha-r\"\n }\n ]\n },\n \"description\": {\n \"$id\": \"#root/description\",\n \"title\": \"Description\",\n \"type\": \"string\",\n \"x-display\": \"textarea\",\n \"x-class\": \"pr-2\"\n }\n }\n}\n", "status": "closed", "type": "incident"},
- },
- },
-
- {
- Name: "EnrichArtifact",
- Args: Args{Method: "Post", URL: "/tickets/8123/artifacts/leadreintermediate.io/enrich", Data: map[string]any{"data": map[string]any{"hash": "b7a067a742c20d07a7456646de89bc2d408a1153"}, "name": "hash.sha1"}},
- Want: Want{
- Status: 200,
- Body: map[string]any{"artifacts": []any{map[string]any{"name": "94d5cab6f5fe3422a447ab15436e7a672bc0c09a", "status": "unknown"}, map[string]any{"name": "http://www.customerviral.io/scalable/vertical/killer", "status": "clean"}, map[string]any{"enrichments": map[string]any{"hash.sha1": map[string]any{"created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "data": map[string]any{"hash": "b7a067a742c20d07a7456646de89bc2d408a1153"}, "name": "hash.sha1"}}, "name": "leadreintermediate.io", "status": "malicious"}}, "created": time.Date(2021, time.October, 2, 16, 4, 59, 78206000, time.UTC), "id": 8123, "modified": time.Date(2021, time.October, 2, 16, 4, 59, 78206000, time.UTC), "name": "live zebra", "owner": "demo", "playbooks": map[string]any{"phishing": map[string]any{"name": "Phishing", "tasks": map[string]any{"block-iocs": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Block IOCs", "order": 6, "type": "task"}, "block-sender": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Block sender", "next": map[string]any{"extract-iocs": ""}, "order": 3, "type": "task"}, "board": map[string]any{"active": true, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Board Involvement?", "next": map[string]any{"escalate": "boardInvolved == true", "mail-available": "boardInvolved == false"}, "order": 0, "schema": map[string]any{"properties": map[string]any{"boardInvolved": map[string]any{"default": false, "title": "A board member is involved.", "type": "boolean"}}, "required": []any{"boardInvolved"}, "title": "Board Involvement?", "type": "object"}, "type": "input"}, "escalate": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Escalate to CISO", "order": 1, "type": "task"}, "extract-iocs": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Extract IOCs", "next": map[string]any{"block-iocs": ""}, "order": 5, "schema": map[string]any{"properties": map[string]any{"iocs": map[string]any{"items": map[string]any{"type": "string"}, "title": "IOCs", "type": "array"}}, "title": "Extract IOCs", "type": "object"}, "type": "input"}, "mail-available": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Mail available", "next": map[string]any{"block-sender": "schemaKey == 'yes'", "extract-iocs": "schemaKey == 'yes'", "search-email-gateway": "schemaKey == 'no'"}, "order": 2, "schema": map[string]any{"oneOf": []any{map[string]any{"properties": map[string]any{"mail": map[string]any{"title": "Mail", "type": "string", "x-display": "textarea"}, "schemaKey": map[string]any{"const": "yes", "type": "string"}}, "required": []any{"mail"}, "title": "Yes"}, map[string]any{"properties": map[string]any{"schemaKey": map[string]any{"const": "no", "type": "string"}}, "title": "No"}}, "title": "Mail available", "type": "object"}, "type": "input"}, "search-email-gateway": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Search email gateway", "next": map[string]any{"extract-iocs": ""}, "order": 4, "type": "task"}}}}, "references": []any{map[string]any{"href": "https://www.leadmaximize.net/e-services/back-end", "name": "performance"}, map[string]any{"href": "http://www.corporateinteractive.name/rich", "name": "autumn"}, map[string]any{"href": "https://www.corporateintuitive.org/intuitive/platforms/integrate", "name": "suggest"}}, "schema": "{\n \"definitions\": {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://example.com/object1618746510.json\",\n \"title\": \"Event\",\n \"type\": \"object\",\n \"required\": [\n \"severity\",\n \"description\",\n \"tlp\"\n ],\n \"properties\": {\n \"severity\": {\n \"$id\": \"#root/severity\",\n \"title\": \"Severity\",\n \"type\": \"string\",\n \"default\": \"Medium\",\n \"nx-enum\": [\n \"Low\",\n \"Medium\",\n \"High\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"Low\",\n \"title\": \"Low\",\n \"icon\": \"mdi-chevron-up\"\n },\n {\n \"const\": \"Medium\",\n \"title\": \"Medium\",\n \"icon\": \"mdi-chevron-double-up\"\n },\n {\n \"const\": \"High\",\n \"title\": \"High\",\n \"icon\": \"mdi-chevron-triple-up\"\n }\n ]\n },\n \"tlp\": {\n \"$id\": \"#root/tlp\",\n \"title\": \"TLP\",\n \"type\": \"string\",\n \"nx-enum\": [\n \"White\",\n \"Green\",\n \"Amber\",\n \"Red\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"White\",\n \"title\": \"White\",\n \"icon\": \"mdi-alpha-w\"\n },\n {\n \"const\": \"Green\",\n \"title\": \"Green\",\n \"icon\": \"mdi-alpha-g\"\n },\n {\n \"const\": \"Amber\",\n \"title\": \"Amber\",\n \"icon\": \"mdi-alpha-a\"\n },\n {\n \"const\": \"Red\",\n \"title\": \"Red\",\n \"icon\": \"mdi-alpha-r\"\n }\n ]\n },\n \"description\": {\n \"$id\": \"#root/description\",\n \"title\": \"Description\",\n \"type\": \"string\",\n \"x-display\": \"textarea\",\n \"x-class\": \"pr-2\"\n }\n }\n}\n", "status": "closed", "type": "incident"},
- },
- },
-
- {
- Name: "RunArtifact",
- Args: Args{Method: "Post", URL: "/tickets/8123/artifacts/leadreintermediate.io/run/hash.sha1"},
- Want: Want{
- Status: 204,
- Body: nil,
- },
- },
-
- {
- Name: "AddComment",
- Args: Args{Method: "Post", URL: "/tickets/8125/comments", Data: map[string]any{"message": "My first comment"}},
- Want: Want{
- Status: 200,
- Body: map[string]any{"comments": []any{map[string]any{"created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "creator": "bob", "message": "My first comment"}}, "created": time.Date(2021, time.October, 2, 16, 4, 59, 78186000, time.UTC), "id": 8125, "modified": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "name": "phishing from selenafadel@von.com detected", "owner": "demo", "references": []any{map[string]any{"href": "https://www.seniorleading-edge.name/users/efficient", "name": "recovery"}, map[string]any{"href": "http://www.dynamicseamless.com/clicks-and-mortar", "name": "force"}, map[string]any{"href": "http://www.leadscalable.biz/envisioneer", "name": "fund"}}, "schema": "{}", "status": "closed", "tickets": []any{map[string]any{"created": time.Date(2021, time.October, 2, 16, 4, 59, 78186000, time.UTC), "id": 8126, "modified": time.Date(2021, time.October, 2, 16, 4, 59, 78186000, time.UTC), "name": "Surfaceintroduce virus detected", "owner": "demo", "references": []any{map[string]any{"href": "http://www.centralworld-class.io/synthesize", "name": "university"}, map[string]any{"href": "https://www.futurevirtual.org/supply-chains/markets/sticky/iterate", "name": "goal"}, map[string]any{"href": "http://www.chiefsyndicate.io/action-items", "name": "unemployment"}}, "schema": "{}", "status": "closed", "type": "alert"}}, "type": "alert"},
- },
- },
-
- {
- Name: "RemoveComment",
- Args: Args{Method: "Delete", URL: "/tickets/8123/comments/0"},
- Want: Want{
- Status: 200,
- Body: map[string]any{"artifacts": []any{map[string]any{"name": "94d5cab6f5fe3422a447ab15436e7a672bc0c09a", "status": "unknown"}, map[string]any{"name": "http://www.customerviral.io/scalable/vertical/killer", "status": "clean"}, map[string]any{"name": "leadreintermediate.io", "status": "malicious"}}, "created": time.Date(2021, time.October, 2, 16, 4, 59, 78206000, time.UTC), "id": 8123, "modified": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "name": "live zebra", "owner": "demo", "playbooks": map[string]any{"phishing": map[string]any{"name": "Phishing", "tasks": map[string]any{"block-iocs": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Block IOCs", "order": 6, "type": "task"}, "block-sender": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Block sender", "next": map[string]any{"extract-iocs": ""}, "order": 3, "type": "task"}, "board": map[string]any{"active": true, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Board Involvement?", "next": map[string]any{"escalate": "boardInvolved == true", "mail-available": "boardInvolved == false"}, "order": 0, "schema": map[string]any{"properties": map[string]any{"boardInvolved": map[string]any{"default": false, "title": "A board member is involved.", "type": "boolean"}}, "required": []any{"boardInvolved"}, "title": "Board Involvement?", "type": "object"}, "type": "input"}, "escalate": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Escalate to CISO", "order": 1, "type": "task"}, "extract-iocs": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Extract IOCs", "next": map[string]any{"block-iocs": ""}, "order": 5, "schema": map[string]any{"properties": map[string]any{"iocs": map[string]any{"items": map[string]any{"type": "string"}, "title": "IOCs", "type": "array"}}, "title": "Extract IOCs", "type": "object"}, "type": "input"}, "mail-available": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Mail available", "next": map[string]any{"block-sender": "schemaKey == 'yes'", "extract-iocs": "schemaKey == 'yes'", "search-email-gateway": "schemaKey == 'no'"}, "order": 2, "schema": map[string]any{"oneOf": []any{map[string]any{"properties": map[string]any{"mail": map[string]any{"title": "Mail", "type": "string", "x-display": "textarea"}, "schemaKey": map[string]any{"const": "yes", "type": "string"}}, "required": []any{"mail"}, "title": "Yes"}, map[string]any{"properties": map[string]any{"schemaKey": map[string]any{"const": "no", "type": "string"}}, "title": "No"}}, "title": "Mail available", "type": "object"}, "type": "input"}, "search-email-gateway": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Search email gateway", "next": map[string]any{"extract-iocs": ""}, "order": 4, "type": "task"}}}}, "references": []any{map[string]any{"href": "https://www.leadmaximize.net/e-services/back-end", "name": "performance"}, map[string]any{"href": "http://www.corporateinteractive.name/rich", "name": "autumn"}, map[string]any{"href": "https://www.corporateintuitive.org/intuitive/platforms/integrate", "name": "suggest"}}, "schema": "{\n \"definitions\": {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://example.com/object1618746510.json\",\n \"title\": \"Event\",\n \"type\": \"object\",\n \"required\": [\n \"severity\",\n \"description\",\n \"tlp\"\n ],\n \"properties\": {\n \"severity\": {\n \"$id\": \"#root/severity\",\n \"title\": \"Severity\",\n \"type\": \"string\",\n \"default\": \"Medium\",\n \"nx-enum\": [\n \"Low\",\n \"Medium\",\n \"High\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"Low\",\n \"title\": \"Low\",\n \"icon\": \"mdi-chevron-up\"\n },\n {\n \"const\": \"Medium\",\n \"title\": \"Medium\",\n \"icon\": \"mdi-chevron-double-up\"\n },\n {\n \"const\": \"High\",\n \"title\": \"High\",\n \"icon\": \"mdi-chevron-triple-up\"\n }\n ]\n },\n \"tlp\": {\n \"$id\": \"#root/tlp\",\n \"title\": \"TLP\",\n \"type\": \"string\",\n \"nx-enum\": [\n \"White\",\n \"Green\",\n \"Amber\",\n \"Red\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"White\",\n \"title\": \"White\",\n \"icon\": \"mdi-alpha-w\"\n },\n {\n \"const\": \"Green\",\n \"title\": \"Green\",\n \"icon\": \"mdi-alpha-g\"\n },\n {\n \"const\": \"Amber\",\n \"title\": \"Amber\",\n \"icon\": \"mdi-alpha-a\"\n },\n {\n \"const\": \"Red\",\n \"title\": \"Red\",\n \"icon\": \"mdi-alpha-r\"\n }\n ]\n },\n \"description\": {\n \"$id\": \"#root/description\",\n \"title\": \"Description\",\n \"type\": \"string\",\n \"x-display\": \"textarea\",\n \"x-class\": \"pr-2\"\n }\n }\n}\n", "status": "closed", "type": "incident"},
- },
- },
-
- {
- Name: "AddTicketPlaybook",
- Args: Args{Method: "Post", URL: "/tickets/8125/playbooks", Data: map[string]any{"yaml": "name: Simple\ntasks:\n input:\n name: Upload malware if possible\n type: input\n schema:\n title: Malware\n type: object\n properties:\n malware:\n type: string\n title: Select malware\n default: \"\"\n next:\n hash: \"malware != ''\"\n\n hash:\n name: Hash the malware\n type: automation\n automation: hash.sha1\n payload:\n default: \"playbook.tasks['input'].data['malware']\"\n next:\n escalate:\n\n escalate:\n name: Escalate to malware team\n type: task\n"}},
- Want: Want{
- Status: 200,
- Body: map[string]any{"created": time.Date(2021, time.October, 2, 16, 4, 59, 78186000, time.UTC), "id": 8125, "modified": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "name": "phishing from selenafadel@von.com detected", "owner": "demo", "playbooks": map[string]any{"simple": map[string]any{"name": "Simple", "tasks": map[string]any{"escalate": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Escalate to malware team", "order": 2, "type": "task"}, "hash": map[string]any{"active": false, "automation": "hash.sha1", "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Hash the malware", "next": map[string]any{"escalate": ""}, "order": 1, "payload": map[string]any{"default": "playbook.tasks['input'].data['malware']"}, "type": "automation"}, "input": map[string]any{"active": true, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Upload malware if possible", "next": map[string]any{"hash": "malware != ''"}, "order": 0, "schema": map[string]any{"properties": map[string]any{"malware": map[string]any{"default": "", "title": "Select malware", "type": "string"}}, "title": "Malware", "type": "object"}, "type": "input"}}}}, "references": []any{map[string]any{"href": "https://www.seniorleading-edge.name/users/efficient", "name": "recovery"}, map[string]any{"href": "http://www.dynamicseamless.com/clicks-and-mortar", "name": "force"}, map[string]any{"href": "http://www.leadscalable.biz/envisioneer", "name": "fund"}}, "schema": "{}", "status": "closed", "tickets": []any{map[string]any{"created": time.Date(2021, time.October, 2, 16, 4, 59, 78186000, time.UTC), "id": 8126, "modified": time.Date(2021, time.October, 2, 16, 4, 59, 78186000, time.UTC), "name": "Surfaceintroduce virus detected", "owner": "demo", "references": []any{map[string]any{"href": "http://www.centralworld-class.io/synthesize", "name": "university"}, map[string]any{"href": "https://www.futurevirtual.org/supply-chains/markets/sticky/iterate", "name": "goal"}, map[string]any{"href": "http://www.chiefsyndicate.io/action-items", "name": "unemployment"}}, "schema": "{}", "status": "closed", "type": "alert"}}, "type": "alert"},
- },
- },
-
- {
- Name: "RemoveTicketPlaybook",
- Args: Args{Method: "Delete", URL: "/tickets/8123/playbooks/phishing"},
- Want: Want{
- Status: 200,
- Body: map[string]any{"artifacts": []any{map[string]any{"name": "94d5cab6f5fe3422a447ab15436e7a672bc0c09a", "status": "unknown"}, map[string]any{"name": "http://www.customerviral.io/scalable/vertical/killer", "status": "clean"}, map[string]any{"name": "leadreintermediate.io", "status": "malicious"}}, "created": time.Date(2021, time.October, 2, 16, 4, 59, 78206000, time.UTC), "id": 8123, "modified": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "name": "live zebra", "owner": "demo", "references": []any{map[string]any{"href": "https://www.leadmaximize.net/e-services/back-end", "name": "performance"}, map[string]any{"href": "http://www.corporateinteractive.name/rich", "name": "autumn"}, map[string]any{"href": "https://www.corporateintuitive.org/intuitive/platforms/integrate", "name": "suggest"}}, "schema": "{\n \"definitions\": {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://example.com/object1618746510.json\",\n \"title\": \"Event\",\n \"type\": \"object\",\n \"required\": [\n \"severity\",\n \"description\",\n \"tlp\"\n ],\n \"properties\": {\n \"severity\": {\n \"$id\": \"#root/severity\",\n \"title\": \"Severity\",\n \"type\": \"string\",\n \"default\": \"Medium\",\n \"nx-enum\": [\n \"Low\",\n \"Medium\",\n \"High\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"Low\",\n \"title\": \"Low\",\n \"icon\": \"mdi-chevron-up\"\n },\n {\n \"const\": \"Medium\",\n \"title\": \"Medium\",\n \"icon\": \"mdi-chevron-double-up\"\n },\n {\n \"const\": \"High\",\n \"title\": \"High\",\n \"icon\": \"mdi-chevron-triple-up\"\n }\n ]\n },\n \"tlp\": {\n \"$id\": \"#root/tlp\",\n \"title\": \"TLP\",\n \"type\": \"string\",\n \"nx-enum\": [\n \"White\",\n \"Green\",\n \"Amber\",\n \"Red\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"White\",\n \"title\": \"White\",\n \"icon\": \"mdi-alpha-w\"\n },\n {\n \"const\": \"Green\",\n \"title\": \"Green\",\n \"icon\": \"mdi-alpha-g\"\n },\n {\n \"const\": \"Amber\",\n \"title\": \"Amber\",\n \"icon\": \"mdi-alpha-a\"\n },\n {\n \"const\": \"Red\",\n \"title\": \"Red\",\n \"icon\": \"mdi-alpha-r\"\n }\n ]\n },\n \"description\": {\n \"$id\": \"#root/description\",\n \"title\": \"Description\",\n \"type\": \"string\",\n \"x-display\": \"textarea\",\n \"x-class\": \"pr-2\"\n }\n }\n}\n", "status": "closed", "type": "incident"},
- },
- },
-
- {
- Name: "SetTaskData",
- Args: Args{Method: "Put", URL: "/tickets/8123/playbooks/phishing/task/board", Data: map[string]any{"boardInvolved": true}},
- Want: Want{
- Status: 200,
- Body: map[string]any{"artifacts": []any{map[string]any{"name": "94d5cab6f5fe3422a447ab15436e7a672bc0c09a", "status": "unknown"}, map[string]any{"name": "http://www.customerviral.io/scalable/vertical/killer", "status": "clean"}, map[string]any{"name": "leadreintermediate.io", "status": "malicious"}}, "created": time.Date(2021, time.October, 2, 16, 4, 59, 78206000, time.UTC), "id": 8123, "modified": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "name": "live zebra", "owner": "demo", "playbooks": map[string]any{"phishing": map[string]any{"name": "Phishing", "tasks": map[string]any{"block-iocs": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Block IOCs", "order": 6, "type": "task"}, "block-sender": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Block sender", "next": map[string]any{"extract-iocs": ""}, "order": 3, "type": "task"}, "board": map[string]any{"active": true, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "data": map[string]any{"boardInvolved": true}, "done": false, "name": "Board Involvement?", "next": map[string]any{"escalate": "boardInvolved == true", "mail-available": "boardInvolved == false"}, "order": 0, "schema": map[string]any{"properties": map[string]any{"boardInvolved": map[string]any{"default": false, "title": "A board member is involved.", "type": "boolean"}}, "required": []any{"boardInvolved"}, "title": "Board Involvement?", "type": "object"}, "type": "input"}, "escalate": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Escalate to CISO", "order": 1, "type": "task"}, "extract-iocs": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Extract IOCs", "next": map[string]any{"block-iocs": ""}, "order": 5, "schema": map[string]any{"properties": map[string]any{"iocs": map[string]any{"items": map[string]any{"type": "string"}, "title": "IOCs", "type": "array"}}, "title": "Extract IOCs", "type": "object"}, "type": "input"}, "mail-available": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Mail available", "next": map[string]any{"block-sender": "schemaKey == 'yes'", "extract-iocs": "schemaKey == 'yes'", "search-email-gateway": "schemaKey == 'no'"}, "order": 2, "schema": map[string]any{"oneOf": []any{map[string]any{"properties": map[string]any{"mail": map[string]any{"title": "Mail", "type": "string", "x-display": "textarea"}, "schemaKey": map[string]any{"const": "yes", "type": "string"}}, "required": []any{"mail"}, "title": "Yes"}, map[string]any{"properties": map[string]any{"schemaKey": map[string]any{"const": "no", "type": "string"}}, "title": "No"}}, "title": "Mail available", "type": "object"}, "type": "input"}, "search-email-gateway": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Search email gateway", "next": map[string]any{"extract-iocs": ""}, "order": 4, "type": "task"}}}}, "references": []any{map[string]any{"href": "https://www.leadmaximize.net/e-services/back-end", "name": "performance"}, map[string]any{"href": "http://www.corporateinteractive.name/rich", "name": "autumn"}, map[string]any{"href": "https://www.corporateintuitive.org/intuitive/platforms/integrate", "name": "suggest"}}, "schema": "{\n \"definitions\": {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://example.com/object1618746510.json\",\n \"title\": \"Event\",\n \"type\": \"object\",\n \"required\": [\n \"severity\",\n \"description\",\n \"tlp\"\n ],\n \"properties\": {\n \"severity\": {\n \"$id\": \"#root/severity\",\n \"title\": \"Severity\",\n \"type\": \"string\",\n \"default\": \"Medium\",\n \"nx-enum\": [\n \"Low\",\n \"Medium\",\n \"High\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"Low\",\n \"title\": \"Low\",\n \"icon\": \"mdi-chevron-up\"\n },\n {\n \"const\": \"Medium\",\n \"title\": \"Medium\",\n \"icon\": \"mdi-chevron-double-up\"\n },\n {\n \"const\": \"High\",\n \"title\": \"High\",\n \"icon\": \"mdi-chevron-triple-up\"\n }\n ]\n },\n \"tlp\": {\n \"$id\": \"#root/tlp\",\n \"title\": \"TLP\",\n \"type\": \"string\",\n \"nx-enum\": [\n \"White\",\n \"Green\",\n \"Amber\",\n \"Red\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"White\",\n \"title\": \"White\",\n \"icon\": \"mdi-alpha-w\"\n },\n {\n \"const\": \"Green\",\n \"title\": \"Green\",\n \"icon\": \"mdi-alpha-g\"\n },\n {\n \"const\": \"Amber\",\n \"title\": \"Amber\",\n \"icon\": \"mdi-alpha-a\"\n },\n {\n \"const\": \"Red\",\n \"title\": \"Red\",\n \"icon\": \"mdi-alpha-r\"\n }\n ]\n },\n \"description\": {\n \"$id\": \"#root/description\",\n \"title\": \"Description\",\n \"type\": \"string\",\n \"x-display\": \"textarea\",\n \"x-class\": \"pr-2\"\n }\n }\n}\n", "status": "closed", "type": "incident"},
- },
- },
-
- {
- Name: "CompleteTask",
- Args: Args{Method: "Put", URL: "/tickets/8123/playbooks/phishing/task/board/complete", Data: map[string]any{"boardInvolved": true}},
- Want: Want{
- Status: 200,
- Body: map[string]any{"artifacts": []any{map[string]any{"name": "94d5cab6f5fe3422a447ab15436e7a672bc0c09a", "status": "unknown"}, map[string]any{"name": "http://www.customerviral.io/scalable/vertical/killer", "status": "clean"}, map[string]any{"name": "leadreintermediate.io", "status": "malicious"}}, "created": time.Date(2021, time.October, 2, 16, 4, 59, 78206000, time.UTC), "id": 8123, "modified": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "name": "live zebra", "owner": "demo", "playbooks": map[string]any{"phishing": map[string]any{"name": "Phishing", "tasks": map[string]any{"block-iocs": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Block IOCs", "order": 6, "type": "task"}, "block-sender": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Block sender", "next": map[string]any{"extract-iocs": ""}, "order": 3, "type": "task"}, "board": map[string]any{"active": false, "closed": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "data": map[string]any{"boardInvolved": true}, "done": true, "name": "Board Involvement?", "next": map[string]any{"escalate": "boardInvolved == true", "mail-available": "boardInvolved == false"}, "order": 0, "schema": map[string]any{"properties": map[string]any{"boardInvolved": map[string]any{"default": false, "title": "A board member is involved.", "type": "boolean"}}, "required": []any{"boardInvolved"}, "title": "Board Involvement?", "type": "object"}, "type": "input"}, "escalate": map[string]any{"active": true, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Escalate to CISO", "order": 1, "type": "task"}, "extract-iocs": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Extract IOCs", "next": map[string]any{"block-iocs": ""}, "order": 5, "schema": map[string]any{"properties": map[string]any{"iocs": map[string]any{"items": map[string]any{"type": "string"}, "title": "IOCs", "type": "array"}}, "title": "Extract IOCs", "type": "object"}, "type": "input"}, "mail-available": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Mail available", "next": map[string]any{"block-sender": "schemaKey == 'yes'", "extract-iocs": "schemaKey == 'yes'", "search-email-gateway": "schemaKey == 'no'"}, "order": 2, "schema": map[string]any{"oneOf": []any{map[string]any{"properties": map[string]any{"mail": map[string]any{"title": "Mail", "type": "string", "x-display": "textarea"}, "schemaKey": map[string]any{"const": "yes", "type": "string"}}, "required": []any{"mail"}, "title": "Yes"}, map[string]any{"properties": map[string]any{"schemaKey": map[string]any{"const": "no", "type": "string"}}, "title": "No"}}, "title": "Mail available", "type": "object"}, "type": "input"}, "search-email-gateway": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Search email gateway", "next": map[string]any{"extract-iocs": ""}, "order": 4, "type": "task"}}}}, "references": []any{map[string]any{"href": "https://www.leadmaximize.net/e-services/back-end", "name": "performance"}, map[string]any{"href": "http://www.corporateinteractive.name/rich", "name": "autumn"}, map[string]any{"href": "https://www.corporateintuitive.org/intuitive/platforms/integrate", "name": "suggest"}}, "schema": "{\n \"definitions\": {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://example.com/object1618746510.json\",\n \"title\": \"Event\",\n \"type\": \"object\",\n \"required\": [\n \"severity\",\n \"description\",\n \"tlp\"\n ],\n \"properties\": {\n \"severity\": {\n \"$id\": \"#root/severity\",\n \"title\": \"Severity\",\n \"type\": \"string\",\n \"default\": \"Medium\",\n \"nx-enum\": [\n \"Low\",\n \"Medium\",\n \"High\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"Low\",\n \"title\": \"Low\",\n \"icon\": \"mdi-chevron-up\"\n },\n {\n \"const\": \"Medium\",\n \"title\": \"Medium\",\n \"icon\": \"mdi-chevron-double-up\"\n },\n {\n \"const\": \"High\",\n \"title\": \"High\",\n \"icon\": \"mdi-chevron-triple-up\"\n }\n ]\n },\n \"tlp\": {\n \"$id\": \"#root/tlp\",\n \"title\": \"TLP\",\n \"type\": \"string\",\n \"nx-enum\": [\n \"White\",\n \"Green\",\n \"Amber\",\n \"Red\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"White\",\n \"title\": \"White\",\n \"icon\": \"mdi-alpha-w\"\n },\n {\n \"const\": \"Green\",\n \"title\": \"Green\",\n \"icon\": \"mdi-alpha-g\"\n },\n {\n \"const\": \"Amber\",\n \"title\": \"Amber\",\n \"icon\": \"mdi-alpha-a\"\n },\n {\n \"const\": \"Red\",\n \"title\": \"Red\",\n \"icon\": \"mdi-alpha-r\"\n }\n ]\n },\n \"description\": {\n \"$id\": \"#root/description\",\n \"title\": \"Description\",\n \"type\": \"string\",\n \"x-display\": \"textarea\",\n \"x-class\": \"pr-2\"\n }\n }\n}\n", "status": "closed", "type": "incident"},
- },
- },
-
- {
- Name: "SetTaskOwner",
- Args: Args{Method: "Put", URL: "/tickets/8123/playbooks/phishing/task/board/owner", Data: "eve"},
- Want: Want{
- Status: 200,
- Body: map[string]any{"artifacts": []any{map[string]any{"name": "94d5cab6f5fe3422a447ab15436e7a672bc0c09a", "status": "unknown"}, map[string]any{"name": "http://www.customerviral.io/scalable/vertical/killer", "status": "clean"}, map[string]any{"name": "leadreintermediate.io", "status": "malicious"}}, "created": time.Date(2021, time.October, 2, 16, 4, 59, 78206000, time.UTC), "id": 8123, "modified": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "name": "live zebra", "owner": "demo", "playbooks": map[string]any{"phishing": map[string]any{"name": "Phishing", "tasks": map[string]any{"block-iocs": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Block IOCs", "order": 6, "type": "task"}, "block-sender": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Block sender", "next": map[string]any{"extract-iocs": ""}, "order": 3, "type": "task"}, "board": map[string]any{"active": true, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Board Involvement?", "next": map[string]any{"escalate": "boardInvolved == true", "mail-available": "boardInvolved == false"}, "order": 0, "owner": "eve", "schema": map[string]any{"properties": map[string]any{"boardInvolved": map[string]any{"default": false, "title": "A board member is involved.", "type": "boolean"}}, "required": []any{"boardInvolved"}, "title": "Board Involvement?", "type": "object"}, "type": "input"}, "escalate": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Escalate to CISO", "order": 1, "type": "task"}, "extract-iocs": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Extract IOCs", "next": map[string]any{"block-iocs": ""}, "order": 5, "schema": map[string]any{"properties": map[string]any{"iocs": map[string]any{"items": map[string]any{"type": "string"}, "title": "IOCs", "type": "array"}}, "title": "Extract IOCs", "type": "object"}, "type": "input"}, "mail-available": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Mail available", "next": map[string]any{"block-sender": "schemaKey == 'yes'", "extract-iocs": "schemaKey == 'yes'", "search-email-gateway": "schemaKey == 'no'"}, "order": 2, "schema": map[string]any{"oneOf": []any{map[string]any{"properties": map[string]any{"mail": map[string]any{"title": "Mail", "type": "string", "x-display": "textarea"}, "schemaKey": map[string]any{"const": "yes", "type": "string"}}, "required": []any{"mail"}, "title": "Yes"}, map[string]any{"properties": map[string]any{"schemaKey": map[string]any{"const": "no", "type": "string"}}, "title": "No"}}, "title": "Mail available", "type": "object"}, "type": "input"}, "search-email-gateway": map[string]any{"active": false, "created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Search email gateway", "next": map[string]any{"extract-iocs": ""}, "order": 4, "type": "task"}}}}, "references": []any{map[string]any{"href": "https://www.leadmaximize.net/e-services/back-end", "name": "performance"}, map[string]any{"href": "http://www.corporateinteractive.name/rich", "name": "autumn"}, map[string]any{"href": "https://www.corporateintuitive.org/intuitive/platforms/integrate", "name": "suggest"}}, "schema": "{\n \"definitions\": {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://example.com/object1618746510.json\",\n \"title\": \"Event\",\n \"type\": \"object\",\n \"required\": [\n \"severity\",\n \"description\",\n \"tlp\"\n ],\n \"properties\": {\n \"severity\": {\n \"$id\": \"#root/severity\",\n \"title\": \"Severity\",\n \"type\": \"string\",\n \"default\": \"Medium\",\n \"nx-enum\": [\n \"Low\",\n \"Medium\",\n \"High\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"Low\",\n \"title\": \"Low\",\n \"icon\": \"mdi-chevron-up\"\n },\n {\n \"const\": \"Medium\",\n \"title\": \"Medium\",\n \"icon\": \"mdi-chevron-double-up\"\n },\n {\n \"const\": \"High\",\n \"title\": \"High\",\n \"icon\": \"mdi-chevron-triple-up\"\n }\n ]\n },\n \"tlp\": {\n \"$id\": \"#root/tlp\",\n \"title\": \"TLP\",\n \"type\": \"string\",\n \"nx-enum\": [\n \"White\",\n \"Green\",\n \"Amber\",\n \"Red\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"White\",\n \"title\": \"White\",\n \"icon\": \"mdi-alpha-w\"\n },\n {\n \"const\": \"Green\",\n \"title\": \"Green\",\n \"icon\": \"mdi-alpha-g\"\n },\n {\n \"const\": \"Amber\",\n \"title\": \"Amber\",\n \"icon\": \"mdi-alpha-a\"\n },\n {\n \"const\": \"Red\",\n \"title\": \"Red\",\n \"icon\": \"mdi-alpha-r\"\n }\n ]\n },\n \"description\": {\n \"$id\": \"#root/description\",\n \"title\": \"Description\",\n \"type\": \"string\",\n \"x-display\": \"textarea\",\n \"x-class\": \"pr-2\"\n }\n }\n}\n", "status": "closed", "type": "incident"},
- },
- },
-
- {
- Name: "RunTask",
- Args: Args{Method: "Post", URL: "/tickets/8123/playbooks/phishing/task/board/run"},
- Want: Want{
- Status: 204,
- Body: nil,
- },
- },
-
- {
- Name: "SetReferences",
- Args: Args{Method: "Put", URL: "/tickets/8125/references", Data: []any{map[string]any{"href": "http://www.leadscalable.biz/envisioneer", "name": "fund"}}},
- Want: Want{
- Status: 200,
- Body: map[string]any{"created": time.Date(2021, time.October, 2, 16, 4, 59, 78186000, time.UTC), "id": 8125, "modified": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "name": "phishing from selenafadel@von.com detected", "owner": "demo", "references": []any{map[string]any{"href": "http://www.leadscalable.biz/envisioneer", "name": "fund"}}, "schema": "{}", "status": "closed", "tickets": []any{map[string]any{"created": time.Date(2021, time.October, 2, 16, 4, 59, 78186000, time.UTC), "id": 8126, "modified": time.Date(2021, time.October, 2, 16, 4, 59, 78186000, time.UTC), "name": "Surfaceintroduce virus detected", "owner": "demo", "references": []any{map[string]any{"href": "http://www.centralworld-class.io/synthesize", "name": "university"}, map[string]any{"href": "https://www.futurevirtual.org/supply-chains/markets/sticky/iterate", "name": "goal"}, map[string]any{"href": "http://www.chiefsyndicate.io/action-items", "name": "unemployment"}}, "schema": "{}", "status": "closed", "type": "alert"}}, "type": "alert"},
- },
- },
-
- {
- Name: "SetSchema",
- Args: Args{Method: "Put", URL: "/tickets/8125/schema", Data: "{}"},
- Want: Want{
- Status: 200,
- Body: map[string]any{"created": time.Date(2021, time.October, 2, 16, 4, 59, 78186000, time.UTC), "id": 8125, "modified": time.Date(2021, time.October, 2, 16, 4, 59, 78186000, time.UTC), "name": "phishing from selenafadel@von.com detected", "owner": "demo", "references": []any{map[string]any{"href": "https://www.seniorleading-edge.name/users/efficient", "name": "recovery"}, map[string]any{"href": "http://www.dynamicseamless.com/clicks-and-mortar", "name": "force"}, map[string]any{"href": "http://www.leadscalable.biz/envisioneer", "name": "fund"}}, "schema": "{}", "status": "closed", "tickets": []any{map[string]any{"created": time.Date(2021, time.October, 2, 16, 4, 59, 78186000, time.UTC), "id": 8126, "modified": time.Date(2021, time.October, 2, 16, 4, 59, 78186000, time.UTC), "name": "Surfaceintroduce virus detected", "owner": "demo", "references": []any{map[string]any{"href": "http://www.centralworld-class.io/synthesize", "name": "university"}, map[string]any{"href": "https://www.futurevirtual.org/supply-chains/markets/sticky/iterate", "name": "goal"}, map[string]any{"href": "http://www.chiefsyndicate.io/action-items", "name": "unemployment"}}, "schema": "{}", "status": "closed", "type": "alert"}}, "type": "alert"},
- },
- },
-
- {
- Name: "LinkTicket",
- Args: Args{Method: "Patch", URL: "/tickets/8126/tickets", Data: 8123},
- Want: Want{
- Status: 200,
- Body: map[string]any{"created": time.Date(2021, time.October, 2, 16, 4, 59, 78186000, time.UTC), "id": 8126, "modified": time.Date(2021, time.October, 2, 16, 4, 59, 78186000, time.UTC), "name": "Surfaceintroduce virus detected", "owner": "demo", "references": []any{map[string]any{"href": "http://www.centralworld-class.io/synthesize", "name": "university"}, map[string]any{"href": "https://www.futurevirtual.org/supply-chains/markets/sticky/iterate", "name": "goal"}, map[string]any{"href": "http://www.chiefsyndicate.io/action-items", "name": "unemployment"}}, "schema": "{}", "status": "closed", "tickets": []any{map[string]any{"artifacts": []any{map[string]any{"name": "94d5cab6f5fe3422a447ab15436e7a672bc0c09a", "status": "unknown"}, map[string]any{"name": "http://www.customerviral.io/scalable/vertical/killer", "status": "clean"}, map[string]any{"name": "leadreintermediate.io", "status": "malicious"}}, "created": time.Date(2021, time.October, 2, 16, 4, 59, 78206000, time.UTC), "id": 8123, "modified": time.Date(2021, time.October, 2, 16, 4, 59, 78206000, time.UTC), "name": "live zebra", "owner": "demo", "playbooks": map[string]any{"phishing": map[string]any{"name": "Phishing", "tasks": map[string]any{"block-iocs": map[string]any{"created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Block IOCs", "type": "task"}, "block-sender": map[string]any{"created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Block sender", "next": map[string]any{"extract-iocs": ""}, "type": "task"}, "board": map[string]any{"created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Board Involvement?", "next": map[string]any{"escalate": "boardInvolved == true", "mail-available": "boardInvolved == false"}, "schema": map[string]any{"properties": map[string]any{"boardInvolved": map[string]any{"default": false, "title": "A board member is involved.", "type": "boolean"}}, "required": []any{"boardInvolved"}, "title": "Board Involvement?", "type": "object"}, "type": "input"}, "escalate": map[string]any{"created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Escalate to CISO", "type": "task"}, "extract-iocs": map[string]any{"created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Extract IOCs", "next": map[string]any{"block-iocs": ""}, "schema": map[string]any{"properties": map[string]any{"iocs": map[string]any{"items": map[string]any{"type": "string"}, "title": "IOCs", "type": "array"}}, "title": "Extract IOCs", "type": "object"}, "type": "input"}, "mail-available": map[string]any{"created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Mail available", "next": map[string]any{"block-sender": "schemaKey == 'yes'", "extract-iocs": "schemaKey == 'yes'", "search-email-gateway": "schemaKey == 'no'"}, "schema": map[string]any{"oneOf": []any{map[string]any{"properties": map[string]any{"mail": map[string]any{"title": "Mail", "type": "string", "x-display": "textarea"}, "schemaKey": map[string]any{"const": "yes", "type": "string"}}, "required": []any{"mail"}, "title": "Yes"}, map[string]any{"properties": map[string]any{"schemaKey": map[string]any{"const": "no", "type": "string"}}, "title": "No"}}, "title": "Mail available", "type": "object"}, "type": "input"}, "search-email-gateway": map[string]any{"created": time.Date(2021, time.December, 12, 12, 12, 12, 12, time.UTC), "done": false, "name": "Search email gateway", "next": map[string]any{"extract-iocs": ""}, "type": "task"}}}}, "references": []any{map[string]any{"href": "https://www.leadmaximize.net/e-services/back-end", "name": "performance"}, map[string]any{"href": "http://www.corporateinteractive.name/rich", "name": "autumn"}, map[string]any{"href": "https://www.corporateintuitive.org/intuitive/platforms/integrate", "name": "suggest"}}, "schema": "{\n \"definitions\": {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://example.com/object1618746510.json\",\n \"title\": \"Event\",\n \"type\": \"object\",\n \"required\": [\n \"severity\",\n \"description\",\n \"tlp\"\n ],\n \"properties\": {\n \"severity\": {\n \"$id\": \"#root/severity\",\n \"title\": \"Severity\",\n \"type\": \"string\",\n \"default\": \"Medium\",\n \"nx-enum\": [\n \"Low\",\n \"Medium\",\n \"High\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"Low\",\n \"title\": \"Low\",\n \"icon\": \"mdi-chevron-up\"\n },\n {\n \"const\": \"Medium\",\n \"title\": \"Medium\",\n \"icon\": \"mdi-chevron-double-up\"\n },\n {\n \"const\": \"High\",\n \"title\": \"High\",\n \"icon\": \"mdi-chevron-triple-up\"\n }\n ]\n },\n \"tlp\": {\n \"$id\": \"#root/tlp\",\n \"title\": \"TLP\",\n \"type\": \"string\",\n \"nx-enum\": [\n \"White\",\n \"Green\",\n \"Amber\",\n \"Red\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"White\",\n \"title\": \"White\",\n \"icon\": \"mdi-alpha-w\"\n },\n {\n \"const\": \"Green\",\n \"title\": \"Green\",\n \"icon\": \"mdi-alpha-g\"\n },\n {\n \"const\": \"Amber\",\n \"title\": \"Amber\",\n \"icon\": \"mdi-alpha-a\"\n },\n {\n \"const\": \"Red\",\n \"title\": \"Red\",\n \"icon\": \"mdi-alpha-r\"\n }\n ]\n },\n \"description\": {\n \"$id\": \"#root/description\",\n \"title\": \"Description\",\n \"type\": \"string\",\n \"x-display\": \"textarea\",\n \"x-class\": \"pr-2\"\n }\n }\n}\n", "status": "closed", "type": "incident"}, map[string]any{"created": time.Date(2021, time.October, 2, 16, 4, 59, 78186000, time.UTC), "id": 8125, "modified": time.Date(2021, time.October, 2, 16, 4, 59, 78186000, time.UTC), "name": "phishing from selenafadel@von.com detected", "owner": "demo", "references": []any{map[string]any{"href": "https://www.seniorleading-edge.name/users/efficient", "name": "recovery"}, map[string]any{"href": "http://www.dynamicseamless.com/clicks-and-mortar", "name": "force"}, map[string]any{"href": "http://www.leadscalable.biz/envisioneer", "name": "fund"}}, "schema": "{}", "status": "closed", "type": "alert"}}, "type": "alert"},
- },
- },
-
- {
- Name: "UnlinkTicket",
- Args: Args{Method: "Delete", URL: "/tickets/8126/tickets", Data: 8125},
- Want: Want{
- Status: 200,
- Body: map[string]any{"created": time.Date(2021, time.October, 2, 16, 4, 59, 78186000, time.UTC), "id": 8126, "modified": time.Date(2021, time.October, 2, 16, 4, 59, 78186000, time.UTC), "name": "Surfaceintroduce virus detected", "owner": "demo", "references": []any{map[string]any{"href": "http://www.centralworld-class.io/synthesize", "name": "university"}, map[string]any{"href": "https://www.futurevirtual.org/supply-chains/markets/sticky/iterate", "name": "goal"}, map[string]any{"href": "http://www.chiefsyndicate.io/action-items", "name": "unemployment"}}, "schema": "{}", "status": "closed", "type": "alert"},
- },
- },
-
- {
- Name: "ListTicketTypes",
- Args: Args{Method: "Get", URL: "/tickettypes"},
- Want: Want{
- Status: 200,
- Body: []any{map[string]any{"default_playbooks": []any{}, "default_template": "default", "icon": "mdi-alert", "id": "alert", "name": "Alerts"}, map[string]any{"default_playbooks": []any{}, "default_template": "default", "icon": "mdi-radioactive", "id": "incident", "name": "Incidents"}, map[string]any{"default_playbooks": []any{}, "default_template": "default", "icon": "mdi-fingerprint", "id": "investigation", "name": "Forensic Investigations"}, map[string]any{"default_playbooks": []any{}, "default_template": "default", "icon": "mdi-target", "id": "hunt", "name": "Threat Hunting"}},
- },
- },
-
- {
- Name: "CreateTicketType",
- Args: Args{Method: "Post", URL: "/tickettypes", Data: map[string]any{"default_playbooks": []any{}, "default_template": "default", "icon": "mdi-newspaper-variant-outline", "name": "TI Tickets"}},
- Want: Want{
- Status: 200,
- Body: map[string]any{"default_playbooks": []any{}, "default_template": "default", "icon": "mdi-newspaper-variant-outline", "id": "ti-tickets", "name": "TI Tickets"},
- },
- },
-
- {
- Name: "GetTicketType",
- Args: Args{Method: "Get", URL: "/tickettypes/alert"},
- Want: Want{
- Status: 200,
- Body: map[string]any{"default_playbooks": []any{}, "default_template": "default", "icon": "mdi-alert", "id": "alert", "name": "Alerts"},
- },
- },
-
- {
- Name: "UpdateTicketType",
- Args: Args{Method: "Put", URL: "/tickettypes/alert", Data: map[string]any{"default_playbooks": []any{}, "default_template": "default", "icon": "mdi-bell", "id": "alert", "name": "Alerts"}},
- Want: Want{
- Status: 200,
- Body: map[string]any{"default_playbooks": []any{}, "default_template": "default", "icon": "mdi-bell", "id": "alert", "name": "Alerts"},
- },
- },
-
- {
- Name: "DeleteTicketType",
- Args: Args{Method: "Delete", URL: "/tickettypes/alert"},
- Want: Want{
- Status: 204,
- Body: nil,
- },
- },
-
- {
- Name: "ListUserData",
- Args: Args{Method: "Get", URL: "/userdata"},
- Want: Want{
- Status: 200,
- Body: []any{map[string]any{"email": "bob@example.org", "id": "bob", "name": "Bob Bad"}},
- },
- },
-
- {
- Name: "GetUserData",
- Args: Args{Method: "Get", URL: "/userdata/bob"},
- Want: Want{
- Status: 200,
- Body: map[string]any{"email": "bob@example.org", "id": "bob", "name": "Bob Bad"},
- },
- },
-
- {
- Name: "UpdateUserData",
- Args: Args{Method: "Put", URL: "/userdata/bob", Data: map[string]any{"blocked": false, "email": "bob@example.org", "name": "Bob Bad"}},
- Want: Want{
- Status: 200,
- Body: map[string]any{"email": "bob@example.org", "id": "bob", "name": "Bob Bad"},
- },
- },
-
- {
- Name: "ListUsers",
- Args: Args{Method: "Get", URL: "/users"},
- Want: Want{
- Status: 200,
- Body: []any{map[string]any{"apikey": false, "blocked": false, "id": "bob", "roles": []any{"admin"}}, map[string]any{"apikey": true, "blocked": false, "id": "script", "roles": []any{"engineer"}}},
- },
- },
-
- {
- Name: "CreateUser",
- Args: Args{Method: "Post", URL: "/users", Data: map[string]any{"apikey": true, "blocked": false, "id": "syncscript", "roles": []any{"analyst"}}},
- Want: Want{
- Status: 200,
- Body: map[string]any{"blocked": false, "id": "syncscript", "roles": []any{"analyst"}, "secret": "v39bOuobnlEljfWzjAgoKzhmnh1xSMxH"},
- },
- },
-
- {
- Name: "GetUser",
- Args: Args{Method: "Get", URL: "/users/script"},
- Want: Want{
- Status: 200,
- Body: map[string]any{"apikey": true, "blocked": false, "id": "script", "roles": []any{"engineer"}},
- },
- },
-
- {
- Name: "UpdateUser",
- Args: Args{Method: "Put", URL: "/users/bob", Data: map[string]any{"apikey": false, "blocked": false, "id": "syncscript", "roles": []any{"analyst", "admin"}}},
- Want: Want{
- Status: 200,
- Body: map[string]any{"apikey": false, "blocked": false, "id": "bob", "roles": []any{"analyst", "admin"}},
- },
- },
-
- {
- Name: "DeleteUser",
- Args: Args{Method: "Delete", URL: "/users/script"},
- Want: Want{
- Status: 204,
- Body: nil,
- },
- },
-}
diff --git a/generated/caql/parser/caql_lexer.go b/generated/caql/parser/caql_lexer.go
deleted file mode 100644
index e9e4781..0000000
--- a/generated/caql/parser/caql_lexer.go
+++ /dev/null
@@ -1,535 +0,0 @@
-// Code generated from CAQLLexer.g4 by ANTLR 4.10.1. DO NOT EDIT.
-
-package parser
-
-import (
- "fmt"
- "sync"
- "unicode"
-
- "github.com/antlr/antlr4/runtime/Go/antlr"
-)
-
-// Suppress unused import error
-var _ = fmt.Printf
-var _ = sync.Once{}
-var _ = unicode.IsLetter
-
-type CAQLLexer struct {
- *antlr.BaseLexer
- channelNames []string
- modeNames []string
- // TODO: EOF string
-}
-
-var caqllexerLexerStaticData struct {
- once sync.Once
- serializedATN []int32
- channelNames []string
- modeNames []string
- literalNames []string
- symbolicNames []string
- ruleNames []string
- predictionContextCache *antlr.PredictionContextCache
- atn *antlr.ATN
- decisionToDFA []*antlr.DFA
-}
-
-func caqllexerLexerInit() {
- staticData := &caqllexerLexerStaticData
- staticData.channelNames = []string{
- "DEFAULT_TOKEN_CHANNEL", "HIDDEN", "ERRORCHANNEL",
- }
- staticData.modeNames = []string{
- "DEFAULT_MODE",
- }
- staticData.literalNames = []string{
- "", "'.'", "'=~'", "'!~'", "'=='", "'!='", "'<'", "'>'", "'<='", "'>='",
- "'+'", "'-'", "'*'", "'/'", "'%'", "'?'", "':'", "'::'", "'..'", "','",
- "'('", "')'", "'{'", "'}'", "'['", "']'",
- }
- staticData.symbolicNames = []string{
- "", "DOT", "T_REGEX_MATCH", "T_REGEX_NON_MATCH", "T_EQ", "T_NE", "T_LT",
- "T_GT", "T_LE", "T_GE", "T_PLUS", "T_MINUS", "T_TIMES", "T_DIV", "T_MOD",
- "T_QUESTION", "T_COLON", "T_SCOPE", "T_RANGE", "T_COMMA", "T_OPEN",
- "T_CLOSE", "T_OBJECT_OPEN", "T_OBJECT_CLOSE", "T_ARRAY_OPEN", "T_ARRAY_CLOSE",
- "T_AGGREGATE", "T_ALL", "T_AND", "T_ANY", "T_ASC", "T_COLLECT", "T_DESC",
- "T_DISTINCT", "T_FALSE", "T_FILTER", "T_FOR", "T_GRAPH", "T_IN", "T_INBOUND",
- "T_INSERT", "T_INTO", "T_K_SHORTEST_PATHS", "T_LET", "T_LIKE", "T_LIMIT",
- "T_NONE", "T_NOT", "T_NULL", "T_OR", "T_OUTBOUND", "T_REMOVE", "T_REPLACE",
- "T_RETURN", "T_SHORTEST_PATH", "T_SORT", "T_TRUE", "T_UPDATE", "T_UPSERT",
- "T_WITH", "T_KEEP", "T_COUNT", "T_OPTIONS", "T_PRUNE", "T_SEARCH", "T_TO",
- "T_CURRENT", "T_NEW", "T_OLD", "T_STRING", "T_INT", "T_FLOAT", "T_PARAMETER",
- "T_QUOTED_STRING", "SINGLE_LINE_COMMENT", "MULTILINE_COMMENT", "SPACES",
- "UNEXPECTED_CHAR", "ERROR_RECONGNIGION",
- }
- staticData.ruleNames = []string{
- "DOT", "T_REGEX_MATCH", "T_REGEX_NON_MATCH", "T_EQ", "T_NE", "T_LT",
- "T_GT", "T_LE", "T_GE", "T_PLUS", "T_MINUS", "T_TIMES", "T_DIV", "T_MOD",
- "T_QUESTION", "T_COLON", "T_SCOPE", "T_RANGE", "T_COMMA", "T_OPEN",
- "T_CLOSE", "T_OBJECT_OPEN", "T_OBJECT_CLOSE", "T_ARRAY_OPEN", "T_ARRAY_CLOSE",
- "T_AGGREGATE", "T_ALL", "T_AND", "T_ANY", "T_ASC", "T_COLLECT", "T_DESC",
- "T_DISTINCT", "T_FALSE", "T_FILTER", "T_FOR", "T_GRAPH", "T_IN", "T_INBOUND",
- "T_INSERT", "T_INTO", "T_K_SHORTEST_PATHS", "T_LET", "T_LIKE", "T_LIMIT",
- "T_NONE", "T_NOT", "T_NULL", "T_OR", "T_OUTBOUND", "T_REMOVE", "T_REPLACE",
- "T_RETURN", "T_SHORTEST_PATH", "T_SORT", "T_TRUE", "T_UPDATE", "T_UPSERT",
- "T_WITH", "T_KEEP", "T_COUNT", "T_OPTIONS", "T_PRUNE", "T_SEARCH", "T_TO",
- "T_CURRENT", "T_NEW", "T_OLD", "T_STRING", "T_INT", "T_FLOAT", "T_PARAMETER",
- "T_QUOTED_STRING", "SINGLE_LINE_COMMENT", "MULTILINE_COMMENT", "SPACES",
- "UNEXPECTED_CHAR", "HEX_DIGIT", "DIGIT", "A", "B", "C", "D", "E", "F",
- "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T",
- "U", "V", "W", "X", "Y", "Z", "ERROR_RECONGNIGION",
- }
- staticData.predictionContextCache = antlr.NewPredictionContextCache()
- staticData.serializedATN = []int32{
- 4, 0, 78, 737, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2,
- 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2,
- 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15,
- 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7,
- 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25,
- 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2,
- 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36,
- 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7,
- 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46,
- 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2,
- 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57,
- 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7,
- 62, 2, 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, 67, 7, 67,
- 2, 68, 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 2, 72, 7, 72, 2,
- 73, 7, 73, 2, 74, 7, 74, 2, 75, 7, 75, 2, 76, 7, 76, 2, 77, 7, 77, 2, 78,
- 7, 78, 2, 79, 7, 79, 2, 80, 7, 80, 2, 81, 7, 81, 2, 82, 7, 82, 2, 83, 7,
- 83, 2, 84, 7, 84, 2, 85, 7, 85, 2, 86, 7, 86, 2, 87, 7, 87, 2, 88, 7, 88,
- 2, 89, 7, 89, 2, 90, 7, 90, 2, 91, 7, 91, 2, 92, 7, 92, 2, 93, 7, 93, 2,
- 94, 7, 94, 2, 95, 7, 95, 2, 96, 7, 96, 2, 97, 7, 97, 2, 98, 7, 98, 2, 99,
- 7, 99, 2, 100, 7, 100, 2, 101, 7, 101, 2, 102, 7, 102, 2, 103, 7, 103,
- 2, 104, 7, 104, 2, 105, 7, 105, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 2, 1,
- 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1,
- 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11,
- 1, 12, 1, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1,
- 16, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 21,
- 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1,
- 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26,
- 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 3, 27, 292, 8, 27, 1, 28, 1,
- 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30,
- 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 32, 1,
- 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33,
- 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1,
- 35, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 37,
- 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1,
- 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40,
- 1, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1,
- 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42,
- 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 1, 44, 1,
- 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 46,
- 1, 46, 3, 46, 412, 8, 46, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 48, 1,
- 48, 1, 48, 1, 48, 1, 48, 3, 48, 424, 8, 48, 1, 49, 1, 49, 1, 49, 1, 49,
- 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1,
- 50, 1, 50, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 52,
- 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 53, 1, 53, 1, 53, 1, 53, 1,
- 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 54,
- 1, 54, 1, 54, 1, 54, 1, 54, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 56, 1,
- 56, 1, 56, 1, 56, 1, 56, 1, 56, 1, 56, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57,
- 1, 57, 1, 57, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 59, 1, 59, 1, 59, 1,
- 59, 1, 59, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 61, 1, 61, 1, 61,
- 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 62, 1, 62, 1, 62, 1, 62, 1, 62, 1,
- 62, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 64, 1, 64, 1, 64,
- 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 66, 1, 66, 1,
- 66, 1, 66, 1, 67, 1, 67, 1, 67, 1, 67, 1, 68, 1, 68, 5, 68, 553, 8, 68,
- 10, 68, 12, 68, 556, 9, 68, 1, 69, 1, 69, 5, 69, 560, 8, 69, 10, 69, 12,
- 69, 563, 9, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 4, 69, 570, 8, 69, 11,
- 69, 12, 69, 571, 1, 69, 1, 69, 1, 69, 1, 69, 4, 69, 578, 8, 69, 11, 69,
- 12, 69, 579, 3, 69, 582, 8, 69, 1, 70, 1, 70, 5, 70, 586, 8, 70, 10, 70,
- 12, 70, 589, 9, 70, 1, 70, 3, 70, 592, 8, 70, 1, 70, 1, 70, 4, 70, 596,
- 8, 70, 11, 70, 12, 70, 597, 1, 70, 1, 70, 3, 70, 602, 8, 70, 1, 70, 4,
- 70, 605, 8, 70, 11, 70, 12, 70, 606, 3, 70, 609, 8, 70, 1, 71, 1, 71, 1,
- 71, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 5, 72, 620, 8, 72, 10, 72,
- 12, 72, 623, 9, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 1, 72, 5,
- 72, 632, 8, 72, 10, 72, 12, 72, 635, 9, 72, 1, 72, 3, 72, 638, 8, 72, 1,
- 73, 1, 73, 1, 73, 1, 73, 5, 73, 644, 8, 73, 10, 73, 12, 73, 647, 9, 73,
- 1, 73, 3, 73, 650, 8, 73, 1, 73, 1, 73, 3, 73, 654, 8, 73, 1, 73, 1, 73,
- 1, 74, 1, 74, 1, 74, 1, 74, 5, 74, 662, 8, 74, 10, 74, 12, 74, 665, 9,
- 74, 1, 74, 1, 74, 1, 74, 1, 74, 1, 74, 1, 75, 1, 75, 1, 75, 1, 75, 1, 76,
- 1, 76, 1, 77, 1, 77, 1, 78, 1, 78, 1, 79, 1, 79, 1, 80, 1, 80, 1, 81, 1,
- 81, 1, 82, 1, 82, 1, 83, 1, 83, 1, 84, 1, 84, 1, 85, 1, 85, 1, 86, 1, 86,
- 1, 87, 1, 87, 1, 88, 1, 88, 1, 89, 1, 89, 1, 90, 1, 90, 1, 91, 1, 91, 1,
- 92, 1, 92, 1, 93, 1, 93, 1, 94, 1, 94, 1, 95, 1, 95, 1, 96, 1, 96, 1, 97,
- 1, 97, 1, 98, 1, 98, 1, 99, 1, 99, 1, 100, 1, 100, 1, 101, 1, 101, 1, 102,
- 1, 102, 1, 103, 1, 103, 1, 104, 1, 104, 1, 105, 1, 105, 1, 105, 1, 105,
- 1, 663, 0, 106, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17,
- 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35,
- 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53,
- 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71,
- 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89,
- 45, 91, 46, 93, 47, 95, 48, 97, 49, 99, 50, 101, 51, 103, 52, 105, 53,
- 107, 54, 109, 55, 111, 56, 113, 57, 115, 58, 117, 59, 119, 60, 121, 61,
- 123, 62, 125, 63, 127, 64, 129, 65, 131, 66, 133, 67, 135, 68, 137, 69,
- 139, 70, 141, 71, 143, 72, 145, 73, 147, 74, 149, 75, 151, 76, 153, 77,
- 155, 0, 157, 0, 159, 0, 161, 0, 163, 0, 165, 0, 167, 0, 169, 0, 171, 0,
- 173, 0, 175, 0, 177, 0, 179, 0, 181, 0, 183, 0, 185, 0, 187, 0, 189, 0,
- 191, 0, 193, 0, 195, 0, 197, 0, 199, 0, 201, 0, 203, 0, 205, 0, 207, 0,
- 209, 0, 211, 78, 1, 0, 37, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57,
- 65, 90, 95, 95, 97, 122, 1, 0, 49, 57, 1, 0, 48, 49, 2, 0, 43, 43, 45,
- 45, 2, 0, 39, 39, 92, 92, 2, 0, 34, 34, 92, 92, 2, 0, 10, 10, 13, 13, 3,
- 0, 9, 11, 13, 13, 32, 32, 3, 0, 48, 57, 65, 70, 97, 102, 1, 0, 48, 57,
- 2, 0, 65, 65, 97, 97, 2, 0, 66, 66, 98, 98, 2, 0, 67, 67, 99, 99, 2, 0,
- 68, 68, 100, 100, 2, 0, 69, 69, 101, 101, 2, 0, 70, 70, 102, 102, 2, 0,
- 71, 71, 103, 103, 2, 0, 72, 72, 104, 104, 2, 0, 73, 73, 105, 105, 2, 0,
- 74, 74, 106, 106, 2, 0, 75, 75, 107, 107, 2, 0, 76, 76, 108, 108, 2, 0,
- 77, 77, 109, 109, 2, 0, 78, 78, 110, 110, 2, 0, 79, 79, 111, 111, 2, 0,
- 80, 80, 112, 112, 2, 0, 81, 81, 113, 113, 2, 0, 82, 82, 114, 114, 2, 0,
- 83, 83, 115, 115, 2, 0, 84, 84, 116, 116, 2, 0, 85, 85, 117, 117, 2, 0,
- 86, 86, 118, 118, 2, 0, 87, 87, 119, 119, 2, 0, 88, 88, 120, 120, 2, 0,
- 89, 89, 121, 121, 2, 0, 90, 90, 122, 122, 736, 0, 1, 1, 0, 0, 0, 0, 3,
- 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11,
- 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0,
- 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0,
- 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0,
- 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0,
- 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1,
- 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57,
- 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0,
- 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0,
- 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0,
- 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0,
- 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, 0, 95, 1,
- 0, 0, 0, 0, 97, 1, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 101, 1, 0, 0, 0, 0, 103,
- 1, 0, 0, 0, 0, 105, 1, 0, 0, 0, 0, 107, 1, 0, 0, 0, 0, 109, 1, 0, 0, 0,
- 0, 111, 1, 0, 0, 0, 0, 113, 1, 0, 0, 0, 0, 115, 1, 0, 0, 0, 0, 117, 1,
- 0, 0, 0, 0, 119, 1, 0, 0, 0, 0, 121, 1, 0, 0, 0, 0, 123, 1, 0, 0, 0, 0,
- 125, 1, 0, 0, 0, 0, 127, 1, 0, 0, 0, 0, 129, 1, 0, 0, 0, 0, 131, 1, 0,
- 0, 0, 0, 133, 1, 0, 0, 0, 0, 135, 1, 0, 0, 0, 0, 137, 1, 0, 0, 0, 0, 139,
- 1, 0, 0, 0, 0, 141, 1, 0, 0, 0, 0, 143, 1, 0, 0, 0, 0, 145, 1, 0, 0, 0,
- 0, 147, 1, 0, 0, 0, 0, 149, 1, 0, 0, 0, 0, 151, 1, 0, 0, 0, 0, 153, 1,
- 0, 0, 0, 0, 211, 1, 0, 0, 0, 1, 213, 1, 0, 0, 0, 3, 215, 1, 0, 0, 0, 5,
- 218, 1, 0, 0, 0, 7, 221, 1, 0, 0, 0, 9, 224, 1, 0, 0, 0, 11, 227, 1, 0,
- 0, 0, 13, 229, 1, 0, 0, 0, 15, 231, 1, 0, 0, 0, 17, 234, 1, 0, 0, 0, 19,
- 237, 1, 0, 0, 0, 21, 239, 1, 0, 0, 0, 23, 241, 1, 0, 0, 0, 25, 243, 1,
- 0, 0, 0, 27, 245, 1, 0, 0, 0, 29, 247, 1, 0, 0, 0, 31, 249, 1, 0, 0, 0,
- 33, 251, 1, 0, 0, 0, 35, 254, 1, 0, 0, 0, 37, 257, 1, 0, 0, 0, 39, 259,
- 1, 0, 0, 0, 41, 261, 1, 0, 0, 0, 43, 263, 1, 0, 0, 0, 45, 265, 1, 0, 0,
- 0, 47, 267, 1, 0, 0, 0, 49, 269, 1, 0, 0, 0, 51, 271, 1, 0, 0, 0, 53, 281,
- 1, 0, 0, 0, 55, 291, 1, 0, 0, 0, 57, 293, 1, 0, 0, 0, 59, 297, 1, 0, 0,
- 0, 61, 301, 1, 0, 0, 0, 63, 309, 1, 0, 0, 0, 65, 314, 1, 0, 0, 0, 67, 323,
- 1, 0, 0, 0, 69, 329, 1, 0, 0, 0, 71, 336, 1, 0, 0, 0, 73, 340, 1, 0, 0,
- 0, 75, 346, 1, 0, 0, 0, 77, 349, 1, 0, 0, 0, 79, 357, 1, 0, 0, 0, 81, 364,
- 1, 0, 0, 0, 83, 369, 1, 0, 0, 0, 85, 386, 1, 0, 0, 0, 87, 390, 1, 0, 0,
- 0, 89, 395, 1, 0, 0, 0, 91, 401, 1, 0, 0, 0, 93, 411, 1, 0, 0, 0, 95, 413,
- 1, 0, 0, 0, 97, 423, 1, 0, 0, 0, 99, 425, 1, 0, 0, 0, 101, 434, 1, 0, 0,
- 0, 103, 441, 1, 0, 0, 0, 105, 449, 1, 0, 0, 0, 107, 456, 1, 0, 0, 0, 109,
- 470, 1, 0, 0, 0, 111, 475, 1, 0, 0, 0, 113, 480, 1, 0, 0, 0, 115, 487,
- 1, 0, 0, 0, 117, 494, 1, 0, 0, 0, 119, 499, 1, 0, 0, 0, 121, 504, 1, 0,
- 0, 0, 123, 510, 1, 0, 0, 0, 125, 518, 1, 0, 0, 0, 127, 524, 1, 0, 0, 0,
- 129, 531, 1, 0, 0, 0, 131, 534, 1, 0, 0, 0, 133, 542, 1, 0, 0, 0, 135,
- 546, 1, 0, 0, 0, 137, 550, 1, 0, 0, 0, 139, 581, 1, 0, 0, 0, 141, 591,
- 1, 0, 0, 0, 143, 610, 1, 0, 0, 0, 145, 637, 1, 0, 0, 0, 147, 639, 1, 0,
- 0, 0, 149, 657, 1, 0, 0, 0, 151, 671, 1, 0, 0, 0, 153, 675, 1, 0, 0, 0,
- 155, 677, 1, 0, 0, 0, 157, 679, 1, 0, 0, 0, 159, 681, 1, 0, 0, 0, 161,
- 683, 1, 0, 0, 0, 163, 685, 1, 0, 0, 0, 165, 687, 1, 0, 0, 0, 167, 689,
- 1, 0, 0, 0, 169, 691, 1, 0, 0, 0, 171, 693, 1, 0, 0, 0, 173, 695, 1, 0,
- 0, 0, 175, 697, 1, 0, 0, 0, 177, 699, 1, 0, 0, 0, 179, 701, 1, 0, 0, 0,
- 181, 703, 1, 0, 0, 0, 183, 705, 1, 0, 0, 0, 185, 707, 1, 0, 0, 0, 187,
- 709, 1, 0, 0, 0, 189, 711, 1, 0, 0, 0, 191, 713, 1, 0, 0, 0, 193, 715,
- 1, 0, 0, 0, 195, 717, 1, 0, 0, 0, 197, 719, 1, 0, 0, 0, 199, 721, 1, 0,
- 0, 0, 201, 723, 1, 0, 0, 0, 203, 725, 1, 0, 0, 0, 205, 727, 1, 0, 0, 0,
- 207, 729, 1, 0, 0, 0, 209, 731, 1, 0, 0, 0, 211, 733, 1, 0, 0, 0, 213,
- 214, 5, 46, 0, 0, 214, 2, 1, 0, 0, 0, 215, 216, 5, 61, 0, 0, 216, 217,
- 5, 126, 0, 0, 217, 4, 1, 0, 0, 0, 218, 219, 5, 33, 0, 0, 219, 220, 5, 126,
- 0, 0, 220, 6, 1, 0, 0, 0, 221, 222, 5, 61, 0, 0, 222, 223, 5, 61, 0, 0,
- 223, 8, 1, 0, 0, 0, 224, 225, 5, 33, 0, 0, 225, 226, 5, 61, 0, 0, 226,
- 10, 1, 0, 0, 0, 227, 228, 5, 60, 0, 0, 228, 12, 1, 0, 0, 0, 229, 230, 5,
- 62, 0, 0, 230, 14, 1, 0, 0, 0, 231, 232, 5, 60, 0, 0, 232, 233, 5, 61,
- 0, 0, 233, 16, 1, 0, 0, 0, 234, 235, 5, 62, 0, 0, 235, 236, 5, 61, 0, 0,
- 236, 18, 1, 0, 0, 0, 237, 238, 5, 43, 0, 0, 238, 20, 1, 0, 0, 0, 239, 240,
- 5, 45, 0, 0, 240, 22, 1, 0, 0, 0, 241, 242, 5, 42, 0, 0, 242, 24, 1, 0,
- 0, 0, 243, 244, 5, 47, 0, 0, 244, 26, 1, 0, 0, 0, 245, 246, 5, 37, 0, 0,
- 246, 28, 1, 0, 0, 0, 247, 248, 5, 63, 0, 0, 248, 30, 1, 0, 0, 0, 249, 250,
- 5, 58, 0, 0, 250, 32, 1, 0, 0, 0, 251, 252, 5, 58, 0, 0, 252, 253, 5, 58,
- 0, 0, 253, 34, 1, 0, 0, 0, 254, 255, 5, 46, 0, 0, 255, 256, 5, 46, 0, 0,
- 256, 36, 1, 0, 0, 0, 257, 258, 5, 44, 0, 0, 258, 38, 1, 0, 0, 0, 259, 260,
- 5, 40, 0, 0, 260, 40, 1, 0, 0, 0, 261, 262, 5, 41, 0, 0, 262, 42, 1, 0,
- 0, 0, 263, 264, 5, 123, 0, 0, 264, 44, 1, 0, 0, 0, 265, 266, 5, 125, 0,
- 0, 266, 46, 1, 0, 0, 0, 267, 268, 5, 91, 0, 0, 268, 48, 1, 0, 0, 0, 269,
- 270, 5, 93, 0, 0, 270, 50, 1, 0, 0, 0, 271, 272, 3, 159, 79, 0, 272, 273,
- 3, 171, 85, 0, 273, 274, 3, 171, 85, 0, 274, 275, 3, 193, 96, 0, 275, 276,
- 3, 167, 83, 0, 276, 277, 3, 171, 85, 0, 277, 278, 3, 159, 79, 0, 278, 279,
- 3, 197, 98, 0, 279, 280, 3, 167, 83, 0, 280, 52, 1, 0, 0, 0, 281, 282,
- 3, 159, 79, 0, 282, 283, 3, 181, 90, 0, 283, 284, 3, 181, 90, 0, 284, 54,
- 1, 0, 0, 0, 285, 286, 3, 159, 79, 0, 286, 287, 3, 185, 92, 0, 287, 288,
- 3, 165, 82, 0, 288, 292, 1, 0, 0, 0, 289, 290, 5, 38, 0, 0, 290, 292, 5,
- 38, 0, 0, 291, 285, 1, 0, 0, 0, 291, 289, 1, 0, 0, 0, 292, 56, 1, 0, 0,
- 0, 293, 294, 3, 159, 79, 0, 294, 295, 3, 185, 92, 0, 295, 296, 3, 207,
- 103, 0, 296, 58, 1, 0, 0, 0, 297, 298, 3, 159, 79, 0, 298, 299, 3, 195,
- 97, 0, 299, 300, 3, 163, 81, 0, 300, 60, 1, 0, 0, 0, 301, 302, 3, 163,
- 81, 0, 302, 303, 3, 187, 93, 0, 303, 304, 3, 181, 90, 0, 304, 305, 3, 181,
- 90, 0, 305, 306, 3, 167, 83, 0, 306, 307, 3, 163, 81, 0, 307, 308, 3, 197,
- 98, 0, 308, 62, 1, 0, 0, 0, 309, 310, 3, 165, 82, 0, 310, 311, 3, 167,
- 83, 0, 311, 312, 3, 195, 97, 0, 312, 313, 3, 163, 81, 0, 313, 64, 1, 0,
- 0, 0, 314, 315, 3, 165, 82, 0, 315, 316, 3, 175, 87, 0, 316, 317, 3, 195,
- 97, 0, 317, 318, 3, 197, 98, 0, 318, 319, 3, 175, 87, 0, 319, 320, 3, 185,
- 92, 0, 320, 321, 3, 163, 81, 0, 321, 322, 3, 197, 98, 0, 322, 66, 1, 0,
- 0, 0, 323, 324, 3, 169, 84, 0, 324, 325, 3, 159, 79, 0, 325, 326, 3, 181,
- 90, 0, 326, 327, 3, 195, 97, 0, 327, 328, 3, 167, 83, 0, 328, 68, 1, 0,
- 0, 0, 329, 330, 3, 169, 84, 0, 330, 331, 3, 175, 87, 0, 331, 332, 3, 181,
- 90, 0, 332, 333, 3, 197, 98, 0, 333, 334, 3, 167, 83, 0, 334, 335, 3, 193,
- 96, 0, 335, 70, 1, 0, 0, 0, 336, 337, 3, 169, 84, 0, 337, 338, 3, 187,
- 93, 0, 338, 339, 3, 193, 96, 0, 339, 72, 1, 0, 0, 0, 340, 341, 3, 171,
- 85, 0, 341, 342, 3, 193, 96, 0, 342, 343, 3, 159, 79, 0, 343, 344, 3, 189,
- 94, 0, 344, 345, 3, 173, 86, 0, 345, 74, 1, 0, 0, 0, 346, 347, 3, 175,
- 87, 0, 347, 348, 3, 185, 92, 0, 348, 76, 1, 0, 0, 0, 349, 350, 3, 175,
- 87, 0, 350, 351, 3, 185, 92, 0, 351, 352, 3, 161, 80, 0, 352, 353, 3, 187,
- 93, 0, 353, 354, 3, 199, 99, 0, 354, 355, 3, 185, 92, 0, 355, 356, 3, 165,
- 82, 0, 356, 78, 1, 0, 0, 0, 357, 358, 3, 175, 87, 0, 358, 359, 3, 185,
- 92, 0, 359, 360, 3, 195, 97, 0, 360, 361, 3, 167, 83, 0, 361, 362, 3, 193,
- 96, 0, 362, 363, 3, 197, 98, 0, 363, 80, 1, 0, 0, 0, 364, 365, 3, 175,
- 87, 0, 365, 366, 3, 185, 92, 0, 366, 367, 3, 197, 98, 0, 367, 368, 3, 187,
- 93, 0, 368, 82, 1, 0, 0, 0, 369, 370, 3, 179, 89, 0, 370, 371, 5, 95, 0,
- 0, 371, 372, 3, 195, 97, 0, 372, 373, 3, 173, 86, 0, 373, 374, 3, 187,
- 93, 0, 374, 375, 3, 193, 96, 0, 375, 376, 3, 197, 98, 0, 376, 377, 3, 167,
- 83, 0, 377, 378, 3, 195, 97, 0, 378, 379, 3, 197, 98, 0, 379, 380, 5, 95,
- 0, 0, 380, 381, 3, 189, 94, 0, 381, 382, 3, 159, 79, 0, 382, 383, 3, 197,
- 98, 0, 383, 384, 3, 173, 86, 0, 384, 385, 3, 195, 97, 0, 385, 84, 1, 0,
- 0, 0, 386, 387, 3, 181, 90, 0, 387, 388, 3, 167, 83, 0, 388, 389, 3, 197,
- 98, 0, 389, 86, 1, 0, 0, 0, 390, 391, 3, 181, 90, 0, 391, 392, 3, 175,
- 87, 0, 392, 393, 3, 179, 89, 0, 393, 394, 3, 167, 83, 0, 394, 88, 1, 0,
- 0, 0, 395, 396, 3, 181, 90, 0, 396, 397, 3, 175, 87, 0, 397, 398, 3, 183,
- 91, 0, 398, 399, 3, 175, 87, 0, 399, 400, 3, 197, 98, 0, 400, 90, 1, 0,
- 0, 0, 401, 402, 3, 185, 92, 0, 402, 403, 3, 187, 93, 0, 403, 404, 3, 185,
- 92, 0, 404, 405, 3, 167, 83, 0, 405, 92, 1, 0, 0, 0, 406, 407, 3, 185,
- 92, 0, 407, 408, 3, 187, 93, 0, 408, 409, 3, 197, 98, 0, 409, 412, 1, 0,
- 0, 0, 410, 412, 5, 33, 0, 0, 411, 406, 1, 0, 0, 0, 411, 410, 1, 0, 0, 0,
- 412, 94, 1, 0, 0, 0, 413, 414, 3, 185, 92, 0, 414, 415, 3, 199, 99, 0,
- 415, 416, 3, 181, 90, 0, 416, 417, 3, 181, 90, 0, 417, 96, 1, 0, 0, 0,
- 418, 419, 3, 187, 93, 0, 419, 420, 3, 193, 96, 0, 420, 424, 1, 0, 0, 0,
- 421, 422, 5, 124, 0, 0, 422, 424, 5, 124, 0, 0, 423, 418, 1, 0, 0, 0, 423,
- 421, 1, 0, 0, 0, 424, 98, 1, 0, 0, 0, 425, 426, 3, 187, 93, 0, 426, 427,
- 3, 199, 99, 0, 427, 428, 3, 197, 98, 0, 428, 429, 3, 161, 80, 0, 429, 430,
- 3, 187, 93, 0, 430, 431, 3, 199, 99, 0, 431, 432, 3, 185, 92, 0, 432, 433,
- 3, 165, 82, 0, 433, 100, 1, 0, 0, 0, 434, 435, 3, 193, 96, 0, 435, 436,
- 3, 167, 83, 0, 436, 437, 3, 183, 91, 0, 437, 438, 3, 187, 93, 0, 438, 439,
- 3, 201, 100, 0, 439, 440, 3, 167, 83, 0, 440, 102, 1, 0, 0, 0, 441, 442,
- 3, 193, 96, 0, 442, 443, 3, 167, 83, 0, 443, 444, 3, 189, 94, 0, 444, 445,
- 3, 181, 90, 0, 445, 446, 3, 159, 79, 0, 446, 447, 3, 163, 81, 0, 447, 448,
- 3, 167, 83, 0, 448, 104, 1, 0, 0, 0, 449, 450, 3, 193, 96, 0, 450, 451,
- 3, 167, 83, 0, 451, 452, 3, 197, 98, 0, 452, 453, 3, 199, 99, 0, 453, 454,
- 3, 193, 96, 0, 454, 455, 3, 185, 92, 0, 455, 106, 1, 0, 0, 0, 456, 457,
- 3, 195, 97, 0, 457, 458, 3, 173, 86, 0, 458, 459, 3, 187, 93, 0, 459, 460,
- 3, 193, 96, 0, 460, 461, 3, 197, 98, 0, 461, 462, 3, 167, 83, 0, 462, 463,
- 3, 195, 97, 0, 463, 464, 3, 197, 98, 0, 464, 465, 5, 95, 0, 0, 465, 466,
- 3, 189, 94, 0, 466, 467, 3, 159, 79, 0, 467, 468, 3, 197, 98, 0, 468, 469,
- 3, 173, 86, 0, 469, 108, 1, 0, 0, 0, 470, 471, 3, 195, 97, 0, 471, 472,
- 3, 187, 93, 0, 472, 473, 3, 193, 96, 0, 473, 474, 3, 197, 98, 0, 474, 110,
- 1, 0, 0, 0, 475, 476, 3, 197, 98, 0, 476, 477, 3, 193, 96, 0, 477, 478,
- 3, 199, 99, 0, 478, 479, 3, 167, 83, 0, 479, 112, 1, 0, 0, 0, 480, 481,
- 3, 199, 99, 0, 481, 482, 3, 189, 94, 0, 482, 483, 3, 165, 82, 0, 483, 484,
- 3, 159, 79, 0, 484, 485, 3, 197, 98, 0, 485, 486, 3, 167, 83, 0, 486, 114,
- 1, 0, 0, 0, 487, 488, 3, 199, 99, 0, 488, 489, 3, 189, 94, 0, 489, 490,
- 3, 195, 97, 0, 490, 491, 3, 167, 83, 0, 491, 492, 3, 193, 96, 0, 492, 493,
- 3, 197, 98, 0, 493, 116, 1, 0, 0, 0, 494, 495, 3, 203, 101, 0, 495, 496,
- 3, 175, 87, 0, 496, 497, 3, 197, 98, 0, 497, 498, 3, 173, 86, 0, 498, 118,
- 1, 0, 0, 0, 499, 500, 3, 179, 89, 0, 500, 501, 3, 167, 83, 0, 501, 502,
- 3, 167, 83, 0, 502, 503, 3, 189, 94, 0, 503, 120, 1, 0, 0, 0, 504, 505,
- 3, 163, 81, 0, 505, 506, 3, 187, 93, 0, 506, 507, 3, 199, 99, 0, 507, 508,
- 3, 185, 92, 0, 508, 509, 3, 197, 98, 0, 509, 122, 1, 0, 0, 0, 510, 511,
- 3, 187, 93, 0, 511, 512, 3, 189, 94, 0, 512, 513, 3, 197, 98, 0, 513, 514,
- 3, 175, 87, 0, 514, 515, 3, 187, 93, 0, 515, 516, 3, 185, 92, 0, 516, 517,
- 3, 195, 97, 0, 517, 124, 1, 0, 0, 0, 518, 519, 3, 189, 94, 0, 519, 520,
- 3, 193, 96, 0, 520, 521, 3, 199, 99, 0, 521, 522, 3, 185, 92, 0, 522, 523,
- 3, 167, 83, 0, 523, 126, 1, 0, 0, 0, 524, 525, 3, 195, 97, 0, 525, 526,
- 3, 167, 83, 0, 526, 527, 3, 159, 79, 0, 527, 528, 3, 193, 96, 0, 528, 529,
- 3, 163, 81, 0, 529, 530, 3, 173, 86, 0, 530, 128, 1, 0, 0, 0, 531, 532,
- 3, 197, 98, 0, 532, 533, 3, 187, 93, 0, 533, 130, 1, 0, 0, 0, 534, 535,
- 3, 163, 81, 0, 535, 536, 3, 199, 99, 0, 536, 537, 3, 193, 96, 0, 537, 538,
- 3, 193, 96, 0, 538, 539, 3, 167, 83, 0, 539, 540, 3, 185, 92, 0, 540, 541,
- 3, 197, 98, 0, 541, 132, 1, 0, 0, 0, 542, 543, 3, 185, 92, 0, 543, 544,
- 3, 167, 83, 0, 544, 545, 3, 203, 101, 0, 545, 134, 1, 0, 0, 0, 546, 547,
- 3, 187, 93, 0, 547, 548, 3, 181, 90, 0, 548, 549, 3, 165, 82, 0, 549, 136,
- 1, 0, 0, 0, 550, 554, 7, 0, 0, 0, 551, 553, 7, 1, 0, 0, 552, 551, 1, 0,
- 0, 0, 553, 556, 1, 0, 0, 0, 554, 552, 1, 0, 0, 0, 554, 555, 1, 0, 0, 0,
- 555, 138, 1, 0, 0, 0, 556, 554, 1, 0, 0, 0, 557, 561, 7, 2, 0, 0, 558,
- 560, 3, 157, 78, 0, 559, 558, 1, 0, 0, 0, 560, 563, 1, 0, 0, 0, 561, 559,
- 1, 0, 0, 0, 561, 562, 1, 0, 0, 0, 562, 582, 1, 0, 0, 0, 563, 561, 1, 0,
- 0, 0, 564, 582, 5, 48, 0, 0, 565, 566, 5, 48, 0, 0, 566, 567, 5, 120, 0,
- 0, 567, 569, 1, 0, 0, 0, 568, 570, 3, 155, 77, 0, 569, 568, 1, 0, 0, 0,
- 570, 571, 1, 0, 0, 0, 571, 569, 1, 0, 0, 0, 571, 572, 1, 0, 0, 0, 572,
- 582, 1, 0, 0, 0, 573, 574, 5, 48, 0, 0, 574, 575, 5, 98, 0, 0, 575, 577,
- 1, 0, 0, 0, 576, 578, 7, 3, 0, 0, 577, 576, 1, 0, 0, 0, 578, 579, 1, 0,
- 0, 0, 579, 577, 1, 0, 0, 0, 579, 580, 1, 0, 0, 0, 580, 582, 1, 0, 0, 0,
- 581, 557, 1, 0, 0, 0, 581, 564, 1, 0, 0, 0, 581, 565, 1, 0, 0, 0, 581,
- 573, 1, 0, 0, 0, 582, 140, 1, 0, 0, 0, 583, 587, 7, 2, 0, 0, 584, 586,
- 3, 157, 78, 0, 585, 584, 1, 0, 0, 0, 586, 589, 1, 0, 0, 0, 587, 585, 1,
- 0, 0, 0, 587, 588, 1, 0, 0, 0, 588, 592, 1, 0, 0, 0, 589, 587, 1, 0, 0,
- 0, 590, 592, 5, 48, 0, 0, 591, 583, 1, 0, 0, 0, 591, 590, 1, 0, 0, 0, 591,
- 592, 1, 0, 0, 0, 592, 593, 1, 0, 0, 0, 593, 595, 5, 46, 0, 0, 594, 596,
- 3, 157, 78, 0, 595, 594, 1, 0, 0, 0, 596, 597, 1, 0, 0, 0, 597, 595, 1,
- 0, 0, 0, 597, 598, 1, 0, 0, 0, 598, 608, 1, 0, 0, 0, 599, 601, 3, 167,
- 83, 0, 600, 602, 7, 4, 0, 0, 601, 600, 1, 0, 0, 0, 601, 602, 1, 0, 0, 0,
- 602, 604, 1, 0, 0, 0, 603, 605, 3, 157, 78, 0, 604, 603, 1, 0, 0, 0, 605,
- 606, 1, 0, 0, 0, 606, 604, 1, 0, 0, 0, 606, 607, 1, 0, 0, 0, 607, 609,
- 1, 0, 0, 0, 608, 599, 1, 0, 0, 0, 608, 609, 1, 0, 0, 0, 609, 142, 1, 0,
- 0, 0, 610, 611, 5, 64, 0, 0, 611, 612, 3, 137, 68, 0, 612, 144, 1, 0, 0,
- 0, 613, 621, 5, 39, 0, 0, 614, 615, 5, 92, 0, 0, 615, 620, 9, 0, 0, 0,
- 616, 617, 5, 39, 0, 0, 617, 620, 5, 39, 0, 0, 618, 620, 8, 5, 0, 0, 619,
- 614, 1, 0, 0, 0, 619, 616, 1, 0, 0, 0, 619, 618, 1, 0, 0, 0, 620, 623,
- 1, 0, 0, 0, 621, 619, 1, 0, 0, 0, 621, 622, 1, 0, 0, 0, 622, 624, 1, 0,
- 0, 0, 623, 621, 1, 0, 0, 0, 624, 638, 5, 39, 0, 0, 625, 633, 5, 34, 0,
- 0, 626, 627, 5, 92, 0, 0, 627, 632, 9, 0, 0, 0, 628, 629, 5, 34, 0, 0,
- 629, 632, 5, 34, 0, 0, 630, 632, 8, 6, 0, 0, 631, 626, 1, 0, 0, 0, 631,
- 628, 1, 0, 0, 0, 631, 630, 1, 0, 0, 0, 632, 635, 1, 0, 0, 0, 633, 631,
- 1, 0, 0, 0, 633, 634, 1, 0, 0, 0, 634, 636, 1, 0, 0, 0, 635, 633, 1, 0,
- 0, 0, 636, 638, 5, 34, 0, 0, 637, 613, 1, 0, 0, 0, 637, 625, 1, 0, 0, 0,
- 638, 146, 1, 0, 0, 0, 639, 640, 5, 47, 0, 0, 640, 641, 5, 47, 0, 0, 641,
- 645, 1, 0, 0, 0, 642, 644, 8, 7, 0, 0, 643, 642, 1, 0, 0, 0, 644, 647,
- 1, 0, 0, 0, 645, 643, 1, 0, 0, 0, 645, 646, 1, 0, 0, 0, 646, 653, 1, 0,
- 0, 0, 647, 645, 1, 0, 0, 0, 648, 650, 5, 13, 0, 0, 649, 648, 1, 0, 0, 0,
- 649, 650, 1, 0, 0, 0, 650, 651, 1, 0, 0, 0, 651, 654, 5, 10, 0, 0, 652,
- 654, 5, 0, 0, 1, 653, 649, 1, 0, 0, 0, 653, 652, 1, 0, 0, 0, 654, 655,
- 1, 0, 0, 0, 655, 656, 6, 73, 0, 0, 656, 148, 1, 0, 0, 0, 657, 658, 5, 47,
- 0, 0, 658, 659, 5, 42, 0, 0, 659, 663, 1, 0, 0, 0, 660, 662, 9, 0, 0, 0,
- 661, 660, 1, 0, 0, 0, 662, 665, 1, 0, 0, 0, 663, 664, 1, 0, 0, 0, 663,
- 661, 1, 0, 0, 0, 664, 666, 1, 0, 0, 0, 665, 663, 1, 0, 0, 0, 666, 667,
- 5, 42, 0, 0, 667, 668, 5, 47, 0, 0, 668, 669, 1, 0, 0, 0, 669, 670, 6,
- 74, 0, 0, 670, 150, 1, 0, 0, 0, 671, 672, 7, 8, 0, 0, 672, 673, 1, 0, 0,
- 0, 673, 674, 6, 75, 0, 0, 674, 152, 1, 0, 0, 0, 675, 676, 9, 0, 0, 0, 676,
- 154, 1, 0, 0, 0, 677, 678, 7, 9, 0, 0, 678, 156, 1, 0, 0, 0, 679, 680,
- 7, 10, 0, 0, 680, 158, 1, 0, 0, 0, 681, 682, 7, 11, 0, 0, 682, 160, 1,
- 0, 0, 0, 683, 684, 7, 12, 0, 0, 684, 162, 1, 0, 0, 0, 685, 686, 7, 13,
- 0, 0, 686, 164, 1, 0, 0, 0, 687, 688, 7, 14, 0, 0, 688, 166, 1, 0, 0, 0,
- 689, 690, 7, 15, 0, 0, 690, 168, 1, 0, 0, 0, 691, 692, 7, 16, 0, 0, 692,
- 170, 1, 0, 0, 0, 693, 694, 7, 17, 0, 0, 694, 172, 1, 0, 0, 0, 695, 696,
- 7, 18, 0, 0, 696, 174, 1, 0, 0, 0, 697, 698, 7, 19, 0, 0, 698, 176, 1,
- 0, 0, 0, 699, 700, 7, 20, 0, 0, 700, 178, 1, 0, 0, 0, 701, 702, 7, 21,
- 0, 0, 702, 180, 1, 0, 0, 0, 703, 704, 7, 22, 0, 0, 704, 182, 1, 0, 0, 0,
- 705, 706, 7, 23, 0, 0, 706, 184, 1, 0, 0, 0, 707, 708, 7, 24, 0, 0, 708,
- 186, 1, 0, 0, 0, 709, 710, 7, 25, 0, 0, 710, 188, 1, 0, 0, 0, 711, 712,
- 7, 26, 0, 0, 712, 190, 1, 0, 0, 0, 713, 714, 7, 27, 0, 0, 714, 192, 1,
- 0, 0, 0, 715, 716, 7, 28, 0, 0, 716, 194, 1, 0, 0, 0, 717, 718, 7, 29,
- 0, 0, 718, 196, 1, 0, 0, 0, 719, 720, 7, 30, 0, 0, 720, 198, 1, 0, 0, 0,
- 721, 722, 7, 31, 0, 0, 722, 200, 1, 0, 0, 0, 723, 724, 7, 32, 0, 0, 724,
- 202, 1, 0, 0, 0, 725, 726, 7, 33, 0, 0, 726, 204, 1, 0, 0, 0, 727, 728,
- 7, 34, 0, 0, 728, 206, 1, 0, 0, 0, 729, 730, 7, 35, 0, 0, 730, 208, 1,
- 0, 0, 0, 731, 732, 7, 36, 0, 0, 732, 210, 1, 0, 0, 0, 733, 734, 9, 0, 0,
- 0, 734, 735, 1, 0, 0, 0, 735, 736, 6, 105, 1, 0, 736, 212, 1, 0, 0, 0,
- 24, 0, 291, 411, 423, 554, 561, 571, 579, 581, 587, 591, 597, 601, 606,
- 608, 619, 621, 631, 633, 637, 645, 649, 653, 663, 2, 0, 1, 0, 0, 2, 0,
- }
- deserializer := antlr.NewATNDeserializer(nil)
- staticData.atn = deserializer.Deserialize(staticData.serializedATN)
- atn := staticData.atn
- staticData.decisionToDFA = make([]*antlr.DFA, len(atn.DecisionToState))
- decisionToDFA := staticData.decisionToDFA
- for index, state := range atn.DecisionToState {
- decisionToDFA[index] = antlr.NewDFA(state, index)
- }
-}
-
-// CAQLLexerInit initializes any static state used to implement CAQLLexer. By default the
-// static state used to implement the lexer is lazily initialized during the first call to
-// NewCAQLLexer(). You can call this function if you wish to initialize the static state ahead
-// of time.
-func CAQLLexerInit() {
- staticData := &caqllexerLexerStaticData
- staticData.once.Do(caqllexerLexerInit)
-}
-
-// NewCAQLLexer produces a new lexer instance for the optional input antlr.CharStream.
-func NewCAQLLexer(input antlr.CharStream) *CAQLLexer {
- CAQLLexerInit()
- l := new(CAQLLexer)
- l.BaseLexer = antlr.NewBaseLexer(input)
- staticData := &caqllexerLexerStaticData
- l.Interpreter = antlr.NewLexerATNSimulator(l, staticData.atn, staticData.decisionToDFA, staticData.predictionContextCache)
- l.channelNames = staticData.channelNames
- l.modeNames = staticData.modeNames
- l.RuleNames = staticData.ruleNames
- l.LiteralNames = staticData.literalNames
- l.SymbolicNames = staticData.symbolicNames
- l.GrammarFileName = "CAQLLexer.g4"
- // TODO: l.EOF = antlr.TokenEOF
-
- return l
-}
-
-// CAQLLexer tokens.
-const (
- CAQLLexerDOT = 1
- CAQLLexerT_REGEX_MATCH = 2
- CAQLLexerT_REGEX_NON_MATCH = 3
- CAQLLexerT_EQ = 4
- CAQLLexerT_NE = 5
- CAQLLexerT_LT = 6
- CAQLLexerT_GT = 7
- CAQLLexerT_LE = 8
- CAQLLexerT_GE = 9
- CAQLLexerT_PLUS = 10
- CAQLLexerT_MINUS = 11
- CAQLLexerT_TIMES = 12
- CAQLLexerT_DIV = 13
- CAQLLexerT_MOD = 14
- CAQLLexerT_QUESTION = 15
- CAQLLexerT_COLON = 16
- CAQLLexerT_SCOPE = 17
- CAQLLexerT_RANGE = 18
- CAQLLexerT_COMMA = 19
- CAQLLexerT_OPEN = 20
- CAQLLexerT_CLOSE = 21
- CAQLLexerT_OBJECT_OPEN = 22
- CAQLLexerT_OBJECT_CLOSE = 23
- CAQLLexerT_ARRAY_OPEN = 24
- CAQLLexerT_ARRAY_CLOSE = 25
- CAQLLexerT_AGGREGATE = 26
- CAQLLexerT_ALL = 27
- CAQLLexerT_AND = 28
- CAQLLexerT_ANY = 29
- CAQLLexerT_ASC = 30
- CAQLLexerT_COLLECT = 31
- CAQLLexerT_DESC = 32
- CAQLLexerT_DISTINCT = 33
- CAQLLexerT_FALSE = 34
- CAQLLexerT_FILTER = 35
- CAQLLexerT_FOR = 36
- CAQLLexerT_GRAPH = 37
- CAQLLexerT_IN = 38
- CAQLLexerT_INBOUND = 39
- CAQLLexerT_INSERT = 40
- CAQLLexerT_INTO = 41
- CAQLLexerT_K_SHORTEST_PATHS = 42
- CAQLLexerT_LET = 43
- CAQLLexerT_LIKE = 44
- CAQLLexerT_LIMIT = 45
- CAQLLexerT_NONE = 46
- CAQLLexerT_NOT = 47
- CAQLLexerT_NULL = 48
- CAQLLexerT_OR = 49
- CAQLLexerT_OUTBOUND = 50
- CAQLLexerT_REMOVE = 51
- CAQLLexerT_REPLACE = 52
- CAQLLexerT_RETURN = 53
- CAQLLexerT_SHORTEST_PATH = 54
- CAQLLexerT_SORT = 55
- CAQLLexerT_TRUE = 56
- CAQLLexerT_UPDATE = 57
- CAQLLexerT_UPSERT = 58
- CAQLLexerT_WITH = 59
- CAQLLexerT_KEEP = 60
- CAQLLexerT_COUNT = 61
- CAQLLexerT_OPTIONS = 62
- CAQLLexerT_PRUNE = 63
- CAQLLexerT_SEARCH = 64
- CAQLLexerT_TO = 65
- CAQLLexerT_CURRENT = 66
- CAQLLexerT_NEW = 67
- CAQLLexerT_OLD = 68
- CAQLLexerT_STRING = 69
- CAQLLexerT_INT = 70
- CAQLLexerT_FLOAT = 71
- CAQLLexerT_PARAMETER = 72
- CAQLLexerT_QUOTED_STRING = 73
- CAQLLexerSINGLE_LINE_COMMENT = 74
- CAQLLexerMULTILINE_COMMENT = 75
- CAQLLexerSPACES = 76
- CAQLLexerUNEXPECTED_CHAR = 77
- CAQLLexerERROR_RECONGNIGION = 78
-)
-
-// CAQLLexerERRORCHANNEL is the CAQLLexer channel.
-const CAQLLexerERRORCHANNEL = 2
diff --git a/generated/caql/parser/caql_parser.go b/generated/caql/parser/caql_parser.go
deleted file mode 100644
index 651fd4d..0000000
--- a/generated/caql/parser/caql_parser.go
+++ /dev/null
@@ -1,2746 +0,0 @@
-// Code generated from CAQLParser.g4 by ANTLR 4.10.1. DO NOT EDIT.
-
-package parser // CAQLParser
-
-import (
- "fmt"
- "strconv"
- "sync"
-
- "github.com/antlr/antlr4/runtime/Go/antlr"
-)
-
-// Suppress unused import errors
-var _ = fmt.Printf
-var _ = strconv.Itoa
-var _ = sync.Once{}
-
-type CAQLParser struct {
- *antlr.BaseParser
-}
-
-var caqlparserParserStaticData struct {
- once sync.Once
- serializedATN []int32
- literalNames []string
- symbolicNames []string
- ruleNames []string
- predictionContextCache *antlr.PredictionContextCache
- atn *antlr.ATN
- decisionToDFA []*antlr.DFA
-}
-
-func caqlparserParserInit() {
- staticData := &caqlparserParserStaticData
- staticData.literalNames = []string{
- "", "'.'", "'=~'", "'!~'", "'=='", "'!='", "'<'", "'>'", "'<='", "'>='",
- "'+'", "'-'", "'*'", "'/'", "'%'", "'?'", "':'", "'::'", "'..'", "','",
- "'('", "')'", "'{'", "'}'", "'['", "']'",
- }
- staticData.symbolicNames = []string{
- "", "DOT", "T_REGEX_MATCH", "T_REGEX_NON_MATCH", "T_EQ", "T_NE", "T_LT",
- "T_GT", "T_LE", "T_GE", "T_PLUS", "T_MINUS", "T_TIMES", "T_DIV", "T_MOD",
- "T_QUESTION", "T_COLON", "T_SCOPE", "T_RANGE", "T_COMMA", "T_OPEN",
- "T_CLOSE", "T_OBJECT_OPEN", "T_OBJECT_CLOSE", "T_ARRAY_OPEN", "T_ARRAY_CLOSE",
- "T_AGGREGATE", "T_ALL", "T_AND", "T_ANY", "T_ASC", "T_COLLECT", "T_DESC",
- "T_DISTINCT", "T_FALSE", "T_FILTER", "T_FOR", "T_GRAPH", "T_IN", "T_INBOUND",
- "T_INSERT", "T_INTO", "T_K_SHORTEST_PATHS", "T_LET", "T_LIKE", "T_LIMIT",
- "T_NONE", "T_NOT", "T_NULL", "T_OR", "T_OUTBOUND", "T_REMOVE", "T_REPLACE",
- "T_RETURN", "T_SHORTEST_PATH", "T_SORT", "T_TRUE", "T_UPDATE", "T_UPSERT",
- "T_WITH", "T_KEEP", "T_COUNT", "T_OPTIONS", "T_PRUNE", "T_SEARCH", "T_TO",
- "T_CURRENT", "T_NEW", "T_OLD", "T_STRING", "T_INT", "T_FLOAT", "T_PARAMETER",
- "T_QUOTED_STRING", "SINGLE_LINE_COMMENT", "MULTILINE_COMMENT", "SPACES",
- "UNEXPECTED_CHAR", "ERROR_RECONGNIGION",
- }
- staticData.ruleNames = []string{
- "parse", "expression", "operator_unary", "reference", "compound_value",
- "function_call", "value_literal", "array", "object", "object_element",
- "object_element_name",
- }
- staticData.predictionContextCache = antlr.NewPredictionContextCache()
- staticData.serializedATN = []int32{
- 4, 1, 78, 190, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7,
- 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7,
- 10, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 30, 8, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 3, 1, 46, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 64, 8, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 5, 1, 84, 8, 1, 10, 1, 12, 1, 87, 9, 1, 1, 2, 1, 2,
- 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 95, 8, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1,
- 3, 1, 3, 1, 3, 3, 3, 105, 8, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1,
- 3, 1, 3, 5, 3, 115, 8, 3, 10, 3, 12, 3, 118, 9, 3, 1, 4, 1, 4, 3, 4, 122,
- 8, 4, 1, 5, 1, 5, 1, 5, 3, 5, 127, 8, 5, 1, 5, 1, 5, 5, 5, 131, 8, 5, 10,
- 5, 12, 5, 134, 9, 5, 1, 5, 3, 5, 137, 8, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1,
- 7, 1, 7, 3, 7, 145, 8, 7, 1, 7, 1, 7, 5, 7, 149, 8, 7, 10, 7, 12, 7, 152,
- 9, 7, 1, 7, 3, 7, 155, 8, 7, 1, 7, 1, 7, 1, 8, 1, 8, 3, 8, 161, 8, 8, 1,
- 8, 1, 8, 5, 8, 165, 8, 8, 10, 8, 12, 8, 168, 9, 8, 1, 8, 3, 8, 171, 8,
- 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1,
- 9, 1, 9, 3, 9, 186, 8, 9, 1, 10, 1, 10, 1, 10, 2, 132, 150, 2, 2, 6, 11,
- 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 0, 9, 1, 0, 10, 11, 1, 0, 12, 14,
- 1, 0, 6, 9, 1, 0, 4, 5, 3, 0, 27, 27, 29, 29, 46, 46, 2, 0, 4, 9, 38, 38,
- 2, 0, 2, 3, 44, 44, 5, 0, 34, 34, 48, 48, 56, 56, 70, 71, 73, 73, 2, 0,
- 69, 69, 73, 73, 214, 0, 22, 1, 0, 0, 0, 2, 29, 1, 0, 0, 0, 4, 94, 1, 0,
- 0, 0, 6, 104, 1, 0, 0, 0, 8, 121, 1, 0, 0, 0, 10, 123, 1, 0, 0, 0, 12,
- 140, 1, 0, 0, 0, 14, 142, 1, 0, 0, 0, 16, 158, 1, 0, 0, 0, 18, 185, 1,
- 0, 0, 0, 20, 187, 1, 0, 0, 0, 22, 23, 3, 2, 1, 0, 23, 24, 5, 0, 0, 1, 24,
- 1, 1, 0, 0, 0, 25, 26, 6, 1, -1, 0, 26, 30, 3, 12, 6, 0, 27, 30, 3, 6,
- 3, 0, 28, 30, 3, 4, 2, 0, 29, 25, 1, 0, 0, 0, 29, 27, 1, 0, 0, 0, 29, 28,
- 1, 0, 0, 0, 30, 85, 1, 0, 0, 0, 31, 32, 10, 13, 0, 0, 32, 33, 7, 0, 0,
- 0, 33, 84, 3, 2, 1, 14, 34, 35, 10, 12, 0, 0, 35, 36, 7, 1, 0, 0, 36, 84,
- 3, 2, 1, 13, 37, 38, 10, 11, 0, 0, 38, 39, 5, 18, 0, 0, 39, 84, 3, 2, 1,
- 12, 40, 41, 10, 10, 0, 0, 41, 42, 7, 2, 0, 0, 42, 84, 3, 2, 1, 11, 43,
- 45, 10, 9, 0, 0, 44, 46, 5, 47, 0, 0, 45, 44, 1, 0, 0, 0, 45, 46, 1, 0,
- 0, 0, 46, 47, 1, 0, 0, 0, 47, 48, 5, 38, 0, 0, 48, 84, 3, 2, 1, 10, 49,
- 50, 10, 8, 0, 0, 50, 51, 7, 3, 0, 0, 51, 84, 3, 2, 1, 9, 52, 53, 10, 7,
- 0, 0, 53, 54, 7, 4, 0, 0, 54, 55, 7, 5, 0, 0, 55, 84, 3, 2, 1, 8, 56, 57,
- 10, 6, 0, 0, 57, 58, 7, 4, 0, 0, 58, 59, 5, 47, 0, 0, 59, 60, 5, 38, 0,
- 0, 60, 84, 3, 2, 1, 7, 61, 63, 10, 5, 0, 0, 62, 64, 5, 47, 0, 0, 63, 62,
- 1, 0, 0, 0, 63, 64, 1, 0, 0, 0, 64, 65, 1, 0, 0, 0, 65, 66, 7, 6, 0, 0,
- 66, 84, 3, 2, 1, 6, 67, 68, 10, 4, 0, 0, 68, 69, 5, 28, 0, 0, 69, 84, 3,
- 2, 1, 5, 70, 71, 10, 3, 0, 0, 71, 72, 5, 49, 0, 0, 72, 84, 3, 2, 1, 4,
- 73, 74, 10, 2, 0, 0, 74, 75, 5, 15, 0, 0, 75, 76, 3, 2, 1, 0, 76, 77, 5,
- 16, 0, 0, 77, 78, 3, 2, 1, 3, 78, 84, 1, 0, 0, 0, 79, 80, 10, 1, 0, 0,
- 80, 81, 5, 15, 0, 0, 81, 82, 5, 16, 0, 0, 82, 84, 3, 2, 1, 2, 83, 31, 1,
- 0, 0, 0, 83, 34, 1, 0, 0, 0, 83, 37, 1, 0, 0, 0, 83, 40, 1, 0, 0, 0, 83,
- 43, 1, 0, 0, 0, 83, 49, 1, 0, 0, 0, 83, 52, 1, 0, 0, 0, 83, 56, 1, 0, 0,
- 0, 83, 61, 1, 0, 0, 0, 83, 67, 1, 0, 0, 0, 83, 70, 1, 0, 0, 0, 83, 73,
- 1, 0, 0, 0, 83, 79, 1, 0, 0, 0, 84, 87, 1, 0, 0, 0, 85, 83, 1, 0, 0, 0,
- 85, 86, 1, 0, 0, 0, 86, 3, 1, 0, 0, 0, 87, 85, 1, 0, 0, 0, 88, 89, 5, 10,
- 0, 0, 89, 95, 3, 2, 1, 0, 90, 91, 5, 11, 0, 0, 91, 95, 3, 2, 1, 0, 92,
- 93, 5, 47, 0, 0, 93, 95, 3, 2, 1, 0, 94, 88, 1, 0, 0, 0, 94, 90, 1, 0,
- 0, 0, 94, 92, 1, 0, 0, 0, 95, 5, 1, 0, 0, 0, 96, 97, 6, 3, -1, 0, 97, 105,
- 5, 69, 0, 0, 98, 105, 3, 8, 4, 0, 99, 105, 3, 10, 5, 0, 100, 101, 5, 20,
- 0, 0, 101, 102, 3, 2, 1, 0, 102, 103, 5, 21, 0, 0, 103, 105, 1, 0, 0, 0,
- 104, 96, 1, 0, 0, 0, 104, 98, 1, 0, 0, 0, 104, 99, 1, 0, 0, 0, 104, 100,
- 1, 0, 0, 0, 105, 116, 1, 0, 0, 0, 106, 107, 10, 2, 0, 0, 107, 108, 5, 1,
- 0, 0, 108, 115, 5, 69, 0, 0, 109, 110, 10, 1, 0, 0, 110, 111, 5, 24, 0,
- 0, 111, 112, 3, 2, 1, 0, 112, 113, 5, 25, 0, 0, 113, 115, 1, 0, 0, 0, 114,
- 106, 1, 0, 0, 0, 114, 109, 1, 0, 0, 0, 115, 118, 1, 0, 0, 0, 116, 114,
- 1, 0, 0, 0, 116, 117, 1, 0, 0, 0, 117, 7, 1, 0, 0, 0, 118, 116, 1, 0, 0,
- 0, 119, 122, 3, 14, 7, 0, 120, 122, 3, 16, 8, 0, 121, 119, 1, 0, 0, 0,
- 121, 120, 1, 0, 0, 0, 122, 9, 1, 0, 0, 0, 123, 124, 5, 69, 0, 0, 124, 126,
- 5, 20, 0, 0, 125, 127, 3, 2, 1, 0, 126, 125, 1, 0, 0, 0, 126, 127, 1, 0,
- 0, 0, 127, 132, 1, 0, 0, 0, 128, 129, 5, 19, 0, 0, 129, 131, 3, 2, 1, 0,
- 130, 128, 1, 0, 0, 0, 131, 134, 1, 0, 0, 0, 132, 133, 1, 0, 0, 0, 132,
- 130, 1, 0, 0, 0, 133, 136, 1, 0, 0, 0, 134, 132, 1, 0, 0, 0, 135, 137,
- 5, 19, 0, 0, 136, 135, 1, 0, 0, 0, 136, 137, 1, 0, 0, 0, 137, 138, 1, 0,
- 0, 0, 138, 139, 5, 21, 0, 0, 139, 11, 1, 0, 0, 0, 140, 141, 7, 7, 0, 0,
- 141, 13, 1, 0, 0, 0, 142, 144, 5, 24, 0, 0, 143, 145, 3, 2, 1, 0, 144,
- 143, 1, 0, 0, 0, 144, 145, 1, 0, 0, 0, 145, 150, 1, 0, 0, 0, 146, 147,
- 5, 19, 0, 0, 147, 149, 3, 2, 1, 0, 148, 146, 1, 0, 0, 0, 149, 152, 1, 0,
- 0, 0, 150, 151, 1, 0, 0, 0, 150, 148, 1, 0, 0, 0, 151, 154, 1, 0, 0, 0,
- 152, 150, 1, 0, 0, 0, 153, 155, 5, 19, 0, 0, 154, 153, 1, 0, 0, 0, 154,
- 155, 1, 0, 0, 0, 155, 156, 1, 0, 0, 0, 156, 157, 5, 25, 0, 0, 157, 15,
- 1, 0, 0, 0, 158, 160, 5, 22, 0, 0, 159, 161, 3, 18, 9, 0, 160, 159, 1,
- 0, 0, 0, 160, 161, 1, 0, 0, 0, 161, 166, 1, 0, 0, 0, 162, 163, 5, 19, 0,
- 0, 163, 165, 3, 18, 9, 0, 164, 162, 1, 0, 0, 0, 165, 168, 1, 0, 0, 0, 166,
- 164, 1, 0, 0, 0, 166, 167, 1, 0, 0, 0, 167, 170, 1, 0, 0, 0, 168, 166,
- 1, 0, 0, 0, 169, 171, 5, 19, 0, 0, 170, 169, 1, 0, 0, 0, 170, 171, 1, 0,
- 0, 0, 171, 172, 1, 0, 0, 0, 172, 173, 5, 23, 0, 0, 173, 17, 1, 0, 0, 0,
- 174, 186, 5, 69, 0, 0, 175, 176, 3, 20, 10, 0, 176, 177, 5, 16, 0, 0, 177,
- 178, 3, 2, 1, 0, 178, 186, 1, 0, 0, 0, 179, 180, 5, 24, 0, 0, 180, 181,
- 3, 2, 1, 0, 181, 182, 5, 25, 0, 0, 182, 183, 5, 16, 0, 0, 183, 184, 3,
- 2, 1, 0, 184, 186, 1, 0, 0, 0, 185, 174, 1, 0, 0, 0, 185, 175, 1, 0, 0,
- 0, 185, 179, 1, 0, 0, 0, 186, 19, 1, 0, 0, 0, 187, 188, 7, 8, 0, 0, 188,
- 21, 1, 0, 0, 0, 20, 29, 45, 63, 83, 85, 94, 104, 114, 116, 121, 126, 132,
- 136, 144, 150, 154, 160, 166, 170, 185,
- }
- deserializer := antlr.NewATNDeserializer(nil)
- staticData.atn = deserializer.Deserialize(staticData.serializedATN)
- atn := staticData.atn
- staticData.decisionToDFA = make([]*antlr.DFA, len(atn.DecisionToState))
- decisionToDFA := staticData.decisionToDFA
- for index, state := range atn.DecisionToState {
- decisionToDFA[index] = antlr.NewDFA(state, index)
- }
-}
-
-// CAQLParserInit initializes any static state used to implement CAQLParser. By default the
-// static state used to implement the parser is lazily initialized during the first call to
-// NewCAQLParser(). You can call this function if you wish to initialize the static state ahead
-// of time.
-func CAQLParserInit() {
- staticData := &caqlparserParserStaticData
- staticData.once.Do(caqlparserParserInit)
-}
-
-// NewCAQLParser produces a new parser instance for the optional input antlr.TokenStream.
-func NewCAQLParser(input antlr.TokenStream) *CAQLParser {
- CAQLParserInit()
- this := new(CAQLParser)
- this.BaseParser = antlr.NewBaseParser(input)
- staticData := &caqlparserParserStaticData
- this.Interpreter = antlr.NewParserATNSimulator(this, staticData.atn, staticData.decisionToDFA, staticData.predictionContextCache)
- this.RuleNames = staticData.ruleNames
- this.LiteralNames = staticData.literalNames
- this.SymbolicNames = staticData.symbolicNames
- this.GrammarFileName = "CAQLParser.g4"
-
- return this
-}
-
-// CAQLParser tokens.
-const (
- CAQLParserEOF = antlr.TokenEOF
- CAQLParserDOT = 1
- CAQLParserT_REGEX_MATCH = 2
- CAQLParserT_REGEX_NON_MATCH = 3
- CAQLParserT_EQ = 4
- CAQLParserT_NE = 5
- CAQLParserT_LT = 6
- CAQLParserT_GT = 7
- CAQLParserT_LE = 8
- CAQLParserT_GE = 9
- CAQLParserT_PLUS = 10
- CAQLParserT_MINUS = 11
- CAQLParserT_TIMES = 12
- CAQLParserT_DIV = 13
- CAQLParserT_MOD = 14
- CAQLParserT_QUESTION = 15
- CAQLParserT_COLON = 16
- CAQLParserT_SCOPE = 17
- CAQLParserT_RANGE = 18
- CAQLParserT_COMMA = 19
- CAQLParserT_OPEN = 20
- CAQLParserT_CLOSE = 21
- CAQLParserT_OBJECT_OPEN = 22
- CAQLParserT_OBJECT_CLOSE = 23
- CAQLParserT_ARRAY_OPEN = 24
- CAQLParserT_ARRAY_CLOSE = 25
- CAQLParserT_AGGREGATE = 26
- CAQLParserT_ALL = 27
- CAQLParserT_AND = 28
- CAQLParserT_ANY = 29
- CAQLParserT_ASC = 30
- CAQLParserT_COLLECT = 31
- CAQLParserT_DESC = 32
- CAQLParserT_DISTINCT = 33
- CAQLParserT_FALSE = 34
- CAQLParserT_FILTER = 35
- CAQLParserT_FOR = 36
- CAQLParserT_GRAPH = 37
- CAQLParserT_IN = 38
- CAQLParserT_INBOUND = 39
- CAQLParserT_INSERT = 40
- CAQLParserT_INTO = 41
- CAQLParserT_K_SHORTEST_PATHS = 42
- CAQLParserT_LET = 43
- CAQLParserT_LIKE = 44
- CAQLParserT_LIMIT = 45
- CAQLParserT_NONE = 46
- CAQLParserT_NOT = 47
- CAQLParserT_NULL = 48
- CAQLParserT_OR = 49
- CAQLParserT_OUTBOUND = 50
- CAQLParserT_REMOVE = 51
- CAQLParserT_REPLACE = 52
- CAQLParserT_RETURN = 53
- CAQLParserT_SHORTEST_PATH = 54
- CAQLParserT_SORT = 55
- CAQLParserT_TRUE = 56
- CAQLParserT_UPDATE = 57
- CAQLParserT_UPSERT = 58
- CAQLParserT_WITH = 59
- CAQLParserT_KEEP = 60
- CAQLParserT_COUNT = 61
- CAQLParserT_OPTIONS = 62
- CAQLParserT_PRUNE = 63
- CAQLParserT_SEARCH = 64
- CAQLParserT_TO = 65
- CAQLParserT_CURRENT = 66
- CAQLParserT_NEW = 67
- CAQLParserT_OLD = 68
- CAQLParserT_STRING = 69
- CAQLParserT_INT = 70
- CAQLParserT_FLOAT = 71
- CAQLParserT_PARAMETER = 72
- CAQLParserT_QUOTED_STRING = 73
- CAQLParserSINGLE_LINE_COMMENT = 74
- CAQLParserMULTILINE_COMMENT = 75
- CAQLParserSPACES = 76
- CAQLParserUNEXPECTED_CHAR = 77
- CAQLParserERROR_RECONGNIGION = 78
-)
-
-// CAQLParser rules.
-const (
- CAQLParserRULE_parse = 0
- CAQLParserRULE_expression = 1
- CAQLParserRULE_operator_unary = 2
- CAQLParserRULE_reference = 3
- CAQLParserRULE_compound_value = 4
- CAQLParserRULE_function_call = 5
- CAQLParserRULE_value_literal = 6
- CAQLParserRULE_array = 7
- CAQLParserRULE_object = 8
- CAQLParserRULE_object_element = 9
- CAQLParserRULE_object_element_name = 10
-)
-
-// IParseContext is an interface to support dynamic dispatch.
-type IParseContext interface {
- antlr.ParserRuleContext
-
- // GetParser returns the parser.
- GetParser() antlr.Parser
-
- // IsParseContext differentiates from other interfaces.
- IsParseContext()
-}
-
-type ParseContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
-}
-
-func NewEmptyParseContext() *ParseContext {
- var p = new(ParseContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = CAQLParserRULE_parse
- return p
-}
-
-func (*ParseContext) IsParseContext() {}
-
-func NewParseContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ParseContext {
- var p = new(ParseContext)
-
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
-
- p.parser = parser
- p.RuleIndex = CAQLParserRULE_parse
-
- return p
-}
-
-func (s *ParseContext) GetParser() antlr.Parser { return s.parser }
-
-func (s *ParseContext) Expression() IExpressionContext {
- var t antlr.RuleContext
- for _, ctx := range s.GetChildren() {
- if _, ok := ctx.(IExpressionContext); ok {
- t = ctx.(antlr.RuleContext)
- break
- }
- }
-
- if t == nil {
- return nil
- }
-
- return t.(IExpressionContext)
-}
-
-func (s *ParseContext) EOF() antlr.TerminalNode {
- return s.GetToken(CAQLParserEOF, 0)
-}
-
-func (s *ParseContext) GetRuleContext() antlr.RuleContext {
- return s
-}
-
-func (s *ParseContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
-}
-
-func (s *ParseContext) EnterRule(listener antlr.ParseTreeListener) {
- if listenerT, ok := listener.(CAQLParserListener); ok {
- listenerT.EnterParse(s)
- }
-}
-
-func (s *ParseContext) ExitRule(listener antlr.ParseTreeListener) {
- if listenerT, ok := listener.(CAQLParserListener); ok {
- listenerT.ExitParse(s)
- }
-}
-
-func (p *CAQLParser) Parse() (localctx IParseContext) {
- this := p
- _ = this
-
- localctx = NewParseContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 0, CAQLParserRULE_parse)
-
- defer func() {
- p.ExitRule()
- }()
-
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
-
- p.EnterOuterAlt(localctx, 1)
- {
- p.SetState(22)
- p.expression(0)
- }
- {
- p.SetState(23)
- p.Match(CAQLParserEOF)
- }
-
- return localctx
-}
-
-// IExpressionContext is an interface to support dynamic dispatch.
-type IExpressionContext interface {
- antlr.ParserRuleContext
-
- // GetParser returns the parser.
- GetParser() antlr.Parser
-
- // GetEq_op returns the eq_op token.
- GetEq_op() antlr.Token
-
- // SetEq_op sets the eq_op token.
- SetEq_op(antlr.Token)
-
- // IsExpressionContext differentiates from other interfaces.
- IsExpressionContext()
-}
-
-type ExpressionContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- eq_op antlr.Token
-}
-
-func NewEmptyExpressionContext() *ExpressionContext {
- var p = new(ExpressionContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = CAQLParserRULE_expression
- return p
-}
-
-func (*ExpressionContext) IsExpressionContext() {}
-
-func NewExpressionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ExpressionContext {
- var p = new(ExpressionContext)
-
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
-
- p.parser = parser
- p.RuleIndex = CAQLParserRULE_expression
-
- return p
-}
-
-func (s *ExpressionContext) GetParser() antlr.Parser { return s.parser }
-
-func (s *ExpressionContext) GetEq_op() antlr.Token { return s.eq_op }
-
-func (s *ExpressionContext) SetEq_op(v antlr.Token) { s.eq_op = v }
-
-func (s *ExpressionContext) Value_literal() IValue_literalContext {
- var t antlr.RuleContext
- for _, ctx := range s.GetChildren() {
- if _, ok := ctx.(IValue_literalContext); ok {
- t = ctx.(antlr.RuleContext)
- break
- }
- }
-
- if t == nil {
- return nil
- }
-
- return t.(IValue_literalContext)
-}
-
-func (s *ExpressionContext) Reference() IReferenceContext {
- var t antlr.RuleContext
- for _, ctx := range s.GetChildren() {
- if _, ok := ctx.(IReferenceContext); ok {
- t = ctx.(antlr.RuleContext)
- break
- }
- }
-
- if t == nil {
- return nil
- }
-
- return t.(IReferenceContext)
-}
-
-func (s *ExpressionContext) Operator_unary() IOperator_unaryContext {
- var t antlr.RuleContext
- for _, ctx := range s.GetChildren() {
- if _, ok := ctx.(IOperator_unaryContext); ok {
- t = ctx.(antlr.RuleContext)
- break
- }
- }
-
- if t == nil {
- return nil
- }
-
- return t.(IOperator_unaryContext)
-}
-
-func (s *ExpressionContext) AllExpression() []IExpressionContext {
- children := s.GetChildren()
- len := 0
- for _, ctx := range children {
- if _, ok := ctx.(IExpressionContext); ok {
- len++
- }
- }
-
- tst := make([]IExpressionContext, len)
- i := 0
- for _, ctx := range children {
- if t, ok := ctx.(IExpressionContext); ok {
- tst[i] = t.(IExpressionContext)
- i++
- }
- }
-
- return tst
-}
-
-func (s *ExpressionContext) Expression(i int) IExpressionContext {
- var t antlr.RuleContext
- j := 0
- for _, ctx := range s.GetChildren() {
- if _, ok := ctx.(IExpressionContext); ok {
- if j == i {
- t = ctx.(antlr.RuleContext)
- break
- }
- j++
- }
- }
-
- if t == nil {
- return nil
- }
-
- return t.(IExpressionContext)
-}
-
-func (s *ExpressionContext) T_PLUS() antlr.TerminalNode {
- return s.GetToken(CAQLParserT_PLUS, 0)
-}
-
-func (s *ExpressionContext) T_MINUS() antlr.TerminalNode {
- return s.GetToken(CAQLParserT_MINUS, 0)
-}
-
-func (s *ExpressionContext) T_TIMES() antlr.TerminalNode {
- return s.GetToken(CAQLParserT_TIMES, 0)
-}
-
-func (s *ExpressionContext) T_DIV() antlr.TerminalNode {
- return s.GetToken(CAQLParserT_DIV, 0)
-}
-
-func (s *ExpressionContext) T_MOD() antlr.TerminalNode {
- return s.GetToken(CAQLParserT_MOD, 0)
-}
-
-func (s *ExpressionContext) T_RANGE() antlr.TerminalNode {
- return s.GetToken(CAQLParserT_RANGE, 0)
-}
-
-func (s *ExpressionContext) T_LT() antlr.TerminalNode {
- return s.GetToken(CAQLParserT_LT, 0)
-}
-
-func (s *ExpressionContext) T_GT() antlr.TerminalNode {
- return s.GetToken(CAQLParserT_GT, 0)
-}
-
-func (s *ExpressionContext) T_LE() antlr.TerminalNode {
- return s.GetToken(CAQLParserT_LE, 0)
-}
-
-func (s *ExpressionContext) T_GE() antlr.TerminalNode {
- return s.GetToken(CAQLParserT_GE, 0)
-}
-
-func (s *ExpressionContext) T_IN() antlr.TerminalNode {
- return s.GetToken(CAQLParserT_IN, 0)
-}
-
-func (s *ExpressionContext) T_NOT() antlr.TerminalNode {
- return s.GetToken(CAQLParserT_NOT, 0)
-}
-
-func (s *ExpressionContext) T_EQ() antlr.TerminalNode {
- return s.GetToken(CAQLParserT_EQ, 0)
-}
-
-func (s *ExpressionContext) T_NE() antlr.TerminalNode {
- return s.GetToken(CAQLParserT_NE, 0)
-}
-
-func (s *ExpressionContext) T_ALL() antlr.TerminalNode {
- return s.GetToken(CAQLParserT_ALL, 0)
-}
-
-func (s *ExpressionContext) T_ANY() antlr.TerminalNode {
- return s.GetToken(CAQLParserT_ANY, 0)
-}
-
-func (s *ExpressionContext) T_NONE() antlr.TerminalNode {
- return s.GetToken(CAQLParserT_NONE, 0)
-}
-
-func (s *ExpressionContext) T_LIKE() antlr.TerminalNode {
- return s.GetToken(CAQLParserT_LIKE, 0)
-}
-
-func (s *ExpressionContext) T_REGEX_MATCH() antlr.TerminalNode {
- return s.GetToken(CAQLParserT_REGEX_MATCH, 0)
-}
-
-func (s *ExpressionContext) T_REGEX_NON_MATCH() antlr.TerminalNode {
- return s.GetToken(CAQLParserT_REGEX_NON_MATCH, 0)
-}
-
-func (s *ExpressionContext) T_AND() antlr.TerminalNode {
- return s.GetToken(CAQLParserT_AND, 0)
-}
-
-func (s *ExpressionContext) T_OR() antlr.TerminalNode {
- return s.GetToken(CAQLParserT_OR, 0)
-}
-
-func (s *ExpressionContext) T_QUESTION() antlr.TerminalNode {
- return s.GetToken(CAQLParserT_QUESTION, 0)
-}
-
-func (s *ExpressionContext) T_COLON() antlr.TerminalNode {
- return s.GetToken(CAQLParserT_COLON, 0)
-}
-
-func (s *ExpressionContext) GetRuleContext() antlr.RuleContext {
- return s
-}
-
-func (s *ExpressionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
-}
-
-func (s *ExpressionContext) EnterRule(listener antlr.ParseTreeListener) {
- if listenerT, ok := listener.(CAQLParserListener); ok {
- listenerT.EnterExpression(s)
- }
-}
-
-func (s *ExpressionContext) ExitRule(listener antlr.ParseTreeListener) {
- if listenerT, ok := listener.(CAQLParserListener); ok {
- listenerT.ExitExpression(s)
- }
-}
-
-func (p *CAQLParser) Expression() (localctx IExpressionContext) {
- return p.expression(0)
-}
-
-func (p *CAQLParser) expression(_p int) (localctx IExpressionContext) {
- this := p
- _ = this
-
- var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext()
- _parentState := p.GetState()
- localctx = NewExpressionContext(p, p.GetParserRuleContext(), _parentState)
- var _prevctx IExpressionContext = localctx
- var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning.
- _startState := 2
- p.EnterRecursionRule(localctx, 2, CAQLParserRULE_expression, _p)
- var _la int
-
- defer func() {
- p.UnrollRecursionContexts(_parentctx)
- }()
-
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
-
- var _alt int
-
- p.EnterOuterAlt(localctx, 1)
- p.SetState(29)
- p.GetErrorHandler().Sync(p)
-
- switch p.GetTokenStream().LA(1) {
- case CAQLParserT_FALSE, CAQLParserT_NULL, CAQLParserT_TRUE, CAQLParserT_INT, CAQLParserT_FLOAT, CAQLParserT_QUOTED_STRING:
- {
- p.SetState(26)
- p.Value_literal()
- }
-
- case CAQLParserT_OPEN, CAQLParserT_OBJECT_OPEN, CAQLParserT_ARRAY_OPEN, CAQLParserT_STRING:
- {
- p.SetState(27)
- p.reference(0)
- }
-
- case CAQLParserT_PLUS, CAQLParserT_MINUS, CAQLParserT_NOT:
- {
- p.SetState(28)
- p.Operator_unary()
- }
-
- default:
- panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil))
- }
- p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1))
- p.SetState(85)
- p.GetErrorHandler().Sync(p)
- _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 4, p.GetParserRuleContext())
-
- for _alt != 2 && _alt != antlr.ATNInvalidAltNumber {
- if _alt == 1 {
- if p.GetParseListeners() != nil {
- p.TriggerExitRuleEvent()
- }
- _prevctx = localctx
- p.SetState(83)
- p.GetErrorHandler().Sync(p)
- switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 3, p.GetParserRuleContext()) {
- case 1:
- localctx = NewExpressionContext(p, _parentctx, _parentState)
- p.PushNewRecursionContext(localctx, _startState, CAQLParserRULE_expression)
- p.SetState(31)
-
- if !(p.Precpred(p.GetParserRuleContext(), 13)) {
- panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 13)", ""))
- }
- {
- p.SetState(32)
- _la = p.GetTokenStream().LA(1)
-
- if !(_la == CAQLParserT_PLUS || _la == CAQLParserT_MINUS) {
- p.GetErrorHandler().RecoverInline(p)
- } else {
- p.GetErrorHandler().ReportMatch(p)
- p.Consume()
- }
- }
- {
- p.SetState(33)
- p.expression(14)
- }
-
- case 2:
- localctx = NewExpressionContext(p, _parentctx, _parentState)
- p.PushNewRecursionContext(localctx, _startState, CAQLParserRULE_expression)
- p.SetState(34)
-
- if !(p.Precpred(p.GetParserRuleContext(), 12)) {
- panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 12)", ""))
- }
- {
- p.SetState(35)
- _la = p.GetTokenStream().LA(1)
-
- if !(((_la)&-(0x1f+1)) == 0 && ((1< github.com/warjiang/gojsonschema v1.2.1-0.20201027075954-b076d39a02e5
+go 1.22.1
require (
- github.com/alecthomas/kong v0.8.1
- github.com/alecthomas/kong-yaml v0.2.0
- github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20220816024939-bc8df83d7b9d
- github.com/arangodb/go-driver v1.6.0
- github.com/aws/aws-sdk-go v1.46.2
- github.com/blevesearch/bleve/v2 v2.3.10
- github.com/coreos/go-oidc/v3 v3.7.0
- github.com/docker/docker v17.12.0-ce-rc1.0.20201201034508-7d75c1d40d88+incompatible
- github.com/go-chi/chi/v5 v5.0.10
- github.com/gobwas/ws v1.3.0
- github.com/google/uuid v1.3.1
- github.com/iancoleman/strcase v0.3.0
- github.com/icza/dyno v0.0.0-20230330125955-09f820a8d9c0
- github.com/imdario/mergo v0.3.16
- github.com/jonas-plum/maut v0.0.0-20221105155335-ed984fd96915
- github.com/mingrammer/commonregex v1.0.1
- github.com/stretchr/testify v1.8.4
- github.com/tidwall/gjson v1.17.0
- github.com/tidwall/sjson v1.2.5
- github.com/tus/tusd v1.13.0
- github.com/xeipuuv/gojsonschema v1.2.0
- golang.org/x/exp v0.0.0-20231006140011-7918f672742d
- golang.org/x/oauth2 v0.13.0
- gopkg.in/yaml.v3 v3.0.1
+ github.com/brianvoe/gofakeit/v7 v7.0.3
+ github.com/labstack/echo/v5 v5.0.0-20230722203903-ec5b858dab61
+ github.com/pocketbase/dbx v1.10.1
+ github.com/pocketbase/pocketbase v0.22.10
+ github.com/spf13/cobra v1.8.0
)
require (
- github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
- github.com/Microsoft/go-winio v0.5.2 // indirect
- github.com/RoaringBitmap/roaring v1.6.0 // indirect
- github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e // indirect
- github.com/bits-and-blooms/bitset v1.10.0 // indirect
- github.com/blevesearch/bleve_index_api v1.0.6 // indirect
- github.com/blevesearch/geo v0.1.18 // indirect
- github.com/blevesearch/go-porterstemmer v1.0.3 // indirect
- github.com/blevesearch/gtreap v0.1.1 // indirect
- github.com/blevesearch/mmap-go v1.0.4 // indirect
- github.com/blevesearch/scorch_segment_api/v2 v2.1.6 // indirect
- github.com/blevesearch/segment v0.9.1 // indirect
- github.com/blevesearch/snowballstem v0.9.0 // indirect
- github.com/blevesearch/upsidedown_store_api v1.0.2 // indirect
- github.com/blevesearch/vellum v1.0.10 // indirect
- github.com/blevesearch/zapx/v11 v11.3.10 // indirect
- github.com/blevesearch/zapx/v12 v12.3.10 // indirect
- github.com/blevesearch/zapx/v13 v13.3.10 // indirect
- github.com/blevesearch/zapx/v14 v14.3.10 // indirect
- github.com/blevesearch/zapx/v15 v15.3.13 // indirect
- github.com/bmizerany/pat v0.0.0-20210406213842-e4b6760bdd6f // indirect
- github.com/containerd/containerd v1.6.26 // indirect
- github.com/davecgh/go-spew v1.1.1 // indirect
- github.com/docker/distribution v2.7.1+incompatible // indirect
- github.com/docker/go-connections v0.4.0 // indirect
- github.com/docker/go-units v0.4.0 // indirect
- github.com/go-jose/go-jose/v3 v3.0.3 // indirect
- github.com/gobwas/httphead v0.1.0 // indirect
- github.com/gobwas/pool v0.2.1 // indirect
- github.com/gogo/protobuf v1.3.2 // indirect
- github.com/golang/geo v0.0.0-20230421003525-6adc56603217 // indirect
- github.com/golang/protobuf v1.5.3 // indirect
- github.com/golang/snappy v0.0.4 // indirect
- github.com/gorilla/securecookie v1.1.1 // indirect
- github.com/gorilla/sessions v1.2.1 // indirect
+ cloud.google.com/go v0.112.2 // indirect
+ cloud.google.com/go/iam v1.1.7 // indirect
+ github.com/AlecAivazis/survey/v2 v2.3.7 // indirect
+ github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
+ github.com/aws/aws-sdk-go-v2 v1.26.1 // indirect
+ github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2 // indirect
+ github.com/aws/aws-sdk-go-v2/config v1.27.11 // indirect
+ github.com/aws/aws-sdk-go-v2/credentials v1.17.11 // indirect
+ github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.1 // indirect
+ github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.16.15 // indirect
+ github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.5 // indirect
+ github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.5 // indirect
+ github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect
+ github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.5 // indirect
+ github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 // indirect
+ github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.7 // indirect
+ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.7 // indirect
+ github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.5 // indirect
+ github.com/aws/aws-sdk-go-v2/service/s3 v1.53.1 // indirect
+ github.com/aws/aws-sdk-go-v2/service/sso v1.20.5 // indirect
+ github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.4 // indirect
+ github.com/aws/aws-sdk-go-v2/service/sts v1.28.6 // indirect
+ github.com/aws/smithy-go v1.20.2 // indirect
+ github.com/disintegration/imaging v1.6.2 // indirect
+ github.com/domodwyer/mailyak/v3 v3.6.2 // indirect
+ github.com/dustin/go-humanize v1.0.1 // indirect
+ github.com/fatih/color v1.16.0 // indirect
+ github.com/gabriel-vasile/mimetype v1.4.3 // indirect
+ github.com/ganigeorgiev/fexpr v0.4.0 // indirect
+ github.com/go-ozzo/ozzo-validation/v4 v4.3.0 // indirect
+ github.com/go-sql-driver/mysql v1.8.1 // indirect
+ github.com/goccy/go-json v0.10.2 // indirect
+ github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
+ github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
+ github.com/google/uuid v1.6.0 // indirect
+ github.com/googleapis/gax-go/v2 v2.12.3 // indirect
+ github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
+ github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
- github.com/json-iterator/go v1.1.12 // indirect
- github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
- github.com/modern-go/reflect2 v1.0.2 // indirect
- github.com/morikuni/aec v1.0.0 // indirect
- github.com/mschoch/smat v0.2.0 // indirect
- github.com/opencontainers/go-digest v1.0.0 // indirect
- github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b // indirect
- github.com/pkg/errors v0.9.1 // indirect
- github.com/pmezard/go-difflib v1.0.0 // indirect
- github.com/sirupsen/logrus v1.9.3 // indirect
- github.com/tidwall/match v1.1.1 // indirect
- github.com/tidwall/pretty v1.2.1 // indirect
- github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
- github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
- go.etcd.io/bbolt v1.3.7 // indirect
- golang.org/x/crypto v0.19.0 // indirect
- golang.org/x/net v0.17.0 // indirect
- golang.org/x/sys v0.17.0 // indirect
- google.golang.org/appengine v1.6.8 // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20230807174057-1744710a1577 // indirect
- google.golang.org/grpc v1.58.3 // indirect
+ github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
+ github.com/mattn/go-colorable v0.1.13 // indirect
+ github.com/mattn/go-isatty v0.0.20 // indirect
+ github.com/mattn/go-sqlite3 v1.14.22 // indirect
+ github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
+ github.com/ncruces/go-strftime v0.1.9 // indirect
+ github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
+ github.com/rogpeppe/go-internal v1.10.0 // indirect
+ github.com/spf13/cast v1.6.0 // indirect
+ github.com/spf13/pflag v1.0.5 // indirect
+ github.com/stretchr/testify v1.9.0 // indirect
+ github.com/valyala/bytebufferpool v1.0.0 // indirect
+ github.com/valyala/fasttemplate v1.2.2 // indirect
+ go.opencensus.io v0.24.0 // indirect
+ go.opentelemetry.io/otel v1.25.0 // indirect
+ go.opentelemetry.io/otel/trace v1.25.0 // indirect
+ gocloud.dev v0.37.0 // indirect
+ golang.org/x/crypto v0.22.0 // indirect
+ golang.org/x/image v0.15.0 // indirect
+ golang.org/x/net v0.24.0 // indirect
+ golang.org/x/oauth2 v0.19.0 // indirect
+ golang.org/x/sync v0.7.0 // indirect
+ golang.org/x/sys v0.19.0 // indirect
+ golang.org/x/term v0.19.0 // indirect
+ golang.org/x/text v0.14.0 // indirect
+ golang.org/x/time v0.5.0 // indirect
+ golang.org/x/tools v0.20.0 // indirect
+ golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
+ google.golang.org/api v0.176.1 // indirect
+ google.golang.org/genproto v0.0.0-20240325203815-454cdb8f5daa // indirect
+ google.golang.org/genproto/googleapis/api v0.0.0-20240325203815-454cdb8f5daa // indirect
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20240415180920-8c6c420018be // indirect
+ google.golang.org/grpc v1.63.2 // indirect
google.golang.org/protobuf v1.33.0 // indirect
- gotest.tools v2.2.0+incompatible // indirect
+ gopkg.in/yaml.v2 v2.4.0 // indirect
+ modernc.org/gc/v3 v3.0.0-20240304020402-f0dba7c97c2b // indirect
+ modernc.org/libc v1.50.2 // indirect
+ modernc.org/mathutil v1.6.0 // indirect
+ modernc.org/memory v1.8.0 // indirect
+ modernc.org/sqlite v1.29.8 // indirect
+ modernc.org/strutil v1.2.0 // indirect
+ modernc.org/token v1.1.0 // indirect
)
diff --git a/go.sum b/go.sum
index e507d28..f713614 100644
--- a/go.sum
+++ b/go.sum
@@ -1,1996 +1,324 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
-cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
-cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
-cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
-cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
-cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
-cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
-cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
-cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To=
-cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4=
-cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M=
-cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc=
-cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk=
-cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs=
-cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc=
-cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY=
-cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI=
-cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk=
-cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY=
-cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg=
-cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8=
-cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0=
-cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY=
-cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM=
-cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY=
-cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ=
-cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI=
-cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4=
-cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc=
-cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA=
-cloud.google.com/go v0.100.1/go.mod h1:fs4QogzfH5n2pBXBP9vRiU+eCny7lD2vmFZy79Iuw1U=
-cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A=
-cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc=
-cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU=
-cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA=
-cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM=
-cloud.google.com/go v0.107.0/go.mod h1:wpc2eNrD7hXUTy8EKS10jkxpZBjASrORK7goS+3YX2I=
-cloud.google.com/go v0.110.0/go.mod h1:SJnCLqQ0FCFGSZMUNUf84MV3Aia54kn7pi8st7tMzaY=
-cloud.google.com/go v0.110.2/go.mod h1:k04UEeEtb6ZBRTv3dZz4CeJC3jKGxyhl0sAiVVquxiw=
-cloud.google.com/go v0.110.4/go.mod h1:+EYjdK8e5RME/VY/qLCAtuyALQ9q67dvuum8i+H5xsI=
-cloud.google.com/go v0.110.6/go.mod h1:+EYjdK8e5RME/VY/qLCAtuyALQ9q67dvuum8i+H5xsI=
-cloud.google.com/go/accessapproval v1.4.0/go.mod h1:zybIuC3KpDOvotz59lFe5qxRZx6C75OtwbisN56xYB4=
-cloud.google.com/go/accessapproval v1.5.0/go.mod h1:HFy3tuiGvMdcd/u+Cu5b9NkO1pEICJ46IR82PoUdplw=
-cloud.google.com/go/accessapproval v1.6.0/go.mod h1:R0EiYnwV5fsRFiKZkPHr6mwyk2wxUJ30nL4j2pcFY2E=
-cloud.google.com/go/accessapproval v1.7.1/go.mod h1:JYczztsHRMK7NTXb6Xw+dwbs/WnOJxbo/2mTI+Kgg68=
-cloud.google.com/go/accesscontextmanager v1.3.0/go.mod h1:TgCBehyr5gNMz7ZaH9xubp+CE8dkrszb4oK9CWyvD4o=
-cloud.google.com/go/accesscontextmanager v1.4.0/go.mod h1:/Kjh7BBu/Gh83sv+K60vN9QE5NJcd80sU33vIe2IFPE=
-cloud.google.com/go/accesscontextmanager v1.6.0/go.mod h1:8XCvZWfYw3K/ji0iVnp+6pu7huxoQTLmxAbVjbloTtM=
-cloud.google.com/go/accesscontextmanager v1.7.0/go.mod h1:CEGLewx8dwa33aDAZQujl7Dx+uYhS0eay198wB/VumQ=
-cloud.google.com/go/accesscontextmanager v1.8.0/go.mod h1:uI+AI/r1oyWK99NN8cQ3UK76AMelMzgZCvJfsi2c+ps=
-cloud.google.com/go/accesscontextmanager v1.8.1/go.mod h1:JFJHfvuaTC+++1iL1coPiG1eu5D24db2wXCDWDjIrxo=
-cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw=
-cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY=
-cloud.google.com/go/aiplatform v1.27.0/go.mod h1:Bvxqtl40l0WImSb04d0hXFU7gDOiq9jQmorivIiWcKg=
-cloud.google.com/go/aiplatform v1.35.0/go.mod h1:7MFT/vCaOyZT/4IIFfxH4ErVg/4ku6lKv3w0+tFTgXQ=
-cloud.google.com/go/aiplatform v1.36.1/go.mod h1:WTm12vJRPARNvJ+v6P52RDHCNe4AhvjcIZ/9/RRHy/k=
-cloud.google.com/go/aiplatform v1.37.0/go.mod h1:IU2Cv29Lv9oCn/9LkFiiuKfwrRTq+QQMbW+hPCxJGZw=
-cloud.google.com/go/aiplatform v1.45.0/go.mod h1:Iu2Q7sC7QGhXUeOhAj/oCK9a+ULz1O4AotZiqjQ8MYA=
-cloud.google.com/go/aiplatform v1.48.0/go.mod h1:Iu2Q7sC7QGhXUeOhAj/oCK9a+ULz1O4AotZiqjQ8MYA=
-cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI=
-cloud.google.com/go/analytics v0.12.0/go.mod h1:gkfj9h6XRf9+TS4bmuhPEShsh3hH8PAZzm/41OOhQd4=
-cloud.google.com/go/analytics v0.17.0/go.mod h1:WXFa3WSym4IZ+JiKmavYdJwGG/CvpqiqczmL59bTD9M=
-cloud.google.com/go/analytics v0.18.0/go.mod h1:ZkeHGQlcIPkw0R/GW+boWHhCOR43xz9RN/jn7WcqfIE=
-cloud.google.com/go/analytics v0.19.0/go.mod h1:k8liqf5/HCnOUkbawNtrWWc+UAzyDlW89doe8TtoDsE=
-cloud.google.com/go/analytics v0.21.2/go.mod h1:U8dcUtmDmjrmUTnnnRnI4m6zKn/yaA5N9RlEkYFHpQo=
-cloud.google.com/go/analytics v0.21.3/go.mod h1:U8dcUtmDmjrmUTnnnRnI4m6zKn/yaA5N9RlEkYFHpQo=
-cloud.google.com/go/apigateway v1.3.0/go.mod h1:89Z8Bhpmxu6AmUxuVRg/ECRGReEdiP3vQtk4Z1J9rJk=
-cloud.google.com/go/apigateway v1.4.0/go.mod h1:pHVY9MKGaH9PQ3pJ4YLzoj6U5FUDeDFBllIz7WmzJoc=
-cloud.google.com/go/apigateway v1.5.0/go.mod h1:GpnZR3Q4rR7LVu5951qfXPJCHquZt02jf7xQx7kpqN8=
-cloud.google.com/go/apigateway v1.6.1/go.mod h1:ufAS3wpbRjqfZrzpvLC2oh0MFlpRJm2E/ts25yyqmXA=
-cloud.google.com/go/apigeeconnect v1.3.0/go.mod h1:G/AwXFAKo0gIXkPTVfZDd2qA1TxBXJ3MgMRBQkIi9jc=
-cloud.google.com/go/apigeeconnect v1.4.0/go.mod h1:kV4NwOKqjvt2JYR0AoIWo2QGfoRtn/pkS3QlHp0Ni04=
-cloud.google.com/go/apigeeconnect v1.5.0/go.mod h1:KFaCqvBRU6idyhSNyn3vlHXc8VMDJdRmwDF6JyFRqZ8=
-cloud.google.com/go/apigeeconnect v1.6.1/go.mod h1:C4awq7x0JpLtrlQCr8AzVIzAaYgngRqWf9S5Uhg+wWs=
-cloud.google.com/go/apigeeregistry v0.4.0/go.mod h1:EUG4PGcsZvxOXAdyEghIdXwAEi/4MEaoqLMLDMIwKXY=
-cloud.google.com/go/apigeeregistry v0.5.0/go.mod h1:YR5+s0BVNZfVOUkMa5pAR2xGd0A473vA5M7j247o1wM=
-cloud.google.com/go/apigeeregistry v0.6.0/go.mod h1:BFNzW7yQVLZ3yj0TKcwzb8n25CFBri51GVGOEUcgQsc=
-cloud.google.com/go/apigeeregistry v0.7.1/go.mod h1:1XgyjZye4Mqtw7T9TsY4NW10U7BojBvG4RMD+vRDrIw=
-cloud.google.com/go/apikeys v0.4.0/go.mod h1:XATS/yqZbaBK0HOssf+ALHp8jAlNHUgyfprvNcBIszU=
-cloud.google.com/go/apikeys v0.5.0/go.mod h1:5aQfwY4D+ewMMWScd3hm2en3hCj+BROlyrt3ytS7KLI=
-cloud.google.com/go/apikeys v0.6.0/go.mod h1:kbpXu5upyiAlGkKrJgQl8A0rKNNJ7dQ377pdroRSSi8=
-cloud.google.com/go/appengine v1.4.0/go.mod h1:CS2NhuBuDXM9f+qscZ6V86m1MIIqPj3WC/UoEuR1Sno=
-cloud.google.com/go/appengine v1.5.0/go.mod h1:TfasSozdkFI0zeoxW3PTBLiNqRmzraodCWatWI9Dmak=
-cloud.google.com/go/appengine v1.6.0/go.mod h1:hg6i0J/BD2cKmDJbaFSYHFyZkgBEfQrDg/X0V5fJn84=
-cloud.google.com/go/appengine v1.7.0/go.mod h1:eZqpbHFCqRGa2aCdope7eC0SWLV1j0neb/QnMJVWx6A=
-cloud.google.com/go/appengine v1.7.1/go.mod h1:IHLToyb/3fKutRysUlFO0BPt5j7RiQ45nrzEJmKTo6E=
-cloud.google.com/go/appengine v1.8.1/go.mod h1:6NJXGLVhZCN9aQ/AEDvmfzKEfoYBlfB80/BHiKVputY=
-cloud.google.com/go/area120 v0.5.0/go.mod h1:DE/n4mp+iqVyvxHN41Vf1CR602GiHQjFPusMFW6bGR4=
-cloud.google.com/go/area120 v0.6.0/go.mod h1:39yFJqWVgm0UZqWTOdqkLhjoC7uFfgXRC8g/ZegeAh0=
-cloud.google.com/go/area120 v0.7.0/go.mod h1:a3+8EUD1SX5RUcCs3MY5YasiO1z6yLiNLRiFrykbynY=
-cloud.google.com/go/area120 v0.7.1/go.mod h1:j84i4E1RboTWjKtZVWXPqvK5VHQFJRF2c1Nm69pWm9k=
-cloud.google.com/go/area120 v0.8.1/go.mod h1:BVfZpGpB7KFVNxPiQBuHkX6Ed0rS51xIgmGyjrAfzsg=
-cloud.google.com/go/artifactregistry v1.6.0/go.mod h1:IYt0oBPSAGYj/kprzsBjZ/4LnG/zOcHyFHjWPCi6SAQ=
-cloud.google.com/go/artifactregistry v1.7.0/go.mod h1:mqTOFOnGZx8EtSqK/ZWcsm/4U8B77rbcLP6ruDU2Ixk=
-cloud.google.com/go/artifactregistry v1.8.0/go.mod h1:w3GQXkJX8hiKN0v+at4b0qotwijQbYUqF2GWkZzAhC0=
-cloud.google.com/go/artifactregistry v1.9.0/go.mod h1:2K2RqvA2CYvAeARHRkLDhMDJ3OXy26h3XW+3/Jh2uYc=
-cloud.google.com/go/artifactregistry v1.11.1/go.mod h1:lLYghw+Itq9SONbCa1YWBoWs1nOucMH0pwXN1rOBZFI=
-cloud.google.com/go/artifactregistry v1.11.2/go.mod h1:nLZns771ZGAwVLzTX/7Al6R9ehma4WUEhZGWV6CeQNQ=
-cloud.google.com/go/artifactregistry v1.12.0/go.mod h1:o6P3MIvtzTOnmvGagO9v/rOjjA0HmhJ+/6KAXrmYDCI=
-cloud.google.com/go/artifactregistry v1.13.0/go.mod h1:uy/LNfoOIivepGhooAUpL1i30Hgee3Cu0l4VTWHUC08=
-cloud.google.com/go/artifactregistry v1.14.1/go.mod h1:nxVdG19jTaSTu7yA7+VbWL346r3rIdkZ142BSQqhn5E=
-cloud.google.com/go/asset v1.5.0/go.mod h1:5mfs8UvcM5wHhqtSv8J1CtxxaQq3AdBxxQi2jGW/K4o=
-cloud.google.com/go/asset v1.7.0/go.mod h1:YbENsRK4+xTiL+Ofoj5Ckf+O17kJtgp3Y3nn4uzZz5s=
-cloud.google.com/go/asset v1.8.0/go.mod h1:mUNGKhiqIdbr8X7KNayoYvyc4HbbFO9URsjbytpUaW0=
-cloud.google.com/go/asset v1.9.0/go.mod h1:83MOE6jEJBMqFKadM9NLRcs80Gdw76qGuHn8m3h8oHQ=
-cloud.google.com/go/asset v1.10.0/go.mod h1:pLz7uokL80qKhzKr4xXGvBQXnzHn5evJAEAtZiIb0wY=
-cloud.google.com/go/asset v1.11.1/go.mod h1:fSwLhbRvC9p9CXQHJ3BgFeQNM4c9x10lqlrdEUYXlJo=
-cloud.google.com/go/asset v1.12.0/go.mod h1:h9/sFOa4eDIyKmH6QMpm4eUK3pDojWnUhTgJlk762Hg=
-cloud.google.com/go/asset v1.13.0/go.mod h1:WQAMyYek/b7NBpYq/K4KJWcRqzoalEsxz/t/dTk4THw=
-cloud.google.com/go/asset v1.14.1/go.mod h1:4bEJ3dnHCqWCDbWJ/6Vn7GVI9LerSi7Rfdi03hd+WTQ=
-cloud.google.com/go/assuredworkloads v1.5.0/go.mod h1:n8HOZ6pff6re5KYfBXcFvSViQjDwxFkAkmUFffJRbbY=
-cloud.google.com/go/assuredworkloads v1.6.0/go.mod h1:yo2YOk37Yc89Rsd5QMVECvjaMKymF9OP+QXWlKXUkXw=
-cloud.google.com/go/assuredworkloads v1.7.0/go.mod h1:z/736/oNmtGAyU47reJgGN+KVoYoxeLBoj4XkKYscNI=
-cloud.google.com/go/assuredworkloads v1.8.0/go.mod h1:AsX2cqyNCOvEQC8RMPnoc0yEarXQk6WEKkxYfL6kGIo=
-cloud.google.com/go/assuredworkloads v1.9.0/go.mod h1:kFuI1P78bplYtT77Tb1hi0FMxM0vVpRC7VVoJC3ZoT0=
-cloud.google.com/go/assuredworkloads v1.10.0/go.mod h1:kwdUQuXcedVdsIaKgKTp9t0UJkE5+PAVNhdQm4ZVq2E=
-cloud.google.com/go/assuredworkloads v1.11.1/go.mod h1:+F04I52Pgn5nmPG36CWFtxmav6+7Q+c5QyJoL18Lry0=
-cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0=
-cloud.google.com/go/automl v1.6.0/go.mod h1:ugf8a6Fx+zP0D59WLhqgTDsQI9w07o64uf/Is3Nh5p8=
-cloud.google.com/go/automl v1.7.0/go.mod h1:RL9MYCCsJEOmt0Wf3z9uzG0a7adTT1fe+aObgSpkCt8=
-cloud.google.com/go/automl v1.8.0/go.mod h1:xWx7G/aPEe/NP+qzYXktoBSDfjO+vnKMGgsApGJJquM=
-cloud.google.com/go/automl v1.12.0/go.mod h1:tWDcHDp86aMIuHmyvjuKeeHEGq76lD7ZqfGLN6B0NuU=
-cloud.google.com/go/automl v1.13.1/go.mod h1:1aowgAHWYZU27MybSCFiukPO7xnyawv7pt3zK4bheQE=
-cloud.google.com/go/baremetalsolution v0.3.0/go.mod h1:XOrocE+pvK1xFfleEnShBlNAXf+j5blPPxrhjKgnIFc=
-cloud.google.com/go/baremetalsolution v0.4.0/go.mod h1:BymplhAadOO/eBa7KewQ0Ppg4A4Wplbn+PsFKRLo0uI=
-cloud.google.com/go/baremetalsolution v0.5.0/go.mod h1:dXGxEkmR9BMwxhzBhV0AioD0ULBmuLZI8CdwalUxuss=
-cloud.google.com/go/baremetalsolution v1.1.1/go.mod h1:D1AV6xwOksJMV4OSlWHtWuFNZZYujJknMAP4Qa27QIA=
-cloud.google.com/go/batch v0.3.0/go.mod h1:TR18ZoAekj1GuirsUsR1ZTKN3FC/4UDnScjT8NXImFE=
-cloud.google.com/go/batch v0.4.0/go.mod h1:WZkHnP43R/QCGQsZ+0JyG4i79ranE2u8xvjq/9+STPE=
-cloud.google.com/go/batch v0.7.0/go.mod h1:vLZN95s6teRUqRQ4s3RLDsH8PvboqBK+rn1oevL159g=
-cloud.google.com/go/batch v1.3.1/go.mod h1:VguXeQKXIYaeeIYbuozUmBR13AfL4SJP7IltNPS+A4A=
-cloud.google.com/go/beyondcorp v0.2.0/go.mod h1:TB7Bd+EEtcw9PCPQhCJtJGjk/7TC6ckmnSFS+xwTfm4=
-cloud.google.com/go/beyondcorp v0.3.0/go.mod h1:E5U5lcrcXMsCuoDNyGrpyTm/hn7ne941Jz2vmksAxW8=
-cloud.google.com/go/beyondcorp v0.4.0/go.mod h1:3ApA0mbhHx6YImmuubf5pyW8srKnCEPON32/5hj+RmM=
-cloud.google.com/go/beyondcorp v0.5.0/go.mod h1:uFqj9X+dSfrheVp7ssLTaRHd2EHqSL4QZmH4e8WXGGU=
-cloud.google.com/go/beyondcorp v0.6.1/go.mod h1:YhxDWw946SCbmcWo3fAhw3V4XZMSpQ/VYfcKGAEU8/4=
-cloud.google.com/go/beyondcorp v1.0.0/go.mod h1:YhxDWw946SCbmcWo3fAhw3V4XZMSpQ/VYfcKGAEU8/4=
-cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
-cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
-cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
-cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg=
-cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
-cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
-cloud.google.com/go/bigquery v1.42.0/go.mod h1:8dRTJxhtG+vwBKzE5OseQn/hiydoQN3EedCaOdYmxRA=
-cloud.google.com/go/bigquery v1.43.0/go.mod h1:ZMQcXHsl+xmU1z36G2jNGZmKp9zNY5BUua5wDgmNCfw=
-cloud.google.com/go/bigquery v1.44.0/go.mod h1:0Y33VqXTEsbamHJvJHdFmtqHvMIY28aK1+dFsvaChGc=
-cloud.google.com/go/bigquery v1.47.0/go.mod h1:sA9XOgy0A8vQK9+MWhEQTY6Tix87M/ZurWFIxmF9I/E=
-cloud.google.com/go/bigquery v1.48.0/go.mod h1:QAwSz+ipNgfL5jxiaK7weyOhzdoAy1zFm0Nf1fysJac=
-cloud.google.com/go/bigquery v1.49.0/go.mod h1:Sv8hMmTFFYBlt/ftw2uN6dFdQPzBlREY9yBh7Oy7/4Q=
-cloud.google.com/go/bigquery v1.50.0/go.mod h1:YrleYEh2pSEbgTBZYMJ5SuSr0ML3ypjRB1zgf7pvQLU=
-cloud.google.com/go/bigquery v1.52.0/go.mod h1:3b/iXjRQGU4nKa87cXeg6/gogLjO8C6PmuM8i5Bi/u4=
-cloud.google.com/go/bigquery v1.53.0/go.mod h1:3b/iXjRQGU4nKa87cXeg6/gogLjO8C6PmuM8i5Bi/u4=
-cloud.google.com/go/billing v1.4.0/go.mod h1:g9IdKBEFlItS8bTtlrZdVLWSSdSyFUZKXNS02zKMOZY=
-cloud.google.com/go/billing v1.5.0/go.mod h1:mztb1tBc3QekhjSgmpf/CV4LzWXLzCArwpLmP2Gm88s=
-cloud.google.com/go/billing v1.6.0/go.mod h1:WoXzguj+BeHXPbKfNWkqVtDdzORazmCjraY+vrxcyvI=
-cloud.google.com/go/billing v1.7.0/go.mod h1:q457N3Hbj9lYwwRbnlD7vUpyjq6u5U1RAOArInEiD5Y=
-cloud.google.com/go/billing v1.12.0/go.mod h1:yKrZio/eu+okO/2McZEbch17O5CB5NpZhhXG6Z766ss=
-cloud.google.com/go/billing v1.13.0/go.mod h1:7kB2W9Xf98hP9Sr12KfECgfGclsH3CQR0R08tnRlRbc=
-cloud.google.com/go/billing v1.16.0/go.mod h1:y8vx09JSSJG02k5QxbycNRrN7FGZB6F3CAcgum7jvGA=
-cloud.google.com/go/binaryauthorization v1.1.0/go.mod h1:xwnoWu3Y84jbuHa0zd526MJYmtnVXn0syOjaJgy4+dM=
-cloud.google.com/go/binaryauthorization v1.2.0/go.mod h1:86WKkJHtRcv5ViNABtYMhhNWRrD1Vpi//uKEy7aYEfI=
-cloud.google.com/go/binaryauthorization v1.3.0/go.mod h1:lRZbKgjDIIQvzYQS1p99A7/U1JqvqeZg0wiI5tp6tg0=
-cloud.google.com/go/binaryauthorization v1.4.0/go.mod h1:tsSPQrBd77VLplV70GUhBf/Zm3FsKmgSqgm4UmiDItk=
-cloud.google.com/go/binaryauthorization v1.5.0/go.mod h1:OSe4OU1nN/VswXKRBmciKpo9LulY41gch5c68htf3/Q=
-cloud.google.com/go/binaryauthorization v1.6.1/go.mod h1:TKt4pa8xhowwffiBmbrbcxijJRZED4zrqnwZ1lKH51U=
-cloud.google.com/go/certificatemanager v1.3.0/go.mod h1:n6twGDvcUBFu9uBgt4eYvvf3sQ6My8jADcOVwHmzadg=
-cloud.google.com/go/certificatemanager v1.4.0/go.mod h1:vowpercVFyqs8ABSmrdV+GiFf2H/ch3KyudYQEMM590=
-cloud.google.com/go/certificatemanager v1.6.0/go.mod h1:3Hh64rCKjRAX8dXgRAyOcY5vQ/fE1sh8o+Mdd6KPgY8=
-cloud.google.com/go/certificatemanager v1.7.1/go.mod h1:iW8J3nG6SaRYImIa+wXQ0g8IgoofDFRp5UMzaNk1UqI=
-cloud.google.com/go/channel v1.8.0/go.mod h1:W5SwCXDJsq/rg3tn3oG0LOxpAo6IMxNa09ngphpSlnk=
-cloud.google.com/go/channel v1.9.0/go.mod h1:jcu05W0my9Vx4mt3/rEHpfxc9eKi9XwsdDL8yBMbKUk=
-cloud.google.com/go/channel v1.11.0/go.mod h1:IdtI0uWGqhEeatSB62VOoJ8FSUhJ9/+iGkJVqp74CGE=
-cloud.google.com/go/channel v1.12.0/go.mod h1:VkxCGKASi4Cq7TbXxlaBezonAYpp1GCnKMY6tnMQnLU=
-cloud.google.com/go/channel v1.16.0/go.mod h1:eN/q1PFSl5gyu0dYdmxNXscY/4Fi7ABmeHCJNf/oHmc=
-cloud.google.com/go/cloudbuild v1.3.0/go.mod h1:WequR4ULxlqvMsjDEEEFnOG5ZSRSgWOywXYDb1vPE6U=
-cloud.google.com/go/cloudbuild v1.4.0/go.mod h1:5Qwa40LHiOXmz3386FrjrYM93rM/hdRr7b53sySrTqA=
-cloud.google.com/go/cloudbuild v1.6.0/go.mod h1:UIbc/w9QCbH12xX+ezUsgblrWv+Cv4Tw83GiSMHOn9M=
-cloud.google.com/go/cloudbuild v1.7.0/go.mod h1:zb5tWh2XI6lR9zQmsm1VRA+7OCuve5d8S+zJUul8KTg=
-cloud.google.com/go/cloudbuild v1.9.0/go.mod h1:qK1d7s4QlO0VwfYn5YuClDGg2hfmLZEb4wQGAbIgL1s=
-cloud.google.com/go/cloudbuild v1.10.1/go.mod h1:lyJg7v97SUIPq4RC2sGsz/9tNczhyv2AjML/ci4ulzU=
-cloud.google.com/go/cloudbuild v1.13.0/go.mod h1:lyJg7v97SUIPq4RC2sGsz/9tNczhyv2AjML/ci4ulzU=
-cloud.google.com/go/clouddms v1.3.0/go.mod h1:oK6XsCDdW4Ib3jCCBugx+gVjevp2TMXFtgxvPSee3OM=
-cloud.google.com/go/clouddms v1.4.0/go.mod h1:Eh7sUGCC+aKry14O1NRljhjyrr0NFC0G2cjwX0cByRk=
-cloud.google.com/go/clouddms v1.5.0/go.mod h1:QSxQnhikCLUw13iAbffF2CZxAER3xDGNHjsTAkQJcQA=
-cloud.google.com/go/clouddms v1.6.1/go.mod h1:Ygo1vL52Ov4TBZQquhz5fiw2CQ58gvu+PlS6PVXCpZI=
-cloud.google.com/go/cloudtasks v1.5.0/go.mod h1:fD92REy1x5woxkKEkLdvavGnPJGEn8Uic9nWuLzqCpY=
-cloud.google.com/go/cloudtasks v1.6.0/go.mod h1:C6Io+sxuke9/KNRkbQpihnW93SWDU3uXt92nu85HkYI=
-cloud.google.com/go/cloudtasks v1.7.0/go.mod h1:ImsfdYWwlWNJbdgPIIGJWC+gemEGTBK/SunNQQNCAb4=
-cloud.google.com/go/cloudtasks v1.8.0/go.mod h1:gQXUIwCSOI4yPVK7DgTVFiiP0ZW/eQkydWzwVMdHxrI=
-cloud.google.com/go/cloudtasks v1.9.0/go.mod h1:w+EyLsVkLWHcOaqNEyvcKAsWp9p29dL6uL9Nst1cI7Y=
-cloud.google.com/go/cloudtasks v1.10.0/go.mod h1:NDSoTLkZ3+vExFEWu2UJV1arUyzVDAiZtdWcsUyNwBs=
-cloud.google.com/go/cloudtasks v1.11.1/go.mod h1:a9udmnou9KO2iulGscKR0qBYjreuX8oHwpmFsKspEvM=
-cloud.google.com/go/cloudtasks v1.12.1/go.mod h1:a9udmnou9KO2iulGscKR0qBYjreuX8oHwpmFsKspEvM=
-cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow=
-cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM=
-cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M=
-cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s=
-cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU=
-cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U=
-cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU=
-cloud.google.com/go/compute v1.12.0/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU=
-cloud.google.com/go/compute v1.12.1/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU=
-cloud.google.com/go/compute v1.13.0/go.mod h1:5aPTS0cUNMIc1CE546K+Th6weJUNQErARyZtRXDJ8GE=
-cloud.google.com/go/compute v1.14.0/go.mod h1:YfLtxrj9sU4Yxv+sXzZkyPjEyPBZfXHUvjxega5vAdo=
-cloud.google.com/go/compute v1.15.1/go.mod h1:bjjoF/NtFUrkD/urWfdHaKuOPDR5nWIs63rR+SXhcpA=
-cloud.google.com/go/compute v1.18.0/go.mod h1:1X7yHxec2Ga+Ss6jPyjxRxpu2uu7PLgsOVXvgU0yacs=
-cloud.google.com/go/compute v1.19.0/go.mod h1:rikpw2y+UMidAe9tISo04EHNOIf42RLYF/q8Bs93scU=
-cloud.google.com/go/compute v1.19.1/go.mod h1:6ylj3a05WF8leseCdIf77NK0g1ey+nj5IKd5/kvShxE=
-cloud.google.com/go/compute v1.19.3/go.mod h1:qxvISKp/gYnXkSAD1ppcSOveRAmzxicEv/JlizULFrI=
-cloud.google.com/go/compute v1.20.1/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM=
-cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM=
-cloud.google.com/go/compute/metadata v0.1.0/go.mod h1:Z1VN+bulIf6bt4P/C37K4DyZYZEXYonfTBHHFPO/4UU=
-cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k=
-cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM=
-cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA=
-cloud.google.com/go/contactcenterinsights v1.3.0/go.mod h1:Eu2oemoePuEFc/xKFPjbTuPSj0fYJcPls9TFlPNnHHY=
-cloud.google.com/go/contactcenterinsights v1.4.0/go.mod h1:L2YzkGbPsv+vMQMCADxJoT9YiTTnSEd6fEvCeHTYVck=
-cloud.google.com/go/contactcenterinsights v1.6.0/go.mod h1:IIDlT6CLcDoyv79kDv8iWxMSTZhLxSCofVV5W6YFM/w=
-cloud.google.com/go/contactcenterinsights v1.9.1/go.mod h1:bsg/R7zGLYMVxFFzfh9ooLTruLRCG9fnzhH9KznHhbM=
-cloud.google.com/go/contactcenterinsights v1.10.0/go.mod h1:bsg/R7zGLYMVxFFzfh9ooLTruLRCG9fnzhH9KznHhbM=
-cloud.google.com/go/container v1.6.0/go.mod h1:Xazp7GjJSeUYo688S+6J5V+n/t+G5sKBTFkKNudGRxg=
-cloud.google.com/go/container v1.7.0/go.mod h1:Dp5AHtmothHGX3DwwIHPgq45Y8KmNsgN3amoYfxVkLo=
-cloud.google.com/go/container v1.13.1/go.mod h1:6wgbMPeQRw9rSnKBCAJXnds3Pzj03C4JHamr8asWKy4=
-cloud.google.com/go/container v1.14.0/go.mod h1:3AoJMPhHfLDxLvrlVWaK57IXzaPnLaZq63WX59aQBfM=
-cloud.google.com/go/container v1.15.0/go.mod h1:ft+9S0WGjAyjDggg5S06DXj+fHJICWg8L7isCQe9pQA=
-cloud.google.com/go/container v1.22.1/go.mod h1:lTNExE2R7f+DLbAN+rJiKTisauFCaoDq6NURZ83eVH4=
-cloud.google.com/go/container v1.24.0/go.mod h1:lTNExE2R7f+DLbAN+rJiKTisauFCaoDq6NURZ83eVH4=
-cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I=
-cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4=
-cloud.google.com/go/containeranalysis v0.7.0/go.mod h1:9aUL+/vZ55P2CXfuZjS4UjQ9AgXoSw8Ts6lemfmxBxI=
-cloud.google.com/go/containeranalysis v0.9.0/go.mod h1:orbOANbwk5Ejoom+s+DUCTTJ7IBdBQJDcSylAx/on9s=
-cloud.google.com/go/containeranalysis v0.10.1/go.mod h1:Ya2jiILITMY68ZLPaogjmOMNkwsDrWBSTyBubGXO7j0=
-cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0=
-cloud.google.com/go/datacatalog v1.5.0/go.mod h1:M7GPLNQeLfWqeIm3iuiruhPzkt65+Bx8dAKvScX8jvs=
-cloud.google.com/go/datacatalog v1.6.0/go.mod h1:+aEyF8JKg+uXcIdAmmaMUmZ3q1b/lKLtXCmXdnc0lbc=
-cloud.google.com/go/datacatalog v1.7.0/go.mod h1:9mEl4AuDYWw81UGc41HonIHH7/sn52H0/tc8f8ZbZIE=
-cloud.google.com/go/datacatalog v1.8.0/go.mod h1:KYuoVOv9BM8EYz/4eMFxrr4DUKhGIOXxZoKYF5wdISM=
-cloud.google.com/go/datacatalog v1.8.1/go.mod h1:RJ58z4rMp3gvETA465Vg+ag8BGgBdnRPEMMSTr5Uv+M=
-cloud.google.com/go/datacatalog v1.12.0/go.mod h1:CWae8rFkfp6LzLumKOnmVh4+Zle4A3NXLzVJ1d1mRm0=
-cloud.google.com/go/datacatalog v1.13.0/go.mod h1:E4Rj9a5ZtAxcQJlEBTLgMTphfP11/lNaAshpoBgemX8=
-cloud.google.com/go/datacatalog v1.14.0/go.mod h1:h0PrGtlihoutNMp/uvwhawLQ9+c63Kz65UFqh49Yo+E=
-cloud.google.com/go/datacatalog v1.14.1/go.mod h1:d2CevwTG4yedZilwe+v3E3ZBDRMobQfSG/a6cCCN5R4=
-cloud.google.com/go/datacatalog v1.16.0/go.mod h1:d2CevwTG4yedZilwe+v3E3ZBDRMobQfSG/a6cCCN5R4=
-cloud.google.com/go/dataflow v0.6.0/go.mod h1:9QwV89cGoxjjSR9/r7eFDqqjtvbKxAK2BaYU6PVk9UM=
-cloud.google.com/go/dataflow v0.7.0/go.mod h1:PX526vb4ijFMesO1o202EaUmouZKBpjHsTlCtB4parQ=
-cloud.google.com/go/dataflow v0.8.0/go.mod h1:Rcf5YgTKPtQyYz8bLYhFoIV/vP39eL7fWNcSOyFfLJE=
-cloud.google.com/go/dataflow v0.9.1/go.mod h1:Wp7s32QjYuQDWqJPFFlnBKhkAtiFpMTdg00qGbnIHVw=
-cloud.google.com/go/dataform v0.3.0/go.mod h1:cj8uNliRlHpa6L3yVhDOBrUXH+BPAO1+KFMQQNSThKo=
-cloud.google.com/go/dataform v0.4.0/go.mod h1:fwV6Y4Ty2yIFL89huYlEkwUPtS7YZinZbzzj5S9FzCE=
-cloud.google.com/go/dataform v0.5.0/go.mod h1:GFUYRe8IBa2hcomWplodVmUx/iTL0FrsauObOM3Ipr0=
-cloud.google.com/go/dataform v0.6.0/go.mod h1:QPflImQy33e29VuapFdf19oPbE4aYTJxr31OAPV+ulA=
-cloud.google.com/go/dataform v0.7.0/go.mod h1:7NulqnVozfHvWUBpMDfKMUESr+85aJsC/2O0o3jWPDE=
-cloud.google.com/go/dataform v0.8.1/go.mod h1:3BhPSiw8xmppbgzeBbmDvmSWlwouuJkXsXsb8UBih9M=
-cloud.google.com/go/datafusion v1.4.0/go.mod h1:1Zb6VN+W6ALo85cXnM1IKiPw+yQMKMhB9TsTSRDo/38=
-cloud.google.com/go/datafusion v1.5.0/go.mod h1:Kz+l1FGHB0J+4XF2fud96WMmRiq/wj8N9u007vyXZ2w=
-cloud.google.com/go/datafusion v1.6.0/go.mod h1:WBsMF8F1RhSXvVM8rCV3AeyWVxcC2xY6vith3iw3S+8=
-cloud.google.com/go/datafusion v1.7.1/go.mod h1:KpoTBbFmoToDExJUso/fcCiguGDk7MEzOWXUsJo0wsI=
-cloud.google.com/go/datalabeling v0.5.0/go.mod h1:TGcJ0G2NzcsXSE/97yWjIZO0bXj0KbVlINXMG9ud42I=
-cloud.google.com/go/datalabeling v0.6.0/go.mod h1:WqdISuk/+WIGeMkpw/1q7bK/tFEZxsrFJOJdY2bXvTQ=
-cloud.google.com/go/datalabeling v0.7.0/go.mod h1:WPQb1y08RJbmpM3ww0CSUAGweL0SxByuW2E+FU+wXcM=
-cloud.google.com/go/datalabeling v0.8.1/go.mod h1:XS62LBSVPbYR54GfYQsPXZjTW8UxCK2fkDciSrpRFdY=
-cloud.google.com/go/dataplex v1.3.0/go.mod h1:hQuRtDg+fCiFgC8j0zV222HvzFQdRd+SVX8gdmFcZzA=
-cloud.google.com/go/dataplex v1.4.0/go.mod h1:X51GfLXEMVJ6UN47ESVqvlsRplbLhcsAt0kZCCKsU0A=
-cloud.google.com/go/dataplex v1.5.2/go.mod h1:cVMgQHsmfRoI5KFYq4JtIBEUbYwc3c7tXmIDhRmNNVQ=
-cloud.google.com/go/dataplex v1.6.0/go.mod h1:bMsomC/aEJOSpHXdFKFGQ1b0TDPIeL28nJObeO1ppRs=
-cloud.google.com/go/dataplex v1.8.1/go.mod h1:7TyrDT6BCdI8/38Uvp0/ZxBslOslP2X2MPDucliyvSE=
-cloud.google.com/go/dataplex v1.9.0/go.mod h1:7TyrDT6BCdI8/38Uvp0/ZxBslOslP2X2MPDucliyvSE=
-cloud.google.com/go/dataproc v1.7.0/go.mod h1:CKAlMjII9H90RXaMpSxQ8EU6dQx6iAYNPcYPOkSbi8s=
-cloud.google.com/go/dataproc v1.8.0/go.mod h1:5OW+zNAH0pMpw14JVrPONsxMQYMBqJuzORhIBfBn9uI=
-cloud.google.com/go/dataproc v1.12.0/go.mod h1:zrF3aX0uV3ikkMz6z4uBbIKyhRITnxvr4i3IjKsKrw4=
-cloud.google.com/go/dataproc/v2 v2.0.1/go.mod h1:7Ez3KRHdFGcfY7GcevBbvozX+zyWGcwLJvvAMwCaoZ4=
-cloud.google.com/go/dataqna v0.5.0/go.mod h1:90Hyk596ft3zUQ8NkFfvICSIfHFh1Bc7C4cK3vbhkeo=
-cloud.google.com/go/dataqna v0.6.0/go.mod h1:1lqNpM7rqNLVgWBJyk5NF6Uen2PHym0jtVJonplVsDA=
-cloud.google.com/go/dataqna v0.7.0/go.mod h1:Lx9OcIIeqCrw1a6KdO3/5KMP1wAmTc0slZWwP12Qq3c=
-cloud.google.com/go/dataqna v0.8.1/go.mod h1:zxZM0Bl6liMePWsHA8RMGAfmTG34vJMapbHAxQ5+WA8=
-cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
-cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
-cloud.google.com/go/datastore v1.10.0/go.mod h1:PC5UzAmDEkAmkfaknstTYbNpgE49HAgW2J1gcgUfmdM=
-cloud.google.com/go/datastore v1.11.0/go.mod h1:TvGxBIHCS50u8jzG+AW/ppf87v1of8nwzFNgEZU1D3c=
-cloud.google.com/go/datastore v1.12.0/go.mod h1:KjdB88W897MRITkvWWJrg2OUtrR5XVj1EoLgSp6/N70=
-cloud.google.com/go/datastore v1.12.1/go.mod h1:KjdB88W897MRITkvWWJrg2OUtrR5XVj1EoLgSp6/N70=
-cloud.google.com/go/datastore v1.13.0/go.mod h1:KjdB88W897MRITkvWWJrg2OUtrR5XVj1EoLgSp6/N70=
-cloud.google.com/go/datastream v1.2.0/go.mod h1:i/uTP8/fZwgATHS/XFu0TcNUhuA0twZxxQ3EyCUQMwo=
-cloud.google.com/go/datastream v1.3.0/go.mod h1:cqlOX8xlyYF/uxhiKn6Hbv6WjwPPuI9W2M9SAXwaLLQ=
-cloud.google.com/go/datastream v1.4.0/go.mod h1:h9dpzScPhDTs5noEMQVWP8Wx8AFBRyS0s8KWPx/9r0g=
-cloud.google.com/go/datastream v1.5.0/go.mod h1:6TZMMNPwjUqZHBKPQ1wwXpb0d5VDVPl2/XoS5yi88q4=
-cloud.google.com/go/datastream v1.6.0/go.mod h1:6LQSuswqLa7S4rPAOZFVjHIG3wJIjZcZrw8JDEDJuIs=
-cloud.google.com/go/datastream v1.7.0/go.mod h1:uxVRMm2elUSPuh65IbZpzJNMbuzkcvu5CjMqVIUHrww=
-cloud.google.com/go/datastream v1.9.1/go.mod h1:hqnmr8kdUBmrnk65k5wNRoHSCYksvpdZIcZIEl8h43Q=
-cloud.google.com/go/datastream v1.10.0/go.mod h1:hqnmr8kdUBmrnk65k5wNRoHSCYksvpdZIcZIEl8h43Q=
-cloud.google.com/go/deploy v1.4.0/go.mod h1:5Xghikd4VrmMLNaF6FiRFDlHb59VM59YoDQnOUdsH/c=
-cloud.google.com/go/deploy v1.5.0/go.mod h1:ffgdD0B89tToyW/U/D2eL0jN2+IEV/3EMuXHA0l4r+s=
-cloud.google.com/go/deploy v1.6.0/go.mod h1:f9PTHehG/DjCom3QH0cntOVRm93uGBDt2vKzAPwpXQI=
-cloud.google.com/go/deploy v1.8.0/go.mod h1:z3myEJnA/2wnB4sgjqdMfgxCA0EqC3RBTNcVPs93mtQ=
-cloud.google.com/go/deploy v1.11.0/go.mod h1:tKuSUV5pXbn67KiubiUNUejqLs4f5cxxiCNCeyl0F2g=
-cloud.google.com/go/deploy v1.13.0/go.mod h1:tKuSUV5pXbn67KiubiUNUejqLs4f5cxxiCNCeyl0F2g=
-cloud.google.com/go/dialogflow v1.15.0/go.mod h1:HbHDWs33WOGJgn6rfzBW1Kv807BE3O1+xGbn59zZWI4=
-cloud.google.com/go/dialogflow v1.16.1/go.mod h1:po6LlzGfK+smoSmTBnbkIZY2w8ffjz/RcGSS+sh1el0=
-cloud.google.com/go/dialogflow v1.17.0/go.mod h1:YNP09C/kXA1aZdBgC/VtXX74G/TKn7XVCcVumTflA+8=
-cloud.google.com/go/dialogflow v1.18.0/go.mod h1:trO7Zu5YdyEuR+BhSNOqJezyFQ3aUzz0njv7sMx/iek=
-cloud.google.com/go/dialogflow v1.19.0/go.mod h1:JVmlG1TwykZDtxtTXujec4tQ+D8SBFMoosgy+6Gn0s0=
-cloud.google.com/go/dialogflow v1.29.0/go.mod h1:b+2bzMe+k1s9V+F2jbJwpHPzrnIyHihAdRFMtn2WXuM=
-cloud.google.com/go/dialogflow v1.31.0/go.mod h1:cuoUccuL1Z+HADhyIA7dci3N5zUssgpBJmCzI6fNRB4=
-cloud.google.com/go/dialogflow v1.32.0/go.mod h1:jG9TRJl8CKrDhMEcvfcfFkkpp8ZhgPz3sBGmAUYJ2qE=
-cloud.google.com/go/dialogflow v1.38.0/go.mod h1:L7jnH+JL2mtmdChzAIcXQHXMvQkE3U4hTaNltEuxXn4=
-cloud.google.com/go/dialogflow v1.40.0/go.mod h1:L7jnH+JL2mtmdChzAIcXQHXMvQkE3U4hTaNltEuxXn4=
-cloud.google.com/go/dlp v1.6.0/go.mod h1:9eyB2xIhpU0sVwUixfBubDoRwP+GjeUoxxeueZmqvmM=
-cloud.google.com/go/dlp v1.7.0/go.mod h1:68ak9vCiMBjbasxeVD17hVPxDEck+ExiHavX8kiHG+Q=
-cloud.google.com/go/dlp v1.9.0/go.mod h1:qdgmqgTyReTz5/YNSSuueR8pl7hO0o9bQ39ZhtgkWp4=
-cloud.google.com/go/dlp v1.10.1/go.mod h1:IM8BWz1iJd8njcNcG0+Kyd9OPnqnRNkDV8j42VT5KOI=
-cloud.google.com/go/documentai v1.7.0/go.mod h1:lJvftZB5NRiFSX4moiye1SMxHx0Bc3x1+p9e/RfXYiU=
-cloud.google.com/go/documentai v1.8.0/go.mod h1:xGHNEB7CtsnySCNrCFdCyyMz44RhFEEX2Q7UD0c5IhU=
-cloud.google.com/go/documentai v1.9.0/go.mod h1:FS5485S8R00U10GhgBC0aNGrJxBP8ZVpEeJ7PQDZd6k=
-cloud.google.com/go/documentai v1.10.0/go.mod h1:vod47hKQIPeCfN2QS/jULIvQTugbmdc0ZvxxfQY1bg4=
-cloud.google.com/go/documentai v1.16.0/go.mod h1:o0o0DLTEZ+YnJZ+J4wNfTxmDVyrkzFvttBXXtYRMHkM=
-cloud.google.com/go/documentai v1.18.0/go.mod h1:F6CK6iUH8J81FehpskRmhLq/3VlwQvb7TvwOceQ2tbs=
-cloud.google.com/go/documentai v1.20.0/go.mod h1:yJkInoMcK0qNAEdRnqY/D5asy73tnPe88I1YTZT+a8E=
-cloud.google.com/go/documentai v1.22.0/go.mod h1:yJkInoMcK0qNAEdRnqY/D5asy73tnPe88I1YTZT+a8E=
-cloud.google.com/go/domains v0.6.0/go.mod h1:T9Rz3GasrpYk6mEGHh4rymIhjlnIuB4ofT1wTxDeT4Y=
-cloud.google.com/go/domains v0.7.0/go.mod h1:PtZeqS1xjnXuRPKE/88Iru/LdfoRyEHYA9nFQf4UKpg=
-cloud.google.com/go/domains v0.8.0/go.mod h1:M9i3MMDzGFXsydri9/vW+EWz9sWb4I6WyHqdlAk0idE=
-cloud.google.com/go/domains v0.9.1/go.mod h1:aOp1c0MbejQQ2Pjf1iJvnVyT+z6R6s8pX66KaCSDYfE=
-cloud.google.com/go/edgecontainer v0.1.0/go.mod h1:WgkZ9tp10bFxqO8BLPqv2LlfmQF1X8lZqwW4r1BTajk=
-cloud.google.com/go/edgecontainer v0.2.0/go.mod h1:RTmLijy+lGpQ7BXuTDa4C4ssxyXT34NIuHIgKuP4s5w=
-cloud.google.com/go/edgecontainer v0.3.0/go.mod h1:FLDpP4nykgwwIfcLt6zInhprzw0lEi2P1fjO6Ie0qbc=
-cloud.google.com/go/edgecontainer v1.0.0/go.mod h1:cttArqZpBB2q58W/upSG++ooo6EsblxDIolxa3jSjbY=
-cloud.google.com/go/edgecontainer v1.1.1/go.mod h1:O5bYcS//7MELQZs3+7mabRqoWQhXCzenBu0R8bz2rwk=
-cloud.google.com/go/errorreporting v0.3.0/go.mod h1:xsP2yaAp+OAW4OIm60An2bbLpqIhKXdWR/tawvl7QzU=
-cloud.google.com/go/essentialcontacts v1.3.0/go.mod h1:r+OnHa5jfj90qIfZDO/VztSFqbQan7HV75p8sA+mdGI=
-cloud.google.com/go/essentialcontacts v1.4.0/go.mod h1:8tRldvHYsmnBCHdFpvU+GL75oWiBKl80BiqlFh9tp+8=
-cloud.google.com/go/essentialcontacts v1.5.0/go.mod h1:ay29Z4zODTuwliK7SnX8E86aUF2CTzdNtvv42niCX0M=
-cloud.google.com/go/essentialcontacts v1.6.2/go.mod h1:T2tB6tX+TRak7i88Fb2N9Ok3PvY3UNbUsMag9/BARh4=
-cloud.google.com/go/eventarc v1.7.0/go.mod h1:6ctpF3zTnaQCxUjHUdcfgcA1A2T309+omHZth7gDfmc=
-cloud.google.com/go/eventarc v1.8.0/go.mod h1:imbzxkyAU4ubfsaKYdQg04WS1NvncblHEup4kvF+4gw=
-cloud.google.com/go/eventarc v1.10.0/go.mod h1:u3R35tmZ9HvswGRBnF48IlYgYeBcPUCjkr4BTdem2Kw=
-cloud.google.com/go/eventarc v1.11.0/go.mod h1:PyUjsUKPWoRBCHeOxZd/lbOOjahV41icXyUY5kSTvVY=
-cloud.google.com/go/eventarc v1.12.1/go.mod h1:mAFCW6lukH5+IZjkvrEss+jmt2kOdYlN8aMx3sRJiAI=
-cloud.google.com/go/eventarc v1.13.0/go.mod h1:mAFCW6lukH5+IZjkvrEss+jmt2kOdYlN8aMx3sRJiAI=
-cloud.google.com/go/filestore v1.3.0/go.mod h1:+qbvHGvXU1HaKX2nD0WEPo92TP/8AQuCVEBXNY9z0+w=
-cloud.google.com/go/filestore v1.4.0/go.mod h1:PaG5oDfo9r224f8OYXURtAsY+Fbyq/bLYoINEK8XQAI=
-cloud.google.com/go/filestore v1.5.0/go.mod h1:FqBXDWBp4YLHqRnVGveOkHDf8svj9r5+mUDLupOWEDs=
-cloud.google.com/go/filestore v1.6.0/go.mod h1:di5unNuss/qfZTw2U9nhFqo8/ZDSc466dre85Kydllg=
-cloud.google.com/go/filestore v1.7.1/go.mod h1:y10jsorq40JJnjR/lQ8AfFbbcGlw3g+Dp8oN7i7FjV4=
-cloud.google.com/go/firestore v1.9.0/go.mod h1:HMkjKHNTtRyZNiMzu7YAsLr9K3X2udY2AMwDaMEQiiE=
-cloud.google.com/go/firestore v1.11.0/go.mod h1:b38dKhgzlmNNGTNZZwe7ZRFEuRab1Hay3/DBsIGKKy4=
-cloud.google.com/go/functions v1.6.0/go.mod h1:3H1UA3qiIPRWD7PeZKLvHZ9SaQhR26XIJcC0A5GbvAk=
-cloud.google.com/go/functions v1.7.0/go.mod h1:+d+QBcWM+RsrgZfV9xo6KfA1GlzJfxcfZcRPEhDDfzg=
-cloud.google.com/go/functions v1.8.0/go.mod h1:RTZ4/HsQjIqIYP9a9YPbU+QFoQsAlYgrwOXJWHn1POY=
-cloud.google.com/go/functions v1.9.0/go.mod h1:Y+Dz8yGguzO3PpIjhLTbnqV1CWmgQ5UwtlpzoyquQ08=
-cloud.google.com/go/functions v1.10.0/go.mod h1:0D3hEOe3DbEvCXtYOZHQZmD+SzYsi1YbI7dGvHfldXw=
-cloud.google.com/go/functions v1.12.0/go.mod h1:AXWGrF3e2C/5ehvwYo/GH6O5s09tOPksiKhz+hH8WkA=
-cloud.google.com/go/functions v1.13.0/go.mod h1:EU4O007sQm6Ef/PwRsI8N2umygGqPBS/IZQKBQBcJ3c=
-cloud.google.com/go/functions v1.15.1/go.mod h1:P5yNWUTkyU+LvW/S9O6V+V423VZooALQlqoXdoPz5AE=
-cloud.google.com/go/gaming v1.5.0/go.mod h1:ol7rGcxP/qHTRQE/RO4bxkXq+Fix0j6D4LFPzYTIrDM=
-cloud.google.com/go/gaming v1.6.0/go.mod h1:YMU1GEvA39Qt3zWGyAVA9bpYz/yAhTvaQ1t2sK4KPUA=
-cloud.google.com/go/gaming v1.7.0/go.mod h1:LrB8U7MHdGgFG851iHAfqUdLcKBdQ55hzXy9xBJz0+w=
-cloud.google.com/go/gaming v1.8.0/go.mod h1:xAqjS8b7jAVW0KFYeRUxngo9My3f33kFmua++Pi+ggM=
-cloud.google.com/go/gaming v1.9.0/go.mod h1:Fc7kEmCObylSWLO334NcO+O9QMDyz+TKC4v1D7X+Bc0=
-cloud.google.com/go/gaming v1.10.1/go.mod h1:XQQvtfP8Rb9Rxnxm5wFVpAp9zCQkJi2bLIb7iHGwB3s=
-cloud.google.com/go/gkebackup v0.2.0/go.mod h1:XKvv/4LfG829/B8B7xRkk8zRrOEbKtEam6yNfuQNH60=
-cloud.google.com/go/gkebackup v0.3.0/go.mod h1:n/E671i1aOQvUxT541aTkCwExO/bTer2HDlj4TsBRAo=
-cloud.google.com/go/gkebackup v0.4.0/go.mod h1:byAyBGUwYGEEww7xsbnUTBHIYcOPy/PgUWUtOeRm9Vg=
-cloud.google.com/go/gkebackup v1.3.0/go.mod h1:vUDOu++N0U5qs4IhG1pcOnD1Mac79xWy6GoBFlWCWBU=
-cloud.google.com/go/gkeconnect v0.5.0/go.mod h1:c5lsNAg5EwAy7fkqX/+goqFsU1Da/jQFqArp+wGNr/o=
-cloud.google.com/go/gkeconnect v0.6.0/go.mod h1:Mln67KyU/sHJEBY8kFZ0xTeyPtzbq9StAVvEULYK16A=
-cloud.google.com/go/gkeconnect v0.7.0/go.mod h1:SNfmVqPkaEi3bF/B3CNZOAYPYdg7sU+obZ+QTky2Myw=
-cloud.google.com/go/gkeconnect v0.8.1/go.mod h1:KWiK1g9sDLZqhxB2xEuPV8V9NYzrqTUmQR9shJHpOZw=
-cloud.google.com/go/gkehub v0.9.0/go.mod h1:WYHN6WG8w9bXU0hqNxt8rm5uxnk8IH+lPY9J2TV7BK0=
-cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y977wO+hBH0=
-cloud.google.com/go/gkehub v0.11.0/go.mod h1:JOWHlmN+GHyIbuWQPl47/C2RFhnFKH38jH9Ascu3n0E=
-cloud.google.com/go/gkehub v0.12.0/go.mod h1:djiIwwzTTBrF5NaXCGv3mf7klpEMcST17VBTVVDcuaw=
-cloud.google.com/go/gkehub v0.14.1/go.mod h1:VEXKIJZ2avzrbd7u+zeMtW00Y8ddk/4V9511C9CQGTY=
-cloud.google.com/go/gkemulticloud v0.3.0/go.mod h1:7orzy7O0S+5kq95e4Hpn7RysVA7dPs8W/GgfUtsPbrA=
-cloud.google.com/go/gkemulticloud v0.4.0/go.mod h1:E9gxVBnseLWCk24ch+P9+B2CoDFJZTyIgLKSalC7tuI=
-cloud.google.com/go/gkemulticloud v0.5.0/go.mod h1:W0JDkiyi3Tqh0TJr//y19wyb1yf8llHVto2Htf2Ja3Y=
-cloud.google.com/go/gkemulticloud v0.6.1/go.mod h1:kbZ3HKyTsiwqKX7Yw56+wUGwwNZViRnxWK2DVknXWfw=
-cloud.google.com/go/gkemulticloud v1.0.0/go.mod h1:kbZ3HKyTsiwqKX7Yw56+wUGwwNZViRnxWK2DVknXWfw=
-cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc=
-cloud.google.com/go/grafeas v0.3.0/go.mod h1:P7hgN24EyONOTMyeJH6DxG4zD7fwiYa5Q6GUgyFSOU8=
-cloud.google.com/go/gsuiteaddons v1.3.0/go.mod h1:EUNK/J1lZEZO8yPtykKxLXI6JSVN2rg9bN8SXOa0bgM=
-cloud.google.com/go/gsuiteaddons v1.4.0/go.mod h1:rZK5I8hht7u7HxFQcFei0+AtfS9uSushomRlg+3ua1o=
-cloud.google.com/go/gsuiteaddons v1.5.0/go.mod h1:TFCClYLd64Eaa12sFVmUyG62tk4mdIsI7pAnSXRkcFo=
-cloud.google.com/go/gsuiteaddons v1.6.1/go.mod h1:CodrdOqRZcLp5WOwejHWYBjZvfY0kOphkAKpF/3qdZY=
-cloud.google.com/go/iam v0.1.0/go.mod h1:vcUNEa0pEm0qRVpmWepWaFMIAI8/hjB9mO8rNCJtF6c=
-cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY=
-cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc=
-cloud.google.com/go/iam v0.6.0/go.mod h1:+1AH33ueBne5MzYccyMHtEKqLE4/kJOibtffMHDMFMc=
-cloud.google.com/go/iam v0.7.0/go.mod h1:H5Br8wRaDGNc8XP3keLc4unfUUZeyH3Sfl9XpQEYOeg=
-cloud.google.com/go/iam v0.8.0/go.mod h1:lga0/y3iH6CX7sYqypWJ33hf7kkfXJag67naqGESjkE=
-cloud.google.com/go/iam v0.11.0/go.mod h1:9PiLDanza5D+oWFZiH1uG+RnRCfEGKoyl6yo4cgWZGY=
-cloud.google.com/go/iam v0.12.0/go.mod h1:knyHGviacl11zrtZUoDuYpDgLjvr28sLQaG0YB2GYAY=
-cloud.google.com/go/iam v0.13.0/go.mod h1:ljOg+rcNfzZ5d6f1nAUJ8ZIxOaZUVoS14bKCtaLZ/D0=
-cloud.google.com/go/iam v1.0.1/go.mod h1:yR3tmSL8BcZB4bxByRv2jkSIahVmCtfKZwLYGBalRE8=
-cloud.google.com/go/iam v1.1.0/go.mod h1:nxdHjaKfCr7fNYx/HJMM8LgiMugmveWlkatear5gVyk=
-cloud.google.com/go/iam v1.1.1/go.mod h1:A5avdyVL2tCppe4unb0951eI9jreack+RJ0/d+KUZOU=
-cloud.google.com/go/iap v1.4.0/go.mod h1:RGFwRJdihTINIe4wZ2iCP0zF/qu18ZwyKxrhMhygBEc=
-cloud.google.com/go/iap v1.5.0/go.mod h1:UH/CGgKd4KyohZL5Pt0jSKE4m3FR51qg6FKQ/z/Ix9A=
-cloud.google.com/go/iap v1.6.0/go.mod h1:NSuvI9C/j7UdjGjIde7t7HBz+QTwBcapPE07+sSRcLk=
-cloud.google.com/go/iap v1.7.0/go.mod h1:beqQx56T9O1G1yNPph+spKpNibDlYIiIixiqsQXxLIo=
-cloud.google.com/go/iap v1.7.1/go.mod h1:WapEwPc7ZxGt2jFGB/C/bm+hP0Y6NXzOYGjpPnmMS74=
-cloud.google.com/go/iap v1.8.1/go.mod h1:sJCbeqg3mvWLqjZNsI6dfAtbbV1DL2Rl7e1mTyXYREQ=
-cloud.google.com/go/ids v1.1.0/go.mod h1:WIuwCaYVOzHIj2OhN9HAwvW+DBdmUAdcWlFxRl+KubM=
-cloud.google.com/go/ids v1.2.0/go.mod h1:5WXvp4n25S0rA/mQWAg1YEEBBq6/s+7ml1RDCW1IrcY=
-cloud.google.com/go/ids v1.3.0/go.mod h1:JBdTYwANikFKaDP6LtW5JAi4gubs57SVNQjemdt6xV4=
-cloud.google.com/go/ids v1.4.1/go.mod h1:np41ed8YMU8zOgv53MMMoCntLTn2lF+SUzlM+O3u/jw=
-cloud.google.com/go/iot v1.3.0/go.mod h1:r7RGh2B61+B8oz0AGE+J72AhA0G7tdXItODWsaA2oLs=
-cloud.google.com/go/iot v1.4.0/go.mod h1:dIDxPOn0UvNDUMD8Ger7FIaTuvMkj+aGk94RPP0iV+g=
-cloud.google.com/go/iot v1.5.0/go.mod h1:mpz5259PDl3XJthEmh9+ap0affn/MqNSP4My77Qql9o=
-cloud.google.com/go/iot v1.6.0/go.mod h1:IqdAsmE2cTYYNO1Fvjfzo9po179rAtJeVGUvkLN3rLE=
-cloud.google.com/go/iot v1.7.1/go.mod h1:46Mgw7ev1k9KqK1ao0ayW9h0lI+3hxeanz+L1zmbbbk=
-cloud.google.com/go/kms v1.4.0/go.mod h1:fajBHndQ+6ubNw6Ss2sSd+SWvjL26RNo/dr7uxsnnOA=
-cloud.google.com/go/kms v1.5.0/go.mod h1:QJS2YY0eJGBg3mnDfuaCyLauWwBJiHRboYxJ++1xJNg=
-cloud.google.com/go/kms v1.6.0/go.mod h1:Jjy850yySiasBUDi6KFUwUv2n1+o7QZFyuUJg6OgjA0=
-cloud.google.com/go/kms v1.8.0/go.mod h1:4xFEhYFqvW+4VMELtZyxomGSYtSQKzM178ylFW4jMAg=
-cloud.google.com/go/kms v1.9.0/go.mod h1:qb1tPTgfF9RQP8e1wq4cLFErVuTJv7UsSC915J8dh3w=
-cloud.google.com/go/kms v1.10.0/go.mod h1:ng3KTUtQQU9bPX3+QGLsflZIHlkbn8amFAMY63m8d24=
-cloud.google.com/go/kms v1.10.1/go.mod h1:rIWk/TryCkR59GMC3YtHtXeLzd634lBbKenvyySAyYI=
-cloud.google.com/go/kms v1.11.0/go.mod h1:hwdiYC0xjnWsKQQCQQmIQnS9asjYVSK6jtXm+zFqXLM=
-cloud.google.com/go/kms v1.12.1/go.mod h1:c9J991h5DTl+kg7gi3MYomh12YEENGrf48ee/N/2CDM=
-cloud.google.com/go/kms v1.15.0/go.mod h1:c9J991h5DTl+kg7gi3MYomh12YEENGrf48ee/N/2CDM=
-cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic=
-cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI=
-cloud.google.com/go/language v1.7.0/go.mod h1:DJ6dYN/W+SQOjF8e1hLQXMF21AkH2w9wiPzPCJa2MIE=
-cloud.google.com/go/language v1.8.0/go.mod h1:qYPVHf7SPoNNiCL2Dr0FfEFNil1qi3pQEyygwpgVKB8=
-cloud.google.com/go/language v1.9.0/go.mod h1:Ns15WooPM5Ad/5no/0n81yUetis74g3zrbeJBE+ptUY=
-cloud.google.com/go/language v1.10.1/go.mod h1:CPp94nsdVNiQEt1CNjF5WkTcisLiHPyIbMhvR8H2AW0=
-cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8=
-cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6t/iPhY2Tyfu08=
-cloud.google.com/go/lifesciences v0.8.0/go.mod h1:lFxiEOMqII6XggGbOnKiyZ7IBwoIqA84ClvoezaA/bo=
-cloud.google.com/go/lifesciences v0.9.1/go.mod h1:hACAOd1fFbCGLr/+weUKRAJas82Y4vrL3O5326N//Wc=
-cloud.google.com/go/logging v1.6.1/go.mod h1:5ZO0mHHbvm8gEmeEUHrmDlTDSu5imF6MUP9OfilNXBw=
-cloud.google.com/go/logging v1.7.0/go.mod h1:3xjP2CjkM3ZkO73aj4ASA5wRPGGCRrPIAeNqVNkzY8M=
-cloud.google.com/go/longrunning v0.1.1/go.mod h1:UUFxuDWkv22EuY93jjmDMFT5GPQKeFVJBIF6QlTqdsE=
-cloud.google.com/go/longrunning v0.3.0/go.mod h1:qth9Y41RRSUE69rDcOn6DdK3HfQfsUI0YSmW3iIlLJc=
-cloud.google.com/go/longrunning v0.4.1/go.mod h1:4iWDqhBZ70CvZ6BfETbvam3T8FMvLK+eFj0E6AaRQTo=
-cloud.google.com/go/longrunning v0.4.2/go.mod h1:OHrnaYyLUV6oqwh0xiS7e5sLQhP1m0QU9R+WhGDMgIQ=
-cloud.google.com/go/longrunning v0.5.0/go.mod h1:0JNuqRShmscVAhIACGtskSAWtqtOoPkwP0YF1oVEchc=
-cloud.google.com/go/longrunning v0.5.1/go.mod h1:spvimkwdz6SPWKEt/XBij79E9fiTkHSQl/fRUUQJYJc=
-cloud.google.com/go/managedidentities v1.3.0/go.mod h1:UzlW3cBOiPrzucO5qWkNkh0w33KFtBJU281hacNvsdE=
-cloud.google.com/go/managedidentities v1.4.0/go.mod h1:NWSBYbEMgqmbZsLIyKvxrYbtqOsxY1ZrGM+9RgDqInM=
-cloud.google.com/go/managedidentities v1.5.0/go.mod h1:+dWcZ0JlUmpuxpIDfyP5pP5y0bLdRwOS4Lp7gMni/LA=
-cloud.google.com/go/managedidentities v1.6.1/go.mod h1:h/irGhTN2SkZ64F43tfGPMbHnypMbu4RB3yl8YcuEak=
-cloud.google.com/go/maps v0.1.0/go.mod h1:BQM97WGyfw9FWEmQMpZ5T6cpovXXSd1cGmFma94eubI=
-cloud.google.com/go/maps v0.6.0/go.mod h1:o6DAMMfb+aINHz/p/jbcY+mYeXBoZoxTfdSQ8VAJaCw=
-cloud.google.com/go/maps v0.7.0/go.mod h1:3GnvVl3cqeSvgMcpRlQidXsPYuDGQ8naBis7MVzpXsY=
-cloud.google.com/go/maps v1.3.0/go.mod h1:6mWTUv+WhnOwAgjVsSW2QPPECmW+s3PcRyOa9vgG/5s=
-cloud.google.com/go/maps v1.4.0/go.mod h1:6mWTUv+WhnOwAgjVsSW2QPPECmW+s3PcRyOa9vgG/5s=
-cloud.google.com/go/mediatranslation v0.5.0/go.mod h1:jGPUhGTybqsPQn91pNXw0xVHfuJ3leR1wj37oU3y1f4=
-cloud.google.com/go/mediatranslation v0.6.0/go.mod h1:hHdBCTYNigsBxshbznuIMFNe5QXEowAuNmmC7h8pu5w=
-cloud.google.com/go/mediatranslation v0.7.0/go.mod h1:LCnB/gZr90ONOIQLgSXagp8XUW1ODs2UmUMvcgMfI2I=
-cloud.google.com/go/mediatranslation v0.8.1/go.mod h1:L/7hBdEYbYHQJhX2sldtTO5SZZ1C1vkapubj0T2aGig=
-cloud.google.com/go/memcache v1.4.0/go.mod h1:rTOfiGZtJX1AaFUrOgsMHX5kAzaTQ8azHiuDoTPzNsE=
-cloud.google.com/go/memcache v1.5.0/go.mod h1:dk3fCK7dVo0cUU2c36jKb4VqKPS22BTkf81Xq617aWM=
-cloud.google.com/go/memcache v1.6.0/go.mod h1:XS5xB0eQZdHtTuTF9Hf8eJkKtR3pVRCcvJwtm68T3rA=
-cloud.google.com/go/memcache v1.7.0/go.mod h1:ywMKfjWhNtkQTxrWxCkCFkoPjLHPW6A7WOTVI8xy3LY=
-cloud.google.com/go/memcache v1.9.0/go.mod h1:8oEyzXCu+zo9RzlEaEjHl4KkgjlNDaXbCQeQWlzNFJM=
-cloud.google.com/go/memcache v1.10.1/go.mod h1:47YRQIarv4I3QS5+hoETgKO40InqzLP6kpNLvyXuyaA=
-cloud.google.com/go/metastore v1.5.0/go.mod h1:2ZNrDcQwghfdtCwJ33nM0+GrBGlVuh8rakL3vdPY3XY=
-cloud.google.com/go/metastore v1.6.0/go.mod h1:6cyQTls8CWXzk45G55x57DVQ9gWg7RiH65+YgPsNh9s=
-cloud.google.com/go/metastore v1.7.0/go.mod h1:s45D0B4IlsINu87/AsWiEVYbLaIMeUSoxlKKDqBGFS8=
-cloud.google.com/go/metastore v1.8.0/go.mod h1:zHiMc4ZUpBiM7twCIFQmJ9JMEkDSyZS9U12uf7wHqSI=
-cloud.google.com/go/metastore v1.10.0/go.mod h1:fPEnH3g4JJAk+gMRnrAnoqyv2lpUCqJPWOodSaf45Eo=
-cloud.google.com/go/metastore v1.11.1/go.mod h1:uZuSo80U3Wd4zi6C22ZZliOUJ3XeM/MlYi/z5OAOWRA=
-cloud.google.com/go/metastore v1.12.0/go.mod h1:uZuSo80U3Wd4zi6C22ZZliOUJ3XeM/MlYi/z5OAOWRA=
-cloud.google.com/go/monitoring v1.7.0/go.mod h1:HpYse6kkGo//7p6sT0wsIC6IBDET0RhIsnmlA53dvEk=
-cloud.google.com/go/monitoring v1.8.0/go.mod h1:E7PtoMJ1kQXWxPjB6mv2fhC5/15jInuulFdYYtlcvT4=
-cloud.google.com/go/monitoring v1.12.0/go.mod h1:yx8Jj2fZNEkL/GYZyTLS4ZtZEZN8WtDEiEqG4kLK50w=
-cloud.google.com/go/monitoring v1.13.0/go.mod h1:k2yMBAB1H9JT/QETjNkgdCGD9bPF712XiLTVr+cBrpw=
-cloud.google.com/go/monitoring v1.15.1/go.mod h1:lADlSAlFdbqQuwwpaImhsJXu1QSdd3ojypXrFSMr2rM=
-cloud.google.com/go/networkconnectivity v1.4.0/go.mod h1:nOl7YL8odKyAOtzNX73/M5/mGZgqqMeryi6UPZTk/rA=
-cloud.google.com/go/networkconnectivity v1.5.0/go.mod h1:3GzqJx7uhtlM3kln0+x5wyFvuVH1pIBJjhCpjzSt75o=
-cloud.google.com/go/networkconnectivity v1.6.0/go.mod h1:OJOoEXW+0LAxHh89nXd64uGG+FbQoeH8DtxCHVOMlaM=
-cloud.google.com/go/networkconnectivity v1.7.0/go.mod h1:RMuSbkdbPwNMQjB5HBWD5MpTBnNm39iAVpC3TmsExt8=
-cloud.google.com/go/networkconnectivity v1.10.0/go.mod h1:UP4O4sWXJG13AqrTdQCD9TnLGEbtNRqjuaaA7bNjF5E=
-cloud.google.com/go/networkconnectivity v1.11.0/go.mod h1:iWmDD4QF16VCDLXUqvyspJjIEtBR/4zq5hwnY2X3scM=
-cloud.google.com/go/networkconnectivity v1.12.1/go.mod h1:PelxSWYM7Sh9/guf8CFhi6vIqf19Ir/sbfZRUwXh92E=
-cloud.google.com/go/networkmanagement v1.4.0/go.mod h1:Q9mdLLRn60AsOrPc8rs8iNV6OHXaGcDdsIQe1ohekq8=
-cloud.google.com/go/networkmanagement v1.5.0/go.mod h1:ZnOeZ/evzUdUsnvRt792H0uYEnHQEMaz+REhhzJRcf4=
-cloud.google.com/go/networkmanagement v1.6.0/go.mod h1:5pKPqyXjB/sgtvB5xqOemumoQNB7y95Q7S+4rjSOPYY=
-cloud.google.com/go/networkmanagement v1.8.0/go.mod h1:Ho/BUGmtyEqrttTgWEe7m+8vDdK74ibQc+Be0q7Fof0=
-cloud.google.com/go/networksecurity v0.5.0/go.mod h1:xS6fOCoqpVC5zx15Z/MqkfDwH4+m/61A3ODiDV1xmiQ=
-cloud.google.com/go/networksecurity v0.6.0/go.mod h1:Q5fjhTr9WMI5mbpRYEbiexTzROf7ZbDzvzCrNl14nyU=
-cloud.google.com/go/networksecurity v0.7.0/go.mod h1:mAnzoxx/8TBSyXEeESMy9OOYwo1v+gZ5eMRnsT5bC8k=
-cloud.google.com/go/networksecurity v0.8.0/go.mod h1:B78DkqsxFG5zRSVuwYFRZ9Xz8IcQ5iECsNrPn74hKHU=
-cloud.google.com/go/networksecurity v0.9.1/go.mod h1:MCMdxOKQ30wsBI1eI659f9kEp4wuuAueoC9AJKSPWZQ=
-cloud.google.com/go/notebooks v1.2.0/go.mod h1:9+wtppMfVPUeJ8fIWPOq1UnATHISkGXGqTkxeieQ6UY=
-cloud.google.com/go/notebooks v1.3.0/go.mod h1:bFR5lj07DtCPC7YAAJ//vHskFBxA5JzYlH68kXVdk34=
-cloud.google.com/go/notebooks v1.4.0/go.mod h1:4QPMngcwmgb6uw7Po99B2xv5ufVoIQ7nOGDyL4P8AgA=
-cloud.google.com/go/notebooks v1.5.0/go.mod h1:q8mwhnP9aR8Hpfnrc5iN5IBhrXUy8S2vuYs+kBJ/gu0=
-cloud.google.com/go/notebooks v1.7.0/go.mod h1:PVlaDGfJgj1fl1S3dUwhFMXFgfYGhYQt2164xOMONmE=
-cloud.google.com/go/notebooks v1.8.0/go.mod h1:Lq6dYKOYOWUCTvw5t2q1gp1lAp0zxAxRycayS0iJcqQ=
-cloud.google.com/go/notebooks v1.9.1/go.mod h1:zqG9/gk05JrzgBt4ghLzEepPHNwE5jgPcHZRKhlC1A8=
-cloud.google.com/go/optimization v1.1.0/go.mod h1:5po+wfvX5AQlPznyVEZjGJTMr4+CAkJf2XSTQOOl9l4=
-cloud.google.com/go/optimization v1.2.0/go.mod h1:Lr7SOHdRDENsh+WXVmQhQTrzdu9ybg0NecjHidBq6xs=
-cloud.google.com/go/optimization v1.3.1/go.mod h1:IvUSefKiwd1a5p0RgHDbWCIbDFgKuEdB+fPPuP0IDLI=
-cloud.google.com/go/optimization v1.4.1/go.mod h1:j64vZQP7h9bO49m2rVaTVoNM0vEBEN5eKPUPbZyXOrk=
-cloud.google.com/go/orchestration v1.3.0/go.mod h1:Sj5tq/JpWiB//X/q3Ngwdl5K7B7Y0KZ7bfv0wL6fqVA=
-cloud.google.com/go/orchestration v1.4.0/go.mod h1:6W5NLFWs2TlniBphAViZEVhrXRSMgUGDfW7vrWKvsBk=
-cloud.google.com/go/orchestration v1.6.0/go.mod h1:M62Bevp7pkxStDfFfTuCOaXgaaqRAga1yKyoMtEoWPQ=
-cloud.google.com/go/orchestration v1.8.1/go.mod h1:4sluRF3wgbYVRqz7zJ1/EUNc90TTprliq9477fGobD8=
-cloud.google.com/go/orgpolicy v1.4.0/go.mod h1:xrSLIV4RePWmP9P3tBl8S93lTmlAxjm06NSm2UTmKvE=
-cloud.google.com/go/orgpolicy v1.5.0/go.mod h1:hZEc5q3wzwXJaKrsx5+Ewg0u1LxJ51nNFlext7Tanwc=
-cloud.google.com/go/orgpolicy v1.10.0/go.mod h1:w1fo8b7rRqlXlIJbVhOMPrwVljyuW5mqssvBtU18ONc=
-cloud.google.com/go/orgpolicy v1.11.0/go.mod h1:2RK748+FtVvnfuynxBzdnyu7sygtoZa1za/0ZfpOs1M=
-cloud.google.com/go/orgpolicy v1.11.1/go.mod h1:8+E3jQcpZJQliP+zaFfayC2Pg5bmhuLK755wKhIIUCE=
-cloud.google.com/go/osconfig v1.7.0/go.mod h1:oVHeCeZELfJP7XLxcBGTMBvRO+1nQ5tFG9VQTmYS2Fs=
-cloud.google.com/go/osconfig v1.8.0/go.mod h1:EQqZLu5w5XA7eKizepumcvWx+m8mJUhEwiPqWiZeEdg=
-cloud.google.com/go/osconfig v1.9.0/go.mod h1:Yx+IeIZJ3bdWmzbQU4fxNl8xsZ4amB+dygAwFPlvnNo=
-cloud.google.com/go/osconfig v1.10.0/go.mod h1:uMhCzqC5I8zfD9zDEAfvgVhDS8oIjySWh+l4WK6GnWw=
-cloud.google.com/go/osconfig v1.11.0/go.mod h1:aDICxrur2ogRd9zY5ytBLV89KEgT2MKB2L/n6x1ooPw=
-cloud.google.com/go/osconfig v1.12.0/go.mod h1:8f/PaYzoS3JMVfdfTubkowZYGmAhUCjjwnjqWI7NVBc=
-cloud.google.com/go/osconfig v1.12.1/go.mod h1:4CjBxND0gswz2gfYRCUoUzCm9zCABp91EeTtWXyz0tE=
-cloud.google.com/go/oslogin v1.4.0/go.mod h1:YdgMXWRaElXz/lDk1Na6Fh5orF7gvmJ0FGLIs9LId4E=
-cloud.google.com/go/oslogin v1.5.0/go.mod h1:D260Qj11W2qx/HVF29zBg+0fd6YCSjSqLUkY/qEenQU=
-cloud.google.com/go/oslogin v1.6.0/go.mod h1:zOJ1O3+dTU8WPlGEkFSh7qeHPPSoxrcMbbK1Nm2iX70=
-cloud.google.com/go/oslogin v1.7.0/go.mod h1:e04SN0xO1UNJ1M5GP0vzVBFicIe4O53FOfcixIqTyXo=
-cloud.google.com/go/oslogin v1.9.0/go.mod h1:HNavntnH8nzrn8JCTT5fj18FuJLFJc4NaZJtBnQtKFs=
-cloud.google.com/go/oslogin v1.10.1/go.mod h1:x692z7yAue5nE7CsSnoG0aaMbNoRJRXO4sn73R+ZqAs=
-cloud.google.com/go/phishingprotection v0.5.0/go.mod h1:Y3HZknsK9bc9dMi+oE8Bim0lczMU6hrX0UpADuMefr0=
-cloud.google.com/go/phishingprotection v0.6.0/go.mod h1:9Y3LBLgy0kDTcYET8ZH3bq/7qni15yVUoAxiFxnlSUA=
-cloud.google.com/go/phishingprotection v0.7.0/go.mod h1:8qJI4QKHoda/sb/7/YmMQ2omRLSLYSu9bU0EKCNI+Lk=
-cloud.google.com/go/phishingprotection v0.8.1/go.mod h1:AxonW7GovcA8qdEk13NfHq9hNx5KPtfxXNeUxTDxB6I=
-cloud.google.com/go/policytroubleshooter v1.3.0/go.mod h1:qy0+VwANja+kKrjlQuOzmlvscn4RNsAc0e15GGqfMxg=
-cloud.google.com/go/policytroubleshooter v1.4.0/go.mod h1:DZT4BcRw3QoO8ota9xw/LKtPa8lKeCByYeKTIf/vxdE=
-cloud.google.com/go/policytroubleshooter v1.5.0/go.mod h1:Rz1WfV+1oIpPdN2VvvuboLVRsB1Hclg3CKQ53j9l8vw=
-cloud.google.com/go/policytroubleshooter v1.6.0/go.mod h1:zYqaPTsmfvpjm5ULxAyD/lINQxJ0DDsnWOP/GZ7xzBc=
-cloud.google.com/go/policytroubleshooter v1.7.1/go.mod h1:0NaT5v3Ag1M7U5r0GfDCpUFkWd9YqpubBWsQlhanRv0=
-cloud.google.com/go/policytroubleshooter v1.8.0/go.mod h1:tmn5Ir5EToWe384EuboTcVQT7nTag2+DuH3uHmKd1HU=
-cloud.google.com/go/privatecatalog v0.5.0/go.mod h1:XgosMUvvPyxDjAVNDYxJ7wBW8//hLDDYmnsNcMGq1K0=
-cloud.google.com/go/privatecatalog v0.6.0/go.mod h1:i/fbkZR0hLN29eEWiiwue8Pb+GforiEIBnV9yrRUOKI=
-cloud.google.com/go/privatecatalog v0.7.0/go.mod h1:2s5ssIFO69F5csTXcwBP7NPFTZvps26xGzvQ2PQaBYg=
-cloud.google.com/go/privatecatalog v0.8.0/go.mod h1:nQ6pfaegeDAq/Q5lrfCQzQLhubPiZhSaNhIgfJlnIXs=
-cloud.google.com/go/privatecatalog v0.9.1/go.mod h1:0XlDXW2unJXdf9zFz968Hp35gl/bhF4twwpXZAW50JA=
-cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
-cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
-cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA=
-cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU=
-cloud.google.com/go/pubsub v1.26.0/go.mod h1:QgBH3U/jdJy/ftjPhTkyXNj543Tin1pRYcdcPRnFIRI=
-cloud.google.com/go/pubsub v1.27.1/go.mod h1:hQN39ymbV9geqBnfQq6Xf63yNhUAhv9CZhzp5O6qsW0=
-cloud.google.com/go/pubsub v1.28.0/go.mod h1:vuXFpwaVoIPQMGXqRyUQigu/AX1S3IWugR9xznmcXX8=
-cloud.google.com/go/pubsub v1.30.0/go.mod h1:qWi1OPS0B+b5L+Sg6Gmc9zD1Y+HaM0MdUr7LsupY1P4=
-cloud.google.com/go/pubsub v1.32.0/go.mod h1:f+w71I33OMyxf9VpMVcZbnG5KSUkCOUHYpFd5U1GdRc=
-cloud.google.com/go/pubsub v1.33.0/go.mod h1:f+w71I33OMyxf9VpMVcZbnG5KSUkCOUHYpFd5U1GdRc=
-cloud.google.com/go/pubsublite v1.5.0/go.mod h1:xapqNQ1CuLfGi23Yda/9l4bBCKz/wC3KIJ5gKcxveZg=
-cloud.google.com/go/pubsublite v1.6.0/go.mod h1:1eFCS0U11xlOuMFV/0iBqw3zP12kddMeCbj/F3FSj9k=
-cloud.google.com/go/pubsublite v1.7.0/go.mod h1:8hVMwRXfDfvGm3fahVbtDbiLePT3gpoiJYJY+vxWxVM=
-cloud.google.com/go/pubsublite v1.8.1/go.mod h1:fOLdU4f5xldK4RGJrBMm+J7zMWNj/k4PxwEZXy39QS0=
-cloud.google.com/go/recaptchaenterprise v1.3.1/go.mod h1:OdD+q+y4XGeAlxRaMn1Y7/GveP6zmq76byL6tjPE7d4=
-cloud.google.com/go/recaptchaenterprise/v2 v2.1.0/go.mod h1:w9yVqajwroDNTfGuhmOjPDN//rZGySaf6PtFVcSCa7o=
-cloud.google.com/go/recaptchaenterprise/v2 v2.2.0/go.mod h1:/Zu5jisWGeERrd5HnlS3EUGb/D335f9k51B/FVil0jk=
-cloud.google.com/go/recaptchaenterprise/v2 v2.3.0/go.mod h1:O9LwGCjrhGHBQET5CA7dd5NwwNQUErSgEDit1DLNTdo=
-cloud.google.com/go/recaptchaenterprise/v2 v2.4.0/go.mod h1:Am3LHfOuBstrLrNCBrlI5sbwx9LBg3te2N6hGvHn2mE=
-cloud.google.com/go/recaptchaenterprise/v2 v2.5.0/go.mod h1:O8LzcHXN3rz0j+LBC91jrwI3R+1ZSZEWrfL7XHgNo9U=
-cloud.google.com/go/recaptchaenterprise/v2 v2.6.0/go.mod h1:RPauz9jeLtB3JVzg6nCbe12qNoaa8pXc4d/YukAmcnA=
-cloud.google.com/go/recaptchaenterprise/v2 v2.7.0/go.mod h1:19wVj/fs5RtYtynAPJdDTb69oW0vNHYDBTbB4NvMD9c=
-cloud.google.com/go/recaptchaenterprise/v2 v2.7.2/go.mod h1:kR0KjsJS7Jt1YSyWFkseQ756D45kaYNTlDPPaRAvDBU=
-cloud.google.com/go/recommendationengine v0.5.0/go.mod h1:E5756pJcVFeVgaQv3WNpImkFP8a+RptV6dDLGPILjvg=
-cloud.google.com/go/recommendationengine v0.6.0/go.mod h1:08mq2umu9oIqc7tDy8sx+MNJdLG0fUi3vaSVbztHgJ4=
-cloud.google.com/go/recommendationengine v0.7.0/go.mod h1:1reUcE3GIu6MeBz/h5xZJqNLuuVjNg1lmWMPyjatzac=
-cloud.google.com/go/recommendationengine v0.8.1/go.mod h1:MrZihWwtFYWDzE6Hz5nKcNz3gLizXVIDI/o3G1DLcrE=
-cloud.google.com/go/recommender v1.5.0/go.mod h1:jdoeiBIVrJe9gQjwd759ecLJbxCDED4A6p+mqoqDvTg=
-cloud.google.com/go/recommender v1.6.0/go.mod h1:+yETpm25mcoiECKh9DEScGzIRyDKpZ0cEhWGo+8bo+c=
-cloud.google.com/go/recommender v1.7.0/go.mod h1:XLHs/W+T8olwlGOgfQenXBTbIseGclClff6lhFVe9Bs=
-cloud.google.com/go/recommender v1.8.0/go.mod h1:PkjXrTT05BFKwxaUxQmtIlrtj0kph108r02ZZQ5FE70=
-cloud.google.com/go/recommender v1.9.0/go.mod h1:PnSsnZY7q+VL1uax2JWkt/UegHssxjUVVCrX52CuEmQ=
-cloud.google.com/go/recommender v1.10.1/go.mod h1:XFvrE4Suqn5Cq0Lf+mCP6oBHD/yRMA8XxP5sb7Q7gpA=
-cloud.google.com/go/redis v1.7.0/go.mod h1:V3x5Jq1jzUcg+UNsRvdmsfuFnit1cfe3Z/PGyq/lm4Y=
-cloud.google.com/go/redis v1.8.0/go.mod h1:Fm2szCDavWzBk2cDKxrkmWBqoCiL1+Ctwq7EyqBCA/A=
-cloud.google.com/go/redis v1.9.0/go.mod h1:HMYQuajvb2D0LvMgZmLDZW8V5aOC/WxstZHiy4g8OiA=
-cloud.google.com/go/redis v1.10.0/go.mod h1:ThJf3mMBQtW18JzGgh41/Wld6vnDDc/F/F35UolRZPM=
-cloud.google.com/go/redis v1.11.0/go.mod h1:/X6eicana+BWcUda5PpwZC48o37SiFVTFSs0fWAJ7uQ=
-cloud.google.com/go/redis v1.13.1/go.mod h1:VP7DGLpE91M6bcsDdMuyCm2hIpB6Vp2hI090Mfd1tcg=
-cloud.google.com/go/resourcemanager v1.3.0/go.mod h1:bAtrTjZQFJkiWTPDb1WBjzvc6/kifjj4QBYuKCCoqKA=
-cloud.google.com/go/resourcemanager v1.4.0/go.mod h1:MwxuzkumyTX7/a3n37gmsT3py7LIXwrShilPh3P1tR0=
-cloud.google.com/go/resourcemanager v1.5.0/go.mod h1:eQoXNAiAvCf5PXxWxXjhKQoTMaUSNrEfg+6qdf/wots=
-cloud.google.com/go/resourcemanager v1.6.0/go.mod h1:YcpXGRs8fDzcUl1Xw8uOVmI8JEadvhRIkoXXUNVYcVo=
-cloud.google.com/go/resourcemanager v1.7.0/go.mod h1:HlD3m6+bwhzj9XCouqmeiGuni95NTrExfhoSrkC/3EI=
-cloud.google.com/go/resourcemanager v1.9.1/go.mod h1:dVCuosgrh1tINZ/RwBufr8lULmWGOkPS8gL5gqyjdT8=
-cloud.google.com/go/resourcesettings v1.3.0/go.mod h1:lzew8VfESA5DQ8gdlHwMrqZs1S9V87v3oCnKCWoOuQU=
-cloud.google.com/go/resourcesettings v1.4.0/go.mod h1:ldiH9IJpcrlC3VSuCGvjR5of/ezRrOxFtpJoJo5SmXg=
-cloud.google.com/go/resourcesettings v1.5.0/go.mod h1:+xJF7QSG6undsQDfsCJyqWXyBwUoJLhetkRMDRnIoXA=
-cloud.google.com/go/resourcesettings v1.6.1/go.mod h1:M7mk9PIZrC5Fgsu1kZJci6mpgN8o0IUzVx3eJU3y4Jw=
-cloud.google.com/go/retail v1.8.0/go.mod h1:QblKS8waDmNUhghY2TI9O3JLlFk8jybHeV4BF19FrE4=
-cloud.google.com/go/retail v1.9.0/go.mod h1:g6jb6mKuCS1QKnH/dpu7isX253absFl6iE92nHwlBUY=
-cloud.google.com/go/retail v1.10.0/go.mod h1:2gDk9HsL4HMS4oZwz6daui2/jmKvqShXKQuB2RZ+cCc=
-cloud.google.com/go/retail v1.11.0/go.mod h1:MBLk1NaWPmh6iVFSz9MeKG/Psyd7TAgm6y/9L2B4x9Y=
-cloud.google.com/go/retail v1.12.0/go.mod h1:UMkelN/0Z8XvKymXFbD4EhFJlYKRx1FGhQkVPU5kF14=
-cloud.google.com/go/retail v1.14.1/go.mod h1:y3Wv3Vr2k54dLNIrCzenyKG8g8dhvhncT2NcNjb/6gE=
-cloud.google.com/go/run v0.2.0/go.mod h1:CNtKsTA1sDcnqqIFR3Pb5Tq0usWxJJvsWOCPldRU3Do=
-cloud.google.com/go/run v0.3.0/go.mod h1:TuyY1+taHxTjrD0ZFk2iAR+xyOXEA0ztb7U3UNA0zBo=
-cloud.google.com/go/run v0.8.0/go.mod h1:VniEnuBwqjigv0A7ONfQUaEItaiCRVujlMqerPPiktM=
-cloud.google.com/go/run v0.9.0/go.mod h1:Wwu+/vvg8Y+JUApMwEDfVfhetv30hCG4ZwDR/IXl2Qg=
-cloud.google.com/go/run v1.2.0/go.mod h1:36V1IlDzQ0XxbQjUx6IYbw8H3TJnWvhii963WW3B/bo=
-cloud.google.com/go/scheduler v1.4.0/go.mod h1:drcJBmxF3aqZJRhmkHQ9b3uSSpQoltBPGPxGAWROx6s=
-cloud.google.com/go/scheduler v1.5.0/go.mod h1:ri073ym49NW3AfT6DZi21vLZrG07GXr5p3H1KxN5QlI=
-cloud.google.com/go/scheduler v1.6.0/go.mod h1:SgeKVM7MIwPn3BqtcBntpLyrIJftQISRrYB5ZtT+KOk=
-cloud.google.com/go/scheduler v1.7.0/go.mod h1:jyCiBqWW956uBjjPMMuX09n3x37mtyPJegEWKxRsn44=
-cloud.google.com/go/scheduler v1.8.0/go.mod h1:TCET+Y5Gp1YgHT8py4nlg2Sew8nUHMqcpousDgXJVQc=
-cloud.google.com/go/scheduler v1.9.0/go.mod h1:yexg5t+KSmqu+njTIh3b7oYPheFtBWGcbVUYF1GGMIc=
-cloud.google.com/go/scheduler v1.10.1/go.mod h1:R63Ldltd47Bs4gnhQkmNDse5w8gBRrhObZ54PxgR2Oo=
-cloud.google.com/go/secretmanager v1.6.0/go.mod h1:awVa/OXF6IiyaU1wQ34inzQNc4ISIDIrId8qE5QGgKA=
-cloud.google.com/go/secretmanager v1.8.0/go.mod h1:hnVgi/bN5MYHd3Gt0SPuTPPp5ENina1/LxM+2W9U9J4=
-cloud.google.com/go/secretmanager v1.9.0/go.mod h1:b71qH2l1yHmWQHt9LC80akm86mX8AL6X1MA01dW8ht4=
-cloud.google.com/go/secretmanager v1.10.0/go.mod h1:MfnrdvKMPNra9aZtQFvBcvRU54hbPD8/HayQdlUgJpU=
-cloud.google.com/go/secretmanager v1.11.1/go.mod h1:znq9JlXgTNdBeQk9TBW/FnR/W4uChEKGeqQWAJ8SXFw=
-cloud.google.com/go/security v1.5.0/go.mod h1:lgxGdyOKKjHL4YG3/YwIL2zLqMFCKs0UbQwgyZmfJl4=
-cloud.google.com/go/security v1.7.0/go.mod h1:mZklORHl6Bg7CNnnjLH//0UlAlaXqiG7Lb9PsPXLfD0=
-cloud.google.com/go/security v1.8.0/go.mod h1:hAQOwgmaHhztFhiQ41CjDODdWP0+AE1B3sX4OFlq+GU=
-cloud.google.com/go/security v1.9.0/go.mod h1:6Ta1bO8LXI89nZnmnsZGp9lVoVWXqsVbIq/t9dzI+2Q=
-cloud.google.com/go/security v1.10.0/go.mod h1:QtOMZByJVlibUT2h9afNDWRZ1G96gVywH8T5GUSb9IA=
-cloud.google.com/go/security v1.12.0/go.mod h1:rV6EhrpbNHrrxqlvW0BWAIawFWq3X90SduMJdFwtLB8=
-cloud.google.com/go/security v1.13.0/go.mod h1:Q1Nvxl1PAgmeW0y3HTt54JYIvUdtcpYKVfIB8AOMZ+0=
-cloud.google.com/go/security v1.15.1/go.mod h1:MvTnnbsWnehoizHi09zoiZob0iCHVcL4AUBj76h9fXA=
-cloud.google.com/go/securitycenter v1.13.0/go.mod h1:cv5qNAqjY84FCN6Y9z28WlkKXyWsgLO832YiWwkCWcU=
-cloud.google.com/go/securitycenter v1.14.0/go.mod h1:gZLAhtyKv85n52XYWt6RmeBdydyxfPeTrpToDPw4Auc=
-cloud.google.com/go/securitycenter v1.15.0/go.mod h1:PeKJ0t8MoFmmXLXWm41JidyzI3PJjd8sXWaVqg43WWk=
-cloud.google.com/go/securitycenter v1.16.0/go.mod h1:Q9GMaLQFUD+5ZTabrbujNWLtSLZIZF7SAR0wWECrjdk=
-cloud.google.com/go/securitycenter v1.18.1/go.mod h1:0/25gAzCM/9OL9vVx4ChPeM/+DlfGQJDwBy/UC8AKK0=
-cloud.google.com/go/securitycenter v1.19.0/go.mod h1:LVLmSg8ZkkyaNy4u7HCIshAngSQ8EcIRREP3xBnyfag=
-cloud.google.com/go/securitycenter v1.23.0/go.mod h1:8pwQ4n+Y9WCWM278R8W3nF65QtY172h4S8aXyI9/hsQ=
-cloud.google.com/go/servicecontrol v1.4.0/go.mod h1:o0hUSJ1TXJAmi/7fLJAedOovnujSEvjKCAFNXPQ1RaU=
-cloud.google.com/go/servicecontrol v1.5.0/go.mod h1:qM0CnXHhyqKVuiZnGKrIurvVImCs8gmqWsDoqe9sU1s=
-cloud.google.com/go/servicecontrol v1.10.0/go.mod h1:pQvyvSRh7YzUF2efw7H87V92mxU8FnFDawMClGCNuAA=
-cloud.google.com/go/servicecontrol v1.11.0/go.mod h1:kFmTzYzTUIuZs0ycVqRHNaNhgR+UMUpw9n02l/pY+mc=
-cloud.google.com/go/servicecontrol v1.11.1/go.mod h1:aSnNNlwEFBY+PWGQ2DoM0JJ/QUXqV5/ZD9DOLB7SnUk=
-cloud.google.com/go/servicedirectory v1.4.0/go.mod h1:gH1MUaZCgtP7qQiI+F+A+OpeKF/HQWgtAddhTbhL2bs=
-cloud.google.com/go/servicedirectory v1.5.0/go.mod h1:QMKFL0NUySbpZJ1UZs3oFAmdvVxhhxB6eJ/Vlp73dfg=
-cloud.google.com/go/servicedirectory v1.6.0/go.mod h1:pUlbnWsLH9c13yGkxCmfumWEPjsRs1RlmJ4pqiNjVL4=
-cloud.google.com/go/servicedirectory v1.7.0/go.mod h1:5p/U5oyvgYGYejufvxhgwjL8UVXjkuw7q5XcG10wx1U=
-cloud.google.com/go/servicedirectory v1.8.0/go.mod h1:srXodfhY1GFIPvltunswqXpVxFPpZjf8nkKQT7XcXaY=
-cloud.google.com/go/servicedirectory v1.9.0/go.mod h1:29je5JjiygNYlmsGz8k6o+OZ8vd4f//bQLtvzkPPT/s=
-cloud.google.com/go/servicedirectory v1.10.1/go.mod h1:Xv0YVH8s4pVOwfM/1eMTl0XJ6bzIOSLDt8f8eLaGOxQ=
-cloud.google.com/go/servicedirectory v1.11.0/go.mod h1:Xv0YVH8s4pVOwfM/1eMTl0XJ6bzIOSLDt8f8eLaGOxQ=
-cloud.google.com/go/servicemanagement v1.4.0/go.mod h1:d8t8MDbezI7Z2R1O/wu8oTggo3BI2GKYbdG4y/SJTco=
-cloud.google.com/go/servicemanagement v1.5.0/go.mod h1:XGaCRe57kfqu4+lRxaFEAuqmjzF0r+gWHjWqKqBvKFo=
-cloud.google.com/go/servicemanagement v1.6.0/go.mod h1:aWns7EeeCOtGEX4OvZUWCCJONRZeFKiptqKf1D0l/Jc=
-cloud.google.com/go/servicemanagement v1.8.0/go.mod h1:MSS2TDlIEQD/fzsSGfCdJItQveu9NXnUniTrq/L8LK4=
-cloud.google.com/go/serviceusage v1.3.0/go.mod h1:Hya1cozXM4SeSKTAgGXgj97GlqUvF5JaoXacR1JTP/E=
-cloud.google.com/go/serviceusage v1.4.0/go.mod h1:SB4yxXSaYVuUBYUml6qklyONXNLt83U0Rb+CXyhjEeU=
-cloud.google.com/go/serviceusage v1.5.0/go.mod h1:w8U1JvqUqwJNPEOTQjrMHkw3IaIFLoLsPLvsE3xueec=
-cloud.google.com/go/serviceusage v1.6.0/go.mod h1:R5wwQcbOWsyuOfbP9tGdAnCAc6B9DRwPG1xtWMDeuPA=
-cloud.google.com/go/shell v1.3.0/go.mod h1:VZ9HmRjZBsjLGXusm7K5Q5lzzByZmJHf1d0IWHEN5X4=
-cloud.google.com/go/shell v1.4.0/go.mod h1:HDxPzZf3GkDdhExzD/gs8Grqk+dmYcEjGShZgYa9URw=
-cloud.google.com/go/shell v1.6.0/go.mod h1:oHO8QACS90luWgxP3N9iZVuEiSF84zNyLytb+qE2f9A=
-cloud.google.com/go/shell v1.7.1/go.mod h1:u1RaM+huXFaTojTbW4g9P5emOrrmLE69KrxqQahKn4g=
-cloud.google.com/go/spanner v1.41.0/go.mod h1:MLYDBJR/dY4Wt7ZaMIQ7rXOTLjYrmxLE/5ve9vFfWos=
-cloud.google.com/go/spanner v1.44.0/go.mod h1:G8XIgYdOK+Fbcpbs7p2fiprDw4CaZX63whnSMLVBxjk=
-cloud.google.com/go/spanner v1.45.0/go.mod h1:FIws5LowYz8YAE1J8fOS7DJup8ff7xJeetWEo5REA2M=
-cloud.google.com/go/spanner v1.47.0/go.mod h1:IXsJwVW2j4UKs0eYDqodab6HgGuA1bViSqW4uH9lfUI=
-cloud.google.com/go/speech v1.6.0/go.mod h1:79tcr4FHCimOp56lwC01xnt/WPJZc4v3gzyT7FoBkCM=
-cloud.google.com/go/speech v1.7.0/go.mod h1:KptqL+BAQIhMsj1kOP2la5DSEEerPDuOP/2mmkhHhZQ=
-cloud.google.com/go/speech v1.8.0/go.mod h1:9bYIl1/tjsAnMgKGHKmBZzXKEkGgtU+MpdDPTE9f7y0=
-cloud.google.com/go/speech v1.9.0/go.mod h1:xQ0jTcmnRFFM2RfX/U+rk6FQNUF6DQlydUSyoooSpco=
-cloud.google.com/go/speech v1.14.1/go.mod h1:gEosVRPJ9waG7zqqnsHpYTOoAS4KouMRLDFMekpJ0J0=
-cloud.google.com/go/speech v1.15.0/go.mod h1:y6oH7GhqCaZANH7+Oe0BhgIogsNInLlz542tg3VqeYI=
-cloud.google.com/go/speech v1.17.1/go.mod h1:8rVNzU43tQvxDaGvqOhpDqgkJTFowBpDvCJ14kGlJYo=
-cloud.google.com/go/speech v1.19.0/go.mod h1:8rVNzU43tQvxDaGvqOhpDqgkJTFowBpDvCJ14kGlJYo=
-cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
-cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos=
-cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
-cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
-cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
-cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
-cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y=
-cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc=
-cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s=
-cloud.google.com/go/storage v1.28.1/go.mod h1:Qnisd4CqDdo6BGs2AD5LLnEsmSQ80wQ5ogcBBKhU86Y=
-cloud.google.com/go/storage v1.29.0/go.mod h1:4puEjyTKnku6gfKoTfNOU/W+a9JyuVNxjpS5GBrB8h4=
-cloud.google.com/go/storage v1.30.1/go.mod h1:NfxhC0UJE1aXSx7CIIbCf7y9HKT7BiccwkR7+P7gN8E=
-cloud.google.com/go/storage v1.32.0/go.mod h1:Hhh/dogNRGca7IWv1RC2YqEn0c0G77ctA/OxflYkiD8=
-cloud.google.com/go/storagetransfer v1.5.0/go.mod h1:dxNzUopWy7RQevYFHewchb29POFv3/AaBgnhqzqiK0w=
-cloud.google.com/go/storagetransfer v1.6.0/go.mod h1:y77xm4CQV/ZhFZH75PLEXY0ROiS7Gh6pSKrM8dJyg6I=
-cloud.google.com/go/storagetransfer v1.7.0/go.mod h1:8Giuj1QNb1kfLAiWM1bN6dHzfdlDAVC9rv9abHot2W4=
-cloud.google.com/go/storagetransfer v1.8.0/go.mod h1:JpegsHHU1eXg7lMHkvf+KE5XDJ7EQu0GwNJbbVGanEw=
-cloud.google.com/go/storagetransfer v1.10.0/go.mod h1:DM4sTlSmGiNczmV6iZyceIh2dbs+7z2Ayg6YAiQlYfA=
-cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw=
-cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g=
-cloud.google.com/go/talent v1.3.0/go.mod h1:CmcxwJ/PKfRgd1pBjQgU6W3YBwiewmUzQYH5HHmSCmM=
-cloud.google.com/go/talent v1.4.0/go.mod h1:ezFtAgVuRf8jRsvyE6EwmbTK5LKciD4KVnHuDEFmOOA=
-cloud.google.com/go/talent v1.5.0/go.mod h1:G+ODMj9bsasAEJkQSzO2uHQWXHHXUomArjWQQYkqK6c=
-cloud.google.com/go/talent v1.6.2/go.mod h1:CbGvmKCG61mkdjcqTcLOkb2ZN1SrQI8MDyma2l7VD24=
-cloud.google.com/go/texttospeech v1.4.0/go.mod h1:FX8HQHA6sEpJ7rCMSfXuzBcysDAuWusNNNvN9FELDd8=
-cloud.google.com/go/texttospeech v1.5.0/go.mod h1:oKPLhR4n4ZdQqWKURdwxMy0uiTS1xU161C8W57Wkea4=
-cloud.google.com/go/texttospeech v1.6.0/go.mod h1:YmwmFT8pj1aBblQOI3TfKmwibnsfvhIBzPXcW4EBovc=
-cloud.google.com/go/texttospeech v1.7.1/go.mod h1:m7QfG5IXxeneGqTapXNxv2ItxP/FS0hCZBwXYqucgSk=
-cloud.google.com/go/tpu v1.3.0/go.mod h1:aJIManG0o20tfDQlRIej44FcwGGl/cD0oiRyMKG19IQ=
-cloud.google.com/go/tpu v1.4.0/go.mod h1:mjZaX8p0VBgllCzF6wcU2ovUXN9TONFLd7iz227X2Xg=
-cloud.google.com/go/tpu v1.5.0/go.mod h1:8zVo1rYDFuW2l4yZVY0R0fb/v44xLh3llq7RuV61fPM=
-cloud.google.com/go/tpu v1.6.1/go.mod h1:sOdcHVIgDEEOKuqUoi6Fq53MKHJAtOwtz0GuKsWSH3E=
-cloud.google.com/go/trace v1.3.0/go.mod h1:FFUE83d9Ca57C+K8rDl/Ih8LwOzWIV1krKgxg6N0G28=
-cloud.google.com/go/trace v1.4.0/go.mod h1:UG0v8UBqzusp+z63o7FK74SdFE+AXpCLdFb1rshXG+Y=
-cloud.google.com/go/trace v1.8.0/go.mod h1:zH7vcsbAhklH8hWFig58HvxcxyQbaIqMarMg9hn5ECA=
-cloud.google.com/go/trace v1.9.0/go.mod h1:lOQqpE5IaWY0Ixg7/r2SjixMuc6lfTFeO4QGM4dQWOk=
-cloud.google.com/go/trace v1.10.1/go.mod h1:gbtL94KE5AJLH3y+WVpfWILmqgc6dXcqgNXdOPAQTYk=
-cloud.google.com/go/translate v1.3.0/go.mod h1:gzMUwRjvOqj5i69y/LYLd8RrNQk+hOmIXTi9+nb3Djs=
-cloud.google.com/go/translate v1.4.0/go.mod h1:06Dn/ppvLD6WvA5Rhdp029IX2Mi3Mn7fpMRLPvXT5Wg=
-cloud.google.com/go/translate v1.5.0/go.mod h1:29YDSYveqqpA1CQFD7NQuP49xymq17RXNaUDdc0mNu0=
-cloud.google.com/go/translate v1.6.0/go.mod h1:lMGRudH1pu7I3n3PETiOB2507gf3HnfLV8qlkHZEyos=
-cloud.google.com/go/translate v1.7.0/go.mod h1:lMGRudH1pu7I3n3PETiOB2507gf3HnfLV8qlkHZEyos=
-cloud.google.com/go/translate v1.8.1/go.mod h1:d1ZH5aaOA0CNhWeXeC8ujd4tdCFw8XoNWRljklu5RHs=
-cloud.google.com/go/translate v1.8.2/go.mod h1:d1ZH5aaOA0CNhWeXeC8ujd4tdCFw8XoNWRljklu5RHs=
-cloud.google.com/go/video v1.8.0/go.mod h1:sTzKFc0bUSByE8Yoh8X0mn8bMymItVGPfTuUBUyRgxk=
-cloud.google.com/go/video v1.9.0/go.mod h1:0RhNKFRF5v92f8dQt0yhaHrEuH95m068JYOvLZYnJSw=
-cloud.google.com/go/video v1.12.0/go.mod h1:MLQew95eTuaNDEGriQdcYn0dTwf9oWiA4uYebxM5kdg=
-cloud.google.com/go/video v1.13.0/go.mod h1:ulzkYlYgCp15N2AokzKjy7MQ9ejuynOJdf1tR5lGthk=
-cloud.google.com/go/video v1.14.0/go.mod h1:SkgaXwT+lIIAKqWAJfktHT/RbgjSuY6DobxEp0C5yTQ=
-cloud.google.com/go/video v1.15.0/go.mod h1:SkgaXwT+lIIAKqWAJfktHT/RbgjSuY6DobxEp0C5yTQ=
-cloud.google.com/go/video v1.17.1/go.mod h1:9qmqPqw/Ib2tLqaeHgtakU+l5TcJxCJbhFXM7UJjVzU=
-cloud.google.com/go/video v1.19.0/go.mod h1:9qmqPqw/Ib2tLqaeHgtakU+l5TcJxCJbhFXM7UJjVzU=
-cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU=
-cloud.google.com/go/videointelligence v1.7.0/go.mod h1:k8pI/1wAhjznARtVT9U1llUaFNPh7muw8QyOUpavru4=
-cloud.google.com/go/videointelligence v1.8.0/go.mod h1:dIcCn4gVDdS7yte/w+koiXn5dWVplOZkE+xwG9FgK+M=
-cloud.google.com/go/videointelligence v1.9.0/go.mod h1:29lVRMPDYHikk3v8EdPSaL8Ku+eMzDljjuvRs105XoU=
-cloud.google.com/go/videointelligence v1.10.0/go.mod h1:LHZngX1liVtUhZvi2uNS0VQuOzNi2TkY1OakiuoUOjU=
-cloud.google.com/go/videointelligence v1.11.1/go.mod h1:76xn/8InyQHarjTWsBR058SmlPCwQjgcvoW0aZykOvo=
-cloud.google.com/go/vision v1.2.0/go.mod h1:SmNwgObm5DpFBme2xpyOyasvBc1aPdjvMk2bBk0tKD0=
-cloud.google.com/go/vision/v2 v2.2.0/go.mod h1:uCdV4PpN1S0jyCyq8sIM42v2Y6zOLkZs+4R9LrGYwFo=
-cloud.google.com/go/vision/v2 v2.3.0/go.mod h1:UO61abBx9QRMFkNBbf1D8B1LXdS2cGiiCRx0vSpZoUo=
-cloud.google.com/go/vision/v2 v2.4.0/go.mod h1:VtI579ll9RpVTrdKdkMzckdnwMyX2JILb+MhPqRbPsY=
-cloud.google.com/go/vision/v2 v2.5.0/go.mod h1:MmaezXOOE+IWa+cS7OhRRLK2cNv1ZL98zhqFFZaaH2E=
-cloud.google.com/go/vision/v2 v2.6.0/go.mod h1:158Hes0MvOS9Z/bDMSFpjwsUrZ5fPrdwuyyvKSGAGMY=
-cloud.google.com/go/vision/v2 v2.7.0/go.mod h1:H89VysHy21avemp6xcf9b9JvZHVehWbET0uT/bcuY/0=
-cloud.google.com/go/vision/v2 v2.7.2/go.mod h1:jKa8oSYBWhYiXarHPvP4USxYANYUEdEsQrloLjrSwJU=
-cloud.google.com/go/vmmigration v1.2.0/go.mod h1:IRf0o7myyWFSmVR1ItrBSFLFD/rJkfDCUTO4vLlJvsE=
-cloud.google.com/go/vmmigration v1.3.0/go.mod h1:oGJ6ZgGPQOFdjHuocGcLqX4lc98YQ7Ygq8YQwHh9A7g=
-cloud.google.com/go/vmmigration v1.5.0/go.mod h1:E4YQ8q7/4W9gobHjQg4JJSgXXSgY21nA5r8swQV+Xxc=
-cloud.google.com/go/vmmigration v1.6.0/go.mod h1:bopQ/g4z+8qXzichC7GW1w2MjbErL54rk3/C843CjfY=
-cloud.google.com/go/vmmigration v1.7.1/go.mod h1:WD+5z7a/IpZ5bKK//YmT9E047AD+rjycCAvyMxGJbro=
-cloud.google.com/go/vmwareengine v0.1.0/go.mod h1:RsdNEf/8UDvKllXhMz5J40XxDrNJNN4sagiox+OI208=
-cloud.google.com/go/vmwareengine v0.2.2/go.mod h1:sKdctNJxb3KLZkE/6Oui94iw/xs9PRNC2wnNLXsHvH8=
-cloud.google.com/go/vmwareengine v0.3.0/go.mod h1:wvoyMvNWdIzxMYSpH/R7y2h5h3WFkx6d+1TIsP39WGY=
-cloud.google.com/go/vmwareengine v0.4.1/go.mod h1:Px64x+BvjPZwWuc4HdmVhoygcXqEkGHXoa7uyfTgSI0=
-cloud.google.com/go/vmwareengine v1.0.0/go.mod h1:Px64x+BvjPZwWuc4HdmVhoygcXqEkGHXoa7uyfTgSI0=
-cloud.google.com/go/vpcaccess v1.4.0/go.mod h1:aQHVbTWDYUR1EbTApSVvMq1EnT57ppDmQzZ3imqIk4w=
-cloud.google.com/go/vpcaccess v1.5.0/go.mod h1:drmg4HLk9NkZpGfCmZ3Tz0Bwnm2+DKqViEpeEpOq0m8=
-cloud.google.com/go/vpcaccess v1.6.0/go.mod h1:wX2ILaNhe7TlVa4vC5xce1bCnqE3AeH27RV31lnmZes=
-cloud.google.com/go/vpcaccess v1.7.1/go.mod h1:FogoD46/ZU+JUBX9D606X21EnxiszYi2tArQwLY4SXs=
-cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xXZmFiHmGE=
-cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg=
-cloud.google.com/go/webrisk v1.6.0/go.mod h1:65sW9V9rOosnc9ZY7A7jsy1zoHS5W9IAXv6dGqhMQMc=
-cloud.google.com/go/webrisk v1.7.0/go.mod h1:mVMHgEYH0r337nmt1JyLthzMr6YxwN1aAIEc2fTcq7A=
-cloud.google.com/go/webrisk v1.8.0/go.mod h1:oJPDuamzHXgUc+b8SiHRcVInZQuybnvEW72PqTc7sSg=
-cloud.google.com/go/webrisk v1.9.1/go.mod h1:4GCmXKcOa2BZcZPn6DCEvE7HypmEJcJkr4mtM+sqYPc=
-cloud.google.com/go/websecurityscanner v1.3.0/go.mod h1:uImdKm2wyeXQevQJXeh8Uun/Ym1VqworNDlBXQevGMo=
-cloud.google.com/go/websecurityscanner v1.4.0/go.mod h1:ebit/Fp0a+FWu5j4JOmJEV8S8CzdTkAS77oDsiSqYWQ=
-cloud.google.com/go/websecurityscanner v1.5.0/go.mod h1:Y6xdCPy81yi0SQnDY1xdNTNpfY1oAgXUlcfN3B3eSng=
-cloud.google.com/go/websecurityscanner v1.6.1/go.mod h1:Njgaw3rttgRHXzwCB8kgCYqv5/rGpFCsBOvPbYgszpg=
-cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0=
-cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M=
-cloud.google.com/go/workflows v1.8.0/go.mod h1:ysGhmEajwZxGn1OhGOGKsTXc5PyxOc0vfKf5Af+to4M=
-cloud.google.com/go/workflows v1.9.0/go.mod h1:ZGkj1aFIOd9c8Gerkjjq7OW7I5+l6cSvT3ujaO/WwSA=
-cloud.google.com/go/workflows v1.10.0/go.mod h1:fZ8LmRmZQWacon9UCX1r/g/DfAXx5VcPALq2CxzdePw=
-cloud.google.com/go/workflows v1.11.1/go.mod h1:Z+t10G1wF7h8LgdY/EmRcQY8ptBD/nvofaL6FqlET6g=
-dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
-gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8=
-git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc=
-github.com/Azure/azure-pipeline-go v0.2.3/go.mod h1:x841ezTBIMG6O3lAcl8ATHnsOPVl2bqk7S3ta6S6u4k=
-github.com/Azure/azure-storage-blob-go v0.14.0/go.mod h1:SMqIBi+SuiQH32bvyjngEewEeXoPfKMgWlBDaYf6fck=
-github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8=
-github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
-github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
-github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M=
-github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74=
-github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k=
-github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8=
-github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU=
+cloud.google.com/go v0.112.2 h1:ZaGT6LiG7dBzi6zNOvVZwacaXlmf3lRqnC4DQzqyRQw=
+cloud.google.com/go v0.112.2/go.mod h1:iEqjp//KquGIJV/m+Pk3xecgKNhV+ry+vVTsy4TbDms=
+cloud.google.com/go/auth v0.3.0 h1:PRyzEpGfx/Z9e8+lHsbkoUVXD0gnu4MNmm7Gp8TQNIs=
+cloud.google.com/go/auth v0.3.0/go.mod h1:lBv6NKTWp8E3LPzmO1TbiiRKc4drLOfHsgmlH9ogv5w=
+cloud.google.com/go/auth/oauth2adapt v0.2.2 h1:+TTV8aXpjeChS9M+aTtN/TjdQnzJvmzKFt//oWu7HX4=
+cloud.google.com/go/auth/oauth2adapt v0.2.2/go.mod h1:wcYjgpZI9+Yu7LyYBg4pqSiaRkfEK3GQcpb7C/uyF1Q=
+cloud.google.com/go/compute v1.25.1 h1:ZRpHJedLtTpKgr3RV1Fx23NuaAEN1Zfx9hw1u4aJdjU=
+cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc=
+cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k=
+cloud.google.com/go/iam v1.1.7 h1:z4VHOhwKLF/+UYXAJDFwGtNF0b6gjsW1Pk9Ml0U/IoM=
+cloud.google.com/go/iam v1.1.7/go.mod h1:J4PMPg8TtyurAUvSmPj8FF3EDgY1SPRZxcUGrn7WXGA=
+cloud.google.com/go/storage v1.39.1 h1:MvraqHKhogCOTXTlct/9C3K3+Uy2jBmFYb3/Sp6dVtY=
+cloud.google.com/go/storage v1.39.1/go.mod h1:xK6xZmxZmo+fyP7+DEF6FhNc24/JAe95OLyOHCXFH1o=
+filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
+filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
+github.com/AlecAivazis/survey/v2 v2.3.7 h1:6I/u8FvytdGsgonrYsVn2t8t4QiRnh6QSTqkkhIiSjQ=
+github.com/AlecAivazis/survey/v2 v2.3.7/go.mod h1:xUTIdE4KCOIjsBAE1JYsUPoCqYdZ1reCfTwbto0Fduo=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
-github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
-github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk=
-github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA=
-github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY=
-github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
-github.com/RoaringBitmap/roaring v1.6.0 h1:dc7kRiroETgJcHhWX6BerXkZz2b3JgLGg9nTURJL/og=
-github.com/RoaringBitmap/roaring v1.6.0/go.mod h1:plvDsJQpxOC5bw8LRteu/MLWHsHez/3y6cubLI4/1yE=
-github.com/ajstarks/deck v0.0.0-20200831202436-30c9fc6549a9/go.mod h1:JynElWSGnm/4RlzPXRlREEwqTHAN3T56Bv2ITsFT3gY=
-github.com/ajstarks/deck/generate v0.0.0-20210309230005-c3f852c02e19/go.mod h1:T13YZdzov6OU0A1+RfKZiZN9ca6VeKdBdyDV+BY97Tk=
-github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw=
-github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM=
-github.com/alecthomas/assert/v2 v2.1.0 h1:tbredtNcQnoSd3QBhQWI7QZ3XHOVkw1Moklp2ojoH/0=
-github.com/alecthomas/kingpin/v2 v2.3.1/go.mod h1:oYL5vtsvEHZGHxU7DMp32Dvx+qL+ptGn6lWaot2vCNE=
-github.com/alecthomas/kong v0.8.1 h1:acZdn3m4lLRobeh3Zi2S2EpnXTd1mOL6U7xVml+vfkY=
-github.com/alecthomas/kong v0.8.1/go.mod h1:n1iCIO2xS46oE8ZfYCNDqdR0b0wZNrXAIAqro/2132U=
-github.com/alecthomas/kong-yaml v0.2.0 h1:iiVVqVttmOsHKawlaW/TljPsjaEv1O4ODx6dloSA58Y=
-github.com/alecthomas/kong-yaml v0.2.0/go.mod h1:vMvOIy+wpB49MCZ0TA3KMts38Mu9YfRP03Q1StN69/g=
-github.com/alecthomas/repr v0.1.0 h1:ENn2e1+J3k09gyj2shc0dHr/yjaWSHRlrJ4DPMevDqE=
-github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
-github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
-github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
-github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
-github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
-github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE=
-github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
-github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
-github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20220816024939-bc8df83d7b9d h1:0xIrH2lJbraclvJT3pvTf3u2oCAL60cAqiv4qRpz4EI=
-github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20220816024939-bc8df83d7b9d/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY=
-github.com/apache/arrow/go/v10 v10.0.1/go.mod h1:YvhnlEePVnBS4+0z3fhPfUy7W1Ikj0Ih0vcRo/gZ1M0=
-github.com/apache/arrow/go/v11 v11.0.0/go.mod h1:Eg5OsL5H+e299f7u5ssuXsuHQVEGC4xei5aX110hRiI=
-github.com/apache/arrow/go/v12 v12.0.0/go.mod h1:d+tV/eHZZ7Dz7RPrFKtPK02tpr+c9/PEd/zm8mDS9Vg=
-github.com/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU=
-github.com/arangodb/go-driver v1.6.0 h1:NFWj/idqXZxhFVueihMSI2R9NotNIsgvNfM/xmpekb4=
-github.com/arangodb/go-driver v1.6.0/go.mod h1:HQmdGkvNMVBTE3SIPSQ8T/ZddC6iwNsfMR+dDJQxIsI=
-github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e h1:Xg+hGrY2LcQBbxd0ZFdbGSyRKTYMZCfBbw/pMJFOk1g=
-github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e/go.mod h1:mq7Shfa/CaixoDxiyAAc5jZ6CVBAyPaNQCGS7mkj4Ho=
-github.com/aws/aws-sdk-go v1.45.1/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
-github.com/aws/aws-sdk-go v1.46.2 h1:XZbOmjtN1VCfEtQq7QNFsbxIqO+bB+bRhiOBjp6AzWc=
-github.com/aws/aws-sdk-go v1.46.2/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
-github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
-github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
-github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
-github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
-github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA=
-github.com/bits-and-blooms/bitset v1.10.0 h1:ePXTeiPEazB5+opbv5fr8umg2R/1NlzgDsyepwsSr88=
-github.com/bits-and-blooms/bitset v1.10.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8=
-github.com/blevesearch/bleve/v2 v2.3.10 h1:z8V0wwGoL4rp7nG/O3qVVLYxUqCbEwskMt4iRJsPLgg=
-github.com/blevesearch/bleve/v2 v2.3.10/go.mod h1:RJzeoeHC+vNHsoLR54+crS1HmOWpnH87fL70HAUCzIA=
-github.com/blevesearch/bleve_index_api v1.0.6 h1:gyUUxdsrvmW3jVhhYdCVL6h9dCjNT/geNU7PxGn37p8=
-github.com/blevesearch/bleve_index_api v1.0.6/go.mod h1:YXMDwaXFFXwncRS8UobWs7nvo0DmusriM1nztTlj1ms=
-github.com/blevesearch/geo v0.1.18 h1:Np8jycHTZ5scFe7VEPLrDoHnnb9C4j636ue/CGrhtDw=
-github.com/blevesearch/geo v0.1.18/go.mod h1:uRMGWG0HJYfWfFJpK3zTdnnr1K+ksZTuWKhXeSokfnM=
-github.com/blevesearch/go-porterstemmer v1.0.3 h1:GtmsqID0aZdCSNiY8SkuPJ12pD4jI+DdXTAn4YRcHCo=
-github.com/blevesearch/go-porterstemmer v1.0.3/go.mod h1:angGc5Ht+k2xhJdZi511LtmxuEf0OVpvUUNrwmM1P7M=
-github.com/blevesearch/gtreap v0.1.1 h1:2JWigFrzDMR+42WGIN/V2p0cUvn4UP3C4Q5nmaZGW8Y=
-github.com/blevesearch/gtreap v0.1.1/go.mod h1:QaQyDRAT51sotthUWAH4Sj08awFSSWzgYICSZ3w0tYk=
-github.com/blevesearch/mmap-go v1.0.4 h1:OVhDhT5B/M1HNPpYPBKIEJaD0F3Si+CrEKULGCDPWmc=
-github.com/blevesearch/mmap-go v1.0.4/go.mod h1:EWmEAOmdAS9z/pi/+Toxu99DnsbhG1TIxUoRmJw/pSs=
-github.com/blevesearch/scorch_segment_api/v2 v2.1.6 h1:CdekX/Ob6YCYmeHzD72cKpwzBjvkOGegHOqhAkXp6yA=
-github.com/blevesearch/scorch_segment_api/v2 v2.1.6/go.mod h1:nQQYlp51XvoSVxcciBjtvuHPIVjlWrN1hX4qwK2cqdc=
-github.com/blevesearch/segment v0.9.1 h1:+dThDy+Lvgj5JMxhmOVlgFfkUtZV2kw49xax4+jTfSU=
-github.com/blevesearch/segment v0.9.1/go.mod h1:zN21iLm7+GnBHWTao9I+Au/7MBiL8pPFtJBJTsk6kQw=
-github.com/blevesearch/snowballstem v0.9.0 h1:lMQ189YspGP6sXvZQ4WZ+MLawfV8wOmPoD/iWeNXm8s=
-github.com/blevesearch/snowballstem v0.9.0/go.mod h1:PivSj3JMc8WuaFkTSRDW2SlrulNWPl4ABg1tC/hlgLs=
-github.com/blevesearch/upsidedown_store_api v1.0.2 h1:U53Q6YoWEARVLd1OYNc9kvhBMGZzVrdmaozG2MfoB+A=
-github.com/blevesearch/upsidedown_store_api v1.0.2/go.mod h1:M01mh3Gpfy56Ps/UXHjEO/knbqyQ1Oamg8If49gRwrQ=
-github.com/blevesearch/vellum v1.0.10 h1:HGPJDT2bTva12hrHepVT3rOyIKFFF4t7Gf6yMxyMIPI=
-github.com/blevesearch/vellum v1.0.10/go.mod h1:ul1oT0FhSMDIExNjIxHqJoGpVrBpKCdgDQNxfqgJt7k=
-github.com/blevesearch/zapx/v11 v11.3.10 h1:hvjgj9tZ9DeIqBCxKhi70TtSZYMdcFn7gDb71Xo/fvk=
-github.com/blevesearch/zapx/v11 v11.3.10/go.mod h1:0+gW+FaE48fNxoVtMY5ugtNHHof/PxCqh7CnhYdnMzQ=
-github.com/blevesearch/zapx/v12 v12.3.10 h1:yHfj3vXLSYmmsBleJFROXuO08mS3L1qDCdDK81jDl8s=
-github.com/blevesearch/zapx/v12 v12.3.10/go.mod h1:0yeZg6JhaGxITlsS5co73aqPtM04+ycnI6D1v0mhbCs=
-github.com/blevesearch/zapx/v13 v13.3.10 h1:0KY9tuxg06rXxOZHg3DwPJBjniSlqEgVpxIqMGahDE8=
-github.com/blevesearch/zapx/v13 v13.3.10/go.mod h1:w2wjSDQ/WBVeEIvP0fvMJZAzDwqwIEzVPnCPrz93yAk=
-github.com/blevesearch/zapx/v14 v14.3.10 h1:SG6xlsL+W6YjhX5N3aEiL/2tcWh3DO75Bnz77pSwwKU=
-github.com/blevesearch/zapx/v14 v14.3.10/go.mod h1:qqyuR0u230jN1yMmE4FIAuCxmahRQEOehF78m6oTgns=
-github.com/blevesearch/zapx/v15 v15.3.13 h1:6EkfaZiPlAxqXz0neniq35my6S48QI94W/wyhnpDHHQ=
-github.com/blevesearch/zapx/v15 v15.3.13/go.mod h1:Turk/TNRKj9es7ZpKK95PS7f6D44Y7fAFy8F4LXQtGg=
-github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c=
-github.com/bmizerany/pat v0.0.0-20210406213842-e4b6760bdd6f h1:gOO/tNZMjjvTKZWpY7YnXC72ULNLErRtp94LountVE8=
-github.com/bmizerany/pat v0.0.0-20210406213842-e4b6760bdd6f/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c=
-github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
-github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
+github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2 h1:+vx7roKuyA63nhn5WAunQHLTznkw5W8b1Xc0dNjp83s=
+github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2/go.mod h1:HBCaDeC1lPdgDeDbhX8XFpy1jqjK0IBG8W5K+xYqA0w=
+github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg=
+github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
+github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
+github.com/aws/aws-sdk-go v1.51.11 h1:El5VypsMIz7sFwAAj/j06JX9UGs4KAbAIEaZ57bNY4s=
+github.com/aws/aws-sdk-go v1.51.11/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
+github.com/aws/aws-sdk-go-v2 v1.26.1 h1:5554eUqIYVWpU0YmeeYZ0wU64H2VLBs8TlhRB2L+EkA=
+github.com/aws/aws-sdk-go-v2 v1.26.1/go.mod h1:ffIFB97e2yNsv4aTSGkqtHnppsIJzw7G7BReUZ3jCXM=
+github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2 h1:x6xsQXGSmW6frevwDA+vi/wqhp1ct18mVXYN08/93to=
+github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2/go.mod h1:lPprDr1e6cJdyYeGXnRaJoP4Md+cDBvi2eOj00BlGmg=
+github.com/aws/aws-sdk-go-v2/config v1.27.11 h1:f47rANd2LQEYHda2ddSCKYId18/8BhSRM4BULGmfgNA=
+github.com/aws/aws-sdk-go-v2/config v1.27.11/go.mod h1:SMsV78RIOYdve1vf36z8LmnszlRWkwMQtomCAI0/mIE=
+github.com/aws/aws-sdk-go-v2/credentials v1.17.11 h1:YuIB1dJNf1Re822rriUOTxopaHHvIq0l/pX3fwO+Tzs=
+github.com/aws/aws-sdk-go-v2/credentials v1.17.11/go.mod h1:AQtFPsDH9bI2O+71anW6EKL+NcD7LG3dpKGMV4SShgo=
+github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.1 h1:FVJ0r5XTHSmIHJV6KuDmdYhEpvlHpiSd38RQWhut5J4=
+github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.1/go.mod h1:zusuAeqezXzAB24LGuzuekqMAEgWkVYukBec3kr3jUg=
+github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.16.15 h1:7Zwtt/lP3KNRkeZre7soMELMGNoBrutx8nobg1jKWmo=
+github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.16.15/go.mod h1:436h2adoHb57yd+8W+gYPrrA9U/R/SuAuOO42Ushzhw=
+github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.5 h1:aw39xVGeRWlWx9EzGVnhOR4yOjQDHPQ6o6NmBlscyQg=
+github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.5/go.mod h1:FSaRudD0dXiMPK2UjknVwwTYyZMRsHv3TtkabsZih5I=
+github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.5 h1:PG1F3OD1szkuQPzDw3CIQsRIrtTlUC3lP84taWzHlq0=
+github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.5/go.mod h1:jU1li6RFryMz+so64PpKtudI+QzbKoIEivqdf6LNpOc=
+github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU=
+github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod h1:8tu/lYfQfFe6IGnaOdrpVgEL2IrrDOf6/m9RQum4NkY=
+github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.5 h1:81KE7vaZzrl7yHBYHVEzYB8sypz11NMOZ40YlWvPxsU=
+github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.5/go.mod h1:LIt2rg7Mcgn09Ygbdh/RdIm0rQ+3BNkbP1gyVMFtRK0=
+github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 h1:Ji0DY1xUsUr3I8cHps0G+XM3WWU16lP6yG8qu1GAZAs=
+github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2/go.mod h1:5CsjAbs3NlGQyZNFACh+zztPDI7fU6eW9QsxjfnuBKg=
+github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.7 h1:ZMeFZ5yk+Ek+jNr1+uwCd2tG89t6oTS5yVWpa6yy2es=
+github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.7/go.mod h1:mxV05U+4JiHqIpGqqYXOHLPKUC6bDXC44bsUhNjOEwY=
+github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.7 h1:ogRAwT1/gxJBcSWDMZlgyFUM962F51A5CRhDLbxLdmo=
+github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.7/go.mod h1:YCsIZhXfRPLFFCl5xxY+1T9RKzOKjCut+28JSX2DnAk=
+github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.5 h1:f9RyWNtS8oH7cZlbn+/JNPpjUk5+5fLd5lM9M0i49Ys=
+github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.5/go.mod h1:h5CoMZV2VF297/VLhRhO1WF+XYWOzXo+4HsObA4HjBQ=
+github.com/aws/aws-sdk-go-v2/service/s3 v1.53.1 h1:6cnno47Me9bRykw9AEv9zkXE+5or7jz8TsskTTccbgc=
+github.com/aws/aws-sdk-go-v2/service/s3 v1.53.1/go.mod h1:qmdkIIAC+GCLASF7R2whgNrJADz0QZPX+Seiw/i4S3o=
+github.com/aws/aws-sdk-go-v2/service/sso v1.20.5 h1:vN8hEbpRnL7+Hopy9dzmRle1xmDc7o8tmY0klsr175w=
+github.com/aws/aws-sdk-go-v2/service/sso v1.20.5/go.mod h1:qGzynb/msuZIE8I75DVRCUXw3o3ZyBmUvMwQ2t/BrGM=
+github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.4 h1:Jux+gDDyi1Lruk+KHF91tK2KCuY61kzoCpvtvJJBtOE=
+github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.4/go.mod h1:mUYPBhaF2lGiukDEjJX2BLRRKTmoUSitGDUgM4tRxak=
+github.com/aws/aws-sdk-go-v2/service/sts v1.28.6 h1:cwIxeBttqPN3qkaAjcEcsh8NYr8n2HZPkcKgPAi1phU=
+github.com/aws/aws-sdk-go-v2/service/sts v1.28.6/go.mod h1:FZf1/nKNEkHdGGJP/cI2MoIMquumuRK6ol3QQJNDxmw=
+github.com/aws/smithy-go v1.20.2 h1:tbp628ireGtzcHDDmLT/6ADHidqnwgF57XOXZe6tp4Q=
+github.com/aws/smithy-go v1.20.2/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E=
+github.com/brianvoe/gofakeit/v7 v7.0.3 h1:tGCt+eYfhTMWE1ko5G2EO1f/yE44yNpIwUb4h32O0wo=
+github.com/brianvoe/gofakeit/v7 v7.0.3/go.mod h1:QXuPeBw164PJCzCUZVmgpgHJ3Llj49jSLVkKPMtxtxA=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
-github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
-github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw=
-github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
-github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
-github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
-github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
-github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
-github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
-github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
-github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
-github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
-github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI=
-github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI=
-github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
-github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
-github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
-github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
-github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
-github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
-github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
-github.com/cncf/xds/go v0.0.0-20230310173818-32f1caf87195/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
-github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
-github.com/containerd/containerd v1.6.26 h1:VVfrE6ZpyisvB1fzoY8Vkiq4sy+i5oF4uk7zu03RaHs=
-github.com/containerd/containerd v1.6.26/go.mod h1:I4TRdsdoo5MlKob5khDJS2EPT1l1oMNaE2MBm6FrwxM=
-github.com/coreos/go-oidc/v3 v3.7.0 h1:FTdj0uexT4diYIPlF4yoFVI5MRO1r5+SEcIpEw9vC0o=
-github.com/coreos/go-oidc/v3 v3.7.0/go.mod h1:yQzSCqBnK3e6Fs5l+f5i0F8Kwf0zpH9bPEsbY00KanM=
-github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
+github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
+github.com/creack/pty v1.1.17 h1:QeVUsEDNrLBW4tMgZHvxy18sKtr6VI492kBhUfhDJNI=
+github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug=
-github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
-github.com/docker/docker v17.12.0-ce-rc1.0.20201201034508-7d75c1d40d88+incompatible h1:rsPfdypSNWulLrsXo3WiBdlNQpokgBqfWLjEa/aXiBc=
-github.com/docker/docker v17.12.0-ce-rc1.0.20201201034508-7d75c1d40d88+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
-github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=
-github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
-github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw=
-github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
-github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
-github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
+github.com/disintegration/imaging v1.6.2 h1:w1LecBlG2Lnp8B3jk5zSuNqd7b4DXhcjwek1ei82L+c=
+github.com/disintegration/imaging v1.6.2/go.mod h1:44/5580QXChDfwIclfc/PCwrr44amcmDAg8hxG0Ewe4=
+github.com/domodwyer/mailyak/v3 v3.6.2 h1:x3tGMsyFhTCaxp6ycgR0FE/bu5QiNp+hetUuCOBXMn8=
+github.com/domodwyer/mailyak/v3 v3.6.2/go.mod h1:lOm/u9CyCVWHeaAmHIdF4RiKVxKUT/H5XX10lIKAL6c=
+github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
-github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po=
-github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
-github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
-github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
-github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0=
-github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE=
-github.com/envoyproxy/go-control-plane v0.10.3/go.mod h1:fJJn/j26vwOu972OllsvAgJJM//w9BV6Fxbg2LuVd34=
-github.com/envoyproxy/go-control-plane v0.11.0/go.mod h1:VnHyVMpzcLvCFt9yUz1UnCwHLhwx1WguiVDV7pTG/tI=
-github.com/envoyproxy/go-control-plane v0.11.1-0.20230524094728-9239064ad72f/go.mod h1:sfYdkwUW4BA3PbKjySwjJy+O4Pu0h62rlqCMHNk+K+Q=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
-github.com/envoyproxy/protoc-gen-validate v0.6.7/go.mod h1:dyJXwwfPK2VSqiB9Klm1J6romD608Ba7Hij42vrOBCo=
-github.com/envoyproxy/protoc-gen-validate v0.9.1/go.mod h1:OKNgG7TCp5pF4d6XftA0++PMirau2/yoOwVac3AbF2w=
-github.com/envoyproxy/protoc-gen-validate v0.10.0/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss=
-github.com/envoyproxy/protoc-gen-validate v0.10.1/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss=
-github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ=
-github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
-github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
-github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k=
-github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
-github.com/go-chi/chi/v5 v5.0.10 h1:rLz5avzKpjqxrYwXNfmjkrYYXOyLJd37pz53UFHC6vk=
-github.com/go-chi/chi/v5 v5.0.10/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
-github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g=
-github.com/go-fonts/latin-modern v0.2.0/go.mod h1:rQVLdDMK+mK1xscDwsqM5J8U2jrRa3T0ecnM9pNujks=
-github.com/go-fonts/liberation v0.1.1/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY=
-github.com/go-fonts/liberation v0.2.0/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY=
-github.com/go-fonts/stix v0.1.0/go.mod h1:w/c1f0ldAUlJmLBvlbkvVXLAD+tAMqobIIQpmnUIzUY=
-github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
-github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
-github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
-github.com/go-jose/go-jose/v3 v3.0.3 h1:fFKWeig/irsp7XD2zBxvnmA/XaRWp5V3CBsZXJF7G7k=
-github.com/go-jose/go-jose/v3 v3.0.3/go.mod h1:5b+7YgP7ZICgJDBdfjZaIt+H/9L9T/YQrVfLAMboGkQ=
-github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
-github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
-github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
-github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0=
-github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0=
-github.com/go-latex/latex v0.0.0-20210118124228-b3d85cf34e07/go.mod h1:CO1AlKB2CSIqUrmQPqA0gdRIlnLEY0gK5JGjh37zN5U=
-github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81/go.mod h1:SX0U8uGpxhq9o2S/CELCSUxEWWAuoCUcVCQWv7G2OCk=
-github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
-github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
-github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
-github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
-github.com/go-pdf/fpdf v0.5.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M=
-github.com/go-pdf/fpdf v0.6.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M=
-github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
-github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU=
-github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM=
-github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og=
-github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw=
-github.com/gobwas/ws v1.3.0 h1:sbeU3Y4Qzlb+MOzIe6mQGf7QR4Hkv6ZD0qhGkBFL2O0=
-github.com/gobwas/ws v1.3.0/go.mod h1:hRKAFb8wOxFROYNsT1bqfWnhX+b5MFeJM9r2ZSwg/KY=
-github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
-github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
-github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
-github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
-github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
-github.com/golang/geo v0.0.0-20230421003525-6adc56603217 h1:HKlyj6in2JV6wVkmQ4XmG/EIm+SCYlPZ+V4GWit7Z+I=
-github.com/golang/geo v0.0.0-20230421003525-6adc56603217/go.mod h1:8wI0hitZ3a1IxZfeH3/5I97CI8i5cLGsYe7xNhQGs9U=
+github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
+github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
+github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
+github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
+github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
+github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
+github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0=
+github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk=
+github.com/ganigeorgiev/fexpr v0.4.0 h1:ojitI+VMNZX/odeNL1x3RzTTE8qAIVvnSSYPNAnQFDI=
+github.com/ganigeorgiev/fexpr v0.4.0/go.mod h1:RyGiGqmeXhEQ6+mlGdnUleLHgtzzu/VGO2WtJkF5drE=
+github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
+github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
+github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
+github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
+github.com/go-ozzo/ozzo-validation/v4 v4.3.0 h1:byhDUpfEwjsVQb1vBunvIjh2BHQ9ead57VkAEY4V+Es=
+github.com/go-ozzo/ozzo-validation/v4 v4.3.0/go.mod h1:2NKgrcHl3z6cJs+3Oo940FPRiTzuqKbvfrL2RxCj6Ew=
+github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
+github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y=
+github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
+github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
+github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
+github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg=
+github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
-github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4=
-github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ=
-github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
-github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
+github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
-github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
-github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
-github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
-github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
-github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
-github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
-github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8=
-github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
-github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
-github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
-github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
-github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk=
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
-github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
-github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
-github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM=
-github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
-github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
-github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
-github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
-github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
-github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
-github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
-github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
-github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
+github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
+github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
-github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
-github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
-github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
-github.com/google/go-pkcs11 v0.2.0/go.mod h1:6eQoGcuNJpa7jnd5pMGdkSaQpNDYvPlXWMcjXXThLlY=
-github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
-github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
-github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
-github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
-github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk=
-github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk=
-github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
-github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
-github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
-github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
-github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
-github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
-github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
-github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
-github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
-github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
-github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
-github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
-github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
-github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
-github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
-github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
-github.com/google/s2a-go v0.1.0/go.mod h1:OJpEgntRZo8ugHpF9hkoLJbS5dSI20XZeXJ9JVywLlM=
-github.com/google/s2a-go v0.1.3/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A=
-github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A=
-github.com/google/s2a-go v0.1.5/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A=
+github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
+github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
+github.com/google/pprof v0.0.0-20240409012703-83162a5b38cd h1:gbpYu9NMq8jhDVbvlGkMFWCjLFlqqEZjEmObmhUy6Vo=
+github.com/google/pprof v0.0.0-20240409012703-83162a5b38cd/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw=
+github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o=
+github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
-github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
-github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
-github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4=
-github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
-github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8=
-github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8=
-github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg=
-github.com/googleapis/enterprise-certificate-proxy v0.2.1/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k=
-github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k=
-github.com/googleapis/enterprise-certificate-proxy v0.2.4/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k=
-github.com/googleapis/enterprise-certificate-proxy v0.2.5/go.mod h1:RxW0N9901Cko1VOCW3SXCpWP+mlIEkk2tP7jnHy9a3w=
-github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
-github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
-github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0=
-github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM=
-github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM=
-github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM=
-github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c=
-github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo=
-github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY=
-github.com/googleapis/gax-go/v2 v2.7.0/go.mod h1:TEop28CZZQ2y+c0VxMUmu1lV+fQx57QpBWsYpwqHJx8=
-github.com/googleapis/gax-go/v2 v2.7.1/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI=
-github.com/googleapis/gax-go/v2 v2.8.0/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI=
-github.com/googleapis/gax-go/v2 v2.10.0/go.mod h1:4UOEnMCrxsSqQ940WnTiD6qJ63le2ev3xfyagutxiPw=
-github.com/googleapis/gax-go/v2 v2.11.0/go.mod h1:DxmR61SGKkGLa2xigwuZIQpkCI2S5iydzRfb3peWZJI=
-github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU=
-github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4=
-github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g=
-github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4=
-github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
-github.com/gorilla/schema v1.2.0 h1:YufUaxZYCKGFuAq3c96BOhjgd5nmXiOY9NGzF247Tsc=
-github.com/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ=
-github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4=
-github.com/gorilla/sessions v1.2.1 h1:DHd3rPN5lE3Ts3D8rKkQ8x/0kqfeNmBAaiSi+o7FsgI=
-github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM=
-github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8=
-github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
-github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks=
-github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w=
-github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI=
-github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
-github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
-github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
-github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
-github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI=
-github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
-github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
-github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
-github.com/icza/dyno v0.0.0-20230330125955-09f820a8d9c0 h1:nHoRIX8iXob3Y2kdt9KsjyIb7iApSvb3vgsd93xb5Ow=
-github.com/icza/dyno v0.0.0-20230330125955-09f820a8d9c0/go.mod h1:c1tRKs5Tx7E2+uHGSyyncziFjvGpgv4H2HrqXeUQ/Uk=
-github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4=
-github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY=
+github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
+github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/google/wire v0.6.0 h1:HBkoIh4BdSxoyo9PveV8giw7ZsaBOvzWKfcg/6MrVwI=
+github.com/google/wire v0.6.0/go.mod h1:F4QhpQ9EDIdJ1Mbop/NZBRB+5yrR6qg3BnctaoUk6NA=
+github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs=
+github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0=
+github.com/googleapis/gax-go/v2 v2.12.3 h1:5/zPPDvw8Q1SuXjrqrZslrqT7dL/uJT2CQii/cLCKqA=
+github.com/googleapis/gax-go/v2 v2.12.3/go.mod h1:AKloxT6GtNbaLm8QTNSidHUVsHYcBHwWRvkNFJUQcS4=
+github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
+github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
+github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec h1:qv2VnGeEQHchGaZ/u7lxST/RaJw+cv273q79D81Xbog=
+github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec/go.mod h1:Q48J4R4DvxnHolD5P8pOtXigYlRuPLGl6moFx3ulM68=
+github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
+github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
-github.com/jonas-plum/maut v0.0.0-20221105155335-ed984fd96915 h1:KMj2qGSB7YUIaUftqWASPI+ggVelUlXYppv1DA/CCD0=
-github.com/jonas-plum/maut v0.0.0-20221105155335-ed984fd96915/go.mod h1:GHi17CboIfEAzcLKyOforrRGpNsJkIahosnrlgfsOvM=
-github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
-github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
-github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
-github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
-github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
-github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
-github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
-github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
-github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
-github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
-github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
-github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
+github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
-github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
-github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
-github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE=
-github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU=
-github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
-github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
-github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
-github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
-github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
-github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
-github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
-github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
-github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
-github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
-github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA=
-github.com/lyft/protoc-gen-star v0.6.1/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA=
-github.com/lyft/protoc-gen-star/v2 v2.0.1/go.mod h1:RcCdONR2ScXaYnQC5tUzxzlpA3WVYF7/opLeUgcQs/o=
-github.com/mattn/go-ieproxy v0.0.1/go.mod h1:pYabZ6IHcRpFh7vIaLfK7rdcWgFEb3SFJ6/gNWuh88E=
-github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
+github.com/labstack/echo/v5 v5.0.0-20230722203903-ec5b858dab61 h1:FwuzbVh87iLiUQj1+uQUsuw9x5t9m5n5g7rG7o4svW4=
+github.com/labstack/echo/v5 v5.0.0-20230722203903-ec5b858dab61/go.mod h1:paQfF1YtHe+GrGg5fOgjsjoCX/UKDr9bc1DoWpZfns8=
+github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
+github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
+github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
+github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
-github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
-github.com/mattn/go-sqlite3 v1.14.14/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
-github.com/mattn/go-sqlite3 v1.14.15/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg=
-github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
-github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
-github.com/mingrammer/commonregex v1.0.1 h1:QY0Z1Bl80jw9M3+488HJXPWnZmvtu3UdvxyodP2FTyY=
-github.com/mingrammer/commonregex v1.0.1/go.mod h1:/HNZq7qReKgXBxJxce5SOxf33y0il/ZqL4Kxgo2NLcA=
-github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY=
-github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE=
-github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
-github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
-github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
-github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
-github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
-github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
-github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
-github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=
-github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
-github.com/mschoch/smat v0.2.0 h1:8imxQsjDm8yFEAVBe7azKmKSgzSkZXDuKkSq9374khM=
-github.com/mschoch/smat v0.2.0/go.mod h1:kc9mz7DoBKqDyiRL7VZN8KvXQMWeTaVnttLRXOlotKw=
-github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
-github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
-github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms=
-github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
-github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
-github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b h1:YWuSjZCQAPM8UUBLkYUk1e+rZcvWHJmFb6i6rM44Xs8=
-github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ=
-github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
-github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2dXMnm1mY=
-github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI=
-github.com/phpdave11/gofpdi v1.0.13/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI=
-github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
-github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
-github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
-github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
-github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
-github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
-github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI=
-github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg=
+github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
+github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
+github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=
+github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
+github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
+github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI=
+github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
+github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4=
+github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
-github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
-github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
-github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0=
-github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY=
-github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y=
-github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc=
-github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
-github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+github.com/pocketbase/dbx v1.10.1 h1:cw+vsyfCJD8YObOVeqb93YErnlxwYMkNZ4rwN0G0AaA=
+github.com/pocketbase/dbx v1.10.1/go.mod h1:xXRCIAKTHMgUCyCKZm55pUOdvFziJjQfXaWKhu2vhMs=
+github.com/pocketbase/pocketbase v0.22.10 h1:5iRTl2wGdH/l/IrJKi/gwzMB4t7pF/oLaGX86BQIy4o=
+github.com/pocketbase/pocketbase v0.22.10/go.mod h1:rk8bn2ywGEC6+bQRfduM8xy0weLVqjDULiMEkgvbpYs=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
-github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
-github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w=
-github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
-github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
-github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
-github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
-github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA=
-github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc=
-github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
-github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
-github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
-github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
-github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
-github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4=
-github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM=
-github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
+github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
-github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
-github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
-github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
-github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
-github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
-github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w=
-github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk=
-github.com/sethgrid/pester v1.2.0/go.mod h1:hEUINb4RqvDxtoCaU0BNT/HV4ig5kfgOasrf1xcvr0A=
-github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
-github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
-github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
-github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
-github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
-github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
-github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
-github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4=
-github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I=
-github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y=
+github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
+github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
+github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
+github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0=
+github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
+github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
+github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
+github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
+github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
-github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
-github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
-github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
-github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
-github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
-github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
-github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
-github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
-github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
-github.com/tidwall/gjson v1.17.0 h1:/Jocvlh98kcTfpN2+JzGQWQcqrPQwDrVEMApx/M5ZwM=
-github.com/tidwall/gjson v1.17.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
-github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
-github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
-github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
-github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4=
-github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
-github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY=
-github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28=
-github.com/tus/tusd v1.13.0 h1:W7rtb1XPSpde/GPZAgdfUS3vus2Jt2KmckS6OUd3CU8=
-github.com/tus/tusd v1.13.0/go.mod h1:1tX4CDGlx8koHGFJdSaJ5ybUIm2NeVloJgZEPSKRcQA=
-github.com/vimeo/go-util v1.4.1/go.mod h1:r+yspV//C48HeMXV8nEvtUeNiIiGfVv3bbEHzOgudwE=
-github.com/warjiang/gojsonschema v1.2.1-0.20201027075954-b076d39a02e5 h1:dgD8Na9CIf4VZQj8pSVcF0c9ihnb6BW/dJZQ71I2TGU=
-github.com/warjiang/gojsonschema v1.2.1-0.20201027075954-b076d39a02e5/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
-github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
-github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo=
-github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
-github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0=
-github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
-github.com/xhit/go-str2duration v1.2.0/go.mod h1:3cPSlfZlUHVlneIVfePFWcJZsuwf+P1v2SRTV4cUmp4=
-github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
-github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
-github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
-github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
-github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
-github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
+github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
+github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
+github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=
+github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
-github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0=
-github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA=
-github.com/zitadel/logging v0.3.4 h1:9hZsTjMMTE3X2LUi0xcF9Q9EdLo+FAezeu52ireBbHM=
-github.com/zitadel/oidc v1.8.0 h1:FEUuAaZVgZv0dWGpCNcG1ov7COVDA5x2yzlYwqy8iTs=
-go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ=
-go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw=
-go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
-go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
-go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
-go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
-go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
-go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
-go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
+go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
-go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
-go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U=
-go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U=
-go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
-go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A=
-go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
-go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI=
-golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
+go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 h1:4Pp6oUg3+e/6M4C0A/3kJ2VYa++dsWVTtGgLVj5xtHg=
+go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0/go.mod h1:Mjt1i1INqiaoZOMGR1RIUJN+i3ChKoFRqzrRQhlkbs0=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw=
+go.opentelemetry.io/otel v1.25.0 h1:gldB5FfhRl7OJQbUHt/8s0a7cE8fbsPAtdpRaApKy4k=
+go.opentelemetry.io/otel v1.25.0/go.mod h1:Wa2ds5NOXEMkCmUou1WA7ZBfLTHWIsp034OVD7AO+Vg=
+go.opentelemetry.io/otel/metric v1.25.0 h1:LUKbS7ArpFL/I2jJHdJcqMGxkRdxpPHE0VU/D4NuEwA=
+go.opentelemetry.io/otel/metric v1.25.0/go.mod h1:rkDLUSd2lC5lq2dFNrX9LGAbINP5B7WBkC78RXCpH5s=
+go.opentelemetry.io/otel/trace v1.25.0 h1:tqukZGLwQYRIFtSQM2u2+yfMVTgGVeqRLPUYx1Dq6RM=
+go.opentelemetry.io/otel/trace v1.25.0/go.mod h1:hCCs70XM/ljO+BeQkyFnbK28SBIJ/Emuha+ccrCRT7I=
+gocloud.dev v0.37.0 h1:XF1rN6R0qZI/9DYjN16Uy0durAmSlf58DHOcb28GPro=
+gocloud.dev v0.37.0/go.mod h1:7/O4kqdInCNsc6LqgmuFnS0GRew4XNNYWpA44yQnwco=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
-golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
-golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
-golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
-golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
-golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
-golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
-golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
-golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
-golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw=
-golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
-golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0=
-golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I=
-golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio=
-golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw=
-golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo=
-golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
-golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
-golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
+golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30=
+golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
-golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
-golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
-golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
-golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
-golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3/go.mod h1:NOZ3BPKG0ec/BKJQgnvsSFpcKLM5xXVWnvZS97DWHgE=
-golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY=
-golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
-golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
-golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
-golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
-golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
-golang.org/x/exp v0.0.0-20220827204233-334a2380cb91/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE=
-golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI=
-golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo=
-golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs=
-golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
-golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
-golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
-golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
-golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
-golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
-golang.org/x/image v0.0.0-20201208152932-35266b937fa6/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
-golang.org/x/image v0.0.0-20210216034530-4410531fe030/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
-golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
-golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
-golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
-golang.org/x/image v0.0.0-20220302094943-723b81ca9867/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
+golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
+golang.org/x/image v0.15.0 h1:kOELfmgrmJlw4Cdb7g/QGuB3CvDrXbqEIww/pNtNBm8=
+golang.org/x/image v0.15.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
-golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
-golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
-golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
-golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
-golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
-golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
-golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
-golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
-golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
-golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
-golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
-golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
-golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
-golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
-golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
-golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
-golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
-golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
-golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
-golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
-golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
-golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
-golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
-golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
-golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
-golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
+golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA=
+golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
-golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
-golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
-golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20191112182307-2180aed22343/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
-golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
-golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
-golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
-golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
-golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
-golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
-golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
-golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
-golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
-golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
-golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc=
-golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
-golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
-golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
-golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
-golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
-golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
-golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
-golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
-golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
-golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
-golang.org/x/net v0.0.0-20221012135044-0b7e1fb9d458/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
-golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
-golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
-golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
-golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE=
-golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws=
-golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
-golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
-golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
-golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
-golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
-golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA=
-golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI=
-golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
-golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
+golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
+golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
-golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
-golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
-golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
-golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
-golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
-golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
-golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
-golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
-golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
-golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
-golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
-golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
-golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
-golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
-golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
-golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
-golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
-golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
-golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE=
-golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE=
-golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg=
-golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg=
-golang.org/x/oauth2 v0.0.0-20221006150949-b44042a4b9c1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg=
-golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg=
-golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec=
-golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I=
-golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw=
-golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4=
-golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE=
-golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI=
-golang.org/x/oauth2 v0.11.0/go.mod h1:LdF7O/8bLR/qWK9DrpXmbHLTouvRHK0SgJl0GmDBchk=
-golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY=
-golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0=
+golang.org/x/oauth2 v0.19.0 h1:9+E/EZBCbTLNrbN35fHv/a/d/mOBatymz1zbtQrXpIg=
+golang.org/x/oauth2 v0.19.0/go.mod h1:vYi7skDa1x015PmRRYZ7+s1cWyPgrPiSYRe4rnsexc8=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
+golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
+golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20191112214154-59a1497f0cea/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200828194041-157a740278f4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210304124612-50617c2ba197/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
-golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
+golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
-golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
-golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
-golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA=
-golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ=
-golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
-golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
-golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY=
-golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
-golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo=
-golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o=
-golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU=
-golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
-golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q=
+golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
-golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
-golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
-golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
-golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
-golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
-golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
-golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
-golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
-golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
-golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
-golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
-golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
-golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
-golang.org/x/time v0.0.0-20220922220347-f3bd1da661af/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
-golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
-golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
-golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
-golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
+golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
-golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
-golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
-golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
-golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
-golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
-golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
-golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
-golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
-golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
-golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
-golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
-golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
-golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
-golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
-golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
-golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
-golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
-golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
-golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
-golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE=
-golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
-golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
-golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
-golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
-golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
-golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
-golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
-golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
-golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
-golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
-golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
-golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
-golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
-golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
-golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k=
-golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
-golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s=
-golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc=
+golang.org/x/tools v0.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY=
+golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
-golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
-golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
-gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo=
-gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0=
-gonum.org/v1/gonum v0.9.3/go.mod h1:TZumC3NeyVQskjXqmyWt4S3bINhy7B4eYwW69EbyX+0=
-gonum.org/v1/gonum v0.11.0/go.mod h1:fSG4YDCxxUZQJ7rKsQrj0gMOg00Il0Z96/qMA4bVQhA=
-gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw=
-gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc=
-gonum.org/v1/plot v0.9.0/go.mod h1:3Pcqqmp6RHvJI72kgb8fThyUnav364FOsdDo2aGW5lY=
-gonum.org/v1/plot v0.10.1/go.mod h1:VZW5OlhkL1mysU9vaqNHnsy86inf6Ot+jB3r+BczCEo=
-google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
-google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
-google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
-google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
-google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
-google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
-google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
-google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
-google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
-google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
-google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
-google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
-google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
-google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
-google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM=
-google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc=
-google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg=
-google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE=
-google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8=
-google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU=
-google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94=
-google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo=
-google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4=
-google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw=
-google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU=
-google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k=
-google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE=
-google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE=
-google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI=
-google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I=
-google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo=
-google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g=
-google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA=
-google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8=
-google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs=
-google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA=
-google.golang.org/api v0.77.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA=
-google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw=
-google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg=
-google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o=
-google.golang.org/api v0.85.0/go.mod h1:AqZf8Ep9uZ2pyTvgL+x0D3Zt0eoT9b5E8fmzfu6FO2g=
-google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw=
-google.golang.org/api v0.93.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw=
-google.golang.org/api v0.95.0/go.mod h1:eADj+UBuxkh5zlrSntJghuNeg8HwQ1w5lTKkuqaETEI=
-google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s=
-google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s=
-google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s=
-google.golang.org/api v0.99.0/go.mod h1:1YOf74vkVndF7pG6hIHuINsM7eWwpVTAfNMNiL91A08=
-google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70=
-google.golang.org/api v0.102.0/go.mod h1:3VFl6/fzoA+qNuS1N1/VfXY4LjoXN/wzeIp7TweWwGo=
-google.golang.org/api v0.103.0/go.mod h1:hGtW6nK1AC+d9si/UBhw8Xli+QMOf6xyNAyJw4qU9w0=
-google.golang.org/api v0.106.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY=
-google.golang.org/api v0.107.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY=
-google.golang.org/api v0.108.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY=
-google.golang.org/api v0.110.0/go.mod h1:7FC4Vvx1Mooxh8C5HWjzZHcavuS2f6pmJpZx60ca7iI=
-google.golang.org/api v0.111.0/go.mod h1:qtFHvU9mhgTJegR31csQ+rwxyUTHOKFqCKWp1J0fdw0=
-google.golang.org/api v0.114.0/go.mod h1:ifYI2ZsFK6/uGddGfAD5BMxlnkBqCmqHSDUVi45N5Yg=
-google.golang.org/api v0.118.0/go.mod h1:76TtD3vkgmZ66zZzp72bUUklpmQmKlhh6sYtIjYK+5E=
-google.golang.org/api v0.122.0/go.mod h1:gcitW0lvnyWjSp9nKxAbdHKIZ6vF4aajGueeslZOyms=
-google.golang.org/api v0.124.0/go.mod h1:xu2HQurE5gi/3t1aFCvhPD781p0a3p11sdunTJ2BlP4=
-google.golang.org/api v0.125.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw=
-google.golang.org/api v0.126.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw=
-google.golang.org/api v0.128.0/go.mod h1:Y611qgqaE92On/7g65MQgxYul3c0rEB894kniWLY750=
-google.golang.org/api v0.132.0/go.mod h1:AeTBC6GpJnJSRJjktDcPX0QwtS8pGYZOV6MSuSCusw0=
-google.golang.org/api v0.138.0/go.mod h1:4xyob8CxC+0GChNBvEUAk8VBKNvYOTWM9T3v3UfRxuY=
+golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU=
+golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90=
+google.golang.org/api v0.176.1 h1:DJSXnV6An+NhJ1J+GWtoF2nHEuqB1VNoTfnIbjNvwD4=
+google.golang.org/api v0.176.1/go.mod h1:j2MaSDYcvYV1lkZ1+SMW4IeF90SrEyFA+tluDYWRrFg=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
-google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
-google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
-google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
-google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
-google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM=
-google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
-google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
-google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
-google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
-google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
-google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
-google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
-google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
-google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
-google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
-google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
-google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
-google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
-google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA=
-google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
-google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
-google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A=
-google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A=
-google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A=
-google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
-google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
-google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
-google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24=
-google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k=
-google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k=
-google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48=
-google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48=
-google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w=
-google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
-google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
-google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
-google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
-google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
-google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
-google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
-google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
-google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
-google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
-google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
-google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
-google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
-google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
-google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
-google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
-google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E=
-google.golang.org/genproto v0.0.0-20220329172620-7be39ac1afc7/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
-google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
-google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
-google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
-google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
-google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
-google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4=
-google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4=
-google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4=
-google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4=
-google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA=
-google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA=
-google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA=
-google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA=
-google.golang.org/genproto v0.0.0-20220628213854-d9e0b6570c03/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA=
-google.golang.org/genproto v0.0.0-20220722212130-b98a9ff5e252/go.mod h1:GkXuJDJ6aQ7lnJcRF+SJVgFdQhypqgl3LB1C9vabdRE=
-google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc=
-google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk=
-google.golang.org/genproto v0.0.0-20220817144833-d7fd3f11b9b1/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk=
-google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk=
-google.golang.org/genproto v0.0.0-20220829144015-23454907ede3/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk=
-google.golang.org/genproto v0.0.0-20220829175752-36a9c930ecbf/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk=
-google.golang.org/genproto v0.0.0-20220913154956-18f8339a66a5/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo=
-google.golang.org/genproto v0.0.0-20220914142337-ca0e39ece12f/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo=
-google.golang.org/genproto v0.0.0-20220915135415-7fd63a7952de/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo=
-google.golang.org/genproto v0.0.0-20220916172020-2692e8806bfa/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo=
-google.golang.org/genproto v0.0.0-20220919141832-68c03719ef51/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo=
-google.golang.org/genproto v0.0.0-20220920201722-2b89144ce006/go.mod h1:ht8XFiar2npT/g4vkk7O0WYS1sHOHbdujxbEp7CJWbw=
-google.golang.org/genproto v0.0.0-20220926165614-551eb538f295/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI=
-google.golang.org/genproto v0.0.0-20220926220553-6981cbe3cfce/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI=
-google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqwhZAwq4wsRUaVG555sVgsNmIjRtO7t/JH29U=
-google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM=
-google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM=
-google.golang.org/genproto v0.0.0-20221024153911-1573dae28c9c/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s=
-google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s=
-google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c/go.mod h1:CGI5F/G+E5bKwmfYo09AXuVN4dD894kIKUFmVbP2/Fo=
-google.golang.org/genproto v0.0.0-20221109142239-94d6d90a7d66/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg=
-google.golang.org/genproto v0.0.0-20221114212237-e4508ebdbee1/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg=
-google.golang.org/genproto v0.0.0-20221117204609-8f9c96812029/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg=
-google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg=
-google.golang.org/genproto v0.0.0-20221201164419-0e50fba7f41c/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg=
-google.golang.org/genproto v0.0.0-20221201204527-e3fa12d562f3/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg=
-google.golang.org/genproto v0.0.0-20221202195650-67e5cbc046fd/go.mod h1:cTsE614GARnxrLsqKREzmNYJACSWWpAWdNMwnD7c2BE=
-google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM=
-google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM=
-google.golang.org/genproto v0.0.0-20230112194545-e10362b5ecf9/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM=
-google.golang.org/genproto v0.0.0-20230113154510-dbe35b8444a5/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM=
-google.golang.org/genproto v0.0.0-20230123190316-2c411cf9d197/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM=
-google.golang.org/genproto v0.0.0-20230124163310-31e0e69b6fc2/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM=
-google.golang.org/genproto v0.0.0-20230125152338-dcaf20b6aeaa/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM=
-google.golang.org/genproto v0.0.0-20230127162408-596548ed4efa/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM=
-google.golang.org/genproto v0.0.0-20230209215440-0dfe4f8abfcc/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM=
-google.golang.org/genproto v0.0.0-20230216225411-c8e22ba71e44/go.mod h1:8B0gmkoRebU8ukX6HP+4wrVQUY1+6PkQ44BSyIlflHA=
-google.golang.org/genproto v0.0.0-20230222225845-10f96fb3dbec/go.mod h1:3Dl5ZL0q0isWJt+FVcfpQyirqemEuLAK/iFvg1UP1Hw=
-google.golang.org/genproto v0.0.0-20230223222841-637eb2293923/go.mod h1:3Dl5ZL0q0isWJt+FVcfpQyirqemEuLAK/iFvg1UP1Hw=
-google.golang.org/genproto v0.0.0-20230303212802-e74f57abe488/go.mod h1:TvhZT5f700eVlTNwND1xoEZQeWTB2RY/65kplwl/bFA=
-google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s=
-google.golang.org/genproto v0.0.0-20230320184635-7606e756e683/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s=
-google.golang.org/genproto v0.0.0-20230323212658-478b75c54725/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak=
-google.golang.org/genproto v0.0.0-20230330154414-c0448cd141ea/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak=
-google.golang.org/genproto v0.0.0-20230331144136-dcfb400f0633/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak=
-google.golang.org/genproto v0.0.0-20230403163135-c38d8f061ccd/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak=
-google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU=
-google.golang.org/genproto v0.0.0-20230525234025-438c736192d0/go.mod h1:9ExIQyXL5hZrHzQceCwuSYwZZ5QZBazOcprJ5rgs3lY=
-google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54/go.mod h1:zqTuNwFlFRsw5zIts5VnzLQxSRqh+CGOTVMlYbY0Eyk=
-google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64=
-google.golang.org/genproto v0.0.0-20230629202037-9506855d4529/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64=
-google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130/go.mod h1:O9kGHb51iE/nOGvQaDUuadVYqovW56s5emA88lQnj6Y=
-google.golang.org/genproto v0.0.0-20230726155614-23370e0ffb3e/go.mod h1:0ggbjUrZYpy1q+ANUS30SEoGZ53cdfwtbuG7Ptgy108=
-google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5/go.mod h1:oH/ZOT02u4kWEp7oYBGYFFkCdKS/uYR9Z7+0/xuuFp8=
-google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a/go.mod h1:ts19tUU+Z0ZShN1y3aPyq2+O3d5FUNNgT6FtOzmrNn8=
-google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig=
-google.golang.org/genproto/googleapis/api v0.0.0-20230526203410-71b5a4ffd15e/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig=
-google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig=
-google.golang.org/genproto/googleapis/api v0.0.0-20230629202037-9506855d4529/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig=
-google.golang.org/genproto/googleapis/api v0.0.0-20230706204954-ccb25ca9f130/go.mod h1:mPBs5jNgx2GuQGvFwUvVKqtn6HsUw9nP64BedgvqEsQ=
-google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e/go.mod h1:rsr7RhLuwsDKL7RmgDDCUc6yaGr1iqceVb5Wv6f6YvQ=
-google.golang.org/genproto/googleapis/api v0.0.0-20230803162519-f966b187b2e5/go.mod h1:5DZzOUPCLYL3mNkQ0ms0F3EuUNZ7py1Bqeq6sxzI7/Q=
-google.golang.org/genproto/googleapis/bytestream v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:ylj+BE99M198VPbBh6A8d9n3w8fChvyLK3wwBOjXBFA=
-google.golang.org/genproto/googleapis/bytestream v0.0.0-20230711160842-782d3b101e98/go.mod h1:3QoBVwTHkXbY1oRGzlhwhOykfcATQN43LJ6iT8Wy8kE=
-google.golang.org/genproto/googleapis/bytestream v0.0.0-20230807174057-1744710a1577/go.mod h1:NjCQG/D8JandXxM57PZbAJL1DCNL6EypA0vPPwfsc7c=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234015-3fc162c6f38a/go.mod h1:xURIpW9ES5+/GZhnV6beoEtxQrnkRGIfP5VQG2tCBLc=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20230526203410-71b5a4ffd15e/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20230629202037-9506855d4529/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20230706204954-ccb25ca9f130/go.mod h1:8mL13HKkDa+IuJ8yruA3ci0q+0vsUz4m//+ottjwS5o=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20230731190214-cbb8c96f2d6d/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20230807174057-1744710a1577 h1:wukfNtZmZUurLN/atp2hiIeTKn7QJWIQdHzqmsOnAOk=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20230807174057-1744710a1577/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M=
+google.golang.org/genproto v0.0.0-20240325203815-454cdb8f5daa h1:ePqxpG3LVx+feAUOx8YmR5T7rc0rdzK8DyxM8cQ9zq0=
+google.golang.org/genproto v0.0.0-20240325203815-454cdb8f5daa/go.mod h1:CnZenrTdRJb7jc+jOm0Rkywq+9wh0QC4U8tyiRbEPPM=
+google.golang.org/genproto/googleapis/api v0.0.0-20240325203815-454cdb8f5daa h1:Jt1XW5PaLXF1/ePZrznsh/aAUvI7Adfc3LY1dAKlzRs=
+google.golang.org/genproto/googleapis/api v0.0.0-20240325203815-454cdb8f5daa/go.mod h1:K4kfzHtI0kqWA79gecJarFtDn/Mls+GxQcg3Zox91Ac=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240415180920-8c6c420018be h1:LG9vZxsWGOmUKieR8wPAUR3u3MpnYFQZROPIMaXh7/A=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240415180920-8c6c420018be/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
-google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
-google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
-google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
-google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
-google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60=
-google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
-google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
-google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
-google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
-google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
-google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8=
-google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
-google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
-google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
-google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
-google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
-google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
-google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE=
-google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE=
-google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
-google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
-google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU=
-google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU=
-google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ=
-google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
-google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
-google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
-google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
-google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
-google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
-google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
-google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww=
-google.golang.org/grpc v1.52.0/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY=
-google.golang.org/grpc v1.52.3/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY=
-google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw=
-google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g=
-google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8=
-google.golang.org/grpc v1.56.1/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s=
-google.golang.org/grpc v1.56.2/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s=
-google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo=
-google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ=
-google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0=
-google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=
+google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM=
+google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
@@ -1999,103 +327,42 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
-google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
-google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
-google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
-google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
-google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
-google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
-google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
-google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
-google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
-gopkg.in/Acconut/lockfile.v1 v1.1.0/go.mod h1:6UCz3wJ8tSFUsPR6uP/j8uegEtDuEEqFxlpi0JI4Umw=
-gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
-gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
-gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
-gopkg.in/h2non/gock.v1 v1.1.2/go.mod h1:n7UGz/ckNChHiK05rDoiC4MYSunEC/lyaUm2WWaDva0=
-gopkg.in/square/go-jose.v2 v2.6.0 h1:NGk74WTnPKBNUhNzQX7PYcTLUjoq7mzKk2OKbvwk2iI=
-gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=
-gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
-honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
-honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
-honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
-honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
-honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
-honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las=
-lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk=
-lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk=
-modernc.org/cc/v3 v3.36.0/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI=
-modernc.org/cc/v3 v3.36.2/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI=
-modernc.org/cc/v3 v3.36.3/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI=
-modernc.org/cc/v3 v3.37.0/go.mod h1:vtL+3mdHx/wcj3iEGz84rQa8vEqR6XM84v5Lcvfph20=
-modernc.org/cc/v3 v3.40.0/go.mod h1:/bTg4dnWkSXowUO6ssQKnOV0yMVxDYNIsIrzqTFDGH0=
-modernc.org/ccgo/v3 v3.0.0-20220428102840-41399a37e894/go.mod h1:eI31LL8EwEBKPpNpA4bU1/i+sKOwOrQy8D87zWUcRZc=
-modernc.org/ccgo/v3 v3.0.0-20220430103911-bc99d88307be/go.mod h1:bwdAnOoaIt8Ax9YdWGjxWsdkPcZyRPHqrOvJxaKAKGw=
-modernc.org/ccgo/v3 v3.0.0-20220904174949-82d86e1b6d56/go.mod h1:YSXjPL62P2AMSxBphRHPn7IkzhVHqkvOnRKAKh+W6ZI=
-modernc.org/ccgo/v3 v3.16.4/go.mod h1:tGtX0gE9Jn7hdZFeU88slbTh1UtCYKusWOoCJuvkWsQ=
-modernc.org/ccgo/v3 v3.16.6/go.mod h1:tGtX0gE9Jn7hdZFeU88slbTh1UtCYKusWOoCJuvkWsQ=
-modernc.org/ccgo/v3 v3.16.8/go.mod h1:zNjwkizS+fIFDrDjIAgBSCLkWbJuHF+ar3QRn+Z9aws=
-modernc.org/ccgo/v3 v3.16.9/go.mod h1:zNMzC9A9xeNUepy6KuZBbugn3c0Mc9TeiJO4lgvkJDo=
-modernc.org/ccgo/v3 v3.16.13-0.20221017192402-261537637ce8/go.mod h1:fUB3Vn0nVPReA+7IG7yZDfjv1TMWjhQP8gCxrFAtL5g=
-modernc.org/ccgo/v3 v3.16.13/go.mod h1:2Quk+5YgpImhPjv2Qsob1DnZ/4som1lJTodubIcoUkY=
-modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ=
-modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM=
-modernc.org/libc v0.0.0-20220428101251-2d5f3daf273b/go.mod h1:p7Mg4+koNjc8jkqwcoFBJx7tXkpj00G77X7A72jXPXA=
-modernc.org/libc v1.16.0/go.mod h1:N4LD6DBE9cf+Dzf9buBlzVJndKr/iJHG97vGLHYnb5A=
-modernc.org/libc v1.16.1/go.mod h1:JjJE0eu4yeK7tab2n4S1w8tlWd9MxXLRzheaRnAKymU=
-modernc.org/libc v1.16.17/go.mod h1:hYIV5VZczAmGZAnG15Vdngn5HSF5cSkbvfz2B7GRuVU=
-modernc.org/libc v1.16.19/go.mod h1:p7Mg4+koNjc8jkqwcoFBJx7tXkpj00G77X7A72jXPXA=
-modernc.org/libc v1.17.0/go.mod h1:XsgLldpP4aWlPlsjqKRdHPqCxCjISdHfM/yeWC5GyW0=
-modernc.org/libc v1.17.1/go.mod h1:FZ23b+8LjxZs7XtFMbSzL/EhPxNbfZbErxEHc7cbD9s=
-modernc.org/libc v1.17.4/go.mod h1:WNg2ZH56rDEwdropAJeZPQkXmDwh+JCA1s/htl6r2fA=
-modernc.org/libc v1.18.0/go.mod h1:vj6zehR5bfc98ipowQOM2nIDUZnVew/wNC/2tOGS+q0=
-modernc.org/libc v1.20.3/go.mod h1:ZRfIaEkgrYgZDl6pa4W39HgN5G/yDW+NRmNKZBDFrk0=
-modernc.org/libc v1.21.4/go.mod h1:przBsL5RDOZajTVslkugzLBj1evTue36jEomFQOoYuI=
-modernc.org/libc v1.22.2/go.mod h1:uvQavJ1pZ0hIoC/jfqNoMLURIMhKzINIWypNM17puug=
-modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E=
-modernc.org/mathutil v1.4.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E=
-modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E=
-modernc.org/memory v1.1.1/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw=
-modernc.org/memory v1.2.0/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw=
-modernc.org/memory v1.2.1/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU=
-modernc.org/memory v1.3.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU=
-modernc.org/memory v1.4.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU=
-modernc.org/memory v1.5.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU=
-modernc.org/opt v0.1.1/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0=
+modernc.org/cc/v4 v4.21.0 h1:D/gLKtcztomvWbsbvBKo3leKQv+86f+DdqEZBBXhnag=
+modernc.org/cc/v4 v4.21.0/go.mod h1:HM7VJTZbUCR3rV8EYBi9wxnJ0ZBRiGE5OeGXNA0IsLQ=
+modernc.org/ccgo/v4 v4.17.0 h1:cX97L5Bv/7PEmyk1oEAD890fQu5/yUQRYeYBsCSnzww=
+modernc.org/ccgo/v4 v4.17.0/go.mod h1:keES1eiOIBJhbA5qKrV7ADG3w8DsX8G7jfHAT76riOg=
+modernc.org/fileutil v1.3.0 h1:gQ5SIzK3H9kdfai/5x41oQiKValumqNTDXMvKo62HvE=
+modernc.org/fileutil v1.3.0/go.mod h1:XatxS8fZi3pS8/hKG2GH/ArUogfxjpEKs3Ku3aK4JyQ=
+modernc.org/gc/v2 v2.4.1 h1:9cNzOqPyMJBvrUipmynX0ZohMhcxPtMccYgGOJdOiBw=
+modernc.org/gc/v2 v2.4.1/go.mod h1:wzN5dK1AzVGoH6XOzc3YZ+ey/jPgYHLuVckd62P0GYU=
+modernc.org/gc/v3 v3.0.0-20240304020402-f0dba7c97c2b h1:BnN1t+pb1cy61zbvSUV7SeI0PwosMhlAEi/vBY4qxp8=
+modernc.org/gc/v3 v3.0.0-20240304020402-f0dba7c97c2b/go.mod h1:Qz0X07sNOR1jWYCrJMEnbW/X55x206Q7Vt4mz6/wHp4=
+modernc.org/libc v1.50.2 h1:I0+3wlRvXmAEjAJvD7BhP1kmKHwkzV0rOcqFcD85u+0=
+modernc.org/libc v1.50.2/go.mod h1:Fd8TZdfRorOd1vB0QCtYSHYAuzobS4xS3mhMGUkeVcA=
+modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4=
+modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo=
+modernc.org/memory v1.8.0 h1:IqGTL6eFMaDZZhEWwcREgeMXYwmW83LYW8cROZYkg+E=
+modernc.org/memory v1.8.0/go.mod h1:XPZ936zp5OMKGWPqbD3JShgd/ZoQ7899TUuQqxY+peU=
+modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4=
modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0=
-modernc.org/sqlite v1.18.1/go.mod h1:6ho+Gow7oX5V+OiOQ6Tr4xeqbx13UZ6t+Fw9IRUG4d4=
-modernc.org/sqlite v1.18.2/go.mod h1:kvrTLEWgxUcHa2GfHBQtanR1H9ht3hTJNtKpzH9k1u0=
-modernc.org/strutil v1.1.1/go.mod h1:DE+MQQ/hjKBZS2zNInV5hhcipt5rLPWkmpbGeW5mmdw=
-modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw=
-modernc.org/tcl v1.13.1/go.mod h1:XOLfOwzhkljL4itZkK6T72ckMgvj0BDsnKNdZVUOecw=
-modernc.org/tcl v1.13.2/go.mod h1:7CLiGIPo1M8Rv1Mitpv5akc2+8fxUd2y2UzC/MfMzy0=
-modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM=
-modernc.org/token v1.0.1/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM=
+modernc.org/sortutil v1.2.0 h1:jQiD3PfS2REGJNzNCMMaLSp/wdMNieTbKX920Cqdgqc=
+modernc.org/sortutil v1.2.0/go.mod h1:TKU2s7kJMf1AE84OoiGppNHJwvB753OYfNl2WRb++Ss=
+modernc.org/sqlite v1.29.8 h1:nGKglNx9K5v0As+zF0/Gcl1kMkmaU1XynYyq92PbsC8=
+modernc.org/sqlite v1.29.8/go.mod h1:lQPm27iqa4UNZpmr4Aor0MH0HkCLbt1huYDfWylLZFk=
+modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA=
+modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0=
+modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y=
modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM=
-modernc.org/z v1.5.1/go.mod h1:eWFB510QWW5Th9YGZT81s+LwvaAs3Q2yr4sP0rmLkv8=
-rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
-rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
-rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
-rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
diff --git a/hooks/hooks.go b/hooks/hooks.go
deleted file mode 100644
index c116c33..0000000
--- a/hooks/hooks.go
+++ /dev/null
@@ -1,55 +0,0 @@
-package hooks
-
-import (
- "context"
-
- "github.com/arangodb/go-driver"
-
- "github.com/SecurityBrewery/catalyst/index"
-)
-
-type Hooks struct {
- DatabaseAfterConnectFuncs []func(ctx context.Context, client driver.Client, name string)
- IngestionFilterFunc func(ctx context.Context, index *index.Index) (string, error)
- TicketReadFilterFunc func(ctx context.Context) (string, map[string]any, error)
- TicketWriteFilterFunc func(ctx context.Context) (string, map[string]any, error)
- GetGroupsFunc func(ctx context.Context, username string) ([]string, error)
-}
-
-func (h *Hooks) DatabaseAfterConnect(ctx context.Context, client driver.Client, name string) {
- for _, f := range h.DatabaseAfterConnectFuncs {
- f(ctx, client, name)
- }
-}
-
-func (h *Hooks) IngestionFilter(ctx context.Context, index *index.Index) (string, error) {
- if h.IngestionFilterFunc != nil {
- return h.IngestionFilterFunc(ctx, index)
- }
-
- return "[]", nil
-}
-
-func (h *Hooks) TicketReadFilter(ctx context.Context) (string, map[string]any, error) {
- if h.TicketReadFilterFunc != nil {
- return h.TicketReadFilterFunc(ctx)
- }
-
- return "", nil, nil
-}
-
-func (h *Hooks) TicketWriteFilter(ctx context.Context) (string, map[string]any, error) {
- if h.TicketWriteFilterFunc != nil {
- return h.TicketWriteFilterFunc(ctx)
- }
-
- return "", nil, nil
-}
-
-func (h *Hooks) GetGroups(ctx context.Context, username string) ([]string, error) {
- if h.GetGroupsFunc != nil {
- return h.GetGroupsFunc(ctx, username)
- }
-
- return nil, nil
-}
diff --git a/index/index.go b/index/index.go
deleted file mode 100644
index 27705dc..0000000
--- a/index/index.go
+++ /dev/null
@@ -1,87 +0,0 @@
-package index
-
-import (
- "errors"
- "fmt"
- "log"
- "os"
-
- "github.com/blevesearch/bleve/v2"
-
- "github.com/SecurityBrewery/catalyst/generated/model"
-)
-
-type Index struct {
- name string
- internal bleve.Index
-}
-
-func New(name string) (*Index, error) {
- var err error
- var bleveIndex bleve.Index
- if _, oerr := os.Stat(name); os.IsNotExist(oerr) {
- bleveIndex, err = bleve.New(name, bleve.NewIndexMapping())
- } else {
- bleveIndex, err = bleve.Open(name)
- }
- if err != nil {
- return nil, err
- }
-
- return &Index{name: name, internal: bleveIndex}, nil
-}
-
-func (i *Index) Index(incidents []*model.TicketSimpleResponse) {
- b := i.internal.NewBatch()
- for _, incident := range incidents {
- if incident.ID == 0 {
- log.Println(errors.New("no ID"), incident)
-
- continue
- }
-
- err := b.Index(fmt.Sprint(incident.ID), incident)
- if err != nil {
- log.Println(err)
- }
- }
-
- if err := i.internal.Batch(b); err != nil {
- log.Println(err)
- }
-}
-
-func (i *Index) Search(term string) (ids []string, err error) {
- query := bleve.NewQueryStringQuery(term)
- result, err := i.internal.Search(bleve.NewSearchRequestOptions(query, 10000, 0, false))
- if err != nil {
- return nil, err
- }
- for _, match := range result.Hits {
- ids = append(ids, match.ID)
- }
-
- return ids, nil
-}
-
-func (i *Index) Truncate() error {
- err := i.internal.Close()
- if err != nil {
- return err
- }
- err = os.RemoveAll(i.name)
- if err != nil {
- return err
- }
- index, err := bleve.New(i.name, bleve.NewIndexMapping())
- if err != nil {
- return err
- }
- i.internal = index
-
- return nil
-}
-
-func (i *Index) Close() error {
- return i.internal.Close()
-}
diff --git a/index/index_test.go b/index/index_test.go
deleted file mode 100644
index 9033691..0000000
--- a/index/index_test.go
+++ /dev/null
@@ -1,94 +0,0 @@
-package index_test
-
-import (
- "reflect"
- "testing"
-
- "github.com/SecurityBrewery/catalyst/generated/model"
- "github.com/SecurityBrewery/catalyst/test"
-)
-
-func TestIndex(t *testing.T) {
- t.Parallel()
-
- type args struct {
- term string
- }
- tests := []struct {
- name string
- args args
- wantIds []string
- wantErr bool
- }{
- {name: "Exists", args: args{"foo"}, wantIds: []string{"1"}},
- {name: "Not exists", args: args{"bar"}},
- }
- for _, tt := range tests {
- tt := tt
- t.Run(tt.name, func(t *testing.T) {
- t.Parallel()
-
- i, cleanup, err := test.Index(t)
- if err != nil {
- t.Fatal(err)
- }
- defer cleanup()
-
- i.Index([]*model.TicketSimpleResponse{
- {ID: 0, Name: "bar"},
- {ID: 1, Name: "foo"},
- })
-
- gotIds, err := i.Search(tt.args.term)
- if (err != nil) != tt.wantErr {
- t.Errorf("Search() error = %v, wantErr %v", err, tt.wantErr)
-
- return
- }
- if !reflect.DeepEqual(gotIds, tt.wantIds) {
- t.Errorf("Search() gotIds = %v, want %v", gotIds, tt.wantIds)
- }
- })
- }
-}
-
-func TestIndex_Truncate(t *testing.T) {
- t.Parallel()
-
- tests := []struct {
- name string
- wantErr bool
- }{
- {name: "Truncate"},
- }
- for _, tt := range tests {
- tt := tt
- t.Run(tt.name, func(t *testing.T) {
- t.Parallel()
-
- i, cleanup, err := test.Index(t)
- if err != nil {
- t.Fatal(err)
- }
- defer cleanup()
-
- i.Index([]*model.TicketSimpleResponse{
- {ID: 0, Name: "bar"},
- {ID: 1, Name: "foo"},
- })
-
- if err := i.Truncate(); (err != nil) != tt.wantErr {
- t.Errorf("Truncate() error = %v, wantErr %v", err, tt.wantErr)
- }
-
- ids, err := i.Search("foo")
- if err != nil {
- t.Fatal(err)
- }
-
- if ids != nil {
- t.Fatal("should return no results")
- }
- })
- }
-}
diff --git a/main.go b/main.go
new file mode 100644
index 0000000..4dc326b
--- /dev/null
+++ b/main.go
@@ -0,0 +1,35 @@
+package main
+
+import (
+ "log"
+
+ "github.com/pocketbase/pocketbase"
+
+ "github.com/SecurityBrewery/catalyst/migrations"
+)
+
+func main() {
+ if err := run(); err != nil {
+ log.Fatal(err)
+ }
+}
+
+func run() error {
+ migrations.Register()
+
+ app := pocketbase.NewWithConfig(pocketbase.Config{
+ DefaultDev: dev(),
+ DefaultDataDir: "catalyst_data",
+ })
+
+ attachWebhooks(app)
+
+ // Register additional commands
+ app.RootCmd.AddCommand(bootstrapCmd(app))
+ app.RootCmd.AddCommand(fakeDataCmd(app))
+ app.RootCmd.AddCommand(setFeatureFlagsCmd(app))
+
+ app.OnBeforeServe().Add(addRoutes())
+
+ return app.Start()
+}
diff --git a/migrations/0_base.go b/migrations/0_base.go
new file mode 100644
index 0000000..5e5b145
--- /dev/null
+++ b/migrations/0_base.go
@@ -0,0 +1,57 @@
+package migrations
+
+import (
+ "github.com/pocketbase/dbx"
+ "github.com/pocketbase/pocketbase/daos"
+ "github.com/pocketbase/pocketbase/models/settings"
+ "github.com/pocketbase/pocketbase/tools/types"
+)
+
+type baseUpFunc func(dao *daos.Dao) error
+
+func baseUp(db dbx.Builder) error {
+ dao := daos.New(db)
+
+ for _, f := range []baseUpFunc{
+ settingsUp,
+ allowUserViewUp,
+ } {
+ if err := f(dao); err != nil {
+ return err
+ }
+ }
+
+ return nil
+}
+
+func settingsUp(dao *daos.Dao) error {
+ s := settings.New()
+ s.Meta.AppName = "Catalyst"
+ s.Meta.HideControls = false
+
+ return dao.SaveSettings(s)
+}
+
+func allowUserViewUp(dao *daos.Dao) error {
+ collection, err := dao.FindCollectionByNameOrId(UserCollectionName)
+ if err != nil {
+ return err
+ }
+
+ collection.ViewRule = types.Pointer("@request.auth.id != ''")
+ collection.ListRule = types.Pointer("@request.auth.id != ''")
+
+ return dao.SaveCollection(collection)
+}
+
+func baseDown(db dbx.Builder) error {
+ collection, err := daos.New(db).FindCollectionByNameOrId(UserCollectionName)
+ if err != nil {
+ return err
+ }
+
+ collection.ViewRule = types.Pointer("id = @request.auth.id")
+ collection.ListRule = types.Pointer("id = @request.auth.id")
+
+ return daos.New(db).SaveCollection(collection)
+}
diff --git a/migrations/1_collections.go b/migrations/1_collections.go
new file mode 100644
index 0000000..cdbf058
--- /dev/null
+++ b/migrations/1_collections.go
@@ -0,0 +1,165 @@
+package migrations
+
+import (
+ "fmt"
+
+ "github.com/pocketbase/dbx"
+ "github.com/pocketbase/pocketbase/daos"
+ "github.com/pocketbase/pocketbase/models"
+ "github.com/pocketbase/pocketbase/models/schema"
+ "github.com/pocketbase/pocketbase/tools/types"
+)
+
+const (
+ TimelineCollectionName = "timeline"
+ CommentCollectionName = "comments"
+ fileCollectionName = "files"
+ LinkCollectionName = "links"
+ TaskCollectionName = "tasks"
+ TicketCollectionName = "tickets"
+ TypeCollectionName = "types"
+ WebhookCollectionName = "webhooks"
+ FeatureCollectionName = "features"
+
+ UserCollectionName = "_pb_users_auth_"
+)
+
+func collectionsUp(db dbx.Builder) error {
+ collections := []*models.Collection{
+ internalCollection(&models.Collection{
+ Name: TypeCollectionName,
+ Type: models.CollectionTypeBase,
+ Schema: schema.NewSchema(
+ &schema.SchemaField{Name: "singular", Type: schema.FieldTypeText, Required: true},
+ &schema.SchemaField{Name: "plural", Type: schema.FieldTypeText, Required: true},
+ &schema.SchemaField{Name: "icon", Type: schema.FieldTypeText, Required: true},
+ &schema.SchemaField{Name: "schema", Type: schema.FieldTypeJson, Required: true, Options: &schema.JsonOptions{MaxSize: 50_000}},
+ ),
+ }),
+ internalCollection(&models.Collection{
+ Name: TicketCollectionName,
+ Type: models.CollectionTypeBase,
+ Schema: schema.NewSchema(
+ &schema.SchemaField{Name: "name", Type: schema.FieldTypeText, Required: true},
+ &schema.SchemaField{Name: "type", Type: schema.FieldTypeRelation, Options: &schema.RelationOptions{CollectionId: TypeCollectionName, MaxSelect: types.Pointer(1)}},
+ &schema.SchemaField{Name: "description", Type: schema.FieldTypeText},
+ &schema.SchemaField{Name: "open", Type: schema.FieldTypeBool},
+ &schema.SchemaField{Name: "resolution", Type: schema.FieldTypeText},
+ &schema.SchemaField{Name: "schema", Type: schema.FieldTypeJson, Options: &schema.JsonOptions{MaxSize: 50_000}},
+ &schema.SchemaField{Name: "state", Type: schema.FieldTypeJson, Options: &schema.JsonOptions{MaxSize: 50_000}},
+ &schema.SchemaField{Name: "owner", Type: schema.FieldTypeRelation, Options: &schema.RelationOptions{CollectionId: UserCollectionName, MaxSelect: types.Pointer(1)}},
+ ),
+ }),
+ internalCollection(&models.Collection{
+ Name: TaskCollectionName,
+ Type: models.CollectionTypeBase,
+ Schema: schema.NewSchema(
+ &schema.SchemaField{Name: "ticket", Type: schema.FieldTypeRelation, Required: true, Options: &schema.RelationOptions{CollectionId: TicketCollectionName, MaxSelect: types.Pointer(1), CascadeDelete: true}},
+ &schema.SchemaField{Name: "name", Type: schema.FieldTypeText, Required: true},
+ &schema.SchemaField{Name: "open", Type: schema.FieldTypeBool},
+ &schema.SchemaField{Name: "owner", Type: schema.FieldTypeRelation, Options: &schema.RelationOptions{CollectionId: UserCollectionName, MaxSelect: types.Pointer(1)}},
+ ),
+ }),
+ internalCollection(&models.Collection{
+ Name: CommentCollectionName,
+ Type: models.CollectionTypeBase,
+ Schema: schema.NewSchema(
+ &schema.SchemaField{Name: "ticket", Type: schema.FieldTypeRelation, Required: true, Options: &schema.RelationOptions{CollectionId: TicketCollectionName, MaxSelect: types.Pointer(1), CascadeDelete: true}},
+ &schema.SchemaField{Name: "author", Type: schema.FieldTypeRelation, Options: &schema.RelationOptions{CollectionId: UserCollectionName, MaxSelect: types.Pointer(1)}},
+ &schema.SchemaField{Name: "message", Type: schema.FieldTypeText, Required: true},
+ ),
+ }),
+ internalCollection(&models.Collection{
+ Name: TimelineCollectionName,
+ Type: models.CollectionTypeBase,
+ Schema: schema.NewSchema(
+ &schema.SchemaField{Name: "ticket", Type: schema.FieldTypeRelation, Required: true, Options: &schema.RelationOptions{CollectionId: TicketCollectionName, MaxSelect: types.Pointer(1), CascadeDelete: true}},
+ &schema.SchemaField{Name: "time", Type: schema.FieldTypeDate, Required: true},
+ &schema.SchemaField{Name: "message", Type: schema.FieldTypeText, Required: true},
+ ),
+ }),
+ internalCollection(&models.Collection{
+ Name: LinkCollectionName,
+ Type: models.CollectionTypeBase,
+ Schema: schema.NewSchema(
+ &schema.SchemaField{Name: "ticket", Type: schema.FieldTypeRelation, Required: true, Options: &schema.RelationOptions{CollectionId: TicketCollectionName, MaxSelect: types.Pointer(1), CascadeDelete: true}},
+ &schema.SchemaField{Name: "name", Type: schema.FieldTypeText, Required: true},
+ &schema.SchemaField{Name: "url", Type: schema.FieldTypeUrl, Required: true},
+ ),
+ }),
+
+ internalCollection(&models.Collection{
+ Name: fileCollectionName,
+ Type: models.CollectionTypeBase,
+ Schema: schema.NewSchema(
+ &schema.SchemaField{Name: "ticket", Type: schema.FieldTypeRelation, Required: true, Options: &schema.RelationOptions{CollectionId: TicketCollectionName, MaxSelect: types.Pointer(1), CascadeDelete: true}},
+ &schema.SchemaField{Name: "name", Type: schema.FieldTypeText, Required: true},
+ &schema.SchemaField{Name: "size", Type: schema.FieldTypeNumber, Required: true},
+ &schema.SchemaField{Name: "blob", Type: schema.FieldTypeFile, Required: true, Options: &schema.FileOptions{MaxSelect: 1, MaxSize: 1024 * 1024 * 100}},
+ ),
+ }),
+ {
+ BaseModel: models.BaseModel{
+ Id: FeatureCollectionName,
+ },
+ Name: FeatureCollectionName,
+ Type: models.CollectionTypeBase,
+ Schema: schema.NewSchema(
+ &schema.SchemaField{Name: "name", Type: schema.FieldTypeText, Required: true},
+ ),
+ ListRule: types.Pointer("@request.auth.id != ''"),
+ ViewRule: types.Pointer("@request.auth.id != ''"),
+ Indexes: types.JsonArray[string]{
+ fmt.Sprintf("CREATE UNIQUE INDEX `unique_name` ON `%s` (`name`)", FeatureCollectionName),
+ },
+ },
+ }
+
+ dao := daos.New(db)
+ for _, c := range collections {
+ if err := dao.SaveCollection(c); err != nil {
+ return err
+ }
+ }
+
+ return nil
+}
+
+func internalCollection(c *models.Collection) *models.Collection {
+ c.Id = c.Name
+ c.ListRule = types.Pointer("@request.auth.id != ''")
+ c.ViewRule = types.Pointer("@request.auth.id != ''")
+ c.CreateRule = types.Pointer("@request.auth.id != ''")
+ c.UpdateRule = types.Pointer("@request.auth.id != ''")
+ c.DeleteRule = types.Pointer("@request.auth.id != ''")
+
+ return c
+}
+
+func collectionsDown(db dbx.Builder) error {
+ collections := []string{
+ TicketCollectionName,
+ TypeCollectionName,
+ fileCollectionName,
+ LinkCollectionName,
+ TaskCollectionName,
+ CommentCollectionName,
+ TimelineCollectionName,
+ FeatureCollectionName,
+ }
+
+ dao := daos.New(db)
+
+ for _, name := range collections {
+ id, err := dao.FindCollectionByNameOrId(name)
+ if err != nil {
+ return err
+ }
+
+ if err := dao.DeleteCollection(id); err != nil {
+ return err
+ }
+ }
+
+ return nil
+}
diff --git a/migrations/3_defaultdata.go b/migrations/3_defaultdata.go
new file mode 100644
index 0000000..8170745
--- /dev/null
+++ b/migrations/3_defaultdata.go
@@ -0,0 +1,51 @@
+package migrations
+
+import (
+ "github.com/pocketbase/dbx"
+ "github.com/pocketbase/pocketbase/daos"
+ "github.com/pocketbase/pocketbase/models"
+ "github.com/pocketbase/pocketbase/tools/security"
+)
+
+func defaultDataUp(db dbx.Builder) error {
+ dao := daos.New(db)
+
+ for _, records := range [][]*models.Record{typeRecords(dao)} {
+ for _, record := range records {
+ if err := dao.SaveRecord(record); err != nil {
+ return err
+ }
+ }
+ }
+
+ return nil
+}
+
+func typeRecords(dao *daos.Dao) []*models.Record {
+ collection, err := dao.FindCollectionByNameOrId(TypeCollectionName)
+ if err != nil {
+ panic(err)
+ }
+
+ var records []*models.Record
+
+ record := models.NewRecord(collection)
+ record.SetId("y_" + security.PseudorandomString(5))
+ record.Set("singular", "Incident")
+ record.Set("plural", "Incidents")
+ record.Set("icon", "Flame")
+ record.Set("schema", `{"type":"object","properties":{"tlp":{"title":"TLP","type":"string"}}}`)
+
+ records = append(records, record)
+
+ record = models.NewRecord(collection)
+ record.SetId("y_" + security.PseudorandomString(5))
+ record.Set("singular", "Alert")
+ record.Set("plural", "Alerts")
+ record.Set("icon", "AlertTriangle")
+ record.Set("schema", `{"type":"object","properties":{"severity":{"title":"Severity","type":"string"}},"required": ["severity"]}`)
+
+ records = append(records, record)
+
+ return records
+}
diff --git a/migrations/4_views.go b/migrations/4_views.go
new file mode 100644
index 0000000..7ad190d
--- /dev/null
+++ b/migrations/4_views.go
@@ -0,0 +1,70 @@
+package migrations
+
+import (
+ "github.com/pocketbase/dbx"
+ "github.com/pocketbase/pocketbase/daos"
+ "github.com/pocketbase/pocketbase/models"
+ "github.com/pocketbase/pocketbase/tools/types"
+)
+
+const (
+ dashboardCountsViewName = "dashboard_counts"
+ sidebarViewName = "sidebar"
+)
+
+const dashboardCountsViewQuery = `SELECT id, count FROM (
+ SELECT 'users' as id, COUNT(users.id) as count FROM users
+ UNION
+ SELECT 'tickets' as id, COUNT(tickets.id) as count FROM tickets
+ UNION
+ SELECT 'tasks' as id, COUNT(tasks.id) as count FROM tasks
+) as counts;`
+
+const sidebarViewQuery = `SELECT types.id as id, types.singular as singular, types.plural as plural, types.icon as icon, (SELECT COUNT(tickets.id) FROM tickets WHERE tickets.type = types.id AND tickets.open = true) as count
+FROM types
+ORDER BY types.plural;`
+
+func viewsUp(db dbx.Builder) error {
+ collections := []*models.Collection{
+ internalView(dashboardCountsViewName, dashboardCountsViewQuery),
+ internalView(sidebarViewName, sidebarViewQuery),
+ }
+
+ dao := daos.New(db)
+ for _, c := range collections {
+ if err := dao.SaveCollection(c); err != nil {
+ return err
+ }
+ }
+
+ return nil
+}
+
+func internalView(name, query string) *models.Collection {
+ return &models.Collection{
+ Name: name,
+ Type: models.CollectionTypeView,
+ Options: types.JsonMap{"query": query},
+ ListRule: types.Pointer("@request.auth.id != ''"),
+ ViewRule: types.Pointer("@request.auth.id != ''"),
+ }
+}
+
+func viewsDown(db dbx.Builder) error {
+ dao := daos.New(db)
+
+ collections := []string{dashboardCountsViewName, sidebarViewName}
+
+ for _, c := range collections {
+ id, err := dao.FindCollectionByNameOrId(c)
+ if err != nil {
+ return err
+ }
+
+ if err := dao.DeleteCollection(id); err != nil {
+ return err
+ }
+ }
+
+ return nil
+}
diff --git a/migrations/migrations.go b/migrations/migrations.go
new file mode 100644
index 0000000..d0ab957
--- /dev/null
+++ b/migrations/migrations.go
@@ -0,0 +1,12 @@
+package migrations
+
+import (
+ "github.com/pocketbase/pocketbase/migrations"
+)
+
+func Register() {
+ migrations.Register(baseUp, baseDown, "1700000000_base.go")
+ migrations.Register(collectionsUp, collectionsDown, "1700000001_collections.go")
+ migrations.Register(defaultDataUp, nil, "1700000003_defaultdata.go")
+ migrations.Register(viewsUp, viewsDown, "1700000004_views.go")
+}
diff --git a/roles.go b/roles.go
deleted file mode 100644
index a0c64be..0000000
--- a/roles.go
+++ /dev/null
@@ -1,50 +0,0 @@
-package catalyst
-
-import maut "github.com/jonas-plum/maut/auth"
-
-var Admin = &maut.Role{
- Name: "admin",
- Permissions: append(engineer.Permissions,
- "backup:create",
- "backup:restore",
- "dashboard:write",
- "job:read",
- "job:write",
- "log:read",
- "settings:write",
- "ticket:delete",
- "user:write",
- "userdata:write",
- ),
-}
-
-var engineer = &maut.Role{
- Name: "engineer",
- Permissions: append(analyst.Permissions,
- "automation:write",
- "playbook:write",
- "template:write",
- "tickettype:write",
- ),
-}
-
-var analyst = &maut.Role{
- Name: "analyst",
- Permissions: []string{
- "automation:read",
- "currentuser:read",
- "currentuserdata:read",
- "currentuserdata:write",
- "dashboard:read",
- "file:read",
- "file:write",
- "playbook:read",
- "settings:read",
- "template:read",
- "ticket:read",
- "ticket:write",
- "tickettype:read",
- "user:read",
- "userdata:read",
- },
-}
diff --git a/routes.go b/routes.go
new file mode 100644
index 0000000..dc9fa99
--- /dev/null
+++ b/routes.go
@@ -0,0 +1,62 @@
+package main
+
+import (
+ "embed"
+ "io/fs"
+ "net/http"
+ "net/http/httputil"
+ "net/url"
+ "os"
+ "strings"
+
+ "github.com/labstack/echo/v5"
+ "github.com/pocketbase/pocketbase/apis"
+ "github.com/pocketbase/pocketbase/core"
+)
+
+//go:embed ui/dist/*
+var ui embed.FS
+
+func dev() bool {
+ return strings.HasPrefix(os.Args[0], os.TempDir())
+}
+
+func addRoutes() func(*core.ServeEvent) error {
+ return func(e *core.ServeEvent) error {
+ e.Router.GET("/", func(c echo.Context) error {
+ return c.Redirect(http.StatusFound, "/ui/")
+ })
+ e.Router.GET("/ui/*", staticFiles())
+ e.Router.GET("/api/config", func(c echo.Context) error {
+ flags, err := flags(e.App)
+ if err != nil {
+ return err
+ }
+
+ return c.JSON(http.StatusOK, map[string]any{
+ "flags": flags,
+ })
+ })
+
+ return nil
+ }
+}
+
+func staticFiles() func(echo.Context) error {
+ return func(c echo.Context) error {
+ if dev() {
+ u, _ := url.Parse("http://localhost:3000/")
+ proxy := httputil.NewSingleHostReverseProxy(u)
+
+ c.Request().Host = c.Request().URL.Host
+
+ proxy.ServeHTTP(c.Response(), c.Request())
+
+ return nil
+ }
+
+ fsys, _ := fs.Sub(ui, "ui/dist")
+
+ return apis.StaticDirectoryHandler(fsys, true)(c)
+ }
+}
diff --git a/server.go b/server.go
deleted file mode 100644
index 40bc126..0000000
--- a/server.go
+++ /dev/null
@@ -1,131 +0,0 @@
-package catalyst
-
-import (
- "context"
- "fmt"
- "net/http"
- "time"
-
- "github.com/go-chi/chi/v5"
- "github.com/go-chi/chi/v5/middleware"
- maut "github.com/jonas-plum/maut/auth"
-
- "github.com/SecurityBrewery/catalyst/bus"
- "github.com/SecurityBrewery/catalyst/busservice"
- "github.com/SecurityBrewery/catalyst/database"
- "github.com/SecurityBrewery/catalyst/generated/api"
- "github.com/SecurityBrewery/catalyst/hooks"
- "github.com/SecurityBrewery/catalyst/index"
- "github.com/SecurityBrewery/catalyst/service"
- "github.com/SecurityBrewery/catalyst/storage"
-)
-
-type Config struct {
- IndexPath string
- DB *database.Config
- Storage *storage.Config
-
- Auth *maut.Config
- ExternalAddress string
- InternalAddress string
- Network string
- Port int
-}
-
-type Server struct {
- Bus *bus.Bus
- DB *database.Database
- Index *index.Index
- Storage *storage.Storage
- Server chi.Router
-}
-
-func New(hooks *hooks.Hooks, config *Config) (*Server, error) {
- ctx := context.Background()
- ctx, cancel := context.WithTimeout(ctx, time.Minute*10)
- defer cancel()
-
- catalystStorage, err := storage.New(config.Storage)
- if err != nil {
- return nil, fmt.Errorf("failed to create storage: %w", err)
- }
-
- catalystIndex, err := index.New(config.IndexPath)
- if err != nil {
- return nil, fmt.Errorf("failed to create index: %w", err)
- }
-
- catalystBus := bus.New()
-
- catalystDatabase, err := database.New(ctx, catalystIndex, catalystBus, hooks, config.DB)
- if err != nil {
- return nil, fmt.Errorf("failed to create database: %w", err)
- }
-
- busservice.New(config.InternalAddress+"/api", config.Auth.InitialAPIKey, config.Network, catalystBus, catalystDatabase)
-
- catalystService, err := service.New(catalystBus, catalystDatabase, catalystStorage, GetVersion())
- if err != nil {
- return nil, fmt.Errorf("failed to create service: %w", err)
- }
-
- authenticator, err := maut.NewAuthenticator(ctx, config.Auth, newCatalystResolver(catalystDatabase))
- if err != nil {
- return nil, fmt.Errorf("failed to create authenticator: %w", err)
- }
-
- apiServer, err := setupAPI(authenticator, catalystService, catalystStorage, catalystDatabase, catalystBus, config)
- if err != nil {
- return nil, fmt.Errorf("failed to create api server: %w", err)
- }
-
- return &Server{
- Bus: catalystBus,
- DB: catalystDatabase,
- Index: catalystIndex,
- Storage: catalystStorage,
- Server: apiServer,
- }, nil
-}
-
-func setupAPI(authenticator *maut.Authenticator, catalystService *service.Service, catalystStorage *storage.Storage, catalystDatabase *database.Database, bus *bus.Bus, config *Config) (chi.Router, error) {
- middlewares := []func(next http.Handler) http.Handler{
- authenticator.Authenticate(),
- authenticator.AuthorizeBlockedUser(),
- }
-
- // create server
- apiServer := api.NewServer(catalystService, permissionAuth(authenticator), middlewares...)
- apiServer.Mount("/files", fileServer(authenticator, catalystDatabase, bus, catalystStorage, config))
-
- server := chi.NewRouter()
- server.Use(middleware.RequestID, middleware.RealIP, middleware.Logger, middleware.Recoverer)
- server.Mount("/api", apiServer)
- server.Mount("/auth", authenticator.Server())
- server.With(middlewares...).Handle("/wss", handleWebSocket(bus))
-
- server.Get("/", func(w http.ResponseWriter, r *http.Request) {
- http.Redirect(w, r, "/ui/", http.StatusFound)
- })
-
- return server, nil
-}
-
-func permissionAuth(authenticator *maut.Authenticator) func([]string) func(http.Handler) http.Handler {
- return func(strings []string) func(http.Handler) http.Handler {
- return authenticator.AuthorizePermission(strings...)
- }
-}
-
-func fileServer(authenticator *maut.Authenticator, catalystDatabase *database.Database, bus *bus.Bus, catalystStorage *storage.Storage, config *Config) *chi.Mux {
- fileRW := authenticator.AuthorizePermission("file:read", "file:write") // TODO: add test
- tudHandler := tusdUpload(catalystDatabase, bus, catalystStorage.S3(), config.ExternalAddress)
- server := chi.NewRouter()
- server.With(fileRW).Head("/{ticketID}/tusd/{id}", tudHandler)
- server.With(fileRW).Patch("/{ticketID}/tusd/{id}", tudHandler)
- server.With(fileRW).Post("/{ticketID}/tusd", tudHandler)
- server.With(fileRW).Post("/{ticketID}/upload", upload(catalystDatabase, catalystStorage.S3(), catalystStorage.Uploader()))
- server.With(fileRW).Get("/{ticketID}/download/{key}", download(catalystStorage.Downloader()))
-
- return server
-}
diff --git a/service/automation.go b/service/automation.go
deleted file mode 100644
index c8a81ca..0000000
--- a/service/automation.go
+++ /dev/null
@@ -1,49 +0,0 @@
-package service
-
-import (
- "context"
- "fmt"
-
- "github.com/arangodb/go-driver"
-
- "github.com/SecurityBrewery/catalyst/database"
- "github.com/SecurityBrewery/catalyst/generated/model"
-)
-
-func automationResponseID(automation *model.AutomationResponse) []driver.DocumentID {
- if automation == nil {
- return nil
- }
-
- return automationID(automation.ID)
-}
-
-func automationID(id string) []driver.DocumentID {
- return []driver.DocumentID{driver.DocumentID(fmt.Sprintf("%s/%s", database.AutomationCollectionName, id))}
-}
-
-func (s *Service) ListAutomations(ctx context.Context) ([]*model.AutomationResponse, error) {
- return s.database.AutomationList(ctx)
-}
-
-func (s *Service) CreateAutomation(ctx context.Context, form *model.AutomationForm) (doc *model.AutomationResponse, err error) {
- defer s.publishRequest(ctx, err, "CreateAutomation", automationResponseID(doc))
-
- return s.database.AutomationCreate(ctx, form)
-}
-
-func (s *Service) GetAutomation(ctx context.Context, id string) (*model.AutomationResponse, error) {
- return s.database.AutomationGet(ctx, id)
-}
-
-func (s *Service) UpdateAutomation(ctx context.Context, id string, form *model.AutomationForm) (doc *model.AutomationResponse, err error) {
- defer s.publishRequest(ctx, err, "UpdateAutomation", automationResponseID(doc))
-
- return s.database.AutomationUpdate(ctx, id, form)
-}
-
-func (s *Service) DeleteAutomation(ctx context.Context, id string) (err error) {
- defer s.publishRequest(ctx, err, "DeleteAutomation", automationID(id))
-
- return s.database.AutomationDelete(ctx, id)
-}
diff --git a/service/dashboard.go b/service/dashboard.go
deleted file mode 100644
index abba06c..0000000
--- a/service/dashboard.go
+++ /dev/null
@@ -1,53 +0,0 @@
-package service
-
-import (
- "context"
- "fmt"
-
- "github.com/arangodb/go-driver"
-
- "github.com/SecurityBrewery/catalyst/database"
- "github.com/SecurityBrewery/catalyst/generated/model"
-)
-
-func dashboardResponseID(doc *model.DashboardResponse) []driver.DocumentID {
- if doc == nil {
- return nil
- }
-
- return templateID(doc.ID)
-}
-
-func dashboardID(id string) []driver.DocumentID {
- return []driver.DocumentID{driver.DocumentID(fmt.Sprintf("%s/%s", database.DashboardCollectionName, id))}
-}
-
-func (s *Service) ListDashboards(ctx context.Context) ([]*model.DashboardResponse, error) {
- return s.database.DashboardList(ctx)
-}
-
-func (s *Service) CreateDashboard(ctx context.Context, dashboard *model.Dashboard) (doc *model.DashboardResponse, err error) {
- defer s.publishRequest(ctx, err, "CreateDashboard", dashboardResponseID(doc))
-
- return s.database.DashboardCreate(ctx, dashboard)
-}
-
-func (s *Service) GetDashboard(ctx context.Context, id string) (*model.DashboardResponse, error) {
- return s.database.DashboardGet(ctx, id)
-}
-
-func (s *Service) UpdateDashboard(ctx context.Context, id string, form *model.Dashboard) (doc *model.DashboardResponse, err error) {
- defer s.publishRequest(ctx, err, "UpdateDashboard", dashboardResponseID(doc))
-
- return s.database.DashboardUpdate(ctx, id, form)
-}
-
-func (s *Service) DeleteDashboard(ctx context.Context, id string) (err error) {
- defer s.publishRequest(ctx, err, "DeleteDashboard", dashboardID(id))
-
- return s.database.DashboardDelete(ctx, id)
-}
-
-func (s *Service) DashboardData(ctx context.Context, aggregation string, filter *string) (map[string]any, error) {
- return s.database.WidgetData(ctx, aggregation, filter)
-}
diff --git a/service/job.go b/service/job.go
deleted file mode 100644
index 16fa862..0000000
--- a/service/job.go
+++ /dev/null
@@ -1,63 +0,0 @@
-package service
-
-import (
- "context"
- "fmt"
-
- "github.com/arangodb/go-driver"
- "github.com/google/uuid"
-
- "github.com/SecurityBrewery/catalyst/bus"
- "github.com/SecurityBrewery/catalyst/database"
- "github.com/SecurityBrewery/catalyst/generated/model"
-)
-
-func jobResponseID(job *model.JobResponse) []driver.DocumentID {
- if job == nil {
- return nil
- }
-
- return jobID(job.ID)
-}
-
-func jobID(id string) []driver.DocumentID {
- return []driver.DocumentID{driver.DocumentID(fmt.Sprintf("%s/%s", database.JobCollectionName, id))}
-}
-
-func (s *Service) ListJobs(ctx context.Context) ([]*model.JobResponse, error) {
- return s.database.JobList(ctx)
-}
-
-func (s *Service) RunJob(ctx context.Context, form *model.JobForm) (doc *model.JobResponse, err error) {
- msgContext := &model.Context{}
- newJobID := uuid.NewString()
-
- defer s.publishRequest(ctx, err, "RunJob", jobID(newJobID))
- s.bus.JobChannel.Publish(&bus.JobMsg{
- ID: newJobID,
- Automation: form.Automation,
- Origin: form.Origin,
- Message: &model.Message{
- Context: msgContext,
- Payload: form.Payload,
- },
- })
-
- return &model.JobResponse{
- Automation: form.Automation,
- ID: newJobID,
- Origin: form.Origin,
- Payload: form.Payload,
- Status: "published",
- }, nil
-}
-
-func (s *Service) GetJob(ctx context.Context, id string) (*model.JobResponse, error) {
- return s.database.JobGet(ctx, id)
-}
-
-func (s *Service) UpdateJob(ctx context.Context, id string, job *model.JobUpdate) (doc *model.JobResponse, err error) {
- defer s.publishRequest(ctx, err, "UpdateJob", jobResponseID(doc))
-
- return s.database.JobUpdate(ctx, id, job)
-}
diff --git a/service/log.go b/service/log.go
deleted file mode 100644
index d0ae307..0000000
--- a/service/log.go
+++ /dev/null
@@ -1,14 +0,0 @@
-package service
-
-import (
- "context"
- "net/url"
-
- "github.com/SecurityBrewery/catalyst/generated/model"
-)
-
-func (s *Service) GetLogs(ctx context.Context, reference string) ([]*model.LogEntry, error) {
- id, _ := url.QueryUnescape(reference)
-
- return s.database.LogList(ctx, id)
-}
diff --git a/service/playbook.go b/service/playbook.go
deleted file mode 100644
index 9309355..0000000
--- a/service/playbook.go
+++ /dev/null
@@ -1,49 +0,0 @@
-package service
-
-import (
- "context"
- "fmt"
-
- "github.com/arangodb/go-driver"
-
- "github.com/SecurityBrewery/catalyst/database"
- "github.com/SecurityBrewery/catalyst/generated/model"
-)
-
-func playbookResponseID(playbook *model.PlaybookTemplateResponse) []driver.DocumentID {
- if playbook == nil {
- return nil
- }
-
- return playbookID(playbook.ID)
-}
-
-func playbookID(id string) []driver.DocumentID {
- return []driver.DocumentID{driver.DocumentID(fmt.Sprintf("%s/%s", database.PlaybookCollectionName, id))}
-}
-
-func (s *Service) ListPlaybooks(ctx context.Context) ([]*model.PlaybookTemplateResponse, error) {
- return s.database.PlaybookList(ctx)
-}
-
-func (s *Service) CreatePlaybook(ctx context.Context, form *model.PlaybookTemplateForm) (doc *model.PlaybookTemplateResponse, err error) {
- defer s.publishRequest(ctx, err, "CreatePlaybook", playbookResponseID(doc))
-
- return s.database.PlaybookCreate(ctx, form)
-}
-
-func (s *Service) GetPlaybook(ctx context.Context, id string) (*model.PlaybookTemplateResponse, error) {
- return s.database.PlaybookGet(ctx, id)
-}
-
-func (s *Service) UpdatePlaybook(ctx context.Context, id string, form *model.PlaybookTemplateForm) (doc *model.PlaybookTemplateResponse, err error) {
- defer s.publishRequest(ctx, err, "UpdatePlaybook", playbookResponseID(doc))
-
- return s.database.PlaybookUpdate(ctx, id, form)
-}
-
-func (s *Service) DeletePlaybook(ctx context.Context, id string) (err error) {
- defer s.publishRequest(ctx, err, "DeletePlaybook", playbookID(id))
-
- return s.database.PlaybookDelete(ctx, id)
-}
diff --git a/service/service.go b/service/service.go
deleted file mode 100644
index ea3ce76..0000000
--- a/service/service.go
+++ /dev/null
@@ -1,42 +0,0 @@
-package service
-
-import (
- "context"
-
- "github.com/arangodb/go-driver"
- maut "github.com/jonas-plum/maut/auth"
-
- "github.com/SecurityBrewery/catalyst/bus"
- "github.com/SecurityBrewery/catalyst/database"
- "github.com/SecurityBrewery/catalyst/storage"
-)
-
-type Service struct {
- bus *bus.Bus
- database *database.Database
- storage *storage.Storage
- version string
-}
-
-func New(bus *bus.Bus, database *database.Database, storage *storage.Storage, version string) (*Service, error) {
- return &Service{database: database, bus: bus, storage: storage, version: version}, nil
-}
-
-func (s *Service) publishRequest(ctx context.Context, err error, function string, ids []driver.DocumentID) {
- if err != nil {
- return
- }
- if ids != nil {
- userID := "unknown"
- user, _, ok := maut.UserFromContext(ctx)
- if ok {
- userID = user.ID
- }
-
- s.bus.RequestChannel.Publish(&bus.RequestMsg{
- User: userID,
- Function: function,
- IDs: ids,
- })
- }
-}
diff --git a/service/settings.go b/service/settings.go
deleted file mode 100644
index 1223b10..0000000
--- a/service/settings.go
+++ /dev/null
@@ -1,50 +0,0 @@
-package service
-
-import (
- "context"
-
- maut "github.com/jonas-plum/maut/auth"
-
- "github.com/SecurityBrewery/catalyst/generated/model"
-)
-
-func (s *Service) GetSettings(ctx context.Context) (*model.SettingsResponse, error) {
- globalSettings, err := s.database.Settings(ctx)
- if err != nil {
- return nil, err
- }
-
- return s.settings(ctx, globalSettings)
-}
-
-func (s *Service) SaveSettings(ctx context.Context, settings *model.Settings) (*model.SettingsResponse, error) {
- globalSettings, err := s.database.SaveSettings(ctx, settings)
- if err != nil {
- return nil, err
- }
-
- return s.settings(ctx, globalSettings)
-}
-
-func (s *Service) settings(ctx context.Context, globalSettings *model.Settings) (*model.SettingsResponse, error) {
- user, permissions, ok := maut.UserFromContext(ctx)
- if ok {
- userData, _ := s.database.UserDataGet(ctx, user.ID)
-
- if userData != nil && userData.Timeformat != nil {
- globalSettings.Timeformat = *userData.Timeformat
- }
- }
-
- ticketTypeList, _ := s.database.TicketTypeList(ctx)
-
- return &model.SettingsResponse{
- Tier: model.SettingsResponseTierCommunity,
- Version: s.version,
- Roles: permissions,
- TicketTypes: ticketTypeList,
- ArtifactStates: globalSettings.ArtifactStates,
- ArtifactKinds: globalSettings.ArtifactKinds,
- Timeformat: globalSettings.Timeformat,
- }, nil
-}
diff --git a/service/statistics.go b/service/statistics.go
deleted file mode 100644
index c9a2449..0000000
--- a/service/statistics.go
+++ /dev/null
@@ -1,11 +0,0 @@
-package service
-
-import (
- "context"
-
- "github.com/SecurityBrewery/catalyst/generated/model"
-)
-
-func (s *Service) GetStatistics(ctx context.Context) (*model.Statistics, error) {
- return s.database.Statistics(ctx)
-}
diff --git a/service/task.go b/service/task.go
deleted file mode 100644
index 5935ea4..0000000
--- a/service/task.go
+++ /dev/null
@@ -1,11 +0,0 @@
-package service
-
-import (
- "context"
-
- "github.com/SecurityBrewery/catalyst/generated/model"
-)
-
-func (s *Service) ListTasks(ctx context.Context) ([]*model.TaskWithContext, error) {
- return s.database.TaskList(ctx)
-}
diff --git a/service/template.go b/service/template.go
deleted file mode 100644
index 886dfa8..0000000
--- a/service/template.go
+++ /dev/null
@@ -1,49 +0,0 @@
-package service
-
-import (
- "context"
- "fmt"
-
- "github.com/arangodb/go-driver"
-
- "github.com/SecurityBrewery/catalyst/database"
- "github.com/SecurityBrewery/catalyst/generated/model"
-)
-
-func templateResponseID(template *model.TicketTemplateResponse) []driver.DocumentID {
- if template == nil {
- return nil
- }
-
- return templateID(template.ID)
-}
-
-func templateID(id string) []driver.DocumentID {
- return []driver.DocumentID{driver.DocumentID(fmt.Sprintf("%s/%s", database.TemplateCollectionName, id))}
-}
-
-func (s *Service) ListTemplates(ctx context.Context) ([]*model.TicketTemplateResponse, error) {
- return s.database.TemplateList(ctx)
-}
-
-func (s *Service) CreateTemplate(ctx context.Context, form *model.TicketTemplateForm) (doc *model.TicketTemplateResponse, err error) {
- defer s.publishRequest(ctx, err, "CreateTemplate", templateResponseID(doc))
-
- return s.database.TemplateCreate(ctx, form)
-}
-
-func (s *Service) GetTemplate(ctx context.Context, id string) (*model.TicketTemplateResponse, error) {
- return s.database.TemplateGet(ctx, id)
-}
-
-func (s *Service) UpdateTemplate(ctx context.Context, id string, form *model.TicketTemplateForm) (doc *model.TicketTemplateResponse, err error) {
- defer s.publishRequest(ctx, err, "UpdateTemplate", templateResponseID(doc))
-
- return s.database.TemplateUpdate(ctx, id, form)
-}
-
-func (s *Service) DeleteTemplate(ctx context.Context, id string) (err error) {
- defer s.publishRequest(ctx, err, "DeleteTemplate", templateID(id))
-
- return s.database.TemplateDelete(ctx, id)
-}
diff --git a/service/ticket.go b/service/ticket.go
deleted file mode 100644
index b7b6f0e..0000000
--- a/service/ticket.go
+++ /dev/null
@@ -1,233 +0,0 @@
-package service
-
-import (
- "context"
- "errors"
- "fmt"
- "net/http"
-
- "github.com/arangodb/go-driver"
- "github.com/google/uuid"
-
- "github.com/SecurityBrewery/catalyst/bus"
- "github.com/SecurityBrewery/catalyst/database"
- "github.com/SecurityBrewery/catalyst/generated/api"
- "github.com/SecurityBrewery/catalyst/generated/model"
-)
-
-func ticketWithTicketsID(ticketResponse *model.TicketWithTickets) []driver.DocumentID {
- if ticketResponse == nil {
- return nil
- }
-
- return ticketID(ticketResponse.ID)
-}
-
-func ticketID(ticketID int64) []driver.DocumentID {
- id := fmt.Sprintf("%s/%d", database.TicketCollectionName, ticketID)
-
- return []driver.DocumentID{driver.DocumentID(id)}
-}
-
-func ticketIDs(ticketResponses []*model.TicketResponse) []driver.DocumentID {
- var ids []driver.DocumentID
- for _, ticketResponse := range ticketResponses {
- ids = append(ids, ticketID(ticketResponse.ID)...)
- }
-
- return ids
-}
-
-func (s *Service) ListTickets(ctx context.Context, ticketType *string, offsetP, countP *int, sort []string, descending []bool, queryP *string) (*model.TicketList, error) {
- q := ""
- if queryP != nil && *queryP != "" {
- q = *queryP
- }
- t := ""
- if ticketType != nil && *ticketType != "" {
- t = *ticketType
- }
-
- offset := int64(0)
- if offsetP != nil {
- offset = int64(*offsetP)
- }
-
- count := int64(25)
- if countP != nil {
- count = int64(*countP)
- }
-
- return s.database.TicketList(ctx, t, q, sort, descending, offset, count)
-}
-
-func (s *Service) CreateTicket(ctx context.Context, form *model.TicketForm) (doc *model.TicketResponse, err error) {
- createdTickets, err := s.database.TicketBatchCreate(ctx, []*model.TicketForm{form})
- defer s.publishRequest(ctx, err, "CreateTicket", ticketIDs(createdTickets))
- if len(createdTickets) > 0 {
- return createdTickets[0], err
- }
-
- return nil, err
-}
-
-func (s *Service) CreateTicketBatch(ctx context.Context, ticketFormArray *model.TicketFormArray) error {
- if ticketFormArray == nil {
- return &api.HTTPError{Status: http.StatusUnprocessableEntity, Internal: errors.New("no tickets given")}
- }
- createdTickets, err := s.database.TicketBatchCreate(ctx, *ticketFormArray)
- defer s.publishRequest(ctx, err, "CreateTicket", ticketIDs(createdTickets))
-
- return err
-}
-
-func (s *Service) GetTicket(ctx context.Context, i int64) (*model.TicketWithTickets, error) {
- return s.database.TicketGet(ctx, i)
-}
-
-func (s *Service) UpdateTicket(ctx context.Context, i int64, ticket *model.Ticket) (doc *model.TicketWithTickets, err error) {
- defer s.publishRequest(ctx, err, "UpdateTicket", ticketWithTicketsID(doc))
-
- return s.database.TicketUpdate(ctx, i, ticket)
-}
-
-func (s *Service) DeleteTicket(ctx context.Context, i int64) (err error) {
- defer s.publishRequest(ctx, err, "DeleteTicket", ticketID(i))
-
- return s.database.TicketDelete(ctx, i)
-}
-
-func (s *Service) AddArtifact(ctx context.Context, i int64, artifact *model.Artifact) (doc *model.TicketWithTickets, err error) {
- defer s.publishRequest(ctx, err, "AddArtifact", ticketWithTicketsID(doc))
-
- return s.database.AddArtifact(ctx, i, artifact)
-}
-
-func (s *Service) GetArtifact(ctx context.Context, i int64, s2 string) (*model.Artifact, error) {
- return s.database.ArtifactGet(ctx, i, s2)
-}
-
-func (s *Service) SetArtifact(ctx context.Context, i int64, s2 string, artifact *model.Artifact) (doc *model.TicketWithTickets, err error) {
- defer s.publishRequest(ctx, err, "SetArtifact", ticketWithTicketsID(doc))
-
- return s.database.ArtifactUpdate(ctx, i, s2, artifact)
-}
-
-func (s *Service) RemoveArtifact(ctx context.Context, i int64, s2 string) (doc *model.TicketWithTickets, err error) {
- defer s.publishRequest(ctx, err, "RemoveArtifact", ticketWithTicketsID(doc))
-
- return s.database.RemoveArtifact(ctx, i, s2)
-}
-
-func (s *Service) EnrichArtifact(ctx context.Context, i int64, s2 string, form *model.EnrichmentForm) (doc *model.TicketWithTickets, err error) {
- defer s.publishRequest(ctx, err, "EnrichArtifact", ticketWithTicketsID(doc))
-
- return s.database.EnrichArtifact(ctx, i, s2, form)
-}
-
-func (s *Service) RunArtifact(ctx context.Context, id int64, name string, automation string) error {
- artifact, err := s.database.ArtifactGet(ctx, id, name)
- if err != nil {
- return err
- }
-
- defer s.publishRequest(ctx, err, "RunArtifact", ticketID(id))
-
- jobID := uuid.NewString()
- origin := &model.Origin{ArtifactOrigin: &model.ArtifactOrigin{TicketId: id, Artifact: name}}
-
- s.bus.JobChannel.Publish(&bus.JobMsg{
- ID: jobID,
- Automation: automation,
- Origin: origin,
- Message: &model.Message{
- Context: &model.Context{Artifact: artifact},
- Payload: map[string]string{"default": name},
- },
- })
-
- return nil
-}
-
-func (s *Service) AddComment(ctx context.Context, i int64, form *model.CommentForm) (doc *model.TicketWithTickets, err error) {
- defer s.publishRequest(ctx, err, "AddComment", ticketWithTicketsID(doc))
-
- return s.database.AddComment(ctx, i, form)
-}
-
-func (s *Service) RemoveComment(ctx context.Context, i int64, i2 int) (doc *model.TicketWithTickets, err error) {
- defer s.publishRequest(ctx, err, "RemoveComment", ticketWithTicketsID(doc))
-
- return s.database.RemoveComment(ctx, i, int64(i2))
-}
-
-func (s *Service) AddTicketPlaybook(ctx context.Context, i int64, form *model.PlaybookTemplateForm) (doc *model.TicketWithTickets, err error) {
- defer s.publishRequest(ctx, err, "AddTicketPlaybook", ticketWithTicketsID(doc))
-
- return s.database.AddTicketPlaybook(ctx, i, form)
-}
-
-func (s *Service) RemoveTicketPlaybook(ctx context.Context, i int64, s2 string) (doc *model.TicketWithTickets, err error) {
- defer s.publishRequest(ctx, err, "RemoveTicketPlaybook", ticketWithTicketsID(doc))
-
- return s.database.RemoveTicketPlaybook(ctx, i, s2)
-}
-
-func (s *Service) SetTaskData(ctx context.Context, i int64, s3 string, s2 string, data map[string]any) (doc *model.TicketWithTickets, err error) {
- defer s.publishRequest(ctx, err, "SetTask", ticketWithTicketsID(doc))
-
- return s.database.TaskUpdateData(ctx, i, s3, s2, data)
-}
-
-func (s *Service) SetTaskOwner(ctx context.Context, i int64, s3 string, s2 string, owner string) (doc *model.TicketWithTickets, err error) {
- defer s.publishRequest(ctx, err, "SetTask", ticketWithTicketsID(doc))
-
- return s.database.TaskUpdateOwner(ctx, i, s3, s2, owner)
-}
-
-func (s *Service) CompleteTask(ctx context.Context, i int64, s3 string, s2 string, m map[string]any) (doc *model.TicketWithTickets, err error) {
- defer s.publishRequest(ctx, err, "CompleteTask", ticketWithTicketsID(doc))
-
- return s.database.TaskComplete(ctx, i, s3, s2, m)
-}
-
-func (s *Service) RunTask(ctx context.Context, i int64, s3 string, s2 string) (err error) {
- defer s.publishRequest(ctx, err, "RunTask", ticketID(i))
-
- return s.database.TaskRun(ctx, i, s3, s2)
-}
-
-func (s *Service) SetReferences(ctx context.Context, i int64, references *model.ReferenceArray) (doc *model.TicketWithTickets, err error) {
- if references == nil {
- return nil, &api.HTTPError{Status: http.StatusUnprocessableEntity, Internal: errors.New("no references given")}
- }
- defer s.publishRequest(ctx, err, "SetReferences", ticketID(i))
-
- return s.database.SetReferences(ctx, i, *references)
-}
-
-func (s *Service) SetSchema(ctx context.Context, i int64, s2 string) (doc *model.TicketWithTickets, err error) {
- defer s.publishRequest(ctx, err, "SetSchema", ticketID(i))
-
- return s.database.SetTemplate(ctx, i, s2)
-}
-
-func (s *Service) LinkTicket(ctx context.Context, i int64, i2 int64) (*model.TicketWithTickets, error) {
- err := s.database.RelatedCreate(ctx, i, i2)
- if err != nil {
- return nil, err
- }
- defer s.publishRequest(ctx, err, "LinkTicket", ticketID(i))
-
- return s.GetTicket(ctx, i)
-}
-
-func (s *Service) UnlinkTicket(ctx context.Context, i int64, i2 int64) (*model.TicketWithTickets, error) {
- err := s.database.RelatedRemove(ctx, i, i2)
- if err != nil {
- return nil, err
- }
- defer s.publishRequest(ctx, err, "UnlinkTicket", ticketID(i))
-
- return s.GetTicket(ctx, i)
-}
diff --git a/service/tickettype.go b/service/tickettype.go
deleted file mode 100644
index ae405ee..0000000
--- a/service/tickettype.go
+++ /dev/null
@@ -1,49 +0,0 @@
-package service
-
-import (
- "context"
- "fmt"
-
- "github.com/arangodb/go-driver"
-
- "github.com/SecurityBrewery/catalyst/database"
- "github.com/SecurityBrewery/catalyst/generated/model"
-)
-
-func ticketTypeResponseID(ticketType *model.TicketTypeResponse) []driver.DocumentID {
- if ticketType == nil {
- return nil
- }
-
- return userDataID(ticketType.ID)
-}
-
-func ticketTypeID(id string) []driver.DocumentID {
- return []driver.DocumentID{driver.DocumentID(fmt.Sprintf("%s/%s", database.UserDataCollectionName, id))}
-}
-
-func (s *Service) ListTicketTypes(ctx context.Context) ([]*model.TicketTypeResponse, error) {
- return s.database.TicketTypeList(ctx)
-}
-
-func (s *Service) CreateTicketType(ctx context.Context, form *model.TicketTypeForm) (doc *model.TicketTypeResponse, err error) {
- defer s.publishRequest(ctx, err, "CreateTicketType", ticketTypeResponseID(doc))
-
- return s.database.TicketTypeCreate(ctx, form)
-}
-
-func (s *Service) GetTicketType(ctx context.Context, id string) (*model.TicketTypeResponse, error) {
- return s.database.TicketTypeGet(ctx, id)
-}
-
-func (s *Service) UpdateTicketType(ctx context.Context, id string, form *model.TicketTypeForm) (doc *model.TicketTypeResponse, err error) {
- defer s.publishRequest(ctx, err, "UpdateTicketType", ticketTypeResponseID(doc))
-
- return s.database.TicketTypeUpdate(ctx, id, form)
-}
-
-func (s *Service) DeleteTicketType(ctx context.Context, id string) (err error) {
- defer s.publishRequest(ctx, err, "DeleteTicketType", ticketTypeID(id))
-
- return s.database.TicketTypeDelete(ctx, id)
-}
diff --git a/service/user.go b/service/user.go
deleted file mode 100644
index b117822..0000000
--- a/service/user.go
+++ /dev/null
@@ -1,82 +0,0 @@
-package service
-
-import (
- "context"
- "errors"
- "fmt"
- "net/url"
-
- "github.com/arangodb/go-driver"
- maut "github.com/jonas-plum/maut/auth"
-
- "github.com/SecurityBrewery/catalyst/database"
- "github.com/SecurityBrewery/catalyst/generated/model"
-)
-
-func newUserResponseID(user *model.NewUserResponse) []driver.DocumentID {
- if user == nil {
- return nil
- }
-
- return userID(user.ID)
-}
-
-func userID(id string) []driver.DocumentID {
- return []driver.DocumentID{driver.DocumentID(fmt.Sprintf("%s/%s", database.UserCollectionName, id))}
-}
-
-func (s *Service) ListUsers(ctx context.Context) ([]*model.UserResponse, error) {
- return s.database.UserList(ctx)
-}
-
-func (s *Service) CreateUser(ctx context.Context, form *model.UserForm) (doc *model.NewUserResponse, err error) {
- defer s.publishRequest(ctx, err, "CreateUser", newUserResponseID(doc))
-
- return s.database.UserCreate(ctx, form)
-}
-
-func (s *Service) GetUser(ctx context.Context, id string) (*model.UserResponse, error) {
- decodedValue, err := url.QueryUnescape(id)
- if err == nil {
- id = decodedValue
- }
-
- return s.database.UserGet(ctx, id)
-}
-
-func (s *Service) UpdateUser(ctx context.Context, id string, form *model.UserForm) (doc *model.UserResponse, err error) {
- decodedValue, err := url.QueryUnescape(id)
- if err == nil {
- id = decodedValue
- }
-
- defer s.publishRequest(ctx, err, "UpdateUser", userID(id))
-
- return s.database.UserUpdate(ctx, id, form)
-}
-
-func (s *Service) DeleteUser(ctx context.Context, id string) (err error) {
- decodedValue, err := url.QueryUnescape(id)
- if err == nil {
- id = decodedValue
- }
-
- defer s.publishRequest(ctx, err, "DeleteUser", userID(id))
-
- return s.database.UserDelete(ctx, id)
-}
-
-func (s *Service) CurrentUser(ctx context.Context) (*model.UserResponse, error) {
- user, _, ok := maut.UserFromContext(ctx)
- if !ok {
- return nil, errors.New("no user in context")
- }
- s.publishRequest(ctx, nil, "CurrentUser", userID(user.ID))
-
- return &model.UserResponse{
- ID: user.ID,
- Apikey: user.APIKey,
- Blocked: user.Blocked,
- Roles: user.Roles,
- }, nil
-}
diff --git a/service/userdata.go b/service/userdata.go
deleted file mode 100644
index e8e62ee..0000000
--- a/service/userdata.go
+++ /dev/null
@@ -1,70 +0,0 @@
-package service
-
-import (
- "context"
- "errors"
- "fmt"
- "net/url"
-
- "github.com/arangodb/go-driver"
- maut "github.com/jonas-plum/maut/auth"
-
- "github.com/SecurityBrewery/catalyst/database"
- "github.com/SecurityBrewery/catalyst/generated/model"
-)
-
-func userDataResponseID(userData *model.UserDataResponse) []driver.DocumentID {
- if userData == nil {
- return nil
- }
-
- return userDataID(userData.ID)
-}
-
-func userDataID(id string) []driver.DocumentID {
- return []driver.DocumentID{driver.DocumentID(fmt.Sprintf("%s/%s", database.UserDataCollectionName, id))}
-}
-
-func (s *Service) ListUserData(ctx context.Context) (doc []*model.UserDataResponse, err error) {
- return s.database.UserDataList(ctx)
-}
-
-func (s *Service) GetUserData(ctx context.Context, id string) (*model.UserDataResponse, error) {
- decodedValue, err := url.QueryUnescape(id)
- if err == nil {
- id = decodedValue
- }
-
- return s.database.UserDataGet(ctx, id)
-}
-
-func (s *Service) UpdateUserData(ctx context.Context, id string, data *model.UserData) (doc *model.UserDataResponse, err error) {
- decodedValue, err := url.QueryUnescape(id)
- if err == nil {
- id = decodedValue
- }
-
- defer s.publishRequest(ctx, err, "UpdateUserData", userDataResponseID(doc))
-
- return s.database.UserDataUpdate(ctx, id, data)
-}
-
-func (s *Service) CurrentUserData(ctx context.Context) (doc *model.UserDataResponse, err error) {
- user, _, ok := maut.UserFromContext(ctx)
- if !ok {
- return nil, errors.New("no user in context")
- }
-
- return s.database.UserDataGet(ctx, user.ID)
-}
-
-func (s *Service) UpdateCurrentUserData(ctx context.Context, data *model.UserData) (doc *model.UserDataResponse, err error) {
- user, _, ok := maut.UserFromContext(ctx)
- if !ok {
- return nil, errors.New("no user in context")
- }
-
- defer s.publishRequest(ctx, err, "UpdateCurrentUserData", userDataResponseID(doc))
-
- return s.database.UserDataUpdate(ctx, user.ID, data)
-}
diff --git a/storage/storage.go b/storage/storage.go
deleted file mode 100644
index bfbd90b..0000000
--- a/storage/storage.go
+++ /dev/null
@@ -1,80 +0,0 @@
-package storage
-
-import (
- "errors"
-
- "github.com/aws/aws-sdk-go/aws"
- "github.com/aws/aws-sdk-go/aws/awserr"
- "github.com/aws/aws-sdk-go/aws/credentials"
- "github.com/aws/aws-sdk-go/aws/session"
- "github.com/aws/aws-sdk-go/service/s3"
- "github.com/aws/aws-sdk-go/service/s3/s3manager"
-
- "github.com/SecurityBrewery/catalyst/generated/pointer"
-)
-
-type Storage struct {
- session *session.Session
-}
-
-type Config struct {
- Host string
- User string
- Region string
- Password string
-}
-
-func New(config *Config) (*Storage, error) {
- s, err := session.NewSession(&aws.Config{
- Credentials: credentials.NewStaticCredentials(config.User, config.Password, ""),
- Endpoint: aws.String(config.Host),
- Region: aws.String(config.Region),
- DisableSSL: aws.Bool(true),
- S3ForcePathStyle: aws.Bool(true),
- })
-
- return &Storage{s}, err
-}
-
-func (s *Storage) S3() *s3.S3 {
- return s3.New(s.session)
-}
-
-func (s *Storage) Downloader() *s3manager.Downloader {
- d := s3manager.NewDownloader(s.session)
- d.Concurrency = 1
-
- return d
-}
-
-func (s *Storage) Uploader() *s3manager.Uploader {
- d := s3manager.NewUploader(s.session)
- d.Concurrency = 1
-
- return d
-}
-
-func (s *Storage) DeleteBucket(name string) error {
- _, err := s.S3().DeleteBucket(&s3.DeleteBucketInput{Bucket: pointer.String("catalyst-" + name)})
-
- return err
-}
-
-func CreateBucket(client *s3.S3, ticketID string) error {
- _, err := client.CreateBucket(&s3.CreateBucketInput{Bucket: pointer.String("catalyst-" + ticketID)})
- if err == nil {
- err = client.WaitUntilBucketExists(&s3.HeadBucketInput{Bucket: pointer.String("catalyst-" + ticketID)})
- if err != nil {
- return err
- }
- } else {
- var awsError awserr.Error
- if errors.As(err, &awsError) && (awsError.Code() == s3.ErrCodeBucketAlreadyExists || awsError.Code() == s3.ErrCodeBucketAlreadyOwnedByYou) {
- return nil
- }
-
- return err
- }
-
- return err
-}
diff --git a/test/data.go b/test/data.go
deleted file mode 100644
index 6a5fafb..0000000
--- a/test/data.go
+++ /dev/null
@@ -1,118 +0,0 @@
-package test
-
-import (
- "context"
- "time"
-
- maut "github.com/jonas-plum/maut/auth"
-
- "github.com/SecurityBrewery/catalyst/database"
- "github.com/SecurityBrewery/catalyst/database/migrations"
- "github.com/SecurityBrewery/catalyst/generated/model"
- "github.com/SecurityBrewery/catalyst/generated/pointer"
-)
-
-var (
- bobSetting = &model.UserData{Email: pointer.String("bob@example.org"), Name: pointer.String("Bob Bad")}
- bobForm = &model.UserForm{ID: "bob", Blocked: false, Roles: []string{"admin"}}
- Bob = &maut.User{ID: "bob", Blocked: false, Roles: []string{"admin"}}
-)
-
-func SetupTestData(ctx context.Context, db *database.Database) error {
- if err := db.UserDataCreate(ctx, "bob", bobSetting); err != nil {
- return err
- }
-
- if _, err := db.UserCreate(ctx, bobForm); err != nil {
- return err
- }
- if _, err := db.UserCreate(ctx, &model.UserForm{ID: "script", Roles: []string{"engineer"}, Apikey: true}); err != nil {
- return err
- }
-
- if _, err := db.TicketBatchCreate(ctx, []*model.TicketForm{
- {
- ID: pointer.Int64(8125),
- Created: parse("2021-10-02T18:04:59.078186+02:00"),
- Modified: parse("2021-10-02T18:04:59.078186+02:00"),
- Name: "phishing from selenafadel@von.com detected",
- Owner: pointer.String("demo"),
- References: []*model.Reference{{Href: "https://www.seniorleading-edge.name/users/efficient", Name: "recovery"}, {Href: "http://www.dynamicseamless.com/clicks-and-mortar", Name: "force"}, {Href: "http://www.leadscalable.biz/envisioneer", Name: "fund"}},
- Schema: pointer.String("{}"),
- Status: "closed",
- Type: "alert",
- }, {
- ID: pointer.Int64(8126),
- Created: parse("2021-10-02T18:04:59.078186+02:00"),
- Modified: parse("2021-10-02T18:04:59.078186+02:00"),
- Name: "Surfaceintroduce virus detected",
- Owner: pointer.String("demo"),
- References: []*model.Reference{{Href: "http://www.centralworld-class.io/synthesize", Name: "university"}, {Href: "https://www.futurevirtual.org/supply-chains/markets/sticky/iterate", Name: "goal"}, {Href: "http://www.chiefsyndicate.io/action-items", Name: "unemployment"}},
- Schema: pointer.String("{}"),
- Status: "closed",
- Type: "alert",
- }, {
- ID: pointer.Int64(8123),
- Created: parse("2021-10-02T18:04:59.078206+02:00"),
- Modified: parse("2021-10-02T18:04:59.078206+02:00"),
- Artifacts: []*model.Artifact{
- {Name: "94d5cab6f5fe3422a447ab15436e7a672bc0c09a", Status: pointer.String("unknown")},
- {Name: "http://www.customerviral.io/scalable/vertical/killer", Status: pointer.String("clean")},
- {Name: "leadreintermediate.io", Status: pointer.String("malicious")},
- },
- Name: "live zebra",
- Owner: pointer.String("demo"),
- References: []*model.Reference{{Href: "https://www.leadmaximize.net/e-services/back-end", Name: "performance"}, {Href: "http://www.corporateinteractive.name/rich", Name: "autumn"}, {Href: "https://www.corporateintuitive.org/intuitive/platforms/integrate", Name: "suggest"}},
- Schema: pointer.String("{\n \"definitions\": {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://example.com/object1618746510.json\",\n \"title\": \"Event\",\n \"type\": \"object\",\n \"required\": [\n \"severity\",\n \"description\",\n \"tlp\"\n ],\n \"properties\": {\n \"severity\": {\n \"$id\": \"#root/severity\",\n \"title\": \"Severity\",\n \"type\": \"string\",\n \"default\": \"Medium\",\n \"nx-enum\": [\n \"Low\",\n \"Medium\",\n \"High\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"Low\",\n \"title\": \"Low\",\n \"icon\": \"mdi-chevron-up\"\n },\n {\n \"const\": \"Medium\",\n \"title\": \"Medium\",\n \"icon\": \"mdi-chevron-double-up\"\n },\n {\n \"const\": \"High\",\n \"title\": \"High\",\n \"icon\": \"mdi-chevron-triple-up\"\n }\n ]\n },\n \"tlp\": {\n \"$id\": \"#root/tlp\",\n \"title\": \"TLP\",\n \"type\": \"string\",\n \"nx-enum\": [\n \"White\",\n \"Green\",\n \"Amber\",\n \"Red\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"White\",\n \"title\": \"White\",\n \"icon\": \"mdi-alpha-w\"\n },\n {\n \"const\": \"Green\",\n \"title\": \"Green\",\n \"icon\": \"mdi-alpha-g\"\n },\n {\n \"const\": \"Amber\",\n \"title\": \"Amber\",\n \"icon\": \"mdi-alpha-a\"\n },\n {\n \"const\": \"Red\",\n \"title\": \"Red\",\n \"icon\": \"mdi-alpha-r\"\n }\n ]\n },\n \"description\": {\n \"$id\": \"#root/description\",\n \"title\": \"Description\",\n \"type\": \"string\",\n \"x-display\": \"textarea\",\n \"x-class\": \"pr-2\"\n }\n }\n}\n"),
- Status: "closed",
- Type: "incident",
- Playbooks: []*model.PlaybookTemplateForm{
- {Yaml: migrations.PhishingPlaybook},
- },
- },
- }); err != nil {
- return err
- }
-
- if err := db.RelatedCreate(ctx, 8125, 8126); err != nil {
- return err
- }
-
- if _, err := db.LogCreate(ctx, "manual", "tickets/294511", "Fail run account resist lend solve incident centre priority temperature. Cause change distribution examine location technique shape partner milk customer. Rail tea plate soil report cook railway interpretation breath action. Exercise dream accept park conclusion addition shoot assistance may answer. Gold writer link stop combine hear power name commitment operation. Determine lifespan support grow degree henry exclude detail set religion. Direct library policy convention chain retain discover ride walk student. Gather proposal select march aspect play noise avoid encourage employ. Assessment preserve transport combine wish influence income guess run stand. Charge limit crime ignore statement foundation study issue stop claim."); err != nil {
- return err
- }
-
- if _, err := db.DashboardCreate(ctx, &model.Dashboard{
- Name: "Simple",
- Widgets: []*model.Widget{
- {
- Name: "open_tickets_per_user",
- Type: model.WidgetTypeBar,
- Aggregation: "owner",
- Filter: pointer.String(`status == "open"`),
- Width: 4,
- },
- {
- Name: "tickets_per_week",
- Type: model.WidgetTypeLine,
- Aggregation: `CONCAT(DATE_YEAR(created), "-", DATE_ISOWEEK(created) < 10 ? "0" : "", DATE_ISOWEEK(created))`,
- Width: 8,
- },
- },
- }); err != nil {
- return err
- }
-
- return nil
-}
-
-func parse(s string) *time.Time {
- modified, err := time.Parse(time.RFC3339, s)
- if err != nil {
- panic(err)
- }
-
- utc := modified.UTC()
-
- return &utc
-}
diff --git a/test/job_test.go b/test/job_test.go
deleted file mode 100644
index 19fdfc3..0000000
--- a/test/job_test.go
+++ /dev/null
@@ -1,87 +0,0 @@
-package test
-
-import (
- "bytes"
- "encoding/json"
- "io"
- "log"
- "net/http"
- "net/http/httptest"
- "testing"
- "time"
-
- "github.com/go-chi/chi/v5"
- "github.com/stretchr/testify/assert"
- "github.com/tidwall/gjson"
-
- "github.com/SecurityBrewery/catalyst/generated/model"
-)
-
-func TestJob(t *testing.T) {
- t.Parallel()
-
- log.SetFlags(log.LstdFlags | log.Lshortfile)
-
- _, _, server, err := Catalyst(t)
- if err != nil {
- t.Fatal(err)
- }
-
- b, err := json.Marshal(model.JobForm{
- Automation: "hash.sha1",
- Payload: map[string]any{"default": "test"},
- })
- if err != nil {
- t.Fatal(err)
- }
- result := request(t, server.Server, http.MethodPost, "/api/jobs", bytes.NewBuffer(b))
- id := gjson.GetBytes(result, "id").String()
-
- start := time.Now()
- for {
- time.Sleep(5 * time.Second)
-
- if time.Since(start) > time.Minute {
- t.Fatal("job did not complete within a minute")
- }
-
- job := request(t, server.Server, http.MethodGet, "/api/jobs/"+id, nil)
-
- status := gjson.GetBytes(job, "status").String()
- if status != "completed" {
- continue
- }
-
- output := gjson.GetBytes(job, "output.hash").String()
- assert.Equal(t, "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3", output)
-
- break
- }
-}
-
-func request(t *testing.T, server chi.Router, method, url string, data io.Reader) []byte {
- t.Helper()
-
- w := httptest.NewRecorder()
-
- // setup request
- req := httptest.NewRequest(method, url, data)
- req.Header.Set("Content-Type", "application/json")
- req.Header.Set("PRIVATE-TOKEN", "test")
-
- // run request
- server.ServeHTTP(w, req)
-
- result := w.Result()
-
- b, err := io.ReadAll(result.Body)
- if err != nil {
- t.Fatal(err)
- }
-
- if result.StatusCode != http.StatusOK {
- t.Fatalf("Status got = %v: %v, want %v", result.Status, string(b), http.StatusOK)
- }
-
- return b
-}
diff --git a/test/server_test.go b/test/server_test.go
deleted file mode 100644
index 741ab32..0000000
--- a/test/server_test.go
+++ /dev/null
@@ -1,125 +0,0 @@
-package test
-
-import (
- "bytes"
- "encoding/json"
- "io"
- "net/http"
- "net/http/httptest"
- "strings"
- "testing"
- "time"
-
- "github.com/stretchr/testify/assert"
- "github.com/tidwall/gjson"
- "github.com/tidwall/sjson"
-
- "github.com/SecurityBrewery/catalyst/generated/api"
- ctime "github.com/SecurityBrewery/catalyst/generated/time"
-)
-
-type testClock struct{}
-
-func (testClock) Now() time.Time {
- return time.Date(2021, 12, 12, 12, 12, 12, 12, time.UTC)
-}
-
-func TestServer(t *testing.T) {
- t.Parallel()
-
- ctime.DefaultClock = testClock{}
-
- for _, tt := range api.Tests {
- tt := tt
- t.Run(tt.Name, func(t *testing.T) {
- t.Parallel()
-
- ctx, _, _, _, _, db, _, server, cleanup, err := Server(t)
- if err != nil {
- t.Fatal(err)
- }
- defer cleanup()
-
- if err := SetupTestData(ctx, db); err != nil {
- t.Fatal(err)
- }
-
- w := httptest.NewRecorder()
-
- // setup request
- var req *http.Request
- if tt.Args.Data != nil {
- b, err := json.Marshal(tt.Args.Data)
- if err != nil {
- t.Fatal(err)
- }
-
- req = httptest.NewRequest(strings.ToUpper(tt.Args.Method), tt.Args.URL, bytes.NewBuffer(b))
- req.Header.Set("Content-Type", "application/json")
- } else {
- req = httptest.NewRequest(strings.ToUpper(tt.Args.Method), tt.Args.URL, nil)
- }
-
- // run request
- server.ServeHTTP(w, req)
-
- result := w.Result()
-
- // assert results
- if result.StatusCode != tt.Want.Status {
- msg, _ := io.ReadAll(result.Body)
-
- t.Fatalf("Status got = %v (%s), want %v", result.Status, msg, tt.Want.Status)
- }
- if tt.Want.Status != http.StatusNoContent {
- jsonEqual(t, tt.Name, result.Body, tt.Want.Body)
- }
- })
- }
-}
-
-func jsonEqual(t *testing.T, name string, got io.Reader, want any) {
- t.Helper()
-
- var gotObject, wantObject any
-
- // load bytes
- wantBytes, err := json.Marshal(want)
- if err != nil {
- t.Fatal(err)
- }
- gotBytes, err := io.ReadAll(got)
- if err != nil {
- t.Fatal(err)
- }
-
- var fields []string
-
- if name == "CreateUser" {
- fields = append(fields, "secret")
- }
- if name == "RunJob" {
- fields = append(fields, "id", "status")
- }
-
- for _, field := range fields {
- gField := gjson.GetBytes(wantBytes, field)
- if gField.Exists() && gjson.GetBytes(gotBytes, field).Exists() {
- gotBytes, err = sjson.SetBytes(gotBytes, field, gField.Value())
- if err != nil {
- t.Fatal(err)
- }
- }
- }
-
- // normalize bytes
- if err = json.Unmarshal(wantBytes, &wantObject); err != nil {
- t.Fatal(err)
- }
- if err := json.Unmarshal(gotBytes, &gotObject); err != nil {
- t.Fatal(string(gotBytes), err)
- }
-
- // compare
- assert.Equal(t, wantObject, gotObject)
-}
diff --git a/test/test.go b/test/test.go
deleted file mode 100644
index cf98e6d..0000000
--- a/test/test.go
+++ /dev/null
@@ -1,227 +0,0 @@
-package test
-
-import (
- "context"
- "log"
- "net/http"
- "os"
- "path"
- "strings"
- "testing"
-
- "github.com/arangodb/go-driver"
- "github.com/coreos/go-oidc/v3/oidc"
- "github.com/go-chi/chi/v5"
- maut "github.com/jonas-plum/maut/auth"
- "golang.org/x/oauth2"
-
- "github.com/SecurityBrewery/catalyst"
- "github.com/SecurityBrewery/catalyst/bus"
- "github.com/SecurityBrewery/catalyst/database"
- "github.com/SecurityBrewery/catalyst/generated/api"
- "github.com/SecurityBrewery/catalyst/generated/model"
- "github.com/SecurityBrewery/catalyst/hooks"
- "github.com/SecurityBrewery/catalyst/index"
- "github.com/SecurityBrewery/catalyst/service"
- "github.com/SecurityBrewery/catalyst/storage"
-)
-
-func Context() context.Context {
- return maut.UserContext(context.Background(), Bob, nil) // TODO add permissions ?
-}
-
-func Config(_ context.Context) (*catalyst.Config, error) {
- config := &catalyst.Config{
- IndexPath: "index.bleve",
- Network: "catalyst",
- DB: &database.Config{
- Host: "http://localhost:8529",
- User: "root",
- Password: "foobar",
- },
- Storage: &storage.Config{
- Host: "http://localhost:9000",
- User: "minio",
- Region: "eu-central-1",
- Password: "minio123",
- },
- Auth: &maut.Config{
- InitialAPIKey: "test",
- CookieSecret: []byte("4ef5b29539b70233dd40c02a1799d25079595565e05a193b09da2c3e60ada1cd"),
- SimpleAuthEnable: true,
- APIKeyAuthEnable: true,
- OIDCAuthEnable: true,
- OIDCIssuer: "http://localhost:8082",
- OAuth2: &oauth2.Config{
- ClientID: "catalyst",
- ClientSecret: "13d4a081-7395-4f71-a911-bc098d8d3c45",
- RedirectURL: "http://localhost:8002/callback",
- Scopes: []string{oidc.ScopeOpenID, "profile", "email"},
- },
- // OIDCClaimUsername: "",
- // OIDCClaimEmail: "",
- // OIDCClaimName: "",
- // AuthBlockNew: false,
- // AuthDefaultRoles: nil,
- },
- }
-
- return config, nil
-}
-
-func Index(t *testing.T) (*index.Index, func(), error) {
- t.Helper()
-
- dir, err := os.MkdirTemp("", "catalyst-test-"+cleanName(t))
- if err != nil {
- return nil, nil, err
- }
-
- catalystIndex, err := index.New(path.Join(dir, "index.bleve"))
- if err != nil {
- return nil, nil, err
- }
-
- return catalystIndex, func() { catalystIndex.Close(); os.RemoveAll(dir) }, nil
-}
-
-func Bus(t *testing.T) (context.Context, *catalyst.Config, *bus.Bus, error) {
- t.Helper()
-
- ctx := Context()
-
- config, err := Config(ctx)
- if err != nil {
- t.Fatal(err)
- }
-
- catalystBus := bus.New()
-
- return ctx, config, catalystBus, err
-}
-
-func DB(t *testing.T) (context.Context, *catalyst.Config, *bus.Bus, *index.Index, *storage.Storage, *database.Database, func(), error) {
- t.Helper()
-
- ctx, config, rbus, err := Bus(t)
- if err != nil {
- return nil, nil, nil, nil, nil, nil, nil, err
- }
-
- catalystStorage, err := storage.New(config.Storage)
- if err != nil {
- return nil, nil, nil, nil, nil, nil, nil, err
- }
-
- catalystIndex, cleanup, err := Index(t)
- if err != nil {
- return nil, nil, nil, nil, nil, nil, nil, err
- }
-
- c := config.DB
- c.Name = cleanName(t)
- db, err := database.New(ctx, catalystIndex, rbus, &hooks.Hooks{
- DatabaseAfterConnectFuncs: []func(ctx context.Context, client driver.Client, name string){Clear},
- }, c)
- if err != nil {
- return nil, nil, nil, nil, nil, nil, nil, err
- }
-
- _, err = db.JobCreate(ctx, "b81c2366-ea37-43d2-b61b-03afdc21d985", &model.JobForm{
- Automation: "hash.sha1",
- Payload: "test",
- Origin: nil,
- })
- if err != nil {
- return nil, nil, nil, nil, nil, nil, nil, err
- }
-
- return ctx, config, rbus, catalystIndex, catalystStorage, db, func() {
- err := db.Remove(context.Background())
- if err != nil {
- log.Println(err)
- }
- cleanup()
- }, err
-}
-
-func Service(t *testing.T) (context.Context, *catalyst.Config, *bus.Bus, *index.Index, *storage.Storage, *database.Database, *service.Service, func(), error) {
- t.Helper()
-
- ctx, config, rbus, catalystIndex, catalystStorage, db, cleanup, err := DB(t)
- if err != nil {
- t.Fatal(err)
- }
-
- catalystService, err := service.New(rbus, db, catalystStorage, "0.0.0-test")
- if err != nil {
- t.Fatal(err)
- }
-
- return ctx, config, rbus, catalystIndex, catalystStorage, db, catalystService, cleanup, err
-}
-
-func Server(t *testing.T) (context.Context, *catalyst.Config, *bus.Bus, *index.Index, *storage.Storage, *database.Database, *service.Service, chi.Router, func(), error) {
- t.Helper()
-
- ctx, config, rbus, catalystIndex, catalystStorage, db, catalystService, cleanup, err := Service(t)
- if err != nil {
- t.Fatal(err)
- }
-
- catalystServer := api.NewServer(catalystService, func(s []string) func(http.Handler) http.Handler {
- return func(handler http.Handler) http.Handler {
- return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- handler.ServeHTTP(w, r.WithContext(maut.UserContext(r.Context(), Bob, nil)))
- })
- }
- })
-
- return ctx, config, rbus, catalystIndex, catalystStorage, db, catalystService, catalystServer, cleanup, err
-}
-
-func Catalyst(t *testing.T) (context.Context, *catalyst.Config, *catalyst.Server, error) {
- t.Helper()
-
- ctx := Context()
-
- config, err := Config(ctx)
- if err != nil {
- t.Fatal(err)
- }
- config.DB.Name = cleanName(t)
- config.IndexPath = cleanName(t) + ".bleve"
-
- c, err := catalyst.New(&hooks.Hooks{
- DatabaseAfterConnectFuncs: []func(ctx context.Context, client driver.Client, name string){Clear},
- }, config)
-
- return ctx, config, c, err
-}
-
-func cleanName(t *testing.T) string {
- t.Helper()
-
- name := t.Name()
- name = strings.ReplaceAll(name, " ", "")
- name = strings.ReplaceAll(name, "/", "_")
-
- return strings.ReplaceAll(name, "#", "_")
-}
-
-func Clear(ctx context.Context, client driver.Client, name string) {
- if exists, _ := client.DatabaseExists(ctx, name); exists {
- if db, err := client.Database(ctx, name); err == nil {
- if exists, _ = db.GraphExists(ctx, database.TicketArtifactsGraphName); exists {
- if g, err := db.Graph(ctx, database.TicketArtifactsGraphName); err == nil {
- if err := g.Remove(ctx); err != nil {
- log.Println(err)
- }
- }
- }
- if err := db.Remove(ctx); err != nil {
- log.Println(err)
- }
- }
- }
-}
diff --git a/test/user_test.go b/test/user_test.go
deleted file mode 100644
index f1371ab..0000000
--- a/test/user_test.go
+++ /dev/null
@@ -1,73 +0,0 @@
-package test
-
-import (
- "bytes"
- "encoding/json"
- "net/http"
- "net/http/httptest"
- "testing"
-)
-
-func TestUser(t *testing.T) {
- t.Parallel()
-
- type args struct {
- method string
- url string
- data any
- }
- type want struct {
- status int
- body any
- }
- tests := []struct {
- name string
- args args
- want want
- }{
- {name: "GetUser not existing", args: args{method: http.MethodGet, url: "/users/123"}, want: want{status: http.StatusNotFound, body: map[string]string{"error": "document not found"}}},
- {name: "ListUsers", args: args{method: http.MethodGet, url: "/users"}, want: want{status: http.StatusOK}},
- }
- for _, tt := range tests {
- tt := tt
- t.Run(tt.name, func(t *testing.T) {
- t.Parallel()
-
- _, _, _, _, _, _, _, server, cleanup, err := Server(t)
- if err != nil {
- t.Fatal(err)
- }
- defer cleanup()
-
- // server.ConfigureRoutes()
- w := httptest.NewRecorder()
-
- // setup request
- var req *http.Request
- if tt.args.data != nil {
- b, err := json.Marshal(tt.args.data)
- if err != nil {
- t.Fatal(err)
- }
-
- req = httptest.NewRequest(tt.args.method, tt.args.url, bytes.NewBuffer(b))
- req.Header.Set("Content-Type", "application/json")
- } else {
- req = httptest.NewRequest(tt.args.method, tt.args.url, nil)
- }
-
- // run request
- server.ServeHTTP(w, req)
-
- result := w.Result()
-
- // assert results
- if result.StatusCode != tt.want.status {
- t.Fatalf("Status got = %v, want %v", result.Status, tt.want.status)
- }
- if tt.want.status != http.StatusNoContent {
- jsonEqual(t, tt.name, result.Body, tt.want.body)
- }
- })
- }
-}
diff --git a/ui/.browserslistrc b/ui/.browserslistrc
deleted file mode 100644
index 214388f..0000000
--- a/ui/.browserslistrc
+++ /dev/null
@@ -1,3 +0,0 @@
-> 1%
-last 2 versions
-not dead
diff --git a/ui/.eslintrc.cjs b/ui/.eslintrc.cjs
new file mode 100644
index 0000000..6f40582
--- /dev/null
+++ b/ui/.eslintrc.cjs
@@ -0,0 +1,15 @@
+/* eslint-env node */
+require('@rushstack/eslint-patch/modern-module-resolution')
+
+module.exports = {
+ root: true,
+ 'extends': [
+ 'plugin:vue/vue3-essential',
+ 'eslint:recommended',
+ '@vue/eslint-config-typescript',
+ '@vue/eslint-config-prettier/skip-formatting'
+ ],
+ parserOptions: {
+ ecmaVersion: 'latest'
+ }
+}
diff --git a/ui/.eslintrc.js b/ui/.eslintrc.js
deleted file mode 100644
index ba02536..0000000
--- a/ui/.eslintrc.js
+++ /dev/null
@@ -1,30 +0,0 @@
-module.exports = {
- root: true,
- env: {
- node: true,
- },
- extends: [
- "plugin:vue/essential",
- "eslint:recommended",
- "@vue/typescript/recommended",
- ],
- parserOptions: {
- ecmaVersion: 2020,
- },
- rules: {
- "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
- "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
- 'vue/valid-v-slot': ['error', {
- allowModifiers: true,
- }],
- },
- overrides: [
- {
- files: ["**/__tests__/*.{j,t}s?(x)", "**/tests/unit/**/*.spec.{j,t}s?(x)"],
- env: {
- jest: true,
- },
- },
- ],
- ignorePatterns: ["src/suggestions/grammar/*.js", "src/views/playbook/vue-blocks/"],
-};
diff --git a/ui/.prettierrc.json b/ui/.prettierrc.json
new file mode 100644
index 0000000..c29e1c4
--- /dev/null
+++ b/ui/.prettierrc.json
@@ -0,0 +1,21 @@
+{
+ "$schema": "https://json.schemastore.org/prettierrc",
+ "semi": false,
+ "tabWidth": 2,
+ "singleQuote": true,
+ "printWidth": 100,
+ "trailingComma": "none",
+ "plugins": [
+ "@trivago/prettier-plugin-sort-imports",
+ "prettier-plugin-tailwindcss"
+ ],
+ "importOrder": [
+ "(.*).css$",
+ "^@/components/(.*)$",
+ "^lucide-vue-next",
+ "",
+ "^@/(.*)$"
+ ],
+ "importOrderSeparation": true,
+ "importOrderSortSpecifiers": true
+}
\ No newline at end of file
diff --git a/ui/README.md b/ui/README.md
index 609de9f..3cb7823 100644
--- a/ui/README.md
+++ b/ui/README.md
@@ -1,27 +1,39 @@
-## Project setup
+# catalyst
-```
-yarn install
+This template should help get you started developing with Vue 3 in Vite.
+
+## Recommended IDE Setup
+
+[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).
+
+## Type Support for `.vue` Imports in TS
+
+TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types.
+
+## Customize configuration
+
+See [Vite Configuration Reference](https://vitejs.dev/config/).
+
+## Project Setup
+
+```sh
+bun install
```
-### Compiles and hot-reloads for development
+### Compile and Hot-Reload for Development
-```
-yarn serve
+```sh
+bun dev
```
-### Compiles and minifies for production
+### Type-Check, Compile and Minify for Production
-```
-yarn build
+```sh
+bun build
```
-### Lints and fixes files
+### Lint with [ESLint](https://eslint.org/)
+```sh
+bun lint
```
-yarn lint
-```
-
-### Customize configuration
-
-See [Configuration Reference](https://cli.vuejs.org/config/).
diff --git a/ui/babel.config.js b/ui/babel.config.js
deleted file mode 100644
index e955840..0000000
--- a/ui/babel.config.js
+++ /dev/null
@@ -1,5 +0,0 @@
-module.exports = {
- presets: [
- '@vue/cli-plugin-babel/preset'
- ]
-}
diff --git a/ui/bun.lockb b/ui/bun.lockb
new file mode 100755
index 0000000..91c6e25
Binary files /dev/null and b/ui/bun.lockb differ
diff --git a/ui/components.json b/ui/components.json
new file mode 100644
index 0000000..9c826ef
--- /dev/null
+++ b/ui/components.json
@@ -0,0 +1,16 @@
+{
+ "$schema": "https://shadcn-vue.com/schema.json",
+ "style": "default",
+ "typescript": true,
+ "tailwind": {
+ "config": "tailwind.config.js",
+ "css": "src/assets/main.css",
+ "baseColor": "slate",
+ "cssVariables": true
+ },
+ "framework": "vite",
+ "aliases": {
+ "components": "@/components",
+ "utils": "@/lib/utils"
+ }
+}
\ No newline at end of file
diff --git a/ui/cypress.config.ts b/ui/cypress.config.ts
deleted file mode 100644
index 4be4a01..0000000
--- a/ui/cypress.config.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { defineConfig } from 'cypress'
-
-export default defineConfig({
- chromeWebSecurity: false,
- e2e: {
- // We've imported your old cypress plugins here.
- // You may want to clean this up later by importing these.
- setupNodeEvents(on, config) {
- return require('./cypress/plugins/index.js')(on, config)
- },
- baseUrl: 'http://localhost',
- experimentalSessionAndOrigin: true,
- },
-})
diff --git a/ui/cypress/e2e/catalyst.cy.js b/ui/cypress/e2e/catalyst.cy.js
deleted file mode 100644
index ac99952..0000000
--- a/ui/cypress/e2e/catalyst.cy.js
+++ /dev/null
@@ -1,152 +0,0 @@
-beforeEach(() => {
- cy.visit('/');
-
- cy.login();
-
- cy.getCookie('maut_user').should('exist');
-
- cy.intercept('GET', '/api/userdata/demo', { fixture: 'userdata_demo.json' })
- cy.intercept('GET', '/api/users/demo', { fixture: 'user_demo.json' })
-})
-
-if (Cypress.env('TEST') === 'tickets') {
- describe('tickets', {"retries": 3}, () => {
- it('open ticket', () => {
- cy.visit('http://localhost/ui/tickets');
-
- // clear caql
- cy.get("#caqlbar > div > div > div > div > div:nth-child(2) > div > button").click();
-
- // wait for results to load
- cy.get("#app > div > main > div > div > div > div > div > div.v-data-table__wrapper > table > tbody > tr:nth-child(1)").should('exist');
- cy.wait(1000);
-
- // open ticket
- cy.contains("live zebra").click();
-
- // assert url
- cy.url().should('eq', "http://localhost/ui/tickets/8123")
-
- // assert title
- cy.get("h1").should("have.text", " Incident #8123: live zebra ")
- })
- })
-}
-
-if (Cypress.env('TEST') === 'templates') {
- describe('templates', {"retries": 3}, () => {
- it('create template', () => {
- cy.get("#toggle_menu").click();
- cy.contains('Templates').click();
- cy.get("#toggle_menu").click();
-
- cy.get("body").then($body => {
- if ($body.find('a[href="/ui/templates/description-only"]').length > 0) {
- cy.get('a[href="/ui/templates/description-only"]').trigger('mouseover');
- cy.get('a[href="/ui/templates/description-only"] button').click();
- cy.get("#delete-button").click();
- }
- });
-
- cy.contains("New Template").click();
- cy.url().should('eq', "http://localhost/ui/templates/new");
- cy.get("#name-edit").click().clear().type("DescriptionOnly");
- cy.get("#template-edit #advanced").click({force: true});
- cy.get(".prism-editor__textarea").clear().type('{ "type": "object", "name": "Incident", "required": [ "description" ], "properties": { "description": { "title": "Description", "type": "string", "x-display": "textarea" } } }', {parseSpecialCharSequences: false});
- cy.contains("Create").click();
-
- cy.get("#toggle_menu").click();
- cy.contains('Alerts').click();
- cy.get("#toggle_menu").click();
-
- cy.contains("New Alert").click();
- cy.get("#title-edit").type("New Alert");
- cy.get("#templates-edit .v-input__slot").click();
- cy.contains("DescriptionOnly").click();
- cy.contains("Create").click();
- cy.url().should('match', /http:\/\/localhost\/ui\/tickets\/\d+/);
-
- cy.get("#description").type("Lorem Ipsum");
- cy.contains("Save Details").click();
- })
- })
-}
-
-if (Cypress.env('TEST') === 'playbooks') {
- describe('playbooks', {"retries": 3}, () => {
- it('create playbook', () => {
- cy.get("#toggle_menu").click();
- cy.contains('Playbooks').click();
- cy.get("#toggle_menu").click();
-
- cy.get("body").then($body => {
- if ($body.find('a[href="/ui/playbooks/test"]').length > 0) {
- cy.get('a[href="/ui/playbooks/test"]').trigger('mouseover');
- cy.get('a[href="/ui/playbooks/test"] button').click();
- cy.get("#delete-button").click();
- }
- });
-
- cy.contains("New Playbook").click();
- cy.url().should('eq', "http://localhost/ui/playbooks/new");
- cy.get(".prism-editor__textarea").clear().type('name: Test\n' +
- 'tasks:\n' +
- ' input:\n' +
- ' name: Enter something to hash\n' +
- 'type: input\n' +
- 'schema:\n' +
- ' title: Something\n' +
- 'type: object\n' +
- 'properties:\n' +
- ' something:\n' +
- ' type: string\n' +
- 'title: Something\n' +
- 'default: ""\n' +
- '{backspace}{backspace}{backspace}next:\n' +
- ' hash: "something != \'\'"\n' +
- '{backspace}{backspace}\n' +
- 'hash:\n' +
- ' name: Hash the something\n' +
- 'type: automation\n' +
- 'automation: hash.sha1\n' +
- 'payload:\n' +
- ' default: "playbook.tasks[\'input\'].data[\'something\']"\n' +
- '{backspace}next:\n' +
- ' comment: "hash != \'\'"\n' +
- '{backspace}{backspace}\n' +
- 'comment:\n' +
- ' name: Comment the hash\n' +
- 'type: automation\n' +
- 'automation: comment\n' +
- 'payload:\n' +
- ' default: "playbook.tasks[\'hash\'].data[\'hash\']"\n' +
- '{backspace}next:\n' +
- ' done: "done"\n' +
- '{backspace}{backspace}\n' +
- 'done:\n' +
- ' name: You can close this case now\n' +
- 'type: task\n');
- cy.scrollTo('bottom');
- cy.contains("Create").click();
-
- cy.get("#toggle_menu").click();
- cy.contains('Alerts').click();
- cy.get("#toggle_menu").click();
-
- cy.contains("New Alert").click();
- cy.get("#title-edit").type("New Alert");
- cy.get("#playbooks-edit .v-input__slot").click();
- cy.contains("Test").click();
- cy.contains("Create").click();
- cy.url().should('match', /http:\/\/localhost\/ui\/tickets\/\d+/);
-
- cy.scrollTo('bottom');
- cy.get(".playbook-test .tasks").contains("Enter something to hash").click();
- cy.get("#something").type("my test value");
- cy.contains("Complete").click();
-
- // cy.wait(300 * 1000);
- // cy.contains("a94a8fe5ccb19ba61c4c0873d391e987982fbbd3").should('exist');
- })
- })
-}
diff --git a/ui/cypress/fixtures/user_demo.json b/ui/cypress/fixtures/user_demo.json
deleted file mode 100644
index e08d96b..0000000
--- a/ui/cypress/fixtures/user_demo.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "apikey": false,
- "blocked": false,
- "id": "demo",
- "roles": [ "admin" ]
-}
\ No newline at end of file
diff --git a/ui/cypress/fixtures/userdata_demo.json b/ui/cypress/fixtures/userdata_demo.json
deleted file mode 100644
index a386415..0000000
--- a/ui/cypress/fixtures/userdata_demo.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "email": "demo@example.org",
- "id": "demo",
- "name": "Demo"
-}
\ No newline at end of file
diff --git a/ui/cypress/plugins/index.js b/ui/cypress/plugins/index.js
deleted file mode 100644
index 59b2bab..0000000
--- a/ui/cypress/plugins/index.js
+++ /dev/null
@@ -1,22 +0,0 @@
-///
-// ***********************************************************
-// This example plugins/index.js can be used to load plugins
-//
-// You can change the location of this file or turn off loading
-// the plugins file with the 'pluginsFile' configuration option.
-//
-// You can read more here:
-// https://on.cypress.io/plugins-guide
-// ***********************************************************
-
-// This function is called when a project is opened or re-opened (e.g. due to
-// the project's config changing)
-
-/**
- * @type {Cypress.PluginConfig}
- */
-// eslint-disable-next-line no-unused-vars
-module.exports = (on, config) => {
- // `on` is used to hook into various events Cypress emits
- // `config` is the resolved Cypress config
-}
diff --git a/ui/cypress/support/commands.js b/ui/cypress/support/commands.js
deleted file mode 100644
index c1d36c5..0000000
--- a/ui/cypress/support/commands.js
+++ /dev/null
@@ -1,20 +0,0 @@
-// ***********************************************
-// custom commands
-// https://on.cypress.io/custom-commands
-// ***********************************************
-//
-//
-// -- This is a parent command --
-// Cypress.Commands.add('login', (email, password) => { ... })
-//
-//
-// -- This is a child command --
-// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
-//
-//
-// -- This is a dual command --
-// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
-//
-//
-// -- This will overwrite an existing command --
-// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
diff --git a/ui/cypress/support/e2e.js b/ui/cypress/support/e2e.js
deleted file mode 100644
index 1386450..0000000
--- a/ui/cypress/support/e2e.js
+++ /dev/null
@@ -1,34 +0,0 @@
-// ***********************************************************
-// global configuration
-// https://on.cypress.io/configuration
-// ***********************************************************
-
-import './commands'
-
-Cypress.Cookies.defaults({
- preserve: 'user',
-})
-
-Cypress.on('uncaught:exception', (err, runnable) => {
- return false
-})
-
-Cypress.Commands.add('login', (options = {}) => {
- if (Cypress.env('AUTH') === 'simple') {
- cy.contains("Name").click({force: true});
- cy.get("#username").type("tom");
- cy.contains("Password").click({force: true});
- cy.get("#password").type("tom");
- cy.get("button").contains("Login").click();
- } else if (Cypress.env('AUTH') === 'keycloak') {
- cy.get("#username").type("bob");
- cy.get("#password").type("bob");
- cy.get("#kc-login").click();
- } else if (Cypress.env('AUTH') === 'authelia') {
- cy.contains("Login with OIDC").should('be.visible').click();
- cy.get("#username-textfield").should('be.visible').type("bob@example.com");
- cy.get("#password-textfield").type("bob");
- cy.get("#sign-in-button").click();
- cy.get("#accept-button").should('be.visible').click();
- }
-})
diff --git a/ui/env.d.ts b/ui/env.d.ts
new file mode 100644
index 0000000..11f02fe
--- /dev/null
+++ b/ui/env.d.ts
@@ -0,0 +1 @@
+///
diff --git a/ui/index.html b/ui/index.html
new file mode 100644
index 0000000..eb40416
--- /dev/null
+++ b/ui/index.html
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+ Catalyst
+
+
+
+
+
+
diff --git a/ui/jest.config.js b/ui/jest.config.js
deleted file mode 100644
index f9d5bfe..0000000
--- a/ui/jest.config.js
+++ /dev/null
@@ -1,3 +0,0 @@
-module.exports = {
- preset: "@vue/cli-plugin-unit-jest/presets/typescript-and-babel",
-};
diff --git a/ui/package.json b/ui/package.json
index 3cba90d..7399420 100644
--- a/ui/package.json
+++ b/ui/package.json
@@ -1,87 +1,68 @@
{
"name": "catalyst",
- "version": "0.2.0",
+ "version": "0.0.0",
"private": true,
+ "type": "module",
"scripts": {
- "serve": "vue-cli-service serve",
- "build": "vue-cli-service build",
- "test": "vue-cli-service test:unit",
- "lint": "vue-cli-service lint"
+ "dev": "vite",
+ "build": "run-p type-check \"build-only {@}\" --",
+ "preview": "vite preview",
+ "build-only": "vite build",
+ "type-check": "vue-tsc --build --force",
+ "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
+ "format": "prettier --write src/"
},
"dependencies": {
- "@crinkles/digl": "^2.0.2",
- "@koumoul/vjsf": "2.23.2",
- "@mdi/font": "7.3.67",
- "@mdi/util": "0.3.2",
- "@types/luxon": "3.3.3",
- "@types/prismjs": "1.26.2",
- "@uppy/core": "1.20.1",
- "@uppy/tus": "1.9.2",
- "@uppy/vue": "0.2.7",
- "ajv": "8.12.0",
- "ant-design-vue": "1.7.8",
- "antlr4": "4.11.0",
- "axios": "1.5.1",
- "chart.js": "2.9.4",
- "core-js": "3.33.1",
- "d3": "^7.8.0",
- "graphlib": "2.1.8",
- "json-schema-editor-vue": "2.2.3",
- "just-kebab-case": "4.2.0",
- "less": "4.2.0",
- "less-loader": "11.1.3",
- "lodash": "4.17.21",
- "luxon": "3.4.3",
- "panzoom": "^9.4.3",
- "register-service-worker": "1.7.2",
- "splitpanes": "2.4.1",
- "swagger-ui": "4.13.0",
- "vue": "2.7.15",
- "vue-axios": "3.5.2",
- "vue-chartjs": "3.5.1",
- "vue-class-component": "7.2.6",
- "vue-cropperjs": "5.0.0",
- "vue-d3-network": "0.1.28",
- "vue-lodash": "2.1.2",
- "vue-luxon": "0.10.0",
- "vue-markdown": "2.2.4",
- "vue-native-websocket": "2.0.15",
- "vue-pipeline": "1.0.12",
- "vue-prism-editor": "1.3.0",
- "vue-property-decorator": "9.1.2",
- "vue-router": "3.6.5",
- "vuetify": "2.7.1",
- "vuex": "3.6.2",
- "yaml": "2.0.1"
+ "@atlaskit/pragmatic-drag-and-drop": "^1.1.3",
+ "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.3",
+ "@formkit/auto-animate": "^0.8.2",
+ "@tanstack/vue-query": "^5.32.0",
+ "@unovis/ts": "^1.4.1",
+ "@unovis/vue": "^1.4.1",
+ "@vee-validate/rules": "^4.12.8",
+ "@vee-validate/zod": "^4.12.8",
+ "@vueuse/core": "^10.10.0",
+ "add": "^2.0.6",
+ "class-variance-authority": "^0.7.0",
+ "clsx": "^2.1.0",
+ "date-fns": "^3.6.0",
+ "easymde": "^2.18.0",
+ "lodash.debounce": "^4.0.8",
+ "lucide-vue-next": "^0.365.0",
+ "marked": "^12.0.2",
+ "pinia": "^2.1.7",
+ "pocketbase": "^0.21.2",
+ "radix-vue": "^1.6.2",
+ "tailwind-merge": "^2.2.2",
+ "tailwindcss-animate": "^1.0.7",
+ "v-calendar": "^3.1.2",
+ "vee-validate": "^4.12.8",
+ "vue": "^3.4.21",
+ "vue-router": "^4.3.0",
+ "vue3-easymde": "^1.0.1",
+ "zod": "^3.23.8"
},
"devDependencies": {
- "@testing-library/vue": "7.0.0",
- "@types/jest": "29.5.6",
- "@types/lodash": "4.14.200",
- "@types/vue-markdown": "2.2.3",
- "@typescript-eslint/eslint-plugin": "5.62.0",
- "@typescript-eslint/parser": "5.62.0",
- "@vue/cli-plugin-babel": "4.5.19",
- "@vue/cli-plugin-eslint": "4.5.19",
- "@vue/cli-plugin-pwa": "4.5.19",
- "@vue/cli-plugin-router": "4.5.19",
- "@vue/cli-plugin-typescript": "4.5.19",
- "@vue/cli-plugin-unit-jest": "4.5.19",
- "@vue/cli-plugin-vuex": "4.5.19",
- "@vue/cli-service": "4.5.19",
- "@vue/compiler-sfc": "3.3.6",
- "@vue/eslint-config-typescript": "10.0.0",
- "@vue/test-utils": "2.4.1",
- "@babel/eslint-parser": "7.22.15",
- "cypress": "11.2.0",
- "eslint": "7.32.0",
- "eslint-plugin-jest": "27.4.3",
- "eslint-plugin-vue": "7.20.0",
- "sass": "1.69.4",
- "sass-loader": "^10",
- "typescript": "5.1.6",
- "vue-cli-plugin-vuetify": "2.5.8",
- "vue-template-compiler": "2.7.15",
- "vuetify-loader": "1.9.2"
+ "@rushstack/eslint-patch": "^1.3.3",
+ "@tailwindcss/typography": "^0.5.13",
+ "@trivago/prettier-plugin-sort-imports": "^4.3.0",
+ "@tsconfig/node20": "^20.1.2",
+ "@types/lodash.debounce": "^4.0.9",
+ "@types/node": "^20.11.28",
+ "@vitejs/plugin-vue": "^5.0.4",
+ "@vue/eslint-config-prettier": "^8.0.0",
+ "@vue/eslint-config-typescript": "^12.0.0",
+ "@vue/tsconfig": "^0.5.1",
+ "autoprefixer": "^10.4.19",
+ "bun-types": "^1.1.6",
+ "eslint": "^8.49.0",
+ "eslint-plugin-vue": "^9.17.0",
+ "npm-run-all2": "^6.1.2",
+ "prettier": "^3.0.3",
+ "prettier-plugin-tailwindcss": "^0.6.0",
+ "tailwindcss": "^3.4.3",
+ "typescript": "~5.4.0",
+ "vite": "^5.1.6",
+ "vue-tsc": "^2.0.6"
}
}
diff --git a/ui/public/img/icons/android-chrome-192x192.png b/ui/public/img/icons/android-chrome-192x192.png
deleted file mode 100644
index fa3c74d..0000000
Binary files a/ui/public/img/icons/android-chrome-192x192.png and /dev/null differ
diff --git a/ui/public/img/icons/android-chrome-512x512.png b/ui/public/img/icons/android-chrome-512x512.png
deleted file mode 100644
index 5cef2ef..0000000
Binary files a/ui/public/img/icons/android-chrome-512x512.png and /dev/null differ
diff --git a/ui/public/img/icons/android-chrome-maskable-192x192.png b/ui/public/img/icons/android-chrome-maskable-192x192.png
deleted file mode 100644
index fa3c74d..0000000
Binary files a/ui/public/img/icons/android-chrome-maskable-192x192.png and /dev/null differ
diff --git a/ui/public/img/icons/android-chrome-maskable-512x512.png b/ui/public/img/icons/android-chrome-maskable-512x512.png
deleted file mode 100644
index 5cef2ef..0000000
Binary files a/ui/public/img/icons/android-chrome-maskable-512x512.png and /dev/null differ
diff --git a/ui/public/img/icons/apple-touch-icon-120x120.png b/ui/public/img/icons/apple-touch-icon-120x120.png
deleted file mode 100644
index a2d9e7e..0000000
Binary files a/ui/public/img/icons/apple-touch-icon-120x120.png and /dev/null differ
diff --git a/ui/public/img/icons/apple-touch-icon-152x152.png b/ui/public/img/icons/apple-touch-icon-152x152.png
deleted file mode 100644
index a62830b..0000000
Binary files a/ui/public/img/icons/apple-touch-icon-152x152.png and /dev/null differ
diff --git a/ui/public/img/icons/apple-touch-icon-180x180.png b/ui/public/img/icons/apple-touch-icon-180x180.png
deleted file mode 100644
index 576825d..0000000
Binary files a/ui/public/img/icons/apple-touch-icon-180x180.png and /dev/null differ
diff --git a/ui/public/img/icons/apple-touch-icon-60x60.png b/ui/public/img/icons/apple-touch-icon-60x60.png
deleted file mode 100644
index d8f6e7c..0000000
Binary files a/ui/public/img/icons/apple-touch-icon-60x60.png and /dev/null differ
diff --git a/ui/public/img/icons/apple-touch-icon-76x76.png b/ui/public/img/icons/apple-touch-icon-76x76.png
deleted file mode 100644
index 0d99887..0000000
Binary files a/ui/public/img/icons/apple-touch-icon-76x76.png and /dev/null differ
diff --git a/ui/public/img/icons/apple-touch-icon.png b/ui/public/img/icons/apple-touch-icon.png
deleted file mode 100644
index 576825d..0000000
Binary files a/ui/public/img/icons/apple-touch-icon.png and /dev/null differ
diff --git a/ui/public/img/icons/favicon-16x16.png b/ui/public/img/icons/favicon-16x16.png
deleted file mode 100644
index cb72d8d..0000000
Binary files a/ui/public/img/icons/favicon-16x16.png and /dev/null differ
diff --git a/ui/public/img/icons/favicon-32x32.png b/ui/public/img/icons/favicon-32x32.png
deleted file mode 100644
index e586f11..0000000
Binary files a/ui/public/img/icons/favicon-32x32.png and /dev/null differ
diff --git a/ui/public/img/icons/msapplication-icon-144x144.png b/ui/public/img/icons/msapplication-icon-144x144.png
deleted file mode 100644
index 9ebb285..0000000
Binary files a/ui/public/img/icons/msapplication-icon-144x144.png and /dev/null differ
diff --git a/ui/public/img/icons/mstile-150x150.png b/ui/public/img/icons/mstile-150x150.png
deleted file mode 100644
index a740f77..0000000
Binary files a/ui/public/img/icons/mstile-150x150.png and /dev/null differ
diff --git a/ui/public/img/icons/safari-pinned-tab.svg b/ui/public/img/icons/safari-pinned-tab.svg
deleted file mode 100644
index 1476170..0000000
--- a/ui/public/img/icons/safari-pinned-tab.svg
+++ /dev/null
@@ -1,130 +0,0 @@
-
-
-
-
-
- image/svg+xml
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/ui/public/index.html b/ui/public/index.html
deleted file mode 100644
index 94672c3..0000000
--- a/ui/public/index.html
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
- Catalyst
-
-
-
- We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.
-
-
-
-
diff --git a/ui/public/manifest.json b/ui/public/manifest.json
deleted file mode 100644
index 2c3ebae..0000000
--- a/ui/public/manifest.json
+++ /dev/null
@@ -1,76 +0,0 @@
-{
- "icons": [
- {
- "src": "./img/icons/android-chrome-192x192.png",
- "sizes": "192x192",
- "type": "image/png"
- },
- {
- "src": "./img/icons/android-chrome-512x512.png",
- "sizes": "512x512",
- "type": "image/png"
- },
- {
- "src": "./img/icons/android-chrome-maskable-192x192.png",
- "sizes": "192x192",
- "type": "image/png",
- "purpose": "maskable"
- },
- {
- "src": "./img/icons/android-chrome-maskable-512x512.png",
- "sizes": "512x512",
- "type": "image/png",
- "purpose": "maskable"
- },
- {
- "src": "./img/icons/apple-touch-icon-60x60.png",
- "sizes": "60x60",
- "type": "image/png"
- },
- {
- "src": "./img/icons/apple-touch-icon-76x76.png",
- "sizes": "76x76",
- "type": "image/png"
- },
- {
- "src": "./img/icons/apple-touch-icon-120x120.png",
- "sizes": "120x120",
- "type": "image/png"
- },
- {
- "src": "./img/icons/apple-touch-icon-152x152.png",
- "sizes": "152x152",
- "type": "image/png"
- },
- {
- "src": "./img/icons/apple-touch-icon-180x180.png",
- "sizes": "180x180",
- "type": "image/png"
- },
- {
- "src": "./img/icons/apple-touch-icon.png",
- "sizes": "180x180",
- "type": "image/png"
- },
- {
- "src": "./img/icons/favicon-16x16.png",
- "sizes": "16x16",
- "type": "image/png"
- },
- {
- "src": "./img/icons/favicon-32x32.png",
- "sizes": "32x32",
- "type": "image/png"
- },
- {
- "src": "./img/icons/msapplication-icon-144x144.png",
- "sizes": "144x144",
- "type": "image/png"
- },
- {
- "src": "./img/icons/mstile-150x150.png",
- "sizes": "150x150",
- "type": "image/png"
- }
- ]
-}
\ No newline at end of file
diff --git a/ui/public/silent-renew-oidc.html b/ui/public/silent-renew-oidc.html
deleted file mode 100644
index 1022e8b..0000000
--- a/ui/public/silent-renew-oidc.html
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/ui/src/App.vue b/ui/src/App.vue
index f7c4e0d..eabfe58 100644
--- a/ui/src/App.vue
+++ b/ui/src/App.vue
@@ -1,392 +1,8 @@
-
-
-
-
-
-
-
-
-
-
- Catalyst Login
-
-
-
-
-
-
-
- Login with OIDC
-
-
-
- Login
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Catalyst
-
-
-
-
-
-
-
-
- mdi-arrow-right-bold
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ customType.icon }}
-
- {{ customType.icon }}
-
- {{ customType.name }}
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ $store.state.settings.version }}
-
-
-
-
-
-
-
-
-
- mdi-share-variant
-
-
-
- API Documentation
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item.text }}
-
-
-
-
-
-
-
-
-
-
-
-
- mdi-account-circle
-
-
-
-
-
- Account
- mdi-account-circle
-
-
- Logout
- mdi-logout
-
-
-
-
-
-
-
- {{ $store.state.alert.name | capitalize }}
- {{ $store.state.alert.detail }}
-
- Close
-
-
-
-
-
-
-
-
+
+
+
+
diff --git a/ui/public/favicon.ico b/ui/src/assets/favicon.ico
similarity index 100%
rename from ui/public/favicon.ico
rename to ui/src/assets/favicon.ico
diff --git a/ui/public/flask.svg b/ui/src/assets/flask.svg
similarity index 100%
rename from ui/public/flask.svg
rename to ui/src/assets/flask.svg
diff --git a/ui/public/flask_white.svg b/ui/src/assets/flask_white.svg
similarity index 100%
rename from ui/public/flask_white.svg
rename to ui/src/assets/flask_white.svg
diff --git a/ui/src/assets/main.css b/ui/src/assets/main.css
new file mode 100644
index 0000000..0bd327d
--- /dev/null
+++ b/ui/src/assets/main.css
@@ -0,0 +1,90 @@
+@tailwind base;
+@tailwind components;
+@tailwind utilities;
+
+@layer base {
+ :root {
+ --background: 0 0% 100%;
+ --foreground: 240 10% 3.9%; /* zinc-950 */
+
+ --card: 0 0% 100%;
+ --card-foreground: 240 10% 3.9%;
+
+ --popover: 0 0% 100%;
+ --popover-foreground: 240 10% 3.9%;
+
+ --primary: 346.8 77.2% 49.8%;
+ --primary-foreground: 355.7 100% 97.3%;
+
+ --secondary: 240 4.8% 95.9%;
+ --secondary-foreground: 240 5.9% 10%;
+
+ --muted: 240 4.8% 95.9%;
+ --muted-foreground: 240 3.8% 46.1%;
+
+ --accent: 240 4.8% 95.9%;
+ --accent-foreground: 240 5.9% 10%; /* zinc-900 */
+
+ --destructive: 0 84.2% 60.2%;
+ --destructive-foreground: 0 0% 98%;
+
+ --border: 240 5.9% 90%;
+ --input: 240 5.9% 90%;
+ --ring: 346.8 77.2% 49.8%;
+ --radius: 0.5rem;
+
+ --vis-tooltip-background-color: none !important;
+ --vis-tooltip-border-color: none !important;
+ --vis-tooltip-text-color: none !important;
+ --vis-tooltip-shadow-color: none !important;
+ --vis-tooltip-backdrop-filter: none !important;
+ --vis-tooltip-padding: none !important;
+
+ --vis-primary-color: var(--primary);
+ /* change to any hsl value you want */
+ --vis-secondary-color: 160 81% 40%;
+ --vis-text-color: var(--muted-foreground);
+ }
+
+ @media (prefers-color-scheme: dark) {
+ :root {
+ --background: 20 14.3% 4.1%;
+ --foreground: 0 0% 95%;
+
+ --card: 24 9.8% 10%;
+ --card-foreground: 0 0% 95%;
+
+ --popover: 0 0% 9%;
+ --popover-foreground: 0 0% 95%;
+
+ --primary: 346.8 77.2% 49.8%;
+ --primary-foreground: 355.7 100% 97.3%;
+
+ --secondary: 240 3.7% 15.9%;
+ --secondary-foreground: 0 0% 98%;
+
+ --muted: 0 0% 15%;
+ --muted-foreground: 240 5% 64.9%;
+
+ --accent: 12 6.5% 15.1%;
+ --accent-foreground: 0 0% 98%;
+
+ --destructive: 0 62.8% 30.6%;
+ --destructive-foreground: 0 85.7% 97.3%;
+
+ --border: 240 3.7% 15.9%;
+ --input: 240 3.7% 15.9%;
+ --ring: 346.8 77.2% 49.8%;
+ }
+ }
+
+ * {
+ @apply border-border;
+ }
+ body {
+ @apply bg-background text-foreground;
+ font-feature-settings:
+ 'rlig' 1,
+ 'calt' 1;
+ }
+}
diff --git a/ui/src/client/.npmignore b/ui/src/client/.npmignore
deleted file mode 100644
index 999d88d..0000000
--- a/ui/src/client/.npmignore
+++ /dev/null
@@ -1 +0,0 @@
-# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm
\ No newline at end of file
diff --git a/ui/src/client/api.ts b/ui/src/client/api.ts
deleted file mode 100644
index ac89745..0000000
--- a/ui/src/client/api.ts
+++ /dev/null
@@ -1,8722 +0,0 @@
-/* tslint:disable */
-/* eslint-disable */
-/**
- *
- * API for the catalyst incident response platform.
- *
- * The version of the OpenAPI document:
- *
- *
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
- * https://openapi-generator.tech
- * Do not edit the class manually.
- */
-
-
-import { Configuration } from './configuration';
-import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
-// Some imports not used depending on template conditions
-// @ts-ignore
-import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common';
-// @ts-ignore
-import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base';
-
-/**
- *
- * @export
- * @interface Artifact
- */
-export interface Artifact {
- /**
- *
- * @type {{ [key: string]: Enrichment; }}
- * @memberof Artifact
- */
- 'enrichments'?: { [key: string]: Enrichment; };
- /**
- *
- * @type {string}
- * @memberof Artifact
- */
- 'kind'?: string;
- /**
- *
- * @type {string}
- * @memberof Artifact
- */
- 'name': string;
- /**
- *
- * @type {string}
- * @memberof Artifact
- */
- 'status'?: string;
- /**
- *
- * @type {string}
- * @memberof Artifact
- */
- 'type'?: string;
-}
-/**
- *
- * @export
- * @interface ArtifactOrigin
- */
-export interface ArtifactOrigin {
- /**
- *
- * @type {string}
- * @memberof ArtifactOrigin
- */
- 'artifact': string;
- /**
- *
- * @type {number}
- * @memberof ArtifactOrigin
- */
- 'ticket_id': number;
-}
-/**
- *
- * @export
- * @interface Automation
- */
-export interface Automation {
- /**
- *
- * @type {string}
- * @memberof Automation
- */
- 'image': string;
- /**
- *
- * @type {string}
- * @memberof Automation
- */
- 'schema'?: string;
- /**
- *
- * @type {string}
- * @memberof Automation
- */
- 'script': string;
- /**
- *
- * @type {Array}
- * @memberof Automation
- */
- 'type': Array;
-}
-
-export const AutomationTypeEnum = {
- Artifact: 'artifact',
- Playbook: 'playbook',
- Global: 'global'
-} as const;
-
-export type AutomationTypeEnum = typeof AutomationTypeEnum[keyof typeof AutomationTypeEnum];
-
-/**
- *
- * @export
- * @interface AutomationForm
- */
-export interface AutomationForm {
- /**
- *
- * @type {string}
- * @memberof AutomationForm
- */
- 'id': string;
- /**
- *
- * @type {string}
- * @memberof AutomationForm
- */
- 'image': string;
- /**
- *
- * @type {string}
- * @memberof AutomationForm
- */
- 'schema'?: string;
- /**
- *
- * @type {string}
- * @memberof AutomationForm
- */
- 'script': string;
- /**
- *
- * @type {Array}
- * @memberof AutomationForm
- */
- 'type': Array;
-}
-
-export const AutomationFormTypeEnum = {
- Artifact: 'artifact',
- Playbook: 'playbook',
- Global: 'global'
-} as const;
-
-export type AutomationFormTypeEnum = typeof AutomationFormTypeEnum[keyof typeof AutomationFormTypeEnum];
-
-/**
- *
- * @export
- * @interface AutomationResponse
- */
-export interface AutomationResponse {
- /**
- *
- * @type {string}
- * @memberof AutomationResponse
- */
- 'id': string;
- /**
- *
- * @type {string}
- * @memberof AutomationResponse
- */
- 'image': string;
- /**
- *
- * @type {string}
- * @memberof AutomationResponse
- */
- 'schema'?: string;
- /**
- *
- * @type {string}
- * @memberof AutomationResponse
- */
- 'script': string;
- /**
- *
- * @type {Array}
- * @memberof AutomationResponse
- */
- 'type': Array;
-}
-
-export const AutomationResponseTypeEnum = {
- Artifact: 'artifact',
- Playbook: 'playbook',
- Global: 'global'
-} as const;
-
-export type AutomationResponseTypeEnum = typeof AutomationResponseTypeEnum[keyof typeof AutomationResponseTypeEnum];
-
-/**
- *
- * @export
- * @interface Comment
- */
-export interface Comment {
- /**
- *
- * @type {string}
- * @memberof Comment
- */
- 'created': string;
- /**
- *
- * @type {string}
- * @memberof Comment
- */
- 'creator': string;
- /**
- *
- * @type {string}
- * @memberof Comment
- */
- 'message': string;
-}
-/**
- *
- * @export
- * @interface CommentForm
- */
-export interface CommentForm {
- /**
- *
- * @type {string}
- * @memberof CommentForm
- */
- 'created'?: string;
- /**
- *
- * @type {string}
- * @memberof CommentForm
- */
- 'creator'?: string;
- /**
- *
- * @type {string}
- * @memberof CommentForm
- */
- 'message': string;
-}
-/**
- *
- * @export
- * @interface Context
- */
-export interface Context {
- /**
- *
- * @type {Artifact}
- * @memberof Context
- */
- 'artifact'?: Artifact;
- /**
- *
- * @type {PlaybookResponse}
- * @memberof Context
- */
- 'playbook'?: PlaybookResponse;
- /**
- *
- * @type {TaskResponse}
- * @memberof Context
- */
- 'task'?: TaskResponse;
- /**
- *
- * @type {TicketResponse}
- * @memberof Context
- */
- 'ticket'?: TicketResponse;
-}
-/**
- *
- * @export
- * @interface Dashboard
- */
-export interface Dashboard {
- /**
- *
- * @type {string}
- * @memberof Dashboard
- */
- 'name': string;
- /**
- *
- * @type {Array}
- * @memberof Dashboard
- */
- 'widgets': Array;
-}
-/**
- *
- * @export
- * @interface DashboardResponse
- */
-export interface DashboardResponse {
- /**
- *
- * @type {string}
- * @memberof DashboardResponse
- */
- 'id': string;
- /**
- *
- * @type {string}
- * @memberof DashboardResponse
- */
- 'name': string;
- /**
- *
- * @type {Array}
- * @memberof DashboardResponse
- */
- 'widgets': Array;
-}
-/**
- *
- * @export
- * @interface Enrichment
- */
-export interface Enrichment {
- /**
- *
- * @type {string}
- * @memberof Enrichment
- */
- 'created': string;
- /**
- *
- * @type {object}
- * @memberof Enrichment
- */
- 'data': object;
- /**
- *
- * @type {string}
- * @memberof Enrichment
- */
- 'name': string;
-}
-/**
- *
- * @export
- * @interface EnrichmentForm
- */
-export interface EnrichmentForm {
- /**
- *
- * @type {object}
- * @memberof EnrichmentForm
- */
- 'data': object;
- /**
- *
- * @type {string}
- * @memberof EnrichmentForm
- */
- 'name': string;
-}
-/**
- *
- * @export
- * @interface Graph
- */
-export interface Graph {
- /**
- *
- * @type {Array }
- * @memberof Graph
- */
- 'links'?: Array ;
- /**
- *
- * @type {Array}
- * @memberof Graph
- */
- 'nodes'?: Array;
-}
-/**
- *
- * @export
- * @interface Group
- */
-export interface Group {
- /**
- *
- * @type {string}
- * @memberof Group
- */
- 'name': string;
- /**
- *
- * @type {Array}
- * @memberof Group
- */
- 'users': Array;
-}
-/**
- *
- * @export
- * @interface GroupForm
- */
-export interface GroupForm {
- /**
- *
- * @type {string}
- * @memberof GroupForm
- */
- 'id'?: string;
- /**
- *
- * @type {string}
- * @memberof GroupForm
- */
- 'name': string;
- /**
- *
- * @type {Array}
- * @memberof GroupForm
- */
- 'users': Array;
-}
-/**
- *
- * @export
- * @interface GroupResponse
- */
-export interface GroupResponse {
- /**
- *
- * @type {string}
- * @memberof GroupResponse
- */
- 'id': string;
- /**
- *
- * @type {string}
- * @memberof GroupResponse
- */
- 'name': string;
- /**
- *
- * @type {Array}
- * @memberof GroupResponse
- */
- 'users': Array;
-}
-/**
- *
- * @export
- * @interface Job
- */
-export interface Job {
- /**
- *
- * @type {string}
- * @memberof Job
- */
- 'automation': string;
- /**
- *
- * @type {string}
- * @memberof Job
- */
- 'container'?: string;
- /**
- *
- * @type {string}
- * @memberof Job
- */
- 'log'?: string;
- /**
- *
- * @type {Origin}
- * @memberof Job
- */
- 'origin'?: Origin;
- /**
- *
- * @type {object}
- * @memberof Job
- */
- 'output'?: object;
- /**
- *
- * @type {object}
- * @memberof Job
- */
- 'payload'?: object;
- /**
- *
- * @type {boolean}
- * @memberof Job
- */
- 'running': boolean;
- /**
- *
- * @type {string}
- * @memberof Job
- */
- 'status': string;
-}
-/**
- *
- * @export
- * @interface JobForm
- */
-export interface JobForm {
- /**
- *
- * @type {string}
- * @memberof JobForm
- */
- 'automation': string;
- /**
- *
- * @type {Origin}
- * @memberof JobForm
- */
- 'origin'?: Origin;
- /**
- *
- * @type {object}
- * @memberof JobForm
- */
- 'payload'?: object;
-}
-/**
- *
- * @export
- * @interface JobResponse
- */
-export interface JobResponse {
- /**
- *
- * @type {string}
- * @memberof JobResponse
- */
- 'automation': string;
- /**
- *
- * @type {string}
- * @memberof JobResponse
- */
- 'container'?: string;
- /**
- *
- * @type {string}
- * @memberof JobResponse
- */
- 'id': string;
- /**
- *
- * @type {string}
- * @memberof JobResponse
- */
- 'log'?: string;
- /**
- *
- * @type {Origin}
- * @memberof JobResponse
- */
- 'origin'?: Origin;
- /**
- *
- * @type {object}
- * @memberof JobResponse
- */
- 'output'?: object;
- /**
- *
- * @type {object}
- * @memberof JobResponse
- */
- 'payload'?: object;
- /**
- *
- * @type {string}
- * @memberof JobResponse
- */
- 'status': string;
-}
-/**
- *
- * @export
- * @interface JobUpdate
- */
-export interface JobUpdate {
- /**
- *
- * @type {string}
- * @memberof JobUpdate
- */
- 'container'?: string;
- /**
- *
- * @type {string}
- * @memberof JobUpdate
- */
- 'log'?: string;
- /**
- *
- * @type {object}
- * @memberof JobUpdate
- */
- 'output'?: object;
- /**
- *
- * @type {boolean}
- * @memberof JobUpdate
- */
- 'running': boolean;
- /**
- *
- * @type {string}
- * @memberof JobUpdate
- */
- 'status': string;
-}
-/**
- *
- * @export
- * @interface Link
- */
-export interface Link {
- /**
- *
- * @type {string}
- * @memberof Link
- */
- 'id': string;
- /**
- *
- * @type {string}
- * @memberof Link
- */
- 'sid': string;
- /**
- *
- * @type {string}
- * @memberof Link
- */
- 'tid': string;
-}
-/**
- *
- * @export
- * @interface LogEntry
- */
-export interface LogEntry {
- /**
- *
- * @type {string}
- * @memberof LogEntry
- */
- 'created': string;
- /**
- *
- * @type {string}
- * @memberof LogEntry
- */
- 'creator': string;
- /**
- *
- * @type {string}
- * @memberof LogEntry
- */
- 'message': string;
- /**
- *
- * @type {string}
- * @memberof LogEntry
- */
- 'reference': string;
- /**
- *
- * @type {string}
- * @memberof LogEntry
- */
- 'type': string;
-}
-/**
- *
- * @export
- * @interface Message
- */
-export interface Message {
- /**
- *
- * @type {Context}
- * @memberof Message
- */
- 'context'?: Context;
- /**
- *
- * @type {object}
- * @memberof Message
- */
- 'payload'?: object;
- /**
- *
- * @type {{ [key: string]: string; }}
- * @memberof Message
- */
- 'secrets'?: { [key: string]: string; };
-}
-/**
- *
- * @export
- * @interface ModelFile
- */
-export interface ModelFile {
- /**
- *
- * @type {string}
- * @memberof ModelFile
- */
- 'key': string;
- /**
- *
- * @type {string}
- * @memberof ModelFile
- */
- 'name': string;
-}
-/**
- *
- * @export
- * @interface NewUserResponse
- */
-export interface NewUserResponse {
- /**
- *
- * @type {boolean}
- * @memberof NewUserResponse
- */
- 'blocked': boolean;
- /**
- *
- * @type {string}
- * @memberof NewUserResponse
- */
- 'id': string;
- /**
- *
- * @type {Array}
- * @memberof NewUserResponse
- */
- 'roles': Array;
- /**
- *
- * @type {string}
- * @memberof NewUserResponse
- */
- 'secret'?: string;
-}
-/**
- *
- * @export
- * @interface Node
- */
-export interface Node {
- /**
- *
- * @type {string}
- * @memberof Node
- */
- 'id': string;
- /**
- *
- * @type {string}
- * @memberof Node
- */
- 'name': string;
-}
-/**
- *
- * @export
- * @interface Origin
- */
-export interface Origin {
- /**
- *
- * @type {ArtifactOrigin}
- * @memberof Origin
- */
- 'artifact_origin'?: ArtifactOrigin;
- /**
- *
- * @type {TaskOrigin}
- * @memberof Origin
- */
- 'task_origin'?: TaskOrigin;
-}
-/**
- *
- * @export
- * @interface Playbook
- */
-export interface Playbook {
- /**
- *
- * @type {string}
- * @memberof Playbook
- */
- 'name': string;
- /**
- *
- * @type {{ [key: string]: Task; }}
- * @memberof Playbook
- */
- 'tasks': { [key: string]: Task; };
-}
-/**
- *
- * @export
- * @interface PlaybookResponse
- */
-export interface PlaybookResponse {
- /**
- *
- * @type {string}
- * @memberof PlaybookResponse
- */
- 'name': string;
- /**
- *
- * @type {{ [key: string]: TaskResponse; }}
- * @memberof PlaybookResponse
- */
- 'tasks': { [key: string]: TaskResponse; };
-}
-/**
- *
- * @export
- * @interface PlaybookTemplate
- */
-export interface PlaybookTemplate {
- /**
- *
- * @type {string}
- * @memberof PlaybookTemplate
- */
- 'name': string;
- /**
- *
- * @type {string}
- * @memberof PlaybookTemplate
- */
- 'yaml': string;
-}
-/**
- *
- * @export
- * @interface PlaybookTemplateForm
- */
-export interface PlaybookTemplateForm {
- /**
- *
- * @type {string}
- * @memberof PlaybookTemplateForm
- */
- 'id'?: string;
- /**
- *
- * @type {string}
- * @memberof PlaybookTemplateForm
- */
- 'yaml': string;
-}
-/**
- *
- * @export
- * @interface PlaybookTemplateResponse
- */
-export interface PlaybookTemplateResponse {
- /**
- *
- * @type {string}
- * @memberof PlaybookTemplateResponse
- */
- 'id': string;
- /**
- *
- * @type {string}
- * @memberof PlaybookTemplateResponse
- */
- 'name': string;
- /**
- *
- * @type {string}
- * @memberof PlaybookTemplateResponse
- */
- 'yaml': string;
-}
-/**
- *
- * @export
- * @interface Reference
- */
-export interface Reference {
- /**
- *
- * @type {string}
- * @memberof Reference
- */
- 'href': string;
- /**
- *
- * @type {string}
- * @memberof Reference
- */
- 'name': string;
-}
-/**
- *
- * @export
- * @interface Rule
- */
-export interface Rule {
- /**
- *
- * @type {string}
- * @memberof Rule
- */
- 'condition': string;
- /**
- *
- * @type {string}
- * @memberof Rule
- */
- 'name': string;
- /**
- *
- * @type {object}
- * @memberof Rule
- */
- 'update': object;
-}
-/**
- *
- * @export
- * @interface RuleForm
- */
-export interface RuleForm {
- /**
- *
- * @type {string}
- * @memberof RuleForm
- */
- 'condition': string;
- /**
- *
- * @type {string}
- * @memberof RuleForm
- */
- 'id'?: string;
- /**
- *
- * @type {string}
- * @memberof RuleForm
- */
- 'name': string;
- /**
- *
- * @type {object}
- * @memberof RuleForm
- */
- 'update': object;
-}
-/**
- *
- * @export
- * @interface RuleResponse
- */
-export interface RuleResponse {
- /**
- *
- * @type {string}
- * @memberof RuleResponse
- */
- 'condition': string;
- /**
- *
- * @type {string}
- * @memberof RuleResponse
- */
- 'id': string;
- /**
- *
- * @type {string}
- * @memberof RuleResponse
- */
- 'name': string;
- /**
- *
- * @type {object}
- * @memberof RuleResponse
- */
- 'update': object;
-}
-/**
- *
- * @export
- * @interface Settings
- */
-export interface Settings {
- /**
- *
- * @type {Array}
- * @memberof Settings
- */
- 'artifactKinds': Array;
- /**
- *
- * @type {Array}
- * @memberof Settings
- */
- 'artifactStates': Array;
- /**
- *
- * @type {string}
- * @memberof Settings
- */
- 'timeformat': string;
-}
-/**
- *
- * @export
- * @interface SettingsResponse
- */
-export interface SettingsResponse {
- /**
- *
- * @type {Array}
- * @memberof SettingsResponse
- */
- 'artifactKinds': Array;
- /**
- *
- * @type {Array}
- * @memberof SettingsResponse
- */
- 'artifactStates': Array;
- /**
- *
- * @type {Array}
- * @memberof SettingsResponse
- */
- 'roles'?: Array;
- /**
- *
- * @type {Array}
- * @memberof SettingsResponse
- */
- 'ticketTypes': Array;
- /**
- *
- * @type {string}
- * @memberof SettingsResponse
- */
- 'tier': SettingsResponseTierEnum;
- /**
- *
- * @type {string}
- * @memberof SettingsResponse
- */
- 'timeformat': string;
- /**
- *
- * @type {string}
- * @memberof SettingsResponse
- */
- 'version': string;
-}
-
-export const SettingsResponseTierEnum = {
- Community: 'community',
- Enterprise: 'enterprise'
-} as const;
-
-export type SettingsResponseTierEnum = typeof SettingsResponseTierEnum[keyof typeof SettingsResponseTierEnum];
-
-/**
- *
- * @export
- * @interface Statistics
- */
-export interface Statistics {
- /**
- *
- * @type {{ [key: string]: number; }}
- * @memberof Statistics
- */
- 'open_tickets_per_user': { [key: string]: number; };
- /**
- *
- * @type {{ [key: string]: number; }}
- * @memberof Statistics
- */
- 'tickets_per_type': { [key: string]: number; };
- /**
- *
- * @type {{ [key: string]: number; }}
- * @memberof Statistics
- */
- 'tickets_per_week': { [key: string]: number; };
- /**
- *
- * @type {number}
- * @memberof Statistics
- */
- 'unassigned': number;
-}
-/**
- *
- * @export
- * @interface Task
- */
-export interface Task {
- /**
- *
- * @type {string}
- * @memberof Task
- */
- 'automation'?: string;
- /**
- *
- * @type {string}
- * @memberof Task
- */
- 'closed'?: string;
- /**
- *
- * @type {string}
- * @memberof Task
- */
- 'created': string;
- /**
- *
- * @type {object}
- * @memberof Task
- */
- 'data'?: object;
- /**
- *
- * @type {boolean}
- * @memberof Task
- */
- 'done': boolean;
- /**
- *
- * @type {boolean}
- * @memberof Task
- */
- 'join'?: boolean;
- /**
- *
- * @type {string}
- * @memberof Task
- */
- 'name': string;
- /**
- *
- * @type {{ [key: string]: string; }}
- * @memberof Task
- */
- 'next'?: { [key: string]: string; };
- /**
- *
- * @type {string}
- * @memberof Task
- */
- 'owner'?: string;
- /**
- *
- * @type {{ [key: string]: string; }}
- * @memberof Task
- */
- 'payload'?: { [key: string]: string; };
- /**
- *
- * @type {object}
- * @memberof Task
- */
- 'schema'?: object;
- /**
- *
- * @type {string}
- * @memberof Task
- */
- 'type': TaskTypeEnum;
-}
-
-export const TaskTypeEnum = {
- Task: 'task',
- Input: 'input',
- Automation: 'automation'
-} as const;
-
-export type TaskTypeEnum = typeof TaskTypeEnum[keyof typeof TaskTypeEnum];
-
-/**
- *
- * @export
- * @interface TaskOrigin
- */
-export interface TaskOrigin {
- /**
- *
- * @type {string}
- * @memberof TaskOrigin
- */
- 'playbook_id': string;
- /**
- *
- * @type {string}
- * @memberof TaskOrigin
- */
- 'task_id': string;
- /**
- *
- * @type {number}
- * @memberof TaskOrigin
- */
- 'ticket_id': number;
-}
-/**
- *
- * @export
- * @interface TaskResponse
- */
-export interface TaskResponse {
- /**
- *
- * @type {boolean}
- * @memberof TaskResponse
- */
- 'active': boolean;
- /**
- *
- * @type {string}
- * @memberof TaskResponse
- */
- 'automation'?: string;
- /**
- *
- * @type {string}
- * @memberof TaskResponse
- */
- 'closed'?: string;
- /**
- *
- * @type {string}
- * @memberof TaskResponse
- */
- 'created': string;
- /**
- *
- * @type {object}
- * @memberof TaskResponse
- */
- 'data'?: object;
- /**
- *
- * @type {boolean}
- * @memberof TaskResponse
- */
- 'done': boolean;
- /**
- *
- * @type {boolean}
- * @memberof TaskResponse
- */
- 'join'?: boolean;
- /**
- *
- * @type {string}
- * @memberof TaskResponse
- */
- 'name': string;
- /**
- *
- * @type {{ [key: string]: string; }}
- * @memberof TaskResponse
- */
- 'next'?: { [key: string]: string; };
- /**
- *
- * @type {number}
- * @memberof TaskResponse
- */
- 'order': number;
- /**
- *
- * @type {string}
- * @memberof TaskResponse
- */
- 'owner'?: string;
- /**
- *
- * @type {{ [key: string]: string; }}
- * @memberof TaskResponse
- */
- 'payload'?: { [key: string]: string; };
- /**
- *
- * @type {object}
- * @memberof TaskResponse
- */
- 'schema'?: object;
- /**
- *
- * @type {string}
- * @memberof TaskResponse
- */
- 'type': TaskResponseTypeEnum;
-}
-
-export const TaskResponseTypeEnum = {
- Task: 'task',
- Input: 'input',
- Automation: 'automation'
-} as const;
-
-export type TaskResponseTypeEnum = typeof TaskResponseTypeEnum[keyof typeof TaskResponseTypeEnum];
-
-/**
- *
- * @export
- * @interface TaskWithContext
- */
-export interface TaskWithContext {
- /**
- *
- * @type {string}
- * @memberof TaskWithContext
- */
- 'playbook_id': string;
- /**
- *
- * @type {string}
- * @memberof TaskWithContext
- */
- 'playbook_name': string;
- /**
- *
- * @type {TaskResponse}
- * @memberof TaskWithContext
- */
- 'task': TaskResponse;
- /**
- *
- * @type {string}
- * @memberof TaskWithContext
- */
- 'task_id': string;
- /**
- *
- * @type {number}
- * @memberof TaskWithContext
- */
- 'ticket_id': number;
- /**
- *
- * @type {string}
- * @memberof TaskWithContext
- */
- 'ticket_name': string;
-}
-/**
- *
- * @export
- * @interface Ticket
- */
-export interface Ticket {
- /**
- *
- * @type {Array}
- * @memberof Ticket
- */
- 'artifacts'?: Array;
- /**
- *
- * @type {Array}
- * @memberof Ticket
- */
- 'comments'?: Array;
- /**
- *
- * @type {string}
- * @memberof Ticket
- */
- 'created': string;
- /**
- *
- * @type {object}
- * @memberof Ticket
- */
- 'details'?: object;
- /**
- *
- * @type {Array}
- * @memberof Ticket
- */
- 'files'?: Array;
- /**
- *
- * @type {string}
- * @memberof Ticket
- */
- 'modified': string;
- /**
- *
- * @type {string}
- * @memberof Ticket
- */
- 'name': string;
- /**
- *
- * @type {string}
- * @memberof Ticket
- */
- 'owner'?: string;
- /**
- *
- * @type {{ [key: string]: Playbook; }}
- * @memberof Ticket
- */
- 'playbooks'?: { [key: string]: Playbook; };
- /**
- *
- * @type {Array}
- * @memberof Ticket
- */
- 'read'?: Array;
- /**
- *
- * @type {Array}
- * @memberof Ticket
- */
- 'references'?: Array;
- /**
- *
- * @type {string}
- * @memberof Ticket
- */
- 'schema': string;
- /**
- *
- * @type {string}
- * @memberof Ticket
- */
- 'status': string;
- /**
- *
- * @type {string}
- * @memberof Ticket
- */
- 'type': string;
- /**
- *
- * @type {Array}
- * @memberof Ticket
- */
- 'write'?: Array;
-}
-/**
- *
- * @export
- * @interface TicketForm
- */
-export interface TicketForm {
- /**
- *
- * @type {Array}
- * @memberof TicketForm
- */
- 'artifacts'?: Array;
- /**
- *
- * @type {Array}
- * @memberof TicketForm
- */
- 'comments'?: Array;
- /**
- *
- * @type {string}
- * @memberof TicketForm
- */
- 'created'?: string;
- /**
- *
- * @type {object}
- * @memberof TicketForm
- */
- 'details'?: object;
- /**
- *
- * @type {Array}
- * @memberof TicketForm
- */
- 'files'?: Array;
- /**
- *
- * @type {number}
- * @memberof TicketForm
- */
- 'id'?: number;
- /**
- *
- * @type {string}
- * @memberof TicketForm
- */
- 'modified'?: string;
- /**
- *
- * @type {string}
- * @memberof TicketForm
- */
- 'name': string;
- /**
- *
- * @type {string}
- * @memberof TicketForm
- */
- 'owner'?: string;
- /**
- *
- * @type {Array}
- * @memberof TicketForm
- */
- 'playbooks'?: Array;
- /**
- *
- * @type {Array}
- * @memberof TicketForm
- */
- 'read'?: Array;
- /**
- *
- * @type {Array}
- * @memberof TicketForm
- */
- 'references'?: Array;
- /**
- *
- * @type {string}
- * @memberof TicketForm
- */
- 'schema'?: string;
- /**
- *
- * @type {string}
- * @memberof TicketForm
- */
- 'status': string;
- /**
- *
- * @type {string}
- * @memberof TicketForm
- */
- 'type': string;
- /**
- *
- * @type {Array}
- * @memberof TicketForm
- */
- 'write'?: Array;
-}
-/**
- *
- * @export
- * @interface TicketList
- */
-export interface TicketList {
- /**
- *
- * @type {number}
- * @memberof TicketList
- */
- 'count': number;
- /**
- *
- * @type {Array}
- * @memberof TicketList
- */
- 'tickets': Array;
-}
-/**
- *
- * @export
- * @interface TicketResponse
- */
-export interface TicketResponse {
- /**
- *
- * @type {Array}
- * @memberof TicketResponse
- */
- 'artifacts'?: Array;
- /**
- *
- * @type {Array}
- * @memberof TicketResponse
- */
- 'comments'?: Array;
- /**
- *
- * @type {string}
- * @memberof TicketResponse
- */
- 'created': string;
- /**
- *
- * @type {object}
- * @memberof TicketResponse
- */
- 'details'?: object;
- /**
- *
- * @type {Array}
- * @memberof TicketResponse
- */
- 'files'?: Array;
- /**
- *
- * @type {number}
- * @memberof TicketResponse
- */
- 'id': number;
- /**
- *
- * @type {string}
- * @memberof TicketResponse
- */
- 'modified': string;
- /**
- *
- * @type {string}
- * @memberof TicketResponse
- */
- 'name': string;
- /**
- *
- * @type {string}
- * @memberof TicketResponse
- */
- 'owner'?: string;
- /**
- *
- * @type {{ [key: string]: PlaybookResponse; }}
- * @memberof TicketResponse
- */
- 'playbooks'?: { [key: string]: PlaybookResponse; };
- /**
- *
- * @type {Array}
- * @memberof TicketResponse
- */
- 'read'?: Array;
- /**
- *
- * @type {Array}
- * @memberof TicketResponse
- */
- 'references'?: Array;
- /**
- *
- * @type {string}
- * @memberof TicketResponse
- */
- 'schema': string;
- /**
- *
- * @type {string}
- * @memberof TicketResponse
- */
- 'status': string;
- /**
- *
- * @type {string}
- * @memberof TicketResponse
- */
- 'type': string;
- /**
- *
- * @type {Array}
- * @memberof TicketResponse
- */
- 'write'?: Array;
-}
-/**
- *
- * @export
- * @interface TicketSimpleResponse
- */
-export interface TicketSimpleResponse {
- /**
- *
- * @type {Array}
- * @memberof TicketSimpleResponse
- */
- 'artifacts'?: Array;
- /**
- *
- * @type {Array}
- * @memberof TicketSimpleResponse
- */
- 'comments'?: Array;
- /**
- *
- * @type {string}
- * @memberof TicketSimpleResponse
- */
- 'created': string;
- /**
- *
- * @type {object}
- * @memberof TicketSimpleResponse
- */
- 'details'?: object;
- /**
- *
- * @type {Array}
- * @memberof TicketSimpleResponse
- */
- 'files'?: Array;
- /**
- *
- * @type {number}
- * @memberof TicketSimpleResponse
- */
- 'id': number;
- /**
- *
- * @type {string}
- * @memberof TicketSimpleResponse
- */
- 'modified': string;
- /**
- *
- * @type {string}
- * @memberof TicketSimpleResponse
- */
- 'name': string;
- /**
- *
- * @type {string}
- * @memberof TicketSimpleResponse
- */
- 'owner'?: string;
- /**
- *
- * @type {{ [key: string]: Playbook; }}
- * @memberof TicketSimpleResponse
- */
- 'playbooks'?: { [key: string]: Playbook; };
- /**
- *
- * @type {Array}
- * @memberof TicketSimpleResponse
- */
- 'read'?: Array;
- /**
- *
- * @type {Array}
- * @memberof TicketSimpleResponse
- */
- 'references'?: Array;
- /**
- *
- * @type {string}
- * @memberof TicketSimpleResponse
- */
- 'schema': string;
- /**
- *
- * @type {string}
- * @memberof TicketSimpleResponse
- */
- 'status': string;
- /**
- *
- * @type {string}
- * @memberof TicketSimpleResponse
- */
- 'type': string;
- /**
- *
- * @type {Array}
- * @memberof TicketSimpleResponse
- */
- 'write'?: Array;
-}
-/**
- *
- * @export
- * @interface TicketTemplate
- */
-export interface TicketTemplate {
- /**
- *
- * @type {string}
- * @memberof TicketTemplate
- */
- 'name': string;
- /**
- *
- * @type {string}
- * @memberof TicketTemplate
- */
- 'schema': string;
-}
-/**
- *
- * @export
- * @interface TicketTemplateForm
- */
-export interface TicketTemplateForm {
- /**
- *
- * @type {string}
- * @memberof TicketTemplateForm
- */
- 'id'?: string;
- /**
- *
- * @type {string}
- * @memberof TicketTemplateForm
- */
- 'name': string;
- /**
- *
- * @type {string}
- * @memberof TicketTemplateForm
- */
- 'schema': string;
-}
-/**
- *
- * @export
- * @interface TicketTemplateResponse
- */
-export interface TicketTemplateResponse {
- /**
- *
- * @type {string}
- * @memberof TicketTemplateResponse
- */
- 'id': string;
- /**
- *
- * @type {string}
- * @memberof TicketTemplateResponse
- */
- 'name': string;
- /**
- *
- * @type {string}
- * @memberof TicketTemplateResponse
- */
- 'schema': string;
-}
-/**
- *
- * @export
- * @interface TicketType
- */
-export interface TicketType {
- /**
- *
- * @type {Array}
- * @memberof TicketType
- */
- 'default_groups'?: Array;
- /**
- *
- * @type {Array}
- * @memberof TicketType
- */
- 'default_playbooks': Array;
- /**
- *
- * @type {string}
- * @memberof TicketType
- */
- 'default_template': string;
- /**
- *
- * @type {string}
- * @memberof TicketType
- */
- 'icon': string;
- /**
- *
- * @type {string}
- * @memberof TicketType
- */
- 'name': string;
-}
-/**
- *
- * @export
- * @interface TicketTypeForm
- */
-export interface TicketTypeForm {
- /**
- *
- * @type {Array}
- * @memberof TicketTypeForm
- */
- 'default_groups'?: Array;
- /**
- *
- * @type {Array}
- * @memberof TicketTypeForm
- */
- 'default_playbooks': Array;
- /**
- *
- * @type {string}
- * @memberof TicketTypeForm
- */
- 'default_template': string;
- /**
- *
- * @type {string}
- * @memberof TicketTypeForm
- */
- 'icon': string;
- /**
- *
- * @type {string}
- * @memberof TicketTypeForm
- */
- 'id'?: string;
- /**
- *
- * @type {string}
- * @memberof TicketTypeForm
- */
- 'name': string;
-}
-/**
- *
- * @export
- * @interface TicketTypeResponse
- */
-export interface TicketTypeResponse {
- /**
- *
- * @type {Array}
- * @memberof TicketTypeResponse
- */
- 'default_groups'?: Array;
- /**
- *
- * @type {Array}
- * @memberof TicketTypeResponse
- */
- 'default_playbooks': Array;
- /**
- *
- * @type {string}
- * @memberof TicketTypeResponse
- */
- 'default_template': string;
- /**
- *
- * @type {string}
- * @memberof TicketTypeResponse
- */
- 'icon': string;
- /**
- *
- * @type {string}
- * @memberof TicketTypeResponse
- */
- 'id': string;
- /**
- *
- * @type {string}
- * @memberof TicketTypeResponse
- */
- 'name': string;
-}
-/**
- *
- * @export
- * @interface TicketWithTickets
- */
-export interface TicketWithTickets {
- /**
- *
- * @type {Array}
- * @memberof TicketWithTickets
- */
- 'artifacts'?: Array;
- /**
- *
- * @type {Array}
- * @memberof TicketWithTickets
- */
- 'comments'?: Array;
- /**
- *
- * @type {Array}
- * @memberof TicketWithTickets
- */
- 'correlated_tickets'?: Array;
- /**
- *
- * @type {string}
- * @memberof TicketWithTickets
- */
- 'created': string;
- /**
- *
- * @type {object}
- * @memberof TicketWithTickets
- */
- 'details'?: object;
- /**
- *
- * @type {Array}
- * @memberof TicketWithTickets
- */
- 'files'?: Array;
- /**
- *
- * @type {number}
- * @memberof TicketWithTickets
- */
- 'id': number;
- /**
- *
- * @type {Array}
- * @memberof TicketWithTickets
- */
- 'logs'?: Array;
- /**
- *
- * @type {string}
- * @memberof TicketWithTickets
- */
- 'modified': string;
- /**
- *
- * @type {string}
- * @memberof TicketWithTickets
- */
- 'name': string;
- /**
- *
- * @type {string}
- * @memberof TicketWithTickets
- */
- 'owner'?: string;
- /**
- *
- * @type {{ [key: string]: PlaybookResponse; }}
- * @memberof TicketWithTickets
- */
- 'playbooks'?: { [key: string]: PlaybookResponse; };
- /**
- *
- * @type {Array}
- * @memberof TicketWithTickets
- */
- 'read'?: Array;
- /**
- *
- * @type {Array}
- * @memberof TicketWithTickets
- */
- 'references'?: Array;
- /**
- *
- * @type {string}
- * @memberof TicketWithTickets
- */
- 'schema': string;
- /**
- *
- * @type {string}
- * @memberof TicketWithTickets
- */
- 'status': string;
- /**
- *
- * @type {Array}
- * @memberof TicketWithTickets
- */
- 'tickets'?: Array;
- /**
- *
- * @type {string}
- * @memberof TicketWithTickets
- */
- 'type': string;
- /**
- *
- * @type {Array}
- * @memberof TicketWithTickets
- */
- 'write'?: Array;
-}
-/**
- *
- * @export
- * @interface Type
- */
-export interface Type {
- /**
- *
- * @type {string}
- * @memberof Type
- */
- 'color'?: TypeColorEnum;
- /**
- *
- * @type {string}
- * @memberof Type
- */
- 'icon': string;
- /**
- *
- * @type {string}
- * @memberof Type
- */
- 'id': string;
- /**
- *
- * @type {string}
- * @memberof Type
- */
- 'name': string;
-}
-
-export const TypeColorEnum = {
- Error: 'error',
- Info: 'info',
- Success: 'success',
- Warning: 'warning'
-} as const;
-
-export type TypeColorEnum = typeof TypeColorEnum[keyof typeof TypeColorEnum];
-
-/**
- *
- * @export
- * @interface User
- */
-export interface User {
- /**
- *
- * @type {boolean}
- * @memberof User
- */
- 'apikey': boolean;
- /**
- *
- * @type {boolean}
- * @memberof User
- */
- 'blocked': boolean;
- /**
- *
- * @type {Array}
- * @memberof User
- */
- 'roles': Array;
- /**
- *
- * @type {string}
- * @memberof User
- */
- 'sha256'?: string;
-}
-/**
- *
- * @export
- * @interface UserData
- */
-export interface UserData {
- /**
- *
- * @type {string}
- * @memberof UserData
- */
- 'email'?: string;
- /**
- *
- * @type {string}
- * @memberof UserData
- */
- 'image'?: string;
- /**
- *
- * @type {string}
- * @memberof UserData
- */
- 'name'?: string;
- /**
- *
- * @type {string}
- * @memberof UserData
- */
- 'timeformat'?: string;
-}
-/**
- *
- * @export
- * @interface UserDataResponse
- */
-export interface UserDataResponse {
- /**
- *
- * @type {string}
- * @memberof UserDataResponse
- */
- 'email'?: string;
- /**
- *
- * @type {string}
- * @memberof UserDataResponse
- */
- 'id': string;
- /**
- *
- * @type {string}
- * @memberof UserDataResponse
- */
- 'image'?: string;
- /**
- *
- * @type {string}
- * @memberof UserDataResponse
- */
- 'name'?: string;
- /**
- *
- * @type {string}
- * @memberof UserDataResponse
- */
- 'timeformat'?: string;
-}
-/**
- *
- * @export
- * @interface UserForm
- */
-export interface UserForm {
- /**
- *
- * @type {boolean}
- * @memberof UserForm
- */
- 'apikey': boolean;
- /**
- *
- * @type {boolean}
- * @memberof UserForm
- */
- 'blocked': boolean;
- /**
- *
- * @type {string}
- * @memberof UserForm
- */
- 'id': string;
- /**
- *
- * @type {Array}
- * @memberof UserForm
- */
- 'roles': Array;
-}
-/**
- *
- * @export
- * @interface UserResponse
- */
-export interface UserResponse {
- /**
- *
- * @type {boolean}
- * @memberof UserResponse
- */
- 'apikey': boolean;
- /**
- *
- * @type {boolean}
- * @memberof UserResponse
- */
- 'blocked': boolean;
- /**
- *
- * @type {string}
- * @memberof UserResponse
- */
- 'id': string;
- /**
- *
- * @type {Array}
- * @memberof UserResponse
- */
- 'roles': Array;
-}
-/**
- *
- * @export
- * @interface Widget
- */
-export interface Widget {
- /**
- *
- * @type {string}
- * @memberof Widget
- */
- 'aggregation': string;
- /**
- *
- * @type {string}
- * @memberof Widget
- */
- 'filter'?: string;
- /**
- *
- * @type {string}
- * @memberof Widget
- */
- 'name': string;
- /**
- *
- * @type {string}
- * @memberof Widget
- */
- 'type': WidgetTypeEnum;
- /**
- *
- * @type {number}
- * @memberof Widget
- */
- 'width': number;
-}
-
-export const WidgetTypeEnum = {
- Bar: 'bar',
- Line: 'line',
- Pie: 'pie'
-} as const;
-
-export type WidgetTypeEnum = typeof WidgetTypeEnum[keyof typeof WidgetTypeEnum];
-
-
-/**
- * AutomationsApi - axios parameter creator
- * @export
- */
-export const AutomationsApiAxiosParamCreator = function (configuration?: Configuration) {
- return {
- /**
- *
- * @summary Create a new automation
- * @param {AutomationForm} automation New automation
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- createAutomation: async (automation: AutomationForm, options: AxiosRequestConfig = {}): Promise => {
- // verify required parameter 'automation' is not null or undefined
- assertParamExists('createAutomation', 'automation', automation)
- const localVarPath = `/automations`;
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- localVarHeaderParameter['Content-Type'] = 'application/json';
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
- localVarRequestOptions.data = serializeDataIfNeeded(automation, localVarRequestOptions, configuration)
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- /**
- *
- * @summary Delete a automation
- * @param {string} id Automation ID
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- deleteAutomation: async (id: string, options: AxiosRequestConfig = {}): Promise => {
- // verify required parameter 'id' is not null or undefined
- assertParamExists('deleteAutomation', 'id', id)
- const localVarPath = `/automations/{id}`
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- /**
- *
- * @summary Get a single automation
- * @param {string} id Automation ID
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- getAutomation: async (id: string, options: AxiosRequestConfig = {}): Promise => {
- // verify required parameter 'id' is not null or undefined
- assertParamExists('getAutomation', 'id', id)
- const localVarPath = `/automations/{id}`
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- /**
- *
- * @summary List automations
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- listAutomations: async (options: AxiosRequestConfig = {}): Promise => {
- const localVarPath = `/automations`;
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- /**
- *
- * @summary Update an existing automation
- * @param {string} id Automation ID
- * @param {AutomationForm} automation Automation object that needs to be added
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- updateAutomation: async (id: string, automation: AutomationForm, options: AxiosRequestConfig = {}): Promise => {
- // verify required parameter 'id' is not null or undefined
- assertParamExists('updateAutomation', 'id', id)
- // verify required parameter 'automation' is not null or undefined
- assertParamExists('updateAutomation', 'automation', automation)
- const localVarPath = `/automations/{id}`
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- localVarHeaderParameter['Content-Type'] = 'application/json';
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
- localVarRequestOptions.data = serializeDataIfNeeded(automation, localVarRequestOptions, configuration)
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- }
-};
-
-/**
- * AutomationsApi - functional programming interface
- * @export
- */
-export const AutomationsApiFp = function(configuration?: Configuration) {
- const localVarAxiosParamCreator = AutomationsApiAxiosParamCreator(configuration)
- return {
- /**
- *
- * @summary Create a new automation
- * @param {AutomationForm} automation New automation
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async createAutomation(automation: AutomationForm, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.createAutomation(automation, options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- /**
- *
- * @summary Delete a automation
- * @param {string} id Automation ID
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async deleteAutomation(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.deleteAutomation(id, options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- /**
- *
- * @summary Get a single automation
- * @param {string} id Automation ID
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async getAutomation(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.getAutomation(id, options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- /**
- *
- * @summary List automations
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async listAutomations(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.listAutomations(options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- /**
- *
- * @summary Update an existing automation
- * @param {string} id Automation ID
- * @param {AutomationForm} automation Automation object that needs to be added
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async updateAutomation(id: string, automation: AutomationForm, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.updateAutomation(id, automation, options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- }
-};
-
-/**
- * AutomationsApi - factory interface
- * @export
- */
-export const AutomationsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
- const localVarFp = AutomationsApiFp(configuration)
- return {
- /**
- *
- * @summary Create a new automation
- * @param {AutomationForm} automation New automation
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- createAutomation(automation: AutomationForm, options?: any): AxiosPromise {
- return localVarFp.createAutomation(automation, options).then((request) => request(axios, basePath));
- },
- /**
- *
- * @summary Delete a automation
- * @param {string} id Automation ID
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- deleteAutomation(id: string, options?: any): AxiosPromise {
- return localVarFp.deleteAutomation(id, options).then((request) => request(axios, basePath));
- },
- /**
- *
- * @summary Get a single automation
- * @param {string} id Automation ID
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- getAutomation(id: string, options?: any): AxiosPromise {
- return localVarFp.getAutomation(id, options).then((request) => request(axios, basePath));
- },
- /**
- *
- * @summary List automations
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- listAutomations(options?: any): AxiosPromise> {
- return localVarFp.listAutomations(options).then((request) => request(axios, basePath));
- },
- /**
- *
- * @summary Update an existing automation
- * @param {string} id Automation ID
- * @param {AutomationForm} automation Automation object that needs to be added
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- updateAutomation(id: string, automation: AutomationForm, options?: any): AxiosPromise {
- return localVarFp.updateAutomation(id, automation, options).then((request) => request(axios, basePath));
- },
- };
-};
-
-/**
- * AutomationsApi - object-oriented interface
- * @export
- * @class AutomationsApi
- * @extends {BaseAPI}
- */
-export class AutomationsApi extends BaseAPI {
- /**
- *
- * @summary Create a new automation
- * @param {AutomationForm} automation New automation
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof AutomationsApi
- */
- public createAutomation(automation: AutomationForm, options?: AxiosRequestConfig) {
- return AutomationsApiFp(this.configuration).createAutomation(automation, options).then((request) => request(this.axios, this.basePath));
- }
-
- /**
- *
- * @summary Delete a automation
- * @param {string} id Automation ID
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof AutomationsApi
- */
- public deleteAutomation(id: string, options?: AxiosRequestConfig) {
- return AutomationsApiFp(this.configuration).deleteAutomation(id, options).then((request) => request(this.axios, this.basePath));
- }
-
- /**
- *
- * @summary Get a single automation
- * @param {string} id Automation ID
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof AutomationsApi
- */
- public getAutomation(id: string, options?: AxiosRequestConfig) {
- return AutomationsApiFp(this.configuration).getAutomation(id, options).then((request) => request(this.axios, this.basePath));
- }
-
- /**
- *
- * @summary List automations
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof AutomationsApi
- */
- public listAutomations(options?: AxiosRequestConfig) {
- return AutomationsApiFp(this.configuration).listAutomations(options).then((request) => request(this.axios, this.basePath));
- }
-
- /**
- *
- * @summary Update an existing automation
- * @param {string} id Automation ID
- * @param {AutomationForm} automation Automation object that needs to be added
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof AutomationsApi
- */
- public updateAutomation(id: string, automation: AutomationForm, options?: AxiosRequestConfig) {
- return AutomationsApiFp(this.configuration).updateAutomation(id, automation, options).then((request) => request(this.axios, this.basePath));
- }
-}
-
-
-/**
- * DashboardsApi - axios parameter creator
- * @export
- */
-export const DashboardsApiAxiosParamCreator = function (configuration?: Configuration) {
- return {
- /**
- *
- * @summary Create a new dashboard
- * @param {Dashboard} template New template
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- createDashboard: async (template: Dashboard, options: AxiosRequestConfig = {}): Promise => {
- // verify required parameter 'template' is not null or undefined
- assertParamExists('createDashboard', 'template', template)
- const localVarPath = `/dashboards`;
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- localVarHeaderParameter['Content-Type'] = 'application/json';
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
- localVarRequestOptions.data = serializeDataIfNeeded(template, localVarRequestOptions, configuration)
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- /**
- *
- * @summary Get widget data
- * @param {string} aggregation Aggregation
- * @param {string} [filter] Filter
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- dashboardData: async (aggregation: string, filter?: string, options: AxiosRequestConfig = {}): Promise => {
- // verify required parameter 'aggregation' is not null or undefined
- assertParamExists('dashboardData', 'aggregation', aggregation)
- const localVarPath = `/dashboard/data`;
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
- if (aggregation !== undefined) {
- localVarQueryParameter['aggregation'] = aggregation;
- }
-
- if (filter !== undefined) {
- localVarQueryParameter['filter'] = filter;
- }
-
-
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- /**
- *
- * @summary Delete a dashboard
- * @param {string} id Dashboard ID
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- deleteDashboard: async (id: string, options: AxiosRequestConfig = {}): Promise => {
- // verify required parameter 'id' is not null or undefined
- assertParamExists('deleteDashboard', 'id', id)
- const localVarPath = `/dashboards/{id}`
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- /**
- *
- * @summary Get a single dashboard
- * @param {string} id Dashboard ID
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- getDashboard: async (id: string, options: AxiosRequestConfig = {}): Promise => {
- // verify required parameter 'id' is not null or undefined
- assertParamExists('getDashboard', 'id', id)
- const localVarPath = `/dashboards/{id}`
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- /**
- *
- * @summary List dashboards
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- listDashboards: async (options: AxiosRequestConfig = {}): Promise => {
- const localVarPath = `/dashboards`;
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- /**
- *
- * @summary Update an existing dashboard
- * @param {string} id Dashboard ID
- * @param {Dashboard} dashboard Dashboard object that needs to be added
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- updateDashboard: async (id: string, dashboard: Dashboard, options: AxiosRequestConfig = {}): Promise => {
- // verify required parameter 'id' is not null or undefined
- assertParamExists('updateDashboard', 'id', id)
- // verify required parameter 'dashboard' is not null or undefined
- assertParamExists('updateDashboard', 'dashboard', dashboard)
- const localVarPath = `/dashboards/{id}`
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- localVarHeaderParameter['Content-Type'] = 'application/json';
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
- localVarRequestOptions.data = serializeDataIfNeeded(dashboard, localVarRequestOptions, configuration)
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- }
-};
-
-/**
- * DashboardsApi - functional programming interface
- * @export
- */
-export const DashboardsApiFp = function(configuration?: Configuration) {
- const localVarAxiosParamCreator = DashboardsApiAxiosParamCreator(configuration)
- return {
- /**
- *
- * @summary Create a new dashboard
- * @param {Dashboard} template New template
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async createDashboard(template: Dashboard, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.createDashboard(template, options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- /**
- *
- * @summary Get widget data
- * @param {string} aggregation Aggregation
- * @param {string} [filter] Filter
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async dashboardData(aggregation: string, filter?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.dashboardData(aggregation, filter, options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- /**
- *
- * @summary Delete a dashboard
- * @param {string} id Dashboard ID
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async deleteDashboard(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.deleteDashboard(id, options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- /**
- *
- * @summary Get a single dashboard
- * @param {string} id Dashboard ID
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async getDashboard(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.getDashboard(id, options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- /**
- *
- * @summary List dashboards
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async listDashboards(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.listDashboards(options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- /**
- *
- * @summary Update an existing dashboard
- * @param {string} id Dashboard ID
- * @param {Dashboard} dashboard Dashboard object that needs to be added
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async updateDashboard(id: string, dashboard: Dashboard, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.updateDashboard(id, dashboard, options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- }
-};
-
-/**
- * DashboardsApi - factory interface
- * @export
- */
-export const DashboardsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
- const localVarFp = DashboardsApiFp(configuration)
- return {
- /**
- *
- * @summary Create a new dashboard
- * @param {Dashboard} template New template
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- createDashboard(template: Dashboard, options?: any): AxiosPromise {
- return localVarFp.createDashboard(template, options).then((request) => request(axios, basePath));
- },
- /**
- *
- * @summary Get widget data
- * @param {string} aggregation Aggregation
- * @param {string} [filter] Filter
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- dashboardData(aggregation: string, filter?: string, options?: any): AxiosPromise {
- return localVarFp.dashboardData(aggregation, filter, options).then((request) => request(axios, basePath));
- },
- /**
- *
- * @summary Delete a dashboard
- * @param {string} id Dashboard ID
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- deleteDashboard(id: string, options?: any): AxiosPromise {
- return localVarFp.deleteDashboard(id, options).then((request) => request(axios, basePath));
- },
- /**
- *
- * @summary Get a single dashboard
- * @param {string} id Dashboard ID
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- getDashboard(id: string, options?: any): AxiosPromise {
- return localVarFp.getDashboard(id, options).then((request) => request(axios, basePath));
- },
- /**
- *
- * @summary List dashboards
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- listDashboards(options?: any): AxiosPromise> {
- return localVarFp.listDashboards(options).then((request) => request(axios, basePath));
- },
- /**
- *
- * @summary Update an existing dashboard
- * @param {string} id Dashboard ID
- * @param {Dashboard} dashboard Dashboard object that needs to be added
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- updateDashboard(id: string, dashboard: Dashboard, options?: any): AxiosPromise {
- return localVarFp.updateDashboard(id, dashboard, options).then((request) => request(axios, basePath));
- },
- };
-};
-
-/**
- * DashboardsApi - object-oriented interface
- * @export
- * @class DashboardsApi
- * @extends {BaseAPI}
- */
-export class DashboardsApi extends BaseAPI {
- /**
- *
- * @summary Create a new dashboard
- * @param {Dashboard} template New template
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof DashboardsApi
- */
- public createDashboard(template: Dashboard, options?: AxiosRequestConfig) {
- return DashboardsApiFp(this.configuration).createDashboard(template, options).then((request) => request(this.axios, this.basePath));
- }
-
- /**
- *
- * @summary Get widget data
- * @param {string} aggregation Aggregation
- * @param {string} [filter] Filter
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof DashboardsApi
- */
- public dashboardData(aggregation: string, filter?: string, options?: AxiosRequestConfig) {
- return DashboardsApiFp(this.configuration).dashboardData(aggregation, filter, options).then((request) => request(this.axios, this.basePath));
- }
-
- /**
- *
- * @summary Delete a dashboard
- * @param {string} id Dashboard ID
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof DashboardsApi
- */
- public deleteDashboard(id: string, options?: AxiosRequestConfig) {
- return DashboardsApiFp(this.configuration).deleteDashboard(id, options).then((request) => request(this.axios, this.basePath));
- }
-
- /**
- *
- * @summary Get a single dashboard
- * @param {string} id Dashboard ID
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof DashboardsApi
- */
- public getDashboard(id: string, options?: AxiosRequestConfig) {
- return DashboardsApiFp(this.configuration).getDashboard(id, options).then((request) => request(this.axios, this.basePath));
- }
-
- /**
- *
- * @summary List dashboards
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof DashboardsApi
- */
- public listDashboards(options?: AxiosRequestConfig) {
- return DashboardsApiFp(this.configuration).listDashboards(options).then((request) => request(this.axios, this.basePath));
- }
-
- /**
- *
- * @summary Update an existing dashboard
- * @param {string} id Dashboard ID
- * @param {Dashboard} dashboard Dashboard object that needs to be added
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof DashboardsApi
- */
- public updateDashboard(id: string, dashboard: Dashboard, options?: AxiosRequestConfig) {
- return DashboardsApiFp(this.configuration).updateDashboard(id, dashboard, options).then((request) => request(this.axios, this.basePath));
- }
-}
-
-
-/**
- * GraphApi - axios parameter creator
- * @export
- */
-export const GraphApiAxiosParamCreator = function (configuration?: Configuration) {
- return {
- /**
- *
- * @summary Graph
- * @param {string} col Graph Start
- * @param {string} id Graph Start
- * @param {number} depth Graph Start
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- graph: async (col: string, id: string, depth: number, options: AxiosRequestConfig = {}): Promise => {
- // verify required parameter 'col' is not null or undefined
- assertParamExists('graph', 'col', col)
- // verify required parameter 'id' is not null or undefined
- assertParamExists('graph', 'id', id)
- // verify required parameter 'depth' is not null or undefined
- assertParamExists('graph', 'depth', depth)
- const localVarPath = `/graph/{col}/{id}`
- .replace(`{${"col"}}`, encodeURIComponent(String(col)))
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
- if (depth !== undefined) {
- localVarQueryParameter['depth'] = depth;
- }
-
-
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- }
-};
-
-/**
- * GraphApi - functional programming interface
- * @export
- */
-export const GraphApiFp = function(configuration?: Configuration) {
- const localVarAxiosParamCreator = GraphApiAxiosParamCreator(configuration)
- return {
- /**
- *
- * @summary Graph
- * @param {string} col Graph Start
- * @param {string} id Graph Start
- * @param {number} depth Graph Start
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async graph(col: string, id: string, depth: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.graph(col, id, depth, options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- }
-};
-
-/**
- * GraphApi - factory interface
- * @export
- */
-export const GraphApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
- const localVarFp = GraphApiFp(configuration)
- return {
- /**
- *
- * @summary Graph
- * @param {string} col Graph Start
- * @param {string} id Graph Start
- * @param {number} depth Graph Start
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- graph(col: string, id: string, depth: number, options?: any): AxiosPromise {
- return localVarFp.graph(col, id, depth, options).then((request) => request(axios, basePath));
- },
- };
-};
-
-/**
- * GraphApi - object-oriented interface
- * @export
- * @class GraphApi
- * @extends {BaseAPI}
- */
-export class GraphApi extends BaseAPI {
- /**
- *
- * @summary Graph
- * @param {string} col Graph Start
- * @param {string} id Graph Start
- * @param {number} depth Graph Start
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof GraphApi
- */
- public graph(col: string, id: string, depth: number, options?: AxiosRequestConfig) {
- return GraphApiFp(this.configuration).graph(col, id, depth, options).then((request) => request(this.axios, this.basePath));
- }
-}
-
-
-/**
- * GroupsApi - axios parameter creator
- * @export
- */
-export const GroupsApiAxiosParamCreator = function (configuration?: Configuration) {
- return {
- /**
- *
- * @summary Create a new group
- * @param {GroupForm} group New group
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- createGroup: async (group: GroupForm, options: AxiosRequestConfig = {}): Promise => {
- // verify required parameter 'group' is not null or undefined
- assertParamExists('createGroup', 'group', group)
- const localVarPath = `/groups`;
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- localVarHeaderParameter['Content-Type'] = 'application/json';
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
- localVarRequestOptions.data = serializeDataIfNeeded(group, localVarRequestOptions, configuration)
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- /**
- *
- * @summary Delete a group
- * @param {string} id Group ID
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- deleteGroup: async (id: string, options: AxiosRequestConfig = {}): Promise => {
- // verify required parameter 'id' is not null or undefined
- assertParamExists('deleteGroup', 'id', id)
- const localVarPath = `/groups/{id}`
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- /**
- *
- * @summary Get a single group
- * @param {string} id Group ID
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- getGroup: async (id: string, options: AxiosRequestConfig = {}): Promise => {
- // verify required parameter 'id' is not null or undefined
- assertParamExists('getGroup', 'id', id)
- const localVarPath = `/groups/{id}`
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- /**
- *
- * @summary List groups
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- listGroups: async (options: AxiosRequestConfig = {}): Promise => {
- const localVarPath = `/groups`;
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- /**
- *
- * @summary Update an existing group
- * @param {string} id Group ID
- * @param {Group} group Group object that needs to be added
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- updateGroup: async (id: string, group: Group, options: AxiosRequestConfig = {}): Promise => {
- // verify required parameter 'id' is not null or undefined
- assertParamExists('updateGroup', 'id', id)
- // verify required parameter 'group' is not null or undefined
- assertParamExists('updateGroup', 'group', group)
- const localVarPath = `/groups/{id}`
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- localVarHeaderParameter['Content-Type'] = 'application/json';
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
- localVarRequestOptions.data = serializeDataIfNeeded(group, localVarRequestOptions, configuration)
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- }
-};
-
-/**
- * GroupsApi - functional programming interface
- * @export
- */
-export const GroupsApiFp = function(configuration?: Configuration) {
- const localVarAxiosParamCreator = GroupsApiAxiosParamCreator(configuration)
- return {
- /**
- *
- * @summary Create a new group
- * @param {GroupForm} group New group
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async createGroup(group: GroupForm, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.createGroup(group, options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- /**
- *
- * @summary Delete a group
- * @param {string} id Group ID
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async deleteGroup(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.deleteGroup(id, options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- /**
- *
- * @summary Get a single group
- * @param {string} id Group ID
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async getGroup(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.getGroup(id, options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- /**
- *
- * @summary List groups
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async listGroups(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.listGroups(options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- /**
- *
- * @summary Update an existing group
- * @param {string} id Group ID
- * @param {Group} group Group object that needs to be added
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async updateGroup(id: string, group: Group, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.updateGroup(id, group, options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- }
-};
-
-/**
- * GroupsApi - factory interface
- * @export
- */
-export const GroupsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
- const localVarFp = GroupsApiFp(configuration)
- return {
- /**
- *
- * @summary Create a new group
- * @param {GroupForm} group New group
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- createGroup(group: GroupForm, options?: any): AxiosPromise {
- return localVarFp.createGroup(group, options).then((request) => request(axios, basePath));
- },
- /**
- *
- * @summary Delete a group
- * @param {string} id Group ID
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- deleteGroup(id: string, options?: any): AxiosPromise {
- return localVarFp.deleteGroup(id, options).then((request) => request(axios, basePath));
- },
- /**
- *
- * @summary Get a single group
- * @param {string} id Group ID
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- getGroup(id: string, options?: any): AxiosPromise {
- return localVarFp.getGroup(id, options).then((request) => request(axios, basePath));
- },
- /**
- *
- * @summary List groups
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- listGroups(options?: any): AxiosPromise> {
- return localVarFp.listGroups(options).then((request) => request(axios, basePath));
- },
- /**
- *
- * @summary Update an existing group
- * @param {string} id Group ID
- * @param {Group} group Group object that needs to be added
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- updateGroup(id: string, group: Group, options?: any): AxiosPromise {
- return localVarFp.updateGroup(id, group, options).then((request) => request(axios, basePath));
- },
- };
-};
-
-/**
- * GroupsApi - object-oriented interface
- * @export
- * @class GroupsApi
- * @extends {BaseAPI}
- */
-export class GroupsApi extends BaseAPI {
- /**
- *
- * @summary Create a new group
- * @param {GroupForm} group New group
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof GroupsApi
- */
- public createGroup(group: GroupForm, options?: AxiosRequestConfig) {
- return GroupsApiFp(this.configuration).createGroup(group, options).then((request) => request(this.axios, this.basePath));
- }
-
- /**
- *
- * @summary Delete a group
- * @param {string} id Group ID
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof GroupsApi
- */
- public deleteGroup(id: string, options?: AxiosRequestConfig) {
- return GroupsApiFp(this.configuration).deleteGroup(id, options).then((request) => request(this.axios, this.basePath));
- }
-
- /**
- *
- * @summary Get a single group
- * @param {string} id Group ID
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof GroupsApi
- */
- public getGroup(id: string, options?: AxiosRequestConfig) {
- return GroupsApiFp(this.configuration).getGroup(id, options).then((request) => request(this.axios, this.basePath));
- }
-
- /**
- *
- * @summary List groups
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof GroupsApi
- */
- public listGroups(options?: AxiosRequestConfig) {
- return GroupsApiFp(this.configuration).listGroups(options).then((request) => request(this.axios, this.basePath));
- }
-
- /**
- *
- * @summary Update an existing group
- * @param {string} id Group ID
- * @param {Group} group Group object that needs to be added
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof GroupsApi
- */
- public updateGroup(id: string, group: Group, options?: AxiosRequestConfig) {
- return GroupsApiFp(this.configuration).updateGroup(id, group, options).then((request) => request(this.axios, this.basePath));
- }
-}
-
-
-/**
- * JobsApi - axios parameter creator
- * @export
- */
-export const JobsApiAxiosParamCreator = function (configuration?: Configuration) {
- return {
- /**
- *
- * @summary Get a single job
- * @param {string} id Job ID
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- getJob: async (id: string, options: AxiosRequestConfig = {}): Promise => {
- // verify required parameter 'id' is not null or undefined
- assertParamExists('getJob', 'id', id)
- const localVarPath = `/jobs/{id}`
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- /**
- *
- * @summary List jobs
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- listJobs: async (options: AxiosRequestConfig = {}): Promise => {
- const localVarPath = `/jobs`;
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- /**
- *
- * @summary Start a new job
- * @param {JobForm} job New job
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- runJob: async (job: JobForm, options: AxiosRequestConfig = {}): Promise => {
- // verify required parameter 'job' is not null or undefined
- assertParamExists('runJob', 'job', job)
- const localVarPath = `/jobs`;
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- localVarHeaderParameter['Content-Type'] = 'application/json';
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
- localVarRequestOptions.data = serializeDataIfNeeded(job, localVarRequestOptions, configuration)
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- /**
- *
- * @summary Update an existing job
- * @param {string} id Job ID
- * @param {JobUpdate} job Job object that needs to be added
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- updateJob: async (id: string, job: JobUpdate, options: AxiosRequestConfig = {}): Promise => {
- // verify required parameter 'id' is not null or undefined
- assertParamExists('updateJob', 'id', id)
- // verify required parameter 'job' is not null or undefined
- assertParamExists('updateJob', 'job', job)
- const localVarPath = `/jobs/{id}`
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- localVarHeaderParameter['Content-Type'] = 'application/json';
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
- localVarRequestOptions.data = serializeDataIfNeeded(job, localVarRequestOptions, configuration)
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- }
-};
-
-/**
- * JobsApi - functional programming interface
- * @export
- */
-export const JobsApiFp = function(configuration?: Configuration) {
- const localVarAxiosParamCreator = JobsApiAxiosParamCreator(configuration)
- return {
- /**
- *
- * @summary Get a single job
- * @param {string} id Job ID
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async getJob(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.getJob(id, options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- /**
- *
- * @summary List jobs
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async listJobs(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.listJobs(options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- /**
- *
- * @summary Start a new job
- * @param {JobForm} job New job
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async runJob(job: JobForm, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.runJob(job, options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- /**
- *
- * @summary Update an existing job
- * @param {string} id Job ID
- * @param {JobUpdate} job Job object that needs to be added
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async updateJob(id: string, job: JobUpdate, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.updateJob(id, job, options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- }
-};
-
-/**
- * JobsApi - factory interface
- * @export
- */
-export const JobsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
- const localVarFp = JobsApiFp(configuration)
- return {
- /**
- *
- * @summary Get a single job
- * @param {string} id Job ID
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- getJob(id: string, options?: any): AxiosPromise {
- return localVarFp.getJob(id, options).then((request) => request(axios, basePath));
- },
- /**
- *
- * @summary List jobs
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- listJobs(options?: any): AxiosPromise> {
- return localVarFp.listJobs(options).then((request) => request(axios, basePath));
- },
- /**
- *
- * @summary Start a new job
- * @param {JobForm} job New job
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- runJob(job: JobForm, options?: any): AxiosPromise {
- return localVarFp.runJob(job, options).then((request) => request(axios, basePath));
- },
- /**
- *
- * @summary Update an existing job
- * @param {string} id Job ID
- * @param {JobUpdate} job Job object that needs to be added
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- updateJob(id: string, job: JobUpdate, options?: any): AxiosPromise {
- return localVarFp.updateJob(id, job, options).then((request) => request(axios, basePath));
- },
- };
-};
-
-/**
- * JobsApi - object-oriented interface
- * @export
- * @class JobsApi
- * @extends {BaseAPI}
- */
-export class JobsApi extends BaseAPI {
- /**
- *
- * @summary Get a single job
- * @param {string} id Job ID
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof JobsApi
- */
- public getJob(id: string, options?: AxiosRequestConfig) {
- return JobsApiFp(this.configuration).getJob(id, options).then((request) => request(this.axios, this.basePath));
- }
-
- /**
- *
- * @summary List jobs
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof JobsApi
- */
- public listJobs(options?: AxiosRequestConfig) {
- return JobsApiFp(this.configuration).listJobs(options).then((request) => request(this.axios, this.basePath));
- }
-
- /**
- *
- * @summary Start a new job
- * @param {JobForm} job New job
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof JobsApi
- */
- public runJob(job: JobForm, options?: AxiosRequestConfig) {
- return JobsApiFp(this.configuration).runJob(job, options).then((request) => request(this.axios, this.basePath));
- }
-
- /**
- *
- * @summary Update an existing job
- * @param {string} id Job ID
- * @param {JobUpdate} job Job object that needs to be added
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof JobsApi
- */
- public updateJob(id: string, job: JobUpdate, options?: AxiosRequestConfig) {
- return JobsApiFp(this.configuration).updateJob(id, job, options).then((request) => request(this.axios, this.basePath));
- }
-}
-
-
-/**
- * LogsApi - axios parameter creator
- * @export
- */
-export const LogsApiAxiosParamCreator = function (configuration?: Configuration) {
- return {
- /**
- *
- * @summary Get log entries
- * @param {string} reference Reference
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- getLogs: async (reference: string, options: AxiosRequestConfig = {}): Promise => {
- // verify required parameter 'reference' is not null or undefined
- assertParamExists('getLogs', 'reference', reference)
- const localVarPath = `/logs/{reference}`
- .replace(`{${"reference"}}`, encodeURIComponent(String(reference)));
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- }
-};
-
-/**
- * LogsApi - functional programming interface
- * @export
- */
-export const LogsApiFp = function(configuration?: Configuration) {
- const localVarAxiosParamCreator = LogsApiAxiosParamCreator(configuration)
- return {
- /**
- *
- * @summary Get log entries
- * @param {string} reference Reference
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async getLogs(reference: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.getLogs(reference, options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- }
-};
-
-/**
- * LogsApi - factory interface
- * @export
- */
-export const LogsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
- const localVarFp = LogsApiFp(configuration)
- return {
- /**
- *
- * @summary Get log entries
- * @param {string} reference Reference
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- getLogs(reference: string, options?: any): AxiosPromise> {
- return localVarFp.getLogs(reference, options).then((request) => request(axios, basePath));
- },
- };
-};
-
-/**
- * LogsApi - object-oriented interface
- * @export
- * @class LogsApi
- * @extends {BaseAPI}
- */
-export class LogsApi extends BaseAPI {
- /**
- *
- * @summary Get log entries
- * @param {string} reference Reference
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof LogsApi
- */
- public getLogs(reference: string, options?: AxiosRequestConfig) {
- return LogsApiFp(this.configuration).getLogs(reference, options).then((request) => request(this.axios, this.basePath));
- }
-}
-
-
-/**
- * PlaybooksApi - axios parameter creator
- * @export
- */
-export const PlaybooksApiAxiosParamCreator = function (configuration?: Configuration) {
- return {
- /**
- *
- * @summary Create a playbook
- * @param {PlaybookTemplateForm} playbook New playbook
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- createPlaybook: async (playbook: PlaybookTemplateForm, options: AxiosRequestConfig = {}): Promise => {
- // verify required parameter 'playbook' is not null or undefined
- assertParamExists('createPlaybook', 'playbook', playbook)
- const localVarPath = `/playbooks`;
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- localVarHeaderParameter['Content-Type'] = 'application/json';
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
- localVarRequestOptions.data = serializeDataIfNeeded(playbook, localVarRequestOptions, configuration)
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- /**
- *
- * @summary Delete a playbook
- * @param {string} id Playbook name
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- deletePlaybook: async (id: string, options: AxiosRequestConfig = {}): Promise => {
- // verify required parameter 'id' is not null or undefined
- assertParamExists('deletePlaybook', 'id', id)
- const localVarPath = `/playbooks/{id}`
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- /**
- *
- * @summary Get a single playbook
- * @param {string} id Playbook name
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- getPlaybook: async (id: string, options: AxiosRequestConfig = {}): Promise => {
- // verify required parameter 'id' is not null or undefined
- assertParamExists('getPlaybook', 'id', id)
- const localVarPath = `/playbooks/{id}`
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- /**
- *
- * @summary List playbooks
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- listPlaybooks: async (options: AxiosRequestConfig = {}): Promise => {
- const localVarPath = `/playbooks`;
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- /**
- *
- * @summary Update an existing ticket playbook
- * @param {string} id Playbook ID
- * @param {PlaybookTemplateForm} playbook Updated playbook
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- updatePlaybook: async (id: string, playbook: PlaybookTemplateForm, options: AxiosRequestConfig = {}): Promise => {
- // verify required parameter 'id' is not null or undefined
- assertParamExists('updatePlaybook', 'id', id)
- // verify required parameter 'playbook' is not null or undefined
- assertParamExists('updatePlaybook', 'playbook', playbook)
- const localVarPath = `/playbooks/{id}`
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- localVarHeaderParameter['Content-Type'] = 'application/json';
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
- localVarRequestOptions.data = serializeDataIfNeeded(playbook, localVarRequestOptions, configuration)
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- }
-};
-
-/**
- * PlaybooksApi - functional programming interface
- * @export
- */
-export const PlaybooksApiFp = function(configuration?: Configuration) {
- const localVarAxiosParamCreator = PlaybooksApiAxiosParamCreator(configuration)
- return {
- /**
- *
- * @summary Create a playbook
- * @param {PlaybookTemplateForm} playbook New playbook
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async createPlaybook(playbook: PlaybookTemplateForm, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.createPlaybook(playbook, options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- /**
- *
- * @summary Delete a playbook
- * @param {string} id Playbook name
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async deletePlaybook(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.deletePlaybook(id, options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- /**
- *
- * @summary Get a single playbook
- * @param {string} id Playbook name
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async getPlaybook(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.getPlaybook(id, options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- /**
- *
- * @summary List playbooks
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async listPlaybooks(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.listPlaybooks(options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- /**
- *
- * @summary Update an existing ticket playbook
- * @param {string} id Playbook ID
- * @param {PlaybookTemplateForm} playbook Updated playbook
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async updatePlaybook(id: string, playbook: PlaybookTemplateForm, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.updatePlaybook(id, playbook, options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- }
-};
-
-/**
- * PlaybooksApi - factory interface
- * @export
- */
-export const PlaybooksApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
- const localVarFp = PlaybooksApiFp(configuration)
- return {
- /**
- *
- * @summary Create a playbook
- * @param {PlaybookTemplateForm} playbook New playbook
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- createPlaybook(playbook: PlaybookTemplateForm, options?: any): AxiosPromise {
- return localVarFp.createPlaybook(playbook, options).then((request) => request(axios, basePath));
- },
- /**
- *
- * @summary Delete a playbook
- * @param {string} id Playbook name
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- deletePlaybook(id: string, options?: any): AxiosPromise {
- return localVarFp.deletePlaybook(id, options).then((request) => request(axios, basePath));
- },
- /**
- *
- * @summary Get a single playbook
- * @param {string} id Playbook name
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- getPlaybook(id: string, options?: any): AxiosPromise {
- return localVarFp.getPlaybook(id, options).then((request) => request(axios, basePath));
- },
- /**
- *
- * @summary List playbooks
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- listPlaybooks(options?: any): AxiosPromise> {
- return localVarFp.listPlaybooks(options).then((request) => request(axios, basePath));
- },
- /**
- *
- * @summary Update an existing ticket playbook
- * @param {string} id Playbook ID
- * @param {PlaybookTemplateForm} playbook Updated playbook
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- updatePlaybook(id: string, playbook: PlaybookTemplateForm, options?: any): AxiosPromise {
- return localVarFp.updatePlaybook(id, playbook, options).then((request) => request(axios, basePath));
- },
- };
-};
-
-/**
- * PlaybooksApi - object-oriented interface
- * @export
- * @class PlaybooksApi
- * @extends {BaseAPI}
- */
-export class PlaybooksApi extends BaseAPI {
- /**
- *
- * @summary Create a playbook
- * @param {PlaybookTemplateForm} playbook New playbook
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof PlaybooksApi
- */
- public createPlaybook(playbook: PlaybookTemplateForm, options?: AxiosRequestConfig) {
- return PlaybooksApiFp(this.configuration).createPlaybook(playbook, options).then((request) => request(this.axios, this.basePath));
- }
-
- /**
- *
- * @summary Delete a playbook
- * @param {string} id Playbook name
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof PlaybooksApi
- */
- public deletePlaybook(id: string, options?: AxiosRequestConfig) {
- return PlaybooksApiFp(this.configuration).deletePlaybook(id, options).then((request) => request(this.axios, this.basePath));
- }
-
- /**
- *
- * @summary Get a single playbook
- * @param {string} id Playbook name
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof PlaybooksApi
- */
- public getPlaybook(id: string, options?: AxiosRequestConfig) {
- return PlaybooksApiFp(this.configuration).getPlaybook(id, options).then((request) => request(this.axios, this.basePath));
- }
-
- /**
- *
- * @summary List playbooks
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof PlaybooksApi
- */
- public listPlaybooks(options?: AxiosRequestConfig) {
- return PlaybooksApiFp(this.configuration).listPlaybooks(options).then((request) => request(this.axios, this.basePath));
- }
-
- /**
- *
- * @summary Update an existing ticket playbook
- * @param {string} id Playbook ID
- * @param {PlaybookTemplateForm} playbook Updated playbook
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof PlaybooksApi
- */
- public updatePlaybook(id: string, playbook: PlaybookTemplateForm, options?: AxiosRequestConfig) {
- return PlaybooksApiFp(this.configuration).updatePlaybook(id, playbook, options).then((request) => request(this.axios, this.basePath));
- }
-}
-
-
-/**
- * RulesApi - axios parameter creator
- * @export
- */
-export const RulesApiAxiosParamCreator = function (configuration?: Configuration) {
- return {
- /**
- *
- * @summary Create a rule
- * @param {RuleForm} rule New rule
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- createRule: async (rule: RuleForm, options: AxiosRequestConfig = {}): Promise => {
- // verify required parameter 'rule' is not null or undefined
- assertParamExists('createRule', 'rule', rule)
- const localVarPath = `/rules`;
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- localVarHeaderParameter['Content-Type'] = 'application/json';
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
- localVarRequestOptions.data = serializeDataIfNeeded(rule, localVarRequestOptions, configuration)
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- /**
- *
- * @summary Delete a rule
- * @param {string} id Rule name
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- deleteRule: async (id: string, options: AxiosRequestConfig = {}): Promise => {
- // verify required parameter 'id' is not null or undefined
- assertParamExists('deleteRule', 'id', id)
- const localVarPath = `/rules/{id}`
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- /**
- *
- * @summary Get a single rule
- * @param {string} id Rule name
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- getRule: async (id: string, options: AxiosRequestConfig = {}): Promise => {
- // verify required parameter 'id' is not null or undefined
- assertParamExists('getRule', 'id', id)
- const localVarPath = `/rules/{id}`
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- /**
- *
- * @summary List rules
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- listRules: async (options: AxiosRequestConfig = {}): Promise => {
- const localVarPath = `/rules`;
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- /**
- *
- * @summary Update an existing ticket rule
- * @param {string} id Rule ID
- * @param {RuleForm} rule Updated rule
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- updateRule: async (id: string, rule: RuleForm, options: AxiosRequestConfig = {}): Promise => {
- // verify required parameter 'id' is not null or undefined
- assertParamExists('updateRule', 'id', id)
- // verify required parameter 'rule' is not null or undefined
- assertParamExists('updateRule', 'rule', rule)
- const localVarPath = `/rules/{id}`
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- localVarHeaderParameter['Content-Type'] = 'application/json';
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
- localVarRequestOptions.data = serializeDataIfNeeded(rule, localVarRequestOptions, configuration)
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- }
-};
-
-/**
- * RulesApi - functional programming interface
- * @export
- */
-export const RulesApiFp = function(configuration?: Configuration) {
- const localVarAxiosParamCreator = RulesApiAxiosParamCreator(configuration)
- return {
- /**
- *
- * @summary Create a rule
- * @param {RuleForm} rule New rule
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async createRule(rule: RuleForm, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.createRule(rule, options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- /**
- *
- * @summary Delete a rule
- * @param {string} id Rule name
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async deleteRule(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.deleteRule(id, options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- /**
- *
- * @summary Get a single rule
- * @param {string} id Rule name
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async getRule(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.getRule(id, options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- /**
- *
- * @summary List rules
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async listRules(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.listRules(options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- /**
- *
- * @summary Update an existing ticket rule
- * @param {string} id Rule ID
- * @param {RuleForm} rule Updated rule
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async updateRule(id: string, rule: RuleForm, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.updateRule(id, rule, options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- }
-};
-
-/**
- * RulesApi - factory interface
- * @export
- */
-export const RulesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
- const localVarFp = RulesApiFp(configuration)
- return {
- /**
- *
- * @summary Create a rule
- * @param {RuleForm} rule New rule
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- createRule(rule: RuleForm, options?: any): AxiosPromise> {
- return localVarFp.createRule(rule, options).then((request) => request(axios, basePath));
- },
- /**
- *
- * @summary Delete a rule
- * @param {string} id Rule name
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- deleteRule(id: string, options?: any): AxiosPromise {
- return localVarFp.deleteRule(id, options).then((request) => request(axios, basePath));
- },
- /**
- *
- * @summary Get a single rule
- * @param {string} id Rule name
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- getRule(id: string, options?: any): AxiosPromise {
- return localVarFp.getRule(id, options).then((request) => request(axios, basePath));
- },
- /**
- *
- * @summary List rules
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- listRules(options?: any): AxiosPromise> {
- return localVarFp.listRules(options).then((request) => request(axios, basePath));
- },
- /**
- *
- * @summary Update an existing ticket rule
- * @param {string} id Rule ID
- * @param {RuleForm} rule Updated rule
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- updateRule(id: string, rule: RuleForm, options?: any): AxiosPromise {
- return localVarFp.updateRule(id, rule, options).then((request) => request(axios, basePath));
- },
- };
-};
-
-/**
- * RulesApi - object-oriented interface
- * @export
- * @class RulesApi
- * @extends {BaseAPI}
- */
-export class RulesApi extends BaseAPI {
- /**
- *
- * @summary Create a rule
- * @param {RuleForm} rule New rule
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof RulesApi
- */
- public createRule(rule: RuleForm, options?: AxiosRequestConfig) {
- return RulesApiFp(this.configuration).createRule(rule, options).then((request) => request(this.axios, this.basePath));
- }
-
- /**
- *
- * @summary Delete a rule
- * @param {string} id Rule name
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof RulesApi
- */
- public deleteRule(id: string, options?: AxiosRequestConfig) {
- return RulesApiFp(this.configuration).deleteRule(id, options).then((request) => request(this.axios, this.basePath));
- }
-
- /**
- *
- * @summary Get a single rule
- * @param {string} id Rule name
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof RulesApi
- */
- public getRule(id: string, options?: AxiosRequestConfig) {
- return RulesApiFp(this.configuration).getRule(id, options).then((request) => request(this.axios, this.basePath));
- }
-
- /**
- *
- * @summary List rules
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof RulesApi
- */
- public listRules(options?: AxiosRequestConfig) {
- return RulesApiFp(this.configuration).listRules(options).then((request) => request(this.axios, this.basePath));
- }
-
- /**
- *
- * @summary Update an existing ticket rule
- * @param {string} id Rule ID
- * @param {RuleForm} rule Updated rule
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof RulesApi
- */
- public updateRule(id: string, rule: RuleForm, options?: AxiosRequestConfig) {
- return RulesApiFp(this.configuration).updateRule(id, rule, options).then((request) => request(this.axios, this.basePath));
- }
-}
-
-
-/**
- * SettingsApi - axios parameter creator
- * @export
- */
-export const SettingsApiAxiosParamCreator = function (configuration?: Configuration) {
- return {
- /**
- *
- * @summary Get settings
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- getSettings: async (options: AxiosRequestConfig = {}): Promise => {
- const localVarPath = `/settings`;
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- /**
- *
- * @summary Save settings
- * @param {Settings} settings Save settings
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- saveSettings: async (settings: Settings, options: AxiosRequestConfig = {}): Promise => {
- // verify required parameter 'settings' is not null or undefined
- assertParamExists('saveSettings', 'settings', settings)
- const localVarPath = `/settings`;
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- localVarHeaderParameter['Content-Type'] = 'application/json';
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
- localVarRequestOptions.data = serializeDataIfNeeded(settings, localVarRequestOptions, configuration)
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- }
-};
-
-/**
- * SettingsApi - functional programming interface
- * @export
- */
-export const SettingsApiFp = function(configuration?: Configuration) {
- const localVarAxiosParamCreator = SettingsApiAxiosParamCreator(configuration)
- return {
- /**
- *
- * @summary Get settings
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async getSettings(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.getSettings(options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- /**
- *
- * @summary Save settings
- * @param {Settings} settings Save settings
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async saveSettings(settings: Settings, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.saveSettings(settings, options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- }
-};
-
-/**
- * SettingsApi - factory interface
- * @export
- */
-export const SettingsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
- const localVarFp = SettingsApiFp(configuration)
- return {
- /**
- *
- * @summary Get settings
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- getSettings(options?: any): AxiosPromise {
- return localVarFp.getSettings(options).then((request) => request(axios, basePath));
- },
- /**
- *
- * @summary Save settings
- * @param {Settings} settings Save settings
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- saveSettings(settings: Settings, options?: any): AxiosPromise {
- return localVarFp.saveSettings(settings, options).then((request) => request(axios, basePath));
- },
- };
-};
-
-/**
- * SettingsApi - object-oriented interface
- * @export
- * @class SettingsApi
- * @extends {BaseAPI}
- */
-export class SettingsApi extends BaseAPI {
- /**
- *
- * @summary Get settings
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof SettingsApi
- */
- public getSettings(options?: AxiosRequestConfig) {
- return SettingsApiFp(this.configuration).getSettings(options).then((request) => request(this.axios, this.basePath));
- }
-
- /**
- *
- * @summary Save settings
- * @param {Settings} settings Save settings
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof SettingsApi
- */
- public saveSettings(settings: Settings, options?: AxiosRequestConfig) {
- return SettingsApiFp(this.configuration).saveSettings(settings, options).then((request) => request(this.axios, this.basePath));
- }
-}
-
-
-/**
- * StatisticsApi - axios parameter creator
- * @export
- */
-export const StatisticsApiAxiosParamCreator = function (configuration?: Configuration) {
- return {
- /**
- *
- * @summary Get statistics
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- getStatistics: async (options: AxiosRequestConfig = {}): Promise => {
- const localVarPath = `/statistics`;
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- }
-};
-
-/**
- * StatisticsApi - functional programming interface
- * @export
- */
-export const StatisticsApiFp = function(configuration?: Configuration) {
- const localVarAxiosParamCreator = StatisticsApiAxiosParamCreator(configuration)
- return {
- /**
- *
- * @summary Get statistics
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async getStatistics(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.getStatistics(options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- }
-};
-
-/**
- * StatisticsApi - factory interface
- * @export
- */
-export const StatisticsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
- const localVarFp = StatisticsApiFp(configuration)
- return {
- /**
- *
- * @summary Get statistics
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- getStatistics(options?: any): AxiosPromise {
- return localVarFp.getStatistics(options).then((request) => request(axios, basePath));
- },
- };
-};
-
-/**
- * StatisticsApi - object-oriented interface
- * @export
- * @class StatisticsApi
- * @extends {BaseAPI}
- */
-export class StatisticsApi extends BaseAPI {
- /**
- *
- * @summary Get statistics
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof StatisticsApi
- */
- public getStatistics(options?: AxiosRequestConfig) {
- return StatisticsApiFp(this.configuration).getStatistics(options).then((request) => request(this.axios, this.basePath));
- }
-}
-
-
-/**
- * TasksApi - axios parameter creator
- * @export
- */
-export const TasksApiAxiosParamCreator = function (configuration?: Configuration) {
- return {
- /**
- *
- * @summary List tasks
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- listTasks: async (options: AxiosRequestConfig = {}): Promise => {
- const localVarPath = `/tasks`;
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- }
-};
-
-/**
- * TasksApi - functional programming interface
- * @export
- */
-export const TasksApiFp = function(configuration?: Configuration) {
- const localVarAxiosParamCreator = TasksApiAxiosParamCreator(configuration)
- return {
- /**
- *
- * @summary List tasks
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async listTasks(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.listTasks(options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- }
-};
-
-/**
- * TasksApi - factory interface
- * @export
- */
-export const TasksApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
- const localVarFp = TasksApiFp(configuration)
- return {
- /**
- *
- * @summary List tasks
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- listTasks(options?: any): AxiosPromise> {
- return localVarFp.listTasks(options).then((request) => request(axios, basePath));
- },
- };
-};
-
-/**
- * TasksApi - object-oriented interface
- * @export
- * @class TasksApi
- * @extends {BaseAPI}
- */
-export class TasksApi extends BaseAPI {
- /**
- *
- * @summary List tasks
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof TasksApi
- */
- public listTasks(options?: AxiosRequestConfig) {
- return TasksApiFp(this.configuration).listTasks(options).then((request) => request(this.axios, this.basePath));
- }
-}
-
-
-/**
- * TemplatesApi - axios parameter creator
- * @export
- */
-export const TemplatesApiAxiosParamCreator = function (configuration?: Configuration) {
- return {
- /**
- *
- * @summary Create a new template
- * @param {TicketTemplateForm} template New template
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- createTemplate: async (template: TicketTemplateForm, options: AxiosRequestConfig = {}): Promise => {
- // verify required parameter 'template' is not null or undefined
- assertParamExists('createTemplate', 'template', template)
- const localVarPath = `/templates`;
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- localVarHeaderParameter['Content-Type'] = 'application/json';
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
- localVarRequestOptions.data = serializeDataIfNeeded(template, localVarRequestOptions, configuration)
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- /**
- *
- * @summary Delete a template
- * @param {string} id Template ID
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- deleteTemplate: async (id: string, options: AxiosRequestConfig = {}): Promise => {
- // verify required parameter 'id' is not null or undefined
- assertParamExists('deleteTemplate', 'id', id)
- const localVarPath = `/templates/{id}`
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- /**
- *
- * @summary Get a single template
- * @param {string} id Template ID
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- getTemplate: async (id: string, options: AxiosRequestConfig = {}): Promise => {
- // verify required parameter 'id' is not null or undefined
- assertParamExists('getTemplate', 'id', id)
- const localVarPath = `/templates/{id}`
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- /**
- *
- * @summary List templates
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- listTemplates: async (options: AxiosRequestConfig = {}): Promise => {
- const localVarPath = `/templates`;
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- /**
- *
- * @summary Update an existing template
- * @param {string} id Template ID
- * @param {TicketTemplateForm} template Template object that needs to be added
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- updateTemplate: async (id: string, template: TicketTemplateForm, options: AxiosRequestConfig = {}): Promise => {
- // verify required parameter 'id' is not null or undefined
- assertParamExists('updateTemplate', 'id', id)
- // verify required parameter 'template' is not null or undefined
- assertParamExists('updateTemplate', 'template', template)
- const localVarPath = `/templates/{id}`
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- localVarHeaderParameter['Content-Type'] = 'application/json';
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
- localVarRequestOptions.data = serializeDataIfNeeded(template, localVarRequestOptions, configuration)
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- }
-};
-
-/**
- * TemplatesApi - functional programming interface
- * @export
- */
-export const TemplatesApiFp = function(configuration?: Configuration) {
- const localVarAxiosParamCreator = TemplatesApiAxiosParamCreator(configuration)
- return {
- /**
- *
- * @summary Create a new template
- * @param {TicketTemplateForm} template New template
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async createTemplate(template: TicketTemplateForm, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.createTemplate(template, options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- /**
- *
- * @summary Delete a template
- * @param {string} id Template ID
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async deleteTemplate(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.deleteTemplate(id, options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- /**
- *
- * @summary Get a single template
- * @param {string} id Template ID
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async getTemplate(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.getTemplate(id, options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- /**
- *
- * @summary List templates
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async listTemplates(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.listTemplates(options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- /**
- *
- * @summary Update an existing template
- * @param {string} id Template ID
- * @param {TicketTemplateForm} template Template object that needs to be added
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- async updateTemplate(id: string, template: TicketTemplateForm, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
- const localVarAxiosArgs = await localVarAxiosParamCreator.updateTemplate(id, template, options);
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
- },
- }
-};
-
-/**
- * TemplatesApi - factory interface
- * @export
- */
-export const TemplatesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
- const localVarFp = TemplatesApiFp(configuration)
- return {
- /**
- *
- * @summary Create a new template
- * @param {TicketTemplateForm} template New template
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- createTemplate(template: TicketTemplateForm, options?: any): AxiosPromise {
- return localVarFp.createTemplate(template, options).then((request) => request(axios, basePath));
- },
- /**
- *
- * @summary Delete a template
- * @param {string} id Template ID
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- deleteTemplate(id: string, options?: any): AxiosPromise {
- return localVarFp.deleteTemplate(id, options).then((request) => request(axios, basePath));
- },
- /**
- *
- * @summary Get a single template
- * @param {string} id Template ID
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- getTemplate(id: string, options?: any): AxiosPromise {
- return localVarFp.getTemplate(id, options).then((request) => request(axios, basePath));
- },
- /**
- *
- * @summary List templates
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- listTemplates(options?: any): AxiosPromise> {
- return localVarFp.listTemplates(options).then((request) => request(axios, basePath));
- },
- /**
- *
- * @summary Update an existing template
- * @param {string} id Template ID
- * @param {TicketTemplateForm} template Template object that needs to be added
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- updateTemplate(id: string, template: TicketTemplateForm, options?: any): AxiosPromise {
- return localVarFp.updateTemplate(id, template, options).then((request) => request(axios, basePath));
- },
- };
-};
-
-/**
- * TemplatesApi - object-oriented interface
- * @export
- * @class TemplatesApi
- * @extends {BaseAPI}
- */
-export class TemplatesApi extends BaseAPI {
- /**
- *
- * @summary Create a new template
- * @param {TicketTemplateForm} template New template
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof TemplatesApi
- */
- public createTemplate(template: TicketTemplateForm, options?: AxiosRequestConfig) {
- return TemplatesApiFp(this.configuration).createTemplate(template, options).then((request) => request(this.axios, this.basePath));
- }
-
- /**
- *
- * @summary Delete a template
- * @param {string} id Template ID
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof TemplatesApi
- */
- public deleteTemplate(id: string, options?: AxiosRequestConfig) {
- return TemplatesApiFp(this.configuration).deleteTemplate(id, options).then((request) => request(this.axios, this.basePath));
- }
-
- /**
- *
- * @summary Get a single template
- * @param {string} id Template ID
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof TemplatesApi
- */
- public getTemplate(id: string, options?: AxiosRequestConfig) {
- return TemplatesApiFp(this.configuration).getTemplate(id, options).then((request) => request(this.axios, this.basePath));
- }
-
- /**
- *
- * @summary List templates
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof TemplatesApi
- */
- public listTemplates(options?: AxiosRequestConfig) {
- return TemplatesApiFp(this.configuration).listTemplates(options).then((request) => request(this.axios, this.basePath));
- }
-
- /**
- *
- * @summary Update an existing template
- * @param {string} id Template ID
- * @param {TicketTemplateForm} template Template object that needs to be added
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- * @memberof TemplatesApi
- */
- public updateTemplate(id: string, template: TicketTemplateForm, options?: AxiosRequestConfig) {
- return TemplatesApiFp(this.configuration).updateTemplate(id, template, options).then((request) => request(this.axios, this.basePath));
- }
-}
-
-
-/**
- * TicketsApi - axios parameter creator
- * @export
- */
-export const TicketsApiAxiosParamCreator = function (configuration?: Configuration) {
- return {
- /**
- *
- * @summary Add a single artifact
- * @param {number} id Ticket ID
- * @param {Artifact} artifact Artifact object that needs to be added
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- addArtifact: async (id: number, artifact: Artifact, options: AxiosRequestConfig = {}): Promise => {
- // verify required parameter 'id' is not null or undefined
- assertParamExists('addArtifact', 'id', id)
- // verify required parameter 'artifact' is not null or undefined
- assertParamExists('addArtifact', 'artifact', artifact)
- const localVarPath = `/tickets/{id}/artifacts`
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- localVarHeaderParameter['Content-Type'] = 'application/json';
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
- localVarRequestOptions.data = serializeDataIfNeeded(artifact, localVarRequestOptions, configuration)
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- /**
- *
- * @summary Add ticket comment
- * @param {number} id Ticket ID
- * @param {CommentForm} comment Ticket comment
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- addComment: async (id: number, comment: CommentForm, options: AxiosRequestConfig = {}): Promise => {
- // verify required parameter 'id' is not null or undefined
- assertParamExists('addComment', 'id', id)
- // verify required parameter 'comment' is not null or undefined
- assertParamExists('addComment', 'comment', comment)
- const localVarPath = `/tickets/{id}/comments`
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- localVarHeaderParameter['Content-Type'] = 'application/json';
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
- localVarRequestOptions.data = serializeDataIfNeeded(comment, localVarRequestOptions, configuration)
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- /**
- *
- * @summary Add a new ticket playbook
- * @param {number} id Ticket ID
- * @param {PlaybookTemplateForm} playbook Ticket playbook object that needs to be added
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- addTicketPlaybook: async (id: number, playbook: PlaybookTemplateForm, options: AxiosRequestConfig = {}): Promise => {
- // verify required parameter 'id' is not null or undefined
- assertParamExists('addTicketPlaybook', 'id', id)
- // verify required parameter 'playbook' is not null or undefined
- assertParamExists('addTicketPlaybook', 'playbook', playbook)
- const localVarPath = `/tickets/{id}/playbooks`
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- localVarHeaderParameter['Content-Type'] = 'application/json';
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
- localVarRequestOptions.data = serializeDataIfNeeded(playbook, localVarRequestOptions, configuration)
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- /**
- *
- * @summary Complete ticket playbook task
- * @param {number} id Ticket ID
- * @param {string} playbookID Playbook ID
- * @param {string} taskID Task ID
- * @param {object} data Ticket playbook object that needs to be added
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- completeTask: async (id: number, playbookID: string, taskID: string, data: object, options: AxiosRequestConfig = {}): Promise => {
- // verify required parameter 'id' is not null or undefined
- assertParamExists('completeTask', 'id', id)
- // verify required parameter 'playbookID' is not null or undefined
- assertParamExists('completeTask', 'playbookID', playbookID)
- // verify required parameter 'taskID' is not null or undefined
- assertParamExists('completeTask', 'taskID', taskID)
- // verify required parameter 'data' is not null or undefined
- assertParamExists('completeTask', 'data', data)
- const localVarPath = `/tickets/{id}/playbooks/{playbookID}/task/{taskID}/complete`
- .replace(`{${"id"}}`, encodeURIComponent(String(id)))
- .replace(`{${"playbookID"}}`, encodeURIComponent(String(playbookID)))
- .replace(`{${"taskID"}}`, encodeURIComponent(String(taskID)));
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- localVarHeaderParameter['Content-Type'] = 'application/json';
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
- localVarRequestOptions.data = serializeDataIfNeeded(data, localVarRequestOptions, configuration)
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- /**
- *
- * @summary Create a new ticket
- * @param {TicketForm} ticket New ticket
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- createTicket: async (ticket: TicketForm, options: AxiosRequestConfig = {}): Promise => {
- // verify required parameter 'ticket' is not null or undefined
- assertParamExists('createTicket', 'ticket', ticket)
- const localVarPath = `/tickets`;
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- localVarHeaderParameter['Content-Type'] = 'application/json';
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
- localVarRequestOptions.data = serializeDataIfNeeded(ticket, localVarRequestOptions, configuration)
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- /**
- *
- * @summary Create a new tickets in batch
- * @param {Array} ticket New ticket
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- createTicketBatch: async (ticket: Array, options: AxiosRequestConfig = {}): Promise => {
- // verify required parameter 'ticket' is not null or undefined
- assertParamExists('createTicketBatch', 'ticket', ticket)
- const localVarPath = `/tickets/batch`;
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
- let baseOptions;
- if (configuration) {
- baseOptions = configuration.baseOptions;
- }
-
- const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
- const localVarHeaderParameter = {} as any;
- const localVarQueryParameter = {} as any;
-
-
-
- localVarHeaderParameter['Content-Type'] = 'application/json';
-
- setSearchParams(localVarUrlObj, localVarQueryParameter);
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
- localVarRequestOptions.data = serializeDataIfNeeded(ticket, localVarRequestOptions, configuration)
-
- return {
- url: toPathString(localVarUrlObj),
- options: localVarRequestOptions,
- };
- },
- /**
- *
- * @summary Delete an ticket
- * @param {number} id Ticket ID
- * @param {*} [options] Override http request option.
- * @throws {RequiredError}
- */
- deleteTicket: async (id: number, options: AxiosRequestConfig = {}): Promise