oauth
oauth copied to clipboard
loadFromEnvironment
I use something like this instead of loadConfig in settings.d.
This isn't something complex, hence I opened this issue to see whether this would be interesting for others.
auto loadFromEnvironment(
string providerName,
string envPrefix,
string redirectUri,
)
{
import std.process : environment;
string clientId = environment[envPrefix ~ "_CLIENTID"];
string clientSecret = environment[envPrefix ~ "_CLIENTSECRET"];
return new immutable(OAuthSettings)(
providerName,
clientId,
clientSecret,
redirectUri);
}
Yes, a requirement for certain deployments.