diff options
author | Mark Felder <feld@feld.me> | 2024-07-25 16:18:31 -0400 |
---|---|---|
committer | Mark Felder <feld@feld.me> | 2024-07-25 16:18:31 -0400 |
commit | 84b15ac1119396eeb9827fc5242489a4f5cb820b (patch) | |
tree | e04ccef40eb2ce2498b6207da34cbc39d0734b6e | |
parent | a964368e31ddf8a22dd36bbf2aae51f7d91bbdaf (diff) | |
download | pleroma-84b15ac1119396eeb9827fc5242489a4f5cb820b.tar.gz pleroma-84b15ac1119396eeb9827fc5242489a4f5cb820b.zip |
Improve specs and matching
-rw-r--r-- | lib/pleroma/signature.ex | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/pleroma/signature.ex b/lib/pleroma/signature.ex index 51dac2402..0f3362ebe 100644 --- a/lib/pleroma/signature.ex +++ b/lib/pleroma/signature.ex @@ -94,8 +94,8 @@ defmodule Pleroma.Signature do Timex.format!(date, "{WDshort}, {0D} {Mshort} {YYYY} {h24}:{m}:{s} GMT") end - @spec validate_signature(map(), String.t()) :: boolean() - def validate_signature(conn, request_target) do + @spec validate_signature(Plug.Conn.t(), String.t()) :: boolean() + def validate_signature(%Plug.Conn{} = conn, request_target) do # Newer drafts for HTTP signatures now use @request-target instead of the # old (request-target). We'll now support both for incoming signatures. conn = @@ -106,8 +106,8 @@ defmodule Pleroma.Signature do @http_signatures_impl.validate_conn(conn) end - @spec validate_signature(map()) :: boolean() - def validate_signature(conn) do + @spec validate_signature(Plug.Conn.t()) :: boolean() + def validate_signature(%Plug.Conn{} = conn) do # This (request-target) is non-standard, but many implementations do it # this way due to a misinterpretation of # https://datatracker.ietf.org/doc/html/draft-cavage-http-signatures-06 |