Files
archie/internal/infrastructure/controlplanerpc/extensions.go
T
sam 9d8f364af1
Quality / check (push) Successful in 5m53s
deploy / gate (push) Canceled after 0s
deploy / archied-image (push) Canceled after 0s
deploy / agent-image (push) Canceled after 0s
deploy / dist-zip (push) Canceled after 0s
feat(releaseupdate): signed OCI distribution sources for releases and the catalogue (#1715)
2026-10-31 18:18:43 +11:00

28 lines
1.4 KiB
Go

package controlplanerpc
import "github.com/samcharles93/archie-core/internal/domain/distribution"
// ExtensionSettingsKind is the control-plane resource kind holding which
// installed extensions are enabled and how each is configured.
const ExtensionSettingsKind = "extension-settings"
// ExtensionSettings is the extension-settings resource document.
type ExtensionSettings struct {
Extensions []ExtensionSetting `json:"extensions"`
CatalogueSource string `json:"catalogue_source,omitempty" title:"Catalogue source" doc:"OCI repository the package catalogue is published to, read at its latest tag. Blank uses the official catalogue."`
CatalogueKey string `json:"catalogue_key,omitempty" title:"Catalogue signing key" doc:"Base64 ed25519 public key the catalogue source signs with. Required with a source."`
}
// Catalogue is the distribution source the settings name.
func (s ExtensionSettings) Catalogue() (distribution.Source, error) {
return distribution.Parse(s.CatalogueSource, s.CatalogueKey, distribution.DefaultCatalogue())
}
// ExtensionSetting enables or disables one installed extension by package name.
// Settings reach the extension through its surface's Configure call.
type ExtensionSetting struct {
Name string `json:"name"`
Enabled bool `json:"enabled"`
Settings map[string]string `json:"settings,omitempty"`
}