nats-server icon indicating copy to clipboard operation
nats-server copied to clipboard

sample config with leafnode and nkeys

Open tvojacek opened this issue 2 years ago • 0 comments

Is it possible to add to docs sample config with leaf nodes secured by nkey? I have found ugly solution using credential file but it require pretense of JWT token. I kept JWT token from docs and put correct USER NKEY SEED there. Is there better solution?

on leafnode nats.conf

leafnodes {
    remotes = [
        {
           url: "nats-leaf://@server_url:7422"
          account: someuser
         credentials: "server.creds"
        }
    ]
}

where server.creds is copy of example creds from docs

**** this part is keept as it is in docs ****
-----BEGIN NATS USER JWT-----
eyJ0eXAiOiJqd3QiLCJhbGciOiJlZDI1NTE5In0.eyJqdGkiOiJUVlNNTEtTWkJBN01VWDNYQUxNUVQzTjRISUw1UkZGQU9YNUtaUFhEU0oyWlAzNkVMNVJBIiwiaWF0IjoxNTU4MDQ1NTYyLCJpc3MiOiJBQlZTQk0zVTQ1REdZRVVFQ0tYUVM3QkVOSFdHN0tGUVVEUlRFSEFKQVNPUlBWV0JaNEhPSUtDSCIsIm5hbWUiOiJvbWVnYSIsInN1YiI6IlVEWEIyVk1MWFBBU0FKN1pEVEtZTlE3UU9DRldTR0I0Rk9NWVFRMjVIUVdTQUY3WlFKRUJTUVNXIiwidHlwZSI6InVzZXIiLCJuYXRzIjp7InB1YiI6e30sInN1YiI6e319fQ.6TQ2ilCDb6m2ZDiJuj_D_OePGXFyN3Ap2DEm3ipcU5AhrWrNvneJryWrpgi_yuVWKo1UoD5s8bxlmwypWVGFAA
------END NATS USER JWT------

************************* IMPORTANT *************************
NKEY Seed printed below can be used to sign and prove identity.
NKEYs are sensitive and should be treated as secrets.

-----BEGIN USER NKEY SEED-----
REAL_USER_PRIVATE_KEY
------END USER NKEY SEED------

*************************************************************

Server config for reference:

leafnodes {
  port: 7422
  authorization: {
        users: [ {user: UDXU4RCSJNZOIQHZNWXHXORDPRTGNJAHAHFRGZNEEJCPQTT2M7NLCNF4,  account: someuser}]
  }
}

tvojacek avatar Jun 16 '22 15:06 tvojacek