Skip to content

Commit e06790a

Browse files
committed
Revert "Security Provider Flag"
This reverts commit acab25d.
1 parent 19ca3a2 commit e06790a

File tree

5 files changed

+26
-54
lines changed

5 files changed

+26
-54
lines changed

.idea/inspectionProfiles/Project_Default.xml

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/container_security_provider.yml

-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,3 @@
1717
---
1818
version: 1.+
1919
repository_root: "{default.repository.root}/container-security-provider"
20-
enabled: true

docs/framework-container_security_provider.md

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ The framework can be configured by modifying the [`config/container_security_pro
2222
| ---- | -----------
2323
| `repository_root` | The URL of the Container Customizer repository index ([details][repositories]).
2424
| `version` | The version of Container Customizer to use. Candidate versions can be found in [this listing][].
25-
| `enabled` | Whether to enable the `SecurityProvider`
2625

2726
## Security Provider
2827
The [security provider][] added by this framework contributes two types, a `TrustManagerFactory` and a `KeyManagerFactory`. The `TrustManagerFactory` adds an additional new `TrustManager` after the configured system `TrustManager` which reads the contents of `/etc/ssl/certs/ca-certificates.crt` which is where [BOSH trusted certificates][] are placed. The `KeyManagerFactory` adds an additional `KeyManager` after the configured system `KeyManager` which reads the contents of the files specified by `$CF_INSTANCE_CERT` and `$CF_INSTANCE_KEY` which are set by Diego to give each container a unique cryptographic identity. These `TrustManager`s and `KeyManager`s are used transparently by any networking library that reads standard system SSL configuration and can be used to enable system-wide trust and [mutual TLS authentication][].

lib/java_buildpack/framework/container_security_provider.rb

+1-7
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,7 @@ def release
4444

4545
# (see JavaBuildpack::Component::VersionedDependencyComponent#supports?)
4646
def supports?
47-
enabled?
48-
end
49-
50-
private
51-
52-
def enabled?
53-
@configuration['enabled']
47+
true
5448
end
5549

5650
end

spec/java_buildpack/framework/container_security_provider_spec.rb

+25-44
Original file line numberDiff line numberDiff line change
@@ -22,70 +22,51 @@
2222
describe JavaBuildpack::Framework::ContainerSecurityProvider do
2323
include_context 'with component help'
2424

25-
let(:java_home) do
26-
java_home = JavaBuildpack::Component::MutableJavaHome.new
27-
java_home.version = version_8
28-
return java_home
25+
it 'always detects' do
26+
expect(component.detect).to eq("container-security-provider=#{version}")
2927
end
3028

31-
let(:version_8) { JavaBuildpack::Util::TokenizedVersion.new('1.8.0_162') }
29+
it 'adds extension directory' do
30+
component.release
3231

33-
let(:version_9) { JavaBuildpack::Util::TokenizedVersion.new('9.0.4_11') }
34-
35-
it 'does not detect if not enabled' do
36-
expect(component.detect).to be_nil
32+
expect(extension_directories).to include(droplet.sandbox)
3733
end
3834

39-
context 'when enabled' do
35+
it 'adds security provider',
36+
cache_fixture: 'stub-container-security-provider.jar' do
4037

41-
let(:configuration) { { 'enabled' => true } }
38+
component.compile
39+
expect(security_providers[1]).to eq('org.cloudfoundry.security.CloudFoundryContainerProvider')
40+
end
4241

43-
it 'detects if enabled' do
44-
expect(component.detect).to eq("container-security-provider=#{version}")
45-
end
42+
context do
4643

47-
it 'adds extension directory' do
48-
component.release
44+
let(:java_home_delegate) do
45+
delegate = JavaBuildpack::Component::MutableJavaHome.new
46+
delegate.root = app_dir + '.test-java-home'
47+
delegate.version = JavaBuildpack::Util::TokenizedVersion.new('9.0.0')
4948

50-
expect(extension_directories).to include(droplet.sandbox)
49+
delegate
5150
end
5251

53-
it 'adds security provider',
52+
it 'adds JAR to classpath during compile in Java 9',
5453
cache_fixture: 'stub-container-security-provider.jar' do
5554

5655
component.compile
5756

58-
expect(security_providers[1]).to eq('org.cloudfoundry.security.CloudFoundryContainerProvider')
57+
expect(additional_libraries).to include(droplet.sandbox + "container_security_provider-#{version}.jar")
5958
end
6059

61-
context 'when java 9' do
62-
63-
it 'adds JAR to classpath during compile in Java 9',
64-
cache_fixture: 'stub-container-security-provider.jar' do
65-
66-
java_home.version = version_9
67-
68-
component.compile
69-
70-
expect(additional_libraries).to include(droplet.sandbox + "container_security_provider-#{version}.jar")
71-
end
72-
73-
it 'adds JAR to classpath during release in Java 9' do
74-
java_home.version = version_9
75-
76-
component.release
77-
78-
expect(additional_libraries).to include(droplet.sandbox + "container_security_provider-#{version}.jar")
79-
end
80-
81-
it 'adds does not add extension directory in Java 9' do
82-
java_home.version = version_9
60+
it 'adds JAR to classpath during release in Java 9' do
61+
component.release
8362

84-
component.release
63+
expect(additional_libraries).to include(droplet.sandbox + "container_security_provider-#{version}.jar")
64+
end
8565

86-
expect(extension_directories).not_to include(droplet.sandbox)
87-
end
66+
it 'adds does not add extension directory in Java 9' do
67+
component.release
8868

69+
expect(extension_directories).not_to include(droplet.sandbox)
8970
end
9071

9172
end

0 commit comments

Comments
 (0)