cmd/headscale/cli: mention sshTests in policy check help
This commit is contained in:
parent
26eebcea5a
commit
92a9accfcb
@ -48,7 +48,7 @@ func init() {
|
|||||||
policyCmd.AddCommand(setPolicy)
|
policyCmd.AddCommand(setPolicy)
|
||||||
|
|
||||||
checkPolicy.Flags().StringP("file", "f", "", "Path to a policy file in HuJSON format")
|
checkPolicy.Flags().StringP("file", "f", "", "Path to a policy file in HuJSON format")
|
||||||
checkPolicy.Flags().BoolP(bypassFlag, "", false, "Open the database directly (no gRPC, no running server) to validate user@ token references and to evaluate the policy's tests block. Required when those checks are needed.")
|
checkPolicy.Flags().BoolP(bypassFlag, "", false, "Open the database directly (no gRPC, no running server) to resolve user references and to evaluate the policy's tests and sshTests blocks. Required when those checks are needed.")
|
||||||
mustMarkRequired(checkPolicy, "file")
|
mustMarkRequired(checkPolicy, "file")
|
||||||
policyCmd.AddCommand(checkPolicy)
|
policyCmd.AddCommand(checkPolicy)
|
||||||
}
|
}
|
||||||
@ -173,8 +173,8 @@ var checkPolicy = &cobra.Command{
|
|||||||
Short: "Check the Policy file for errors",
|
Short: "Check the Policy file for errors",
|
||||||
Long: `
|
Long: `
|
||||||
Check validates the policy against the server's live users and nodes,
|
Check validates the policy against the server's live users and nodes,
|
||||||
running any "tests" block. By default the command is a thin frontend
|
running any "tests" or "sshTests" block. By default the command is a
|
||||||
for a gRPC call to a running headscale; pass --` + bypassFlag + ` to
|
thin frontend for a gRPC call to a running headscale; pass --` + bypassFlag + ` to
|
||||||
open the database directly when headscale is not running.`,
|
open the database directly when headscale is not running.`,
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
policyPath, _ := cmd.Flags().GetString("file")
|
policyPath, _ := cmd.Flags().GetString("file")
|
||||||
@ -208,7 +208,7 @@ var checkPolicy = &cobra.Command{
|
|||||||
// NewPolicyManager validates structure and user references
|
// NewPolicyManager validates structure and user references
|
||||||
// but intentionally skips test evaluation (boot path).
|
// but intentionally skips test evaluation (boot path).
|
||||||
// SetPolicy is the user-write boundary and is what runs the
|
// SetPolicy is the user-write boundary and is what runs the
|
||||||
// tests block.
|
// tests and sshTests blocks.
|
||||||
pm, err := policy.NewPolicyManager(policyBytes, users, nodes.ViewSlice())
|
pm, err := policy.NewPolicyManager(policyBytes, users, nodes.ViewSlice())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("parsing policy file: %w", err)
|
return fmt.Errorf("parsing policy file: %w", err)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user