View Source CsrfPlus.UserAccessInfo (CsrfPlus v0.1.0)

Defines a basic user access information containing the ip and the user agent.

Summary

Types

t()

The User access information.

Functions

Will convert a raw map with :ip and :user_agent into a CsrfPlus.UserAccessInfo struct.

Converts a JSON object string with :ip and :user_agent fields into a CsrfPlus.UserAccessInfo struct.

Converts a CsrfPlus.UserAccessInfo struct into a JSON object string.

Types

@type t() :: %CsrfPlus.UserAccessInfo{ip: String.t(), user_agent: String.t()}

The User access information.

  • :ip - The most trustable IP address you can get.
  • :user_agent - The user agent string of the requests.

Functions

Will convert a raw map with :ip and :user_agent into a CsrfPlus.UserAccessInfo struct.

Link to this function

user_info_from_string(user_info)

View Source

Converts a JSON object string with :ip and :user_agent fields into a CsrfPlus.UserAccessInfo struct.

Link to this function

user_info_to_string(user_info)

View Source

Converts a CsrfPlus.UserAccessInfo struct into a JSON object string.