@Override public void validate(ShallowConnectAddonBean addonBean) throws InvalidDescriptorException { // if the baseUrl does not exist or is not a valid URI then schema validation fails and the code never gets here, // so there's no need to check for null, empty-string or not-a-URI URI baseUrl = URI.create(addonBean.getBaseUrl()); if (null == baseUrl.getScheme()) { String message = String.format("Add-on '%s' specifies a 'baseUrl' without a HTTP scheme: please add a scheme (e.g. 'https').", addonBean.getKey()); throw new InvalidDescriptorException(message, "connect.install.error.base_url.no_scheme"); } if (!baseUrl.getScheme().equalsIgnoreCase("https")) { if (!systemPropertyService.isDevMode() && !systemPropertyService.isHttpAllowedMode()) { String message = String.format("Add-on '%s' specifies a 'baseUrl' with the scheme 'http'. Add-ons running " + "in production must be hosted on a domain protected with 'https'", addonBean.getKey()); throw new InvalidDescriptorException(message, "connect.install.error.base_url.no_tls"); } } } }
@Override public void validate(ShallowConnectAddonBean addonBean) throws InvalidDescriptorException { // if the baseUrl does not exist or is not a valid URI then schema validation fails and the code never gets here, // so there's no need to check for null, empty-string or not-a-URI URI baseUrl = URI.create(addonBean.getBaseUrl()); if (null == baseUrl.getScheme()) { String message = String.format("Add-on '%s' specifies a 'baseUrl' without a HTTP scheme: please add a scheme (e.g. 'https').", addonBean.getKey()); throw new InvalidDescriptorException(message, "connect.install.error.base_url.no_scheme"); } if (!baseUrl.getScheme().equalsIgnoreCase("https")) { if (!systemPropertyService.isDevMode() && !systemPropertyService.isHttpAllowedMode()) { String message = String.format("Add-on '%s' specifies a 'baseUrl' with the scheme 'http'. Add-ons running " + "in production must be hosted on a domain protected with 'https'", addonBean.getKey()); throw new InvalidDescriptorException(message, "connect.install.error.base_url.no_tls"); } } } }
if (sendEvent && !Strings.isNullOrEmpty(addon.getLifecycle().getUninstalled())) { try { final URI callbackUri = getURI(addon.getBaseUrl(), addon.getLifecycle().getUninstalled()); callSyncHandler(addon.getKey(), addonUsesJwtAuthentication(addon),
public ConnectAddonBeanBuilder(ShallowConnectAddonBean defaultBean) { this.key = defaultBean.getKey(); this.name = defaultBean.getName(); this.version = defaultBean.getVersion(); this.apiVersion = defaultBean.getApiVersion(); this.description = defaultBean.getDescription(); this.vendor = defaultBean.getVendor(); this.links = defaultBean.getLinks(); this.lifecycle = defaultBean.getLifecycle(); this.baseUrl = defaultBean.getBaseUrl(); this.authentication = defaultBean.getAuthentication(); this.scopes = defaultBean.getScopes(); this.enableLicensing = defaultBean.getEnableLicensing(); }
public ConnectAddonBeanBuilder(ShallowConnectAddonBean defaultBean) { this.key = defaultBean.getKey(); this.dependencies = defaultBean.getDependencies(); this.name = defaultBean.getName(); this.version = defaultBean.getVersion(); this.apiVersion = defaultBean.getApiVersion(); this.description = defaultBean.getDescription(); this.vendor = defaultBean.getVendor(); this.links = defaultBean.getLinks(); this.lifecycle = defaultBean.getLifecycle(); this.baseUrl = defaultBean.getBaseUrl(); this.authentication = defaultBean.getAuthentication(); this.scopes = defaultBean.getScopes(); this.enableLicensing = defaultBean.getEnableLicensing(); this.translations = defaultBean.getTranslations(); }