@Path("/suggestion") @Api(value = "/suggestion", nickname = "query", description = "Auto-suggestion", tags = "query") public class AutoSuggestionHttpService extends HttpService {
if ((api != null && readHidden) || (api != null && !api.hidden())) { Authorization[] authorizations = api.authorizations();
public ProjectPermissionIRequestParameter(ApiKeyService apiKeyService, Method method) { final ApiOperation annotation = method.getAnnotation(ApiOperation.class); Authorization[] authorizations = annotation == null ? new Authorization[0] : Arrays.stream(annotation.authorizations()).filter(auth -> !auth.value().equals("")).toArray(value -> new Authorization[value]); if (authorizations.length == 0) { throw new IllegalStateException(method.toGenericString() + ": The permission check component requires endpoints to have authorizations definition in @ApiOperation. " + "Use @IgnorePermissionCheck to bypass security check in method " + method.toString()); } if (annotation != null && !annotation.consumes().isEmpty() && !annotation.consumes().equals("application/json")) { throw new IllegalStateException("The permission check component requires endpoint to consume application/json. " + "Use @IgnorePermissionCheck to bypass security check in method " + method.toString()); } Api clazzOperation = method.getDeclaringClass().getAnnotation(Api.class); if (authorizations.length == 0 && (clazzOperation == null || clazzOperation.authorizations().length == 0)) { throw new IllegalArgumentException(String.format("Authorization for method %s is not defined. " + "You must use @IgnorePermissionCheck if the endpoint doesn't need permission check", method.toString())); } if (authorizations.length != 1) { throw new IllegalArgumentException(); } type = ApiKeyService.AccessKeyType.fromKey(authorizations[0].value()); this.apiKeyService = apiKeyService; }
protected Set<String> extractTags(Api api) { Set<String> output = new LinkedHashSet<>(); boolean hasExplicitTags = false; for (String tag : api.tags()) { if (!"".equals(tag)) { hasExplicitTags = true; output.add(tag); } } if (!hasExplicitTags) { // derive tag from api path + description String tagString = api.value().replace("/", ""); if (!"".equals(tagString)) { output.add(tagString); } } return output; }
String nickname = !apiOperation.nickname().isEmpty() ? apiOperation.nickname() : parentApi.nickname(); if (nickname.isEmpty()) { nickname = method.getDeclaringClass().getName().replace(".", "_");
@Path("/automation") @Api(value = "/automation", nickname = "automation", description = "Automation module", tags = "automation") public class AutomationHttpService extends HttpService {
@Path("/saml") @Api(value = "/saml", nickname = "saml", description = "SAML operations", tags = "saml") public class SamlHttpService extends HttpService {
@Path("/ab-testing") @Api(value = "/ab-testing", nickname = "abTesting", description = "A/B Testing module", tags = "ab-testing") public class ABTestingHttpService extends HttpService {
@Path("/user/mailbox") @Api(value = "/user/mailbox", nickname = "userMailbox", description = "UserMailbox", tags = "user-mailbox") public class UserMailboxHttpService extends HttpService { private final UserMailboxStorage storage;
@Path("/admin") @Api(value = "/admin", nickname = "admin", description = "System operations", tags = "admin") public class AdminHttpService extends HttpService {
@Path("/recipe") @Api(value = "/recipe", nickname = "recipe", description = "Recipe operations", tags = "recipe") public class RecipeHttpService extends HttpService { private static ObjectMapper yamlMapper;
@Path("/javascript-logger") @Api(value = "/javascript-logger", nickname = "javascript-logs", description = "Javascript code logs", tags = "javascript") public class JSCodeJDBCLoggerService implements JSLoggerService { private final DBI dbi;
@Path("/user/action/mailbox") @Api(value = "/user/action/mailbox", nickname = "userMailboxAction", description = "Mailbox action", tags = "user-action") public class UserMailboxActionService extends UserActionService<UserMailboxActionService.MailAction> { private final AbstractUserService userService;
@Path("/retention") @Api(value = "/retention", nickname = "retentionAnalyzer", tags = "retention") public class RetentionAnalyzerHttpService extends HttpService {
@Singleton @Api(value = "/realtime", nickname = "realtime", description = "Realtime module", tags = "realtime") @Path("/realtime") public class RealTimeHttpService
@Path("/materialized-view") @Api(value = "/materialized-view", nickname = "materializedView", description = "Materialized View", tags = "materialized-view") public class MaterializedViewHttpService extends HttpService {
@Path("/stream") @Api(value = "/stream", tags = "event-stream") public class EventStreamHttpService extends HttpService {
@Path("/user/action/email") @Api(value = "/user/action/email", nickname = "userEmailAction", description = "Email action", tags = "user-action") public class UserEmailActionService extends UserActionService<UserEmailActionService.EmailActionConfig> { private final static Logger LOGGER = Logger.get(UserEmailActionService.class);
@Path("/funnel") @Api(value = "/funnel", nickname = "funnelAnalyzer", tags = "funnel") public class FunnelAnalyzerHttpService extends HttpService {
@Path("/event-explorer") @Api(value = "/event-explorer", nickname = "eventExplorer", description = "Event explorer module", tags = "event-explorer") public class EventExplorerHttpService extends HttpService {