MCPcopy Index your code
hub / github.com/larksuite/cli / userPolicyPath

Function userPolicyPath

cmd/platform_bootstrap.go:273–275  ·  view source on GitHub ↗

userPolicyPath returns the path of /policy.yml. The base directory honours LARKSUITE_CLI_CONFIG_DIR (via core.GetBaseConfigDir) so that test isolation, container deployments and per-Agent config overrides all see a consistent policy location. Using vfs.UserHomeDir directly here would

()

Source from the content-addressed store, hash-verified

271// the home dir can't be resolved, and the resolver already treats a
272// missing file as "no policy".
273func userPolicyPath() (string, error) {
274 return filepath.Join(core.GetBaseConfigDir(), userPolicyFileName), nil
275}
276
277// warnPolicyError writes a one-line stderr warning when the user policy
278// fails to load. V1 yaml errors are fail-OPEN -- the CLI keeps running

Callers 1

applyUserPolicyPruningFunction · 0.85

Calls 1

GetBaseConfigDirFunction · 0.92

Tested by

no test coverage detected