Account lookup using Resolver
最后更新于
这有帮助吗?
最后更新于
这有帮助吗?
The resolver
configuration option is used in conjunction with and . The resolver
option specifies a URL where the nats-server can retrieve an account JWT. There are two built-in resolver implementations:
URL
MEMORY
If the operator JWT specified in
operator
contains an account resolver URL,resolver
only needs to be specified in order to overwrite that default.
The URL
resolver specifies a URL where the server can append an account public key to retrieve that account's JWT. Convention for is to serve JWTs at: http://localhost:9090/jwt/v1/accounts/
. For such a configuration you would specify the resolver as follows:
Note that if you are not using a nats-account-server, the URL can be anything as long as by appending the public key for an account, the requested JWT is returned.
If the server used requires client authentication, or you want to specify which CA is trusted for the lookup of account information, specify resolver_tls
. This lets you further restrict TLS to the resolver.
The MEMORY
resolver is statically configured in the server's configuration file. The memory resolver makes use of the resolver_preload
directive, which specifies a map of a public key to an account JWT:
The MEMORY
resolver is recommended when the server has a small number of accounts that don't change very often.
For more information on how to configure a memory resolver, see .