|
41 | 41 | 'locators' => ['some-locator[some-port]', 'some-other-locator[some-other-port]'], |
42 | 42 | 'users' => |
43 | 43 | [ |
44 | | - { 'password' => 'fake-password', |
45 | | - 'username' => 'cluster_operator' } |
| 44 | + { |
| 45 | + 'password' => 'some-password', |
| 46 | + 'username' => 'some-username', |
| 47 | + 'roles' => ['cluster_operator'] |
| 48 | + } |
46 | 49 | ] |
47 | 50 | } |
48 | 51 | ) |
|
102 | 105 | expect(java_opts).to include( |
103 | 106 | '-Dgemfire.security-client-auth-init=io.pivotal.cloudcache.ClientAuthInitialize.create' |
104 | 107 | ) |
105 | | - expect(java_opts).to include('-Dgemfire.security-username=cluster_operator') |
106 | | - expect(java_opts).to include('-Dgemfire.security-password=fake-password') |
| 108 | + expect(java_opts).to include('-Dgemfire.security-username=some-username') |
| 109 | + expect(java_opts).to include('-Dgemfire.security-password=some-password') |
107 | 110 | end |
| 111 | + end |
108 | 112 |
|
| 113 | + context 'when there is session replication service and service credentials do not include roles' do |
| 114 | + before do |
| 115 | + allow(services).to receive(:one_service?).with(/session-replication/, 'locators', 'users') |
| 116 | + .and_return(true) |
| 117 | + allow(services).to receive(:find_service).and_return( |
| 118 | + 'credentials' => { |
| 119 | + 'locators' => ['some-locator[some-port]', 'some-other-locator[some-other-port]'], |
| 120 | + 'users' => |
| 121 | + [ |
| 122 | + { |
| 123 | + 'password' => 'some-password', |
| 124 | + 'username' => 'cluster_operator' |
| 125 | + } |
| 126 | + ] |
| 127 | + } |
| 128 | + ) |
| 129 | + end |
| 130 | + |
| 131 | + it 'assumes usernames represent roles and passes security properties to the release', |
| 132 | + app_fixture: 'container_tomcat_geode_store', |
| 133 | + cache_fixture: 'stub-geode-store.tar' do |
| 134 | + |
| 135 | + component.release |
| 136 | + |
| 137 | + expect(java_opts).to include( |
| 138 | + '-Dgemfire.security-client-auth-init=io.pivotal.cloudcache.ClientAuthInitialize.create' |
| 139 | + ) |
| 140 | + expect(java_opts).to include('-Dgemfire.security-username=cluster_operator') |
| 141 | + expect(java_opts).to include('-Dgemfire.security-password=some-password') |
| 142 | + end |
109 | 143 | end |
110 | 144 | end |
0 commit comments