Skip to content

Commit e5fd458

Browse files
pj892031arxioly
authored andcommitted
draft
Signed-off-by: Pavel Jareš <[email protected]>
1 parent 1bd74f9 commit e5fd458

File tree

17 files changed

+169
-69
lines changed

17 files changed

+169
-69
lines changed

api-catalog-package/src/main/resources/bin/start.sh

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -150,25 +150,30 @@ ADD_OPENS="--add-opens=java.base/java.lang=ALL-UNNAMED
150150
--add-opens=java.base/sun.nio.ch=ALL-UNNAMED
151151
--add-opens=java.base/java.io=ALL-UNNAMED"
152152

153-
ATTLS_ENABLED="false"
153+
add_profile() {
154+
new_profile=$1
155+
if [ -n "${ZWE_configs_spring_profiles_active}" ]; then
156+
ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active},"
157+
fi
158+
ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active}${new_profile}"
159+
}
160+
161+
ATTLS_SERVER_ENABLED="false"
154162
ATTLS_CLIENT_ENABLED="false"
155163

156164
if [ "${ZWE_zowe_network_server_tls_attls}" = "true" ]; then
157-
ATTLS_ENABLED="true"
165+
ATTLS_SERVER_ENABLED="true"
158166
fi
159167
if [ "${ZWE_zowe_network_client_tls_attls}" = "true" ]; then
160168
ATTLS_CLIENT_ENABLED="true"
161169
fi
162170

163-
if [ "${ATTLS_ENABLED}" = "true" ]; then
171+
if [ "${ATTLS_SERVER_ENABLED}" = "true" ]; then
172+
add_profile "attlsServer"
164173
ZWE_configs_server_ssl_enabled="false"
165-
if [ -n "${ZWE_configs_spring_profiles_active}" ]; then
166-
ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active},"
167-
fi
168-
ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active}attls"
169174
fi
170175

171-
if [ "${ZWE_configs_server_ssl_enabled:-true}" = "true" -o "$ATTLS_ENABLED" = "true" ]; then
176+
if [ "${ZWE_configs_server_ssl_enabled:-true}" = "true" -o "$ATTLS_SERVER_ENABLED" = "true" ]; then
172177
externalProtocol="https"
173178
else
174179
externalProtocol="http"
@@ -177,6 +182,7 @@ fi
177182
internalProtocol="https"
178183
ZWE_DISCOVERY_SERVICES_LIST=${ZWE_DISCOVERY_SERVICES_LIST:-"https://${ZWE_haInstance_hostname:-localhost}:${ZWE_components_discovery_port:-7553}/eureka/"}
179184
if [ "$ATTLS_CLIENT_ENABLED" = "true" ]; then
185+
add_profile "attlsClient"
180186
ZWE_DISCOVERY_SERVICES_LIST=$(echo "${ZWE_DISCOVERY_SERVICES_LIST=}" | sed -e 's|https://|http://|g')
181187
internalProtocol="http"
182188
fi
@@ -250,7 +256,7 @@ if [ -n "${ZWE_configs_logging_config}" ]; then
250256
LOGBACK="-Dlogging.config=${ZWE_configs_logging_config}"
251257
fi
252258

253-
if [ "${ATTLS_ENABLED}" = "true" -a "${APIML_ATTLS_LOAD_KEYRING:-false}" = "true" ]; then
259+
if [ "${ATTLS_SERVER_ENABLED}" = "true" -a "${APIML_ATTLS_LOAD_KEYRING:-false}" = "true" ]; then
254260
keystore_type=
255261
keystore_pass=
256262
key_pass=

api-catalog-services/src/main/resources/application.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# for back-compatibility
2+
spring.profiles.group.attls: attlsServer
3+
14
spring:
25
application:
36
name: ${apiml.service.id}
@@ -230,13 +233,22 @@ management:
230233
exposure:
231234
include: "*"
232235
---
233-
spring.config.activate.on-profile: attls
236+
spring.config.activate.on-profile: attlsServer
234237

235238
server:
236239
attls:
237240
enabled: true
238241
ssl:
239242
enabled: false
243+
apiml:
244+
service:
245+
scheme: http
246+
nonSecurePortEnabled: true
247+
securePortEnabled: false
248+
249+
---
250+
spring.config.activate.on-profile: attlsClient
251+
240252
eureka:
241253
instance:
242254
securePort: 0
@@ -252,8 +264,3 @@ eureka:
252264
version: 1.0.0
253265
gatewayUrl: api/v1
254266
swaggerUrl: http://${apiml.service.hostname}:${apiml.service.port}${apiml.service.contextPath}/v3/api-docs
255-
apiml:
256-
service:
257-
scheme: http
258-
nonSecurePortEnabled: true
259-
securePortEnabled: false

apiml-package/src/main/resources/bin/start.sh

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -175,33 +175,39 @@ if [ -n "${ZWE_configs_logging_config}" ]; then
175175
LOGBACK="-Dlogging.config=${ZWE_configs_logging_config}"
176176
fi
177177

178-
ATTLS_ENABLED="false"
178+
add_profile() {
179+
new_profile=$1
180+
if [ -n "${ZWE_configs_spring_profiles_active}" ]; then
181+
ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active},"
182+
fi
183+
ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active}${new_profile}"
184+
}
185+
186+
ATTLS_SERVER_ENABLED="false"
179187
ATTLS_CLIENT_ENABLED="false"
180188

181189
if [ "${ZWE_zowe_network_server_tls_attls}" = "true" ]; then
182-
ATTLS_ENABLED="true"
190+
ATTLS_SERVER_ENABLED="true"
183191
fi
184192
if [ "${ZWE_zowe_network_client_tls_attls}" = "true" ]; then
185193
ATTLS_CLIENT_ENABLED="true"
186194
fi
187195

188-
if [ "${ATTLS_ENABLED}" = "true" ]; then
196+
if [ "${ATTLS_SERVER_ENABLED}" = "true" ]; then
197+
add_profile "attlsServer"
189198
ZWE_configs_server_ssl_enabled="false"
190-
if [ -n "${ZWE_configs_spring_profiles_active}" ]; then
191-
ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active},"
192-
fi
193-
ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active}attls"
194199
fi
195200

196201
internalProtocol="https"
197202
ZWE_DISCOVERY_SERVICES_LIST=${ZWE_DISCOVERY_SERVICES_LIST:-"https://${ZWE_haInstance_hostname:-localhost}:${ZWE_components_discovery_port:-7553}/eureka/"}
198203
if [ "${ATTLS_CLIENT_ENABLED}" = "true" ]; then
204+
add_profile "attlsClient"
199205
ZWE_DISCOVERY_SERVICES_LIST=$(echo "${ZWE_DISCOVERY_SERVICES_LIST=}" | sed -e 's|https://|http://|g')
200206
internalProtocol=http
201207
ZWE_configs_apiml_service_corsEnabled=true
202208
fi
203209

204-
if [ "${ZWE_configs_server_ssl_enabled:-${ZWE_components_gateway_server_ssl_enabled:-${ZWE_components_discovery_server_ssl_enabled:-true}}}" = "true" -o "$ATTLS_ENABLED" = "true" ]; then
210+
if [ "${ZWE_configs_server_ssl_enabled:-${ZWE_components_gateway_server_ssl_enabled:-${ZWE_components_discovery_server_ssl_enabled:-true}}}" = "true" -o "$ATTLS_SERVER_ENABLED" = "true" ]; then
205211
externalProtocol="https"
206212
else
207213
externalProtocol="http"
@@ -294,7 +300,7 @@ elif [ "${keystore_type}" = "JCEHYBRIDRACFKS" ]; then
294300
truststore_location=$(echo "${truststore_location}" | sed s_safkeyring://_safkeyringjcehybrid://_)
295301
fi
296302

297-
if [ "${ATTLS_ENABLED}" = "true" -a "${APIML_ATTLS_LOAD_KEYRING:-false}" = "true" ]; then
303+
if [ "${ATTLS_SERVER_ENABLED}" = "true" -a "${APIML_ATTLS_LOAD_KEYRING:-false}" = "true" ]; then
298304
keystore_type=
299305
keystore_pass=
300306
key_pass=

apiml/src/main/resources/application.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# for back-compatibility
2+
spring.profiles.group.attls: attlsServer
3+
14
eureka:
25
dashboard:
36
path: /eureka
@@ -226,7 +229,7 @@ logging:
226229
reactor.netty.http.client.HttpClientConnect: DEBUG
227230

228231
---
229-
spring.config.activate.on-profile: attls
232+
spring.config.activate.on-profile: attlsServer
230233

231234
server:
232235
attls:

caching-service-package/src/main/resources/bin/start.sh

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,27 +120,33 @@ ADD_OPENS="--add-opens=java.base/java.lang=ALL-UNNAMED
120120
--add-opens=java.base/sun.nio.ch=ALL-UNNAMED
121121
--add-opens=java.base/java.io=ALL-UNNAMED"
122122

123-
ATTLS_ENABLED="false"
123+
add_profile() {
124+
new_profile=$1
125+
if [ -n "${ZWE_configs_spring_profiles_active}" ]; then
126+
ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active},"
127+
fi
128+
ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active}${new_profile}"
129+
}
130+
131+
ATTLS_SERVER_ENABLED="false"
124132
ATTLS_CLIENT_ENABLED="false"
125133

126134
if [ "${ZWE_zowe_network_server_tls_attls}" = "true" ]; then
127-
ATTLS_ENABLED="true"
135+
ATTLS_SERVER_ENABLED="true"
128136
fi
129137
if [ "${ZWE_zowe_network_client_tls_attls}" = "true" ]; then
130138
ATTLS_CLIENT_ENABLED="true"
131139
fi
132140

133-
if [ "${ATTLS_ENABLED}" = "true" ]; then
141+
if [ "${ATTLS_SERVER_ENABLED}" = "true" ]; then
142+
add_profile "attlsServer"
134143
ZWE_configs_server_ssl_enabled="false"
135-
if [ -n "${ZWE_configs_spring_profiles_active}" ]; then
136-
ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active},"
137-
fi
138-
ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active}attls"
139144
fi
140145

141146
# Verify discovery service URL in case AT-TLS is enabled, assumes outgoing rules are in place
142147
ZWE_DISCOVERY_SERVICES_LIST=${ZWE_DISCOVERY_SERVICES_LIST:-"https://${ZWE_haInstance_hostname:-localhost}:${ZWE_components_discovery_port:-7553}/eureka/"}
143148
if [ "${ATTLS_CLIENT_ENABLED}" = "true" ]; then
149+
add_profile "attlsClient"
144150
ZWE_DISCOVERY_SERVICES_LIST=$(echo "${ZWE_DISCOVERY_SERVICES_LIST=}" | sed -e 's|https://|http://|g')
145151
fi
146152

@@ -216,7 +222,7 @@ if [ -n "${ZWE_configs_logging_config}" ]; then
216222
LOGBACK="-Dlogging.config=${ZWE_configs_logging_config}"
217223
fi
218224

219-
if [ "${ATTLS_ENABLED}" = "true" -a "${APIML_ATTLS_LOAD_KEYRING:-false}" = "true" ]; then
225+
if [ "${ATTLS_SERVER_ENABLED}" = "true" -a "${APIML_ATTLS_LOAD_KEYRING:-false}" = "true" ]; then
220226
keystore_type=
221227
keystore_pass=
222228
key_pass=

caching-service/src/main/resources/application.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# for back-compatibility
2+
spring.profiles.group.attls: attlsServer
3+
14
caching:
25
storage:
36
mode: inMemory
@@ -187,7 +190,7 @@ spring.config.activate.on-profile: dev
187190
logbackServiceName: ZWEACS1
188191

189192
---
190-
spring.config.activate.on-profile: attls
193+
spring.config.activate.on-profile: attlsServer
191194

192195
server:
193196
attls:
@@ -199,6 +202,9 @@ apiml:
199202
service:
200203
scheme: http
201204

205+
---
206+
spring.config.activate.on-profile: attlsClient
207+
202208
eureka:
203209
instance:
204210
nonSecurePortEnabled: true

discoverable-client/src/main/resources/application.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# for back-compatibility
2+
spring.profiles.group.attls: attlsServer
3+
14
logging:
25
level:
36
ROOT: INFO
@@ -217,7 +220,7 @@ logging:
217220
logbackServiceName: ZWEADC1
218221

219222
---
220-
spring.config.activate.on-profile: attls
223+
spring.config.activate.on-profile: attlsServer
221224

222225
apiml:
223226
service:

discovery-package/src/main/resources/bin/start.sh

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,26 +115,32 @@ if [ "$(uname)" = "OS/390" ]; then
115115
fi
116116
fi
117117

118-
ATTLS_ENABLED="false"
118+
add_profile() {
119+
new_profile=$1
120+
if [ -n "${ZWE_configs_spring_profiles_active}" ]; then
121+
ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active},"
122+
fi
123+
ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active}${new_profile}"
124+
}
125+
126+
ATTLS_SERVER_ENABLED="false"
119127
ATTLS_CLIENT_ENABLED="false"
120128

121129
if [ "${ZWE_zowe_network_server_tls_attls}" = "true" ]; then
122-
ATTLS_ENABLED="true"
130+
ATTLS_SERVER_ENABLED="true"
123131
fi
124132
if [ "${ZWE_zowe_network_client_tls_attls}" = "true" ]; then
125133
ATTLS_CLIENT_ENABLED="true"
126134
fi
127135

128-
if [ "${ATTLS_ENABLED}" = "true" ]; then
136+
if [ "${ATTLS_SERVER_ENABLED}" = "true" ]; then
137+
add_profile "attlsServer"
129138
ZWE_configs_server_ssl_enabled="false"
130-
if [ -n "${ZWE_configs_spring_profiles_active}" ]; then
131-
ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active},"
132-
fi
133-
ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active}attls"
134139
fi
135140

136141
ZWE_DISCOVERY_SERVICES_LIST=${ZWE_DISCOVERY_SERVICES_LIST:-"https://${ZWE_haInstance_hostname:-localhost}:${ZWE_components_discovery_port:-7553}/eureka/"}
137142
if [ "${ATTLS_CLIENT_ENABLED}" = "true" ]; then
143+
add_profile "attlsClient"
138144
ZWE_DISCOVERY_SERVICES_LIST=$(echo "${ZWE_DISCOVERY_SERVICES_LIST=}" | sed -e 's|https://|http://|g')
139145
fi
140146

@@ -238,7 +244,7 @@ if [ -n "${ZWE_configs_logging_config}" ]; then
238244
LOGBACK="-Dlogging.config=${ZWE_configs_logging_config}"
239245
fi
240246

241-
if [ "${ATTLS_ENABLED}" = "true" -a "${APIML_ATTLS_LOAD_KEYRING:-false}" = "true" ]; then
247+
if [ "${ATTLS_SERVER_ENABLED}" = "true" -a "${APIML_ATTLS_LOAD_KEYRING:-false}" = "true" ]; then
242248
keystore_type=
243249
keystore_pass=
244250
key_pass=

discovery-service/src/main/java/org/zowe/apiml/discovery/config/HttpWebSecurityConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
*/
4747
@Configuration
4848
@RequiredArgsConstructor
49-
@Profile("!https & !attls")
49+
@Profile("!https & !attlsServer")
5050
@ConditionalOnMissingBean(name = "modulithConfig")
5151
public class HttpWebSecurityConfig extends AbstractWebSecurityConfigurer {
5252
private static final String DISCOVERY_REALM = "API Mediation Discovery Service realm";

discovery-service/src/main/java/org/zowe/apiml/discovery/config/HttpWebSecurityLoginConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
"org.zowe.apiml.security.common",
2020
"org.zowe.apiml.gateway.security.login"
2121
})
22-
@Profile("!https & !attls")
22+
@Profile("!https & !attlsServer")
2323
public class HttpWebSecurityLoginConfig {
2424
}

0 commit comments

Comments
 (0)