-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1186 from roeschter/main
Basic nats cheat auth
- Loading branch information
Showing
3 changed files
with
63 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Basic steps for setting up decentralized authentication | ||
All configuration changes are stored locally until `nats auth account push`ed to a nats cluster. | ||
|
||
# Create a new operator and set as working context | ||
nats auth operator add sysopp | ||
|
||
# Generate a template server configuration file from an operator | ||
nats server generate server.conf | ||
|
||
# Create a new account | ||
nats auth account add MyAccount | ||
|
||
# Create a new user in an account | ||
nats auth user add MyUser | ||
|
||
# Create an admin user in system account | ||
nats auth user add admin SYSTEM | ||
|
||
# Export credentials for a user | ||
nats auth user credential sys_admin.cred admin SYSTEM | ||
|
||
# Push an account or its changes from a specific operator to a specific server, using system account credentials. | ||
nats auth account push MyAccount --server nats://localhost:4222 --operator sysopp --creds sys_admin.cred | ||
|
||
# Use `nats context` and `nats auth operator select` to set defaults | ||
nats context add sysadmin --description "System Account" --server nats://localhost:4222 --creds sys_admin.cred | ||
|
||
nats auth operator select sysopp | ||
|
||
# Push account with default settings | ||
nats auth account push MyAccount | ||
|
||
|