1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2018 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Captcha.Service do
7 Request new captcha from a captcha service.
11 Service-specific data for using the newly created captcha
13 @callback new() :: map
16 Validated the provided captcha solution.
19 * `token` the captcha is associated with
20 * `captcha` solution of the captcha to validate
24 `true` if captcha is valid, `false` if not
26 @callback validate(token :: String.t(), captcha :: String.t()) :: boolean
29 This function is called periodically to clean up old captchas
31 @callback cleanup() :: :ok