List<ModuleBean> lifecycleWebhooks = getLifecycleWebhooks(addon.getLifecycle()); moduleLists.putAll(new WebHookModuleMeta().getDescriptorKey(), lifecycleWebhooks);
public synchronized void registerDescriptorsForBeans(ConnectAddonBean addon) throws ConnectModuleRegistrationException { //don't register modules more than once if (registrations.containsKey(addon.getKey())) { return; } Collection<ConnectModuleProvider<?>> moduleProviders = pluginAccessor.getModules( new ModuleDescriptorOfClassPredicate<>(ConnectModuleProviderModuleDescriptor.class)); // The time period bracketed here is the one we are naively obligated to pay each request with the current // vertigo spike logic as per EXT-43. I'm not including the module provider logic above as we could easily // hoist this in the vertigo logic. final long start = System.currentTimeMillis(); Map<String, List<ModuleBean>> moduleLists = getModuleLists(addon); List<ModuleBean> lifecycleWebhooks = getLifecycleWebhooks(addon.getLifecycle()); Map<String, List<ModuleBean>> lifecycleWebhookModuleList = Collections.singletonMap(new WebHookModuleMeta().getDescriptorKey(), lifecycleWebhooks); List<ModuleDescriptor<?>> descriptorsToRegister = new ArrayList<>(); getDescriptorsToRegisterForModules(moduleLists, addon, moduleProviders, descriptorsToRegister); getDescriptorsToRegisterForModules(lifecycleWebhookModuleList, addon, moduleProviders, descriptorsToRegister); final long stop = System.currentTimeMillis(); log.info("registerDescriptorsForBeans computed descriptors for {} in {}ms", addon.getKey(), (stop - start)); registrations.putIfAbsent(addon.getKey(), dynamicDescriptorRegistration.registerDescriptors(descriptorsToRegister)); }
private void requestInstallCallback(ConnectAddonBean addon, Optional<OAuthClient> oauthClient, final boolean sign) throws ConnectAddonInstallException { final URI callbackUri = getURI(addon.getBaseUrl(), addon.getLifecycle().getInstalled()); final Optional<String> authHeader = sign ? getAuthHeader(callbackUri, remotablePluginAccessorFactory.get(addon).getAuthorizationGenerator()) : Optional.empty(); requestInstallCallback(addon, oauthClient, callbackUri, authHeader); }
private void requestInstallCallback(ConnectAddonBean addon, Optional<OAuthClient> oauthClient, String previousSharedSecret) throws ConnectAddonInstallException { final URI callbackUri = getURI(addon.getBaseUrl(), addon.getLifecycle().getInstalled()); final AuthorizationGenerator authorizationGenerator = remotablePluginAccessorFactory.get(addon).getAuthorizationGenerator(); // NB: check that the auth generator matches the request/non-request to sign with an arbitrary key on installation, not on every callback, // because signing with a previous key happens only on installation String authHeader = getAuthHeader(callbackUri, (ReKeyableAuthorizationGenerator) authorizationGenerator, previousSharedSecret); requestInstallCallback(addon, oauthClient, callbackUri, Optional.of(authHeader)); }
private void requestInstallCallback(ConnectAddonBean addon, Optional<OAuthClient> oauthClient, final boolean sign) throws ConnectAddonInstallException { final URI callbackUri = getURI(addon.getBaseUrl(), addon.getLifecycle().getInstalled()); final Optional<String> authHeader = sign ? getAuthHeader(callbackUri, remotablePluginAccessorFactory.get(addon.getKey()).getAuthorizationGenerator()) : Optional.<String>empty(); requestInstallCallback(addon, oauthClient, callbackUri, authHeader); }
private void requestInstallCallback(ConnectAddonBean addon, Optional<OAuthClient> oauthClient, String previousSharedSecret) throws ConnectAddonInstallException { final URI callbackUri = getURI(addon.getBaseUrl(), addon.getLifecycle().getInstalled()); final AuthorizationGenerator authorizationGenerator = remotablePluginAccessorFactory.get(addon.getKey()).getAuthorizationGenerator(); // NB: check that the auth generator matches the request/non-request to sign with an arbitrary key on installation, not on every callback, // because signing with a previous key happens only on installation String authHeader = getAuthHeader(callbackUri, (ReKeyableAuthorizationGenerator) authorizationGenerator, previousSharedSecret); requestInstallCallback(addon, oauthClient, callbackUri, Optional.of(authHeader)); }
if (sendEvent && !Strings.isNullOrEmpty(addon.getLifecycle().getUninstalled())) { try { final URI callbackUri = getURI(addon.getBaseUrl(), addon.getLifecycle().getUninstalled()); callSyncHandler(addon.getKey(), addonUsesJwtAuthentication(addon),
if (!Strings.isNullOrEmpty(addon.getLifecycle().getInstalled())) { if (darkFeatureManager.isFeatureEnabledForAllUsers(DARK_FEATURE_DISABLE_SIGN_INSTALL_WITH_PREV_KEY)) { requestInstallCallback(addon, newOAuthClient, true); // sign using whatever shared secret is looked up (the old code path)
if (!Strings.isNullOrEmpty(addon.getLifecycle().getInstalled())) { if (darkFeatureManager.isFeatureEnabledForAllUsers(DARK_FEATURE_DISABLE_SIGN_INSTALL_WITH_PREV_KEY)) { requestInstallCallback(addon, scopeFilteredOAuthClient, true); // sign using whatever shared secret is looked up (the old code path)