Manager API - Set noCache=1 to getConf before calling saveConf (related to #2058)

lowercase-endpoints
Soisik Froger 5 years ago
parent 1b2fe5804f
commit 715987c292
  1. 11
      lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Api/Providers/OidcRp.pm
  2. 11
      lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Api/Providers/SamlSp.pm

@ -22,9 +22,6 @@ sub getOidcRpByConfKey {
my $oidcRp = $self->_getOidcRpByConfKey( $conf, $confKey );
# $self->logger->debug("$oidcRp :: ");
# use Data::Dumper; print STDERR Dumper($oidcRp);
# Return 404 if not found
unless ( defined $oidcRp ) {
return $self->sendError( $req,
@ -120,7 +117,7 @@ sub addOidcRp {
);
# Get latest configuration
my $conf = $self->_confAcc->getConf;
my $conf = $self->_confAcc->getConf({ noCache => 1 });
if ( defined $self->_getOidcRpByConfKey( $conf, $add->{confKey} ) ) {
return $self->sendError(
@ -168,7 +165,7 @@ sub updateOidcRp {
"[API] OIDC RP $confKey configuration update requested");
# Get latest configuration
my $conf = $self->_confAcc->getConf;
my $conf = $self->_confAcc->getConf({ noCache => 1 });
my $current = $self->_getOidcRpByConfKey( $conf, $confKey );
@ -215,7 +212,7 @@ sub replaceOidcRp {
"[API] OIDC RP $confKey configuration replace requested");
# Get latest configuration
my $conf = $self->_confAcc->getConf;
my $conf = $self->_confAcc->getConf({ noCache => 1 });
# Return 404 if not found
unless ( defined $self->_getOidcRpByConfKey( $conf, $confKey ) ) {
@ -245,7 +242,7 @@ sub deleteOidcRp {
or return $self->sendError( $req, 'confKey is missing', 400 );
# Get latest configuration
my $conf = $self->_confAcc->getConf;
my $conf = $self->_confAcc->getConf({ noCache => 1 });
my $delete = $self->_getOidcRpByConfKey( $conf, $confKey );

@ -22,9 +22,6 @@ sub getSamlSpByConfKey {
my $samlSp = $self->_getSamlSpByConfKey( $conf, $confKey );
# $self->logger->debug("$oidcRp :: ");
# use Data::Dumper; print STDERR Dumper($oidcRp);
# Check if confKey is defined
unless ( defined $samlSp ) {
return $self->sendError( $req,
@ -126,7 +123,7 @@ sub addSamlSp {
);
# Get latest configuration
my $conf = $self->_confAcc->getConf;
my $conf = $self->_confAcc->getConf({ noCache => 1 });
if ( defined $self->_getSamlSpByConfKey( $conf, $add->{confKey} ) ) {
return $self->sendError(
@ -172,7 +169,7 @@ sub replaceSamlSp {
"[API] SAML SP $confKey configuration replace requested");
# Get latest configuration
my $conf = $self->_confAcc->getConf;
my $conf = $self->_confAcc->getConf({ noCache => 1 });
# Return 404 if not found
unless ( defined $self->_getSamlSpByConfKey( $conf, $confKey ) ) {
@ -211,7 +208,7 @@ sub updateSamlSp {
"[API] SAML SP $confKey configuration update requested");
# Get latest configuration
my $conf = $self->_confAcc->getConf;
my $conf = $self->_confAcc->getConf({ noCache => 1 });
my $current = $self->_getSamlSpByConfKey( $conf, $confKey );
@ -248,7 +245,7 @@ sub deleteSamlSp {
or return $self->sendError( $req, 'confKey is missing', 400 );
# Get latest configuration
my $conf = $self->_confAcc->getConf;
my $conf = $self->_confAcc->getConf({ noCache => 1 });
my $delete = $self->_getSamlSpByConfKey( $conf, $confKey );

Loading…
Cancel
Save