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
()
| 271 | // the home dir can't be resolved, and the resolver already treats a |
| 272 | // missing file as "no policy". |
| 273 | func 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 |
no test coverage detected