MCPcopy Create free account
hub / github.com/smallstep/cli / EmailCommand

Function EmailCommand

command/ca/policy/actions/emails.go:19–81  ·  view source on GitHub ↗

EmailCommand returns the x509 email subcommand

(ctx context.Context)

Source from the content-addressed store, hash-verified

17
18// EmailCommand returns the x509 email subcommand
19func EmailCommand(ctx context.Context) cli.Command {
20 commandName := policycontext.GetPrefixedCommandUsage(ctx, "email")
21 return cli.Command{
22 Name: "email",
23 Usage: "add or remove email addresses",
24 UsageText: fmt.Sprintf(`**%s** <email> [**--remove**] [**--provisioner**=<name>]
25[**--admin-cert**=<file>] [**--admin-key**=<file>] [**--admin-subject**=<subject>]
26[**--admin-provisioner**=<name>] [**--admin-password-file**=<file>]
27[**--ca-url**=<uri>] [**--root**=<file>] [**--context**=<name>]`, commandName),
28 Description: fmt.Sprintf(`**%s** command manages email addresses and domains in policies
29
30## EXAMPLES
31
32Allow all email addresses for the example.com domain in X.509 certificates on authority level
33'''
34$ step ca policy authority x509 allow email @example.com
35'''
36
37Remove the email addresses for the example.com domain in X.509 certificates on authority level
38'''
39$ step ca policy authority x509 allow email @example.com --remove
40'''
41
42Deny badmail@example.com in X.509 certificates on authority level
43'''
44$ step ca policy authority x509 deny email badmail@example.com
45'''
46
47Allow all email addresses for the example.com domain in X.509 certificates on provisioner level
48'''
49$ step ca policy provisioner x509 allow email @example.com --provisioner my_provisioner
50'''
51
52Allow all local parts for the example.com domain in SSH user certificates on provisioner level
53'''
54$ step ca policy provisioner ssh user allow email @example.com --provisioner my_provisioner
55'''
56
57Deny root@example.com domain in SSH user certificates on provisioner level
58'''
59$ step ca policy provisioner ssh user deny email @example.com --provisioner my_provisioner
60'''`, commandName),
61 Action: command.InjectContext(
62 ctx,
63 emailAction,
64 ),
65 Flags: []cli.Flag{
66 flags.Provisioner,
67 cli.BoolFlag{
68 Name: "remove",
69 Usage: `removes the provided emails from the policy instead of adding them`,
70 },
71 flags.AdminCert,
72 flags.AdminKey,
73 flags.AdminSubject,
74 flags.AdminProvisioner,
75 flags.AdminPasswordFile,
76 flags.CaURL,

Callers 6

allowCommandFunction · 0.92
denyCommandFunction · 0.92
allowCommandFunction · 0.92
denyCommandFunction · 0.92
allowCommandFunction · 0.92
denyCommandFunction · 0.92

Calls 2

GetPrefixedCommandUsageFunction · 0.92
InjectContextFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…