|
53 | 53 | 'DATASOURCES_DEFAULT_PASSWORD=±!@#$%^&*()_+=-}{|:;<>?', |
54 | 54 | 'DATASOURCES_DEFAULT_USERNAME=passbolt', |
55 | 55 | 'DATASOURCES_DEFAULT_DATABASE=passbolt', |
56 | | - 'PASSBOLT_SSL_FORCE=true' |
| 56 | + 'PASSBOLT_SSL_FORCE=true', |
| 57 | + 'PASSBOLT_PLUGINS_JWT_AUTHENTICATION_ENABLED=true' |
57 | 58 | ], |
58 | 59 | 'Image' => @image.id, |
59 | 60 | 'Binds' => $binds |
|
74 | 75 | let(:passbolt_host) { @container.json['NetworkSettings']['IPAddress'] } |
75 | 76 | let(:uri) { '/healthcheck/status.json' } |
76 | 77 | let(:curl) { "curl -sk -o /dev/null -w '%{http_code}' -H 'Host: passbolt.local' https://#{passbolt_host}:#{$https_port}/#{uri}" } |
| 78 | + let(:jwt_conf) { "#{PASSBOLT_CONFIG_PATH + '/jwt'}" } |
| 79 | + let(:jwt_key_pair) { ["#{jwt_conf}/jwt.key", "#{jwt_conf}/jwt.pem"] } |
77 | 80 |
|
78 | 81 | let(:rootless_env_setup) do |
79 | 82 | # The sed command needs to create a temporary file on the same directory as the destination file (/etc/cron.d). |
|
167 | 170 | end |
168 | 171 | end |
169 | 172 |
|
| 173 | + describe 'jwt configuration' do |
| 174 | + it 'should have the correct permissions' do |
| 175 | + expect(file(jwt_conf)).to be_a_directory |
| 176 | + expect(file(jwt_conf)).to be_mode 550 |
| 177 | + expect(file(jwt_conf)).to be_owned_by($root_user) |
| 178 | + expect(file(jwt_conf)).to be_grouped_into($config_group) |
| 179 | + end |
| 180 | + |
| 181 | + describe 'JWT key file' do |
| 182 | + it 'should exist' do |
| 183 | + expect(file("#{jwt_conf}/jwt.key")).to exist |
| 184 | + expect(file("#{jwt_conf}/jwt.key")).to be_mode 440 |
| 185 | + end |
| 186 | + end |
| 187 | + |
| 188 | + describe 'JWT pem file' do |
| 189 | + it 'should exist' do |
| 190 | + expect(file("#{jwt_conf}/jwt.pem")).to exist |
| 191 | + expect(file("#{jwt_conf}/jwt.pem")).to be_mode 440 |
| 192 | + end |
| 193 | + end |
| 194 | + end |
170 | 195 | describe 'cron service' do |
171 | 196 | context 'cron process' do |
172 | 197 | it 'is running supervised' do |
|
0 commit comments