https://github.com/tanguilp/apiac_auth_bearer_cache_cachex
https://github.com/tanguilp/apiac_auth_bearer_cache_cachex
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/tanguilp/apiac_auth_bearer_cache_cachex
- Owner: tanguilp
- License: apache-2.0
- Created: 2018-10-26T18:13:06.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-29T19:13:11.000Z (about 5 years ago)
- Last Synced: 2025-03-04T04:35:07.005Z (3 months ago)
- Language: Elixir
- Homepage: https://hexdocs.pm/apiac_auth_bearer_cache_cachex
- Size: 18.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# APIacAuthBearerCacheCachex
An application implementing the `APIacAuthBearer.Cache` behaviour with Cachex
## Installation
To use it in your application as your cache for the `APIacAuthBearer` plug, add this to your
dependencies:```elixir
def deps do
[
{:apiac_auth_bearer_cache_cachex, "~> 1.0"}
]
end
```and then reference this cache implementation in your plug options:
```elixir
Plug APIacAuthBearer, bearer_validator: {APIacAuthBearer,[...]},
cache: {APIacAuthBearerCacheCachex, [ttl: 60*10]}```
On startup, this application will automatically start the cache.
It is possible to add Cachex-specific configuration in the config files:
```elixir
config :apiac_auth_bearer_cache_cachex,
cachex_opts: ..., # Cachex cache options
```for example
```elixir
config :apiac_auth_bearer_cache_cachex,
cachex_opts: [
nodes: [
:node1@server1,
:node2@server1,
:node1@server2,
:node1@server3
],
limit: 200_000
]
```