Skip to content

Commit

Permalink
Merge pull request #190 from danifr/preauth_auth-constraint
Browse files Browse the repository at this point in the history
Remove auth-constraint from web.xml if preauthenticated mode enabled
  • Loading branch information
jyaworski committed Mar 8, 2016
2 parents 596bcd8 + b710ab3 commit 922ad35
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 922ad35

Please sign in to comment.