docs+nix: add deployment README and align release packaging
This commit is contained in:
@@ -14,7 +14,7 @@ defmodule Parrhesia.Auth.Nip98 do
|
||||
def validate_authorization_header("Nostr " <> encoded_event, method, url)
|
||||
when is_binary(method) and is_binary(url) do
|
||||
with {:ok, event_json} <- decode_base64(encoded_event),
|
||||
{:ok, event} <- Jason.decode(event_json),
|
||||
{:ok, event} <- JSON.decode(event_json),
|
||||
:ok <- validate_event_shape(event),
|
||||
:ok <- validate_http_binding(event, method, url) do
|
||||
{:ok, event}
|
||||
|
||||
@@ -59,7 +59,7 @@ defmodule Parrhesia.Protocol do
|
||||
def encode_relay(message) do
|
||||
message
|
||||
|> relay_frame()
|
||||
|> Jason.encode!()
|
||||
|> JSON.encode!()
|
||||
end
|
||||
|
||||
@spec decode_error_notice(decode_error()) :: String.t()
|
||||
@@ -77,7 +77,7 @@ defmodule Parrhesia.Protocol do
|
||||
end
|
||||
|
||||
defp decode_json(payload) do
|
||||
case Jason.decode(payload) do
|
||||
case JSON.decode(payload) do
|
||||
{:ok, decoded} -> {:ok, decoded}
|
||||
{:error, _reason} -> {:error, :invalid_json}
|
||||
end
|
||||
|
||||
@@ -71,7 +71,7 @@ defmodule Parrhesia.Protocol.EventValidator do
|
||||
event["tags"],
|
||||
event["content"]
|
||||
]
|
||||
|> Jason.encode!()
|
||||
|> JSON.encode!()
|
||||
|> then(&:crypto.hash(:sha256, &1))
|
||||
|> Base.encode16(case: :lower)
|
||||
end
|
||||
|
||||
@@ -493,7 +493,7 @@ defmodule Parrhesia.Web.Connection do
|
||||
|
||||
defp generate_hll_payload(filters, count) do
|
||||
filters
|
||||
|> Jason.encode!()
|
||||
|> JSON.encode!()
|
||||
|> then(&"#{&1}:#{count}")
|
||||
|> then(&:crypto.hash(:sha256, &1))
|
||||
|> Base.encode64()
|
||||
|
||||
@@ -76,7 +76,7 @@ defmodule Parrhesia.Web.Management do
|
||||
defp normalize_result(result), do: %{"value" => inspect(result)}
|
||||
|
||||
defp send_json(conn, status, body) do
|
||||
encoded = Jason.encode!(body)
|
||||
encoded = JSON.encode!(body)
|
||||
|
||||
conn
|
||||
|> put_resp_content_type("application/json")
|
||||
|
||||
@@ -11,7 +11,7 @@ defmodule Parrhesia.Web.Router do
|
||||
plug(Plug.Parsers,
|
||||
parsers: [:json],
|
||||
pass: ["application/json"],
|
||||
json_decoder: Jason
|
||||
json_decoder: JSON
|
||||
)
|
||||
|
||||
plug(:match)
|
||||
@@ -43,7 +43,7 @@ defmodule Parrhesia.Web.Router do
|
||||
|
||||
get "/relay" do
|
||||
if accepts_nip11?(conn) do
|
||||
body = Jason.encode!(RelayInfo.document())
|
||||
body = JSON.encode!(RelayInfo.document())
|
||||
|
||||
conn
|
||||
|> put_resp_content_type("application/nostr+json")
|
||||
|
||||
Reference in New Issue
Block a user