Commands returns all the Access related subcommands
()
| 74 | |
| 75 | // Commands returns all the Access related subcommands |
| 76 | func Commands() []*cli.Command { |
| 77 | return []*cli.Command{ |
| 78 | { |
| 79 | Name: "access", |
| 80 | Aliases: []string{"forward"}, |
| 81 | Category: "Access", |
| 82 | Usage: "access <subcommand>", |
| 83 | Flags: []cli.Flag{&cli.BoolFlag{ |
| 84 | Name: fedrampFlag, |
| 85 | Usage: "use when performing operations in fedramp account", |
| 86 | }}, |
| 87 | Description: `Cloudflare Access protects internal resources by securing, authenticating and monitoring access |
| 88 | per-user and by application. With Cloudflare Access, only authenticated users with the required permissions are |
| 89 | able to reach sensitive resources. The commands provided here allow you to interact with Access protected |
| 90 | applications from the command line.`, |
| 91 | Subcommands: []*cli.Command{ |
| 92 | { |
| 93 | Name: "login", |
| 94 | Action: cliutil.Action(login), |
| 95 | Usage: "login <url of access application>", |
| 96 | ArgsUsage: "url of Access application", |
| 97 | Description: `The login subcommand initiates an authentication flow with your identity provider. |
| 98 | The subcommand will launch a browser. For headless systems, a url is provided. |
| 99 | Once authenticated with your identity provider, the login command will generate a JSON Web Token (JWT) |
| 100 | scoped to your identity, the application you intend to reach, and valid for a session duration set by your |
| 101 | administrator. cloudflared stores the token in local storage.`, |
| 102 | Flags: []cli.Flag{ |
| 103 | &cli.BoolFlag{ |
| 104 | Name: loginQuietFlag, |
| 105 | Aliases: []string{"q"}, |
| 106 | Usage: "do not print the jwt to the command line", |
| 107 | }, |
| 108 | &cli.BoolFlag{ |
| 109 | Name: "no-verbose", |
| 110 | Usage: "print only the jwt to stdout", |
| 111 | }, |
| 112 | &cli.BoolFlag{ |
| 113 | Name: "auto-close", |
| 114 | Usage: "automatically close the auth interstitial after action", |
| 115 | }, |
| 116 | &cli.StringFlag{ |
| 117 | Name: appURLFlag, |
| 118 | }, |
| 119 | }, |
| 120 | }, |
| 121 | { |
| 122 | Name: "curl", |
| 123 | Action: cliutil.Action(curl), |
| 124 | Usage: "curl [--allow-request, -ar] <url> [<curl args>...]", |
| 125 | Description: `The curl subcommand wraps curl and automatically injects the JWT into a cf-access-token |
| 126 | header when using curl to reach an application behind Access.`, |
| 127 | ArgsUsage: "allow-request will allow the curl request to continue even if the jwt is not present.", |
| 128 | SkipFlagParsing: true, |
| 129 | }, |
| 130 | { |
| 131 | Name: "token", |
| 132 | Action: cliutil.Action(generateToken), |
| 133 | Usage: "token <url of access application>", |