From 48679efb054f3cf03fbbad1f60a8360492cff401 Mon Sep 17 00:00:00 2001 From: Didier Roche Date: Wed, 15 Nov 2023 08:50:54 +0100 Subject: [PATCH 01/11] Split Generate from Generate admx/adml We will generate then the documentation too, so split the names. --- cmd/admxgen/main.go | 2 +- internal/ad/admxgen/admxgen_test.go | 4 ++-- internal/ad/admxgen/files.go | 4 ++-- .../admx generation fails.yaml | 0 .../autodetect overrides releases from yaml.yaml | 0 .../category expansion fails.yaml | 0 .../golden/autodetect_overrides_releases_from_yaml.adml | 0 .../golden/autodetect_overrides_releases_from_yaml.admx | 0 .../golden/releases_from_yaml.adml | 0 .../golden/releases_from_yaml.admx | 0 .../{TestGenerate => TestGenerateAD}/releases from yaml.yaml | 0 .../testdata/{TestGenerate => TestGenerateAD}/src/20.04.yaml | 0 .../testdata/{TestGenerate => TestGenerateAD}/src/21.04.yaml | 0 .../testdata/{TestGenerate => TestGenerateAD}/src/21.10.yaml | 0 .../{TestGenerate => TestGenerateAD}/src/nonreleasefile | 0 15 files changed, 5 insertions(+), 5 deletions(-) rename internal/ad/admxgen/testdata/{TestGenerate => TestGenerateAD}/admx generation fails.yaml (100%) rename internal/ad/admxgen/testdata/{TestGenerate => TestGenerateAD}/autodetect overrides releases from yaml.yaml (100%) rename internal/ad/admxgen/testdata/{TestGenerate => TestGenerateAD}/category expansion fails.yaml (100%) rename internal/ad/admxgen/testdata/{TestGenerate => TestGenerateAD}/golden/autodetect_overrides_releases_from_yaml.adml (100%) rename internal/ad/admxgen/testdata/{TestGenerate => TestGenerateAD}/golden/autodetect_overrides_releases_from_yaml.admx (100%) rename internal/ad/admxgen/testdata/{TestGenerate => TestGenerateAD}/golden/releases_from_yaml.adml (100%) rename internal/ad/admxgen/testdata/{TestGenerate => TestGenerateAD}/golden/releases_from_yaml.admx (100%) rename internal/ad/admxgen/testdata/{TestGenerate => TestGenerateAD}/releases from yaml.yaml (100%) rename internal/ad/admxgen/testdata/{TestGenerate => TestGenerateAD}/src/20.04.yaml (100%) rename internal/ad/admxgen/testdata/{TestGenerate => TestGenerateAD}/src/21.04.yaml (100%) rename internal/ad/admxgen/testdata/{TestGenerate => TestGenerateAD}/src/21.10.yaml (100%) rename internal/ad/admxgen/testdata/{TestGenerate => TestGenerateAD}/src/nonreleasefile (100%) diff --git a/cmd/admxgen/main.go b/cmd/admxgen/main.go index b9c23993b..84cf0d8f0 100644 --- a/cmd/admxgen/main.go +++ b/cmd/admxgen/main.go @@ -94,7 +94,7 @@ func installAdmx(rootCmd *cobra.Command, viper *viper.Viper) error { Long: gotext.Get("Collects all intermediary policy definition files in SOURCE directory to create admx and adml templates in DEST, based on CATEGORIES_DEF.yaml."), Args: cobra.ExactArgs(3), RunE: func(cmd *cobra.Command, args []string) error { - return admxgen.Generate(args[0], args[1], args[2], *autoDetectReleases, *allowMissingKeys) + return admxgen.GenerateAD(args[0], args[1], args[2], *autoDetectReleases, *allowMissingKeys) }, } autoDetectReleases = cmd.Flags().BoolP("auto-detect-releases", "a", false, gotext.Get("override supported releases in categories definition file and will takes all yaml files in SOURCE directory and use the basename as their versions.")) diff --git a/internal/ad/admxgen/admxgen_test.go b/internal/ad/admxgen/admxgen_test.go index 39e61adf5..e4f951bfd 100644 --- a/internal/ad/admxgen/admxgen_test.go +++ b/internal/ad/admxgen/admxgen_test.go @@ -84,7 +84,7 @@ func TestExpand(t *testing.T) { } } -func TestGenerate(t *testing.T) { +func TestGenerateAD(t *testing.T) { t.Parallel() tests := map[string]struct { @@ -119,7 +119,7 @@ func TestGenerate(t *testing.T) { require.NoError(t, err, "Setup: should create a file as destination") } - err := admxgen.Generate(catDef, src, dst, tc.autoDetectReleases, false) + err := admxgen.GenerateAD(catDef, src, dst, tc.autoDetectReleases, false) if tc.wantErr { require.Error(t, err, "admx should have errored out") return diff --git a/internal/ad/admxgen/files.go b/internal/ad/admxgen/files.go index 428d52138..3d4cead6b 100644 --- a/internal/ad/admxgen/files.go +++ b/internal/ad/admxgen/files.go @@ -116,8 +116,8 @@ type categoryFileStruct struct { Categories []category } -// Generate creates and merge all policies into ADMX/ADML files. -func Generate(categoryDefinition, src, dst string, autoDetectReleases, allowMissingKeys bool) error { +// GenerateAD creates and merge all policies into ADMX/ADML files. +func GenerateAD(categoryDefinition, src, dst string, autoDetectReleases, allowMissingKeys bool) error { // Load all expanded categories policies, catfs, err := loadDefinitions(categoryDefinition, src) if err != nil { diff --git a/internal/ad/admxgen/testdata/TestGenerate/admx generation fails.yaml b/internal/ad/admxgen/testdata/TestGenerateAD/admx generation fails.yaml similarity index 100% rename from internal/ad/admxgen/testdata/TestGenerate/admx generation fails.yaml rename to internal/ad/admxgen/testdata/TestGenerateAD/admx generation fails.yaml diff --git a/internal/ad/admxgen/testdata/TestGenerate/autodetect overrides releases from yaml.yaml b/internal/ad/admxgen/testdata/TestGenerateAD/autodetect overrides releases from yaml.yaml similarity index 100% rename from internal/ad/admxgen/testdata/TestGenerate/autodetect overrides releases from yaml.yaml rename to internal/ad/admxgen/testdata/TestGenerateAD/autodetect overrides releases from yaml.yaml diff --git a/internal/ad/admxgen/testdata/TestGenerate/category expansion fails.yaml b/internal/ad/admxgen/testdata/TestGenerateAD/category expansion fails.yaml similarity index 100% rename from internal/ad/admxgen/testdata/TestGenerate/category expansion fails.yaml rename to internal/ad/admxgen/testdata/TestGenerateAD/category expansion fails.yaml diff --git a/internal/ad/admxgen/testdata/TestGenerate/golden/autodetect_overrides_releases_from_yaml.adml b/internal/ad/admxgen/testdata/TestGenerateAD/golden/autodetect_overrides_releases_from_yaml.adml similarity index 100% rename from internal/ad/admxgen/testdata/TestGenerate/golden/autodetect_overrides_releases_from_yaml.adml rename to internal/ad/admxgen/testdata/TestGenerateAD/golden/autodetect_overrides_releases_from_yaml.adml diff --git a/internal/ad/admxgen/testdata/TestGenerate/golden/autodetect_overrides_releases_from_yaml.admx b/internal/ad/admxgen/testdata/TestGenerateAD/golden/autodetect_overrides_releases_from_yaml.admx similarity index 100% rename from internal/ad/admxgen/testdata/TestGenerate/golden/autodetect_overrides_releases_from_yaml.admx rename to internal/ad/admxgen/testdata/TestGenerateAD/golden/autodetect_overrides_releases_from_yaml.admx diff --git a/internal/ad/admxgen/testdata/TestGenerate/golden/releases_from_yaml.adml b/internal/ad/admxgen/testdata/TestGenerateAD/golden/releases_from_yaml.adml similarity index 100% rename from internal/ad/admxgen/testdata/TestGenerate/golden/releases_from_yaml.adml rename to internal/ad/admxgen/testdata/TestGenerateAD/golden/releases_from_yaml.adml diff --git a/internal/ad/admxgen/testdata/TestGenerate/golden/releases_from_yaml.admx b/internal/ad/admxgen/testdata/TestGenerateAD/golden/releases_from_yaml.admx similarity index 100% rename from internal/ad/admxgen/testdata/TestGenerate/golden/releases_from_yaml.admx rename to internal/ad/admxgen/testdata/TestGenerateAD/golden/releases_from_yaml.admx diff --git a/internal/ad/admxgen/testdata/TestGenerate/releases from yaml.yaml b/internal/ad/admxgen/testdata/TestGenerateAD/releases from yaml.yaml similarity index 100% rename from internal/ad/admxgen/testdata/TestGenerate/releases from yaml.yaml rename to internal/ad/admxgen/testdata/TestGenerateAD/releases from yaml.yaml diff --git a/internal/ad/admxgen/testdata/TestGenerate/src/20.04.yaml b/internal/ad/admxgen/testdata/TestGenerateAD/src/20.04.yaml similarity index 100% rename from internal/ad/admxgen/testdata/TestGenerate/src/20.04.yaml rename to internal/ad/admxgen/testdata/TestGenerateAD/src/20.04.yaml diff --git a/internal/ad/admxgen/testdata/TestGenerate/src/21.04.yaml b/internal/ad/admxgen/testdata/TestGenerateAD/src/21.04.yaml similarity index 100% rename from internal/ad/admxgen/testdata/TestGenerate/src/21.04.yaml rename to internal/ad/admxgen/testdata/TestGenerateAD/src/21.04.yaml diff --git a/internal/ad/admxgen/testdata/TestGenerate/src/21.10.yaml b/internal/ad/admxgen/testdata/TestGenerateAD/src/21.10.yaml similarity index 100% rename from internal/ad/admxgen/testdata/TestGenerate/src/21.10.yaml rename to internal/ad/admxgen/testdata/TestGenerateAD/src/21.10.yaml diff --git a/internal/ad/admxgen/testdata/TestGenerate/src/nonreleasefile b/internal/ad/admxgen/testdata/TestGenerateAD/src/nonreleasefile similarity index 100% rename from internal/ad/admxgen/testdata/TestGenerate/src/nonreleasefile rename to internal/ad/admxgen/testdata/TestGenerateAD/src/nonreleasefile From bf80a86a931e1b76dcb58d9acec0b27931c76734 Mon Sep 17 00:00:00 2001 From: Didier Roche Date: Wed, 15 Nov 2023 08:54:36 +0100 Subject: [PATCH 02/11] Implement generation reference documentation for policy This is the internal recursive function to create documentation from a md template, one each page, for each documentation policy. Categories are sorted into folders, and both of them are split between Computer and User policies. --- internal/ad/admxgen/admxgen.go | 109 ++++++++++++++++++++++ internal/ad/admxgen/docpolicy.md.template | 29 ++++++ internal/ad/admxgen/files.go | 3 + 3 files changed, 141 insertions(+) create mode 100644 internal/ad/admxgen/docpolicy.md.template diff --git a/internal/ad/admxgen/admxgen.go b/internal/ad/admxgen/admxgen.go index 9b71ef5d9..1f0b94148 100644 --- a/internal/ad/admxgen/admxgen.go +++ b/internal/ad/admxgen/admxgen.go @@ -512,6 +512,115 @@ func (g generator) expandedCategoriesToADMX(expandedCategories []expandedCategor return nil } +func expandedCategoriesToMD(expandedCategories []expandedCategory, rootDest string, currentRelPath string) (err error) { + computerDest, userDest := filepath.Join(rootDest, "Computer Policies", currentRelPath), filepath.Join(rootDest, "User Policies", currentRelPath) + // bootstrap first directories + if currentRelPath == "." { + for _, dest := range []string{rootDest, computerDest, userDest} { + if dest != rootDest { + if err := os.RemoveAll(dest); err != nil { + return err + } + } + if err := os.Mkdir(dest, 0700); err != nil { + if dest == rootDest && errors.Is(err, os.ErrExist) { + continue + } + return err + } + } + } + + for _, ec := range expandedCategories { + // Directories: create both paths. + computerCategoryDir, userCategoryDir := filepath.Join(computerDest, ec.DisplayName), filepath.Join(userDest, ec.DisplayName) + for _, p := range []string{computerCategoryDir, userCategoryDir} { + if err := os.Mkdir(p, 0700); err != nil { + return err + } + } + + // This is a list of policies in the current directory. + for _, p := range ec.Policies { + dest := computerCategoryDir + if p.Class == "User" { + dest = userCategoryDir + } + polDetails := p.ReleasesElements["all"] + + input := struct { + Key string + DisplayName string + ExplainText string + ElementType string + Class string + RangeValuesMin string + RangeValuesMax string + Choices []string + }{ + p.Key, + polDetails.DisplayName, + strings.ReplaceAll( + strings.ReplaceAll( + strings.TrimSpace(strings.TrimPrefix(p.ExplainText, "-")), + "[", "`["), + "]", "]`"), + string(polDetails.ElementType), + p.Class, + polDetails.RangeValues.Min, + polDetails.RangeValues.Max, + polDetails.Choices, + } + + f, err := os.Create(filepath.Join(dest, filepath.Base(polDetails.Key)) + ".md") + if err != nil { + return fmt.Errorf(i18n.G("can't create md file: %v"), err) + } + defer decorate.LogFuncOnError(f.Close) + t := template.Must(template.New("doc policy").Parse(docPolicyTemplate)) + err = t.Execute(f, input) + if err != nil { + return err + } + } + + // Expand children categories. + if err := expandedCategoriesToMD(ec.Children, rootDest, filepath.Join(currentRelPath, ec.DisplayName)); err != nil { + return err + } + + // Remove any folders that are still empty after the expansion of children categories and policies + // (the leaves will be removed first, and so children empty categories are already purged). + for _, p := range []string{computerCategoryDir, userCategoryDir} { + if err := removeDirIfEmpty(p); err != nil { + return err + } + } + } + + // Remove root directories if they are empty + if currentRelPath == "." { + for _, p := range []string{computerDest, userDest, rootDest} { + if err := removeDirIfEmpty(p); err != nil { + return err + } + } + } + + return nil +} + +func removeDirIfEmpty(p string) error { + children, err := os.ReadDir(p) + if err != nil { + return err + } + if len(children) > 0 { + return nil + } + return os.Remove(p) +} + func (g generator) collectCategoriesPolicies(category expandedCategory, parent string) ([]categoryForADMX, []policyForADMX) { if parent == "" { parent = category.Parent diff --git a/internal/ad/admxgen/docpolicy.md.template b/internal/ad/admxgen/docpolicy.md.template new file mode 100644 index 000000000..73c869e37 --- /dev/null +++ b/internal/ad/admxgen/docpolicy.md.template @@ -0,0 +1,29 @@ +# {{.DisplayName}} + +{{.ExplainText}} + +{{ if or (ne .RangeValuesMin "") (ne .RangeValuesMax "") -}} + +## Valid range + +* Min: {{.RangeValuesMin}} +* Max: {{.RangeValuesMax}} + +{{ end -}} + +{{- if ne (len .Choices) 0 -}} + +## Valid values + +{{ range $i, $c := .Choices -}} +* {{$c}} +{{ end -}} +{{- end }} + +## Metadata + +| Element | Value | +| --- | --- | +| Key | {{.Key}} | +| Element type | {{.ElementType}} | +| Class: | {{.Class}} | diff --git a/internal/ad/admxgen/files.go b/internal/ad/admxgen/files.go index 3d4cead6b..fce8d9dcc 100644 --- a/internal/ad/admxgen/files.go +++ b/internal/ad/admxgen/files.go @@ -23,6 +23,9 @@ var admxTemplate string //go:embed adml.template var admlTemplate string +//go:embed docpolicy.md.template +var docPolicyTemplate string + // Expand will expand any policies on the system into a list of expanded policies. func Expand(src, dst, root, currentSession string) error { release, err := adcommon.GetVersionID(root) From 271d18cce2909bd113717cde8f307a9930ac7648 Mon Sep 17 00:00:00 2001 From: Didier Roche Date: Wed, 15 Nov 2023 09:01:44 +0100 Subject: [PATCH 03/11] Tests for expandedCategoriesToMD Those tests are similar to the ones for expandedCategoriesToADMX --- internal/ad/admxgen/internal_test.go | 80 ++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/internal/ad/admxgen/internal_test.go b/internal/ad/admxgen/internal_test.go index 077f566da..1044d8a90 100644 --- a/internal/ad/admxgen/internal_test.go +++ b/internal/ad/admxgen/internal_test.go @@ -218,6 +218,86 @@ func TestExpandedCategoriesToADMX(t *testing.T) { } } +func TestExpandedCategoriesToMD(t *testing.T) { + t.Parallel() + + tests := map[string]struct { + destIsFile bool + + wantErr bool + }{ + "simple": {}, + "nested categories": {}, + "multiple categories": {}, + + // Basic keys: no options means a key with no children and no types on it + "basic key": {}, + + "user policy": {}, + "nested categories, classes and empty": {}, + + // Types + "boolean": {}, + "decimal": {}, + "decimal with range": {}, + "decimal with min only": {}, + "decimal with max only": {}, + // TODO: range with min or max < 0 -> text + "long decimal": {}, + "array of strings": {}, + "array of integers": {}, + "choices": {}, + "choices with default": {}, + "double": {}, + "double with range": {}, + + // Multiple releases + "multiple releases for one key": {}, + "multiple releases with different widgettype": {}, + "multiple releases with different choices": {}, + "multiple releases with different ranges": {}, + "multiple releases with all widgets and different defaults": {}, + + // meta cases + "no meta enabled": {}, + "no meta disabled": {}, + "no meta at all": {}, + + // Error Cases + "error on destination creation": {destIsFile: true, wantErr: true}, + } + for name, tc := range tests { + name := name + + tc := tc + t.Run(name, func(t *testing.T) { + t.Parallel() + dst := filepath.Join(t.TempDir(), "subdir") + + if tc.destIsFile { + f, err := os.Create(dst) + f.Close() + require.NoError(t, err, "Setup: should create a file as destination") + } + + var ec []expandedCategory + ecF, err := os.ReadFile(filepath.Join(testutils.TestFamilyPath(t), "defs", name+".yaml")) + require.NoError(t, err, "Setup: failed to load expanded categories from file") + err = yaml.Unmarshal(ecF, &ec) + require.NoError(t, err, "Setup: failed to unmarshal expanded categories") + + err = expandedCategoriesToMD(ec, dst, ".") + if tc.wantErr { + require.Error(t, err, "expandedCategoriesToMD should have errored out") + return + } + require.NoError(t, err, "expandedCategoriesToMD failed but shouldn't have") + + testutils.CompareTreesWithFiltering(t, dst, testutils.GoldenPath(t), testutils.Update()) + }) + } +} + func TestMain(m *testing.M) { testutils.InstallUpdateFlag() flag.Parse() From ce9687151474a8398b10bfeb12208f0d5efd5340 Mon Sep 17 00:00:00 2001 From: Didier Roche Date: Wed, 15 Nov 2023 09:02:35 +0100 Subject: [PATCH 04/11] Fixtures and golden assets for expandedCategoriesToMD tests Those are similar to the ones from expandedCategoriesToADMX. --- .../defs/array of integers.yaml | 29 ++++ .../defs/array of strings.yaml | 29 ++++ .../defs/basic key.yaml | 24 +++ .../defs/boolean.yaml | 29 ++++ .../defs/choices with default.yaml | 87 +++++++++++ .../defs/choices.yaml | 34 +++++ .../defs/decimal with max only.yaml | 31 ++++ .../defs/decimal with min only.yaml | 31 ++++ .../defs/decimal with range.yaml | 32 ++++ .../defs/decimal.yaml | 29 ++++ .../defs/double with range.yaml | 32 ++++ .../defs/double.yaml | 29 ++++ .../defs/error on destination creation.yaml | 29 ++++ .../defs/long decimal.yaml | 29 ++++ .../defs/multiple categories.yaml | 58 +++++++ .../defs/multiple releases for one key.yaml | 53 +++++++ ...th all widgets and different defaults.yaml | 124 +++++++++++++++ ...tiple releases with different choices.yaml | 70 +++++++++ ...ltiple releases with different ranges.yaml | 64 ++++++++ ...le releases with different widgettype.yaml | 55 +++++++ .../nested categories, classes and empty.yaml | 141 ++++++++++++++++++ .../defs/nested categories.yaml | 58 +++++++ .../defs/no meta at all.yaml | 29 ++++ .../defs/no meta disabled.yaml | 29 ++++ .../defs/no meta enabled.yaml | 29 ++++ .../defs/other distro.yaml | 29 ++++ .../defs/simple.yaml | 29 ++++ .../defs/user policy.yaml | 29 ++++ .../Category1 Display Name/policy-simple.md | 20 +++ .../Category1 Display Name/policy-simple.md | 20 +++ .../Category1 Display Name/no-options.md | 16 ++ .../Category1 Display Name/policy-simple.md | 20 +++ .../Category1 Display Name/policy-simple.md | 26 ++++ .../Category1 Display Name/policy-simple.md | 28 ++++ .../Category1 Display Name/policy-decimal.md | 20 +++ .../policy-decimal-with-range.md | 25 ++++ .../policy-decimal-with-range.md | 25 ++++ .../policy-decimal-with-range.md | 25 ++++ .../Category1 Display Name/policy-double.md | 20 +++ .../Category1 Display Name/policy-double.md | 25 ++++ .../policy-long-decimal.md | 20 +++ .../policy-multiple1.md | 18 +++ .../policy-multiple2.md | 18 +++ .../Category1 Display Name/policy-simple.md | 20 +++ .../Category1 Display Name/policy-simple.md | 26 ++++ .../Category1 Display Name/policy-simple.md | 28 ++++ .../Category1 Display Name/policy-simple.md | 27 ++++ .../Category1 Display Name/policy-simple.md | 22 +++ .../policy-child-computer.md | 20 +++ .../policy-computer.md | 20 +++ .../policy-first.md | 20 +++ .../policy-child-user.md | 20 +++ .../policy-user.md | 20 +++ .../policy-second.md | 20 +++ .../policy-first.md | 20 +++ .../Category1 Display Name/policy-simple.md | 20 +++ .../Category1 Display Name/policy-simple.md | 20 +++ .../Category1 Display Name/policy-simple.md | 20 +++ .../Category1 Display Name/policy-simple.md | 20 +++ .../Category1 Display Name/policy-simple.md | 20 +++ 60 files changed, 1960 insertions(+) create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/array of integers.yaml create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/array of strings.yaml create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/basic key.yaml create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/boolean.yaml create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/choices with default.yaml create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/choices.yaml create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/decimal with max only.yaml create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/decimal with min only.yaml create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/decimal with range.yaml create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/decimal.yaml create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/double with range.yaml create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/double.yaml create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/error on destination creation.yaml create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/long decimal.yaml create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/multiple categories.yaml create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/multiple releases for one key.yaml create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/multiple releases with all widgets and different defaults.yaml create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/multiple releases with different choices.yaml create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/multiple releases with different ranges.yaml create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/multiple releases with different widgettype.yaml create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/nested categories, classes and empty.yaml create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/nested categories.yaml create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/no meta at all.yaml create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/no meta disabled.yaml create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/no meta enabled.yaml create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/other distro.yaml create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/simple.yaml create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/user policy.yaml create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/array_of_integers/Computer Policies/Category1 Display Name/policy-simple.md create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/array_of_strings/Computer Policies/Category1 Display Name/policy-simple.md create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/basic_key/Computer Policies/Category1 Display Name/no-options.md create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/boolean/Computer Policies/Category1 Display Name/policy-simple.md create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/choices/Computer Policies/Category1 Display Name/policy-simple.md create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/choices_with_default/Computer Policies/Category1 Display Name/policy-simple.md create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/decimal/Computer Policies/Category1 Display Name/policy-decimal.md create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/decimal_with_max_only/Computer Policies/Category1 Display Name/policy-decimal-with-range.md create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/decimal_with_min_only/Computer Policies/Category1 Display Name/policy-decimal-with-range.md create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/decimal_with_range/Computer Policies/Category1 Display Name/policy-decimal-with-range.md create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/double/Computer Policies/Category1 Display Name/policy-double.md create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/double_with_range/Computer Policies/Category1 Display Name/policy-double.md create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/long_decimal/Computer Policies/Category1 Display Name/policy-long-decimal.md create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_categories/Computer Policies/Category1 Display Name/policy-multiple1.md create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_categories/Computer Policies/Category2 Display Name/policy-multiple2.md create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_for_one_key/Computer Policies/Category1 Display Name/policy-simple.md create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_with_all_widgets_and_different_defaults/Computer Policies/Category1 Display Name/policy-simple.md create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_with_different_choices/Computer Policies/Category1 Display Name/policy-simple.md create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_with_different_ranges/Computer Policies/Category1 Display Name/policy-simple.md create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_with_different_widgettype/Computer Policies/Category1 Display Name/policy-simple.md create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/Computer Policies/Parent Category Display Name/Category with User and Computer/policy-child-computer.md create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/Computer Policies/Parent Category Display Name/Child Category Display Name Computer/policy-computer.md create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/Computer Policies/Parent Category Display Name/policy-first.md create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/User Policies/Parent Category Display Name/Category with User and Computer/policy-child-user.md create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/User Policies/Parent Category Display Name/Child Category Display Name in User/policy-user.md create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories/Computer Policies/Parent Category Display Name/Child Category Display Name/policy-second.md create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories/Computer Policies/Parent Category Display Name/policy-first.md create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/no_meta_at_all/Computer Policies/Category1 Display Name/policy-simple.md create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/no_meta_disabled/Computer Policies/Category1 Display Name/policy-simple.md create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/no_meta_enabled/Computer Policies/Category1 Display Name/policy-simple.md create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/simple/Computer Policies/Category1 Display Name/policy-simple.md create mode 100644 internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/user_policy/User Policies/Category1 Display Name/policy-simple.md diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/array of integers.yaml b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/array of integers.yaml new file mode 100644 index 000000000..a28351ed3 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/array of integers.yaml @@ -0,0 +1,29 @@ +- displayname: Category1 Display Name + parent: ubuntu:Desktop + policies: + - key: Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-array-decimal + explaintext: |- + description + + - Type: dconf + - Key: org/gnome/desktop/policy-array-decimal + - Default: [1, 2] + Note: default system value is used for "Not Configured" and enforced if "Disabled". + + Supported on Ubuntu 20.04 + metaenabled: '{"20.04":{"empty":"[]","meta":"ai"},"all":{"empty":"[]","meta":"ai"}}' + metadisabled: '{"20.04":{"meta":"ai"},"all":{"meta":"ai"}}' + class: Machine + releaseselements: + all: + key: /org/gnome/desktop/policy-simple + displayname: summary + explaintext: description + elementtype: multiText + meta: + meta: "ai" + empty: "[]" + default: '[1, 2]' + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "20.04" + type: dconf diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/array of strings.yaml b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/array of strings.yaml new file mode 100644 index 000000000..cedefde71 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/array of strings.yaml @@ -0,0 +1,29 @@ +- displayname: Category1 Display Name + parent: ubuntu:Desktop + policies: + - key: Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-array-string + explaintext: |- + description + + - Type: dconf + - Key: org/gnome/desktop/policy-array-string + - Default: ['Value1', 'Value2'] + Note: default system value is used for "Not Configured" and enforced if "Disabled". + + Supported on Ubuntu 20.04 + metaenabled: '{"20.04":{"empty":"[]","meta":"as"},"all":{"empty":"[]","meta":"as"}}' + metadisabled: '{"20.04":{"meta":"as"},"all":{"meta":"as"}}' + class: Machine + releaseselements: + all: + key: /org/gnome/desktop/policy-simple + displayname: summary + explaintext: description + elementtype: multiText + meta: + meta: "as" + empty: "[]" + default: '[''Value1'', ''Value2'']' + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "20.04" + type: dconf diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/basic key.yaml b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/basic key.yaml new file mode 100644 index 000000000..2e4f27fd3 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/basic key.yaml @@ -0,0 +1,24 @@ +- displayname: Category1 Display Name + parent: ubuntu:Desktop + policies: + - key: Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-no-options + explaintext: |- + description + + - Type: privilege + - Key: /no-options + + metaenabled: '{"all":{"meta":"some enabled value"}}' + metadisabled: '{"all":{"meta":"some disabled value"}}' + class: Machine + releaseselements: + all: + key: /no-options + displayname: summary + explaintext: description + meta: + empty: '''''' + meta: "s" + default: "" + release: "all" + type: privilege diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/boolean.yaml b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/boolean.yaml new file mode 100644 index 000000000..eaf3003b7 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/boolean.yaml @@ -0,0 +1,29 @@ +- displayname: Category1 Display Name + parent: ubuntu:Desktop + policies: + - key: Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-boolean + explaintext: |- + description + + - Type: dconf + - Key: org/gnome/desktop/policy-boolean + - Default: true + Note: default system value is used for "Not Configured" and enforced if "Disabled". + + Supported on Ubuntu 20.04 + metaenabled: '{"20.04":{"empty":"false","meta":"b"},"all":{"empty":"false","meta":"b"}}' + metadisabled: '{"20.04":{"meta":"b"},"all":{"meta":"b"}}' + class: Machine + releaseselements: + all: + key: /org/gnome/desktop/policy-simple + displayname: summary + explaintext: description + elementtype: boolean + meta: + meta: "b" + empty: "false" + default: 'true' + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "20.04" + type: dconf diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/choices with default.yaml b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/choices with default.yaml new file mode 100644 index 000000000..a9bdbbcd0 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/choices with default.yaml @@ -0,0 +1,87 @@ +- displayname: Category1 Display Name + parent: ubuntu:Desktop + policies: + - key: Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-choices + explaintext: |- + description + + - Type: dconf + - Key: org/gnome/desktop/policy-choices + - Default for 20.04: Choice 3 + - Default for 18.04: Choice 2 + - Default for 16.04: Unmatched default + Note: default system value is used for "Not Configured" and enforced if "Disabled". + + Supported on Ubuntu 20.04, 18.04 + metaenabled: '{"20.04":{"empty":"''''","meta":"s"},"18.04":{"empty":"''''","meta":"s"},"16.04":{"empty":"''''","meta":"s"},"all":{"empty":"''''","meta":"s"}}' + metadisabled: '{"20.04":{"meta":"s"},"18.04":{"meta":"s"},"16.04":{"meta":"s"},"all":{"meta":"s"}}' + class: Machine + releaseselements: + all: + key: /org/gnome/desktop/policy-simple + displayname: summary + explaintext: description + elementtype: dropdownList + meta: + meta: "s" + empty: '''''' + default: 'Choice 3' + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "20.04" + type: dconf + choices: + - Choice 1 + - Choice 2 + - Choice 3 + - Choice 4 + "20.04": + key: /org/gnome/desktop/policy-simple + displayname: summary + explaintext: description + elementtype: dropdownList + meta: + meta: "s" + empty: '''''' + default: 'Choice 3' + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "20.04" + type: dconf + choices: + - Choice 1 + - Choice 2 + - Choice 3 + - Choice 4 + "18.04": + key: /org/gnome/desktop/policy-simple + displayname: summary + explaintext: description + elementtype: dropdownList + meta: + meta: "s" + empty: '''''' + default: 'Choice 2' + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "18.04" + type: dconf + choices: + - Choice 1 + - Choice 2 + - Choice 3 + - Choice 4 + "16.04": + key: /org/gnome/desktop/policy-simple + displayname: summary + explaintext: description + elementtype: dropdownList + meta: + meta: "s" + empty: '''''' + default: 'Unmatched default' + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "16.04" + type: dconf + choices: + - Choice 1 + - Choice 2 + - Choice 3 + - Choice 4 diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/choices.yaml b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/choices.yaml new file mode 100644 index 000000000..3768d0e8e --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/choices.yaml @@ -0,0 +1,34 @@ +- displayname: Category1 Display Name + parent: ubuntu:Desktop + policies: + - key: Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-choices + explaintext: |- + description + + - Type: dconf + - Key: org/gnome/desktop/policy-choices + - Default: Choice 1 + Note: default system value is used for "Not Configured" and enforced if "Disabled". + + Supported on Ubuntu 20.04 + metaenabled: '{"20.04":{"empty":"''''","meta":"s"},"all":{"empty":"''''","meta":"s"}}' + metadisabled: '{"20.04":{"meta":"s"},"all":{"meta":"s"}}' + class: Machine + releaseselements: + all: + key: /org/gnome/desktop/policy-simple + displayname: summary + explaintext: description + elementtype: dropdownList + meta: + meta: "s" + empty: '''''' + default: 'Choice 1' + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "20.04" + type: dconf + choices: + - Choice 1 + - Choice 2 + - Choice 3 + - Choice 4 diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/decimal with max only.yaml b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/decimal with max only.yaml new file mode 100644 index 000000000..f4d8aae1a --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/decimal with max only.yaml @@ -0,0 +1,31 @@ +- displayname: Category1 Display Name + parent: ubuntu:Desktop + policies: + - key: Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-decimal-with-range + explaintext: |- + description + + - Type: dconf + - Key: org/gnome/desktop/policy-decimal-with-range + - Default: 42 + Note: default system value is used for "Not Configured" and enforced if "Disabled". + + Supported on Ubuntu 20.04 + metaenabled: '{"20.04":{"empty":"0","meta":"i"},"all":{"empty":"0","meta":"i"}}' + metadisabled: '{"20.04":{"meta":"i"},"all":{"meta":"i"}}' + class: Machine + releaseselements: + all: + key: /org/gnome/desktop/policy-decimal-with-range + displayname: summary + explaintext: description + elementtype: decimal + meta: + empty: "0" + meta: i + default: "42" + note: default system value is used for "Not Configured" and enforced if "Disabled". + rangevalues: + max: "15000.000000" + release: "20.04" + type: dconf diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/decimal with min only.yaml b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/decimal with min only.yaml new file mode 100644 index 000000000..90c74d1f7 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/decimal with min only.yaml @@ -0,0 +1,31 @@ +- displayname: Category1 Display Name + parent: ubuntu:Desktop + policies: + - key: Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-decimal-with-range + explaintext: |- + description + + - Type: dconf + - Key: org/gnome/desktop/policy-decimal-with-range + - Default: 42 + Note: default system value is used for "Not Configured" and enforced if "Disabled". + + Supported on Ubuntu 20.04 + metaenabled: '{"20.04":{"empty":"0","meta":"i"},"all":{"empty":"0","meta":"i"}}' + metadisabled: '{"20.04":{"meta":"i"},"all":{"meta":"i"}}' + class: Machine + releaseselements: + all: + key: /org/gnome/desktop/policy-decimal-with-range + displayname: summary + explaintext: description + elementtype: decimal + meta: + empty: "0" + meta: i + default: "42" + note: default system value is used for "Not Configured" and enforced if "Disabled". + rangevalues: + min: "-123.000000" + release: "20.04" + type: dconf diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/decimal with range.yaml b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/decimal with range.yaml new file mode 100644 index 000000000..98f88f5b6 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/decimal with range.yaml @@ -0,0 +1,32 @@ +- displayname: Category1 Display Name + parent: ubuntu:Desktop + policies: + - key: Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-decimal-with-range + explaintext: |- + description + + - Type: dconf + - Key: org/gnome/desktop/policy-decimal-with-range + - Default: 42 + Note: default system value is used for "Not Configured" and enforced if "Disabled". + + Supported on Ubuntu 20.04 + metaenabled: '{"20.04":{"empty":"0","meta":"i"},"all":{"empty":"0","meta":"i"}}' + metadisabled: '{"20.04":{"meta":"i"},"all":{"meta":"i"}}' + class: Machine + releaseselements: + all: + key: /org/gnome/desktop/policy-decimal-with-range + displayname: summary + explaintext: description + elementtype: decimal + meta: + empty: "0" + meta: i + default: "42" + note: default system value is used for "Not Configured" and enforced if "Disabled". + rangevalues: + min: "-123.000000" + max: "15000.000000" + release: "20.04" + type: dconf diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/decimal.yaml b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/decimal.yaml new file mode 100644 index 000000000..4599279d9 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/decimal.yaml @@ -0,0 +1,29 @@ +- displayname: Category1 Display Name + parent: ubuntu:Desktop + policies: + - key: Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-decimal + explaintext: |- + description + + - Type: dconf + - Key: org/gnome/desktop/policy-decimal + - Default: 42 + Note: default system value is used for "Not Configured" and enforced if "Disabled". + + Supported on Ubuntu 20.04 + metaenabled: '{"20.04":{"empty":"0","meta":"i"},"all":{"empty":"0","meta":"i"}}' + metadisabled: '{"20.04":{"meta":"i"},"all":{"meta":"i"}}' + class: Machine + releaseselements: + all: + key: /org/gnome/desktop/policy-decimal + displayname: summary + explaintext: description + elementtype: decimal + meta: + empty: "0" + meta: i + default: "42" + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "20.04" + type: dconf diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/double with range.yaml b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/double with range.yaml new file mode 100644 index 000000000..4effba318 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/double with range.yaml @@ -0,0 +1,32 @@ +- displayname: Category1 Display Name + parent: ubuntu:Desktop + policies: + - key: Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-double + explaintext: |- + description + + - Type: dconf + - Key: org/gnome/desktop/policy-double + - Default: 123.456 + Note: default system value is used for "Not Configured" and enforced if "Disabled". + + Supported on Ubuntu 20.04 + metaenabled: '{"20.04":{"empty":"0","meta":"u"},"all":{"empty":"0","meta":"u"}}' + metadisabled: '{"20.04":{"meta":"u"},"all":{"meta":"u"}}' + class: Machine + releaseselements: + all: + key: /org/gnome/desktop/policy-double + displayname: summary + explaintext: description + elementtype: text + meta: + empty: "0" + meta: u + default: "123.456" + note: default system value is used for "Not Configured" and enforced if "Disabled". + rangevalues: + min: "123.000000" + max: "15000.000000" + release: "20.04" + type: dconf diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/double.yaml b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/double.yaml new file mode 100644 index 000000000..7d128ad47 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/double.yaml @@ -0,0 +1,29 @@ +- displayname: Category1 Display Name + parent: ubuntu:Desktop + policies: + - key: Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-double + explaintext: |- + description + + - Type: dconf + - Key: org/gnome/desktop/policy-double + - Default: 123.456 + Note: default system value is used for "Not Configured" and enforced if "Disabled". + + Supported on Ubuntu 20.04 + metaenabled: '{"20.04":{"empty":"0","meta":"u"},"all":{"empty":"0","meta":"u"}}' + metadisabled: '{"20.04":{"meta":"u"},"all":{"meta":"u"}}' + class: Machine + releaseselements: + all: + key: /org/gnome/desktop/policy-double + displayname: summary + explaintext: description + elementtype: text + meta: + empty: "0" + meta: u + default: "123.456" + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "20.04" + type: dconf diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/error on destination creation.yaml b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/error on destination creation.yaml new file mode 100644 index 000000000..10d2ca447 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/error on destination creation.yaml @@ -0,0 +1,29 @@ +- displayname: Category1 Display Name + parent: ubuntu:Desktop + policies: + - key: Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple + explaintext: |- + description + + - Type: dconf + - Key: org/gnome/desktop/policy-simple + - Default: 'Default Value' + Note: default system value is used for "Not Configured" and enforced if "Disabled". + + Supported on Ubuntu 20.04 + metaenabled: '{"20.04":{"empty":"''''","meta":"s"},"all":{"empty":"''''","meta":"s"}}' + metadisabled: '{"20.04":{"meta":"s"},"all":{"meta":"s"}}' + class: Machine + releaseselements: + all: + key: /org/gnome/desktop/policy-simple + displayname: summary + explaintext: description + elementtype: text + meta: + meta: "s" + empty: '''''' + default: '''Default Value''' + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "20.04" + type: dconf diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/long decimal.yaml b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/long decimal.yaml new file mode 100644 index 000000000..00fdfe721 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/long decimal.yaml @@ -0,0 +1,29 @@ +- displayname: Category1 Display Name + parent: ubuntu:Desktop + policies: + - key: Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-long-decimal + explaintext: |- + description + + - Type: dconf + - Key: org/gnome/desktop/policy-long-decimal + - Default: 42 + Note: default system value is used for "Not Configured" and enforced if "Disabled". + + Supported on Ubuntu 20.04 + metaenabled: '{"20.04":{"empty":"0","meta":"u"},"all":{"empty":"0","meta":"u"}}' + metadisabled: '{"20.04":{"meta":"u"},"all":{"meta":"u"}}' + class: Machine + releaseselements: + all: + key: /org/gnome/desktop/policy-long-decimal + displayname: summary + explaintext: description + elementtype: longDecimal + meta: + empty: "0" + meta: u + default: "42" + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "20.04" + type: dconf diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/multiple categories.yaml b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/multiple categories.yaml new file mode 100644 index 000000000..143930aa1 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/multiple categories.yaml @@ -0,0 +1,58 @@ +- displayname: Category1 Display Name + parent: ubuntu:Desktop + policies: + - key: Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-multiple1 + explaintext: |- + description 1 + + - Type: dconf + - Key: org/gnome/desktop/policy-multiple1 + - Default: 'Default Value 1' + Note: default system value is used for "Not Configured" and enforced if "Disabled". + elementtype: text + metaenabled: '{"20.04":{"empty":"''''","meta":"s"},"all":{"empty":"''''","meta":"s"}}' + metadisabled: '{"20.04":{"meta":"s"},"all":{"meta":"s"}}' + class: Machine + releaseselements: + all: + key: /org/gnome/desktop/policy-multiple1 + displayname: summary 1 + explaintext: description 1 + elementtype: text + meta: + meta: "s" + empty: '''''' + default: '''Default Value 1''' + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "20.04" + type: dconf + + +- displayname: Category2 Display Name + parent: ubuntu:Desktop + policies: + - key: Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-multiple2 + explaintext: |- + description 2 + + - Type: dconf + - Key: org/gnome/desktop/policy-multiple2 + - Default: 'Default Value 2' + Note: default system value is used for "Not Configured" and enforced if "Disabled". + elementtype: text + metaenabled: '{"20.04":{"empty":"''''","meta":"s"},"all":{"empty":"''''","meta":"s"}}' + metadisabled: '{"20.04":{"meta":"s"},"all":{"meta":"s"}}' + class: Machine + releaseselements: + all: + key: /org/gnome/desktop/policy-multiple2 + displayname: summary 2 + explaintext: description 2 + elementtype: text + meta: + meta: "s" + empty: '''''' + default: '''Default Value 2''' + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "20.04" + type: dconf diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/multiple releases for one key.yaml b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/multiple releases for one key.yaml new file mode 100644 index 000000000..6b9328e07 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/multiple releases for one key.yaml @@ -0,0 +1,53 @@ +- displayname: Category1 Display Name + parent: ubuntu:Desktop + policies: + - key: Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple + explaintext: |- + description + + - Type: dconf + - Key: org/gnome/desktop/policy-simple + - Default: 'Default Value' + Note: default system value is used for "Not Configured" and enforced if "Disabled". + + Supported on Ubuntu 20.04, 18.04 + metaenabled: '{"20.04":{"empty":"''''","meta":"s"},{"18.04":{"empty":"''''","meta":"s"},"all":{"empty":"''''","meta":"s"}}' + metadisabled: '{"20.04":{"meta":"s"},{"18.04":{"meta":"s"},"all":{"meta":"s"}}' + class: Machine + releaseselements: + all: + key: /org/gnome/desktop/policy-simple + displayname: summary + explaintext: description + elementtype: text + meta: + meta: "s" + empty: '''''' + default: '''Default Value''' + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "20.04" + type: dconf + "20.04": + key: /org/gnome/desktop/policy-simple + displayname: summary + explaintext: description + elementtype: text + meta: + meta: "s" + empty: '''''' + default: '''Default Value''' + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "20.04" + type: dconf + "18.04": + key: /org/gnome/desktop/policy-simple + displayname: summary + explaintext: description + elementtype: text + meta: + meta: "s" + empty: '''''' + default: '''Default Value''' + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "18.04" + type: dconf diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/multiple releases with all widgets and different defaults.yaml b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/multiple releases with all widgets and different defaults.yaml new file mode 100644 index 000000000..53a756b98 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/multiple releases with all widgets and different defaults.yaml @@ -0,0 +1,124 @@ +- displayname: Category1 Display Name + parent: ubuntu:Desktop + policies: + - key: Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple + explaintext: |- + description + + - Type: dconf + - Key: org/gnome/desktop/policy-simple + - Default for textrelease: text default + - Default for multitextrelease: multitext default + - Default for longdecimalrelease: 2020 + - Default for dropdownlistrelease: Choice 1 + - Default for decimalrelease: 20 + - Default for booleanrelease: 'true' + + Note: default system value is used for "Not Configured" and enforced if "Disabled". + + Supported on Ubuntu textrelease, multitextrelease, longdecimalrelease, dropdownlistrelease, decimalrelease, booleanrelease + metaenabled: '{"textrelease":{"meta": "s", "empty": "''''"}, + "multitextrelease":{"meta": "as", "empty": "[]"}, + "longdecimalrelease":{"meta": "u", "empty": "0"}, + "dropdownlistrelease":{"meta": "s", "empty": "''''"}, + "decimalrelease":{"meta": "i", "empty": "0"}, + "booleanrelease":{"meta": "b", "empty": "false"}, + "all":{"meta": "s", "empty": "''''"}}' + metadisabled: '{"textrelease":{"meta": "s"}, + "multitextrelease":{"meta": "as"}, + "longdecimalrelease":{"meta": "u"}, + "dropdownlistrelease":{"meta": "s"}, + "decimalrelease":{"meta": "i"}, + "booleanrelease":{"meta": "b"}, + "all":{"meta": "s"}}' + class: Machine + releaseselements: + all: + key: /org/gnome/desktop/policy-simple + displayname: summary + explaintext: description + elementtype: text + meta: + empty: '''''' + meta: "s" + default: "text default" + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "textrelease" + type: dconf + textrelease: + key: /org/gnome/desktop/policy-simple + displayname: summary + explaintext: description + elementtype: text + meta: + empty: '''''' + meta: "s" + default: "text default" + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "textrelease" + type: dconf + multitextrelease: + key: /org/gnome/desktop/policy-simple + displayname: summary + explaintext: description + elementtype: multiText + meta: + empty: '''''' + meta: "s" + default: "multitext default" + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "multitextrelease" + type: dconf + booleanrelease: + key: /org/gnome/desktop/policy-simple + displayname: summary + explaintext: description + elementtype: boolean + meta: + empty: "false" + meta: "b" + default: 'true' + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "booleanrelease" + type: dconf + decimalrelease: + key: /org/gnome/desktop/policy-simple + displayname: summary + explaintext: description + elementtype: decimal + meta: + empty: "0" + meta: "i" + default: "20" + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "decimalrelease" + type: dconf + longdecimalrelease: + key: /org/gnome/desktop/policy-simple + displayname: summary + explaintext: description + elementtype: longDecimal + meta: + empty: "u" + meta: "u" + default: "2020" + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "longdecimalrelease" + type: dconf + dropdownlistrelease": + key: /org/gnome/desktop/policy-simple + displayname: summary + explaintext: description + elementtype: dropdownList + meta: + empty: '''''' + meta: "s" + default: 'Choice 3' + note: default system value is used for "Not Configured" and enforced if "Disabled". + choices: + - Choice 1 + - Choice 2 + - Choice 3 + - Choice 4 + release: "dropdownlistrelease" + type: dconf diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/multiple releases with different choices.yaml b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/multiple releases with different choices.yaml new file mode 100644 index 000000000..6ce7e4a1d --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/multiple releases with different choices.yaml @@ -0,0 +1,70 @@ +- displayname: Category1 Display Name + parent: ubuntu:Desktop + policies: + - key: Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple + explaintext: |- + description + + - Type: dconf + - Key: org/gnome/desktop/policy-simple + - Default for 20.04: Choice 11 + - Default for 18.04: Choice 22 + + Note: default system value is used for "Not Configured" and enforced if "Disabled". + + Supported on Ubuntu 20.04, 18.04 + metaenabled: '{"20.04":{"empty":"''''","meta":"s"},{"18.04":{"empty":"''''","meta":"s"},"all":{"empty":"''''","meta":"s"}}' + metadisabled: '{"20.04":{"meta":"s"},{"18.04":{"meta":"s"},"all":{"meta":"s"}}' + class: Machine + releaseselements: + all: + key: /org/gnome/desktop/policy-simple + displayname: summary + explaintext: description + elementtype: dropdownList + meta: + empty: '''''' + meta: "s" + default: '''Choice 11''' + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "20.04" + type: dconf + choices: + - Choice 11 + - Choice 12 + - Choice 13 + - Choice 14 + "20.04": + key: /org/gnome/desktop/policy-simple + displayname: summary + explaintext: description + elementtype: dropdownList + meta: + empty: '''''' + meta: "s" + default: Choice 11' + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "20.04" + type: dconf + choices: + - Choice 11 + - Choice 12 + - Choice 13 + - Choice 14 + "18.04": + key: /org/gnome/desktop/policy-simple + displayname: summary + explaintext: description + elementtype: dropdownList + meta: + empty: '''''' + meta: "s" + default: Choice 22' + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "18.04" + type: dconf + choices: + - Choice 21 + - Choice 22 + - Choice 23 + - Choice 24 \ No newline at end of file diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/multiple releases with different ranges.yaml b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/multiple releases with different ranges.yaml new file mode 100644 index 000000000..ec9e11dbd --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/multiple releases with different ranges.yaml @@ -0,0 +1,64 @@ +- displayname: Category1 Display Name + parent: ubuntu:Desktop + policies: + - key: Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple + explaintext: |- + description + + - Type: dconf + - Key: org/gnome/desktop/policy-simple + - Default for 20.04: 20 + - Default for 18.04: 18 + + Note: default system value is used for "Not Configured" and enforced if "Disabled". + + Supported on Ubuntu 20.04, 18.04 + metaenabled: '{"20.04":{"empty":"0","meta":"i"},{"18.04":{"empty":"0","meta":"i"},"all":{"empty":"0","meta":"i"}}' + metadisabled: '{"20.04":{"meta":"i"},{"18.04":{"meta":"i"},"all":{"meta":"i"}}' + class: Machine + releaseselements: + all: + key: /org/gnome/desktop/policy-simple + displayname: summary + explaintext: description + elementtype: decimal + meta: + empty: "0" + meta: "i" + default: "20" + note: default system value is used for "Not Configured" and enforced if "Disabled". + rangevalues: + min: "-20.000000" + max: "20.000000" + release: "20.04" + type: dconf + "20.04": + key: /org/gnome/desktop/policy-simple + displayname: summary + explaintext: description + elementtype: decimal + meta: + empty: "0" + meta: "i" + default: "20" + note: default system value is used for "Not Configured" and enforced if "Disabled". + rangevalues: + min: "-20.000000" + max: "20.000000" + release: "20.04" + type: dconf + "18.04": + key: /org/gnome/desktop/policy-simple + displayname: summary + explaintext: description + elementtype: decimal + meta: + empty: "0" + meta: "i" + default: "18" + note: default system value is used for "Not Configured" and enforced if "Disabled". + rangevalues: + min: "-18.000000" + max: "18.000000" + release: "18.04" + type: dconf diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/multiple releases with different widgettype.yaml b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/multiple releases with different widgettype.yaml new file mode 100644 index 000000000..8e75b1c18 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/multiple releases with different widgettype.yaml @@ -0,0 +1,55 @@ +- displayname: Category1 Display Name + parent: ubuntu:Desktop + policies: + - key: Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple + explaintext: |- + description + + - Type: dconf + - Key: org/gnome/desktop/policy-simple + - Default for 20.04: 'Default Value' + - Default for 18.04: true + + Note: default system value is used for "Not Configured" and enforced if "Disabled". + + Supported on Ubuntu 20.04, 18.04 + metaenabled: '{"20.04":{"empty":"''''","meta":"s"},{"18.04":{"empty":"false","meta":"b"},"all":{"empty":"''''","meta":"s"}}' + metadisabled: '{"20.04":{"meta":"s"},{"18.04":{"meta":"b"},"all":{"meta":"s"}}' + class: Machine + releaseselements: + all: + key: /org/gnome/desktop/policy-simple + displayname: summary + explaintext: description + elementtype: text + meta: + empty: '''''' + meta: "s" + default: '''Default Value''' + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "20.04" + type: dconf + "20.04": + key: /org/gnome/desktop/policy-simple + displayname: summary + explaintext: description + elementtype: text + meta: + empty: '''''' + meta: "s" + default: '''Default Value''' + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "20.04" + type: dconf + "18.04": + key: /org/gnome/desktop/policy-simple + displayname: summary + explaintext: description + elementtype: boolean + meta: + empty: "false" + meta: "b" + default: 'true' + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "18.04" + type: dconf diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/nested categories, classes and empty.yaml b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/nested categories, classes and empty.yaml new file mode 100644 index 000000000..a86e1f2bc --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/nested categories, classes and empty.yaml @@ -0,0 +1,141 @@ +- displayname: Parent Category Display Name + parent: ubuntu:Desktop + policies: + - key: Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-first + explaintext: |- + description first + + - Type: dconf + - Key: org/gnome/desktop/policy-first + - Default: 'Default Value first' + Note: default system value is used for "Not Configured" and enforced if "Disabled". + + Supported on Ubuntu 20.04 + metaenabled: '{"20.04":{"empty":"''''","meta":"s"},"all":{"empty":"''''","meta":"s"}}' + metadisabled: '{"20.04":{"meta":"s"},"all":{"meta":"s"}}' + class: Machine + releaseselements: + all: + key: /org/gnome/desktop/policy-first + displayname: summary first + explaintext: description first + elementtype: text + meta: + empty: "''" + meta: "s" + default: "'Default Value first'" + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "20.04" + type: dconf + children: + - displayname: Category with User and Computer + parent: "" + policies: + - key: Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-child-computer + explaintext: |- + description child computer + + - Type: dconf + - Key: org/gnome/desktop/policy-child-computer + - Default: 'Default Value computer' + Note: default system value is used for "Not Configured" and enforced if "Disabled". + + Supported on Ubuntu 20.04 + metaenabled: '{"20.04":{"empty":"''''","meta":"s"},"all":{"empty":"''''","meta":"s"}}' + metadisabled: '{"20.04":{"meta":"s"},"all":{"meta":"s"}}' + class: Machine + releaseselements: + all: + key: /org/gnome/desktop/policy-child-computer + displayname: summary child computer + explaintext: description child computer + elementtype: text + meta: + default: "''" + meta: "s" + empty: "'Default Value second'" + release: "20.04" + type: dconf + - key: Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-child-user + explaintext: |- + description child user + + - Type: dconf + - Key: org/gnome/desktop/policy-child-user + - Default: 'Default Value child user' + Note: default system value is used for "Not Configured" and enforced if "Disabled". + + Supported on Ubuntu 20.04 + metaenabled: '{"20.04":{"empty":"''''","meta":"s"},"all":{"empty":"''''","meta":"s"}}' + metadisabled: '{"20.04":{"meta":"s"},"all":{"meta":"s"}}' + class: User + releaseselements: + all: + key: /org/gnome/desktop/policy-child-user + displayname: summary computer + explaintext: description computer + elementtype: text + meta: + default: "''" + meta: "s" + empty: "'Default Value second'" + release: "20.04" + type: dconf + - displayname: Child Category Display Name Computer + parent: "" + policies: + - key: Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-computer + explaintext: |- + description computer + + - Type: dconf + - Key: org/gnome/desktop/policy-computer + - Default: 'Default Value computer' + Note: default system value is used for "Not Configured" and enforced if "Disabled". + + Supported on Ubuntu 20.04 + metaenabled: '{"20.04":{"empty":"''''","meta":"s"},"all":{"empty":"''''","meta":"s"}}' + metadisabled: '{"20.04":{"meta":"s"},"all":{"meta":"s"}}' + class: Machine + releaseselements: + all: + key: /org/gnome/desktop/policy-computer + displayname: summary computer + explaintext: description computer + elementtype: text + meta: + default: "''" + meta: "s" + empty: "'Default Value second'" + release: "20.04" + type: dconf + - displayname: Child Category Display Name in User + parent: "" + policies: + - key: Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-user + explaintext: |- + description user + + - Type: dconf + - Key: org/gnome/desktop/policy-user + - Default: 'Default Value user' + Note: default system value is used for "Not Configured" and enforced if "Disabled". + + Supported on Ubuntu 20.04 + metaenabled: '{"20.04":{"empty":"''''","meta":"s"},"all":{"empty":"''''","meta":"s"}}' + metadisabled: '{"20.04":{"meta":"s"},"all":{"meta":"s"}}' + class: User + releaseselements: + all: + key: /org/gnome/desktop/policy-user + displayname: summary user + explaintext: description user + elementtype: text + meta: + default: "''" + meta: "s" + empty: "'Default Value user'" + release: "20.04" + type: dconf + - displayname: Empty category + parent: "" diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/nested categories.yaml b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/nested categories.yaml new file mode 100644 index 000000000..2bfdd2270 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/nested categories.yaml @@ -0,0 +1,58 @@ +- displayname: Parent Category Display Name + parent: ubuntu:Desktop + policies: + - key: Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-first + explaintext: |- + description first + + - Type: dconf + - Key: org/gnome/desktop/policy-first + - Default: 'Default Value first' + Note: default system value is used for "Not Configured" and enforced if "Disabled". + + Supported on Ubuntu 20.04 + metaenabled: '{"20.04":{"empty":"''''","meta":"s"},"all":{"empty":"''''","meta":"s"}}' + metadisabled: '{"20.04":{"meta":"s"},"all":{"meta":"s"}}' + class: Machine + releaseselements: + all: + key: /org/gnome/desktop/policy-first + displayname: summary first + explaintext: description first + elementtype: text + meta: + empty: '''''' + meta: "s" + default: '''Default Value first''' + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "20.04" + type: dconf + children: + - displayname: Child Category Display Name + parent: "" + policies: + - key: Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-second + explaintext: |- + description second + + - Type: dconf + - Key: org/gnome/desktop/policy-second + - Default: 'Default Value second' + Note: default system value is used for "Not Configured" and enforced if "Disabled". + + Supported on Ubuntu 20.04 + metaenabled: '{"20.04":{"empty":"''''","meta":"s"},"all":{"empty":"''''","meta":"s"}}' + metadisabled: '{"20.04":{"meta":"s"},"all":{"meta":"s"}}' + class: Machine + releaseselements: + all: + key: /org/gnome/desktop/policy-second + displayname: summary second + explaintext: description second + elementtype: text + meta: + default: '''''' + meta: "s" + empty: '''Default Value second''' + release: "20.04" + type: dconf diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/no meta at all.yaml b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/no meta at all.yaml new file mode 100644 index 000000000..c74cb9716 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/no meta at all.yaml @@ -0,0 +1,29 @@ +- displayname: Category1 Display Name + parent: ubuntu:Desktop + policies: + - key: Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple + explaintext: |- + description + + - Type: dconf + - Key: org/gnome/desktop/policy-simple + - Default: 'Default Value' + Note: default system value is used for "Not Configured" and enforced if "Disabled". + + Supported on Ubuntu 20.04 + metaenabled: '{"20.04":{},"all":{}}' + metadisabled: '{"20.04":{},"all":{}}' + class: Machine + releaseselements: + all: + key: /org/gnome/desktop/policy-simple + displayname: summary + explaintext: description + elementtype: text + meta: + empty: '''''' + meta: "s" + default: '''Default Value''' + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "20.04" + type: dconf diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/no meta disabled.yaml b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/no meta disabled.yaml new file mode 100644 index 000000000..b8f545bf4 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/no meta disabled.yaml @@ -0,0 +1,29 @@ +- displayname: Category1 Display Name + parent: ubuntu:Desktop + policies: + - key: Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple + explaintext: |- + description + + - Type: dconf + - Key: org/gnome/desktop/policy-simple + - Default: 'Default Value' + Note: default system value is used for "Not Configured" and enforced if "Disabled". + + Supported on Ubuntu 20.04 + metaenabled: '{"20.04":{"empty":"''''","meta":"s"},"all":{"empty":"''''","meta":"s"}}' + metadisabled: '{"20.04":{},"all":{}}' + class: Machine + releaseselements: + all: + key: /org/gnome/desktop/policy-simple + displayname: summary + explaintext: description + elementtype: text + meta: + empty: '''''' + meta: "s" + default: '''Default Value''' + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "20.04" + type: dconf diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/no meta enabled.yaml b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/no meta enabled.yaml new file mode 100644 index 000000000..7821276d7 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/no meta enabled.yaml @@ -0,0 +1,29 @@ +- displayname: Category1 Display Name + parent: ubuntu:Desktop + policies: + - key: Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple + explaintext: |- + description + + - Type: dconf + - Key: org/gnome/desktop/policy-simple + - Default: 'Default Value' + Note: default system value is used for "Not Configured" and enforced if "Disabled". + + Supported on Ubuntu 20.04 + metaenabled: '{"20.04":{},"all":{}}' + metadisabled: '{"20.04":{"meta":"s"},"all":{"meta":"s"}}' + class: Machine + releaseselements: + all: + key: /org/gnome/desktop/policy-simple + displayname: summary + explaintext: description + elementtype: text + meta: + empty: '''''' + meta: "s" + default: '''Default Value''' + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "20.04" + type: dconf diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/other distro.yaml b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/other distro.yaml new file mode 100644 index 000000000..3e7fbc550 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/other distro.yaml @@ -0,0 +1,29 @@ +- displayname: Category1 Display Name + parent: ubuntu:Desktop + policies: + - key: Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple + explaintext: |- + description + + - Type: dconf + - Key: org/gnome/desktop/policy-simple + - Default: 'Default Value' + Note: default system value is used for "Not Configured" and enforced if "Disabled". + + Supported on Debian sid + metaenabled: '{"sid":{"empty":"''''","meta":"s"},"all":{"empty":"''''","meta":"s"}}' + metadisabled: '{"sid":{"meta":"s"},"all":{"meta":"s"}}' + class: Machine + releaseselements: + all: + key: /org/gnome/desktop/policy-simple + displayname: summary + explaintext: description + elementtype: text + meta: + empty: '''''' + meta: "s" + default: '''Default Value''' + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "sid" + type: dconf diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/simple.yaml b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/simple.yaml new file mode 100644 index 000000000..448f4c120 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/simple.yaml @@ -0,0 +1,29 @@ +- displayname: Category1 Display Name + parent: ubuntu:Desktop + policies: + - key: Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple + explaintext: |- + description + + - Type: dconf + - Key: org/gnome/desktop/policy-simple + - Default: 'Default Value' + Note: default system value is used for "Not Configured" and enforced if "Disabled". + + Supported on Ubuntu 20.04 + metaenabled: '{"20.04":{"empty":"''''","meta":"s"},"all":{"empty":"''''","meta":"s"}}' + metadisabled: '{"20.04":{"meta":"s"},"all":{"meta":"s"}}' + class: Machine + releaseselements: + all: + key: /org/gnome/desktop/policy-simple + displayname: summary + explaintext: description + elementtype: text + meta: + empty: '''''' + meta: "s" + default: '''Default Value''' + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "20.04" + type: dconf diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/user policy.yaml b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/user policy.yaml new file mode 100644 index 000000000..2e97f85e7 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/defs/user policy.yaml @@ -0,0 +1,29 @@ +- displayname: Category1 Display Name + parent: ubuntu:Desktop + policies: + - key: Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple + explaintext: |- + description + + - Type: dconf + - Key: org/gnome/desktop/policy-simple + - Default: 'Default Value' + Note: default system value is used for "Not Configured" and enforced if "Disabled". + + Supported on Ubuntu 20.04 + metaenabled: '{"20.04":{"empty":"''''","meta":"s"},"all":{"empty":"''''","meta":"s"}}' + metadisabled: '{"20.04":{"meta":"s"},"all":{"meta":"s"}}' + class: User + releaseselements: + all: + key: /org/gnome/desktop/policy-simple + displayname: summary + explaintext: description + elementtype: text + meta: + empty: "''" + meta: "s" + default: "'Default Value'" + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "20.04" + type: dconf diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/array_of_integers/Computer Policies/Category1 Display Name/policy-simple.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/array_of_integers/Computer Policies/Category1 Display Name/policy-simple.md new file mode 100644 index 000000000..3ddb533a8 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/array_of_integers/Computer Policies/Category1 Display Name/policy-simple.md @@ -0,0 +1,20 @@ +# summary + +description + +- Type: dconf +- Key: org/gnome/desktop/policy-array-decimal +- Default: `[1, 2]` +Note: default system value is used for "Not Configured" and enforced if "Disabled". + +Supported on Ubuntu 20.04 + + + +## Metadata + +| Element | Value | +| --- | --- | +| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-array-decimal | +| Element type | multiText | +| Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/array_of_strings/Computer Policies/Category1 Display Name/policy-simple.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/array_of_strings/Computer Policies/Category1 Display Name/policy-simple.md new file mode 100644 index 000000000..568234d10 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/array_of_strings/Computer Policies/Category1 Display Name/policy-simple.md @@ -0,0 +1,20 @@ +# summary + +description + +- Type: dconf +- Key: org/gnome/desktop/policy-array-string +- Default: `['Value1', 'Value2']` +Note: default system value is used for "Not Configured" and enforced if "Disabled". + +Supported on Ubuntu 20.04 + + + +## Metadata + +| Element | Value | +| --- | --- | +| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-array-string | +| Element type | multiText | +| Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/basic_key/Computer Policies/Category1 Display Name/no-options.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/basic_key/Computer Policies/Category1 Display Name/no-options.md new file mode 100644 index 000000000..80ed7b860 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/basic_key/Computer Policies/Category1 Display Name/no-options.md @@ -0,0 +1,16 @@ +# summary + +description + +- Type: privilege +- Key: /no-options + + + +## Metadata + +| Element | Value | +| --- | --- | +| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-no-options | +| Element type | | +| Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/boolean/Computer Policies/Category1 Display Name/policy-simple.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/boolean/Computer Policies/Category1 Display Name/policy-simple.md new file mode 100644 index 000000000..cc7af12ff --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/boolean/Computer Policies/Category1 Display Name/policy-simple.md @@ -0,0 +1,20 @@ +# summary + +description + +- Type: dconf +- Key: org/gnome/desktop/policy-boolean +- Default: true +Note: default system value is used for "Not Configured" and enforced if "Disabled". + +Supported on Ubuntu 20.04 + + + +## Metadata + +| Element | Value | +| --- | --- | +| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-boolean | +| Element type | boolean | +| Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/choices/Computer Policies/Category1 Display Name/policy-simple.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/choices/Computer Policies/Category1 Display Name/policy-simple.md new file mode 100644 index 000000000..7ec21d0f3 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/choices/Computer Policies/Category1 Display Name/policy-simple.md @@ -0,0 +1,26 @@ +# summary + +description + +- Type: dconf +- Key: org/gnome/desktop/policy-choices +- Default: Choice 1 +Note: default system value is used for "Not Configured" and enforced if "Disabled". + +Supported on Ubuntu 20.04 + +## Valid values + +* Choice 1 +* Choice 2 +* Choice 3 +* Choice 4 + + +## Metadata + +| Element | Value | +| --- | --- | +| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-choices | +| Element type | dropdownList | +| Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/choices_with_default/Computer Policies/Category1 Display Name/policy-simple.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/choices_with_default/Computer Policies/Category1 Display Name/policy-simple.md new file mode 100644 index 000000000..713f85a97 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/choices_with_default/Computer Policies/Category1 Display Name/policy-simple.md @@ -0,0 +1,28 @@ +# summary + +description + +- Type: dconf +- Key: org/gnome/desktop/policy-choices +- Default for 20.04: Choice 3 +- Default for 18.04: Choice 2 +- Default for 16.04: Unmatched default +Note: default system value is used for "Not Configured" and enforced if "Disabled". + +Supported on Ubuntu 20.04, 18.04 + +## Valid values + +* Choice 1 +* Choice 2 +* Choice 3 +* Choice 4 + + +## Metadata + +| Element | Value | +| --- | --- | +| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-choices | +| Element type | dropdownList | +| Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/decimal/Computer Policies/Category1 Display Name/policy-decimal.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/decimal/Computer Policies/Category1 Display Name/policy-decimal.md new file mode 100644 index 000000000..c9b756de0 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/decimal/Computer Policies/Category1 Display Name/policy-decimal.md @@ -0,0 +1,20 @@ +# summary + +description + +- Type: dconf +- Key: org/gnome/desktop/policy-decimal +- Default: 42 +Note: default system value is used for "Not Configured" and enforced if "Disabled". + +Supported on Ubuntu 20.04 + + + +## Metadata + +| Element | Value | +| --- | --- | +| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-decimal | +| Element type | decimal | +| Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/decimal_with_max_only/Computer Policies/Category1 Display Name/policy-decimal-with-range.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/decimal_with_max_only/Computer Policies/Category1 Display Name/policy-decimal-with-range.md new file mode 100644 index 000000000..08df1987a --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/decimal_with_max_only/Computer Policies/Category1 Display Name/policy-decimal-with-range.md @@ -0,0 +1,25 @@ +# summary + +description + +- Type: dconf +- Key: org/gnome/desktop/policy-decimal-with-range +- Default: 42 +Note: default system value is used for "Not Configured" and enforced if "Disabled". + +Supported on Ubuntu 20.04 + +## Valid range + +* Min: +* Max: 15000.000000 + + + +## Metadata + +| Element | Value | +| --- | --- | +| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-decimal-with-range | +| Element type | decimal | +| Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/decimal_with_min_only/Computer Policies/Category1 Display Name/policy-decimal-with-range.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/decimal_with_min_only/Computer Policies/Category1 Display Name/policy-decimal-with-range.md new file mode 100644 index 000000000..2e633aed2 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/decimal_with_min_only/Computer Policies/Category1 Display Name/policy-decimal-with-range.md @@ -0,0 +1,25 @@ +# summary + +description + +- Type: dconf +- Key: org/gnome/desktop/policy-decimal-with-range +- Default: 42 +Note: default system value is used for "Not Configured" and enforced if "Disabled". + +Supported on Ubuntu 20.04 + +## Valid range + +* Min: -123.000000 +* Max: + + + +## Metadata + +| Element | Value | +| --- | --- | +| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-decimal-with-range | +| Element type | decimal | +| Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/decimal_with_range/Computer Policies/Category1 Display Name/policy-decimal-with-range.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/decimal_with_range/Computer Policies/Category1 Display Name/policy-decimal-with-range.md new file mode 100644 index 000000000..071c584d7 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/decimal_with_range/Computer Policies/Category1 Display Name/policy-decimal-with-range.md @@ -0,0 +1,25 @@ +# summary + +description + +- Type: dconf +- Key: org/gnome/desktop/policy-decimal-with-range +- Default: 42 +Note: default system value is used for "Not Configured" and enforced if "Disabled". + +Supported on Ubuntu 20.04 + +## Valid range + +* Min: -123.000000 +* Max: 15000.000000 + + + +## Metadata + +| Element | Value | +| --- | --- | +| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-decimal-with-range | +| Element type | decimal | +| Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/double/Computer Policies/Category1 Display Name/policy-double.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/double/Computer Policies/Category1 Display Name/policy-double.md new file mode 100644 index 000000000..c45f2bf1a --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/double/Computer Policies/Category1 Display Name/policy-double.md @@ -0,0 +1,20 @@ +# summary + +description + +- Type: dconf +- Key: org/gnome/desktop/policy-double +- Default: 123.456 +Note: default system value is used for "Not Configured" and enforced if "Disabled". + +Supported on Ubuntu 20.04 + + + +## Metadata + +| Element | Value | +| --- | --- | +| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-double | +| Element type | text | +| Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/double_with_range/Computer Policies/Category1 Display Name/policy-double.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/double_with_range/Computer Policies/Category1 Display Name/policy-double.md new file mode 100644 index 000000000..233df31bf --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/double_with_range/Computer Policies/Category1 Display Name/policy-double.md @@ -0,0 +1,25 @@ +# summary + +description + +- Type: dconf +- Key: org/gnome/desktop/policy-double +- Default: 123.456 +Note: default system value is used for "Not Configured" and enforced if "Disabled". + +Supported on Ubuntu 20.04 + +## Valid range + +* Min: 123.000000 +* Max: 15000.000000 + + + +## Metadata + +| Element | Value | +| --- | --- | +| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-double | +| Element type | text | +| Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/long_decimal/Computer Policies/Category1 Display Name/policy-long-decimal.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/long_decimal/Computer Policies/Category1 Display Name/policy-long-decimal.md new file mode 100644 index 000000000..de5d71ab1 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/long_decimal/Computer Policies/Category1 Display Name/policy-long-decimal.md @@ -0,0 +1,20 @@ +# summary + +description + +- Type: dconf +- Key: org/gnome/desktop/policy-long-decimal +- Default: 42 +Note: default system value is used for "Not Configured" and enforced if "Disabled". + +Supported on Ubuntu 20.04 + + + +## Metadata + +| Element | Value | +| --- | --- | +| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-long-decimal | +| Element type | longDecimal | +| Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_categories/Computer Policies/Category1 Display Name/policy-multiple1.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_categories/Computer Policies/Category1 Display Name/policy-multiple1.md new file mode 100644 index 000000000..558b18155 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_categories/Computer Policies/Category1 Display Name/policy-multiple1.md @@ -0,0 +1,18 @@ +# summary 1 + +description 1 + +- Type: dconf +- Key: org/gnome/desktop/policy-multiple1 +- Default: 'Default Value 1' +Note: default system value is used for "Not Configured" and enforced if "Disabled". + + + +## Metadata + +| Element | Value | +| --- | --- | +| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-multiple1 | +| Element type | text | +| Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_categories/Computer Policies/Category2 Display Name/policy-multiple2.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_categories/Computer Policies/Category2 Display Name/policy-multiple2.md new file mode 100644 index 000000000..51200ae1a --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_categories/Computer Policies/Category2 Display Name/policy-multiple2.md @@ -0,0 +1,18 @@ +# summary 2 + +description 2 + +- Type: dconf +- Key: org/gnome/desktop/policy-multiple2 +- Default: 'Default Value 2' +Note: default system value is used for "Not Configured" and enforced if "Disabled". + + + +## Metadata + +| Element | Value | +| --- | --- | +| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-multiple2 | +| Element type | text | +| Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_for_one_key/Computer Policies/Category1 Display Name/policy-simple.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_for_one_key/Computer Policies/Category1 Display Name/policy-simple.md new file mode 100644 index 000000000..ca399f7a1 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_for_one_key/Computer Policies/Category1 Display Name/policy-simple.md @@ -0,0 +1,20 @@ +# summary + +description + +- Type: dconf +- Key: org/gnome/desktop/policy-simple +- Default: 'Default Value' +Note: default system value is used for "Not Configured" and enforced if "Disabled". + +Supported on Ubuntu 20.04, 18.04 + + + +## Metadata + +| Element | Value | +| --- | --- | +| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple | +| Element type | text | +| Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_with_all_widgets_and_different_defaults/Computer Policies/Category1 Display Name/policy-simple.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_with_all_widgets_and_different_defaults/Computer Policies/Category1 Display Name/policy-simple.md new file mode 100644 index 000000000..c5a00bfac --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_with_all_widgets_and_different_defaults/Computer Policies/Category1 Display Name/policy-simple.md @@ -0,0 +1,26 @@ +# summary + +description + +- Type: dconf +- Key: org/gnome/desktop/policy-simple +- Default for textrelease: text default +- Default for multitextrelease: multitext default +- Default for longdecimalrelease: 2020 +- Default for dropdownlistrelease: Choice 1 +- Default for decimalrelease: 20 +- Default for booleanrelease: 'true' + +Note: default system value is used for "Not Configured" and enforced if "Disabled". + +Supported on Ubuntu textrelease, multitextrelease, longdecimalrelease, dropdownlistrelease, decimalrelease, booleanrelease + + + +## Metadata + +| Element | Value | +| --- | --- | +| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple | +| Element type | text | +| Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_with_different_choices/Computer Policies/Category1 Display Name/policy-simple.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_with_different_choices/Computer Policies/Category1 Display Name/policy-simple.md new file mode 100644 index 000000000..9ab25594a --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_with_different_choices/Computer Policies/Category1 Display Name/policy-simple.md @@ -0,0 +1,28 @@ +# summary + +description + +- Type: dconf +- Key: org/gnome/desktop/policy-simple +- Default for 20.04: Choice 11 +- Default for 18.04: Choice 22 + +Note: default system value is used for "Not Configured" and enforced if "Disabled". + +Supported on Ubuntu 20.04, 18.04 + +## Valid values + +* Choice 11 +* Choice 12 +* Choice 13 +* Choice 14 + + +## Metadata + +| Element | Value | +| --- | --- | +| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple | +| Element type | dropdownList | +| Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_with_different_ranges/Computer Policies/Category1 Display Name/policy-simple.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_with_different_ranges/Computer Policies/Category1 Display Name/policy-simple.md new file mode 100644 index 000000000..7e80c1970 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_with_different_ranges/Computer Policies/Category1 Display Name/policy-simple.md @@ -0,0 +1,27 @@ +# summary + +description + +- Type: dconf +- Key: org/gnome/desktop/policy-simple +- Default for 20.04: 20 +- Default for 18.04: 18 + +Note: default system value is used for "Not Configured" and enforced if "Disabled". + +Supported on Ubuntu 20.04, 18.04 + +## Valid range + +* Min: -20.000000 +* Max: 20.000000 + + + +## Metadata + +| Element | Value | +| --- | --- | +| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple | +| Element type | decimal | +| Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_with_different_widgettype/Computer Policies/Category1 Display Name/policy-simple.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_with_different_widgettype/Computer Policies/Category1 Display Name/policy-simple.md new file mode 100644 index 000000000..332bb3283 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_with_different_widgettype/Computer Policies/Category1 Display Name/policy-simple.md @@ -0,0 +1,22 @@ +# summary + +description + +- Type: dconf +- Key: org/gnome/desktop/policy-simple +- Default for 20.04: 'Default Value' +- Default for 18.04: true + +Note: default system value is used for "Not Configured" and enforced if "Disabled". + +Supported on Ubuntu 20.04, 18.04 + + + +## Metadata + +| Element | Value | +| --- | --- | +| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple | +| Element type | text | +| Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/Computer Policies/Parent Category Display Name/Category with User and Computer/policy-child-computer.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/Computer Policies/Parent Category Display Name/Category with User and Computer/policy-child-computer.md new file mode 100644 index 000000000..7941a0555 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/Computer Policies/Parent Category Display Name/Category with User and Computer/policy-child-computer.md @@ -0,0 +1,20 @@ +# summary child computer + +description child computer + +- Type: dconf +- Key: org/gnome/desktop/policy-child-computer +- Default: 'Default Value computer' + Note: default system value is used for "Not Configured" and enforced if "Disabled". + +Supported on Ubuntu 20.04 + + + +## Metadata + +| Element | Value | +| --- | --- | +| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-child-computer | +| Element type | text | +| Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/Computer Policies/Parent Category Display Name/Child Category Display Name Computer/policy-computer.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/Computer Policies/Parent Category Display Name/Child Category Display Name Computer/policy-computer.md new file mode 100644 index 000000000..d63ce2a94 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/Computer Policies/Parent Category Display Name/Child Category Display Name Computer/policy-computer.md @@ -0,0 +1,20 @@ +# summary computer + +description computer + +- Type: dconf +- Key: org/gnome/desktop/policy-computer +- Default: 'Default Value computer' + Note: default system value is used for "Not Configured" and enforced if "Disabled". + +Supported on Ubuntu 20.04 + + + +## Metadata + +| Element | Value | +| --- | --- | +| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-computer | +| Element type | text | +| Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/Computer Policies/Parent Category Display Name/policy-first.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/Computer Policies/Parent Category Display Name/policy-first.md new file mode 100644 index 000000000..b00354a6a --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/Computer Policies/Parent Category Display Name/policy-first.md @@ -0,0 +1,20 @@ +# summary first + +description first + +- Type: dconf +- Key: org/gnome/desktop/policy-first +- Default: 'Default Value first' +Note: default system value is used for "Not Configured" and enforced if "Disabled". + +Supported on Ubuntu 20.04 + + + +## Metadata + +| Element | Value | +| --- | --- | +| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-first | +| Element type | text | +| Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/User Policies/Parent Category Display Name/Category with User and Computer/policy-child-user.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/User Policies/Parent Category Display Name/Category with User and Computer/policy-child-user.md new file mode 100644 index 000000000..a33181e62 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/User Policies/Parent Category Display Name/Category with User and Computer/policy-child-user.md @@ -0,0 +1,20 @@ +# summary computer + +description child user + +- Type: dconf +- Key: org/gnome/desktop/policy-child-user +- Default: 'Default Value child user' + Note: default system value is used for "Not Configured" and enforced if "Disabled". + +Supported on Ubuntu 20.04 + + + +## Metadata + +| Element | Value | +| --- | --- | +| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-child-user | +| Element type | text | +| Class: | User | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/User Policies/Parent Category Display Name/Child Category Display Name in User/policy-user.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/User Policies/Parent Category Display Name/Child Category Display Name in User/policy-user.md new file mode 100644 index 000000000..d535f4549 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/User Policies/Parent Category Display Name/Child Category Display Name in User/policy-user.md @@ -0,0 +1,20 @@ +# summary user + +description user + +- Type: dconf +- Key: org/gnome/desktop/policy-user +- Default: 'Default Value user' + Note: default system value is used for "Not Configured" and enforced if "Disabled". + +Supported on Ubuntu 20.04 + + + +## Metadata + +| Element | Value | +| --- | --- | +| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-user | +| Element type | text | +| Class: | User | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories/Computer Policies/Parent Category Display Name/Child Category Display Name/policy-second.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories/Computer Policies/Parent Category Display Name/Child Category Display Name/policy-second.md new file mode 100644 index 000000000..774c81ebc --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories/Computer Policies/Parent Category Display Name/Child Category Display Name/policy-second.md @@ -0,0 +1,20 @@ +# summary second + +description second + +- Type: dconf +- Key: org/gnome/desktop/policy-second +- Default: 'Default Value second' + Note: default system value is used for "Not Configured" and enforced if "Disabled". + +Supported on Ubuntu 20.04 + + + +## Metadata + +| Element | Value | +| --- | --- | +| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-second | +| Element type | text | +| Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories/Computer Policies/Parent Category Display Name/policy-first.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories/Computer Policies/Parent Category Display Name/policy-first.md new file mode 100644 index 000000000..b00354a6a --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories/Computer Policies/Parent Category Display Name/policy-first.md @@ -0,0 +1,20 @@ +# summary first + +description first + +- Type: dconf +- Key: org/gnome/desktop/policy-first +- Default: 'Default Value first' +Note: default system value is used for "Not Configured" and enforced if "Disabled". + +Supported on Ubuntu 20.04 + + + +## Metadata + +| Element | Value | +| --- | --- | +| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-first | +| Element type | text | +| Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/no_meta_at_all/Computer Policies/Category1 Display Name/policy-simple.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/no_meta_at_all/Computer Policies/Category1 Display Name/policy-simple.md new file mode 100644 index 000000000..8a12c856d --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/no_meta_at_all/Computer Policies/Category1 Display Name/policy-simple.md @@ -0,0 +1,20 @@ +# summary + +description + +- Type: dconf +- Key: org/gnome/desktop/policy-simple +- Default: 'Default Value' +Note: default system value is used for "Not Configured" and enforced if "Disabled". + +Supported on Ubuntu 20.04 + + + +## Metadata + +| Element | Value | +| --- | --- | +| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple | +| Element type | text | +| Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/no_meta_disabled/Computer Policies/Category1 Display Name/policy-simple.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/no_meta_disabled/Computer Policies/Category1 Display Name/policy-simple.md new file mode 100644 index 000000000..8a12c856d --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/no_meta_disabled/Computer Policies/Category1 Display Name/policy-simple.md @@ -0,0 +1,20 @@ +# summary + +description + +- Type: dconf +- Key: org/gnome/desktop/policy-simple +- Default: 'Default Value' +Note: default system value is used for "Not Configured" and enforced if "Disabled". + +Supported on Ubuntu 20.04 + + + +## Metadata + +| Element | Value | +| --- | --- | +| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple | +| Element type | text | +| Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/no_meta_enabled/Computer Policies/Category1 Display Name/policy-simple.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/no_meta_enabled/Computer Policies/Category1 Display Name/policy-simple.md new file mode 100644 index 000000000..8a12c856d --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/no_meta_enabled/Computer Policies/Category1 Display Name/policy-simple.md @@ -0,0 +1,20 @@ +# summary + +description + +- Type: dconf +- Key: org/gnome/desktop/policy-simple +- Default: 'Default Value' +Note: default system value is used for "Not Configured" and enforced if "Disabled". + +Supported on Ubuntu 20.04 + + + +## Metadata + +| Element | Value | +| --- | --- | +| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple | +| Element type | text | +| Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/simple/Computer Policies/Category1 Display Name/policy-simple.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/simple/Computer Policies/Category1 Display Name/policy-simple.md new file mode 100644 index 000000000..8a12c856d --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/simple/Computer Policies/Category1 Display Name/policy-simple.md @@ -0,0 +1,20 @@ +# summary + +description + +- Type: dconf +- Key: org/gnome/desktop/policy-simple +- Default: 'Default Value' +Note: default system value is used for "Not Configured" and enforced if "Disabled". + +Supported on Ubuntu 20.04 + + + +## Metadata + +| Element | Value | +| --- | --- | +| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple | +| Element type | text | +| Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/user_policy/User Policies/Category1 Display Name/policy-simple.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/user_policy/User Policies/Category1 Display Name/policy-simple.md new file mode 100644 index 000000000..e8ad8eb6f --- /dev/null +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/user_policy/User Policies/Category1 Display Name/policy-simple.md @@ -0,0 +1,20 @@ +# summary + +description + +- Type: dconf +- Key: org/gnome/desktop/policy-simple +- Default: 'Default Value' +Note: default system value is used for "Not Configured" and enforced if "Disabled". + +Supported on Ubuntu 20.04 + + + +## Metadata + +| Element | Value | +| --- | --- | +| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple | +| Element type | text | +| Class: | User | From 0aabfe23b8c2cf68c5a2f4a68a09680c765711cd Mon Sep 17 00:00:00 2001 From: Didier Roche Date: Wed, 15 Nov 2023 09:05:27 +0100 Subject: [PATCH 05/11] Entry point for generating policy documentation This collects any policies and then call our generation code. --- internal/ad/admxgen/files.go | 38 ++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/internal/ad/admxgen/files.go b/internal/ad/admxgen/files.go index fce8d9dcc..58f7efd23 100644 --- a/internal/ad/admxgen/files.go +++ b/internal/ad/admxgen/files.go @@ -159,6 +159,44 @@ func GenerateAD(categoryDefinition, src, dst string, autoDetectReleases, allowMi return nil } +// GenerateDoc creates and merge all policies into documentation files. +func GenerateDoc(categoryDefinition, src, dst string) error { + // Load all expanded categories + policies, catfs, err := loadDefinitions(categoryDefinition, src) + if err != nil { + return err + } + + // Collect supported releases + var supportedReleases []string + files, err := os.ReadDir(src) + if err != nil { + return fmt.Errorf("can't read source directory: %w", err) + } + for _, f := range files { + if !strings.HasSuffix(f.Name(), ".yaml") { + continue + } + n := strings.TrimSuffix(f.Name(), ".yaml") + supportedReleases = append(supportedReleases, n) + } + + g := generator{ + distroID: catfs.DistroID, + supportedReleases: supportedReleases, + } + ec, err := g.generateExpandedCategories(catfs.Categories, policies, false) + if err != nil { + return err + } + err = expandedCategoriesToMD(ec, dst, ".") + if err != nil { + return err + } + + return nil +} + func loadDefinitions(categoryDefinition, src string) (ep []common.ExpandedPolicy, cfs categoryFileStruct, err error) { defer decorate.OnError(&err, i18n.G("can't load category definition")) From 2ddec9ce424a25f88219c69d515d438074923b63 Mon Sep 17 00:00:00 2001 From: Didier Roche Date: Wed, 15 Nov 2023 09:06:14 +0100 Subject: [PATCH 06/11] Tests for generation policy documentation High level tests, similar to GenerateAD tests, to collect and bootstrap documentation generation. --- internal/ad/admxgen/admxgen_test.go | 46 +++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/internal/ad/admxgen/admxgen_test.go b/internal/ad/admxgen/admxgen_test.go index e4f951bfd..a009c39fe 100644 --- a/internal/ad/admxgen/admxgen_test.go +++ b/internal/ad/admxgen/admxgen_test.go @@ -142,3 +142,49 @@ func TestGenerateAD(t *testing.T) { }) } } + +func TestGenerateDoc(t *testing.T) { + t.Parallel() + + tests := map[string]struct { + autoDetectReleases bool + destIsFile bool + + wantErr bool + }{ + "releases from yaml": {}, + "autodetect overrides releases from yaml": {autoDetectReleases: true}, + + // Error cases + "invalid definition file": {wantErr: true}, + "category expansion fails": {wantErr: true}, + "doc generation fails": {destIsFile: true, wantErr: true}, + } + for name, tc := range tests { + name := name + + tc := tc + t.Run(name, func(t *testing.T) { + t.Parallel() + + catDef := filepath.Join(testutils.TestFamilyPath(t), name+".yaml") + src := filepath.Join(testutils.TestFamilyPath(t), "src") + dst := filepath.Join(t.TempDir(), "subdir") + + if tc.destIsFile { + f, err := os.Create(dst) + f.Close() + require.NoError(t, err, "Setup: should create a file as destination") + } + + err := admxgen.GenerateDoc(catDef, src, dst) + if tc.wantErr { + require.Error(t, err, "GenerateDoc should have errored out") + return + } + require.NoError(t, err, "GenerateDoc failed but shouldn't have") + + testutils.CompareTreesWithFiltering(t, dst, testutils.GoldenPath(t), testutils.Update()) + }) + } +} From 38b6175bce3e78238ad35bc533fbeb39561694df Mon Sep 17 00:00:00 2001 From: Didier Roche Date: Wed, 15 Nov 2023 09:07:02 +0100 Subject: [PATCH 07/11] Fixtures and golden files for generating policy documentation Accompagning fixutres and golden files for generation policy documentation code. --- ...todetect overrides releases from yaml.yaml | 9 ++++++++ .../category expansion fails.yaml | 9 ++++++++ .../TestGenerateDoc/doc generation fails.yaml | 9 ++++++++ .../simple-text-property.md | 21 +++++++++++++++++++ .../simple-text-property.md | 21 +++++++++++++++++++ .../TestGenerateDoc/releases from yaml.yaml | 10 +++++++++ .../testdata/TestGenerateDoc/src/20.04.yaml | 12 +++++++++++ .../testdata/TestGenerateDoc/src/21.04.yaml | 14 +++++++++++++ .../testdata/TestGenerateDoc/src/21.10.yaml | 17 +++++++++++++++ .../TestGenerateDoc/src/nonreleasefile | 12 +++++++++++ 10 files changed, 134 insertions(+) create mode 100644 internal/ad/admxgen/testdata/TestGenerateDoc/autodetect overrides releases from yaml.yaml create mode 100644 internal/ad/admxgen/testdata/TestGenerateDoc/category expansion fails.yaml create mode 100644 internal/ad/admxgen/testdata/TestGenerateDoc/doc generation fails.yaml create mode 100644 internal/ad/admxgen/testdata/TestGenerateDoc/golden/autodetect_overrides_releases_from_yaml/Computer Policies/Category1 Display Name/simple-text-property.md create mode 100644 internal/ad/admxgen/testdata/TestGenerateDoc/golden/releases_from_yaml/Computer Policies/Category1 Display Name/simple-text-property.md create mode 100644 internal/ad/admxgen/testdata/TestGenerateDoc/releases from yaml.yaml create mode 100644 internal/ad/admxgen/testdata/TestGenerateDoc/src/20.04.yaml create mode 100644 internal/ad/admxgen/testdata/TestGenerateDoc/src/21.04.yaml create mode 100644 internal/ad/admxgen/testdata/TestGenerateDoc/src/21.10.yaml create mode 100644 internal/ad/admxgen/testdata/TestGenerateDoc/src/nonreleasefile diff --git a/internal/ad/admxgen/testdata/TestGenerateDoc/autodetect overrides releases from yaml.yaml b/internal/ad/admxgen/testdata/TestGenerateDoc/autodetect overrides releases from yaml.yaml new file mode 100644 index 000000000..d454d3e97 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestGenerateDoc/autodetect overrides releases from yaml.yaml @@ -0,0 +1,9 @@ +distroid: "Ubuntu" +supportedreleases: + - 20.04 +categories: + - displayname: "Category1 Display Name" + parent: "ubuntu:Desktop" + defaultpolicyclass: "Machine" + policies: + - "/com/ubuntu/simple/simple-text-property" diff --git a/internal/ad/admxgen/testdata/TestGenerateDoc/category expansion fails.yaml b/internal/ad/admxgen/testdata/TestGenerateDoc/category expansion fails.yaml new file mode 100644 index 000000000..ba097ead2 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestGenerateDoc/category expansion fails.yaml @@ -0,0 +1,9 @@ +distroid: "Ubuntu" +supportedreleases: + - 20.04 +categories: + - displayname: "Category1 Display Name" + parent: "ubuntu:Desktop" + defaultpolicyclass: "Machine" + policies: + - "/key/does/not/exists" diff --git a/internal/ad/admxgen/testdata/TestGenerateDoc/doc generation fails.yaml b/internal/ad/admxgen/testdata/TestGenerateDoc/doc generation fails.yaml new file mode 100644 index 000000000..d454d3e97 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestGenerateDoc/doc generation fails.yaml @@ -0,0 +1,9 @@ +distroid: "Ubuntu" +supportedreleases: + - 20.04 +categories: + - displayname: "Category1 Display Name" + parent: "ubuntu:Desktop" + defaultpolicyclass: "Machine" + policies: + - "/com/ubuntu/simple/simple-text-property" diff --git a/internal/ad/admxgen/testdata/TestGenerateDoc/golden/autodetect_overrides_releases_from_yaml/Computer Policies/Category1 Display Name/simple-text-property.md b/internal/ad/admxgen/testdata/TestGenerateDoc/golden/autodetect_overrides_releases_from_yaml/Computer Policies/Category1 Display Name/simple-text-property.md new file mode 100644 index 000000000..0b85b9cd9 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestGenerateDoc/golden/autodetect_overrides_releases_from_yaml/Computer Policies/Category1 Display Name/simple-text-property.md @@ -0,0 +1,21 @@ +# simple-text-property summary + +simple-text-property description + +- Type: dconf +- Key: /com/ubuntu/simple/simple-text-property +- Default: simple-text-property Default Value + +Note: default system value is used for "Not Configured" and enforced if "Disabled". + +Supported on Ubuntu 20.04, 21.04, 21.10. + + + +## Metadata + +| Element | Value | +| --- | --- | +| Key | Software\Policies\Ubuntu\dconf\com\ubuntu\simple\simple-text-property | +| Element type | text | +| Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestGenerateDoc/golden/releases_from_yaml/Computer Policies/Category1 Display Name/simple-text-property.md b/internal/ad/admxgen/testdata/TestGenerateDoc/golden/releases_from_yaml/Computer Policies/Category1 Display Name/simple-text-property.md new file mode 100644 index 000000000..0b85b9cd9 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestGenerateDoc/golden/releases_from_yaml/Computer Policies/Category1 Display Name/simple-text-property.md @@ -0,0 +1,21 @@ +# simple-text-property summary + +simple-text-property description + +- Type: dconf +- Key: /com/ubuntu/simple/simple-text-property +- Default: simple-text-property Default Value + +Note: default system value is used for "Not Configured" and enforced if "Disabled". + +Supported on Ubuntu 20.04, 21.04, 21.10. + + + +## Metadata + +| Element | Value | +| --- | --- | +| Key | Software\Policies\Ubuntu\dconf\com\ubuntu\simple\simple-text-property | +| Element type | text | +| Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestGenerateDoc/releases from yaml.yaml b/internal/ad/admxgen/testdata/TestGenerateDoc/releases from yaml.yaml new file mode 100644 index 000000000..2af586a63 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestGenerateDoc/releases from yaml.yaml @@ -0,0 +1,10 @@ +distroid: "Ubuntu" +supportedreleases: + - 20.04 + - 21.10 +categories: + - displayname: "Category1 Display Name" + parent: "ubuntu:Desktop" + defaultpolicyclass: "Machine" + policies: + - "/com/ubuntu/simple/simple-text-property" diff --git a/internal/ad/admxgen/testdata/TestGenerateDoc/src/20.04.yaml b/internal/ad/admxgen/testdata/TestGenerateDoc/src/20.04.yaml new file mode 100644 index 000000000..d1b624fd7 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestGenerateDoc/src/20.04.yaml @@ -0,0 +1,12 @@ +- key: /com/ubuntu/simple/simple-text-property + displayname: simple-text-property summary + explaintext: simple-text-property description + elementtype: text + meta: + meta: "s" + empty: "''''" + class: "" + default: simple-text-property Default Value + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "20.04" + type: dconf diff --git a/internal/ad/admxgen/testdata/TestGenerateDoc/src/21.04.yaml b/internal/ad/admxgen/testdata/TestGenerateDoc/src/21.04.yaml new file mode 100644 index 000000000..836ad7402 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestGenerateDoc/src/21.04.yaml @@ -0,0 +1,14 @@ +- key: /com/ubuntu/simple/simple-text-property + displayname: simple-text-property summary + explaintext: simple-text-property description + elementtype: text + metaenabled: + meta: "s" + empty: "''''" + metadisabled: + meta: "other" + class: "" + default: simple-text-property Default Value + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "21.04" + type: dconf diff --git a/internal/ad/admxgen/testdata/TestGenerateDoc/src/21.10.yaml b/internal/ad/admxgen/testdata/TestGenerateDoc/src/21.10.yaml new file mode 100644 index 000000000..76ed7c17b --- /dev/null +++ b/internal/ad/admxgen/testdata/TestGenerateDoc/src/21.10.yaml @@ -0,0 +1,17 @@ +- key: /com/ubuntu/simple/simple-text-property + displayname: simple-text-property summary + explaintext: simple-text-property description + elementtype: text + meta: + meta: "s" + empty: "''''" + metaenabled: + meta: "i" + empty: "0" + metadisabled: + meta: "other" + class: "" + default: simple-text-property Default Value + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "21.10" + type: dconf diff --git a/internal/ad/admxgen/testdata/TestGenerateDoc/src/nonreleasefile b/internal/ad/admxgen/testdata/TestGenerateDoc/src/nonreleasefile new file mode 100644 index 000000000..e85396d89 --- /dev/null +++ b/internal/ad/admxgen/testdata/TestGenerateDoc/src/nonreleasefile @@ -0,0 +1,12 @@ +- key: /com/ubuntu/simple/simple-text-property + displayname: simple-text-property summary + explaintext: simple-text-property description + elementtype: text + meta: + meta: "s" + empty: "''''" + class: "" + default: simple-text-property Default Value + note: default system value is used for "Not Configured" and enforced if "Disabled". + release: "22.04" + type: dconf From c00794dda2443ff872d124731a118fb73e9dd2dc Mon Sep 17 00:00:00 2001 From: Didier Roche Date: Wed, 15 Nov 2023 09:08:28 +0100 Subject: [PATCH 08/11] Add "doc" subcommand to admxgen This new command generate policy documentation reference in destination directory. --- cmd/admxgen/main.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/cmd/admxgen/main.go b/cmd/admxgen/main.go index 84cf0d8f0..4142e4ae1 100644 --- a/cmd/admxgen/main.go +++ b/cmd/admxgen/main.go @@ -57,6 +57,10 @@ func main() { log.Error(err) os.Exit(2) } + if err := installDoc(&rootCmd, viper); err != nil { + log.Error(err) + os.Exit(2) + } if err := rootCmd.Execute(); err != nil { log.Error(err) @@ -107,6 +111,24 @@ func installAdmx(rootCmd *cobra.Command, viper *viper.Viper) error { return nil } +func installDoc(rootCmd *cobra.Command, viper *viper.Viper) error { + cmd := &cobra.Command{ + Use: "doc CATEGORIES_DEF.YAML SOURCE DEST", + Short: gotext.Get("Create markdown documentation"), + Long: gotext.Get("Collects all intermediary policy definition files in SOURCE directory to create markdown documentation in DEST, based on CATEGORIES_DEF.yaml."), + Args: cobra.ExactArgs(3), + RunE: func(cmd *cobra.Command, args []string) error { + return admxgen.GenerateDoc(args[0], args[1], args[2]) + }, + } + if err := bindFlags(viper, cmd.Flags()); err != nil { + return errors.New(gotext.Get("can't install command flag bindings: %v", err)) + } + + rootCmd.AddCommand(cmd) + return nil +} + // bindFlags each cobra flag in a flagset to its associated viper env, ignoring config // Compare to the viper automated binding, it translates - to _. func bindFlags(viper *viper.Viper, flags *pflag.FlagSet) (errBind error) { From 54bf36d5ad8f40f474d2881025da68cbc3ee1590 Mon Sep 17 00:00:00 2001 From: Didier Roche Date: Wed, 15 Nov 2023 15:20:17 +0100 Subject: [PATCH 09/11] Add key and location in metadata Those elements will expand to locate the registry key for the admin. --- internal/ad/admxgen/admxgen.go | 4 ++++ internal/ad/admxgen/docpolicy.md.template | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/ad/admxgen/admxgen.go b/internal/ad/admxgen/admxgen.go index 1f0b94148..0ec53159a 100644 --- a/internal/ad/admxgen/admxgen.go +++ b/internal/ad/admxgen/admxgen.go @@ -549,6 +549,7 @@ func expandedCategoriesToMD(expandedCategories []expandedCategory, rootDest stri polDetails := p.ReleasesElements["all"] input := struct { + Location string Key string DisplayName string ExplainText string @@ -558,6 +559,9 @@ func expandedCategoriesToMD(expandedCategories []expandedCategory, rootDest stri RangeValuesMax string Choices []string }{ + strings.ReplaceAll( + strings.TrimLeft(filepath.Join(dest, filepath.Base(polDetails.DisplayName)), rootDest), + "/", " -> "), p.Key, polDetails.DisplayName, strings.ReplaceAll( diff --git a/internal/ad/admxgen/docpolicy.md.template b/internal/ad/admxgen/docpolicy.md.template index 73c869e37..eecf67536 100644 --- a/internal/ad/admxgen/docpolicy.md.template +++ b/internal/ad/admxgen/docpolicy.md.template @@ -24,6 +24,7 @@ | Element | Value | | --- | --- | -| Key | {{.Key}} | +| Location | {{.Location}} | +| Registry Key | {{.Key}} | | Element type | {{.ElementType}} | | Class: | {{.Class}} | From d9e5821581e6749893e17556f97a0d7d93ab76e1 Mon Sep 17 00:00:00 2001 From: Didier Roche Date: Wed, 15 Nov 2023 15:22:00 +0100 Subject: [PATCH 10/11] Avoid making subsections as titles. Do not use title for metadata/range/valid values. Otherwise, when listing them in the toc, we will always end up with them listed at the same level than the other elements (subdirectories/subsections). --- internal/ad/admxgen/docpolicy.md.template | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/ad/admxgen/docpolicy.md.template b/internal/ad/admxgen/docpolicy.md.template index eecf67536..ce70411c2 100644 --- a/internal/ad/admxgen/docpolicy.md.template +++ b/internal/ad/admxgen/docpolicy.md.template @@ -4,7 +4,7 @@ {{ if or (ne .RangeValuesMin "") (ne .RangeValuesMax "") -}} -## Valid range +**Valid range** * Min: {{.RangeValuesMin}} * Max: {{.RangeValuesMax}} @@ -13,14 +13,14 @@ {{- if ne (len .Choices) 0 -}} -## Valid values +**Valid values** {{ range $i, $c := .Choices -}} * {{$c}} {{ end -}} {{- end }} -## Metadata +**Metadata** | Element | Value | | --- | --- | From c5d9e33f111b5f13ac75d9198972ea484c3d9adc Mon Sep 17 00:00:00 2001 From: Didier Roche Date: Wed, 15 Nov 2023 15:24:59 +0100 Subject: [PATCH 11/11] Regenerate golden files This includes existing retitle and path refiltering. --- .../Category1 Display Name/policy-simple.md | 5 +++-- .../Category1 Display Name/policy-simple.md | 5 +++-- .../Computer Policies/Category1 Display Name/no-options.md | 5 +++-- .../Category1 Display Name/policy-simple.md | 5 +++-- .../Category1 Display Name/policy-simple.md | 7 ++++--- .../Category1 Display Name/policy-simple.md | 7 ++++--- .../Category1 Display Name/policy-decimal.md | 5 +++-- .../Category1 Display Name/policy-decimal-with-range.md | 7 ++++--- .../Category1 Display Name/policy-decimal-with-range.md | 7 ++++--- .../Category1 Display Name/policy-decimal-with-range.md | 7 ++++--- .../Category1 Display Name/policy-double.md | 5 +++-- .../Category1 Display Name/policy-double.md | 7 ++++--- .../Category1 Display Name/policy-long-decimal.md | 5 +++-- .../Category1 Display Name/policy-multiple1.md | 5 +++-- .../Category2 Display Name/policy-multiple2.md | 5 +++-- .../Category1 Display Name/policy-simple.md | 5 +++-- .../Category1 Display Name/policy-simple.md | 5 +++-- .../Category1 Display Name/policy-simple.md | 7 ++++--- .../Category1 Display Name/policy-simple.md | 7 ++++--- .../Category1 Display Name/policy-simple.md | 5 +++-- .../policy-child-computer.md | 5 +++-- .../policy-computer.md | 5 +++-- .../Parent Category Display Name/policy-first.md | 5 +++-- .../Category with User and Computer/policy-child-user.md | 5 +++-- .../Child Category Display Name in User/policy-user.md | 5 +++-- .../Child Category Display Name/policy-second.md | 5 +++-- .../Parent Category Display Name/policy-first.md | 5 +++-- .../Category1 Display Name/policy-simple.md | 5 +++-- .../Category1 Display Name/policy-simple.md | 5 +++-- .../Category1 Display Name/policy-simple.md | 5 +++-- .../Category1 Display Name/policy-simple.md | 5 +++-- .../User Policies/Category1 Display Name/policy-simple.md | 5 +++-- .../Category1 Display Name/simple-text-property.md | 5 +++-- .../Category1 Display Name/simple-text-property.md | 5 +++-- 34 files changed, 110 insertions(+), 76 deletions(-) diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/array_of_integers/Computer Policies/Category1 Display Name/policy-simple.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/array_of_integers/Computer Policies/Category1 Display Name/policy-simple.md index 3ddb533a8..222f018bf 100644 --- a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/array_of_integers/Computer Policies/Category1 Display Name/policy-simple.md +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/array_of_integers/Computer Policies/Category1 Display Name/policy-simple.md @@ -11,10 +11,11 @@ Supported on Ubuntu 20.04 -## Metadata +**Metadata** | Element | Value | | --- | --- | -| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-array-decimal | +| Location | Policies -> Category1 Display Name -> summary | +| Registry Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-array-decimal | | Element type | multiText | | Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/array_of_strings/Computer Policies/Category1 Display Name/policy-simple.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/array_of_strings/Computer Policies/Category1 Display Name/policy-simple.md index 568234d10..29643c8ff 100644 --- a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/array_of_strings/Computer Policies/Category1 Display Name/policy-simple.md +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/array_of_strings/Computer Policies/Category1 Display Name/policy-simple.md @@ -11,10 +11,11 @@ Supported on Ubuntu 20.04 -## Metadata +**Metadata** | Element | Value | | --- | --- | -| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-array-string | +| Location | Policies -> Category1 Display Name -> summary | +| Registry Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-array-string | | Element type | multiText | | Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/basic_key/Computer Policies/Category1 Display Name/no-options.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/basic_key/Computer Policies/Category1 Display Name/no-options.md index 80ed7b860..851c05372 100644 --- a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/basic_key/Computer Policies/Category1 Display Name/no-options.md +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/basic_key/Computer Policies/Category1 Display Name/no-options.md @@ -7,10 +7,11 @@ description -## Metadata +**Metadata** | Element | Value | | --- | --- | -| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-no-options | +| Location | Policies -> Category1 Display Name -> summary | +| Registry Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-no-options | | Element type | | | Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/boolean/Computer Policies/Category1 Display Name/policy-simple.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/boolean/Computer Policies/Category1 Display Name/policy-simple.md index cc7af12ff..c1def0764 100644 --- a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/boolean/Computer Policies/Category1 Display Name/policy-simple.md +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/boolean/Computer Policies/Category1 Display Name/policy-simple.md @@ -11,10 +11,11 @@ Supported on Ubuntu 20.04 -## Metadata +**Metadata** | Element | Value | | --- | --- | -| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-boolean | +| Location | Policies -> Category1 Display Name -> summary | +| Registry Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-boolean | | Element type | boolean | | Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/choices/Computer Policies/Category1 Display Name/policy-simple.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/choices/Computer Policies/Category1 Display Name/policy-simple.md index 7ec21d0f3..229e158c6 100644 --- a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/choices/Computer Policies/Category1 Display Name/policy-simple.md +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/choices/Computer Policies/Category1 Display Name/policy-simple.md @@ -9,7 +9,7 @@ Note: default system value is used for "Not Configured" and enforced if "Disable Supported on Ubuntu 20.04 -## Valid values +**Valid values** * Choice 1 * Choice 2 @@ -17,10 +17,11 @@ Supported on Ubuntu 20.04 * Choice 4 -## Metadata +**Metadata** | Element | Value | | --- | --- | -| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-choices | +| Location | Policies -> Category1 Display Name -> summary | +| Registry Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-choices | | Element type | dropdownList | | Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/choices_with_default/Computer Policies/Category1 Display Name/policy-simple.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/choices_with_default/Computer Policies/Category1 Display Name/policy-simple.md index 713f85a97..3fa7da4cc 100644 --- a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/choices_with_default/Computer Policies/Category1 Display Name/policy-simple.md +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/choices_with_default/Computer Policies/Category1 Display Name/policy-simple.md @@ -11,7 +11,7 @@ Note: default system value is used for "Not Configured" and enforced if "Disable Supported on Ubuntu 20.04, 18.04 -## Valid values +**Valid values** * Choice 1 * Choice 2 @@ -19,10 +19,11 @@ Supported on Ubuntu 20.04, 18.04 * Choice 4 -## Metadata +**Metadata** | Element | Value | | --- | --- | -| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-choices | +| Location | Policies -> Category1 Display Name -> summary | +| Registry Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-choices | | Element type | dropdownList | | Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/decimal/Computer Policies/Category1 Display Name/policy-decimal.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/decimal/Computer Policies/Category1 Display Name/policy-decimal.md index c9b756de0..7449ae215 100644 --- a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/decimal/Computer Policies/Category1 Display Name/policy-decimal.md +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/decimal/Computer Policies/Category1 Display Name/policy-decimal.md @@ -11,10 +11,11 @@ Supported on Ubuntu 20.04 -## Metadata +**Metadata** | Element | Value | | --- | --- | -| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-decimal | +| Location | Policies -> Category1 Display Name -> summary | +| Registry Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-decimal | | Element type | decimal | | Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/decimal_with_max_only/Computer Policies/Category1 Display Name/policy-decimal-with-range.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/decimal_with_max_only/Computer Policies/Category1 Display Name/policy-decimal-with-range.md index 08df1987a..b2f224ad5 100644 --- a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/decimal_with_max_only/Computer Policies/Category1 Display Name/policy-decimal-with-range.md +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/decimal_with_max_only/Computer Policies/Category1 Display Name/policy-decimal-with-range.md @@ -9,17 +9,18 @@ Note: default system value is used for "Not Configured" and enforced if "Disable Supported on Ubuntu 20.04 -## Valid range +**Valid range** * Min: * Max: 15000.000000 -## Metadata +**Metadata** | Element | Value | | --- | --- | -| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-decimal-with-range | +| Location | Policies -> Category1 Display Name -> summary | +| Registry Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-decimal-with-range | | Element type | decimal | | Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/decimal_with_min_only/Computer Policies/Category1 Display Name/policy-decimal-with-range.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/decimal_with_min_only/Computer Policies/Category1 Display Name/policy-decimal-with-range.md index 2e633aed2..ca4221d98 100644 --- a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/decimal_with_min_only/Computer Policies/Category1 Display Name/policy-decimal-with-range.md +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/decimal_with_min_only/Computer Policies/Category1 Display Name/policy-decimal-with-range.md @@ -9,17 +9,18 @@ Note: default system value is used for "Not Configured" and enforced if "Disable Supported on Ubuntu 20.04 -## Valid range +**Valid range** * Min: -123.000000 * Max: -## Metadata +**Metadata** | Element | Value | | --- | --- | -| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-decimal-with-range | +| Location | Policies -> Category1 Display Name -> summary | +| Registry Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-decimal-with-range | | Element type | decimal | | Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/decimal_with_range/Computer Policies/Category1 Display Name/policy-decimal-with-range.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/decimal_with_range/Computer Policies/Category1 Display Name/policy-decimal-with-range.md index 071c584d7..5bbfb9f3b 100644 --- a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/decimal_with_range/Computer Policies/Category1 Display Name/policy-decimal-with-range.md +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/decimal_with_range/Computer Policies/Category1 Display Name/policy-decimal-with-range.md @@ -9,17 +9,18 @@ Note: default system value is used for "Not Configured" and enforced if "Disable Supported on Ubuntu 20.04 -## Valid range +**Valid range** * Min: -123.000000 * Max: 15000.000000 -## Metadata +**Metadata** | Element | Value | | --- | --- | -| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-decimal-with-range | +| Location | Policies -> Category1 Display Name -> summary | +| Registry Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-decimal-with-range | | Element type | decimal | | Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/double/Computer Policies/Category1 Display Name/policy-double.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/double/Computer Policies/Category1 Display Name/policy-double.md index c45f2bf1a..79cbb991d 100644 --- a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/double/Computer Policies/Category1 Display Name/policy-double.md +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/double/Computer Policies/Category1 Display Name/policy-double.md @@ -11,10 +11,11 @@ Supported on Ubuntu 20.04 -## Metadata +**Metadata** | Element | Value | | --- | --- | -| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-double | +| Location | Policies -> Category1 Display Name -> summary | +| Registry Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-double | | Element type | text | | Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/double_with_range/Computer Policies/Category1 Display Name/policy-double.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/double_with_range/Computer Policies/Category1 Display Name/policy-double.md index 233df31bf..a2eb752e2 100644 --- a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/double_with_range/Computer Policies/Category1 Display Name/policy-double.md +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/double_with_range/Computer Policies/Category1 Display Name/policy-double.md @@ -9,17 +9,18 @@ Note: default system value is used for "Not Configured" and enforced if "Disable Supported on Ubuntu 20.04 -## Valid range +**Valid range** * Min: 123.000000 * Max: 15000.000000 -## Metadata +**Metadata** | Element | Value | | --- | --- | -| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-double | +| Location | Policies -> Category1 Display Name -> summary | +| Registry Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-double | | Element type | text | | Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/long_decimal/Computer Policies/Category1 Display Name/policy-long-decimal.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/long_decimal/Computer Policies/Category1 Display Name/policy-long-decimal.md index de5d71ab1..04db33327 100644 --- a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/long_decimal/Computer Policies/Category1 Display Name/policy-long-decimal.md +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/long_decimal/Computer Policies/Category1 Display Name/policy-long-decimal.md @@ -11,10 +11,11 @@ Supported on Ubuntu 20.04 -## Metadata +**Metadata** | Element | Value | | --- | --- | -| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-long-decimal | +| Location | Policies -> Category1 Display Name -> summary | +| Registry Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-long-decimal | | Element type | longDecimal | | Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_categories/Computer Policies/Category1 Display Name/policy-multiple1.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_categories/Computer Policies/Category1 Display Name/policy-multiple1.md index 558b18155..07fef6f7c 100644 --- a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_categories/Computer Policies/Category1 Display Name/policy-multiple1.md +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_categories/Computer Policies/Category1 Display Name/policy-multiple1.md @@ -9,10 +9,11 @@ Note: default system value is used for "Not Configured" and enforced if "Disable -## Metadata +**Metadata** | Element | Value | | --- | --- | -| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-multiple1 | +| Location | Policies -> Category1 Display Name -> summary 1 | +| Registry Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-multiple1 | | Element type | text | | Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_categories/Computer Policies/Category2 Display Name/policy-multiple2.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_categories/Computer Policies/Category2 Display Name/policy-multiple2.md index 51200ae1a..ad094e56c 100644 --- a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_categories/Computer Policies/Category2 Display Name/policy-multiple2.md +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_categories/Computer Policies/Category2 Display Name/policy-multiple2.md @@ -9,10 +9,11 @@ Note: default system value is used for "Not Configured" and enforced if "Disable -## Metadata +**Metadata** | Element | Value | | --- | --- | -| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-multiple2 | +| Location | Policies -> Category2 Display Name -> summary 2 | +| Registry Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-multiple2 | | Element type | text | | Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_for_one_key/Computer Policies/Category1 Display Name/policy-simple.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_for_one_key/Computer Policies/Category1 Display Name/policy-simple.md index ca399f7a1..1f9983ae7 100644 --- a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_for_one_key/Computer Policies/Category1 Display Name/policy-simple.md +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_for_one_key/Computer Policies/Category1 Display Name/policy-simple.md @@ -11,10 +11,11 @@ Supported on Ubuntu 20.04, 18.04 -## Metadata +**Metadata** | Element | Value | | --- | --- | -| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple | +| Location | Policies -> Category1 Display Name -> summary | +| Registry Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple | | Element type | text | | Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_with_all_widgets_and_different_defaults/Computer Policies/Category1 Display Name/policy-simple.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_with_all_widgets_and_different_defaults/Computer Policies/Category1 Display Name/policy-simple.md index c5a00bfac..c809b92e3 100644 --- a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_with_all_widgets_and_different_defaults/Computer Policies/Category1 Display Name/policy-simple.md +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_with_all_widgets_and_different_defaults/Computer Policies/Category1 Display Name/policy-simple.md @@ -17,10 +17,11 @@ Supported on Ubuntu textrelease, multitextrelease, longdecimalrelease, dropdownl -## Metadata +**Metadata** | Element | Value | | --- | --- | -| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple | +| Location | Policies -> Category1 Display Name -> summary | +| Registry Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple | | Element type | text | | Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_with_different_choices/Computer Policies/Category1 Display Name/policy-simple.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_with_different_choices/Computer Policies/Category1 Display Name/policy-simple.md index 9ab25594a..b0f7bdd96 100644 --- a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_with_different_choices/Computer Policies/Category1 Display Name/policy-simple.md +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_with_different_choices/Computer Policies/Category1 Display Name/policy-simple.md @@ -11,7 +11,7 @@ Note: default system value is used for "Not Configured" and enforced if "Disable Supported on Ubuntu 20.04, 18.04 -## Valid values +**Valid values** * Choice 11 * Choice 12 @@ -19,10 +19,11 @@ Supported on Ubuntu 20.04, 18.04 * Choice 14 -## Metadata +**Metadata** | Element | Value | | --- | --- | -| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple | +| Location | Policies -> Category1 Display Name -> summary | +| Registry Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple | | Element type | dropdownList | | Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_with_different_ranges/Computer Policies/Category1 Display Name/policy-simple.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_with_different_ranges/Computer Policies/Category1 Display Name/policy-simple.md index 7e80c1970..4a1a652d5 100644 --- a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_with_different_ranges/Computer Policies/Category1 Display Name/policy-simple.md +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_with_different_ranges/Computer Policies/Category1 Display Name/policy-simple.md @@ -11,17 +11,18 @@ Note: default system value is used for "Not Configured" and enforced if "Disable Supported on Ubuntu 20.04, 18.04 -## Valid range +**Valid range** * Min: -20.000000 * Max: 20.000000 -## Metadata +**Metadata** | Element | Value | | --- | --- | -| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple | +| Location | Policies -> Category1 Display Name -> summary | +| Registry Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple | | Element type | decimal | | Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_with_different_widgettype/Computer Policies/Category1 Display Name/policy-simple.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_with_different_widgettype/Computer Policies/Category1 Display Name/policy-simple.md index 332bb3283..6961a8883 100644 --- a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_with_different_widgettype/Computer Policies/Category1 Display Name/policy-simple.md +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/multiple_releases_with_different_widgettype/Computer Policies/Category1 Display Name/policy-simple.md @@ -13,10 +13,11 @@ Supported on Ubuntu 20.04, 18.04 -## Metadata +**Metadata** | Element | Value | | --- | --- | -| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple | +| Location | Policies -> Category1 Display Name -> summary | +| Registry Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple | | Element type | text | | Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/Computer Policies/Parent Category Display Name/Category with User and Computer/policy-child-computer.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/Computer Policies/Parent Category Display Name/Category with User and Computer/policy-child-computer.md index 7941a0555..a5580660c 100644 --- a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/Computer Policies/Parent Category Display Name/Category with User and Computer/policy-child-computer.md +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/Computer Policies/Parent Category Display Name/Category with User and Computer/policy-child-computer.md @@ -11,10 +11,11 @@ Supported on Ubuntu 20.04 -## Metadata +**Metadata** | Element | Value | | --- | --- | -| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-child-computer | +| Location | Policies -> Parent Category Display Name -> Category with User and Computer -> summary child computer | +| Registry Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-child-computer | | Element type | text | | Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/Computer Policies/Parent Category Display Name/Child Category Display Name Computer/policy-computer.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/Computer Policies/Parent Category Display Name/Child Category Display Name Computer/policy-computer.md index d63ce2a94..8699dae0d 100644 --- a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/Computer Policies/Parent Category Display Name/Child Category Display Name Computer/policy-computer.md +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/Computer Policies/Parent Category Display Name/Child Category Display Name Computer/policy-computer.md @@ -11,10 +11,11 @@ Supported on Ubuntu 20.04 -## Metadata +**Metadata** | Element | Value | | --- | --- | -| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-computer | +| Location | Policies -> Parent Category Display Name -> Child Category Display Name Computer -> summary computer | +| Registry Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-computer | | Element type | text | | Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/Computer Policies/Parent Category Display Name/policy-first.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/Computer Policies/Parent Category Display Name/policy-first.md index b00354a6a..fc4a55856 100644 --- a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/Computer Policies/Parent Category Display Name/policy-first.md +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/Computer Policies/Parent Category Display Name/policy-first.md @@ -11,10 +11,11 @@ Supported on Ubuntu 20.04 -## Metadata +**Metadata** | Element | Value | | --- | --- | -| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-first | +| Location | Policies -> Parent Category Display Name -> summary first | +| Registry Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-first | | Element type | text | | Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/User Policies/Parent Category Display Name/Category with User and Computer/policy-child-user.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/User Policies/Parent Category Display Name/Category with User and Computer/policy-child-user.md index a33181e62..728ba444f 100644 --- a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/User Policies/Parent Category Display Name/Category with User and Computer/policy-child-user.md +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/User Policies/Parent Category Display Name/Category with User and Computer/policy-child-user.md @@ -11,10 +11,11 @@ Supported on Ubuntu 20.04 -## Metadata +**Metadata** | Element | Value | | --- | --- | -| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-child-user | +| Location | User Policies -> Parent Category Display Name -> Category with User and Computer -> summary computer | +| Registry Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-child-user | | Element type | text | | Class: | User | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/User Policies/Parent Category Display Name/Child Category Display Name in User/policy-user.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/User Policies/Parent Category Display Name/Child Category Display Name in User/policy-user.md index d535f4549..8514dd7e8 100644 --- a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/User Policies/Parent Category Display Name/Child Category Display Name in User/policy-user.md +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories,_classes_and_empty/User Policies/Parent Category Display Name/Child Category Display Name in User/policy-user.md @@ -11,10 +11,11 @@ Supported on Ubuntu 20.04 -## Metadata +**Metadata** | Element | Value | | --- | --- | -| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-user | +| Location | User Policies -> Parent Category Display Name -> Child Category Display Name in User -> summary user | +| Registry Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-user | | Element type | text | | Class: | User | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories/Computer Policies/Parent Category Display Name/Child Category Display Name/policy-second.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories/Computer Policies/Parent Category Display Name/Child Category Display Name/policy-second.md index 774c81ebc..810b739f0 100644 --- a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories/Computer Policies/Parent Category Display Name/Child Category Display Name/policy-second.md +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories/Computer Policies/Parent Category Display Name/Child Category Display Name/policy-second.md @@ -11,10 +11,11 @@ Supported on Ubuntu 20.04 -## Metadata +**Metadata** | Element | Value | | --- | --- | -| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-second | +| Location | Policies -> Parent Category Display Name -> Child Category Display Name -> summary second | +| Registry Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-second | | Element type | text | | Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories/Computer Policies/Parent Category Display Name/policy-first.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories/Computer Policies/Parent Category Display Name/policy-first.md index b00354a6a..fc4a55856 100644 --- a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories/Computer Policies/Parent Category Display Name/policy-first.md +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/nested_categories/Computer Policies/Parent Category Display Name/policy-first.md @@ -11,10 +11,11 @@ Supported on Ubuntu 20.04 -## Metadata +**Metadata** | Element | Value | | --- | --- | -| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-first | +| Location | Policies -> Parent Category Display Name -> summary first | +| Registry Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-first | | Element type | text | | Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/no_meta_at_all/Computer Policies/Category1 Display Name/policy-simple.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/no_meta_at_all/Computer Policies/Category1 Display Name/policy-simple.md index 8a12c856d..163692b8a 100644 --- a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/no_meta_at_all/Computer Policies/Category1 Display Name/policy-simple.md +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/no_meta_at_all/Computer Policies/Category1 Display Name/policy-simple.md @@ -11,10 +11,11 @@ Supported on Ubuntu 20.04 -## Metadata +**Metadata** | Element | Value | | --- | --- | -| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple | +| Location | Policies -> Category1 Display Name -> summary | +| Registry Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple | | Element type | text | | Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/no_meta_disabled/Computer Policies/Category1 Display Name/policy-simple.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/no_meta_disabled/Computer Policies/Category1 Display Name/policy-simple.md index 8a12c856d..163692b8a 100644 --- a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/no_meta_disabled/Computer Policies/Category1 Display Name/policy-simple.md +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/no_meta_disabled/Computer Policies/Category1 Display Name/policy-simple.md @@ -11,10 +11,11 @@ Supported on Ubuntu 20.04 -## Metadata +**Metadata** | Element | Value | | --- | --- | -| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple | +| Location | Policies -> Category1 Display Name -> summary | +| Registry Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple | | Element type | text | | Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/no_meta_enabled/Computer Policies/Category1 Display Name/policy-simple.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/no_meta_enabled/Computer Policies/Category1 Display Name/policy-simple.md index 8a12c856d..163692b8a 100644 --- a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/no_meta_enabled/Computer Policies/Category1 Display Name/policy-simple.md +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/no_meta_enabled/Computer Policies/Category1 Display Name/policy-simple.md @@ -11,10 +11,11 @@ Supported on Ubuntu 20.04 -## Metadata +**Metadata** | Element | Value | | --- | --- | -| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple | +| Location | Policies -> Category1 Display Name -> summary | +| Registry Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple | | Element type | text | | Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/simple/Computer Policies/Category1 Display Name/policy-simple.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/simple/Computer Policies/Category1 Display Name/policy-simple.md index 8a12c856d..163692b8a 100644 --- a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/simple/Computer Policies/Category1 Display Name/policy-simple.md +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/simple/Computer Policies/Category1 Display Name/policy-simple.md @@ -11,10 +11,11 @@ Supported on Ubuntu 20.04 -## Metadata +**Metadata** | Element | Value | | --- | --- | -| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple | +| Location | Policies -> Category1 Display Name -> summary | +| Registry Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple | | Element type | text | | Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/user_policy/User Policies/Category1 Display Name/policy-simple.md b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/user_policy/User Policies/Category1 Display Name/policy-simple.md index e8ad8eb6f..dd0a6f34d 100644 --- a/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/user_policy/User Policies/Category1 Display Name/policy-simple.md +++ b/internal/ad/admxgen/testdata/TestExpandedCategoriesToMD/golden/user_policy/User Policies/Category1 Display Name/policy-simple.md @@ -11,10 +11,11 @@ Supported on Ubuntu 20.04 -## Metadata +**Metadata** | Element | Value | | --- | --- | -| Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple | +| Location | User Policies -> Category1 Display Name -> summary | +| Registry Key | Software\Policies\Ubuntu\dconf\org\gnome\desktop\policy-simple | | Element type | text | | Class: | User | diff --git a/internal/ad/admxgen/testdata/TestGenerateDoc/golden/autodetect_overrides_releases_from_yaml/Computer Policies/Category1 Display Name/simple-text-property.md b/internal/ad/admxgen/testdata/TestGenerateDoc/golden/autodetect_overrides_releases_from_yaml/Computer Policies/Category1 Display Name/simple-text-property.md index 0b85b9cd9..f66627a00 100644 --- a/internal/ad/admxgen/testdata/TestGenerateDoc/golden/autodetect_overrides_releases_from_yaml/Computer Policies/Category1 Display Name/simple-text-property.md +++ b/internal/ad/admxgen/testdata/TestGenerateDoc/golden/autodetect_overrides_releases_from_yaml/Computer Policies/Category1 Display Name/simple-text-property.md @@ -12,10 +12,11 @@ Supported on Ubuntu 20.04, 21.04, 21.10. -## Metadata +**Metadata** | Element | Value | | --- | --- | -| Key | Software\Policies\Ubuntu\dconf\com\ubuntu\simple\simple-text-property | +| Location | Computer Policies -> Category1 Display Name -> simple-text-property summary | +| Registry Key | Software\Policies\Ubuntu\dconf\com\ubuntu\simple\simple-text-property | | Element type | text | | Class: | Machine | diff --git a/internal/ad/admxgen/testdata/TestGenerateDoc/golden/releases_from_yaml/Computer Policies/Category1 Display Name/simple-text-property.md b/internal/ad/admxgen/testdata/TestGenerateDoc/golden/releases_from_yaml/Computer Policies/Category1 Display Name/simple-text-property.md index 0b85b9cd9..f66627a00 100644 --- a/internal/ad/admxgen/testdata/TestGenerateDoc/golden/releases_from_yaml/Computer Policies/Category1 Display Name/simple-text-property.md +++ b/internal/ad/admxgen/testdata/TestGenerateDoc/golden/releases_from_yaml/Computer Policies/Category1 Display Name/simple-text-property.md @@ -12,10 +12,11 @@ Supported on Ubuntu 20.04, 21.04, 21.10. -## Metadata +**Metadata** | Element | Value | | --- | --- | -| Key | Software\Policies\Ubuntu\dconf\com\ubuntu\simple\simple-text-property | +| Location | Computer Policies -> Category1 Display Name -> simple-text-property summary | +| Registry Key | Software\Policies\Ubuntu\dconf\com\ubuntu\simple\simple-text-property | | Element type | text | | Class: | Machine |