-
Notifications
You must be signed in to change notification settings - Fork 105
Expand file tree
/
Copy pathstore.ex
More file actions
29 lines (24 loc) · 953 Bytes
/
Copy pathstore.ex
File metadata and controls
29 lines (24 loc) · 953 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
defmodule Samly.IdpDataStore.Store do
alias Samly.IdpData
alias Samly.SpData
@doc """
Called during GenServer init to initializes the store.
Takes an optional list of `identity_providers` to populate the store from,
and the already-configured map of `service_providers` data.
"""
@callback init([map], %{SpData.id() => SpData.t()}) :: :ok | {:error, any()}
@doc """
Fetches the IdpData for the given Id from the store.
"""
@callback get(binary) :: nil | IdpData.t()
@doc """
Saves the IdpData for the given Id into the store.
Could be omitted by implementation. In that case, it should return `:unsupported`
"""
@callback put(binary, IdpData.t()) :: :ok | :unsupported | {:error, any()}
@doc """
Removes the IdpData for the given Id from the store.
Could be omitted by implementation. In that case, it should return `:unsupported`
"""
@callback delete(binary) :: :ok | :unsupported | {:error, any()}
end