EmailCommand returns the x509 email subcommand
(ctx context.Context)
| 17 | |
| 18 | // EmailCommand returns the x509 email subcommand |
| 19 | func 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 | |
| 32 | Allow 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 | |
| 37 | Remove 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 | |
| 42 | Deny badmail@example.com in X.509 certificates on authority level |
| 43 | ''' |
| 44 | $ step ca policy authority x509 deny email badmail@example.com |
| 45 | ''' |
| 46 | |
| 47 | Allow 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 | |
| 52 | Allow 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 | |
| 57 | Deny 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, |
no test coverage detected
searching dependent graphs…