Polyjuice Client v0.4.2 Polyjuice.Client.WellKnown View Source

Look up and interpret a server's .well-known file.

https://matrix.org/docs/spec/client_server/latest#well-known-uri

Link to this section Summary

Functions

Get and parse a server's .well-known file based on its server name.

Get a server's .well-known file based on its server name.

Get the homeserver that's specified in a .well-known file.

Get the identity server that's specified in a .well-known file.

Link to this section Functions

Link to this function

discover_server(server_name)

View Source
discover_server(server_name :: String.t()) ::
  {:ok, String.t(), String.t() | nil | :fail_error, map()}
  | {:error, :ignore}
  | {:error, :fail_prompt}
  | {:error, :fail_error}

Get and parse a server's .well-known file based on its server name.

If the homeserver information is correct, returns a tuple of the form {:ok, homeserver_url, identity_server_url, well_known}, where identity_server_url is either a string giving the identity server's URL, nil indicating no identity server was specified, or :fail_error indicating an error in fetching the identity server URL; and well_known is the full contents of the well_known file.

This function is essentially equivalent to calling get_for_server followed by get_homeserver and get_identity_server.

Link to this function

get_for_server(server_name)

View Source
get_for_server(server_name :: String.t()) ::
  {:ok, map()}
  | {:error, :ignore}
  | {:error, :fail_prompt}
  | {:error, :fail_error}

Get a server's .well-known file based on its server name.

Link to this function

get_homeserver(well_known)

View Source
get_homeserver(map()) ::
  {:ok, String.t()} | {:error, :fail_error} | {:error, :fail_prompt}

Get the homeserver that's specified in a .well-known file.

Link to this function

get_identity_server(well_known)

View Source
get_identity_server(map()) :: {:ok, String.t()} | {:error, :fail_error}

Get the identity server that's specified in a .well-known file.