mirror of
https://github.com/team-alembic/ash_authentication.git
synced 2024-09-19 12:52:55 +12:00
docs: Add new Testing guide
It's pretty bare-bones at the moment, but does close #476 by mentioning that `bcrypt_elixir` can be tweaked for faster tests
This commit is contained in:
parent
15ea60dfd1
commit
739a544651
3 changed files with 22 additions and 0 deletions
|
@ -91,6 +91,10 @@ Dispatching to plugs directly:
|
|||
...> conn = Strategy.plug(strategy, :reset_request, conn)
|
||||
...> {_conn, :ok} = Plug.Helpers.get_authentication_result(conn)
|
||||
|
||||
## Testing
|
||||
|
||||
See the [Testing guide](/documentation/topics/testing.md) for tips on testing resources using this strategy.
|
||||
|
||||
## DSL Documentation
|
||||
|
||||
Strategy for authenticating using local resources as the source of truth.
|
||||
|
|
14
documentation/topics/testing.md
Normal file
14
documentation/topics/testing.md
Normal file
|
@ -0,0 +1,14 @@
|
|||
# Testing
|
||||
|
||||
Tips and tricks to help test your apps.
|
||||
|
||||
## When using the Password strategy
|
||||
|
||||
AshAuthentication uses `bcrypt_elixir` for hashing passwords for secure storage, which by design has a high computational cost. To reduce the cost (make hashing faster), you can reduce the number of computation rounds it performs in tests:
|
||||
|
||||
```elixir
|
||||
# in config/test.exs
|
||||
|
||||
# Do NOT set this value for production
|
||||
config :bcrypt_elixir, log_rounds: 1
|
||||
```
|
|
@ -90,6 +90,10 @@ defmodule AshAuthentication.Strategy.Password do
|
|||
...> conn = Strategy.plug(strategy, :reset_request, conn)
|
||||
...> {_conn, :ok} = Plug.Helpers.get_authentication_result(conn)
|
||||
|
||||
## Testing
|
||||
|
||||
See the [Testing guide](/documentation/topics/testing.md) for tips on testing resources using this strategy.
|
||||
|
||||
## DSL Documentation
|
||||
|
||||
#{Spark.Dsl.Extension.doc_entity(Dsl.dsl())}
|
||||
|
|
Loading…
Reference in a new issue