Lti_1p3.Examples.KeyProviderConfig (Lti 1p3 v0.10.0)

Example configuration for the LTI 1.3 key provider.

This module provides example configurations that client applications can use as a reference when setting up the key provider in their supervision tree.

basic-usage

Basic Usage

Add the key provider supervisor to your application's supervision tree:

# In your application.ex file
defmodule MyApp.Application do
  use Application

  def start(_type, _args) do
    children = [
      # ... your other children
      Lti_1p3.Examples.KeyProviderConfig.child_spec()
    ]

    Supervisor.start_link(children, strategy: :one_for_one, name: MyApp.Supervisor)
  end
end

custom-configuration

Custom Configuration

You can also configure the key provider with custom settings:

children = [
  {Lti_1p3.KeyProviderSupervisor, [
    key_provider: Lti_1p3.KeyProviders.MemoryKeyProvider,
    refresh_interval: 600,  # 10 minutes
    cache_ttl: 1800        # 30 minutes
  ]}
]

configuration-options

Configuration Options

  • :key_provider - The key provider module (default: Lti_1p3.KeyProviders.MemoryKeyProvider)
  • :refresh_interval - How often to refresh stale keys in seconds (default: 1800 - 30 minutes)
  • :cache_ttl - Default cache TTL in seconds (default: 3600 - 1 hour)

application-configuration

Application Configuration

You can also configure the key provider through your application config:

# config/config.exs
config :lti_1p3,
  key_provider: Lti_1p3.KeyProviders.MemoryKeyProvider,
  key_provider_cache_ttl: 3600,
  key_provider_refresh_interval: 1800

Link to this section Summary

Functions

Returns a child spec for the key provider with default production-ready settings.

Returns a child spec optimized for development with faster refresh times.

Returns a child spec optimized for testing with very short refresh times.

Link to this section Functions

Link to this function

child_spec(opts \\ [])

Returns a child spec for the key provider with default production-ready settings.

Link to this function

dev_child_spec(opts \\ [])

Returns a child spec optimized for development with faster refresh times.

Link to this function

test_child_spec(opts \\ [])

Returns a child spec optimized for testing with very short refresh times.