# `MishkaCmsCore.Captcha.Providers.Turnstile`
[🔗](https://github.com/mishka-group/mishka_cms_core/blob/v0.0.1/lib/mishka_cms_core/captcha/providers/turnstile.ex#L5)

[Cloudflare Turnstile](https://developers.cloudflare.com/turnstile/) as a captcha provider.

Each scope keeps its own widget: its site key (`security.captcha.turnstile.site_key`) and its
secret key (`security.captcha.turnstile.secret_key`, a `:secret` setting). Whether the visitor
sees a box, a box that rarely asks anything, or nothing at all is the widget's mode, chosen in
Cloudflare's dashboard — the same code draws all three. The widget's hostname list there decides
where it may be drawn.

A token is good for five minutes and one check. Cloudflare's published test keys draw a box that
always passes (`1x00000000000000000000AA`) or always fails (`2x00000000000000000000AB`), and
verify with any token: always (`1x0000000000000000000000000000000AA`), never
(`2x0000000000000000000000000000000AA`), or as already spent (`3x0000000000000000000000000000000AA`).
They answer the same token and hostname wherever they were solved, so a test key's answer is held
neither to the site's address nor to the form, and not remembered as used.

# `error_return`

```elixir
@type error_return() ::
  {:error, [%{action: atom(), field: atom(), message: String.t()}]}
```

# `okey_return`

```elixir
@type okey_return() :: {:ok, struct() | map() | module() | [any()]}
```

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `config`

```elixir
@spec config() :: keyword()
```

# `config`

```elixir
@spec config(atom()) :: any()
```

# `enable`

```elixir
@spec enable() :: okey_return() | error_return()
```

# `get`

```elixir
@spec get() :: keyword()
```

# `health_check`

```elixir
@spec health_check() :: :ok | {:degraded, term()} | {:error, term()}
```

Optional. See `c:MishkaInstaller.Event.Hook.health_check/0`. Override to report health.

# `on_dependency_error`

```elixir
@spec on_dependency_error(term()) :: term()
```

Optional. See `c:MishkaInstaller.Event.Hook.on_dependency_error/1`. Override to react.

# `register`

```elixir
@spec register() :: okey_return() | error_return()
```

# `restart`

```elixir
@spec restart() :: okey_return() | error_return()
```

# `start`

```elixir
@spec start() :: okey_return() | error_return()
```

# `start_link`

# `stop`

```elixir
@spec stop() :: okey_return() | error_return()
```

# `unregister`

```elixir
@spec unregister() :: okey_return() | error_return()
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
