// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

// Code generated by hack/docgen tool. DO NOT EDIT.

package security

import (
	"github.com/siderolabs/talos/pkg/machinery/config/encoder"
)

func (TrustedRootsConfigV1Alpha1) Doc() *encoder.Doc {
	doc := &encoder.Doc{
		Type:        "TrustedRootsConfig",
		Comments:    [3]string{"" /* encoder.HeadComment */, "TrustedRootsConfig allows to configure additional trusted CA roots." /* encoder.LineComment */, "" /* encoder.FootComment */},
		Description: "TrustedRootsConfig allows to configure additional trusted CA roots.",
		Fields: []encoder.Doc{
			{
				Type:   "Meta",
				Inline: true,
			},
			{
				Name:        "name",
				Type:        "string",
				Note:        "",
				Description: "Name of the config document.",
				Comments:    [3]string{"" /* encoder.HeadComment */, "Name of the config document." /* encoder.LineComment */, "" /* encoder.FootComment */},
			},
			{
				Name:        "certificates",
				Type:        "string",
				Note:        "",
				Description: "List of additional trusted certificate authorities (as PEM-encoded certificates).\n\nMultiple certificates can be provided in a single config document, separated by newline characters.",
				Comments:    [3]string{"" /* encoder.HeadComment */, "List of additional trusted certificate authorities (as PEM-encoded certificates)." /* encoder.LineComment */, "" /* encoder.FootComment */},
			},
		},
	}

	doc.AddExample("", exampleTrustedRootsConfigV1Alpha1())

	return doc
}

func (ImageVerificationConfigV1Alpha1) Doc() *encoder.Doc {
	doc := &encoder.Doc{
		Type:        "ImageVerificationConfig",
		Comments:    [3]string{"" /* encoder.HeadComment */, "ImageVerificationConfig configures image signature verification policy." /* encoder.LineComment */, "" /* encoder.FootComment */},
		Description: "ImageVerificationConfig configures image signature verification policy.",
		Fields: []encoder.Doc{
			{
				Type:   "Meta",
				Inline: true,
			},
			{
				Name:        "rules",
				Type:        "[]ImageVerificationRuleV1Alpha1",
				Note:        "",
				Description: "List of verification rules.\nRules are evaluated in order; first matching rule applies.",
				Comments:    [3]string{"" /* encoder.HeadComment */, "List of verification rules." /* encoder.LineComment */, "" /* encoder.FootComment */},
			},
		},
	}

	doc.AddExample("", exampleImageVerificationConfigV1Alpha1())

	return doc
}

func (ImageVerificationRuleV1Alpha1) Doc() *encoder.Doc {
	doc := &encoder.Doc{
		Type:        "ImageVerificationRuleV1Alpha1",
		Comments:    [3]string{"" /* encoder.HeadComment */, "ImageVerificationRuleV1Alpha1 defines a verification rule." /* encoder.LineComment */, "" /* encoder.FootComment */},
		Description: "ImageVerificationRuleV1Alpha1 defines a verification rule.",
		AppearsIn: []encoder.Appearance{
			{
				TypeName:  "ImageVerificationConfigV1Alpha1",
				FieldName: "rules",
			},
		},
		Fields: []encoder.Doc{
			{
				Name:        "image",
				Type:        "string",
				Note:        "",
				Description: "Image reference pattern to match for this rule.\nSupports glob patterns.",
				Comments:    [3]string{"" /* encoder.HeadComment */, "Image reference pattern to match for this rule." /* encoder.LineComment */, "" /* encoder.FootComment */},
			},
			{
				Name:        "skip",
				Type:        "bool",
				Note:        "",
				Description: "Skip verification for this image pattern (default: false).",
				Comments:    [3]string{"" /* encoder.HeadComment */, "Skip verification for this image pattern (default: false)." /* encoder.LineComment */, "" /* encoder.FootComment */},
			},
			{
				Name:        "deny",
				Type:        "bool",
				Note:        "",
				Description: "Deny pulling images matching the pattern (default: false).",
				Comments:    [3]string{"" /* encoder.HeadComment */, "Deny pulling images matching the pattern (default: false)." /* encoder.LineComment */, "" /* encoder.FootComment */},
			},
			{
				Name:        "keyless",
				Type:        "ImageKeylessVerifierV1Alpha1",
				Note:        "",
				Description: "Keyless verifier configuration to use for this rule.",
				Comments:    [3]string{"" /* encoder.HeadComment */, "Keyless verifier configuration to use for this rule." /* encoder.LineComment */, "" /* encoder.FootComment */},
			},
			{
				Name:        "publicKey",
				Type:        "ImagePublicKeyVerifierV1Alpha1",
				Note:        "",
				Description: "Public key verifier configuration to use for this rule.",
				Comments:    [3]string{"" /* encoder.HeadComment */, "Public key verifier configuration to use for this rule." /* encoder.LineComment */, "" /* encoder.FootComment */},
			},
		},
	}

	doc.Fields[0].AddExample("", "docker.io/library/nginx")
	doc.Fields[0].AddExample("", "registry.k8s.io/*")

	return doc
}

func (ImageKeylessVerifierV1Alpha1) Doc() *encoder.Doc {
	doc := &encoder.Doc{
		Type:        "ImageKeylessVerifierV1Alpha1",
		Comments:    [3]string{"" /* encoder.HeadComment */, "ImageKeylessVerifierV1Alpha1 configures a signature verification provider using Cosign keyless verification." /* encoder.LineComment */, "" /* encoder.FootComment */},
		Description: "ImageKeylessVerifierV1Alpha1 configures a signature verification provider using Cosign keyless verification.",
		AppearsIn: []encoder.Appearance{
			{
				TypeName:  "ImageVerificationRuleV1Alpha1",
				FieldName: "keyless",
			},
		},
		Fields: []encoder.Doc{
			{
				Name:        "issuer",
				Type:        "string",
				Note:        "",
				Description: "OIDC issuer URL for keyless verification.",
				Comments:    [3]string{"" /* encoder.HeadComment */, "OIDC issuer URL for keyless verification." /* encoder.LineComment */, "" /* encoder.FootComment */},
			},
			{
				Name:        "subject",
				Type:        "string",
				Note:        "",
				Description: "Expected subject for keyless verification.\n\nThis is the identity (email, URI) that signed the image.",
				Comments:    [3]string{"" /* encoder.HeadComment */, "Expected subject for keyless verification." /* encoder.LineComment */, "" /* encoder.FootComment */},
			},
			{
				Name:        "subjectRegex",
				Type:        "string",
				Note:        "",
				Description: "Regex pattern for subject matching.\n\nUse this instead of subject for flexible matching.",
				Comments:    [3]string{"" /* encoder.HeadComment */, "Regex pattern for subject matching." /* encoder.LineComment */, "" /* encoder.FootComment */},
			},
		},
	}

	doc.Fields[0].AddExample("", "https://accounts.google.com")
	doc.Fields[0].AddExample("", "https://token.actions.githubusercontent.com")
	doc.Fields[2].AddExample("", ".*@example\\.com")

	return doc
}

func (ImagePublicKeyVerifierV1Alpha1) Doc() *encoder.Doc {
	doc := &encoder.Doc{
		Type:        "ImagePublicKeyVerifierV1Alpha1",
		Comments:    [3]string{"" /* encoder.HeadComment */, "ImagePublicKeyVerifierV1Alpha1 configures a signature verification provider using a static public key." /* encoder.LineComment */, "" /* encoder.FootComment */},
		Description: "ImagePublicKeyVerifierV1Alpha1 configures a signature verification provider using a static public key.",
		AppearsIn: []encoder.Appearance{
			{
				TypeName:  "ImageVerificationRuleV1Alpha1",
				FieldName: "publicKey",
			},
		},
		Fields: []encoder.Doc{
			{
				Name:        "certificate",
				Type:        "string",
				Note:        "",
				Description: "A public certificate in PEM format accepted for image signature verification.",
				Comments:    [3]string{"" /* encoder.HeadComment */, "A public certificate in PEM format accepted for image signature verification." /* encoder.LineComment */, "" /* encoder.FootComment */},
			},
		},
	}

	return doc
}

// GetFileDoc returns documentation for the file security_doc.go.
func GetFileDoc() *encoder.FileDoc {
	return &encoder.FileDoc{
		Name:        "security",
		Description: "Package security provides security-related machine configuration documents.\n",
		Structs: []*encoder.Doc{
			TrustedRootsConfigV1Alpha1{}.Doc(),
			ImageVerificationConfigV1Alpha1{}.Doc(),
			ImageVerificationRuleV1Alpha1{}.Doc(),
			ImageKeylessVerifierV1Alpha1{}.Doc(),
			ImagePublicKeyVerifierV1Alpha1{}.Doc(),
		},
	}
}
