Accept and protect processing glossary files

This commit is contained in:
2026-11-26 18:18:34 +00:00
parent a4b8fd0976
commit 39087675e1
6 changed files with 118 additions and 12 deletions

View File

@@ -27,7 +27,11 @@ type engineEntry struct {
engine *pk.Engine
}
func loadApplication(ctx context.Context, selection ckconfig.Selection, _ struct{}, _ *invocationState) (*ck.Result[appconfig.Config], error) {
type acquisitionInput struct {
GlossaryFiles []string
}
func acquireApplication(ctx context.Context, selection ckconfig.Selection, input acquisitionInput) (*appconfig.Acquisition, error) {
if err := ctx.Err(); err != nil {
return nil, err
}
@@ -40,11 +44,16 @@ func loadApplication(ctx context.Context, selection ckconfig.Selection, _ struct
} else {
source = ck.SearchConfig("audita", ck.Searches(ck.WorkingDirectory(), ck.UserConfigDirectory(), ck.UnixSystemDirectories()))
}
loaded, report, err := appconfig.Load(ctx, ck.Input{Source: source}, appconfig.Options{Overlay: selection.Overlay.Value, Overrides: selection.Overrides})
loaded, report, err := appconfig.Load(ctx, ck.Input{Source: source}, appconfig.Options{Overlay: selection.Overlay.Value, Overrides: selection.Overrides, GlossaryFiles: input.GlossaryFiles})
return loaded, reportBootstrap(ctx, report, err)
}
func loadApplication(ctx context.Context, selection ckconfig.Selection, _ struct{}, _ *invocationState) (*ck.Result[appconfig.Config], error) {
loaded, err := acquireApplication(ctx, selection, acquisitionInput{})
if err != nil {
return nil, reportBootstrap(ctx, report, err)
return nil, err
}
return loaded.Result, reportBootstrap(ctx, report, nil)
return loaded.Result, nil
}
func loadPromptEngine(ctx context.Context, selection ckconfig.Selection, input struct{}, state *invocationState) (*pk.Engine, error) {