Skip to content

Commit

Permalink
Remove auth-constraint from web.xml if preauthenticated mode enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
danifr committed Mar 8, 2016
1 parent 801746f commit b710ab3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions manifests/config/global/web.pp
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,20 @@
incl => $rundeck::params::web_xml,
changes => [ "set web-app/session-config/session-timeout/#text '${session_timeout}'" ],
}

if $rundeck::preauthenticated_config['enabled'] {
augeas { 'rundeck/web.xml/security-constraint/auth-constraint':
lens => 'Xml.lns',
incl => $rundeck::params::web_xml,
changes => [ 'rm web-app/security-constraint/auth-constraint' ],
}
}
else {
augeas { 'rundeck/web.xml/security-constraint/auth-constraint/role-name':
lens => 'Xml.lns',
incl => $rundeck::params::web_xml,
changes => [ "set web-app/security-constraint[last()+1]/auth-constraint/role-name/#text '*'" ],
onlyif => 'match web-app/security-constraint/auth-constraint/role-name size == 0',
}
}
}

0 comments on commit b710ab3

Please sign in to comment.