trust

package
v2.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2026 License: Apache-2.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package trust decides whether Prism may run a repository's own build tools while indexing it (SEC-01). Indexing a trusted repository runs its Maven or Gradle build, its own typescript, rust-analyzer (build scripts, proc macros) and a pinned go toolchain; an untrusted one runs none.

The decision is per user, never per repository: the trust file lives in the user's config directory, so a hostile prism.yaml cannot grant itself trust. Default: trusted, with a one-time notice per repository.

Index

Constants

View Source
const (
	Trusted        = "trusted"
	Untrusted      = "untrusted"
	TrustedDefault = "trusted-default" // never asked; the notice was shown
)

State values stored per root.

Variables

This section is empty.

Functions

func NoticeOnce

func NoticeOnce(root string) string

func Path

func Path() string

Path is the trust file: $XDG_CONFIG_HOME/prism/trusted.json, else ~/.config/prism/trusted.json.

func Roots

func Roots() [][2]string

Roots lists the recorded roots and their state, sorted.

func Set

func Set(root, state string) error

Set records root as trusted or untrusted.

func SetOverride

func SetOverride(state string)

SetOverride applies a command-line --trusted or --untrusted.

Types

type Decision

type Decision struct {
	Untrusted bool
	Source    string // "--untrusted", "PRISM_UNTRUSTED", "trust file", "default"
}

Decision is the effective trust for a root and why.

func For

func For(root string) Decision

For returns the effective trust for root: flag, then PRISM_UNTRUSTED, then the trust file, then trusted.

func (Decision) String

func (d Decision) String() string

String is "trusted (default)" or "untrusted (PRISM_UNTRUSTED)".

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL