MCPcopy Index your code
hub / github.com/coder/coder / boundary

Method boundary

enterprise/cli/boundary.go:62–86  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

60}
61
62func (r *RootCmd) boundary() *serpent.Command {
63 version := getBoundaryVersion()
64 cmd := boundarycli.BaseCommand(version) // Package coder/boundary/cli exports a "base command" designed to be integrated as a subcommand.
65 cmd.Use += " [args...]" // The base command looks like `boundary -- command`. Serpent adds the flags piece, but we need to add the args.
66
67 // Wrap the handler to check for FeatureBoundary entitlement.
68 originalHandler := cmd.Handler
69 cmd.Handler = func(inv *serpent.Invocation) error {
70 // Boundary re-executes itself with CHILD=true to run the target process
71 // inside a jailed network namespace. Skip the license check for child
72 // processes since the parent already verified entitlement.
73 if isChild() {
74 return originalHandler(inv)
75 }
76
77 if err := r.verifyLicense(inv); err != nil {
78 return err
79 }
80
81 // Call the original handler if entitlement check passes.
82 return originalHandler(inv)
83 }
84
85 return cmd
86}

Callers 1

enterpriseOnlyMethod · 0.95

Calls 3

verifyLicenseMethod · 0.95
getBoundaryVersionFunction · 0.85
isChildFunction · 0.85

Tested by

no test coverage detected