sreq auth

Interactively configure authentication for providers.

Synopsis

sreq auth [provider] [flags]

Description

The auth command provides an interactive setup wizard for configuring provider credentials. It guides you through setting up Consul and AWS authentication.

Subcommands

CommandDescription
sreq authInteractive setup for all providers
sreq auth consulConfigure Consul only
sreq auth awsConfigure AWS only

Examples

Full Interactive Setup

sreq auth

Output:

sreq Authentication Setup
==========================

1. Consul Configuration
------------------------
Consul address [consul.example.com:8500]: consul.mycompany.com:8500
Consul token: <hidden>
Test connection? [Y/n]: y
✓ Connected to Consul successfully

2. AWS Configuration
---------------------
AWS region [us-east-1]: us-west-2
AWS profile [default]: myprofile
Test connection? [Y/n]: y
✓ AWS credentials valid

Authentication setup complete!
Run 'sreq config test' to verify your configuration.

Configure Consul Only

sreq auth consul

Configure AWS Only

sreq auth aws

Provider Configuration

Consul

The wizard prompts for:

FieldDescriptionEnvironment Variable
AddressConsul server addressCONSUL_HTTP_ADDR
TokenACL token for authenticationCONSUL_HTTP_TOKEN
DatacenterOptional datacenter

AWS

The wizard prompts for:

FieldDescriptionEnvironment Variable
RegionAWS regionAWS_REGION
ProfileAWS credentials profileAWS_PROFILE

Configuration Output

The wizard updates ~/.sreq/config.yaml:

providers:
  consul:
    address: consul.mycompany.com:8500
    token: ${CONSUL_TOKEN}  # References environment variable
    datacenter: dc1

  aws_secrets:
    region: us-west-2
    profile: myprofile

Security Notes

  • Tokens can be stored directly or reference environment variables with ${VAR}
  • Environment variable references are recommended for sensitive values
  • Config file permissions are set to 600 (owner read/write only)

See Also