nixos/oauth2_proxy: actually pass provider-specific options

Syntax errors prevented important parameters from being passed to
oauth2_proxy, which could have permitted unauthorised access to
services behind the proxy.
This commit is contained in:
Rhys
2017-07-21 00:27:06 +02:00
committed by Franz Pletz
parent 17c8fe21fd
commit 8777174d60
@@ -21,21 +21,20 @@ let
''; '';
github = cfg: '' github = cfg: ''
$(optionalString (!isNull cfg.github.org) "--github-org=${cfg.github.org}") \ ${optionalString (!isNull cfg.github.org) "--github-org=${cfg.github.org}"} \
$(optionalString (!isNull cfg.github.team) "--github-org=${cfg.github.team}") \ ${optionalString (!isNull cfg.github.team) "--github-org=${cfg.github.team}"} \
''; '';
google = cfg: '' google = cfg: ''
--google-admin-email=${cfg.google.adminEmail} \ --google-admin-email=${cfg.google.adminEmail} \
--google-service-account=${cfg.google.serviceAccountJSON} \ --google-service-account=${cfg.google.serviceAccountJSON} \
$(repeatedArgs (group: "--google-group=${group}") cfg.google.groups) \ ${repeatedArgs (group: "--google-group=${group}") cfg.google.groups} \
''; '';
}; };
authenticatedEmailsFile = pkgs.writeText "authenticated-emails" cfg.email.addresses; authenticatedEmailsFile = pkgs.writeText "authenticated-emails" cfg.email.addresses;
getProviderOptions = cfg: provider: getProviderOptions = cfg: provider: providerSpecificOptions.${provider} or (_: "") cfg;
if providerSpecificOptions ? provider then providerSpecificOptions.provider cfg else "";
mkCommandLine = cfg: '' mkCommandLine = cfg: ''
--provider='${cfg.provider}' \ --provider='${cfg.provider}' \