in pan-domain-auth-core/src/main/scala/com/gu/pandomainauth/model/PanDomainAuthSettings.scala [35:62]
def apply(settingMap: Map[String, String]): SettingsResult[PanDomainAuthSettings] = {
val cookieSettings = CookieSettings(
cookieName = settingMap.getOrElse(legacyCookieNameSetting, settingMap("cookieName"))
)
val oAuthSettings = OAuthSettings(
settingMap("clientId"),
settingMap("clientSecret"),
settingMap("discoveryDocumentUrl"),
settingMap.get("organizationDomain")
)
val google2faSettings = for(
serviceAccountId <- settingMap.get("googleServiceAccountId");
serviceAccountCert <- settingMap.get("googleServiceAccountCert");
adminUser <- settingMap.get("google2faUser");
group <- settingMap.get("multifactorGroupId")
) yield Google2FAGroupSettings(serviceAccountId, serviceAccountCert, adminUser, group)
for {
cryptoConf <- CryptoConf.SettingsReader(settingMap).signingAndVerificationConf
} yield PanDomainAuthSettings(
cryptoConf,
cookieSettings,
oAuthSettings,
google2faSettings
)
}