Skip to content
This repository was archived by the owner on Jul 28, 2020. It is now read-only.

Commit 2aa543b

Browse files
authored
Merge pull request #75 from fuze/master
Fixed spec tests and default recipe to handle new st2auth config
2 parents 4de02f6 + 479fef0 commit 2aa543b

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

attributes/config.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
auth_enable: true,
1818
auth_mode: 'standalone',
1919
auth_backend: 'flat_file',
20-
auth_backend_kwargs: { file_path: '/etc/st2/htpasswd' },
20+
auth_backend_kwargs: { 'file_path' => '/etc/st2/htpasswd' },
2121

2222
syslog_enabled: false,
2323
syslog_host: '127.0.0.1',

recipes/default.rb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111
include_recipe 'stackstorm::_services'
1212

1313
# Generate username & password for htpasswd flat-file authentication
14-
htpasswd ':add credentials to htpasswd file' do
15-
file node['stackstorm']['config']['auth_standalone_file']
16-
user node['stackstorm']['username']
17-
password node['stackstorm']['password']
18-
action :add
14+
if node['stackstorm']['config']['auth_backend'] == 'flat_file'
15+
htpasswd ':add credentials to htpasswd file' do
16+
file node['stackstorm']['config']['auth_backend_kwargs']['file_path']
17+
user node['stackstorm']['username']
18+
password node['stackstorm']['password']
19+
action :add
20+
end
1921
end

spec/recipes/config_spec.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,9 @@
168168
'auth_use_ssl' => false,
169169
'auth_debug' => false,
170170
'auth_enable' => true,
171-
'auth_standalone_file' => '/etc/st2/htpasswd',
171+
'auth_mode' => 'standalone',
172+
'auth_backend' => 'flat_file',
173+
'auth_backend_kwargs' => { 'file_path' => '/etc/st2/htpasswd' },
172174

173175
'syslog_enabled' => false,
174176
'syslog_host' => '127.0.0.1',

0 commit comments

Comments
 (0)