feat: Expose managed variables via API (#6134)

* WIP

* hcl

* useManagedVariables

* fix

* Fix

* Fix

* fix

* go:build

* Fix

* fix: bool flag

* Insert template variables

* API

* fix

* Expose via API

* More wiring

* CLI for testing purposes

* WIP

* Delete FIXME

* planVars

* WIP

* WIP

* UserVariableValues

* no dry run

* Dry run

* Done FIXME

* Fix

* Fix: CLI

* Fix: migration

* API tests

* Test info

* Tests

* More tests

* fix: lint

* Fix: authz

* Address PR comments

* Fix

* fix

* fix
This commit is contained in:
Marcin Tojek
2023-02-15 18:24:15 +01:00
committed by GitHub
parent f0f39b4892
commit 3b7b96ac28
41 changed files with 2423 additions and 667 deletions

View File

@ -1463,6 +1463,24 @@ type TemplateVersionParameter struct {
ValidationMonotonic string `db:"validation_monotonic" json:"validation_monotonic"`
}
type TemplateVersionVariable struct {
TemplateVersionID uuid.UUID `db:"template_version_id" json:"template_version_id"`
// Variable name
Name string `db:"name" json:"name"`
// Variable description
Description string `db:"description" json:"description"`
// Variable type
Type string `db:"type" json:"type"`
// Variable value
Value string `db:"value" json:"value"`
// Variable default value
DefaultValue string `db:"default_value" json:"default_value"`
// Required variables needs a default value or a value provided by template admin
Required bool `db:"required" json:"required"`
// Sensitive variables have their values redacted in logs or site UI
Sensitive bool `db:"sensitive" json:"sensitive"`
}
type User struct {
ID uuid.UUID `db:"id" json:"id"`
Email string `db:"email" json:"email"`