Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix jaas-loginmodule template #537

Merged
merged 1 commit into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions spec/classes/config/jaas_auth_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

it 'jaas-loginmodule.conf contains no auth classes' do
jaas_auth = catalogue.resource('file', '/etc/rundeck/jaas-loginmodule.conf')[:content]
expect(jaas_auth).not_to include('org.eclipse.jetty.jaas.spi.PropertyFileLoginModule')
expect(jaas_auth).not_to include('org.rundeck.jaas.jetty.ReloadablePropertyFileLoginModule')
expect(jaas_auth).not_to include('com.dtolabs.rundeck.jetty.jaas.JettyCombinedLdapLoginModule')
expect(jaas_auth).not_to include('com.dtolabs.rundeck.jetty.jaas.JettyCachingLdapLoginModule')
expect(jaas_auth).not_to include('org.rundeck.jaas.jetty.JettyPamLoginModule')
Expand Down Expand Up @@ -56,7 +56,7 @@

it 'contains PropertyFileLoginModule and default auth_flag' do
jaas_auth = catalogue.resource('file', '/etc/rundeck/jaas-loginmodule.conf')[:content]
expect(jaas_auth).to include('org.eclipse.jetty.jaas.spi.PropertyFileLoginModule required')
expect(jaas_auth).to include('org.rundeck.jaas.jetty.ReloadablePropertyFileLoginModule required')
end
end

Expand Down Expand Up @@ -91,7 +91,7 @@

it 'contains PropertyFileLoginModule and be sufficient' do
jaas_auth = catalogue.resource('file', '/etc/rundeck/jaas-loginmodule.conf')[:content]
expect(jaas_auth).to include('org.eclipse.jetty.jaas.spi.PropertyFileLoginModule required')
expect(jaas_auth).to include('org.rundeck.jaas.jetty.ReloadablePropertyFileLoginModule required')
end
end

Expand Down Expand Up @@ -127,7 +127,7 @@

it 'contains PropertyFileLoginModule and be sufficient' do
jaas_auth = catalogue.resource('file', '/etc/rundeck/jaas-loginmodule.conf')[:content]
expect(jaas_auth).to include('org.eclipse.jetty.jaas.spi.PropertyFileLoginModule required')
expect(jaas_auth).to include('org.rundeck.jaas.jetty.ReloadablePropertyFileLoginModule required')
end
end

Expand Down Expand Up @@ -170,7 +170,7 @@

it 'contains PropertyFileLoginModule and be sufficient' do
jaas_auth = catalogue.resource('file', '/etc/rundeck/jaas-loginmodule.conf')[:content]
expect(jaas_auth).to include('org.eclipse.jetty.jaas.spi.PropertyFileLoginModule sufficient')
expect(jaas_auth).to include('org.rundeck.jaas.jetty.ReloadablePropertyFileLoginModule sufficient')
end
end

Expand Down Expand Up @@ -282,7 +282,7 @@

it 'generates valid content for jaas-loginmodule.conf' do
content = catalogue.resource('file', '/etc/rundeck/jaas-loginmodule.conf')[:content]
expect(content).to include('org.eclipse.jetty.jaas.spi.PropertyFileLoginModule sufficient')
expect(content).to include('org.rundeck.jaas.jetty.ReloadablePropertyFileLoginModule sufficient')
expect(content).to include('file="/etc/rundeck/realm.properties";')
expect(content).to include('com.dtolabs.rundeck.jetty.jaas.JettyCombinedLdapLoginModule required')
expect(content).to include('debug="true"')
Expand Down
4 changes: 2 additions & 2 deletions templates/jaas-loginmodule.conf.epp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ authentication {
<%- $_auth_config.keys.each |$_type| { -%>
<%- if $_type == 'file' { -%>
<%- if $_auth_config['file']['auth_flag'] { -%>
org.eclipse.jetty.jaas.spi.PropertyFileLoginModule <%= $_auth_config['file']['auth_flag'] %>
org.rundeck.jaas.jetty.ReloadablePropertyFileLoginModule <%= $_auth_config['file']['auth_flag'] %>
<%- } else { -%>
org.eclipse.jetty.jaas.spi.PropertyFileLoginModule required
org.rundeck.jaas.jetty.ReloadablePropertyFileLoginModule required
<%- } -%>
<%- $_auth_config['file']['jaas_config'].each |$_k, $_v| { -%>
<%= $_k -%>=<% if keys($_auth_config['file']['jaas_config'])[-1] == $_k { -%>"<%= $_v %>";<% } else { -%>"<%= $_v %>"<%- } %>
Expand Down