Lti_1p3.Tool (Lti 1p3 v0.3.0)

Link to this section Summary

Functions

Creates a new deployment.

Creates a new registration.

Gets a user's cached lti_params from the given key. Returns nil if the lti_params do not exist.

Gets the registration with the given issuer and client_id.

Gets the registration and deployment associated with the given issuer, client_id and deployment_id.

Generates a cache key by using the hash of the provided parameters. The more parameters provided, the more specific the key can be. For example, to only generate a key for details that pertain to a platform, only provide an issuer and client_id. To generate a key for a specific platform user's context, provide all parameters.

Link to this section Functions

Link to this function

create_deployment(deployment)

Creates a new deployment.

Examples

iex> create_deployment(deployment)
{:ok, %Lti_1p3.Tool.Deployment{}}
iex> create_deployment(deployment)
{:error, %Lti_1p3.DataProviderError{}}
Link to this function

create_registration(registration)

Creates a new registration.

Examples

iex> create_registration(registration)
{:ok, %Lti_1p3.Tool.Registration{}}
iex> create_registration(registration)
{:error, %Lti_1p3.DataProviderError{}}
Link to this function

get_lti_params_by_key(key)

Gets a user's cached lti_params from the given key. Returns nil if the lti_params do not exist.

Examples

iex> get_lti_params_by_key("some-key")
%Lti_1p3.Tool.LtiParams{}
iex> get_lti_params_by_key("unknown-key")
nil
Link to this function

get_registration_by_issuer_client_id(issuer, client_id)

Gets the registration with the given issuer and client_id.

Examples

iex> get_registration_by_issuer_client_id(issuer, client_id)
%Registration{}
iex> get_registration_by_issuer_client_id(issuer, client_id)
nil
Link to this function

get_registration_deployment(issuer, client_id, deployment_id)

Gets the registration and deployment associated with the given issuer, client_id and deployment_id.

Examples

iex> get_registration_deployment(issuer, client_id, deployment_id)
{%Registration{}, %Deployment{}}
iex> get_registration_deployment(issuer, client_id, deployment_id)
{nil, nil}
Link to this function

lti_params_key(issuer, client_id, user_sub \\ "", context_id \\ "")

Generates a cache key by using the hash of the provided parameters. The more parameters provided, the more specific the key can be. For example, to only generate a key for details that pertain to a platform, only provide an issuer and client_id. To generate a key for a specific platform user's context, provide all parameters.

Examples

iex> lti_params_key("some-key")
%Lti_1p3.Tool.LtiParams{}
iex> lti_params_key("unknown-key")
nil