public ConnectRunner setAuthenticationToNone() { addonBuilder.withAuthentication(AuthenticationBean.none()); return this; }
public ConnectRunner setAuthenticationToNone() { addonBuilder.withAuthentication(AuthenticationBean.none()); return this; }
private ConnectRunner addJWT(HttpServlet installHandlerServlet, SignedRequestHandler signedRequestHandler) { addonBuilder.withAuthentication(AuthenticationBean.newAuthenticationBean() .withType(AuthenticationType.JWT) .build()); addInstallLifecycle(); this.signedRequestHandler = signedRequestHandler; addRoute(INSTALLED_PATH, installHandlerServlet); return this; }
private ConnectRunner addJWT(HttpServlet installHandlerServlet, SignedRequestHandler signedRequestHandler) { addonBuilder.withAuthentication(AuthenticationBean.newAuthenticationBean() .withType(AuthenticationType.JWT) .build()); addInstallLifecycle(); this.signedRequestHandler = signedRequestHandler; addRoute(INSTALLED_PATH, installHandlerServlet); return this; }
private static String createAddonExample() { Map<String, String> links = ImmutableMap.<String, String>builder().put("self", "http://www.example.com/connect/jira").build(); Set<ScopeName> scopes = Sets.newHashSet(ScopeName.READ, ScopeName.WRITE); ConnectAddonBean addonBean = newConnectAddonBean() .withKey("my-addon-key") .withName("My Connect Addon") .withDescription("A connect addon that does something") .withVendor(newVendorBean().withName("My Company").withUrl("http://www.example.com").build()) .withBaseurl("http://www.example.com/connect/jira") .withLinks(links) .withAuthentication(newAuthenticationBean().build()) .withLicensing(true) .withLifecycle(LifecycleBean.newLifecycleBean().withInstalled("/installed").withUninstalled("/uninstalled").build()) .withScopes(scopes) .build(); final JsonElement jsonRepresentation = gson.toJsonTree(addonBean); // Remove the version element from the example because our vendors should jsonRepresentation.getAsJsonObject().remove("version"); return gson.toJson(jsonRepresentation); }
private static String createAddonExample() { Map<String, String> links = ImmutableMap.<String, String>builder().put("self", "http://www.example.com/connect/jira").build(); Set<ScopeName> scopes = Sets.newHashSet(ScopeName.READ, ScopeName.WRITE); ConnectAddonBean addonBean = newConnectAddonBean() .withKey("my-addon-key") .withName("My Connect Addon") .withDescription("A connect addon that does something") .withVendor(newVendorBean().withName("My Company").withUrl("http://www.example.com").build()) .withBaseurl("http://www.example.com/connect/jira") .withLinks(links) .withAuthentication(newAuthenticationBean().build()) .withLicensing(true) .withLifecycle(LifecycleBean.newLifecycleBean().withInstalled("/installed").withUninstalled("/uninstalled").build()) .withScopes(scopes) .build(); final JsonElement jsonRepresentation = gson.toJsonTree(addonBean); // Remove the version element from the example because our vendors should jsonRepresentation.getAsJsonObject().remove("version"); return gson.toJson(jsonRepresentation); }
.withAuthentication(new AuthenticationBeanBuilder().withType(AuthenticationType.valueOf(rawConnectAddon.getAuthType())).build()) .withBaseurl(rawConnectAddon.getBaseUrl()) .withScopes(addonScopes)
private ConnectAddonBean createAddonBeanWithScope(ScopeName scopeName) { final String key = getPluginKeyForScopeName(scopeName); ConnectAddonBeanBuilder connectAddonBeanBuilder = newConnectAddonBean() .withKey(key) .withName(key) .withBaseurl(testPluginInstaller.getInternalAddonBaseUrl(key)) .withLicensing(true) .withAuthentication(newAuthenticationBean() .withType(AuthenticationType.JWT) .build()) .withLifecycle(newLifecycleBean() .withInstalled("/installed") .build()) .withModule("generalPages", newPageBean() .withUrl("/hello-world.html") .withKey("general") .withName(I18nProperty.value("Greeting")) .build()); // scopes are optional so that we can have "no scopes" test classes if (null != scopeName) { connectAddonBeanBuilder = connectAddonBeanBuilder.withScopes(new HashSet<>(singletonList(scopeName))); } return connectAddonBeanBuilder.build(); } }