Skip to content

Commit a2a7b29

Browse files
authored
Merge pull request #851 from BenjaminPerryRoss/geode-security-credentials
Remove security credentials for geode store from JAVA_OPTS
2 parents 4394b2b + d0707a2 commit a2a7b29

File tree

2 files changed

+0
-43
lines changed

2 files changed

+0
-43
lines changed

lib/java_buildpack/container/tomcat/tomcat_geode_store.rb

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@ def compile
4141
def release
4242
return unless supports?
4343

44-
credentials = @application.services.find_service(FILTER, KEY_LOCATORS, KEY_USERS)['credentials']
45-
user = credentials[KEY_USERS].find { |u| cluster_operator?(u) }
46-
47-
@droplet.java_opts.add_system_property 'gemfire.security-username', user['username']
48-
@droplet.java_opts.add_system_property 'gemfire.security-password', user['password']
4944
@droplet.java_opts.add_system_property 'gemfire.security-client-auth-init',
5045
'io.pivotal.cloudcache.ClientAuthInitialize.create'
5146
end
@@ -76,10 +71,6 @@ def supports?
7671
:CACHE_CLIENT_LISTENER_CLASS_NAME, :SCHEMA_URL, :SCHEMA_INSTANCE_URL, :SCHEMA_LOCATION,
7772
:LOCATOR_REGEXP
7873

79-
def cluster_operator?(user)
80-
user['username'] == 'cluster_operator' || user['roles'] && (user['roles'].include? 'cluster_operator')
81-
end
82-
8374
def add_client_cache(document)
8475
client_cache = document.add_element 'client-cache',
8576
'xmlns' => SCHEMA_URL,

spec/java_buildpack/container/tomcat/tomcat_geode_store_spec.rb

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -107,40 +107,6 @@
107107
expect(java_opts).to include(
108108
'-Dgemfire.security-client-auth-init=io.pivotal.cloudcache.ClientAuthInitialize.create'
109109
)
110-
expect(java_opts).to include('-Dgemfire.security-username=some-username')
111-
expect(java_opts).to include('-Dgemfire.security-password=some-password')
112-
end
113-
end
114-
115-
context 'when there is session replication service and service credentials do not include roles' do
116-
before do
117-
allow(services).to receive(:one_service?).with(/session-replication/, 'locators', 'users')
118-
.and_return(true)
119-
allow(services).to receive(:find_service).and_return(
120-
'credentials' => {
121-
'locators' => ['some-locator[some-port]', 'some-other-locator[some-other-port]'],
122-
'users' =>
123-
[
124-
{
125-
'password' => 'some-password',
126-
'username' => 'cluster_operator'
127-
}
128-
]
129-
}
130-
)
131-
end
132-
133-
it 'assumes usernames represent roles and passes security properties to the release',
134-
app_fixture: 'container_tomcat_geode_store',
135-
cache_fixture: 'stub-geode-store.tar' do
136-
137-
component.release
138-
139-
expect(java_opts).to include(
140-
'-Dgemfire.security-client-auth-init=io.pivotal.cloudcache.ClientAuthInitialize.create'
141-
)
142-
expect(java_opts).to include('-Dgemfire.security-username=cluster_operator')
143-
expect(java_opts).to include('-Dgemfire.security-password=some-password')
144110
end
145111
end
146112
end

0 commit comments

Comments
 (0)