Skip to content
This repository has been archived by the owner on Feb 25, 2019. It is now read-only.

Latest commit

 

History

History
309 lines (213 loc) · 6.84 KB

cli.md

File metadata and controls

309 lines (213 loc) · 6.84 KB

nvl

The nvl command aims to help with deploying, managing, and maintaining Anvil Connect servers. You can get it by installing Anvil Connect globally via npm:

$ npm install -g anvil-connect-cli

Terminology

  • Issuer - an Anvil Connect server

Initializing a project

See the getting started guide

Setting up a server for administration

In order to administer an Anvil Connect server, you need

  • A registered, administrator ("authority") user
  • A client registration entry for the CLI tool

Fresh install

The nvl setup command takes care of registering an administrator account and registering the CLI client with an Anvil Connect that has no administrator user set up yet.

$ nvl setup https://connect.example.com --token-file path/to/connect/keys/setup.token
? Choose an email [email protected]
? Choose a password ********
? Choose a name for this configuration connect.example.com
? Choose an ID for this configuration connect-example-com
Your setup is complete. You may now log in with `$ nvl login`.

Existing install

If you already have a CLI registered with an Anvil Connect server, you can add the existing registration using nvl issuer:add.

$ nvl issuer:add
? Enter the issuer URI https://connect.example.com
? Enter the client ID 0a1b2c3d4e5f6-7a0b-1c2d-3e4f5a6b7c8d
? Enter the client secret 0a1b2c3d4e5f6a0b1c2d
? Enter the redirect URI https://connect.example.com
? Choose a name for this configuration My OIDC Provider
? Choose an ID for this configuration example-oidc-provider
Added issuer. You may now log in with `$ nvl login`.

You can replace any of the prompts with their command-line argument equivalents:

 nvl issuer:add [<issuer uri>] [--client-id | -c <id>]
        [--client-secret | -s <secret>] [--redirect-uri | -r <uri>]
        [--name | -n <config name>] [--id | -i <config id>]

CLI User Authentication

login

Running the login command will first prompt you to select an issuer.

nvl login
? Select an Anvil Connect instance (Use arrow keys)
❯ connect.anvil.io (connect-anvil-io)
  laptop-connect.anvil.io (laptop-connect-anvil-io) 

After you select an issuer, you'll be prompted for your email and password to login.

? Select an Anvil Connect instance connect.anvil.io (connect-anvil-io)
Selected issuer connect.anvil.io (https://connect.anvil.io)
? Enter your email [email protected]
? Enter your password **********
You have been successfully logged in to connect.anvil.io  

Once you've logged into an issuer, you can run other commands that require authentication.

Client Registration

client:register

nvl client:register [--issuer | -i <issuer id>] [--trusted | -t]
         [--name | -n <name>] [--uri | -u <uri>]
         [--logo-uri | -l <logo uri>] [--application-type | -a <app type>]
         [--response-type | -r <response type>] [--grant-type | -g <grant type>]
         [--default-max-age | -d <seconds>] [--redirect-uri | -s <redirect uri>]
         [--post-logout-redirect-uri | -p <post logout redirect uri>]

client:list

nvl client:list [--issuer | -i <issuer id>]

client:info

nvl client:info [<id>] [--issuer | -i <issuer id>]

client:update

nvl client:update [<id>] [--issuer | -i <issuer id>] [--trusted | -t] [--untrusted]
         [--name | -n <name>] [--uri | -u <uri>]
         [--logo-uri | -l <logo uri>] [--application-type | -a <app type>]
         [--response-type | -r <response type>] [--grant-type | -g <grant type>]
         [--default-max-age | -d <seconds>] [--redirect-uri | -s <redirect uri>]
         [--post-logout-redirect-uri | -p <post logout redirect uri>]

client:delete

nvl client:delete [<id>] [--issuer | -i <issuer id>]

client:roles

nvl client:roles [<id>] [--issuer | -i <issuer id>]

client:assign

nvl client:assign [<client id> <role name>] [--issuer | -i <issuer id>]

client:revoke

nvl client:revoke [<client id> <role name>] [--issuer | -i <issuer id>]

client:token

nvl client:token [--issuer | -i <issuer id>]

User Registration

user:register

nvl user:register [--issuer | -i <issuer id>]
        [--name | -n <name>] [--given | -g <given name>]
        [--middle | -m <middle name>] [--family | -f <family name>]
        [--nickname | -k <nickname>] [--username | -u <preferred username>]
        [--profile | -p <profile url>] [--picture | -i <picture url>]
        [--website | -w <website url>] [--email | -e <email>]

user:list

nvl user:list [--issuer | -i <issuer id>]

user:info

nvl user:info [<id>] [--issuer | -i <issuer id>]

user:update

nvl user:update [<id>] [--issuer | -i <issuer id>]
        [--name | -n <name>] [--given | -g <given name>]
        [--middle | -m <middle name>] [--family | -f <family name>]
        [--nickname | -k <nickname>] [--username | -u <preferred username>]
        [--profile | -p <profile url>] [--picture | -i <picture url>]
        [--website | -w <website url>] [--email | -e <email>]

user:delete

nvl user:delete [<id>] [--issuer | -i <issuer id>]

user:roles

nvl user:roles [<id>] [--issuer | -i <issuer id>]

user:assign

nvl user:assign [<user id> <role name>] [--issuer | -i <issuer id>]

user:revoke

nvl user:revoke [<user id> <role name>] [--issuer | -i <issuer id>]

user:token

nvl user:token [--issuer | -i <issuer id>]

Roles

role:register

nvl role:register [<id>] [--issuer | -i <issuer id>] [--name | -n <name>]

role:list

nvl role:list [--issuer | -i <issuer id>]

role:info

nvl role:info [<id>] [--issuer | -i <issuer id>]

role:update

nvl role:update [<id>] [--issuer | -i <issuer id>] [--name | -n <name>]

role:delete

nvl role:delete [<id>] [--issuer | -i <issuer id>]

role:scopes

nvl role:scopes [<role name>] [--issuer | -i <issuer id>]

role:permit

nvl role:permit [<role name> <scope name>] [--issuer | -i <issuer id>]

role:forbid

nvl role:forbid [<role name> <scope name>] [--issuer | -i <issuer id>]

Scopes

scope:register

nvl scope:register [<id>] [--issuer | -i <issuer id>] [--name | -n <name>]
        [--description | -d <description>] [--restricted | -r]

scope:list

nvl scope:list [--issuer | -i <issuer id>]

scope:info

nvl scope:info [<id>] [--issuer | -i <issuer id>]

scope:update

nvl scope:update [<id>] [--issuer | -i <issuer id>] [--name | -n <name>]
        [--description | -d <description>] [--restricted | -r]

scope:delete

nvl scope:delete [<id>] [--issuer | -i <issuer id>]

Version

nvl version