Skip to content

Commit

Permalink
chore: prepare v3 release
Browse files Browse the repository at this point in the history
  • Loading branch information
yordis committed Sep 11, 2023
1 parent 8cbe3a6 commit 5bcc4d5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## v3.0.0

* Introduced `Guardian.DB.Adapter` behaviour to allow for custom database adapters to be used with Guardian DB.
Add`config :guardian, Guardian.DB, adapter: Guardian.DB.EctoAdapter` to fallback to the default Ecto adapter.
* Allow migrations mix task with custom table name.
* Make `jti` and `aud` required fields, since they are primary keys.

### Breaking changes

* `Guardian.DB.Token.SweeperServer` becomes `Guardian.DB.Sweeper`

## v2.0.2

* Fix deps range to include Guardian 2
Expand Down
8 changes: 4 additions & 4 deletions lib/guardian/db.ex
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ defmodule Guardian.DB do
* `prefix` - The schema prefix to use.
* `schema_name` - The name of the schema to use. Default "guardian_tokens".
* `sweep_interval` - The interval between db sweeps to remove old tokens.
Default 60 (mins).
Default 60 (minutes).
### Sweeper
In order to sweep your expired tokens from the db, you'll need to add
`Guardian.DB.Token.SweeperServer` to your supervision tree.
`Guardian.DB.Sweeper` to your supervision tree.
In your supervisor add it as a worker
```elixir
worker(Guardian.DB.Token.SweeperServer, [])
worker(Guardian.DB.Sweeper, [interval: 60])
```
# Migration
Expand All @@ -69,7 +69,7 @@ defmodule Guardian.DB do
```elixir
config :guardian, Guardian.DB,
schema_name: "my_customy_custom_schema
schema_name: "my_custom_schema
```
And when you run `mix guardian.db.gen.migration` it'll generate the following
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Guardian.DB.Mixfile do
use Mix.Project

@version "2.1.0"
@version "3.0.0"
@source_url "https://github.com/ueberauth/guardian_db"

def project do
Expand Down

0 comments on commit 5bcc4d5

Please sign in to comment.