2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.sdc.be.filters;
23 import com.google.common.annotations.VisibleForTesting;
24 import org.apache.commons.lang.StringUtils;
25 import org.onap.portalsdk.core.onboarding.util.PortalApiProperties;
26 import org.onap.sdc.security.IPortalConfiguration;
27 import org.onap.sdc.security.PortalClient;
29 import java.security.InvalidParameterException;
31 public class PortalConfiguration implements IPortalConfiguration {
32 private static final String PROPERTY_NOT_SET = "%s property value is not set in portal.properties file";
33 private String portalUser;
34 private String portalPassword;
35 private String ecompPortalRestURL;
36 private String portalAppName;
37 private String uebKey;
39 public PortalConfiguration() throws org.onap.portalsdk.core.onboarding.exception.CipherUtilException {
40 this.portalUser = org.onap.portalsdk.core.onboarding.util.PortalApiProperties.getProperty(org.onap.sdc.security.PortalClient.PortalPropertiesEnum.USER.value());
41 this.portalPassword = org.onap.portalsdk.core.onboarding.util.PortalApiProperties.getProperty(PortalClient.PortalPropertiesEnum.PASSWORD.value());
42 this.portalAppName = org.onap.portalsdk.core.onboarding.util.PortalApiProperties.getProperty(PortalClient.PortalPropertiesEnum.APP_NAME.value());
43 this.ecompPortalRestURL = org.onap.portalsdk.core.onboarding.util.PortalApiProperties.getProperty(org.onap.sdc.security.PortalClient.PortalPropertiesEnum.ECOMP_REST_URL.value());
44 this.uebKey = org.onap.portalsdk.core.onboarding.util.PortalApiProperties.getProperty(org.onap.sdc.security.PortalClient.PortalPropertiesEnum.UEB_APP_KEY.value());
48 String getPortalProperty(String key) {
49 String value = PortalApiProperties.getProperty(key);
50 if (StringUtils.isEmpty(value)) {
51 throw new InvalidParameterException(String.format(PROPERTY_NOT_SET, key));
57 public String getPortalApiPrefix() {
62 public long getMaxIdleTime() {
67 public String getUserAttributeName() {
72 public boolean IsUseRestForFunctionalMenu() {
77 public String getPortalApiImplClass() {
82 public String getRoleAccessCentralized() {
87 public boolean getUebListenersEnable() {
92 public String getEcompRedirectUrl() {
97 public String getEcompRestUrl() {
98 return ecompPortalRestURL;
102 public String getPortalUser() {
107 public String getPortalPass() {
108 return portalPassword;
112 public String getPortalAppName() {
113 return portalAppName;
117 public String getUebAppKey() {
122 public String getAafNamespace() {
127 public String getAuthNamespace() {
132 public String getCspCookieName() {
137 public String getCspGateKeeperProdKey() {
142 public String getExtReqConnectionTimeout() {
147 public String getExtReqReadTimeout() {