handnot2 / samly

Elixir Plug library to enable SAML 2.0 SP SSO in Phoenix/Plug applications.
MIT License
125 stars 90 forks source link

Provide a behaviour for identity providers storage #56

Open adanselm opened 3 years ago

adanselm commented 3 years ago

The idea is to de-correlate identity providers storage from the rest of the application. A Samly.IdpDataStore.Store behaviour was created, as well as a default implementation Samly.IdpDataStore.Config that does exactly the same as before (read from configuration). A new configuration option was added to customize the IdP storage module to be used:

config :samly, Samly.Provider,
      idp_data_store: MyApp.IdpStore

If not provided, the default one will be used.

This is intended as a first step towards dynamic IdP data storage. Next step will be to try another implementation and check if Samly's public interface provides all functions needed.