Lti_1p3.PlatformDataProvider behaviour (Lti 1p3 v0.6.0)

Link to this section Summary

Callbacks

Deletes all expired login hints older than the provided ttl_sec. If no ttl_sec is provided, the default value should be 86_400 seconds (1 day).

Gets a login hint associated with the given value.

Gets a platform instance associated with the given client_id.

Link to this section Callbacks

Link to this callback

create_login_hint(%Lti_1p3.Platform.LoginHint{})

@callback create_login_hint(%Lti_1p3.Platform.LoginHint{
  context: term(),
  id: term(),
  session_user_id: term(),
  value: term()
}) ::
  {:ok,
   %Lti_1p3.Platform.LoginHint{
     context: term(),
     id: term(),
     session_user_id: term(),
     value: term()
   }}
  | {:error, DataProviderError.t()}

Creates a new login hint.

examples

Examples

iex> create_login_hint(%LoginHint{})
{:ok, %LoginHint{}}
iex> create_login_hint(%LoginHint{})
{:error, %Lti_1p3.DataProviderError{}}
Link to this callback

create_platform_instance(%Lti_1p3.Platform.PlatformInstance{})

@callback create_platform_instance(%Lti_1p3.Platform.PlatformInstance{
  client_id: term(),
  custom_params: term(),
  description: term(),
  id: term(),
  keyset_url: term(),
  login_url: term(),
  name: term(),
  redirect_uris: term(),
  target_link_uri: term()
}) ::
  {:ok,
   %Lti_1p3.Platform.PlatformInstance{
     client_id: term(),
     custom_params: term(),
     description: term(),
     id: term(),
     keyset_url: term(),
     login_url: term(),
     name: term(),
     redirect_uris: term(),
     target_link_uri: term()
   }}
  | {:error, DataProviderError.t()}

Creates a new platform instance.

examples

Examples

iex> create_platform_instance(%PlatformInstance{})
{:ok, %PlatformInstance{}}
iex> create_platform_instance(%PlatformInstance{})
{:error, %Lti_1p3.DataProviderError{}}
Link to this callback

delete_expired_login_hints(arg1)

@callback delete_expired_login_hints(integer() | nil) :: any()

Deletes all expired login hints older than the provided ttl_sec. If no ttl_sec is provided, the default value should be 86_400 seconds (1 day).

examples

Examples

iex> delete_expired_login_hints(ttl_sec)
Link to this callback

get_login_hint_by_value(t)

@callback get_login_hint_by_value(String.t()) ::
  %Lti_1p3.Platform.LoginHint{
    context: term(),
    id: term(),
    session_user_id: term(),
    value: term()
  }
  | nil

Gets a login hint associated with the given value.

examples

Examples

iex> get_login_hint_by_value(value)
%LoginHint{}
iex> get_login_hint_by_value(value)
nil
Link to this callback

get_platform_instance_by_client_id(t)

@callback get_platform_instance_by_client_id(String.t()) ::
  %Lti_1p3.Platform.PlatformInstance{
    client_id: term(),
    custom_params: term(),
    description: term(),
    id: term(),
    keyset_url: term(),
    login_url: term(),
    name: term(),
    redirect_uris: term(),
    target_link_uri: term()
  }
  | nil

Gets a platform instance associated with the given client_id.

examples

Examples

iex> get_platform_instance_by_client_id(client_id)
%PlatformInstance{}
iex> get_platform_instance_by_client_id(client_id)
nil