Skip to content

Commit 68fd575

Browse files
committed
Ensure that the private key is not accidentally sent to the frontend
1 parent 6b1a91b commit 68fd575

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

lib/GADS.pm

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1777,9 +1777,33 @@ any ['get', 'post'] => '/authentication_providers/:id' => require_any_role [qw/u
17771777
{ 'label_plain' => 'builtin', value => 'builtin'},
17781778
);
17791779

1780+
# This is required to ensure we do not accidentally pass the
1781+
# private key to the frontend - we could allow the admin
1782+
# to update the key and cert manually by displaying an empty
1783+
# sp_key field in the template;
1784+
my %provider = (
1785+
name => $editProvider->name,
1786+
type => $editProvider->type,
1787+
saml2_firstname => $editProvider->saml2_firstname,
1788+
saml2_surname => $editProvider->saml2_surname,
1789+
xml => $editProvider->xml,
1790+
cacert => $editProvider->cacert,
1791+
sp_cert => $editProvider->sp_cert,
1792+
saml2_relaystate => $editProvider->saml2_relaystate,
1793+
saml2_groupname => $editProvider->saml2_groupname,
1794+
saml2_unique_id => $editProvider->saml2_unique_id,
1795+
sso_url => $editProvider->sso_url,
1796+
sso_xml => $editProvider->sso_xml,
1797+
enabled => $editProvider->enabled,
1798+
sp_key => '',
1799+
id => $editProvider->id,
1800+
site_id => $editProvider->site_id,
1801+
error_messages => $editProvider->error_messages,
1802+
);
1803+
17801804
# FIXME need to revise what is passed to the template
17811805
my $output = template 'authentication/provider_edit' => {
1782-
editprovider => $editProvider,
1806+
editprovider => \%provider,
17831807
groups => GADS::Groups->new(schema => schema)->all,
17841808
values => {
17851809
type => \@types,

0 commit comments

Comments
 (0)