1
0
mirror of https://github.com/taigrr/nats.docs synced 2025-01-18 04:03:23 -08:00

Update resolver.md

This commit is contained in:
Ginger Collison 2020-01-06 16:04:57 -06:00 committed by GitHub
parent a1a61731b1
commit 370550b31f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,23 +1,23 @@
# resolver # resolver
The `resolver` configuration option is used in conjunction with [NATS JWT Authentication](securing_nats/auth_intro/jwt_auth.md) and [nsc](../../nats-tools/nsc/nsc). The `resolver` option specifies an URL where the nats-server can retrieve an account JWT. There are two built-in resolver implementations: The `resolver` configuration option is used in conjunction with [NATS JWT Authentication](securing_nats/auth_intro/jwt_auth.md) and [nsc](../../nats-tools/nsc/nsc). The `resolver` option specifies a URL where the nats-server can retrieve an account JWT. There are two built-in resolver implementations:
- `URL` - `URL`
- `MEMORY` - `MEMORY`
# URL Resolver ## URL Resolver
The `URL` resolver specifies an URL where the server can append an account public key to retrieve that accounts JWT. Convention for [NATS Account JWT Servers](../../nats-tools/nas) is to serve JWTs at: `http://localhost:9090/jwt/v1/accounts/`. For such a configuration you would specify the resolver as follows: The `URL` resolver specifies a URL where the server can append an account public key to retrieve that account's JWT. Convention for [NATS Account JWT Servers](../../nats-tools/nas) is to serve JWTs at: `http://localhost:9090/jwt/v1/accounts/`. For such a configuration you would specify the resolver as follows:
```yaml ```yaml
resolver: URL(http://localhost:9090/jwt/v1/accounts/) resolver: URL(http://localhost:9090/jwt/v1/accounts/)
``` ```
Note that if not using a nats-account-server, the URL can be anything so long as by appending the public key for an account, the requested JWT is returned. 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.
For more information on how to configure an account server, see [NATS Account JWT Server](../../nats-tools/nas). For more information on how to configure an account server, see [NATS Account JWT Server](../../nats-tools/nas).
# MEMORY ## MEMORY
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 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:
@ -30,4 +30,4 @@ ACSU3Q6LTLBVLGAQUONAGXJHVNWGSKKAUA7IY5TB4Z7PLEKSR5O6JTGR: eyJ0eXAiOiJqd3QiLCJhbG
The `MEMORY` resolver is recommended when the server has a small number of accounts that don't change very often. 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 [this tutorial](../../nats-tools/nas/mem_resolver.md). For more information on how to configure a memory resolver, see [this tutorial](../../nats-tools/nas/mem_resolver.md).