managed

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package managed detects OS-level Claude Code managed (enterprise) settings so the configurator honors an admin's hook policy (SEC-6). `sync init` warns/ aborts when hooks are disabled; `sync run` no-ops under disableAllHooks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HooksDisabled

func HooksDisabled() bool

HooksDisabled is a convenience that reports whether managed settings forbid hooks. Any read error degrades to false (fail-open for detection only; the server governance layer is the real authority).

Types

type Policy

type Policy struct {
	// DisableAllHooks, when true, means no hooks may run — the configurator
	// must not install and the uploader must no-op.
	DisableAllHooks bool `json:"disableAllHooks"`
	// Path is the managed-settings file that was read (empty if none).
	Path string `json:"-"`
	// Present reports whether a managed-settings file exists.
	Present bool `json:"-"`
}

Policy is the subset of managed-settings we care about.

func Detect

func Detect() (*Policy, error)

Detect reads the managed-settings policy. A missing file is not an error — it returns a zero Policy with Present=false.

Jump to

Keyboard shortcuts

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