diff --git a/src/main/java/com/capitalone/dashboard/Application.java b/src/main/java/com/capitalone/dashboard/Application.java index 2aad11ba..c72577c7 100644 --- a/src/main/java/com/capitalone/dashboard/Application.java +++ b/src/main/java/com/capitalone/dashboard/Application.java @@ -4,7 +4,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; -import org.springframework.boot.web.support.SpringBootServletInitializer; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.context.annotation.Bean; import com.capitalone.dashboard.config.MongoConfig; diff --git a/src/main/java/com/capitalone/dashboard/auth/access/MethodLevelSecurityHandler.java b/src/main/java/com/capitalone/dashboard/auth/access/MethodLevelSecurityHandler.java index 0f22b385..75522cbe 100644 --- a/src/main/java/com/capitalone/dashboard/auth/access/MethodLevelSecurityHandler.java +++ b/src/main/java/com/capitalone/dashboard/auth/access/MethodLevelSecurityHandler.java @@ -10,6 +10,8 @@ import com.capitalone.dashboard.model.Owner; import com.capitalone.dashboard.repository.DashboardRepository; +import java.util.Optional; + @Component public class MethodLevelSecurityHandler { @@ -21,10 +23,11 @@ public MethodLevelSecurityHandler(DashboardRepository dashboardRepository) { } public boolean isOwnerOfDashboard(ObjectId dashboardId) { - Dashboard dashboard = dashboardRepository.findOne(dashboardId); - if (dashboard == null) { + Optional dashboardOptional = dashboardRepository.findById(dashboardId); + if (dashboardOptional.isEmpty()) { return false; } + Dashboard dashboard = dashboardOptional.get(); String username = AuthenticationUtil.getUsernameFromContext(); AuthType authType = AuthenticationUtil.getAuthTypeFromContext(); diff --git a/src/main/java/com/capitalone/dashboard/auth/ldap/CustomUserDetailsContextMapper.java b/src/main/java/com/capitalone/dashboard/auth/ldap/CustomUserDetailsContextMapper.java index 6f022cdb..efb4ccba 100644 --- a/src/main/java/com/capitalone/dashboard/auth/ldap/CustomUserDetailsContextMapper.java +++ b/src/main/java/com/capitalone/dashboard/auth/ldap/CustomUserDetailsContextMapper.java @@ -1,6 +1,7 @@ package com.capitalone.dashboard.auth.ldap; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.context.annotation.Configuration; import org.springframework.ldap.core.DirContextAdapter; import org.springframework.ldap.core.DirContextOperations; @@ -14,7 +15,7 @@ @Configuration public class CustomUserDetailsContextMapper extends LdapUserDetailsMapper { - private static final Logger LOGGER = Logger.getLogger(CustomUserDetailsContextMapper.class); + private static final Logger LOGGER = LoggerFactory.getLogger(CustomUserDetailsContextMapper.class); @Override public CustomUserDetails mapUserFromContext(DirContextOperations ctx, String username, Collection authorities) { diff --git a/src/main/java/com/capitalone/dashboard/auth/openid/OpenIdAuthenticationFilter.java b/src/main/java/com/capitalone/dashboard/auth/openid/OpenIdAuthenticationFilter.java index bdee0e6c..2a07924c 100644 --- a/src/main/java/com/capitalone/dashboard/auth/openid/OpenIdAuthenticationFilter.java +++ b/src/main/java/com/capitalone/dashboard/auth/openid/OpenIdAuthenticationFilter.java @@ -15,7 +15,7 @@ import javax.servlet.http.HttpServletResponse; import java.io.IOException; -@Component + public class OpenIdAuthenticationFilter extends AbstractAuthenticationProcessingFilter { @Autowired diff --git a/src/main/java/com/capitalone/dashboard/auth/openid/OpenIdAuthenticationServiceImpl.java b/src/main/java/com/capitalone/dashboard/auth/openid/OpenIdAuthenticationServiceImpl.java index 2d704bed..32d2bc30 100644 --- a/src/main/java/com/capitalone/dashboard/auth/openid/OpenIdAuthenticationServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/auth/openid/OpenIdAuthenticationServiceImpl.java @@ -57,12 +57,12 @@ public OpenIdAuthenticationServiceImpl(AuthProperties authProperties, RestClient @Override public void addAuthentication(HttpServletResponse response, Authentication authentication) { - String jwt = Jwts.builder().setSubject(authentication.getName()) + char[] jwt = Jwts.builder().setSubject(authentication.getName()) .claim(DETAILS_CLAIM, authentication.getDetails()) .claim(ROLES_CLAIM, getRoles(authentication.getAuthorities())) .setExpiration(new Date(System.currentTimeMillis() + authProperties.getExpirationTime())) - .signWith(SignatureAlgorithm.HS512, authProperties.getSecret()).compact(); - response.addHeader(AUTH_RESPONSE_HEADER, jwt); + .signWith(SignatureAlgorithm.HS512, authProperties.getSecret()).compact().toCharArray(); + response.addHeader(AUTH_RESPONSE_HEADER, String.valueOf(jwt)); } diff --git a/src/main/java/com/capitalone/dashboard/auth/sso/SsoAuthenticationFilter.java b/src/main/java/com/capitalone/dashboard/auth/sso/SsoAuthenticationFilter.java index 7c703ecc..d39ff64e 100644 --- a/src/main/java/com/capitalone/dashboard/auth/sso/SsoAuthenticationFilter.java +++ b/src/main/java/com/capitalone/dashboard/auth/sso/SsoAuthenticationFilter.java @@ -7,7 +7,9 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.apache.log4j.Logger; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.core.Authentication; @@ -17,9 +19,9 @@ import com.capitalone.dashboard.auth.AuthenticationResultHandler; -@Component + public class SsoAuthenticationFilter extends UsernamePasswordAuthenticationFilter { - private static final Logger LOGGER = Logger.getLogger(SsoAuthenticationFilter.class); + private static final Logger LOGGER = LoggerFactory.getLogger(SsoAuthenticationFilter.class); @Autowired private SsoAuthenticationService ssoAuthenticationService; diff --git a/src/main/java/com/capitalone/dashboard/auth/sso/SsoAuthenticationServiceImpl.java b/src/main/java/com/capitalone/dashboard/auth/sso/SsoAuthenticationServiceImpl.java index 640bf780..02a7baf9 100644 --- a/src/main/java/com/capitalone/dashboard/auth/sso/SsoAuthenticationServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/auth/sso/SsoAuthenticationServiceImpl.java @@ -5,7 +5,8 @@ import java.util.HashMap; import java.util.Map; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.Authentication; import org.springframework.security.core.GrantedAuthority; @@ -17,7 +18,7 @@ @Component public class SsoAuthenticationServiceImpl implements SsoAuthenticationService { - private static final Logger LOGGER = Logger.getLogger(SsoAuthenticationServiceImpl.class); + private static final Logger LOGGER = LoggerFactory.getLogger(SsoAuthenticationServiceImpl.class); @Autowired private SsoAuthenticationUtil ssoAuthenticationUtil; diff --git a/src/main/java/com/capitalone/dashboard/auth/sso/SsoAuthenticationUtil.java b/src/main/java/com/capitalone/dashboard/auth/sso/SsoAuthenticationUtil.java index 8803e071..31b3828f 100644 --- a/src/main/java/com/capitalone/dashboard/auth/sso/SsoAuthenticationUtil.java +++ b/src/main/java/com/capitalone/dashboard/auth/sso/SsoAuthenticationUtil.java @@ -3,7 +3,8 @@ import java.util.ArrayList; import java.util.Map; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.Authentication; import org.springframework.security.core.GrantedAuthority; @@ -16,7 +17,7 @@ @Component public class SsoAuthenticationUtil { - private static final Logger LOGGER = Logger.getLogger(SsoAuthenticationUtil.class); + private static final Logger LOGGER = LoggerFactory.getLogger(SsoAuthenticationUtil.class); @Autowired private AuthProperties authProperties; diff --git a/src/main/java/com/capitalone/dashboard/auth/token/JwtAuthenticationFilter.java b/src/main/java/com/capitalone/dashboard/auth/token/JwtAuthenticationFilter.java index 2a36ddae..ea12a8a0 100644 --- a/src/main/java/com/capitalone/dashboard/auth/token/JwtAuthenticationFilter.java +++ b/src/main/java/com/capitalone/dashboard/auth/token/JwtAuthenticationFilter.java @@ -3,7 +3,8 @@ import com.capitalone.dashboard.util.CommonConstants; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.annotation.Order; import org.springframework.security.core.Authentication; @@ -25,7 +26,7 @@ @Order(2) public class JwtAuthenticationFilter extends OncePerRequestFilter { - private static final Logger LOGGER = Logger.getLogger(JwtAuthenticationFilter.class); + private static final Logger LOGGER = LoggerFactory.getLogger(JwtAuthenticationFilter.class); private TokenAuthenticationService tokenAuthenticationService; private static final String PING = "ping"; @@ -116,4 +117,4 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse } } } -} \ No newline at end of file +} diff --git a/src/main/java/com/capitalone/dashboard/auth/token/TokenAuthenticationServiceImpl.java b/src/main/java/com/capitalone/dashboard/auth/token/TokenAuthenticationServiceImpl.java index 514f168f..223ba310 100644 --- a/src/main/java/com/capitalone/dashboard/auth/token/TokenAuthenticationServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/auth/token/TokenAuthenticationServiceImpl.java @@ -42,12 +42,12 @@ public TokenAuthenticationServiceImpl(AuthProperties tokenAuthProperties) { @Override public void addAuthentication(HttpServletResponse response, Authentication authentication) { - String jwt = Jwts.builder().setSubject(authentication.getName()) + char[] jwt = Jwts.builder().setSubject(authentication.getName()) .claim(DETAILS_CLAIM, authentication.getDetails()) .claim(ROLES_CLAIM, getRoles(authentication.getAuthorities())) .setExpiration(new Date(System.currentTimeMillis() + tokenAuthProperties.getExpirationTime())) - .signWith(SignatureAlgorithm.HS512, tokenAuthProperties.getSecret()).compact(); - response.addHeader(AUTH_RESPONSE_HEADER, jwt); + .signWith(SignatureAlgorithm.HS512, tokenAuthProperties.getSecret()).compact().toCharArray(); + response.addHeader(AUTH_RESPONSE_HEADER, String.valueOf(jwt)); } @SuppressWarnings("unchecked") diff --git a/src/main/java/com/capitalone/dashboard/config/WebSecurityConfig.java b/src/main/java/com/capitalone/dashboard/config/WebSecurityConfig.java index 519a21bf..a2031681 100644 --- a/src/main/java/com/capitalone/dashboard/config/WebSecurityConfig.java +++ b/src/main/java/com/capitalone/dashboard/config/WebSecurityConfig.java @@ -17,7 +17,8 @@ import com.capitalone.dashboard.settings.ApiSettings; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.security.Http401AuthenticationEntryPoint; +//import org.springframework.boot.autoconfigure.security.Http401AuthenticationEntryPoint; +import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; @@ -34,8 +35,12 @@ import org.springframework.security.ldap.authentication.ad.ActiveDirectoryLdapAuthenticationProvider; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; import org.springframework.web.client.RestTemplate; +import org.springframework.web.cors.CorsConfiguration; +import org.springframework.web.cors.CorsConfigurationSource; import java.util.List; +import java.util.Objects; +import java.util.stream.Stream; @Configuration @EnableWebSecurity @@ -64,9 +69,15 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { @Autowired private ApiSettings apiSettings; + @Value("${cors.allowed-origins:}") + private String[] allowedOrigins; + @Override protected void configure(HttpSecurity http) throws Exception { http.headers().cacheControl(); + if (Objects.nonNull(allowedOrigins) && allowedOrigins.length > 0) { + http.cors().configurationSource(corsConfigSource()); + } http.csrf().disable() .authorizeRequests().antMatchers("/appinfo").permitAll() .antMatchers("/registerUser").permitAll() @@ -105,8 +116,7 @@ protected void configure(HttpSecurity http) throws Exception { .addFilterBefore(apiTokenRequestFilter(), UsernamePasswordAuthenticationFilter.class) .addFilterBefore(openIdAuthenticationFilter(), UsernamePasswordAuthenticationFilter.class) .addFilterBefore(jwtAuthenticationFilter, UsernamePasswordAuthenticationFilter.class) - .addFilterBefore(githubWebhookRequestFilter(), UsernamePasswordAuthenticationFilter.class) - .exceptionHandling().authenticationEntryPoint(new Http401AuthenticationEntryPoint("Authorization")); + .addFilterBefore(githubWebhookRequestFilter(), UsernamePasswordAuthenticationFilter.class); } @Override @@ -214,5 +224,15 @@ protected ActiveDirectoryLdapAuthenticationProvider activeDirectoryLdapAuthentic public RestClient restClient() { return new RestClient(RestTemplate::new); } - + private CorsConfigurationSource corsConfigSource() { + final CorsConfiguration corsConfig = new CorsConfiguration(); + corsConfig.addAllowedHeader(CorsConfiguration.ALL); + corsConfig.addAllowedMethod(CorsConfiguration.ALL); + corsConfig.addExposedHeader("x-authentication-token"); + Stream.of(allowedOrigins).forEach( + origin -> corsConfig.addAllowedOriginPattern(origin) + ); + + return request -> corsConfig; + } } diff --git a/src/main/java/com/capitalone/dashboard/logging/LoggingFilter.java b/src/main/java/com/capitalone/dashboard/logging/LoggingFilter.java index 0e52fbc4..fe6cc366 100644 --- a/src/main/java/com/capitalone/dashboard/logging/LoggingFilter.java +++ b/src/main/java/com/capitalone/dashboard/logging/LoggingFilter.java @@ -9,9 +9,10 @@ import org.apache.commons.io.output.TeeOutputStream; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.exception.ExceptionUtils; -import org.apache.log4j.Logger; import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.annotation.Order; import org.springframework.http.HttpMethod; @@ -57,7 +58,7 @@ @Order(1) public class LoggingFilter implements Filter { - private static final Logger LOGGER = Logger.getLogger("LoggingFilter"); + private static final Logger LOGGER = LoggerFactory.getLogger("LoggingFilter"); private static final String API_USER_KEY = "apiUser"; diff --git a/src/main/java/com/capitalone/dashboard/request/DashboardRemoteRequest.java b/src/main/java/com/capitalone/dashboard/request/DashboardRemoteRequest.java index 51e0e36a..445f2fd4 100644 --- a/src/main/java/com/capitalone/dashboard/request/DashboardRemoteRequest.java +++ b/src/main/java/com/capitalone/dashboard/request/DashboardRemoteRequest.java @@ -6,7 +6,6 @@ import com.capitalone.dashboard.model.CollectorItem; import com.capitalone.dashboard.model.CollectorType; import com.capitalone.dashboard.model.Owner; -import com.capitalone.dashboard.model.WhiteSourceComponent; import com.capitalone.dashboard.util.GitHubParsedUrl; import org.hibernate.validator.constraints.NotEmpty; diff --git a/src/main/java/com/capitalone/dashboard/rest/BuildController.java b/src/main/java/com/capitalone/dashboard/rest/BuildController.java index 3e57794a..dd38599b 100644 --- a/src/main/java/com/capitalone/dashboard/rest/BuildController.java +++ b/src/main/java/com/capitalone/dashboard/rest/BuildController.java @@ -12,6 +12,7 @@ import com.capitalone.dashboard.service.BuildService; import com.capitalone.dashboard.util.CommonConstants; import org.bson.types.ObjectId; +import org.owasp.esapi.ESAPI; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -84,7 +85,7 @@ public ResponseEntity createBuildv2(@Valid @RequestBody BuildDataCreateR @RequestMapping(value = "/v3/build", method = POST, consumes = APPLICATION_JSON_VALUE, produces = APPLICATION_JSON_VALUE) public ResponseEntity createBuildv3(@Valid @RequestBody BuildDataCreateRequest request) throws HygieiaException { - request.setClientReference(httpServletRequest.getHeader(CommonConstants.HEADER_CLIENT_CORRELATION_ID)); + request.setClientReference(ESAPI.encoder().encodeForHTML(httpServletRequest.getHeader(CommonConstants.HEADER_CLIENT_CORRELATION_ID))); String requester = httpServletRequest.getHeader(CommonConstants.HEADER_API_USER); BuildDataCreateResponse response = buildService.createV3(request); String response_message = "Successfully created/updated build : "+ response.getId(); diff --git a/src/main/java/com/capitalone/dashboard/rest/CollectorController.java b/src/main/java/com/capitalone/dashboard/rest/CollectorController.java index d0290c63..d8e5eaab 100644 --- a/src/main/java/com/capitalone/dashboard/rest/CollectorController.java +++ b/src/main/java/com/capitalone/dashboard/rest/CollectorController.java @@ -169,5 +169,4 @@ public ResponseEntity deletePropertiesCase(@PathVariable String id) { collectorService.deletePropertiesInCollectorById(id); return ResponseEntity.noContent().build(); } - -} \ No newline at end of file +} diff --git a/src/main/java/com/capitalone/dashboard/rest/CollectorItemController.java b/src/main/java/com/capitalone/dashboard/rest/CollectorItemController.java index bf4812bf..a228d9e0 100644 --- a/src/main/java/com/capitalone/dashboard/rest/CollectorItemController.java +++ b/src/main/java/com/capitalone/dashboard/rest/CollectorItemController.java @@ -3,6 +3,7 @@ import com.capitalone.dashboard.service.CollectorItemService; import java.util.Objects; import org.apache.commons.lang3.StringUtils; +import org.owasp.esapi.ESAPI; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; @@ -24,10 +25,11 @@ public CollectorItemController(CollectorItemService collectorItemService){ @RequestMapping(path="/collector-items/cleanup", method = RequestMethod.DELETE) public ResponseEntity cleanup(@RequestParam(value = "collectorType", required = true, defaultValue = "") String collectorType, @RequestParam(value = "collectorName", required = true, defaultValue = "") String collectorName) { - if (StringUtils.isEmpty(collectorName) || Objects.isNull(collectorType)) { + + if (StringUtils.isEmpty(ESAPI.encoder().encodeForHTML(collectorName)) || Objects.isNull(ESAPI.encoder().encodeForHTML(collectorType))) { return ResponseEntity.status(HttpStatus.BAD_REQUEST).body("Collector type and name are required parameters"); } - return collectorItemService.cleanup(collectorType, collectorName); + return collectorItemService.cleanup(ESAPI.encoder().encodeForHTML(collectorType), ESAPI.encoder().encodeForHTML(collectorName)); } } diff --git a/src/main/java/com/capitalone/dashboard/rest/DashboardController.java b/src/main/java/com/capitalone/dashboard/rest/DashboardController.java index 89b52ebd..6e91a242 100644 --- a/src/main/java/com/capitalone/dashboard/rest/DashboardController.java +++ b/src/main/java/com/capitalone/dashboard/rest/DashboardController.java @@ -14,6 +14,7 @@ import com.capitalone.dashboard.auth.access.Admin; import com.capitalone.dashboard.util.PaginationHeaderUtility; import org.bson.types.ObjectId; +import org.owasp.esapi.ESAPI; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -487,7 +488,7 @@ public ResponseEntity> myDashboardByTitlePage(@RequestParam(valu @RequestMapping(value = "/dashboard/removeWidgetDuplicates", method = DELETE) public ResponseEntity removeWidgetDuplicates(@RequestParam(value="title", required = false)String title, @RequestParam(value="dryRun", required = true, defaultValue = "true") boolean dryRun){ - String message = dashboardService.removeWidgetDuplicatesHelper(title, dryRun); + String message = dashboardService.removeWidgetDuplicatesHelper(ESAPI.encoder().encodeForHTML(title), dryRun); return ResponseEntity.ok().body(message); } } diff --git a/src/main/java/com/capitalone/dashboard/rest/DefaultTestResultController.java b/src/main/java/com/capitalone/dashboard/rest/DefaultTestResultController.java index f9521aa7..2899bcd7 100644 --- a/src/main/java/com/capitalone/dashboard/rest/DefaultTestResultController.java +++ b/src/main/java/com/capitalone/dashboard/rest/DefaultTestResultController.java @@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import org.owasp.esapi.ESAPI; import javax.servlet.http.HttpServletRequest; import javax.validation.Valid; @@ -93,17 +94,16 @@ public ResponseEntity createPerfTestV2(@Valid @RequestBody PerfTestDataC @RequestMapping(value = "/quality/test-result", method = POST, consumes = "application/json;v=3", produces = APPLICATION_JSON_VALUE) public ResponseEntity createTest(@Valid @RequestBody TestCreateRequest request) throws HygieiaException { - String correlation_id = httpServletRequest.getHeader(CommonConstants.HEADER_CLIENT_CORRELATION_ID); - String requester = httpServletRequest.getHeader(CommonConstants.HEADER_API_USER); - request.setClientReference(correlation_id); + char[] requester = httpServletRequest.getHeader(CommonConstants.HEADER_API_USER).toCharArray(); + request.setClientReference(ESAPI.encoder().encodeForHTML(httpServletRequest.getHeader(CommonConstants.HEADER_CLIENT_CORRELATION_ID))); String response = testResultService.createTest(request); //temporary fix to ensure backward compatibility boolean success = !StringUtils.containsIgnoreCase(response, "Hygieia does not support"); HttpStatus httpStatus = success ? HttpStatus.CREATED : HttpStatus.BAD_REQUEST; String response_status = success ? "success" : "failed"; - LOGGER.info("correlation_id=" + correlation_id + ", application=hygieia, service=api, uri=" + httpServletRequest.getRequestURI() + - ", requester=" + requester + ", response_status=" + response_status + ", response_code=" + httpStatus.value() + + LOGGER.info("correlation_id=" + request.getClientReference() + ", application=hygieia, service=api, uri=" + httpServletRequest.getRequestURI() + + ", requester=" + String.valueOf(requester) + ", response_status=" + response_status + ", response_code=" + httpStatus.value() + ", response_status_message=" + response + ", test_type=" + request.getTestType() + ", test_source_format="+request.getSourceFormat() + ", test_source=" + request.getSource() + ", target_app_name=" + request.getTargetAppName() + ", target_service_name=" + request.getTargetServiceName() + diff --git a/src/main/java/com/capitalone/dashboard/rest/PingController.java b/src/main/java/com/capitalone/dashboard/rest/PingController.java index 1e256fa2..0f28e15d 100644 --- a/src/main/java/com/capitalone/dashboard/rest/PingController.java +++ b/src/main/java/com/capitalone/dashboard/rest/PingController.java @@ -1,6 +1,7 @@ package com.capitalone.dashboard.rest; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.PropertySource; import org.springframework.http.HttpStatus; @@ -15,7 +16,7 @@ @RestController public class PingController { - private static final Logger LOGGER = Logger.getLogger(PingController.class); + private static final Logger LOGGER = LoggerFactory.getLogger(PingController.class); @Value("${version.number}") private String versionNumber; diff --git a/src/main/java/com/capitalone/dashboard/service/AutoDiscoveryServiceImpl.java b/src/main/java/com/capitalone/dashboard/service/AutoDiscoveryServiceImpl.java index bfb0e2ea..61a507d4 100644 --- a/src/main/java/com/capitalone/dashboard/service/AutoDiscoveryServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/service/AutoDiscoveryServiceImpl.java @@ -52,9 +52,9 @@ public AutoDiscovery save(AutoDiscoveryRemoteRequest request) throws HygieiaExce AutoDiscovery autoDiscovery; FeatureFlag featureFlag = featureFlagRepository.findByName(FeatureFlagsEnum.auto_discover.toString()); - if (autoDiscoveryRepository.exists(id)) { + if (autoDiscoveryRepository.existsById(id)) { // update existing AutoDiscovery record with the status from request - autoDiscovery = autoDiscoveryRepository.findOne(id); + autoDiscovery = autoDiscoveryRepository.findById(id).get(); updateAutoDiscovery(autoDiscovery, request, featureFlag); autoDiscovery.setModifiedTimestamp(System.currentTimeMillis()); } else { diff --git a/src/main/java/com/capitalone/dashboard/service/BinaryArtifactServiceImpl.java b/src/main/java/com/capitalone/dashboard/service/BinaryArtifactServiceImpl.java index 7f907185..9414d7e8 100644 --- a/src/main/java/com/capitalone/dashboard/service/BinaryArtifactServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/service/BinaryArtifactServiceImpl.java @@ -73,7 +73,7 @@ public DataResponse> search(BinaryArtifactSearchRequest } private Build getBuildById(ObjectId buildId){ - return buildRepository.findOne(buildId); + return buildRepository.findById(buildId).orElse(null); } @Override @@ -126,7 +126,7 @@ private void setBuildInformation(BinaryArtifact ba, ObjectId buildId) { ba.setBuildNumber(build.getNumber()); } - JobCollectorItem ci = jobRepository.findOne(build.getCollectorItemId()); + JobCollectorItem ci = jobRepository.findById(build.getCollectorItemId()).orElse(null); if (ci != null) { if (ba.getInstanceUrl() == null) { ba.setInstanceUrl(ci.getInstanceUrl()); diff --git a/src/main/java/com/capitalone/dashboard/service/BuildServiceImpl.java b/src/main/java/com/capitalone/dashboard/service/BuildServiceImpl.java index cf2402f1..a22e550d 100644 --- a/src/main/java/com/capitalone/dashboard/service/BuildServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/service/BuildServiceImpl.java @@ -27,24 +27,17 @@ import com.querydsl.core.BooleanBuilder; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; -import org.apache.log4j.Logger; import org.bson.types.ObjectId; import org.joda.time.LocalDate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Sort; import org.springframework.stereotype.Service; import javax.validation.constraints.NotNull; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; +import java.util.*; @Service public class BuildServiceImpl implements BuildService { @@ -60,7 +53,7 @@ public class BuildServiceImpl implements BuildService { @Autowired private ApiSettings settings; - private static final Logger LOGGER = Logger.getLogger(BuildService.class); + private static final Logger LOGGER = LoggerFactory.getLogger(BuildService.class); @Autowired public BuildServiceImpl(BuildRepository buildRepository, @@ -84,9 +77,9 @@ public BuildServiceImpl(BuildRepository buildRepository, @Override public DataResponse> search(BuildSearchRequest request) { CollectorItem item = null; - Component component = componentRepository.findOne(request.getComponentId()); - if ( (component == null) - || ((item = component.getLastUpdatedCollectorItemForType(CollectorType.Build)) == null) ) { + Optional component = componentRepository.findById(request.getComponentId()); + if ( (component.isEmpty()) + || ((item = component.get().getLastUpdatedCollectorItemForType(CollectorType.Build)) == null) ) { Iterable results = new ArrayList<>(); return new DataResponse<>(results, new Date().getTime()); } @@ -115,13 +108,13 @@ public DataResponse> search(BuildSearchRequest request) { builder.and(build.buildStatus.in(request.getBuildStatuses())); } - Collector collector = collectorRepository.findOne(item.getCollectorId()); + Collector collector = collectorRepository.findById(item.getCollectorId()).orElseGet(() -> new Collector()); Iterable result; if (request.getMax() == null) { result = buildRepository.findAll(builder.getValue()); } else { - PageRequest pageRequest = new PageRequest(0, request.getMax(), Sort.Direction.DESC, "timestamp"); + PageRequest pageRequest = PageRequest.of(0, request.getMax(), Sort.Direction.DESC, "timestamp"); result = buildRepository.findAll(builder.getValue(), pageRequest).getContent(); } @@ -179,8 +172,9 @@ public BuildDataCreateResponse createV3(BuildDataCreateRequest request) throws H } response.setClientReference(clientReference); // Will be refactored soon - CollectorItem buildCollectorItem = collectorItemRepository.findOne(build.getCollectorItemId()); - if (buildCollectorItem != null) { + Optional buildCollectorItemOptional = collectorItemRepository.findById(build.getCollectorItemId()); + if (buildCollectorItemOptional.isPresent()) { + CollectorItem buildCollectorItem = buildCollectorItemOptional.get(); LOGGER.info("correlation_id=" + clientReference + ", build_url=" + build.getBuildUrl() + ", build_duration_millis=" + build.getDuration() @@ -241,11 +235,11 @@ private String buildExecNodeLog (BuildStage buildStage, CollectorItem collectorI private void populateDashboardId(BuildDataCreateResponse response) { if (response == null) return; - CollectorItem collectorItem = collectorItemRepository.findOne(response.getCollectorItemId()); - if (collectorItem == null) return; + Optional collectorItem = collectorItemRepository.findById(response.getCollectorItemId()); + if (collectorItem.isEmpty()) return; List dashboards = dashboardService.getDashboardsByCollectorItems - (Collections.singleton(collectorItem), CollectorType.Build); + (Collections.singleton(collectorItem.get()), CollectorType.Build); /* * retrieve the dashboardId only if 1 dashboard is associated for this collectorItem * */ @@ -362,8 +356,13 @@ private void createSCMCollectorItem(@NotNull RepoBranch repoBranch) { Collector collector = collectorRepository.findByName(settings.getGitToolName()); if (collector == null) return; // check if collector item exists and is disabled. - CollectorItem item = collectorItemRepository.findRepoByUrlAndBranch(collector.getId(), + CollectorItem item = null; + List items = collectorItemRepository.findAllRepoByUrlAndBranch(collector.getId(), repoBranch.getBranch(), repoBranch.getUrl()); + if (CollectionUtils.isNotEmpty(items)) { + items.sort(Comparator.comparing(CollectorItem::getLastUpdated).reversed()); + item = items.get(0); + } if (item == null) { item = new CollectorItem(); item.setCollectorId(collector.getId()); diff --git a/src/main/java/com/capitalone/dashboard/service/CloudInstanceServiceImpl.java b/src/main/java/com/capitalone/dashboard/service/CloudInstanceServiceImpl.java index 3fdb0edb..746ee9c0 100644 --- a/src/main/java/com/capitalone/dashboard/service/CloudInstanceServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/service/CloudInstanceServiceImpl.java @@ -51,7 +51,7 @@ public Collection getInstanceDetails(CollectorItem item) { } private CollectorItem getCollectorItem(ObjectId componentId) { - Component component = componentRepository.findOne(componentId); + Component component = componentRepository.findById(componentId).orElseGet(() -> new Component()); if (CollectionUtils.isEmpty(component.getCollectorItems())) return null; return component.getCollectorItems().get(CollectorType.Cloud).get(0); } @@ -106,7 +106,7 @@ public Collection refreshInstances(CloudInstanceListRefreshRequest reque } } if (CollectionUtils.isEmpty(toDelete)) { - cloudInstanceRepository.delete(toDelete); + cloudInstanceRepository.deleteAll(toDelete); } return deletedIds; } diff --git a/src/main/java/com/capitalone/dashboard/service/CloudSubnetServiceImpl.java b/src/main/java/com/capitalone/dashboard/service/CloudSubnetServiceImpl.java index 1f6c8a85..419f0e37 100644 --- a/src/main/java/com/capitalone/dashboard/service/CloudSubnetServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/service/CloudSubnetServiceImpl.java @@ -37,7 +37,7 @@ public CloudSubnetServiceImpl(CloudSubNetworkRepository cloudSubNetworkRepositor private CollectorItem getCollectorItem(ObjectId componentId) { - Component component = componentRepository.findOne(componentId); + Component component = componentRepository.findById(componentId).orElseGet(() -> new Component()); if (CollectionUtils.isEmpty(component.getCollectorItems())) return null; return component.getCollectorItems().get(CollectorType.Cloud).get(0); } @@ -67,7 +67,7 @@ public Collection refreshSubnets(CloudInstanceListRefreshRequest request } } if (CollectionUtils.isEmpty(toDelete)) { - cloudSubNetworkRepository.delete(toDelete); + cloudSubNetworkRepository.deleteAll(toDelete); } return deletedIds; } diff --git a/src/main/java/com/capitalone/dashboard/service/CloudVirtualNetworkServiceImpl.java b/src/main/java/com/capitalone/dashboard/service/CloudVirtualNetworkServiceImpl.java index bc325a85..302e55fd 100644 --- a/src/main/java/com/capitalone/dashboard/service/CloudVirtualNetworkServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/service/CloudVirtualNetworkServiceImpl.java @@ -39,7 +39,7 @@ public CloudVirtualNetworkServiceImpl(CloudVirtualNetworkRepository cloudVirtual } private CollectorItem getCollectorItem(ObjectId componentId) { - Component component = componentRepository.findOne(componentId); + Component component = componentRepository.findById(componentId).orElseGet(() -> new Component()); if (CollectionUtils.isEmpty(component.getCollectorItems())) return null; return component.getCollectorItems().get(CollectorType.Cloud).get(0); } diff --git a/src/main/java/com/capitalone/dashboard/service/CloudVolumeServiceImpl.java b/src/main/java/com/capitalone/dashboard/service/CloudVolumeServiceImpl.java index 5f99eaa1..aa897d27 100644 --- a/src/main/java/com/capitalone/dashboard/service/CloudVolumeServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/service/CloudVolumeServiceImpl.java @@ -51,7 +51,7 @@ public Collection getVolumeDetails(CollectorItem item) { } private CollectorItem getCollectorItem(ObjectId componentId) { - Component component = componentRepository.findOne(componentId); + Component component = componentRepository.findById(componentId).orElseGet(() -> new Component()); if (CollectionUtils.isEmpty(component.getCollectorItems())) return null; return component.getCollectorItems().get(CollectorType.Cloud).get(0); } @@ -112,7 +112,7 @@ public Collection refreshVolumes(CloudVolumeListRefreshRequest request) } } if (CollectionUtils.isEmpty(toDelete)) { - cloudVolumeRepository.delete(toDelete); + cloudVolumeRepository.deleteAll(toDelete); } return deletedIds; } diff --git a/src/main/java/com/capitalone/dashboard/service/CmdbServiceImpl.java b/src/main/java/com/capitalone/dashboard/service/CmdbServiceImpl.java index 6eabbe23..a9fb6876 100644 --- a/src/main/java/com/capitalone/dashboard/service/CmdbServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/service/CmdbServiceImpl.java @@ -52,7 +52,7 @@ public String configurationItemNameByObjectId(ObjectId objectId){ } @Override public Cmdb configurationItemsByObjectId(ObjectId objectId){ - Cmdb cmdb = cmdbRepository.findOne(objectId); + Cmdb cmdb = cmdbRepository.findById(objectId).orElse(null); return cmdb; } @Override diff --git a/src/main/java/com/capitalone/dashboard/service/CodeQualityServiceImpl.java b/src/main/java/com/capitalone/dashboard/service/CodeQualityServiceImpl.java index 6fe420f1..535f74b7 100644 --- a/src/main/java/com/capitalone/dashboard/service/CodeQualityServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/service/CodeQualityServiceImpl.java @@ -109,7 +109,7 @@ private DataResponse> searchType(CodeQualityRequest reques result = codeQualityRepository.findAll(builder.getValue(), quality.timestamp.desc()); } else { PageRequest pageRequest = - new PageRequest(0, request.getMax(), Sort.Direction.DESC, "timestamp"); + PageRequest.of(0, request.getMax(), Sort.Direction.DESC, "timestamp"); result = codeQualityRepository.findAll(builder.getValue(), pageRequest).getContent(); } String instanceUrl = (String)item.getOptions().get("instanceUrl"); @@ -118,14 +118,14 @@ private DataResponse> searchType(CodeQualityRequest reques if ( instanceUrl != null ) { reportUrl = getReportURL(instanceUrl,"dashboard/index/",projectId); } - Collector collector = collectorRepository.findOne(item.getCollectorId()); + Collector collector = collectorRepository.findById(item.getCollectorId()).orElse(null); long lastExecuted = (collector == null) ? 0 : collector.getLastExecuted(); return new DataResponse<>(result, lastExecuted,reportUrl); } protected CollectorItem getCollectorItem(CodeQualityRequest request) { - Component component = componentRepository.findOne(request.getComponentId()); + Component component = componentRepository.findById(request.getComponentId()).orElse(null); if (component == null) { return null; } diff --git a/src/main/java/com/capitalone/dashboard/service/CollectorItemServiceImpl.java b/src/main/java/com/capitalone/dashboard/service/CollectorItemServiceImpl.java index 5fc40bbc..71b38315 100644 --- a/src/main/java/com/capitalone/dashboard/service/CollectorItemServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/service/CollectorItemServiceImpl.java @@ -73,11 +73,11 @@ public ResponseEntity cleanup(String collectorTypeString, String collect for (CollectorItem collectorItem : collectorItems) { if (!hasComponent(collectorType, collectorItem.getId())) { - String loggingPrefix = String.format("cleanup :: Removing (#%d of %d) :: could not find a dashboard for the collectorItem with the following options:" + String loggingPrefix = String.format("cleanup :: Removing (#%d of %d):: could not find a dashboard for the collectorItem with the following options:" ,collectorItems.indexOf(collectorItem)+1, collectorItems.size()); logDeletedCollectorItem(collectorType, collectorItem, loggingPrefix); - collectorItemRepository.delete(collectorItem.getId()); + collectorItemRepository.deleteById(collectorItem.getId()); count++; } } diff --git a/src/main/java/com/capitalone/dashboard/service/CollectorServiceAspect.java b/src/main/java/com/capitalone/dashboard/service/CollectorServiceAspect.java index 4282238e..9fffb6e7 100644 --- a/src/main/java/com/capitalone/dashboard/service/CollectorServiceAspect.java +++ b/src/main/java/com/capitalone/dashboard/service/CollectorServiceAspect.java @@ -45,7 +45,7 @@ private boolean isGit(Collector collector) { } private void normalizeOptions(CollectorItem item, Map uniqueOptions) { - Collector collector = collectorRepository.findOne(item.getCollectorId()); + Collector collector = collectorRepository.findById(item.getCollectorId()).orElseGet(() -> new Collector()); if (collector.getCollectorType() == CollectorType.SCM && isGit(collector)) { String repoUrl = (String)uniqueOptions.get("url"); GitHubParsedUrl gitHubParsed = new GitHubParsedUrl(repoUrl); diff --git a/src/main/java/com/capitalone/dashboard/service/CommitServiceImpl.java b/src/main/java/com/capitalone/dashboard/service/CommitServiceImpl.java index b15d7356..7f4a6f37 100644 --- a/src/main/java/com/capitalone/dashboard/service/CommitServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/service/CommitServiceImpl.java @@ -29,6 +29,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Optional; @Service public class CommitServiceImpl implements CommitService { @@ -55,10 +56,10 @@ public DataResponse> search(CommitRequest request) { BooleanBuilder builder = new BooleanBuilder(); CollectorItem item = null; - Component component = componentRepository.findOne(request.getComponentId()); + Optional component = componentRepository.findById(request.getComponentId()); - if ( (component == null) - || ((item = component.getLastUpdatedCollectorItemForType(CollectorType.SCM)) == null) ) { + if ( (component.isEmpty()) + || ((item = component.get().getLastUpdatedCollectorItemForType(CollectorType.SCM)) == null) ) { Iterable results = new ArrayList<>(); return new DataResponse<>(results, new Date().getTime()); } @@ -88,8 +89,9 @@ public DataResponse> search(CommitRequest request) { builder.and(commit.scmCommitLog.contains(request.getMessageContains())); } - Collector collector = collectorRepository.findOne(item.getCollectorId()); - return new DataResponse<>(commitRepository.findAll(builder.getValue()), collector.getLastExecuted()); + Optional collector = collectorRepository.findById(item.getCollectorId()); + long lastUpdated = collector.isPresent() ? collector.get().getLastExecuted() : 0; + return new DataResponse<>(commitRepository.findAll(builder.getValue()), lastUpdated); } @Override diff --git a/src/main/java/com/capitalone/dashboard/service/ConfigurationServiceImpl.java b/src/main/java/com/capitalone/dashboard/service/ConfigurationServiceImpl.java index d506d2cf..831ceebf 100644 --- a/src/main/java/com/capitalone/dashboard/service/ConfigurationServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/service/ConfigurationServiceImpl.java @@ -32,7 +32,7 @@ public List insertConfigurationData(List configLis for (Configuration config : configList) { config.decryptOrEncrptInfo(); } - return (List) configurationRepository.save(configList); + return (List) configurationRepository.saveAll(configList); } @Override diff --git a/src/main/java/com/capitalone/dashboard/service/DashboardRemoteServiceImpl.java b/src/main/java/com/capitalone/dashboard/service/DashboardRemoteServiceImpl.java index ecb01434..9615b826 100644 --- a/src/main/java/com/capitalone/dashboard/service/DashboardRemoteServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/service/DashboardRemoteServiceImpl.java @@ -161,7 +161,7 @@ public Dashboard remoteCreate(DashboardRemoteRequest request, boolean isUpdate) Set incomingTypes = new HashSet<>(); List entries = request.getAllEntries(); Map allWidgetRequests = generateRequestWidgetList( entries, dashboard, incomingTypes); - Component component = componentRepository.findOne(dashboard.getApplication().getComponents().get(0).getId()); + Component component = componentRepository.findById(dashboard.getApplication().getComponents().get(0).getId()).orElseGet(() -> new Component()); Set existingTypes = new HashSet<>(component.getCollectorItems().keySet()); //adds widgets diff --git a/src/main/java/com/capitalone/dashboard/service/DashboardServiceImpl.java b/src/main/java/com/capitalone/dashboard/service/DashboardServiceImpl.java index 57ad9ae5..7f9ae96d 100644 --- a/src/main/java/com/capitalone/dashboard/service/DashboardServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/service/DashboardServiceImpl.java @@ -114,7 +114,7 @@ public DashboardServiceImpl(DashboardRepository dashboardRepository, @Override public Iterable all() { - Iterable dashboards = dashboardRepository.findAll(new Sort(Sort.Direction.ASC, "title")); + Iterable dashboards = dashboardRepository.findAll(Sort.by(Sort.Direction.ASC, "title")); for(Dashboard dashboard: dashboards){ String appName = dashboard.getConfigurationItemBusServName(); String compName = dashboard.getConfigurationItemBusAppName(); @@ -139,7 +139,7 @@ public Iterable allTemplate(String template){ @Override public Dashboard get(ObjectId id) { - Dashboard dashboard = dashboardRepository.findOne(id); + Dashboard dashboard = dashboardRepository.findById(id).orElseGet(() -> new Dashboard()); String appName = dashboard.getConfigurationItemBusServName(); String compName = dashboard.getConfigurationItemBusAppName(); @@ -185,7 +185,7 @@ private Dashboard create(Dashboard dashboard, boolean isUpdate) throws HygieiaEx if(!isUpdate) { dashboard.setCreatedAt(System.currentTimeMillis()); - components = componentRepository.save(dashboard.getApplication().getComponents()); + components = componentRepository.saveAll(dashboard.getApplication().getComponents()); } dashboard.setUpdatedAt(System.currentTimeMillis()); @@ -202,7 +202,7 @@ private Dashboard create(Dashboard dashboard, boolean isUpdate) throws HygieiaEx } catch (Exception e) { //Exclude deleting of components if this is an update request if(!isUpdate) { - componentRepository.delete(components); + componentRepository.deleteAll(components); } if(e instanceof HygieiaException){ @@ -224,7 +224,7 @@ public Dashboard update(Dashboard dashboard) throws HygieiaException { @Override public void delete(ObjectId id) { - Dashboard dashboard = dashboardRepository.findOne(id); + Dashboard dashboard = dashboardRepository.findById(id).orElseGet(() -> new Dashboard()); if (!isSafeDelete(dashboard)) { throw new UnsafeDeleteException("Cannot delete team dashboard " + dashboard.getTitle() + " as it is referenced by program dashboards."); @@ -232,7 +232,7 @@ public void delete(ObjectId id) { // Remove this Dashboard's services and service dependencies - serviceRepository.delete(serviceRepository.findByDashboardId(id)); + serviceRepository.deleteAll(serviceRepository.findByDashboardId(id)); for (com.capitalone.dashboard.model.Service service : serviceRepository.findByDependedBy(id)) { //NOPMD - using fully qualified or we pickup an incorrect spring class service.getDependedBy().remove(id); serviceRepository.save(service); @@ -242,7 +242,7 @@ public void delete(ObjectId id) { * Delete Dashboard. Then delete component. Then disable collector items if needed */ dashboardRepository.delete(dashboard); - componentRepository.delete(dashboard.getApplication().getComponents()); + componentRepository.deleteAll(dashboard.getApplication().getComponents()); handleCollectorItems(dashboard.getApplication().getComponents()); if (dashboard.isScoreEnabled()) { this.scoreDashboardService.disableScoreForDashboard(dashboard); @@ -303,7 +303,8 @@ public Component associateCollectorToComponent(ObjectId componentId, List collectorItemIds, ObjectId currentCollectorId = null; Collector collector = null; for (ObjectId collectorItemId : collectorItemIds) { - CollectorItem collectorItem = collectorItemRepository.findOne(collectorItemId); + CollectorItem collectorItem = collectorItemRepository.findById(collectorItemId).orElse(null); incomingCollectorItems.put(collectorItemId, collectorItem); if(collectorItem == null) { LOG.warn(METHOD_NAME + " Bad CollectorItemId passed in the request : " + collectorItemId); continue; } if(collector == null || currentCollectorId != collectorItem.getCollectorId()) { - collector = collectorRepository.findOne(collectorItem.getCollectorId()); + collector = collectorRepository.findById(collectorItem.getCollectorId()).orElseGet(() -> new Collector()); currentCollectorId = collector.getId(); } if (!incomingTypes.contains(collector.getCollectorType())) { @@ -390,7 +391,7 @@ private void associateCollectorItemsToComponent(List collectorItemIds, collectorItem.setLastUpdated(System.currentTimeMillis()); } if(collector == null || currentCollectorId != collectorItem.getCollectorId()) { - collector = collectorRepository.findOne(collectorItem.getCollectorId()); + collector = collectorRepository.findById(collectorItem.getCollectorId()).orElseGet(() -> new Collector()); currentCollectorId = collector.getId(); } component.addCollectorItem(collector.getCollectorType(), collectorItem); @@ -399,7 +400,7 @@ private void associateCollectorItemsToComponent(List collectorItemIds, collectorItem.setCollector(collector); } - collectorItemRepository.save(new HashSet<>(toSaveCollectorItems.values())); + collectorItemRepository.saveAll(new HashSet<>(toSaveCollectorItems.values())); if(save){ componentRepository.save(component); } @@ -473,7 +474,7 @@ private Iterable collectorsFromItems(Map collectors) { @@ -520,7 +521,7 @@ public Iterable updateOwners(ObjectId dashboardId, Iterable owners } } - Dashboard dashboard = dashboardRepository.findOne(dashboardId); + Dashboard dashboard = dashboardRepository.findById(dashboardId).orElseGet(() -> new Dashboard()); dashboard.setOwners(Lists.newArrayList(owners)); Dashboard result = dashboardRepository.save(dashboard); @@ -545,7 +546,7 @@ private DashboardType getDashboardType(Dashboard dashboard) { @Override public Component getComponent(ObjectId componentId){ - Component component = componentRepository.findOne(componentId); + Component component = componentRepository.findById(componentId).orElse(null); return component; } @Override @@ -654,7 +655,7 @@ public Dashboard updateDashboardWidgets(ObjectId dashboardId, Dashboard request) dashboard.setActiveWidgets(request.getActiveWidgets()); dashboard = update(dashboard); if(componentId!=null){ - com.capitalone.dashboard.model.Component component = componentRepository.findOne(componentId); + com.capitalone.dashboard.model.Component component = componentRepository.findById(componentId).orElseGet(() -> new Component()); for (CollectorType cType :collectorTypesToDelete) { component.getCollectorItems().remove(cType); } @@ -1010,7 +1011,7 @@ public Dashboard updateScoreSettings(ObjectId dashboardId, boolean scoreEnabled, public String removeWidgetDuplicatesHelper(String title, boolean dryRun){ // get page and clean until there are no more pages if(StringUtils.isEmpty(title)){ - Pageable pageable = new PageRequest(0, settings.getBatchSize()); + Pageable pageable = PageRequest.of(0, settings.getBatchSize()); Page page = findDashboardsByPage("", pageable); while(page.hasContent()){ diff --git a/src/main/java/com/capitalone/dashboard/service/DefaultAuthenticationServiceImpl.java b/src/main/java/com/capitalone/dashboard/service/DefaultAuthenticationServiceImpl.java index ef543a73..30ebed40 100644 --- a/src/main/java/com/capitalone/dashboard/service/DefaultAuthenticationServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/service/DefaultAuthenticationServiceImpl.java @@ -33,7 +33,7 @@ public Iterable all() { @Override public Authentication get(ObjectId id) { - Authentication authentication = authenticationRepository.findOne(id); + Authentication authentication = authenticationRepository.findById(id).orElse(null); return authentication; } @@ -60,7 +60,7 @@ public String update(String username, String password) { @Override public void delete(ObjectId id) { - Authentication authentication = authenticationRepository.findOne(id); + Authentication authentication = authenticationRepository.findById(id).orElse(null); if (authentication != null) { authenticationRepository.delete(authentication); } diff --git a/src/main/java/com/capitalone/dashboard/service/DeployServiceImpl.java b/src/main/java/com/capitalone/dashboard/service/DeployServiceImpl.java index 9b09b2f2..cbd9fcdc 100644 --- a/src/main/java/com/capitalone/dashboard/service/DeployServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/service/DeployServiceImpl.java @@ -91,7 +91,7 @@ public DeployServiceImpl(ComponentRepository componentRepository, @Override public DataResponse> getDeployStatus(ObjectId componentId) { - Component component = componentRepository.findOne(componentId); + Component component = componentRepository.findById(componentId).orElseGet(() -> new Component()); Collection cis = component.getCollectorItems() .get(CollectorType.Deployment); @@ -126,7 +126,7 @@ private DataResponse> getDeployStatus(Collection new Collector()); if (collector.getLastExecuted() > lastExecuted) { lastExecuted = collector.getLastExecuted(); @@ -255,7 +255,7 @@ public String createV3(DeployDataCreateRequest request) throws HygieiaException BuildDataCreateRequest buildRequest = buildRequestFromDeployRequest(request); BuildDataCreateResponse buildResponse = buildService.createV3(buildRequest); ObjectId buildId = buildResponse.getId(); - Build build = buildRepository.findOne(buildId); + Build build = buildRepository.findById(buildId).orElseGet(() -> new Build()); HashMap metadata = new HashMap<>(); metadata.put("appName", request.getAppName()); metadata.put("appServiceName",request.getAppServiceName()); diff --git a/src/main/java/com/capitalone/dashboard/service/DynamicPipelineServiceImpl.java b/src/main/java/com/capitalone/dashboard/service/DynamicPipelineServiceImpl.java index 0043ce84..4bcdbdfd 100644 --- a/src/main/java/com/capitalone/dashboard/service/DynamicPipelineServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/service/DynamicPipelineServiceImpl.java @@ -13,11 +13,14 @@ import java.util.Map; import java.util.Set; import java.util.stream.Collectors; +import java.util.Optional; +import java.util.Objects; import com.capitalone.dashboard.misc.HygieiaException; import org.apache.commons.lang3.ObjectUtils; -import org.apache.log4j.Logger; import org.bson.types.ObjectId; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -65,7 +68,7 @@ */ @Service("dynamic-pipeline") public class DynamicPipelineServiceImpl implements PipelineService { - private static final Logger logger = Logger.getLogger(DynamicPipelineServiceImpl.class); + private static final Logger logger = LoggerFactory.getLogger(DynamicPipelineServiceImpl.class); private static final int PROD_COMMIT_DATE_RANGE_DEFAULT = -90; @@ -145,10 +148,15 @@ private PipelineResponse buildPipelineResponse(Pipeline pipeline, Long lowerBoun /** * get the collector item and dashboard */ - CollectorItem dashboardCollectorItem = collectorItemRepository.findOne(pipeline.getCollectorItemId()); - Dashboard dashboard = dashboardRepository.findOne(new ObjectId((String)dashboardCollectorItem.getOptions().get("dashboardId"))); - - PipelineResponse pipelineResponse = new PipelineResponse(); + PipelineResponse pipelineResponse = new PipelineResponse(); + CollectorItem dashboardCollectorItem = collectorItemRepository.findById(pipeline.getCollectorItemId()).orElse(null); + if (Objects.isNull(dashboardCollectorItem) || Objects.isNull(dashboardCollectorItem.getOptions().get("dashboardId"))) { + return pipelineResponse; + } + Optional dashboardOptional = dashboardRepository.findById(new ObjectId((String)dashboardCollectorItem.getOptions().get("dashboardId"))); + if (dashboardOptional.isEmpty()) return pipelineResponse; + Dashboard dashboard = dashboardOptional.get(); + pipelineResponse.setCollectorItemId(dashboardCollectorItem.getId()); // Fix for 1254 pipelineResponse.setProdStage(PipelineUtils.getProdStage(dashboard)); @@ -202,13 +210,13 @@ private PipelineResponse buildPipelineResponse(Pipeline pipeline, Long lowerBoun * @return the pipeline passed in */ protected Pipeline buildPipeline(Pipeline pipeline, Long lowerBound, Long upperBound) { - CollectorItem dashboardCollectorItem = collectorItemRepository.findOne(pipeline.getCollectorItemId()); - Dashboard dashboard = dashboardRepository.findOne(new ObjectId((String)dashboardCollectorItem.getOptions().get("dashboardId"))); - + CollectorItem dashboardCollectorItem = collectorItemRepository.findById(pipeline.getCollectorItemId()).orElseGet(() -> new CollectorItem()); + Optional dashboard = dashboardRepository.findById(new ObjectId((String)dashboardCollectorItem.getOptions().get("dashboardId"))); + if (dashboard.isEmpty()) return pipeline; // First gather information about our dashboard // TODO how should we handle multiple components? - Component component = dashboard.getApplication().getComponents().iterator().next(); + Component component = dashboard.get().getApplication().getComponents().iterator().next(); // Note - since other items link to commits we always need to pull all of our commit data List commits = getCommits(component, getMinStart(), upperBound); @@ -382,7 +390,7 @@ protected void processBuilds(Pipeline pipeline, List builds, List * Computes the build stage of the pipeline. *

* Iterates over each environment to determine what commits currently exist in the current deployment. - * Given an {@link Environment} this method will iterate over its {@link DeploymentUnit}s until + * Given an {@link Environment} this method will iterate over its {DeploymentUnit}s until * a unit is found that corresponds to a {@link BinaryArtifact} that exists in the artifacts * collection. DeploymentUnits are artifacts are currently correlated by name and version. * If the artifact is found an attempt is made to find the last {@link Commit} that was used @@ -892,7 +900,7 @@ private PipelineResponseCommit applyStageTimestamps(PipelineResponseCommit commi * Gets all commits for a given pipeline stage, taking into account the mappings for environment stages * @param dashboard * @param pipeline - * @param stageType + * @param stage * @return */ private Map findCommitsForStage(Dashboard dashboard, Pipeline pipeline, PipelineStage stage) throws HygieiaException { diff --git a/src/main/java/com/capitalone/dashboard/service/FeatureFlagServiceImpl.java b/src/main/java/com/capitalone/dashboard/service/FeatureFlagServiceImpl.java index 60c226dc..f068f995 100644 --- a/src/main/java/com/capitalone/dashboard/service/FeatureFlagServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/service/FeatureFlagServiceImpl.java @@ -6,7 +6,6 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; import org.apache.commons.collections4.IterableUtils; -import org.apache.log4j.Logger; import org.bson.types.ObjectId; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -46,7 +45,7 @@ public List getFeatureFlags(){ @Override public void deleteFlags(ObjectId id){ - featureFlagRepository.delete(id); + featureFlagRepository.deleteById(id); } } diff --git a/src/main/java/com/capitalone/dashboard/service/FeatureServiceImpl.java b/src/main/java/com/capitalone/dashboard/service/FeatureServiceImpl.java index 9b34e432..2b4eab2c 100644 --- a/src/main/java/com/capitalone/dashboard/service/FeatureServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/service/FeatureServiceImpl.java @@ -90,7 +90,7 @@ public FeatureServiceImpl(ComponentRepository componentRepository, */ @Override public DataResponse> getStory(ObjectId componentId, String storyNumber) { - Component component = componentRepository.findOne(componentId); + Component component = componentRepository.findById(componentId).orElse(null); if ((component == null) || CollectionUtils.isEmpty(component.getCollectorItems()) || CollectionUtils .isEmpty(component.getCollectorItems().get(CollectorType.AgileTool)) @@ -106,7 +106,7 @@ public DataResponse> getStory(ObjectId componentId, String storyNu // Get one story based on story number, based on component List story = featureRepository.getStoryByNumber(storyNumber); - Collector collector = collectorRepository.findOne(item.getCollectorId()); + Collector collector = collectorRepository.findById(item.getCollectorId()).orElseGet(() -> new Collector()); return new DataResponse<>(story, collector.getLastExecuted()); } @@ -124,7 +124,7 @@ public DataResponse> getStory(ObjectId componentId, String storyNu @Override public DataResponse> getRelevantStories(ObjectId componentId, String teamId, String projectId, Optional agileType) { - Component component = componentRepository.findOne(componentId); + Component component = componentRepository.findById(componentId).orElse(null); if ((component == null) || CollectionUtils.isEmpty(component.getCollectorItems()) || CollectionUtils .isEmpty(component.getCollectorItems().get(CollectorType.AgileTool)) @@ -141,7 +141,7 @@ public DataResponse> getRelevantStories(ObjectId componentId, Stri // Get teamId first from available collector item, based on component List relevantStories = getFeaturesForCurrentSprints(teamId, projectId, item.getCollectorId(), agileType.isPresent()? agileType.get() : null, false); - Collector collector = collectorRepository.findOne(item.getCollectorId()); + Collector collector = collectorRepository.findById(item.getCollectorId()).orElseGet(() -> new Collector()); return new DataResponse<>(relevantStories, collector.getLastExecuted()); } @@ -162,7 +162,7 @@ public DataResponse> getRelevantStories(ObjectId componentId, Stri @Override public DataResponse> getFeatureEpicEstimates(ObjectId componentId, String teamId, String projectId, Optional agileType, Optional estimateMetricType) { - Component component = componentRepository.findOne(componentId); + Component component = componentRepository.findById(componentId).orElse(null); if ((component == null) || CollectionUtils.isEmpty(component.getCollectorItems()) || CollectionUtils @@ -210,14 +210,14 @@ public DataResponse> getFeatureEpicEstimates(ObjectId componentId, } } - Collector collector = collectorRepository.findOne(item.getCollectorId()); + Collector collector = collectorRepository.findById(item.getCollectorId()).orElseGet(() -> new Collector()); return new DataResponse<>(new ArrayList<>(epicIDToEpicFeatureMap.values()), collector.getLastExecuted()); } @Override public DataResponse getAggregatedSprintEstimates(ObjectId componentId, String teamId, String projectId, Optional agileType, Optional estimateMetricType) { - Component component = componentRepository.findOne(componentId); + Component component = componentRepository.findById(componentId).orElse(null); if ((component == null) || CollectionUtils.isEmpty(component.getCollectorItems()) || CollectionUtils .isEmpty(component.getCollectorItems().get(CollectorType.AgileTool)) @@ -226,7 +226,7 @@ public DataResponse getAggregatedSprintEstimates(ObjectId compon } CollectorItem item = component.getCollectorItems().get(CollectorType.AgileTool).get(0); - Collector collector = collectorRepository.findOne(item.getCollectorId()); + Collector collector = collectorRepository.findById(item.getCollectorId()).orElseGet(() -> new Collector()); SprintEstimate estimate = getSprintEstimates(teamId, projectId, item.getCollectorId(), agileType, estimateMetricType); return new DataResponse<>(estimate, collector.getLastExecuted()); @@ -248,7 +248,7 @@ public DataResponse getAggregatedSprintEstimates(ObjectId compon @Deprecated public DataResponse> getTotalEstimate(ObjectId componentId, String teamId, Optional agileType, Optional estimateMetricType) { - Component component = componentRepository.findOne(componentId); + Component component = componentRepository.findById(componentId).orElse(null); if ((component == null) || CollectionUtils.isEmpty(component.getCollectorItems()) || CollectionUtils @@ -264,7 +264,7 @@ public DataResponse> getTotalEstimate(ObjectId componentId, String List list = Collections.singletonList(new Feature()); list.get(0).setsEstimate(Integer.toString(estimate.getTotalEstimate())); - Collector collector = collectorRepository.findOne(item.getCollectorId()); + Collector collector = collectorRepository.findById(item.getCollectorId()).orElseGet(() -> new Collector()); return new DataResponse<>(list, collector.getLastExecuted()); } @@ -284,7 +284,7 @@ public DataResponse> getTotalEstimate(ObjectId componentId, String @Deprecated public DataResponse> getInProgressEstimate(ObjectId componentId, String teamId, Optional agileType, Optional estimateMetricType) { - Component component = componentRepository.findOne(componentId); + Component component = componentRepository.findById(componentId).orElse(null); if ((component == null) || CollectionUtils.isEmpty(component.getCollectorItems()) || CollectionUtils @@ -300,7 +300,7 @@ public DataResponse> getInProgressEstimate(ObjectId componentId, S List list = Collections.singletonList(new Feature()); list.get(0).setsEstimate(Integer.toString(estimate.getInProgressEstimate())); - Collector collector = collectorRepository.findOne(item.getCollectorId()); + Collector collector = collectorRepository.findById(item.getCollectorId()).orElseGet(() -> new Collector()); return new DataResponse<>(list, collector.getLastExecuted()); } @@ -320,7 +320,7 @@ public DataResponse> getInProgressEstimate(ObjectId componentId, S @Deprecated public DataResponse> getDoneEstimate(ObjectId componentId, String teamId, Optional agileType, Optional estimateMetricType) { - Component component = componentRepository.findOne(componentId); + Component component = componentRepository.findById(componentId).orElse(null); if ((component == null) || CollectionUtils.isEmpty(component.getCollectorItems()) || CollectionUtils @@ -336,7 +336,7 @@ public DataResponse> getDoneEstimate(ObjectId componentId, String List list = Collections.singletonList(new Feature()); list.get(0).setsEstimate(Integer.toString(estimate.getCompleteEstimate())); - Collector collector = collectorRepository.findOne(item.getCollectorId()); + Collector collector = collectorRepository.findById(item.getCollectorId()).orElseGet(() -> new Collector()); return new DataResponse<>(list, collector.getLastExecuted()); } @@ -354,7 +354,7 @@ public DataResponse> getDoneEstimate(ObjectId componentId, String @Override public DataResponse> getCurrentSprintDetail(ObjectId componentId, String teamId, String projectId, Optional agileType) { - Component component = componentRepository.findOne(componentId); + Component component = componentRepository.findById(componentId).orElse(null); if ((component == null) || CollectionUtils.isEmpty(component.getCollectorItems()) || CollectionUtils .isEmpty(component.getCollectorItems().get(CollectorType.AgileTool)) @@ -367,7 +367,7 @@ public DataResponse> getCurrentSprintDetail(ObjectId componentId, // Get teamId first from available collector item, based on component List sprintResponse = getFeaturesForCurrentSprints(teamId, projectId, item.getCollectorId(), agileType.isPresent()? agileType.get() : null, true); - Collector collector = collectorRepository.findOne(item.getCollectorId()); + Collector collector = collectorRepository.findById(item.getCollectorId()).orElseGet(() -> new Collector()); return new DataResponse<>(sprintResponse, collector.getLastExecuted()); } @@ -506,4 +506,4 @@ private int getEstimate(Feature feature, Optional estimateMetricType) { return rt; } -} \ No newline at end of file +} diff --git a/src/main/java/com/capitalone/dashboard/service/GenericCollectorItemServiceImpl.java b/src/main/java/com/capitalone/dashboard/service/GenericCollectorItemServiceImpl.java index 424fa01c..bc8e3b43 100644 --- a/src/main/java/com/capitalone/dashboard/service/GenericCollectorItemServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/service/GenericCollectorItemServiceImpl.java @@ -88,7 +88,7 @@ public String create(GenericCollectorItemCreateRequest request) throws HygieiaEx @Override public String createGenericBinaryArtifactData(GenericCollectorItemCreateRequest request){ ObjectId id = new ObjectId(request.getBuildId()); - Build currentBuild = buildRepository.findOne(id); + Build currentBuild = buildRepository.findById(id).orElseGet(() -> new Build()); String artifactName = captureArtifactAttributes(apiSettings.getCapturePattern(),request.getRawData(),ARTIFACT_NAME); String artifactVersion = captureArtifactAttributes(apiSettings.getCapturePattern(),request.getRawData(),ARTIFACT_VERSION); String artifactGroupId = captureArtifactAttributes(apiSettings.getCapturePattern(),request.getRawData(),ARTIFACT_GROUP); diff --git a/src/main/java/com/capitalone/dashboard/service/GitRequestServiceImpl.java b/src/main/java/com/capitalone/dashboard/service/GitRequestServiceImpl.java index 9e42086a..fbe6a3bb 100644 --- a/src/main/java/com/capitalone/dashboard/service/GitRequestServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/service/GitRequestServiceImpl.java @@ -53,7 +53,7 @@ public DataResponse> search(GitRequestRequest request, BooleanBuilder builder = new BooleanBuilder(); CollectorItem item = null; - Component component = componentRepository.findOne(request.getComponentId()); + Component component = componentRepository.findById(request.getComponentId()).orElse(null); if ( (component == null) || ((item = component.getLastUpdatedCollectorItemForType(CollectorType.SCM)) == null) ) { Iterable results = new ArrayList<>(); @@ -75,7 +75,7 @@ public DataResponse> search(GitRequestRequest request, (state.toLowerCase().equals("closed")) || (state.toLowerCase().equals("merged")))) { builder.and(gitRequest.state.eq(state)); } - Collector collector = collectorRepository.findOne(item.getCollectorId()); + Collector collector = collectorRepository.findById(item.getCollectorId()).orElse(null); if ((collector == null) || (collector.getId() == null)) { Iterable results = new ArrayList<>(); return new DataResponse<>(results, new Date().getTime()); @@ -119,8 +119,8 @@ public DataResponse> getGitRequestsForWidget(GitRequestRequ private boolean isNewGitRequest(CollectorItem repo, GitRequest gitRequest) { - return gitRequestRepository.findByCollectorItemIdAndScmRevisionNumber( - repo.getId(), gitRequest.getScmRevisionNumber()) == null; + List gitRequests = gitRequestRepository.findAllByCollectorItemIdAndScmRevisionNumber(repo.getId(), gitRequest.getScmRevisionNumber()); + return CollectionUtils.isEmpty(gitRequests); } private class GitHubv3 { diff --git a/src/main/java/com/capitalone/dashboard/service/LibraryPolicyServiceImpl.java b/src/main/java/com/capitalone/dashboard/service/LibraryPolicyServiceImpl.java index 3a9f421d..0f9f386d 100644 --- a/src/main/java/com/capitalone/dashboard/service/LibraryPolicyServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/service/LibraryPolicyServiceImpl.java @@ -73,7 +73,7 @@ public DataResponse> search(LibraryPolicyRequest reque itemResult = libraryPolicyResultsRepository.findAll(builder.getValue(), policyResult.timestamp.desc()); } else { PageRequest pageRequest = - new PageRequest(0, request.getMax(), Sort.Direction.DESC, "timestamp"); + PageRequest.of(0, request.getMax(), Sort.Direction.DESC, "timestamp"); itemResult = libraryPolicyResultsRepository.findAll(builder.getValue(), pageRequest).getContent(); } if (itemResult != null) { @@ -82,7 +82,7 @@ public DataResponse> search(LibraryPolicyRequest reque results.add(lpr); } } - Collector collector = collectorRepository.findOne(item.getCollectorId()); + Collector collector = collectorRepository.findById(item.getCollectorId()).orElse(null); long runTime = (collector == null) ? 0 : collector.getLastExecuted(); lastExecuted = (runTime < lastExecuted) ? runTime : lastExecuted; } @@ -91,7 +91,7 @@ public DataResponse> search(LibraryPolicyRequest reque protected List getCollectorItems(LibraryPolicyRequest request) { - Component component = componentRepository.findOne(request.getComponentId()); + Component component = componentRepository.findById(request.getComponentId()).orElse(null); return (component != null) ? component.getCollectorItems(CollectorType.LibraryPolicy) : null; } diff --git a/src/main/java/com/capitalone/dashboard/service/LogAnalysisServiceImpl.java b/src/main/java/com/capitalone/dashboard/service/LogAnalysisServiceImpl.java index 22b7afc8..aa7759b1 100644 --- a/src/main/java/com/capitalone/dashboard/service/LogAnalysisServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/service/LogAnalysisServiceImpl.java @@ -38,7 +38,7 @@ public DataResponse> search(LogAnalysisSearchRequest reque if (null == request) { return emptyResponse(); } - Component component = componentRepository.findOne(request.getComponentId()); + Component component = componentRepository.findById(request.getComponentId()).orElse(null); if (null == component) { return emptyResponse(); } @@ -54,11 +54,11 @@ public DataResponse> search(LogAnalysisSearchRequest reque if (null == request.getMax()) { result = this.repository.findAll(builder.getValue(), log.timestamp.desc()); } else { - PageRequest pageRequest = new PageRequest(0, request.getMax(), Sort.Direction.DESC, "timestamp"); + PageRequest pageRequest = PageRequest.of(0, request.getMax(), Sort.Direction.DESC, "timestamp"); result = this.repository.findAll(builder.getValue(), pageRequest); } - Collector collector = collectorRepository.findOne(item.getCollectorId()); + Collector collector = collectorRepository.findById(item.getCollectorId()).orElseGet(() -> new Collector()); return new DataResponse<>(result,collector.getLastExecuted()); } diff --git a/src/main/java/com/capitalone/dashboard/service/Monitor2ServiceImpl.java b/src/main/java/com/capitalone/dashboard/service/Monitor2ServiceImpl.java index 2afae5e2..69db9a2f 100644 --- a/src/main/java/com/capitalone/dashboard/service/Monitor2ServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/service/Monitor2ServiceImpl.java @@ -11,6 +11,7 @@ import org.springframework.stereotype.Service; import java.util.List; +import java.util.Optional; // Hits the repositories for saving the data to mongo and retrieving it. @Service @@ -36,7 +37,7 @@ public List dashboardMonitor2es(ObjectId dashboardId) { @Override public Monitor2 get(ObjectId monitor2Id) { - return monitor2Repository.findOne(monitor2Id); + return monitor2Repository.findById(monitor2Id).orElse(null); } @Override @@ -48,8 +49,9 @@ public Monitor2 create(ObjectId dashboardId, Monitor2DataCreateRequest monitor2D monitor2.setDashboardId(dashboardId); monitor2.setLastUpdated(System.currentTimeMillis()); - Dashboard dashboard = dashboardRepository.findOne(dashboardId); - monitor2.setApplicationName(dashboard.getApplication().getName()); + Optional dashboard = dashboardRepository.findById(dashboardId); + if (dashboard.isEmpty()) return null; + monitor2.setApplicationName(dashboard.get().getApplication().getName()); return monitor2Repository.save(monitor2); } diff --git a/src/main/java/com/capitalone/dashboard/service/PerformanceServiceImpl.java b/src/main/java/com/capitalone/dashboard/service/PerformanceServiceImpl.java index bf2275dc..cd2d0362 100644 --- a/src/main/java/com/capitalone/dashboard/service/PerformanceServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/service/PerformanceServiceImpl.java @@ -30,6 +30,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Optional; @Service public class PerformanceServiceImpl implements PerformanceService { @@ -90,24 +91,24 @@ private DataResponse> searchType(PerformanceSearchRequest result = performanceRepository.findAll(builder.getValue(), performance.timestamp.desc()); } else { PageRequest pageRequest = - new PageRequest(0, request.getMax(), Sort.Direction.DESC, "timestamp"); + PageRequest.of(0, request.getMax(), Sort.Direction.DESC, "timestamp"); result = performanceRepository.findAll(builder.getValue(), pageRequest).getContent(); } - Collector collector = collectorRepository.findOne(item.getCollectorId()); - long lastExecuted = (collector == null) ? 0 : collector.getLastExecuted(); + Optional collector = collectorRepository.findById(item.getCollectorId()); + long lastExecuted = (collector.isEmpty()) ? 0 : collector.get().getLastExecuted(); return new DataResponse<>(result, lastExecuted); } protected CollectorItem getCollectorItem(PerformanceSearchRequest request) { - Component component = componentRepository.findOne(request.getComponentId()); - if (component == null) { + Optional component = componentRepository.findById(request.getComponentId()); + if (component.isEmpty()) { return null; } CollectorItem item = null; PerformanceType qualityType = MoreObjects.firstNonNull(request.getType(), PerformanceType.ApplicationPerformance); - List items = component.getCollectorItems().get(qualityType.collectorType()); + List items = component.get().getCollectorItems().get(qualityType.collectorType()); if (items != null) { item = Iterables.getFirst(items, null); } diff --git a/src/main/java/com/capitalone/dashboard/service/PipelineServiceImpl.java b/src/main/java/com/capitalone/dashboard/service/PipelineServiceImpl.java index a9b6ec42..d60d076a 100644 --- a/src/main/java/com/capitalone/dashboard/service/PipelineServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/service/PipelineServiceImpl.java @@ -29,6 +29,7 @@ import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; +import java.util.Optional; @Service("pipeline") public class PipelineServiceImpl implements PipelineService { @@ -80,15 +81,16 @@ private PipelineResponse buildPipelineResponse(Pipeline pipeline, Long beginDate /** * get the collector item and dashboard */ - CollectorItem dashboardCollectorItem = collectorItemRepository.findOne(pipeline.getCollectorItemId()); + CollectorItem dashboardCollectorItem = collectorItemRepository.findById(pipeline.getCollectorItemId()).orElseGet(() -> new CollectorItem()); if(dashboardCollectorItem.getOptions().get("dashboardId") == null) { throw new HygieiaException(" Collector Item: " + dashboardCollectorItem.getId() + " is not associated to a dashboard. ", HygieiaException.BAD_DATA); } String dashboardId = (String) dashboardCollectorItem.getOptions().get("dashboardId"); - Dashboard dashboard = dashboardRepository.findOne(new ObjectId(dashboardId)); - if(dashboard == null) { + Optional dashboardOptional = dashboardRepository.findById(new ObjectId(dashboardId)); + if(dashboardOptional.isEmpty()) { throw new HygieiaException(" Dashboard " + dashboardId + " is not found for collectorItem: " + dashboardCollectorItem.getId() + " ", HygieiaException.BAD_DATA); } + Dashboard dashboard = dashboardOptional.get(); PipelineResponse pipelineResponse = new PipelineResponse(); pipelineResponse.setCollectorItemId(dashboardCollectorItem.getId()); pipelineResponse.setProdStage(PipelineUtils.getProdStage(dashboard)); diff --git a/src/main/java/com/capitalone/dashboard/service/RallyFeatureServiceImpl.java b/src/main/java/com/capitalone/dashboard/service/RallyFeatureServiceImpl.java index 6ce65846..bb5c8520 100644 --- a/src/main/java/com/capitalone/dashboard/service/RallyFeatureServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/service/RallyFeatureServiceImpl.java @@ -65,7 +65,7 @@ public List rallyWidgetDataDetails(CollectorItem collectorItem) { public CollectorItem getCollectorItem(RallyFeatureRequest request) { - Component component = componentRepository.findOne(request.getComponentId()); + Component component = componentRepository.findById(request.getComponentId()).orElse(null); if (component == null) { return null; } diff --git a/src/main/java/com/capitalone/dashboard/service/ScopeServiceImpl.java b/src/main/java/com/capitalone/dashboard/service/ScopeServiceImpl.java index 26ea63ef..441de7b3 100644 --- a/src/main/java/com/capitalone/dashboard/service/ScopeServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/service/ScopeServiceImpl.java @@ -13,6 +13,7 @@ import org.springframework.stereotype.Service; import java.util.List; +import java.util.Optional; @Service public class ScopeServiceImpl implements ScopeService { @@ -53,7 +54,7 @@ public List getAllScopes() { for (Scope scope : scopes) { Collector collector = collectorRepository - .findOne(scope.getCollectorId()); + .findById(scope.getCollectorId()).orElseGet(() -> new Collector()); scope.setCollector(collector); } @@ -75,8 +76,11 @@ public List getAllScopes() { @Override public DataResponse> getScope(ObjectId componentId, String scopeId) { - Component component = componentRepository.findOne(componentId); - CollectorItem item = component.getCollectorItems() + Optional component = componentRepository.findById(componentId); + if (component.isEmpty()) { + new DataResponse<>(null, 0); + } + CollectorItem item = component.get().getCollectorItems() .get(CollectorType.AgileTool).get(0); QScopeOwner team = new QScopeOwner("team"); BooleanBuilder builder = new BooleanBuilder(); @@ -87,7 +91,7 @@ public DataResponse> getScope(ObjectId componentId, List scope = scopeRepository.getScopeById(scopeId); Collector collector = collectorRepository - .findOne(item.getCollectorId()); + .findById(item.getCollectorId()).orElseGet(() -> new Collector()); return new DataResponse<>(scope, collector.getLastExecuted()); } diff --git a/src/main/java/com/capitalone/dashboard/service/ScoreDashboardServiceImpl.java b/src/main/java/com/capitalone/dashboard/service/ScoreDashboardServiceImpl.java index ab76278a..a1460106 100644 --- a/src/main/java/com/capitalone/dashboard/service/ScoreDashboardServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/service/ScoreDashboardServiceImpl.java @@ -8,17 +8,20 @@ import com.capitalone.dashboard.repository.CollectorItemRepository; import com.capitalone.dashboard.repository.ScoreCollectorItemRepository; import org.apache.commons.collections.CollectionUtils; -import org.apache.log4j.Logger; + import org.bson.types.ObjectId; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; + @Service public class ScoreDashboardServiceImpl implements ScoreDashboardService { - private static final Logger LOGGER = Logger.getLogger(ScoreDashboardServiceImpl.class); + private static final Logger LOGGER = LoggerFactory.getLogger(ScoreDashboardServiceImpl.class); private final CollectorService collectorService; private final ScoreCollectorItemRepository scoreCollectorItemRepository; diff --git a/src/main/java/com/capitalone/dashboard/service/ServiceAccountServiceImpl.java b/src/main/java/com/capitalone/dashboard/service/ServiceAccountServiceImpl.java index f1cbbc4a..8e2b31f8 100644 --- a/src/main/java/com/capitalone/dashboard/service/ServiceAccountServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/service/ServiceAccountServiceImpl.java @@ -3,17 +3,19 @@ import com.capitalone.dashboard.model.ServiceAccount; import com.capitalone.dashboard.repository.ServiceAccountRepository; import com.google.common.collect.Sets; -import org.apache.log4j.Logger; import org.bson.types.ObjectId; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.util.Collection; +import java.util.Optional; @Component public class ServiceAccountServiceImpl implements ServiceAccountService { - private static final Logger LOGGER = Logger.getLogger(ServiceAccountServiceImpl.class); + private static final Logger LOGGER = LoggerFactory.getLogger(ServiceAccountServiceImpl.class); private ServiceAccountRepository serviceAccountRepository; @@ -40,7 +42,8 @@ public Collection getAllServiceAccounts() { @Override public String updateAccount(String serviceAccount, String fileNames, ObjectId id){ - ServiceAccount sa = serviceAccountRepository.findOne(id); + Optional saOptional = serviceAccountRepository.findById(id).or(() -> Optional.of(new ServiceAccount("", ""))); + ServiceAccount sa = saOptional.get(); sa.setServiceAccountName(serviceAccount); sa.setFileNames(fileNames); serviceAccountRepository.save(sa); @@ -49,7 +52,7 @@ public String updateAccount(String serviceAccount, String fileNames, ObjectId id @Override public void deleteAccount(ObjectId id ){ - serviceAccountRepository.delete(id); + serviceAccountRepository.deleteById(id); } diff --git a/src/main/java/com/capitalone/dashboard/service/ServiceServiceImpl.java b/src/main/java/com/capitalone/dashboard/service/ServiceServiceImpl.java index a53fe526..ca879a66 100644 --- a/src/main/java/com/capitalone/dashboard/service/ServiceServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/service/ServiceServiceImpl.java @@ -5,7 +5,9 @@ import java.net.URL; import java.net.URLConnection; import java.util.List; +import java.util.Objects; +import com.capitalone.dashboard.model.Application; import org.bson.types.ObjectId; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -52,7 +54,7 @@ public List dashboardDependentServices(ObjectId dashboardId) { @Override public Service get(ObjectId id) { - return serviceRepository.findOne(id); + return serviceRepository.findById(id).orElse(null); } @Override @@ -63,8 +65,8 @@ public Service create(ObjectId dashboardId, String name, String url) { service.setDashboardId(dashboardId); service.setStatus(ServiceStatus.Warning); service.setLastUpdated(System.currentTimeMillis()); - Dashboard dashboard = dashboardRepository.findOne(dashboardId); - service.setApplicationName(dashboard.getApplication().getName()); + Dashboard dashboard = dashboardRepository.findById(dashboardId).orElseGet(() -> new Dashboard()); + service.setApplicationName(Objects.nonNull(dashboard.getApplication()) ? dashboard.getApplication().getName() : ""); return serviceRepository.save(service); } @@ -112,8 +114,8 @@ public void refreshService(ObjectId dashboardId, ObjectId serviceId) { service.setDashboardId(dashboardId); service.setStatus(getServiceStatus(service.getUrl(), dashboardId)); service.setLastUpdated(System.currentTimeMillis()); - Dashboard dashboard = dashboardRepository.findOne(dashboardId); - service.setApplicationName(dashboard.getApplication().getName()); + Dashboard dashboard = dashboardRepository.findById(dashboardId).orElseGet(() -> new Dashboard()); + service.setApplicationName(Objects.nonNull(dashboard.getApplication()) ? dashboard.getApplication().getName() : ""); serviceRepository.save(service); } diff --git a/src/main/java/com/capitalone/dashboard/service/TeamInventoryServiceImpl.java b/src/main/java/com/capitalone/dashboard/service/TeamInventoryServiceImpl.java index 21769319..1841635b 100644 --- a/src/main/java/com/capitalone/dashboard/service/TeamInventoryServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/service/TeamInventoryServiceImpl.java @@ -25,7 +25,7 @@ public TeamInventoryServiceImpl(TeamInventoryRepository teamInventoryRepository, @Override public DataResponse getTeamData(String teamName, String teamId) { TeamInventory teamInventory = teamInventoryRepository.findByNameAndTeamId(teamName,teamId); - Collector collector = collectorRepository.findOne(teamInventory.getCollectorId()); + Collector collector = collectorRepository.findById(teamInventory.getCollectorId()).orElseGet(() -> new Collector()); return new DataResponse<>(teamInventory, collector.getLastExecuted()); } } diff --git a/src/main/java/com/capitalone/dashboard/service/TeamServiceImpl.java b/src/main/java/com/capitalone/dashboard/service/TeamServiceImpl.java index 2c401e8d..dcc24ed6 100644 --- a/src/main/java/com/capitalone/dashboard/service/TeamServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/service/TeamServiceImpl.java @@ -16,6 +16,7 @@ import org.springframework.stereotype.Service; import java.util.List; +import java.util.Optional; @Service public class TeamServiceImpl implements TeamService { @@ -56,7 +57,7 @@ public Iterable getAllTeams() { for (Team team : teams) { Collector collector = collectorRepository - .findOne(team.getCollectorId()); + .findById(team.getCollectorId()).orElseGet(() -> new Collector()); team.setCollector(collector); } @@ -78,15 +79,16 @@ public Iterable getAllTeams() { @Override public DataResponse getTeam(ObjectId componentId, String teamId) { - Component component = componentRepository.findOne(componentId); - CollectorItem item = component.getCollectorItems() + Optional component = componentRepository.findById(componentId); + if (component.isEmpty()) return new DataResponse<>(null, 0); + CollectorItem item = component.get().getCollectorItems() .get(CollectorType.AgileTool).get(0); // Get one scope by Id Team team = teamRepository.findByTeamId(teamId); Collector collector = collectorRepository - .findOne(item.getCollectorId()); + .findById(item.getCollectorId()).orElseGet(() -> new Collector()); return new DataResponse<>(team, collector.getLastExecuted()); } diff --git a/src/main/java/com/capitalone/dashboard/service/TemplateServiceImpl.java b/src/main/java/com/capitalone/dashboard/service/TemplateServiceImpl.java index 90dd898a..b331db2f 100644 --- a/src/main/java/com/capitalone/dashboard/service/TemplateServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/service/TemplateServiceImpl.java @@ -40,13 +40,13 @@ public Template update(Template template) throws HygieiaException { @Override public void delete(ObjectId id) { - templateRepository.delete(id); + templateRepository.deleteById(id); } @Override public Template get(ObjectId id) { - Template template = templateRepository.findOne(id); + Template template = templateRepository.findById(id).orElse(null); return template; } diff --git a/src/main/java/com/capitalone/dashboard/service/TestResultServiceImpl.java b/src/main/java/com/capitalone/dashboard/service/TestResultServiceImpl.java index 4a93fa68..7e1c0ede 100644 --- a/src/main/java/com/capitalone/dashboard/service/TestResultServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/service/TestResultServiceImpl.java @@ -23,9 +23,10 @@ import hygieia.transformer.JunitXmlToTestCapabilityTransformer; import hygieia.transformer.JunitXmlToTestCapabilityTransformerV2; import org.apache.commons.lang3.StringUtils; -import org.apache.log4j.Logger; import org.bson.types.ObjectId; import org.joda.time.format.DateTimeFormat; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Sort; @@ -45,6 +46,7 @@ import java.util.Objects; import java.util.regex.Matcher; import java.util.regex.Pattern; +import java.util.Optional; @Service public class TestResultServiceImpl implements TestResultService { @@ -58,7 +60,7 @@ public class TestResultServiceImpl implements TestResultService { private final CmdbService cmdbService; private final ApiSettings apiSettings; - private static final Logger LOGGER = Logger.getLogger(ApiTokenServiceImpl.class); + private static final Logger LOGGER = LoggerFactory.getLogger(ApiTokenServiceImpl.class); @Autowired public TestResultServiceImpl(TestResultRepository testResultRepository, @@ -81,18 +83,19 @@ public TestResultServiceImpl(TestResultRepository testResultRepository, @Override public DataResponse> search(com.capitalone.dashboard.request.TestResultRequest request) { - Component component = componentRepository.findOne(request.getComponentId()); + Optional componentOptional = componentRepository.findById(request.getComponentId()); - if ((component == null) || !component.getCollectorItems().containsKey(CollectorType.Test)) { + if ((componentOptional.isEmpty()) || !componentOptional.get().getCollectorItems().containsKey(CollectorType.Test)) { return new DataResponse<>(null, 0L); } + Component component = componentOptional.get(); List result = new ArrayList<>(); validateAllCollectorItems(request, component, result); //One collector per Type. get(0) is hardcoded. if (!CollectionUtils.isEmpty(component.getCollectorItems().get(CollectorType.Test)) && (component.getCollectorItems().get(CollectorType.Test).get(0) != null)) { - Collector collector = collectorRepository.findOne(component.getCollectorItems().get(CollectorType.Test).get(0).getCollectorId()); - if (collector != null) { - return new DataResponse<>(pruneToDepth(result, request.getDepth()), collector.getLastExecuted()); + Optional collectorOptional = collectorRepository.findById(component.getCollectorItems().get(CollectorType.Test).get(0).getCollectorId()); + if (collectorOptional.isPresent()) { + return new DataResponse<>(pruneToDepth(result, request.getDepth()), collectorOptional.get().getLastExecuted()); } } @@ -119,7 +122,7 @@ private void addAllTestResultRepositories(com.capitalone.dashboard.request.TestR if (request.getMax() == null) { result.addAll(Lists.newArrayList(testResultRepository.findAll(builder.getValue(), testResult.timestamp.desc()))); } else { - PageRequest pageRequest = new PageRequest(0, request.getMax(), Sort.Direction.DESC, "timestamp"); + PageRequest pageRequest = PageRequest.of(0, request.getMax(), Sort.Direction.DESC, "timestamp"); result.addAll(Lists.newArrayList(testResultRepository.findAll(builder.getValue(), pageRequest).getContent())); } } @@ -709,7 +712,7 @@ private String getConfigurationItem(String configurationItem, String targetAppNa } else if (StringUtils.isNotBlank(targetAppName) ){ List cmdb = cmdbService.configurationItemsByTypeWithFilter("", targetAppName, - new PageRequest(0, 1)).getContent(); + PageRequest.of(0, 1)).getContent(); if(cmdb.size() > 0){ return cmdb.get(0).getConfigurationItem(); } diff --git a/src/main/java/com/capitalone/dashboard/service/UserInfoServiceImpl.java b/src/main/java/com/capitalone/dashboard/service/UserInfoServiceImpl.java index 71452771..7b5cc561 100644 --- a/src/main/java/com/capitalone/dashboard/service/UserInfoServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/service/UserInfoServiceImpl.java @@ -7,7 +7,9 @@ import com.capitalone.dashboard.auth.AuthProperties; import com.capitalone.dashboard.settings.ApiSettings; import org.apache.commons.lang3.StringUtils; -import org.apache.log4j.Logger; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; @@ -33,7 +35,7 @@ @Component public class UserInfoServiceImpl implements UserInfoService { - private static final Logger LOGGER = Logger.getLogger(UserInfoServiceImpl.class); + private static final Logger LOGGER = LoggerFactory.getLogger(UserInfoServiceImpl.class); private UserInfoRepository userInfoRepository; @Autowired diff --git a/src/main/java/com/capitalone/dashboard/webhook/datasync/ArtifactDataSyncDelegate.java b/src/main/java/com/capitalone/dashboard/webhook/datasync/ArtifactDataSyncDelegate.java index 6186bd3e..fb033310 100644 --- a/src/main/java/com/capitalone/dashboard/webhook/datasync/ArtifactDataSyncDelegate.java +++ b/src/main/java/com/capitalone/dashboard/webhook/datasync/ArtifactDataSyncDelegate.java @@ -53,7 +53,8 @@ public DataSyncResponse clean(Collector collector) { bs.sort(Comparator.comparing(BinaryArtifact::getTimestamp).reversed()); BinaryArtifact binaryArtifact = bs.stream().filter(Objects::nonNull).findFirst().orElse(null); if (Objects.nonNull(binaryArtifact)) { - CollectorItem collectorItem = dataSyncServiceImpl.getCollectorItemRepository().findOne(binaryArtifact.getCollectorItemId()); + CollectorItem collectorItem = dataSyncServiceImpl.getCollectorItemRepository().findById(binaryArtifact.getCollectorItemId()).orElse(null); + if (Objects.isNull(collectorItem)) continue; List suspectCollectorItems = dataSyncUtils.deleteCollectorItems(collectorItems, collectorItem, suspects); collectorItemsCount += suspectCollectorItems.size(); if (CollectionUtils.isEmpty(components)) continue; @@ -71,4 +72,4 @@ public DataSyncResponse clean(Collector collector) { } return new DataSyncResponse(componentIds, collectorItemsCount, collectorName + " refresh Successful==>> Updated " + componentCount + " components and " + collectorItemsCount + " collectorItems."); } -} \ No newline at end of file +} diff --git a/src/main/java/com/capitalone/dashboard/webhook/datasync/DataSyncUtils.java b/src/main/java/com/capitalone/dashboard/webhook/datasync/DataSyncUtils.java index 2f95614e..5111c69a 100644 --- a/src/main/java/com/capitalone/dashboard/webhook/datasync/DataSyncUtils.java +++ b/src/main/java/com/capitalone/dashboard/webhook/datasync/DataSyncUtils.java @@ -38,7 +38,7 @@ public DataSyncUtils(DataSyncServiceImpl dataSyncServiceImpl) { } public int pages(Collector collector) { - Page collectorItemsPage = dataSyncServiceImpl.getCollectorItemRepository().findByCollectorIdIn(Collections.singleton(collector.getId()), new PageRequest(MAX_PAGE_SIZE, MAX_PAGE_SIZE)); + Page collectorItemsPage = dataSyncServiceImpl.getCollectorItemRepository().findByCollectorIdIn(Collections.singleton(collector.getId()), PageRequest.of(MAX_PAGE_SIZE, MAX_PAGE_SIZE)); if (Objects.isNull(collectorItemsPage)) return ZERO; return collectorItemsPage.getTotalPages(); } @@ -47,7 +47,7 @@ public List getAllCollectorItems(Collector collector, int total) LOG.info("starting - collecting collector items"); List collectorItems = new ArrayList<>(); IntStream.range(ZERO, total).forEach(idx -> { - Page collectorItemsPage = dataSyncServiceImpl.getCollectorItemRepository().findByCollectorIdIn(Collections.singleton(collector.getId()), new PageRequest(idx, MAX_PAGE_SIZE)); + Page collectorItemsPage = dataSyncServiceImpl.getCollectorItemRepository().findByCollectorIdIn(Collections.singleton(collector.getId()), PageRequest.of(idx, MAX_PAGE_SIZE)); collectorItems.addAll(collectorItemsPage.getContent()); LOG.info("completed " + idx + " run"); }); @@ -89,7 +89,7 @@ public int clearDuplicateCollectorItemsAndUpdateComponents(List c suspectsList.removeIf(sci -> sci.getId().equals(first.getId())); suspectsList.forEach(sci -> { collectorItems.removeIf(cItem -> cItem.getId().equals(sci.getId())); - dataSyncServiceImpl.getCollectorItemRepository().delete(sci.getId()); + dataSyncServiceImpl.getCollectorItemRepository().deleteById(sci.getId()); }); if (CollectionUtils.isEmpty(components)) return componentCount; int componentsUpdated = updateComponents(collector, components, first, collectorType); @@ -118,7 +118,7 @@ public List deleteCollectorItems(List collectorIte suspectCollectorItems.removeIf(cItem -> cItem.getId().equals(collectorItem.getId())); suspectCollectorItems.forEach(colItem -> { collectorItems.removeIf(cItem -> cItem.getId().equals(colItem.getId())); - dataSyncServiceImpl.getCollectorItemRepository().delete(colItem.getId()); + dataSyncServiceImpl.getCollectorItemRepository().deleteById(colItem.getId()); }); return suspectCollectorItems; } diff --git a/src/main/java/com/capitalone/dashboard/webhook/datasync/GithubDataSyncDelegate.java b/src/main/java/com/capitalone/dashboard/webhook/datasync/GithubDataSyncDelegate.java index 8171967a..dbb787fa 100644 --- a/src/main/java/com/capitalone/dashboard/webhook/datasync/GithubDataSyncDelegate.java +++ b/src/main/java/com/capitalone/dashboard/webhook/datasync/GithubDataSyncDelegate.java @@ -6,7 +6,7 @@ import com.capitalone.dashboard.model.Component; import com.capitalone.dashboard.model.GitRequest; import com.capitalone.dashboard.request.DataSyncResponse; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.IterableUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -44,7 +44,11 @@ public DataSyncResponse clean(Collector collector) { List grs = new ArrayList<>(); List components = new ArrayList<>(); suspects.forEach(suspect -> { - GitRequest gitRequest = dataSyncServiceImpl.getGitRequestRepository().findTopByCollectorItemIdOrderByTimestampDesc(suspect.getId()); + List gitRequests = dataSyncServiceImpl.getGitRequestRepository().findAllByCollectorItemIdOrderByTimestampDesc(suspect.getId()); + GitRequest gitRequest = null; + if (CollectionUtils.isNotEmpty(gitRequests)) { + gitRequest = gitRequests.get(0); + } grs.add(gitRequest); List cs = dataSyncServiceImpl.getComponentRepository().findBySCMCollectorItemId(suspect.getId()); components.addAll(cs); @@ -55,7 +59,8 @@ public DataSyncResponse clean(Collector collector) { gs.sort(Comparator.comparing(GitRequest::getTimestamp).reversed()); GitRequest pullRequest = gs.stream().filter(Objects::nonNull).findFirst().orElse(null); if (Objects.nonNull(pullRequest)) { - CollectorItem collectorItem = dataSyncServiceImpl.getCollectorItemRepository().findOne(pullRequest.getCollectorItemId()); + CollectorItem collectorItem = dataSyncServiceImpl.getCollectorItemRepository().findById(pullRequest.getCollectorItemId()).orElse(null); + if (Objects.isNull(collectorItem)) continue; List suspectCollectorItems = dataSyncUtils.deleteCollectorItems(collectorItems, collectorItem, suspects); collectorItemsCount += suspectCollectorItems.size(); if (CollectionUtils.isEmpty(components)) continue; @@ -73,4 +78,4 @@ public DataSyncResponse clean(Collector collector) { } return new DataSyncResponse(componentIds, collectorItemsCount,collectorName + " refresh Successful==>> Updated " + componentCount + " components and " + collectorItemsCount + " collectorItems."); } -} \ No newline at end of file +} diff --git a/src/main/java/com/capitalone/dashboard/webhook/datasync/LibraryPolicyDataSyncDelegate.java b/src/main/java/com/capitalone/dashboard/webhook/datasync/LibraryPolicyDataSyncDelegate.java index f7f85b4d..82598ffb 100644 --- a/src/main/java/com/capitalone/dashboard/webhook/datasync/LibraryPolicyDataSyncDelegate.java +++ b/src/main/java/com/capitalone/dashboard/webhook/datasync/LibraryPolicyDataSyncDelegate.java @@ -56,7 +56,8 @@ public DataSyncResponse clean(Collector collector) { lp.sort(Comparator.comparing(LibraryPolicyResult::getTimestamp).reversed()); LibraryPolicyResult libraryPolicyResult = lp.stream().filter(Objects::nonNull).findFirst().orElse(null); if (Objects.nonNull(libraryPolicyResult)) { - CollectorItem collectorItem = dataSyncServiceImpl.getCollectorItemRepository().findOne(libraryPolicyResult.getCollectorItemId()); + CollectorItem collectorItem = dataSyncServiceImpl.getCollectorItemRepository().findById(libraryPolicyResult.getCollectorItemId()).orElse(null); + if (Objects.isNull(collectorItem)) continue; List suspectCollectorItems = dataSyncUtils.deleteCollectorItems(collectorItems,collectorItem,suspects); collectorItemsCount += suspectCollectorItems.size(); if (CollectionUtils.isEmpty(components)) continue; @@ -75,4 +76,4 @@ public DataSyncResponse clean(Collector collector) { } return new DataSyncResponse(componentIds,collectorItemsCount,collectorName + " refresh Successful==>> Updated " + componentCount + " components and " + collectorItemsCount + " collectorItems."); } -} \ No newline at end of file +} diff --git a/src/main/java/com/capitalone/dashboard/webhook/datasync/SonarDataSyncDelegate.java b/src/main/java/com/capitalone/dashboard/webhook/datasync/SonarDataSyncDelegate.java index 09c0c01b..9c9a2f50 100644 --- a/src/main/java/com/capitalone/dashboard/webhook/datasync/SonarDataSyncDelegate.java +++ b/src/main/java/com/capitalone/dashboard/webhook/datasync/SonarDataSyncDelegate.java @@ -53,7 +53,8 @@ public DataSyncResponse clean(Collector collector) { cq.sort(Comparator.comparing(CodeQuality::getTimestamp).reversed()); CodeQuality codeQuality = cq.stream().filter(Objects::nonNull).findFirst().orElse(null); if (Objects.nonNull(codeQuality)) { - CollectorItem collectorItem = dataSyncServiceImpl.getCollectorItemRepository().findOne(codeQuality.getCollectorItemId()); + CollectorItem collectorItem = dataSyncServiceImpl.getCollectorItemRepository().findById(codeQuality.getCollectorItemId()).orElse(null); + if (Objects.isNull(collectorItem)) continue; List suspectCollectorItems = dataSyncUtils.deleteCollectorItems(collectorItems, collectorItem, suspects); collectorItemsCount += suspectCollectorItems.size(); if (CollectionUtils.isEmpty(components)) continue; @@ -72,4 +73,4 @@ public DataSyncResponse clean(Collector collector) { } return new DataSyncResponse(componentIds, collectorItemsCount,collectorName + " refresh Successful==>> Updated " + componentCount + " components and " + collectorItemsCount + " collectorItems."); } -} \ No newline at end of file +} diff --git a/src/main/java/com/capitalone/dashboard/webhook/datasync/StaticSecurityDataSyncDelegate.java b/src/main/java/com/capitalone/dashboard/webhook/datasync/StaticSecurityDataSyncDelegate.java index 1120f889..a37c773d 100644 --- a/src/main/java/com/capitalone/dashboard/webhook/datasync/StaticSecurityDataSyncDelegate.java +++ b/src/main/java/com/capitalone/dashboard/webhook/datasync/StaticSecurityDataSyncDelegate.java @@ -53,7 +53,8 @@ public DataSyncResponse clean(Collector collector) { cq.sort(Comparator.comparing(CodeQuality::getTimestamp).reversed()); CodeQuality staticSecurity = cq.stream().filter(Objects::nonNull).findFirst().orElse(null); if (Objects.nonNull(staticSecurity)) { - CollectorItem collectorItem = dataSyncServiceImpl.getCollectorItemRepository().findOne(staticSecurity.getCollectorItemId()); + CollectorItem collectorItem = dataSyncServiceImpl.getCollectorItemRepository().findById(staticSecurity.getCollectorItemId()).orElse(null); + if (Objects.isNull(collectorItem)) continue; List suspectCollectorItems = dataSyncUtils.deleteCollectorItems(collectorItems, collectorItem, suspects); collectorItemsCount += suspectCollectorItems.size(); if (CollectionUtils.isEmpty(components)) continue; @@ -72,4 +73,4 @@ public DataSyncResponse clean(Collector collector) { } return new DataSyncResponse(componentIds,collectorItemsCount, collectorName + " refresh Successful==>> Updated " + componentCount + " components and " + collectorItemsCount + " collectorItems."); } -} \ No newline at end of file +} diff --git a/src/main/java/com/capitalone/dashboard/webhook/datasync/TestDataSyncDelegate.java b/src/main/java/com/capitalone/dashboard/webhook/datasync/TestDataSyncDelegate.java index f47b89e0..697a1343 100644 --- a/src/main/java/com/capitalone/dashboard/webhook/datasync/TestDataSyncDelegate.java +++ b/src/main/java/com/capitalone/dashboard/webhook/datasync/TestDataSyncDelegate.java @@ -39,7 +39,8 @@ public DataSyncResponse clean(Collector collector) { TestResult testResult = dataSyncServiceImpl.getTestResultRepository().findTop1ByCollectorItemIdOrderByTimestampDesc(c.getId()); LOG.info("collectorItem run +++" + count + " of " + collectorItems.size()); if (Objects.nonNull(testResult)) { - CollectorItem collectorItem = dataSyncServiceImpl.getCollectorItemRepository().findOne(testResult.getCollectorItemId()); + CollectorItem collectorItem = dataSyncServiceImpl.getCollectorItemRepository().findById(testResult.getCollectorItemId()).orElse(null); + if (Objects.isNull(collectorItem)) continue; collectorItem.getOptions().put(TEST_TYPE, testResult.getType()); dataSyncServiceImpl.getCollectorItemRepository().save(collectorItem); collectorItemsCount++; @@ -64,4 +65,4 @@ private void setTestType(CollectorItem c, String regex, String type) { dataSyncServiceImpl.getCollectorItemRepository().save(c); } } -} \ No newline at end of file +} diff --git a/src/main/java/com/capitalone/dashboard/webhook/github/GitHubCommitV3.java b/src/main/java/com/capitalone/dashboard/webhook/github/GitHubCommitV3.java index 352671d4..9ad023db 100644 --- a/src/main/java/com/capitalone/dashboard/webhook/github/GitHubCommitV3.java +++ b/src/main/java/com/capitalone/dashboard/webhook/github/GitHubCommitV3.java @@ -117,7 +117,7 @@ public String process(JSONObject jsonObject) throws MalformedURLException, Hygie List commitList = getCommits(commitsObjectList, repoUrl, branch, gitHubWebHookToken, senderObj); updateCollectorItemLastUpdated(repoUrl, branch); - commitRepository.save(commitList); + commitRepository.saveAll(commitList); return result; } @@ -272,9 +272,16 @@ private boolean checkCommitsListForSettingPullNumber(List commitsList) { } protected void setCommitPullNumber (Commit commit) { - GitRequest pr = gitRequestRepository.findByScmRevisionNumberOrScmMergeEventRevisionNumber(commit.getScmRevisionNumber()); + List prs = gitRequestRepository.findAllByScmRevisionNumberOrScmMergeEventRevisionNumberOrderByTimestampDesc(commit.getScmRevisionNumber()); + GitRequest pr = null; + if (CollectionUtils.isNotEmpty(prs)) { + pr = prs.get(0); + } if (pr == null) { - pr = gitRequestRepository.findByCommitScmRevisionNumber(commit.getScmRevisionNumber()); + prs = gitRequestRepository.findAllByCommitScmRevisionNumberOrderByTimestampDesc(commit.getScmRevisionNumber()); + if (CollectionUtils.isNotEmpty(prs)) { + pr = prs.get(0); + } } if (pr != null) { commit.setPullNumber(pr.getNumber()); diff --git a/src/main/java/com/capitalone/dashboard/webhook/github/GitHubIssueV3.java b/src/main/java/com/capitalone/dashboard/webhook/github/GitHubIssueV3.java index 8c33d8b5..f038b2f6 100644 --- a/src/main/java/com/capitalone/dashboard/webhook/github/GitHubIssueV3.java +++ b/src/main/java/com/capitalone/dashboard/webhook/github/GitHubIssueV3.java @@ -12,10 +12,13 @@ import com.capitalone.dashboard.model.GitRequest; import com.capitalone.dashboard.repository.GitRequestRepository; import com.capitalone.dashboard.service.CollectorService; +import org.apache.commons.collections4.CollectionUtils; import org.joda.time.DateTime; import org.json.simple.JSONObject; import java.net.MalformedURLException; +import java.util.Comparator; +import java.util.List; import java.util.Map; public class GitHubIssueV3 extends GitHubV3 { @@ -118,8 +121,12 @@ protected GitRequest getIssue(Map issueMap, GitHubParsed gitHubParsed, String br } protected void setCollectorItemId(GitRequest issue) throws HygieiaException, MalformedURLException { - GitRequest existingIssue - = gitRequestRepository.findByScmUrlIgnoreCaseAndScmBranchIgnoreCaseAndNumberAndRequestTypeIgnoreCase(issue.getScmUrl(), issue.getScmBranch(), issue.getNumber(), "issue"); + List issues = gitRequestRepository.findAllByScmUrlIgnoreCaseAndScmBranchIgnoreCaseAndNumberAndRequestTypeIgnoreCase(issue.getScmUrl(), issue.getScmBranch(), issue.getNumber(), "issue"); + GitRequest existingIssue = null; + if (CollectionUtils.isNotEmpty(issues)) { + issues.sort(Comparator.comparing(GitRequest::getTimestamp).reversed()); + existingIssue = issues.get(0); + } if (existingIssue != null) { issue.setId(existingIssue.getId()); issue.setCollectorItemId(existingIssue.getCollectorItemId()); @@ -133,4 +140,4 @@ protected void setCollectorItemId(GitRequest issue) throws HygieiaException, Mal issue.setCollectorItemId(collectorItem.getId()); } } -} \ No newline at end of file +} diff --git a/src/main/java/com/capitalone/dashboard/webhook/github/GitHubPullRequestV3.java b/src/main/java/com/capitalone/dashboard/webhook/github/GitHubPullRequestV3.java index cef9ba14..fb401d7e 100644 --- a/src/main/java/com/capitalone/dashboard/webhook/github/GitHubPullRequestV3.java +++ b/src/main/java/com/capitalone/dashboard/webhook/github/GitHubPullRequestV3.java @@ -20,7 +20,7 @@ import com.capitalone.dashboard.service.CollectorService; import com.capitalone.dashboard.webhook.settings.GitHubWebHookSettings; import com.capitalone.dashboard.webhook.settings.WebHookSettings; -import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; import org.apache.commons.logging.Log; @@ -32,12 +32,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.client.RestClientException; import java.net.MalformedURLException; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.List; -import java.util.ArrayList; -import java.util.Collections; +import java.util.*; public class GitHubPullRequestV3 extends GitHubV3 { private static final Log LOG = LogFactory.getLog(GitHubPullRequestV3.class); @@ -281,9 +276,13 @@ protected GitRequest buildGitRequestFromPayload(String repoUrl, String branch, O protected void setCollectorItemId (GitRequest pull) throws MalformedURLException, HygieiaException { long start = System.currentTimeMillis(); - GitRequest existingPR - = gitRequestRepository.findByScmUrlIgnoreCaseAndScmBranchIgnoreCaseAndNumberAndRequestTypeIgnoreCase(pull.getScmUrl(), pull.getScmBranch(), pull.getNumber(), "pull"); - + List gitRequests + = gitRequestRepository.findAllByScmUrlIgnoreCaseAndScmBranchIgnoreCaseAndNumberAndRequestTypeIgnoreCase(pull.getScmUrl(), pull.getScmBranch(), pull.getNumber(), "pull"); + GitRequest existingPR = null; + if (CollectionUtils.isNotEmpty(gitRequests)) { + gitRequests.sort(Comparator.comparing(GitRequest::getTimestamp).reversed()); + existingPR = gitRequests.get(0); + } if (existingPR != null) { pull.setId(existingPR.getId()); pull.setCollectorItemId(existingPR.getCollectorItemId()); @@ -551,4 +550,4 @@ private boolean isValidEvent(String action) { return validPullRequestEvents.contains(PullRequestEvent.fromString(action)); } -} \ No newline at end of file +} diff --git a/src/main/java/com/capitalone/dashboard/webhook/github/GitHubSyncServiceImpl.java b/src/main/java/com/capitalone/dashboard/webhook/github/GitHubSyncServiceImpl.java index 342ddae0..1aa97f1c 100644 --- a/src/main/java/com/capitalone/dashboard/webhook/github/GitHubSyncServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/webhook/github/GitHubSyncServiceImpl.java @@ -596,7 +596,7 @@ private int processCommits(GitHubRepo repo) { if (existingCount == 0) { List newCommits = getCommits(); newCommits.forEach(c -> c.setCollectorItemId(repo.getId())); - Iterable saved = commitRepository.save(newCommits); + Iterable saved = commitRepository.saveAll(newCommits); count = saved != null ? Lists.newArrayList(saved).size() : 0; } else { Collection nonDupCommits = getCommits().stream() @@ -669,7 +669,7 @@ private void processOrphanCommits(GitHubRepo repo) { List orphanSaveList = orphanCommits.stream().filter(c -> !StringUtils.isEmpty(c.getPullNumber())).collect(Collectors.toList()); orphanSaveList.forEach(c -> LOG.info("Updating orphan " + c.getScmRevisionNumber() + " " + new DateTime(c.getScmCommitTimestamp()).toString("yyyy-MM-dd hh:mm:ss.SSa") + " with pull " + c.getPullNumber())); - commitRepository.save(orphanSaveList); + commitRepository.saveAll(orphanSaveList); } diff --git a/src/main/java/com/capitalone/dashboard/webhook/github/GitHubV3.java b/src/main/java/com/capitalone/dashboard/webhook/github/GitHubV3.java index 1d095b39..59027288 100644 --- a/src/main/java/com/capitalone/dashboard/webhook/github/GitHubV3.java +++ b/src/main/java/com/capitalone/dashboard/webhook/github/GitHubV3.java @@ -28,10 +28,7 @@ import org.springframework.web.client.RestClientException; import java.net.MalformedURLException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; public abstract class GitHubV3 { private static final Log LOG = LogFactory.getLog(GitHubV3.class); @@ -139,7 +136,12 @@ protected CollectorItem getCollectorItem(String repoUrl, String branch) throws H if (col == null) throw new HygieiaException("Failed creating collector.", HygieiaException.COLLECTOR_CREATE_ERROR); - CollectorItem item = collectorItemRepository.findRepoByUrlAndBranch(col.getId(), repoUrl, branch); + List items = collectorItemRepository.findAllRepoByUrlAndBranch(col.getId(), repoUrl, branch); + CollectorItem item = null; + if (CollectionUtils.isNotEmpty(items)) { + items.sort(Comparator.comparing(CollectorItem::getLastUpdated).reversed()); + item = items.get(0); + } if (item != null) return item; @@ -270,7 +272,12 @@ protected boolean isRegistered(String repoUrl, String branch) throws HygieiaExce if (col == null) throw new HygieiaException("Failed creating collector.", HygieiaException.COLLECTOR_CREATE_ERROR); - CollectorItem existingItem = getCollectorItemRepository().findRepoByUrlAndBranch(col.getId(), repoUrl, branch, true); + List collectorItems = getCollectorItemRepository().findAllRepoByUrlAndBranchAndEnabled(col.getId(), repoUrl, branch, true); + CollectorItem existingItem = null; + if (CollectionUtils.isNotEmpty(collectorItems)) { + collectorItems.sort(Comparator.comparing(CollectorItem::getLastUpdated).reversed()); + existingItem = collectorItems.get(0); + } return existingItem != null; } -} \ No newline at end of file +} diff --git a/src/main/java/com/capitalone/dashboard/webhook/sonarqube/SonarQubeHookServiceImpl.java b/src/main/java/com/capitalone/dashboard/webhook/sonarqube/SonarQubeHookServiceImpl.java index 9c9a6b5c..1eb44f2a 100644 --- a/src/main/java/com/capitalone/dashboard/webhook/sonarqube/SonarQubeHookServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/webhook/sonarqube/SonarQubeHookServiceImpl.java @@ -343,7 +343,7 @@ public ResponseEntity syncData(SonarDataSyncRequest request) throws Hygi String math = updatedProjects.size() + "/" + projects.size(); String message = math + " sonar collector items and " + compIndex + " dashboard components can be updated"; if (isSync) { - sonarProjectRepository.save(updatedProjects); + sonarProjectRepository.saveAll(updatedProjects); message = math + " sonar collector items and " + compIndex + " dashboard components updated"; } LOG.info(message); diff --git a/src/main/resources/.esapi/ESAPI.properties b/src/main/resources/.esapi/ESAPI.properties new file mode 100644 index 00000000..d51fdb9d --- /dev/null +++ b/src/main/resources/.esapi/ESAPI.properties @@ -0,0 +1,455 @@ +# +# OWASP Enterprise Security API (ESAPI) Properties file -- PRODUCTION Version +# +# This file is part of the Open Web Application Security Project (OWASP) +# Enterprise Security API (ESAPI) project. For details, please see +# http://www.owasp.org/index.php/ESAPI. +# +# Copyright (c) 2008,2009 - The OWASP Foundation +# +# DISCUSS: This may cause a major backwards compatibility issue, etc. but +# from a name space perspective, we probably should have prefaced +# all the property names with ESAPI or at least OWASP. Otherwise +# there could be problems is someone loads this properties file into +# the System properties. We could also put this file into the +# esapi.jar file (perhaps as a ResourceBundle) and then allow an external +# ESAPI properties be defined that would overwrite these defaults. +# That keeps the application's properties relatively simple as usually +# they will only want to override a few properties. If looks like we +# already support multiple override levels of this in the +# DefaultSecurityConfiguration class, but I'm suggesting placing the +# defaults in the esapi.jar itself. That way, if the jar is signed, +# we could detect if those properties had been tampered with. (The +# code to check the jar signatures is pretty simple... maybe 70-90 LOC, +# but off course there is an execution penalty (similar to the way +# that the separate sunjce.jar used to be when a class from it was +# first loaded). Thoughts? +############################################################################### +# +# WARNING: Operating system protection should be used to lock down the .esapi +# resources directory and all the files inside and all the directories all the +# way up to the root directory of the file system. Note that if you are using +# file-based implementations, that some files may need to be read-write as they +# get updated dynamically. +# +# Before using, be sure to update the MasterKey and MasterSalt as described below. +# N.B.: If you had stored data that you have previously encrypted with ESAPI 1.4, +# you *must* FIRST decrypt it using ESAPI 1.4 and then (if so desired) +# re-encrypt it with ESAPI 2.0. If you fail to do this, you will NOT be +# able to decrypt your data with ESAPI 2.0. +# +# YOU HAVE BEEN WARNED!!! More details are in the ESAPI 2.0 Release Notes. +# +#=========================================================================== +# ESAPI Configuration +# +# If true, then print all the ESAPI properties set here when they are loaded. +# If false, they are not printed. Useful to reduce output when running JUnit tests. +# If you need to troubleshoot a properties related problem, turning this on may help. +# This is 'false' in the src/test/resources/.esapi version. It is 'true' by +# default for reasons of backward compatibility with earlier ESAPI versions. +ESAPI.printProperties=true + +# ESAPI is designed to be easily extensible. You can use the reference implementation +# or implement your own providers to take advantage of your enterprise's security +# infrastructure. The functions in ESAPI are referenced using the ESAPI locator, like: +# +# String ciphertext = +# ESAPI.encryptor().encrypt("Secret message"); // Deprecated in 2.0 +# CipherText cipherText = +# ESAPI.encryptor().encrypt(new PlainText("Secret message")); // Preferred +# +# Below you can specify the classname for the provider that you wish to use in your +# application. The only requirement is that it implement the appropriate ESAPI interface. +# This allows you to switch security implementations in the future without rewriting the +# entire application. +# +# ExperimentalAccessController requires ESAPI-AccessControlPolicy.xml in .esapi directory +ESAPI.AccessControl=org.owasp.esapi.reference.DefaultAccessController +# FileBasedAuthenticator requires users.txt file in .esapi directory +ESAPI.Authenticator=org.owasp.esapi.reference.FileBasedAuthenticator +ESAPI.Encoder=org.owasp.esapi.reference.DefaultEncoder +ESAPI.Encryptor=org.owasp.esapi.reference.crypto.JavaEncryptor + +ESAPI.Executor=org.owasp.esapi.reference.DefaultExecutor +ESAPI.HTTPUtilities=org.owasp.esapi.reference.DefaultHTTPUtilities +ESAPI.IntrusionDetector=org.owasp.esapi.reference.DefaultIntrusionDetector +# Log4JFactory Requires log4j.xml or log4j.properties in classpath - http://www.laliluna.de/log4j-tutorial.html +#ESAPI.Logger=org.owasp.esapi.reference.Log4JLogFactory +#ESAPI.Logger=org.owasp.esapi.reference.JavaLogFactory +ESAPI.Logger=org.owasp.esapi.logging.slf4j.Slf4JLogFactory +ESAPI.Randomizer=org.owasp.esapi.reference.DefaultRandomizer +ESAPI.Validator=org.owasp.esapi.reference.DefaultValidator + +#=========================================================================== +# ESAPI Authenticator +# +Authenticator.AllowedLoginAttempts=3 +Authenticator.MaxOldPasswordHashes=13 +Authenticator.UsernameParameterName=username +Authenticator.PasswordParameterName=password +# RememberTokenDuration (in days) +Authenticator.RememberTokenDuration=14 +# Session Timeouts (in minutes) +Authenticator.IdleTimeoutDuration=20 +Authenticator.AbsoluteTimeoutDuration=120 + +#=========================================================================== +# ESAPI Encoder +# +# ESAPI canonicalizes input before validation to prevent bypassing filters with encoded attacks. +# Failure to canonicalize input is a very common mistake when implementing validation schemes. +# Canonicalization is automatic when using the ESAPI Validator, but you can also use the +# following code to canonicalize data. +# +# ESAPI.Encoder().canonicalize( "%22hello world"" ); +# +# Multiple encoding is when a single encoding format is applied multiple times. Allowing +# multiple encoding is strongly discouraged. +Encoder.AllowMultipleEncoding=false + +# Mixed encoding is when multiple different encoding formats are applied, or when +# multiple formats are nested. Allowing multiple encoding is strongly discouraged. +Encoder.AllowMixedEncoding=false + +# The default list of codecs to apply when canonicalizing untrusted data. The list should include the codecs +# for all downstream interpreters or decoders. For example, if the data is likely to end up in a URL, HTML, or +# inside JavaScript, then the list of codecs below is appropriate. The order of the list is not terribly important. +Encoder.DefaultCodecList=HTMLEntityCodec,PercentCodec,JavaScriptCodec + + +#=========================================================================== +# ESAPI Encryption +# +# The ESAPI Encryptor provides basic cryptographic functions with a simplified API. +# To get started, generate a new key using java -classpath esapi.jar org.owasp.esapi.reference.crypto.JavaEncryptor +# There is not currently any support for key rotation, so be careful when changing your key and salt as it +# will invalidate all signed, encrypted, and hashed data. +# +# WARNING: Not all combinations of algorithms and key lengths are supported. +# If you choose to use a key length greater than 128, you MUST download the +# unlimited strength policy files and install in the lib directory of your JRE/JDK. +# See http://java.sun.com/javase/downloads/index.jsp for more information. +# +# Backward compatibility with ESAPI Java 1.4 is supported by the two deprecated API +# methods, Encryptor.encrypt(String) and Encryptor.decrypt(String). However, whenever +# possible, these methods should be avoided as they use ECB cipher mode, which in almost +# all circumstances a poor choice because of it's weakness. CBC cipher mode is the default +# for the new Encryptor encrypt / decrypt methods for ESAPI Java 2.0. In general, you +# should only use this compatibility setting if you have persistent data encrypted with +# version 1.4 and even then, you should ONLY set this compatibility mode UNTIL +# you have decrypted all of your old encrypted data and then re-encrypted it with +# ESAPI 2.0 using CBC mode. If you have some reason to mix the deprecated 1.4 mode +# with the new 2.0 methods, make sure that you use the same cipher algorithm for both +# (256-bit AES was the default for 1.4; 128-bit is the default for 2.0; see below for +# more details.) Otherwise, you will have to use the new 2.0 encrypt / decrypt methods +# where you can specify a SecretKey. (Note that if you are using the 256-bit AES, +# that requires downloading the special jurisdiction policy files mentioned above.) +# +# ***** IMPORTANT: Do NOT forget to replace these with your own values! ***** +# To calculate these values, you can run: +# java -classpath esapi.jar org.owasp.esapi.reference.crypto.JavaEncryptor +# +Encryptor.MasterKey=tzfztf56ftv +Encryptor.MasterSalt=123456ztrewq + +# Provides the default JCE provider that ESAPI will "prefer" for its symmetric +# encryption and hashing. (That is it will look to this provider first, but it +# will defer to other providers if the requested algorithm is not implemented +# by this provider.) If left unset, ESAPI will just use your Java VM's current +# preferred JCE provider, which is generally set in the file +# "$JAVA_HOME/jre/lib/security/java.security". +# +# The main intent of this is to allow ESAPI symmetric encryption to be +# used with a FIPS 140-2 compliant crypto-module. For details, see the section +# "Using ESAPI Symmetric Encryption with FIPS 140-2 Cryptographic Modules" in +# the ESAPI 2.0 Symmetric Encryption User Guide, at: +# http://owasp-esapi-java.googlecode.com/svn/trunk/documentation/esapi4java-core-2.0-symmetric-crypto-user-guide.html +# However, this property also allows you to easily use an alternate JCE provider +# such as "Bouncy Castle" without having to make changes to "java.security". +# See Javadoc for SecurityProviderLoader for further details. If you wish to use +# a provider that is not known to SecurityProviderLoader, you may specify the +# fully-qualified class name of the JCE provider class that implements +# java.security.Provider. If the name contains a '.', this is interpreted as +# a fully-qualified class name that implements java.security.Provider. +# +# NOTE: Setting this property has the side-effect of changing it in your application +# as well, so if you are using JCE in your application directly rather than +# through ESAPI (you wouldn't do that, would you? ;-), it will change the +# preferred JCE provider there as well. +# +# Default: Keeps the JCE provider set to whatever JVM sets it to. +Encryptor.PreferredJCEProvider= + +# AES is the most widely used and strongest encryption algorithm. This +# should agree with your Encryptor.CipherTransformation property. +# By default, ESAPI Java 1.4 uses "PBEWithMD5AndDES" and which is +# very weak. It is essentially a password-based encryption key, hashed +# with MD5 around 1K times and then encrypted with the weak DES algorithm +# (56-bits) using ECB mode and an unspecified padding (it is +# JCE provider specific, but most likely "NoPadding"). However, 2.0 uses +# "AES/CBC/PKCSPadding". If you want to change these, change them here. +# Warning: This property does not control the default reference implementation for +# ESAPI 2.0 using JavaEncryptor. Also, this property will be dropped +# in the future. +# @deprecated +Encryptor.EncryptionAlgorithm=AES +# For ESAPI Java 2.0 - New encrypt / decrypt methods use this. +Encryptor.CipherTransformation=AES/CBC/PKCS5Padding + +# Applies to ESAPI 2.0 and later only! +# Comma-separated list of cipher modes that provide *BOTH* +# confidentiality *AND* message authenticity. (NIST refers to such cipher +# modes as "combined modes" so that's what we shall call them.) If any of these +# cipher modes are used then no MAC is calculated and stored +# in the CipherText upon encryption. Likewise, if one of these +# cipher modes is used with decryption, no attempt will be made +# to validate the MAC contained in the CipherText object regardless +# of whether it contains one or not. Since the expectation is that +# these cipher modes support support message authenticity already, +# injecting a MAC in the CipherText object would be at best redundant. +# +# Note that as of JDK 1.5, the SunJCE provider does not support *any* +# of these cipher modes. Of these listed, only GCM and CCM are currently +# NIST approved. YMMV for other JCE providers. E.g., Bouncy Castle supports +# GCM and CCM with "NoPadding" mode, but not with "PKCS5Padding" or other +# padding modes. +Encryptor.cipher_modes.combined_modes=GCM,CCM,IAPM,EAX,OCB,CWC + +# Applies to ESAPI 2.0 and later only! +# Additional cipher modes allowed for ESAPI 2.0 encryption. These +# cipher modes are in _addition_ to those specified by the property +# 'Encryptor.cipher_modes.combined_modes'. +# Note: We will add support for streaming modes like CFB & OFB once +# we add support for 'specified' to the property 'Encryptor.ChooseIVMethod' +# (probably in ESAPI 2.1). +# DISCUSS: Better name? +Encryptor.cipher_modes.additional_allowed=CBC + +# 128-bit is almost always sufficient and appears to be more resistant to +# related key attacks than is 256-bit AES. Use '_' to use default key size +# for cipher algorithms (where it makes sense because the algorithm supports +# a variable key size). Key length must agree to what's provided as the +# cipher transformation, otherwise this will be ignored after logging a +# warning. +# +# NOTE: This is what applies BOTH ESAPI 1.4 and 2.0. See warning above about mixing! +Encryptor.EncryptionKeyLength=128 + +# Because 2.0 uses CBC mode by default, it requires an initialization vector (IV). +# (All cipher modes except ECB require an IV.) There are two choices: we can either +# use a fixed IV known to both parties or allow ESAPI to choose a random IV. While +# the IV does not need to be hidden from adversaries, it is important that the +# adversary not be allowed to choose it. Also, random IVs are generally much more +# secure than fixed IVs. (In fact, it is essential that feed-back cipher modes +# such as CFB and OFB use a different IV for each encryption with a given key so +# in such cases, random IVs are much preferred. By default, ESAPI 2.0 uses random +# IVs. If you wish to use 'fixed' IVs, set 'Encryptor.ChooseIVMethod=fixed' and +# uncomment the Encryptor.fixedIV. +# +# Valid values: random|fixed|specified 'specified' not yet implemented; planned for 2.1 +Encryptor.ChooseIVMethod=random +# If you choose to use a fixed IV, then you must place a fixed IV here that +# is known to all others who are sharing your secret key. The format should +# be a hex string that is the same length as the cipher block size for the +# cipher algorithm that you are using. The following is an *example* for AES +# from an AES test vector for AES-128/CBC as described in: +# NIST Special Publication 800-38A (2001 Edition) +# "Recommendation for Block Cipher Modes of Operation". +# (Note that the block size for AES is 16 bytes == 128 bits.) +# +Encryptor.fixedIV=0x000102030405060708090a0b0c0d0e0f + +# Whether or not CipherText should use a message authentication code (MAC) with it. +# This prevents an adversary from altering the IV as well as allowing a more +# fool-proof way of determining the decryption failed because of an incorrect +# key being supplied. This refers to the "separate" MAC calculated and stored +# in CipherText, not part of any MAC that is calculated as a result of a +# "combined mode" cipher mode. +# +# If you are using ESAPI with a FIPS 140-2 cryptographic module, you *must* also +# set this property to false. +Encryptor.CipherText.useMAC=true + +# Whether or not the PlainText object may be overwritten and then marked +# eligible for garbage collection. If not set, this is still treated as 'true'. +Encryptor.PlainText.overwrite=true + +# Do not use DES except in a legacy situations. 56-bit is way too small key size. +#Encryptor.EncryptionKeyLength=56 +#Encryptor.EncryptionAlgorithm=DES + +# TripleDES is considered strong enough for most purposes. +# Note: There is also a 112-bit version of DESede. Using the 168-bit version +# requires downloading the special jurisdiction policy from Sun. +#Encryptor.EncryptionKeyLength=168 +#Encryptor.EncryptionAlgorithm=DESede + +Encryptor.HashAlgorithm=SHA-512 +Encryptor.HashIterations=1024 +Encryptor.DigitalSignatureAlgorithm=SHA1withDSA +Encryptor.DigitalSignatureKeyLength=1024 +Encryptor.RandomAlgorithm=SHA1PRNG +Encryptor.CharacterEncoding=UTF-8 + +# This is the Pseudo Random Function (PRF) that ESAPI's Key Derivation Function +# (KDF) normally uses. Note this is *only* the PRF used for ESAPI's KDF and +# *not* what is used for ESAPI's MAC. (Currently, HmacSHA1 is always used for +# the MAC, mostly to keep the overall size at a minimum.) +# +# Currently supported choices for JDK 1.5 and 1.6 are: +# HmacSHA1 (160 bits), HmacSHA256 (256 bits), HmacSHA384 (384 bits), and +# HmacSHA512 (512 bits). +# Note that HmacMD5 is *not* supported for the PRF used by the KDF even though +# the JDKs support it. See the ESAPI 2.0 Symmetric Encryption User Guide +# further details. +Encryptor.KDF.PRF=HmacSHA256 +#=========================================================================== +# ESAPI HttpUtilties +# +# The HttpUtilities provide basic protections to HTTP requests and responses. Primarily these methods +# protect against malicious data from attackers, such as unprintable characters, escaped characters, +# and other simple attacks. The HttpUtilities also provides utility methods for dealing with cookies, +# headers, and CSRF tokens. +# +# Default file upload location (remember to escape backslashes with \\) +HttpUtilities.UploadDir=C:\\ESAPI\\testUpload +HttpUtilities.UploadTempDir=C:\\temp +# Force flags on cookies, if you use HttpUtilities to set cookies +HttpUtilities.ForceHttpOnlySession=false +HttpUtilities.ForceSecureSession=false +HttpUtilities.ForceHttpOnlyCookies=true +HttpUtilities.ForceSecureCookies=true +# Maximum size of HTTP headers +HttpUtilities.MaxHeaderSize=4096 +# File upload configuration +HttpUtilities.ApprovedUploadExtensions=.zip,.pdf,.doc,.docx,.ppt,.pptx,.tar,.gz,.tgz,.rar,.war,.jar,.ear,.xls,.rtf,.properties,.java,.class,.txt,.xml,.jsp,.jsf,.exe,.dll +HttpUtilities.MaxUploadFileBytes=500000000 +# Using UTF-8 throughout your stack is highly recommended. That includes your database driver, +# container, and any other technologies you may be using. Failure to do this may expose you +# to Unicode transcoding injection attacks. Use of UTF-8 does not hinder internationalization. +HttpUtilities.ResponseContentType=text/html; charset=UTF-8 +# This is the name of the cookie used to represent the HTTP session +# Typically this will be the default "JSESSIONID" +HttpUtilities.HttpSessionIdName=JSESSIONID + + + +#=========================================================================== +# ESAPI Executor +# CHECKME - Not sure what this is used for, but surely it should be made OS independent. +Executor.WorkingDirectory=C:\\Windows\\Temp +Executor.ApprovedExecutables=C:\\Windows\\System32\\cmd.exe,C:\\Windows\\System32\\runas.exe + + +#=========================================================================== +# ESAPI Logging +# Set the application name if these logs are combined with other applications +Logger.ApplicationName=hygieia-api-ace +# If you use an HTML log viewer that does not properly HTML escape log data, you can set LogEncodingRequired to true +Logger.LogEncodingRequired=false +# Determines whether ESAPI should log the application name. This might be clutter in some single-server/single-app environments. +Logger.LogApplicationName=true +# Determines whether ESAPI should log the server IP and port. This might be clutter in some single-server environments. +Logger.LogServerIP=true +# LogFileName, the name of the logging file. Provide a full directory path (e.g., C:\\ESAPI\\ESAPI_logging_file) if you +# want to place it in a specific directory. +Logger.LogFileName=ESAPI_logging_file +# MaxLogFileSize, the max size (in bytes) of a single log file before it cuts over to a new one (default is 10,000,000) +Logger.MaxLogFileSize=10000000 + + +#=========================================================================== +# ESAPI Intrusion Detection +# +# Each event has a base to which .count, .interval, and .action are added +# The IntrusionException will fire if we receive "count" events within "interval" seconds +# The IntrusionDetector is configurable to take the following actions: log, logout, and disable +# (multiple actions separated by commas are allowed e.g. event.test.actions=log,disable +# +# Custom Events +# Names must start with "event." as the base +# Use IntrusionDetector.addEvent( "test" ) in your code to trigger "event.test" here +# You can also disable intrusion detection completely by changing +# the following parameter to true +# +IntrusionDetector.Disable=false +# +IntrusionDetector.event.test.count=2 +IntrusionDetector.event.test.interval=10 +IntrusionDetector.event.test.actions=disable,log + +# Exception Events +# All EnterpriseSecurityExceptions are registered automatically +# Call IntrusionDetector.getInstance().addException(e) for Exceptions that do not extend EnterpriseSecurityException +# Use the fully qualified classname of the exception as the base + +# any intrusion is an attack +IntrusionDetector.org.owasp.esapi.errors.IntrusionException.count=1 +IntrusionDetector.org.owasp.esapi.errors.IntrusionException.interval=1 +IntrusionDetector.org.owasp.esapi.errors.IntrusionException.actions=log,disable,logout + +# for test purposes +# CHECKME: Shouldn't there be something in the property name itself that designates +# that these are for testing??? +IntrusionDetector.org.owasp.esapi.errors.IntegrityException.count=10 +IntrusionDetector.org.owasp.esapi.errors.IntegrityException.interval=5 +IntrusionDetector.org.owasp.esapi.errors.IntegrityException.actions=log,disable,logout + +# rapid validation errors indicate scans or attacks in progress +# org.owasp.esapi.errors.ValidationException.count=10 +# org.owasp.esapi.errors.ValidationException.interval=10 +# org.owasp.esapi.errors.ValidationException.actions=log,logout + +# sessions jumping between hosts indicates session hijacking +IntrusionDetector.org.owasp.esapi.errors.AuthenticationHostException.count=2 +IntrusionDetector.org.owasp.esapi.errors.AuthenticationHostException.interval=10 +IntrusionDetector.org.owasp.esapi.errors.AuthenticationHostException.actions=log,logout + + +#=========================================================================== +# ESAPI Validation +# +# The ESAPI Validator works on regular expressions with defined names. You can define names +# either here, or you may define application specific patterns in a separate file defined below. +# This allows enterprises to specify both organizational standards as well as application specific +# validation rules. +# +Validator.ConfigurationFile=validation.properties + +# Validators used by ESAPI +Validator.AccountName=^[a-zA-Z0-9]{3,20}$ +Validator.SystemCommand=^[a-zA-Z\\-\\/]{1,64}$ +Validator.RoleName=^[a-z]{1,20}$ + +#the word TEST below should be changed to your application +#name - only relative URL's are supported +Validator.Redirect=^\\/hygieia-api-ace.*$ + +# Global HTTP Validation Rules +# Values with Base64 encoded data (e.g. encrypted state) will need at least [a-zA-Z0-9\/+=] +Validator.HTTPScheme=^(http|https)$ +Validator.HTTPServerName=^[a-zA-Z0-9_.\\-]*$ +Validator.HTTPParameterName=^[a-zA-Z0-9_]{1,32}$ +Validator.HTTPParameterValue=^[a-zA-Z0-9.\\-\\/+=@_ ]*$ +Validator.HTTPCookieName=^[a-zA-Z0-9\\-_]{1,32}$ +Validator.HTTPCookieValue=^[a-zA-Z0-9\\-\\/+=_ ]*$ +Validator.HTTPHeaderName=^[a-zA-Z0-9\\-_]{1,32}$ +Validator.HTTPHeaderValue=^[a-zA-Z0-9()\\-=\\*\\.\\?;,+\\/:&_ ]*$ +Validator.HTTPContextPath=^\\/?[a-zA-Z0-9.\\-\\/_]*$ +Validator.HTTPServletPath=^[a-zA-Z0-9.\\-\\/_]*$ +Validator.HTTPPath=^[a-zA-Z0-9.\\-_]*$ +Validator.HTTPQueryString=^[a-zA-Z0-9()\\-=\\*\\.\\?;,+\\/:&_ %]*$ +Validator.HTTPURI=^[a-zA-Z0-9()\\-=\\*\\.\\?;,+\\/:&_ ]*$ +Validator.HTTPURL=^.*$ +Validator.HTTPJSESSIONID=^[A-Z0-9]{10,30}$ + +# Validation of file related input +Validator.FileName=^[a-zA-Z0-9!@#$%^&{}\\[\\]()_+\\-=,.~'` ]{1,255}$ +Validator.DirectoryName=^[a-zA-Z0-9:/\\\\!@#$%^&{}\\[\\]()_+\\-=,.~'` ]{1,255}$ + +# Validation of dates. Controls whether or not 'lenient' dates are accepted. +# See DataFormat.setLenient(boolean flag) for further details. +Validator.AcceptLenientDates=false +Logger.UserInfo=false +Logger.ClientInfo=false diff --git a/src/main/resources/.esapi/validation.properties b/src/main/resources/.esapi/validation.properties new file mode 100644 index 00000000..ae870a13 --- /dev/null +++ b/src/main/resources/.esapi/validation.properties @@ -0,0 +1,36 @@ +# OWASP Enterprise Security API (ESAPI) Properties file -- TEST Version +# The ESAPI validator does many security checks on input, such as canonicalization +# and whitelist validation. Note that all of these validation rules are applied *after* +# canonicalization. Double-encoded characters (even with different encodings involved, +# are never allowed. +# +# To use: +# +# First set up a pattern below. You can choose any name you want, prefixed by the word +# "Validation." For example: +# Validation.Email=^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\\.[a-zA-Z]{2,4}$ +# +# Then you can validate in your code against the pattern like this: +# ESAPI.validator().isValidInput("User Email", input, "Email", maxLength, allowNull); +# Where maxLength and allowNull are set for you needs, respectively. +# +# But note, when you use boolean variants of validation functions, you lose critical +# canonicalization. It is preferable to use the "get" methods (which throw exceptions) and +# and use the returned user input which is in canonical form. Consider the following: +# +# try { +# someObject.setEmail(ESAPI.validator().getValidInput("User Email", input, "Email", maxLength, allowNull)); +# +Validator.SafeString=^[.\\p{Alnum}\\p{Space}]{0,1024}$ +#Given the discussion: https://github.com/ESAPI/esapi-java-legacy/issues/374, a better upper-bound for domain name +#was selected as 62. This is slightly under the length in RFC-1035 +Validator.Email=^[A-Za-z0-9._%'-]+@[A-Za-z0-9.-]+\\.[a-zA-Z]{2,62}$ +Validator.Gmail=^[A-Za-z0-9._%'-+]+@[A-Za-z0-9.-]+\\.[a-zA-Z]{2,62}$ +Validator.IPAddress=^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$ +#Validator.URL=^(?:ht|f)tp(s?+)\\:\\/\\/[0-9a-zA-Z](?:[-.\\w]*[0-9a-zA-Z])*(?::(?:0-9)*)*(?:\\/?+)(?:[-a-zA-Z0-9\\.\\?\\,\\:\\'\\/\\\\\\+=&%\\$#_]*)?+$ +Validator.URL=^(?:ht|f)tp(?:s?)(?:[:A-Za-z0-9%/#?&.=-]*)$ +Validator.CreditCard=^(\\d{4}[- ]?){3}\\d{4}$ +Validator.SSN=^(?!000)([0-6]\\d{2}|7([0-6]\\d|7[012]))([ -]?)(?!00)\\d\\d\\3(?!0000)\\d{4}$ +#RegexString here is PURELY for regression testing purposes. NOT for production use. +Validator.RegexString=^[^<>]* +Validator.avaloqLooseSafeString=^[+>= - - - - %d [%thread] %-5level %logger{36} - %msg%n - - - - - - api/logs/devopsdashboard-api-%d{yyyy-MM-dd}.%i.log - - - 20MB - - 30 - - - %d [%thread] %-5level %logger{36} - %msg%n - - - - - - - - + + + + + %d [%thread] %-5level %logger{36} - %msg%n + + + + + + logs/api-%d{yyyy-MM-dd}.%i.log + + + 20MB + + 30 + + + %d [%thread] %-5level %logger{36} - %msg%n + + + + + + + + diff --git a/src/main/resources/static/swagger/css/print.css b/src/main/resources/static/swagger/css/print.css deleted file mode 100644 index d84b17aa..00000000 --- a/src/main/resources/static/swagger/css/print.css +++ /dev/null @@ -1,1498 +0,0 @@ -/* Original style from softwaremaniacs.org (c) Ivan Sagalaev */ -.swagger-section pre code { - display: block; - padding: 0.5em; - background: #F0F0F0; -} - -.swagger-section pre code, -.swagger-section pre .subst, -.swagger-section pre .tag .title, -.swagger-section pre .lisp .title, -.swagger-section pre .clojure .built_in, -.swagger-section pre .nginx .title { - color: black; -} - -.swagger-section pre .string, -.swagger-section pre .title, -.swagger-section pre .constant, -.swagger-section pre .parent, -.swagger-section pre .tag .value, -.swagger-section pre .rules .value, -.swagger-section pre .rules .value .number, -.swagger-section pre .preprocessor, -.swagger-section pre .ruby .symbol, -.swagger-section pre .ruby .symbol .string, -.swagger-section pre .aggregate, -.swagger-section pre .template_tag, -.swagger-section pre .django .variable, -.swagger-section pre .smalltalk .class, -.swagger-section pre .addition, -.swagger-section pre .flow, -.swagger-section pre .stream, -.swagger-section pre .bash .variable, -.swagger-section pre .apache .tag, -.swagger-section pre .apache .cbracket, -.swagger-section pre .tex .command, -.swagger-section pre .tex .special, -.swagger-section pre .erlang_repl .function_or_atom, -.swagger-section pre .markdown .header { - color: #800; -} - -.swagger-section pre .comment, -.swagger-section pre .annotation, -.swagger-section pre .template_comment, -.swagger-section pre .diff .header, -.swagger-section pre .chunk, -.swagger-section pre .markdown .blockquote { - color: #888; -} - -.swagger-section pre .number, -.swagger-section pre .date, -.swagger-section pre .regexp, -.swagger-section pre .literal, -.swagger-section pre .smalltalk .symbol, -.swagger-section pre .smalltalk .char, -.swagger-section pre .go .constant, -.swagger-section pre .change, -.swagger-section pre .markdown .bullet, -.swagger-section pre .markdown .link_url { - color: #080; -} - -.swagger-section pre .label, -.swagger-section pre .javadoc, -.swagger-section pre .ruby .string, -.swagger-section pre .decorator, -.swagger-section pre .filter .argument, -.swagger-section pre .localvars, -.swagger-section pre .array, -.swagger-section pre .attr_selector, -.swagger-section pre .important, -.swagger-section pre .pseudo, -.swagger-section pre .pi, -.swagger-section pre .doctype, -.swagger-section pre .deletion, -.swagger-section pre .envvar, -.swagger-section pre .shebang, -.swagger-section pre .apache .sqbracket, -.swagger-section pre .nginx .built_in, -.swagger-section pre .tex .formula, -.swagger-section pre .erlang_repl .reserved, -.swagger-section pre .prompt, -.swagger-section pre .markdown .link_label, -.swagger-section pre .vhdl .attribute, -.swagger-section pre .clojure .attribute, -.swagger-section pre .coffeescript .property { - color: #88F; -} - -.swagger-section pre .keyword, -.swagger-section pre .id, -.swagger-section pre .phpdoc, -.swagger-section pre .title, -.swagger-section pre .built_in, -.swagger-section pre .aggregate, -.swagger-section pre .css .tag, -.swagger-section pre .javadoctag, -.swagger-section pre .phpdoc, -.swagger-section pre .yardoctag, -.swagger-section pre .smalltalk .class, -.swagger-section pre .winutils, -.swagger-section pre .bash .variable, -.swagger-section pre .apache .tag, -.swagger-section pre .go .typename, -.swagger-section pre .tex .command, -.swagger-section pre .markdown .strong, -.swagger-section pre .request, -.swagger-section pre .status { - font-weight: bold; -} - -.swagger-section pre .markdown .emphasis { - font-style: italic; -} - -.swagger-section pre .nginx .built_in { - font-weight: normal; -} - -.swagger-section pre .coffeescript .javascript, -.swagger-section pre .javascript .xml, -.swagger-section pre .tex .formula, -.swagger-section pre .xml .javascript, -.swagger-section pre .xml .vbscript, -.swagger-section pre .xml .css, -.swagger-section pre .xml .cdata { - opacity: 0.5; -} - -.swagger-section .hljs { - display: block; - overflow-x: auto; - padding: 0.5em; - background: #F0F0F0; -} - -.swagger-section .hljs, -.swagger-section .hljs-subst { - color: #444; -} - -.swagger-section .hljs-keyword, -.swagger-section .hljs-attribute, -.swagger-section .hljs-selector-tag, -.swagger-section .hljs-meta-keyword, -.swagger-section .hljs-doctag, -.swagger-section .hljs-name { - font-weight: bold; -} - -.swagger-section .hljs-built_in, -.swagger-section .hljs-literal, -.swagger-section .hljs-bullet, -.swagger-section .hljs-code, -.swagger-section .hljs-addition { - color: #1F811F; -} - -.swagger-section .hljs-regexp, -.swagger-section .hljs-symbol, -.swagger-section .hljs-variable, -.swagger-section .hljs-template-variable, -.swagger-section .hljs-link, -.swagger-section .hljs-selector-attr, -.swagger-section .hljs-selector-pseudo { - color: #BC6060; -} - -.swagger-section .hljs-type, -.swagger-section .hljs-string, -.swagger-section .hljs-number, -.swagger-section .hljs-selector-id, -.swagger-section .hljs-selector-class, -.swagger-section .hljs-quote, -.swagger-section .hljs-template-tag, -.swagger-section .hljs-deletion { - color: #880000; -} - -.swagger-section .hljs-title, -.swagger-section .hljs-section { - color: #880000; - font-weight: bold; -} - -.swagger-section .hljs-comment { - color: #888888; -} - -.swagger-section .hljs-meta { - color: #2B6EA1; -} - -.swagger-section .hljs-emphasis { - font-style: italic; -} - -.swagger-section .hljs-strong { - font-weight: bold; -} - -.swagger-section .swagger-ui-wrap { - line-height: 1; - font-family: "Droid Sans", sans-serif; - max-width: 960px; - margin-left: auto; - margin-right: auto; - /* JSONEditor specific styling */ -} - -.swagger-section .swagger-ui-wrap b, -.swagger-section .swagger-ui-wrap strong { - font-family: "Droid Sans", sans-serif; - font-weight: bold; -} - -.swagger-section .swagger-ui-wrap q, -.swagger-section .swagger-ui-wrap blockquote { - quotes: none; -} - -.swagger-section .swagger-ui-wrap p { - line-height: 1.4em; - padding: 0 0 10px; - color: #333333; -} - -.swagger-section .swagger-ui-wrap q:before, -.swagger-section .swagger-ui-wrap q:after, -.swagger-section .swagger-ui-wrap blockquote:before, -.swagger-section .swagger-ui-wrap blockquote:after { - content: none; -} - -.swagger-section .swagger-ui-wrap .heading_with_menu h1, -.swagger-section .swagger-ui-wrap .heading_with_menu h2, -.swagger-section .swagger-ui-wrap .heading_with_menu h3, -.swagger-section .swagger-ui-wrap .heading_with_menu h4, -.swagger-section .swagger-ui-wrap .heading_with_menu h5, -.swagger-section .swagger-ui-wrap .heading_with_menu h6 { - display: block; - clear: none; - float: left; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - -ms-box-sizing: border-box; - box-sizing: border-box; - width: 60%; -} - -.swagger-section .swagger-ui-wrap table { - border-collapse: collapse; - border-spacing: 0; -} - -.swagger-section .swagger-ui-wrap table thead tr th { - padding: 5px; - font-size: 0.9em; - color: #666666; - border-bottom: 1px solid #999999; -} - -.swagger-section .swagger-ui-wrap table tbody tr:last-child td { - border-bottom: none; -} - -.swagger-section .swagger-ui-wrap table tbody tr.offset { - background-color: #f0f0f0; -} - -.swagger-section .swagger-ui-wrap table tbody tr td { - padding: 6px; - font-size: 0.9em; - border-bottom: 1px solid #cccccc; - vertical-align: top; - line-height: 1.3em; -} - -.swagger-section .swagger-ui-wrap ol { - margin: 0px 0 10px; - padding: 0 0 0 18px; - list-style-type: decimal; -} - -.swagger-section .swagger-ui-wrap ol li { - padding: 5px 0px; - font-size: 0.9em; - color: #333333; -} - -.swagger-section .swagger-ui-wrap ol, -.swagger-section .swagger-ui-wrap ul { - list-style: none; -} - -.swagger-section .swagger-ui-wrap h1 a, -.swagger-section .swagger-ui-wrap h2 a, -.swagger-section .swagger-ui-wrap h3 a, -.swagger-section .swagger-ui-wrap h4 a, -.swagger-section .swagger-ui-wrap h5 a, -.swagger-section .swagger-ui-wrap h6 a { - text-decoration: none; -} - -.swagger-section .swagger-ui-wrap h1 a:hover, -.swagger-section .swagger-ui-wrap h2 a:hover, -.swagger-section .swagger-ui-wrap h3 a:hover, -.swagger-section .swagger-ui-wrap h4 a:hover, -.swagger-section .swagger-ui-wrap h5 a:hover, -.swagger-section .swagger-ui-wrap h6 a:hover { - text-decoration: underline; -} - -.swagger-section .swagger-ui-wrap h1 span.divider, -.swagger-section .swagger-ui-wrap h2 span.divider, -.swagger-section .swagger-ui-wrap h3 span.divider, -.swagger-section .swagger-ui-wrap h4 span.divider, -.swagger-section .swagger-ui-wrap h5 span.divider, -.swagger-section .swagger-ui-wrap h6 span.divider { - color: #aaaaaa; -} - -.swagger-section .swagger-ui-wrap a { - color: #547f00; -} - -.swagger-section .swagger-ui-wrap a img { - border: none; -} - -.swagger-section .swagger-ui-wrap article, -.swagger-section .swagger-ui-wrap aside, -.swagger-section .swagger-ui-wrap details, -.swagger-section .swagger-ui-wrap figcaption, -.swagger-section .swagger-ui-wrap figure, -.swagger-section .swagger-ui-wrap footer, -.swagger-section .swagger-ui-wrap header, -.swagger-section .swagger-ui-wrap hgroup, -.swagger-section .swagger-ui-wrap menu, -.swagger-section .swagger-ui-wrap nav, -.swagger-section .swagger-ui-wrap section, -.swagger-section .swagger-ui-wrap summary { - display: block; -} - -.swagger-section .swagger-ui-wrap pre { - font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; - background-color: #fcf6db; - border: 1px solid #e5e0c6; - padding: 10px; -} - -.swagger-section .swagger-ui-wrap pre code { - line-height: 1.6em; - background: none; -} - -.swagger-section .swagger-ui-wrap .content > .content-type > div > label { - clear: both; - display: block; - color: #0F6AB4; - font-size: 1.1em; - margin: 0; - padding: 15px 0 5px; -} - -.swagger-section .swagger-ui-wrap .content pre { - font-size: 12px; - margin-top: 5px; - padding: 5px; -} - -.swagger-section .swagger-ui-wrap .icon-btn { - cursor: pointer; -} - -.swagger-section .swagger-ui-wrap .info_title { - padding-bottom: 10px; - font-weight: bold; - font-size: 25px; -} - -.swagger-section .swagger-ui-wrap .footer { - margin-top: 20px; -} - -.swagger-section .swagger-ui-wrap p.big, -.swagger-section .swagger-ui-wrap div.big p { - font-size: 1em; - margin-bottom: 10px; -} - -.swagger-section .swagger-ui-wrap form.fullwidth ol li.string input, -.swagger-section .swagger-ui-wrap form.fullwidth ol li.url input, -.swagger-section .swagger-ui-wrap form.fullwidth ol li.text textarea, -.swagger-section .swagger-ui-wrap form.fullwidth ol li.numeric input { - width: 500px !important; -} - -.swagger-section .swagger-ui-wrap .info_license { - padding-bottom: 5px; -} - -.swagger-section .swagger-ui-wrap .info_tos { - padding-bottom: 5px; -} - -.swagger-section .swagger-ui-wrap .message-fail { - color: #cc0000; -} - -.swagger-section .swagger-ui-wrap .info_url { - padding-bottom: 5px; -} - -.swagger-section .swagger-ui-wrap .info_email { - padding-bottom: 5px; -} - -.swagger-section .swagger-ui-wrap .info_name { - padding-bottom: 5px; -} - -.swagger-section .swagger-ui-wrap .info_description { - padding-bottom: 10px; - font-size: 15px; -} - -.swagger-section .swagger-ui-wrap .markdown ol li, -.swagger-section .swagger-ui-wrap .markdown ul li { - padding: 3px 0px; - line-height: 1.4em; - color: #333333; -} - -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input, -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input, -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input { - display: block; - padding: 4px; - width: auto; - clear: both; -} - -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input.title, -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input.title, -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input.title { - font-size: 1.3em; -} - -.swagger-section .swagger-ui-wrap table.fullwidth { - width: 100%; -} - -.swagger-section .swagger-ui-wrap .model-signature { - font-family: "Droid Sans", sans-serif; - font-size: 1em; - line-height: 1.5em; -} - -.swagger-section .swagger-ui-wrap .model-signature .signature-nav a { - text-decoration: none; - color: #AAA; -} - -.swagger-section .swagger-ui-wrap .model-signature .signature-nav a:hover { - text-decoration: underline; - color: black; -} - -.swagger-section .swagger-ui-wrap .model-signature .signature-nav .selected { - color: black; - text-decoration: none; -} - -.swagger-section .swagger-ui-wrap .model-signature .propType { - color: #5555aa; -} - -.swagger-section .swagger-ui-wrap .model-signature pre:hover { - background-color: #ffffdd; -} - -.swagger-section .swagger-ui-wrap .model-signature pre { - font-size: .85em; - line-height: 1.2em; - overflow: auto; - max-height: 200px; - cursor: pointer; -} - -.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav { - display: block; - min-width: 230px; - margin: 0; - padding: 0; -} - -.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li:last-child { - padding-right: 0; - border-right: none; -} - -.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li { - float: left; - margin: 0 5px 5px 0; - padding: 2px 5px 2px 0; - border-right: 1px solid #ddd; -} - -.swagger-section .swagger-ui-wrap .model-signature .propOpt { - color: #555; -} - -.swagger-section .swagger-ui-wrap .model-signature .snippet small { - font-size: 0.75em; -} - -.swagger-section .swagger-ui-wrap .model-signature .propOptKey { - font-style: italic; -} - -.swagger-section .swagger-ui-wrap .model-signature .description .strong { - font-weight: bold; - color: #000; - font-size: .9em; -} - -.swagger-section .swagger-ui-wrap .model-signature .description div { - font-size: 0.9em; - line-height: 1.5em; - margin-left: 1em; -} - -.swagger-section .swagger-ui-wrap .model-signature .description .stronger { - font-weight: bold; - color: #000; -} - -.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper { - border-spacing: 0; - position: absolute; - background-color: #ffffff; - border: 1px solid #bbbbbb; - display: none; - font-size: 11px; - max-width: 400px; - line-height: 30px; - color: black; - padding: 5px; - margin-left: 10px; -} - -.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper th { - text-align: center; - background-color: #eeeeee; - border: 1px solid #bbbbbb; - font-size: 11px; - color: #666666; - font-weight: bold; - padding: 5px; - line-height: 15px; -} - -.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper .optionName { - font-weight: bold; -} - -.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:first-child, -.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:last-child { - display: inline; -} - -.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:not(:first-child):before { - display: block; - content: ''; -} - -.swagger-section .swagger-ui-wrap .model-signature .description span:last-of-type.propDesc.markdown > p:only-child { - margin-right: -3px; -} - -.swagger-section .swagger-ui-wrap .model-signature .propName { - font-weight: bold; -} - -.swagger-section .swagger-ui-wrap .model-signature .signature-container { - clear: both; -} - -.swagger-section .swagger-ui-wrap .body-textarea { - width: 300px; - height: 100px; - border: 1px solid #aaa; -} - -.swagger-section .swagger-ui-wrap .markdown p code, -.swagger-section .swagger-ui-wrap .markdown li code { - font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; - background-color: #f0f0f0; - color: black; - padding: 1px 3px; -} - -.swagger-section .swagger-ui-wrap .required { - font-weight: bold; -} - -.swagger-section .swagger-ui-wrap .editor_holder { - font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; - font-size: 0.9em; -} - -.swagger-section .swagger-ui-wrap .editor_holder label { - font-weight: normal !important; - /* JSONEditor uses bold by default for all labels, we revert that back to normal to not give the impression that by default fields are required */ -} - -.swagger-section .swagger-ui-wrap .editor_holder label.required { - font-weight: bold !important; -} - -.swagger-section .swagger-ui-wrap input.parameter { - width: 300px; - border: 1px solid #aaa; -} - -.swagger-section .swagger-ui-wrap h1 { - color: black; - font-size: 1.5em; - line-height: 1.3em; - padding: 10px 0 10px 0; - font-family: "Droid Sans", sans-serif; - font-weight: bold; -} - -.swagger-section .swagger-ui-wrap .heading_with_menu { - float: none; - clear: both; - overflow: hidden; - display: block; -} - -.swagger-section .swagger-ui-wrap .heading_with_menu ul { - display: block; - clear: none; - float: right; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - -ms-box-sizing: border-box; - box-sizing: border-box; - margin-top: 10px; -} - -.swagger-section .swagger-ui-wrap h2 { - color: black; - font-size: 1.3em; - padding: 10px 0 10px 0; -} - -.swagger-section .swagger-ui-wrap h2 a { - color: black; -} - -.swagger-section .swagger-ui-wrap h2 span.sub { - font-size: 0.7em; - color: #999999; - font-style: italic; -} - -.swagger-section .swagger-ui-wrap h2 span.sub a { - color: #777777; -} - -.swagger-section .swagger-ui-wrap span.weak { - color: #666666; -} - -.swagger-section .swagger-ui-wrap .message-success { - color: #89BF04; -} - -.swagger-section .swagger-ui-wrap caption, -.swagger-section .swagger-ui-wrap th, -.swagger-section .swagger-ui-wrap td { - text-align: left; - font-weight: normal; - vertical-align: middle; -} - -.swagger-section .swagger-ui-wrap .code { - font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; -} - -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.text textarea { - font-family: "Droid Sans", sans-serif; - height: 250px; - padding: 4px; - display: block; - clear: both; -} - -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.select select { - display: block; - clear: both; -} - -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean { - float: none; - clear: both; - overflow: hidden; - display: block; -} - -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean label { - display: block; - float: left; - clear: none; - margin: 0; - padding: 0; -} - -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean input { - display: block; - float: left; - clear: none; - margin: 0 5px 0 0; -} - -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.required label { - color: black; -} - -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label { - display: block; - clear: both; - width: auto; - padding: 0 0 3px; - color: #666666; -} - -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label abbr { - padding-left: 3px; - color: #888888; -} - -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li p.inline-hints { - margin-left: 0; - font-style: italic; - font-size: 0.9em; - margin: 0; -} - -.swagger-section .swagger-ui-wrap form.formtastic fieldset.buttons { - margin: 0; - padding: 0; -} - -.swagger-section .swagger-ui-wrap span.blank, -.swagger-section .swagger-ui-wrap span.empty { - color: #888888; - font-style: italic; -} - -.swagger-section .swagger-ui-wrap .markdown h3 { - color: #547f00; -} - -.swagger-section .swagger-ui-wrap .markdown h4 { - color: #666666; -} - -.swagger-section .swagger-ui-wrap .markdown pre { - font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; - background-color: #fcf6db; - border: 1px solid #e5e0c6; - padding: 10px; - margin: 0 0 10px 0; -} - -.swagger-section .swagger-ui-wrap .markdown pre code { - line-height: 1.6em; -} - -.swagger-section .swagger-ui-wrap div.gist { - margin: 20px 0 25px 0 !important; -} - -.swagger-section .swagger-ui-wrap ul#resources { - font-family: "Droid Sans", sans-serif; - font-size: 0.9em; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource { - border-bottom: 1px solid #dddddd; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading h2 a, -.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading h2 a { - color: black; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading ul.options li a, -.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading ul.options li a { - color: #555555; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource:last-child { - border-bottom: none; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading { - border: 1px solid transparent; - float: none; - clear: both; - overflow: hidden; - display: block; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options { - overflow: hidden; - padding: 0; - display: block; - clear: none; - float: right; - margin: 14px 10px 0 0; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li { - float: left; - clear: none; - margin: 0; - padding: 2px 10px; - border-right: 1px solid #dddddd; - color: #666666; - font-size: 0.9em; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a { - color: #aaaaaa; - text-decoration: none; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover { - text-decoration: underline; - color: black; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover, -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:active, -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a.active { - text-decoration: underline; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:first-child, -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.first { - padding-left: 0; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:last-child, -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.last { - padding-right: 0; - border-right: none; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options:first-child, -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options.first { - padding-left: 0; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 { - color: #999999; - padding-left: 0; - display: block; - clear: none; - float: left; - font-family: "Droid Sans", sans-serif; - font-weight: bold; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a { - color: #999999; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a:hover { - color: black; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation { - float: none; - clear: both; - overflow: hidden; - display: block; - margin: 0 0 10px; - padding: 0; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading { - float: none; - clear: both; - overflow: hidden; - display: block; - margin: 0; - padding: 0; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 { - display: block; - clear: none; - float: left; - width: auto; - margin: 0; - padding: 0; - line-height: 1.1em; - color: black; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path { - padding-left: 10px; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a { - color: black; - text-decoration: none; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a.toggleOperation.deprecated { - text-decoration: line-through; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a:hover { - text-decoration: underline; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.http_method a { - text-transform: uppercase; - text-decoration: none; - color: white; - display: inline-block; - width: 50px; - font-size: 0.7em; - text-align: center; - padding: 7px 0 4px; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - -o-border-radius: 2px; - -ms-border-radius: 2px; - -khtml-border-radius: 2px; - border-radius: 2px; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span { - margin: 0; - padding: 0; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options { - overflow: hidden; - padding: 0; - display: block; - clear: none; - float: right; - margin: 6px 10px 0 0; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li { - float: left; - clear: none; - margin: 0; - padding: 2px 10px; - font-size: 0.9em; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li a { - text-decoration: none; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li.access { - color: black; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content { - border-top: none; - padding: 10px; - -moz-border-radius-bottomleft: 6px; - -webkit-border-bottom-left-radius: 6px; - -o-border-bottom-left-radius: 6px; - -ms-border-bottom-left-radius: 6px; - -khtml-border-bottom-left-radius: 6px; - border-bottom-left-radius: 6px; - -moz-border-radius-bottomright: 6px; - -webkit-border-bottom-right-radius: 6px; - -o-border-bottom-right-radius: 6px; - -ms-border-bottom-right-radius: 6px; - -khtml-border-bottom-right-radius: 6px; - border-bottom-right-radius: 6px; - margin: 0 0 20px; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content h4 { - font-size: 1.1em; - margin: 0; - padding: 15px 0 5px; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header { - float: none; - clear: both; - overflow: hidden; - display: block; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header a { - padding: 4px 0 0 10px; - display: inline-block; - font-size: 0.9em; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header input.submit { - display: block; - clear: none; - float: left; - padding: 6px 8px; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header span.response_throbber { - background-image: url('../images/throbber.gif'); - width: 128px; - height: 16px; - display: block; - clear: none; - float: right; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form input[type='text'].error { - outline: 2px solid black; - outline-color: #cc0000; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form select[name='parameterContentType'] { - max-width: 300px; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.response div.block pre { - font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; - padding: 10px; - font-size: 0.9em; - max-height: 400px; - overflow-y: auto; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading { - background-color: #f9f2e9; - border: 1px solid #f0e0ca; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading h3 span.http_method a { - background-color: #c5862b; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li { - border-right: 1px solid #dddddd; - border-right-color: #f0e0ca; - color: #c5862b; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li a { - color: #c5862b; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content { - background-color: #faf5ee; - border: 1px solid #f0e0ca; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content h4 { - color: #c5862b; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content div.sandbox_header a { - color: #dcb67f; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading { - background-color: #fcffcd; - border: 1px solid black; - border-color: #ffd20f; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading h3 span.http_method a { - text-transform: uppercase; - background-color: #ffd20f; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li { - border-right: 1px solid #dddddd; - border-right-color: #ffd20f; - color: #ffd20f; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li a { - color: #ffd20f; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content { - background-color: #fcffcd; - border: 1px solid black; - border-color: #ffd20f; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content h4 { - color: #ffd20f; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content div.sandbox_header a { - color: #6fc992; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading { - background-color: #f5e8e8; - border: 1px solid #e8c6c7; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading h3 span.http_method a { - text-transform: uppercase; - background-color: #a41e22; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li { - border-right: 1px solid #dddddd; - border-right-color: #e8c6c7; - color: #a41e22; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li a { - color: #a41e22; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content { - background-color: #f7eded; - border: 1px solid #e8c6c7; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content h4 { - color: #a41e22; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content div.sandbox_header a { - color: #c8787a; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading { - background-color: #e7f6ec; - border: 1px solid #c3e8d1; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading h3 span.http_method a { - background-color: #10a54a; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li { - border-right: 1px solid #dddddd; - border-right-color: #c3e8d1; - color: #10a54a; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li a { - color: #10a54a; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content { - background-color: #ebf7f0; - border: 1px solid #c3e8d1; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content h4 { - color: #10a54a; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content div.sandbox_header a { - color: #6fc992; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading { - background-color: #FCE9E3; - border: 1px solid #F5D5C3; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading h3 span.http_method a { - background-color: #D38042; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li { - border-right: 1px solid #dddddd; - border-right-color: #f0cecb; - color: #D38042; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li a { - color: #D38042; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content { - background-color: #faf0ef; - border: 1px solid #f0cecb; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content h4 { - color: #D38042; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content div.sandbox_header a { - color: #dcb67f; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading { - background-color: #e7f0f7; - border: 1px solid #c3d9ec; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading h3 span.http_method a { - background-color: #0f6ab4; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li { - border-right: 1px solid #dddddd; - border-right-color: #c3d9ec; - color: #0f6ab4; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li a { - color: #0f6ab4; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content { - background-color: #ebf3f9; - border: 1px solid #c3d9ec; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content h4 { - color: #0f6ab4; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.sandbox_header a { - color: #6fa5d2; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading { - background-color: #e7f0f7; - border: 1px solid #c3d9ec; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading h3 span.http_method a { - background-color: #0f6ab4; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li { - border-right: 1px solid #dddddd; - border-right-color: #c3d9ec; - color: #0f6ab4; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li a { - color: #0f6ab4; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content { - background-color: #ebf3f9; - border: 1px solid #c3d9ec; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content h4 { - color: #0f6ab4; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content div.sandbox_header a { - color: #6fa5d2; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content { - border-top: none; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li:last-child, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li:last-child, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li:last-child, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li:last-child, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li:last-child, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li:last-child, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li.last, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li.last, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li.last, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li.last, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li.last, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li.last { - padding-right: 0; - border-right: none; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:hover, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:active, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a.active { - text-decoration: underline; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li:first-child, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li.first { - padding-left: 0; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations:first-child, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations.first { - padding-left: 0; -} - -.swagger-section .swagger-ui-wrap p#colophon { - margin: 0 15px 40px 15px; - padding: 10px 0; - font-size: 0.8em; - border-top: 1px solid #dddddd; - font-family: "Droid Sans", sans-serif; - color: #999999; - font-style: italic; -} - -.swagger-section .swagger-ui-wrap p#colophon a { - text-decoration: none; - color: #547f00; -} - -.swagger-section .swagger-ui-wrap h3 { - color: black; - font-size: 1.1em; - padding: 10px 0 10px 0; -} - -.swagger-section .swagger-ui-wrap .markdown ol, -.swagger-section .swagger-ui-wrap .markdown ul { - font-family: "Droid Sans", sans-serif; - margin: 5px 0 10px; - padding: 0 0 0 18px; - list-style-type: disc; -} - -.swagger-section .swagger-ui-wrap form.form_box { - background-color: #ebf3f9; - border: 1px solid #c3d9ec; - padding: 10px; -} - -.swagger-section .swagger-ui-wrap form.form_box label { - color: #0f6ab4 !important; -} - -.swagger-section .swagger-ui-wrap form.form_box input[type=submit] { - display: block; - padding: 10px; -} - -.swagger-section .swagger-ui-wrap form.form_box p.weak { - font-size: 0.8em; -} - -.swagger-section .swagger-ui-wrap form.form_box p { - font-size: 0.9em; - padding: 0 0 15px; - color: #7e7b6d; -} - -.swagger-section .swagger-ui-wrap form.form_box p a { - color: #646257; -} - -.swagger-section .swagger-ui-wrap form.form_box p strong { - color: black; -} - -.swagger-section .swagger-ui-wrap .operation-status td.markdown > p:last-child { - padding-bottom: 0; -} - -.swagger-section .title { - font-style: bold; -} - -.swagger-section .secondary_form { - display: none; -} - -.swagger-section .main_image { - display: block; - margin-left: auto; - margin-right: auto; -} - -.swagger-section .oauth_body { - margin-left: 100px; - margin-right: 100px; -} - -.swagger-section .oauth_submit { - text-align: center; -} - -.swagger-section .api-popup-dialog { - z-index: 10000; - position: absolute; - width: 500px; - background: #FFF; - padding: 20px; - border: 1px solid #ccc; - border-radius: 5px; - display: none; - font-size: 13px; - color: #777; -} - -.swagger-section .api-popup-dialog .api-popup-title { - font-size: 24px; - padding: 10px 0; -} - -.swagger-section .api-popup-dialog .api-popup-title { - font-size: 24px; - padding: 10px 0; -} - -.swagger-section .api-popup-dialog .error-msg { - padding-left: 5px; - padding-bottom: 5px; -} - -.swagger-section .api-popup-dialog .api-popup-authbtn { - height: 30px; -} - -.swagger-section .api-popup-dialog .api-popup-cancel { - height: 30px; -} - -.swagger-section .api-popup-scopes { - padding: 10px 20px; -} - -.swagger-section .api-popup-scopes li { - padding: 5px 0; - line-height: 20px; -} - -.swagger-section .api-popup-scopes li input { - position: relative; - top: 2px; -} - -.swagger-section .api-popup-scopes .api-scope-desc { - padding-left: 20px; - font-style: italic; -} - -.swagger-section .api-popup-actions { - padding-top: 10px; -} - -#header { - display: none; -} - -.swagger-section .swagger-ui-wrap .model-signature pre { - max-height: none; -} - -.swagger-section .swagger-ui-wrap .body-textarea { - width: 100px; -} - -.swagger-section .swagger-ui-wrap input.parameter { - width: 100px; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options { - display: none; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints { - display: block !important; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content { - display: block !important; -} diff --git a/src/main/resources/static/swagger/css/reset.css b/src/main/resources/static/swagger/css/reset.css deleted file mode 100644 index 8b259cad..00000000 --- a/src/main/resources/static/swagger/css/reset.css +++ /dev/null @@ -1,131 +0,0 @@ -/* http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126 */ -html, -body, -div, -span, -applet, -object, -iframe, -h1, -h2, -h3, -h4, -h5, -h6, -p, -blockquote, -pre, -a, -abbr, -acronym, -address, -big, -cite, -code, -del, -dfn, -em, -img, -ins, -kbd, -q, -s, -samp, -small, -strike, -strong, -sub, -sup, -tt, -var, -b, -u, -i, -center, -dl, -dt, -dd, -ol, -ul, -li, -fieldset, -form, -label, -legend, -table, -caption, -tbody, -tfoot, -thead, -tr, -th, -td, -article, -aside, -canvas, -details, -embed, -figure, -figcaption, -footer, -header, -hgroup, -menu, -nav, -output, -ruby, -section, -summary, -time, -mark, -audio, -video { - margin: 0; - padding: 0; - border: 0; - font-size: 100%; - font: inherit; - vertical-align: baseline; -} - -/* HTML5 display-role reset for older browsers */ -article, -aside, -details, -figcaption, -figure, -footer, -header, -hgroup, -menu, -nav, -section { - display: block; -} - -body { - line-height: 1; -} - -ol, -ul { - list-style: none; -} - -blockquote, -q { - quotes: none; -} - -blockquote:before, -blockquote:after, -q:before, -q:after { - content: ''; - content: none; -} - -table { - border-collapse: collapse; - border-spacing: 0; -} diff --git a/src/main/resources/static/swagger/css/screen.css b/src/main/resources/static/swagger/css/screen.css deleted file mode 100644 index 788121f6..00000000 --- a/src/main/resources/static/swagger/css/screen.css +++ /dev/null @@ -1,1629 +0,0 @@ -/* Original style from softwaremaniacs.org (c) Ivan Sagalaev */ -.swagger-section pre code { - display: block; - padding: 0.5em; - background: #F0F0F0; -} - -.swagger-section pre code, -.swagger-section pre .subst, -.swagger-section pre .tag .title, -.swagger-section pre .lisp .title, -.swagger-section pre .clojure .built_in, -.swagger-section pre .nginx .title { - color: black; -} - -.swagger-section pre .string, -.swagger-section pre .title, -.swagger-section pre .constant, -.swagger-section pre .parent, -.swagger-section pre .tag .value, -.swagger-section pre .rules .value, -.swagger-section pre .rules .value .number, -.swagger-section pre .preprocessor, -.swagger-section pre .ruby .symbol, -.swagger-section pre .ruby .symbol .string, -.swagger-section pre .aggregate, -.swagger-section pre .template_tag, -.swagger-section pre .django .variable, -.swagger-section pre .smalltalk .class, -.swagger-section pre .addition, -.swagger-section pre .flow, -.swagger-section pre .stream, -.swagger-section pre .bash .variable, -.swagger-section pre .apache .tag, -.swagger-section pre .apache .cbracket, -.swagger-section pre .tex .command, -.swagger-section pre .tex .special, -.swagger-section pre .erlang_repl .function_or_atom, -.swagger-section pre .markdown .header { - color: #800; -} - -.swagger-section pre .comment, -.swagger-section pre .annotation, -.swagger-section pre .template_comment, -.swagger-section pre .diff .header, -.swagger-section pre .chunk, -.swagger-section pre .markdown .blockquote { - color: #888; -} - -.swagger-section pre .number, -.swagger-section pre .date, -.swagger-section pre .regexp, -.swagger-section pre .literal, -.swagger-section pre .smalltalk .symbol, -.swagger-section pre .smalltalk .char, -.swagger-section pre .go .constant, -.swagger-section pre .change, -.swagger-section pre .markdown .bullet, -.swagger-section pre .markdown .link_url { - color: #080; -} - -.swagger-section pre .label, -.swagger-section pre .javadoc, -.swagger-section pre .ruby .string, -.swagger-section pre .decorator, -.swagger-section pre .filter .argument, -.swagger-section pre .localvars, -.swagger-section pre .array, -.swagger-section pre .attr_selector, -.swagger-section pre .important, -.swagger-section pre .pseudo, -.swagger-section pre .pi, -.swagger-section pre .doctype, -.swagger-section pre .deletion, -.swagger-section pre .envvar, -.swagger-section pre .shebang, -.swagger-section pre .apache .sqbracket, -.swagger-section pre .nginx .built_in, -.swagger-section pre .tex .formula, -.swagger-section pre .erlang_repl .reserved, -.swagger-section pre .prompt, -.swagger-section pre .markdown .link_label, -.swagger-section pre .vhdl .attribute, -.swagger-section pre .clojure .attribute, -.swagger-section pre .coffeescript .property { - color: #88F; -} - -.swagger-section pre .keyword, -.swagger-section pre .id, -.swagger-section pre .phpdoc, -.swagger-section pre .title, -.swagger-section pre .built_in, -.swagger-section pre .aggregate, -.swagger-section pre .css .tag, -.swagger-section pre .javadoctag, -.swagger-section pre .phpdoc, -.swagger-section pre .yardoctag, -.swagger-section pre .smalltalk .class, -.swagger-section pre .winutils, -.swagger-section pre .bash .variable, -.swagger-section pre .apache .tag, -.swagger-section pre .go .typename, -.swagger-section pre .tex .command, -.swagger-section pre .markdown .strong, -.swagger-section pre .request, -.swagger-section pre .status { - font-weight: bold; -} - -.swagger-section pre .markdown .emphasis { - font-style: italic; -} - -.swagger-section pre .nginx .built_in { - font-weight: normal; -} - -.swagger-section pre .coffeescript .javascript, -.swagger-section pre .javascript .xml, -.swagger-section pre .tex .formula, -.swagger-section pre .xml .javascript, -.swagger-section pre .xml .vbscript, -.swagger-section pre .xml .css, -.swagger-section pre .xml .cdata { - opacity: 0.5; -} - -.swagger-section .hljs { - display: block; - overflow-x: auto; - padding: 0.5em; - background: #F0F0F0; -} - -.swagger-section .hljs, -.swagger-section .hljs-subst { - color: #444; -} - -.swagger-section .hljs-keyword, -.swagger-section .hljs-attribute, -.swagger-section .hljs-selector-tag, -.swagger-section .hljs-meta-keyword, -.swagger-section .hljs-doctag, -.swagger-section .hljs-name { - font-weight: bold; -} - -.swagger-section .hljs-built_in, -.swagger-section .hljs-literal, -.swagger-section .hljs-bullet, -.swagger-section .hljs-code, -.swagger-section .hljs-addition { - color: #1F811F; -} - -.swagger-section .hljs-regexp, -.swagger-section .hljs-symbol, -.swagger-section .hljs-variable, -.swagger-section .hljs-template-variable, -.swagger-section .hljs-link, -.swagger-section .hljs-selector-attr, -.swagger-section .hljs-selector-pseudo { - color: #BC6060; -} - -.swagger-section .hljs-type, -.swagger-section .hljs-string, -.swagger-section .hljs-number, -.swagger-section .hljs-selector-id, -.swagger-section .hljs-selector-class, -.swagger-section .hljs-quote, -.swagger-section .hljs-template-tag, -.swagger-section .hljs-deletion { - color: #880000; -} - -.swagger-section .hljs-title, -.swagger-section .hljs-section { - color: #880000; - font-weight: bold; -} - -.swagger-section .hljs-comment { - color: #888888; -} - -.swagger-section .hljs-meta { - color: #2B6EA1; -} - -.swagger-section .hljs-emphasis { - font-style: italic; -} - -.swagger-section .hljs-strong { - font-weight: bold; -} - -.swagger-section .swagger-ui-wrap { - line-height: 1; - font-family: "Droid Sans", sans-serif; - max-width: 960px; - margin-left: auto; - margin-right: auto; - /* JSONEditor specific styling */ -} - -.swagger-section .swagger-ui-wrap b, -.swagger-section .swagger-ui-wrap strong { - font-family: "Droid Sans", sans-serif; - font-weight: bold; -} - -.swagger-section .swagger-ui-wrap q, -.swagger-section .swagger-ui-wrap blockquote { - quotes: none; -} - -.swagger-section .swagger-ui-wrap p { - line-height: 1.4em; - padding: 0 0 10px; - color: #333333; -} - -.swagger-section .swagger-ui-wrap q:before, -.swagger-section .swagger-ui-wrap q:after, -.swagger-section .swagger-ui-wrap blockquote:before, -.swagger-section .swagger-ui-wrap blockquote:after { - content: none; -} - -.swagger-section .swagger-ui-wrap .heading_with_menu h1, -.swagger-section .swagger-ui-wrap .heading_with_menu h2, -.swagger-section .swagger-ui-wrap .heading_with_menu h3, -.swagger-section .swagger-ui-wrap .heading_with_menu h4, -.swagger-section .swagger-ui-wrap .heading_with_menu h5, -.swagger-section .swagger-ui-wrap .heading_with_menu h6 { - display: block; - clear: none; - float: left; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - -ms-box-sizing: border-box; - box-sizing: border-box; - width: 60%; -} - -.swagger-section .swagger-ui-wrap table { - border-collapse: collapse; - border-spacing: 0; -} - -.swagger-section .swagger-ui-wrap table thead tr th { - padding: 5px; - font-size: 0.9em; - color: #666666; - border-bottom: 1px solid #999999; -} - -.swagger-section .swagger-ui-wrap table tbody tr:last-child td { - border-bottom: none; -} - -.swagger-section .swagger-ui-wrap table tbody tr.offset { - background-color: #f0f0f0; -} - -.swagger-section .swagger-ui-wrap table tbody tr td { - padding: 6px; - font-size: 0.9em; - border-bottom: 1px solid #cccccc; - vertical-align: top; - line-height: 1.3em; -} - -.swagger-section .swagger-ui-wrap ol { - margin: 0px 0 10px; - padding: 0 0 0 18px; - list-style-type: decimal; -} - -.swagger-section .swagger-ui-wrap ol li { - padding: 5px 0px; - font-size: 0.9em; - color: #333333; -} - -.swagger-section .swagger-ui-wrap ol, -.swagger-section .swagger-ui-wrap ul { - list-style: none; -} - -.swagger-section .swagger-ui-wrap h1 a, -.swagger-section .swagger-ui-wrap h2 a, -.swagger-section .swagger-ui-wrap h3 a, -.swagger-section .swagger-ui-wrap h4 a, -.swagger-section .swagger-ui-wrap h5 a, -.swagger-section .swagger-ui-wrap h6 a { - text-decoration: none; -} - -.swagger-section .swagger-ui-wrap h1 a:hover, -.swagger-section .swagger-ui-wrap h2 a:hover, -.swagger-section .swagger-ui-wrap h3 a:hover, -.swagger-section .swagger-ui-wrap h4 a:hover, -.swagger-section .swagger-ui-wrap h5 a:hover, -.swagger-section .swagger-ui-wrap h6 a:hover { - text-decoration: underline; -} - -.swagger-section .swagger-ui-wrap h1 span.divider, -.swagger-section .swagger-ui-wrap h2 span.divider, -.swagger-section .swagger-ui-wrap h3 span.divider, -.swagger-section .swagger-ui-wrap h4 span.divider, -.swagger-section .swagger-ui-wrap h5 span.divider, -.swagger-section .swagger-ui-wrap h6 span.divider { - color: #aaaaaa; -} - -.swagger-section .swagger-ui-wrap a { - color: #547f00; -} - -.swagger-section .swagger-ui-wrap a img { - border: none; -} - -.swagger-section .swagger-ui-wrap article, -.swagger-section .swagger-ui-wrap aside, -.swagger-section .swagger-ui-wrap details, -.swagger-section .swagger-ui-wrap figcaption, -.swagger-section .swagger-ui-wrap figure, -.swagger-section .swagger-ui-wrap footer, -.swagger-section .swagger-ui-wrap header, -.swagger-section .swagger-ui-wrap hgroup, -.swagger-section .swagger-ui-wrap menu, -.swagger-section .swagger-ui-wrap nav, -.swagger-section .swagger-ui-wrap section, -.swagger-section .swagger-ui-wrap summary { - display: block; -} - -.swagger-section .swagger-ui-wrap pre { - font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; - background-color: #fcf6db; - border: 1px solid #e5e0c6; - padding: 10px; -} - -.swagger-section .swagger-ui-wrap pre code { - line-height: 1.6em; - background: none; -} - -.swagger-section .swagger-ui-wrap .content > .content-type > div > label { - clear: both; - display: block; - color: #0F6AB4; - font-size: 1.1em; - margin: 0; - padding: 15px 0 5px; -} - -.swagger-section .swagger-ui-wrap .content pre { - font-size: 12px; - margin-top: 5px; - padding: 5px; -} - -.swagger-section .swagger-ui-wrap .icon-btn { - cursor: pointer; -} - -.swagger-section .swagger-ui-wrap .info_title { - padding-bottom: 10px; - font-weight: bold; - font-size: 25px; -} - -.swagger-section .swagger-ui-wrap .footer { - margin-top: 20px; -} - -.swagger-section .swagger-ui-wrap p.big, -.swagger-section .swagger-ui-wrap div.big p { - font-size: 1em; - margin-bottom: 10px; -} - -.swagger-section .swagger-ui-wrap form.fullwidth ol li.string input, -.swagger-section .swagger-ui-wrap form.fullwidth ol li.url input, -.swagger-section .swagger-ui-wrap form.fullwidth ol li.text textarea, -.swagger-section .swagger-ui-wrap form.fullwidth ol li.numeric input { - width: 500px !important; -} - -.swagger-section .swagger-ui-wrap .info_license { - padding-bottom: 5px; -} - -.swagger-section .swagger-ui-wrap .info_tos { - padding-bottom: 5px; -} - -.swagger-section .swagger-ui-wrap .message-fail { - color: #cc0000; -} - -.swagger-section .swagger-ui-wrap .info_url { - padding-bottom: 5px; -} - -.swagger-section .swagger-ui-wrap .info_email { - padding-bottom: 5px; -} - -.swagger-section .swagger-ui-wrap .info_name { - padding-bottom: 5px; -} - -.swagger-section .swagger-ui-wrap .info_description { - padding-bottom: 10px; - font-size: 15px; -} - -.swagger-section .swagger-ui-wrap .markdown ol li, -.swagger-section .swagger-ui-wrap .markdown ul li { - padding: 3px 0px; - line-height: 1.4em; - color: #333333; -} - -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input, -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input, -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input { - display: block; - padding: 4px; - width: auto; - clear: both; -} - -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input.title, -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input.title, -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input.title { - font-size: 1.3em; -} - -.swagger-section .swagger-ui-wrap table.fullwidth { - width: 100%; -} - -.swagger-section .swagger-ui-wrap .model-signature { - font-family: "Droid Sans", sans-serif; - font-size: 1em; - line-height: 1.5em; -} - -.swagger-section .swagger-ui-wrap .model-signature .signature-nav a { - text-decoration: none; - color: #AAA; -} - -.swagger-section .swagger-ui-wrap .model-signature .signature-nav a:hover { - text-decoration: underline; - color: black; -} - -.swagger-section .swagger-ui-wrap .model-signature .signature-nav .selected { - color: black; - text-decoration: none; -} - -.swagger-section .swagger-ui-wrap .model-signature .propType { - color: #5555aa; -} - -.swagger-section .swagger-ui-wrap .model-signature pre:hover { - background-color: #ffffdd; -} - -.swagger-section .swagger-ui-wrap .model-signature pre { - font-size: .85em; - line-height: 1.2em; - overflow: auto; - max-height: 200px; - cursor: pointer; -} - -.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav { - display: block; - min-width: 230px; - margin: 0; - padding: 0; -} - -.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li:last-child { - padding-right: 0; - border-right: none; -} - -.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li { - float: left; - margin: 0 5px 5px 0; - padding: 2px 5px 2px 0; - border-right: 1px solid #ddd; -} - -.swagger-section .swagger-ui-wrap .model-signature .propOpt { - color: #555; -} - -.swagger-section .swagger-ui-wrap .model-signature .snippet small { - font-size: 0.75em; -} - -.swagger-section .swagger-ui-wrap .model-signature .propOptKey { - font-style: italic; -} - -.swagger-section .swagger-ui-wrap .model-signature .description .strong { - font-weight: bold; - color: #000; - font-size: .9em; -} - -.swagger-section .swagger-ui-wrap .model-signature .description div { - font-size: 0.9em; - line-height: 1.5em; - margin-left: 1em; -} - -.swagger-section .swagger-ui-wrap .model-signature .description .stronger { - font-weight: bold; - color: #000; -} - -.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper { - border-spacing: 0; - position: absolute; - background-color: #ffffff; - border: 1px solid #bbbbbb; - display: none; - font-size: 11px; - max-width: 400px; - line-height: 30px; - color: black; - padding: 5px; - margin-left: 10px; -} - -.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper th { - text-align: center; - background-color: #eeeeee; - border: 1px solid #bbbbbb; - font-size: 11px; - color: #666666; - font-weight: bold; - padding: 5px; - line-height: 15px; -} - -.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper .optionName { - font-weight: bold; -} - -.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:first-child, -.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:last-child { - display: inline; -} - -.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:not(:first-child):before { - display: block; - content: ''; -} - -.swagger-section .swagger-ui-wrap .model-signature .description span:last-of-type.propDesc.markdown > p:only-child { - margin-right: -3px; -} - -.swagger-section .swagger-ui-wrap .model-signature .propName { - font-weight: bold; -} - -.swagger-section .swagger-ui-wrap .model-signature .signature-container { - clear: both; -} - -.swagger-section .swagger-ui-wrap .body-textarea { - width: 300px; - height: 100px; - border: 1px solid #aaa; -} - -.swagger-section .swagger-ui-wrap .markdown p code, -.swagger-section .swagger-ui-wrap .markdown li code { - font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; - background-color: #f0f0f0; - color: black; - padding: 1px 3px; -} - -.swagger-section .swagger-ui-wrap .required { - font-weight: bold; -} - -.swagger-section .swagger-ui-wrap .editor_holder { - font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; - font-size: 0.9em; -} - -.swagger-section .swagger-ui-wrap .editor_holder label { - font-weight: normal !important; - /* JSONEditor uses bold by default for all labels, we revert that back to normal to not give the impression that by default fields are required */ -} - -.swagger-section .swagger-ui-wrap .editor_holder label.required { - font-weight: bold !important; -} - -.swagger-section .swagger-ui-wrap input.parameter { - width: 300px; - border: 1px solid #aaa; -} - -.swagger-section .swagger-ui-wrap h1 { - color: black; - font-size: 1.5em; - line-height: 1.3em; - padding: 10px 0 10px 0; - font-family: "Droid Sans", sans-serif; - font-weight: bold; -} - -.swagger-section .swagger-ui-wrap .heading_with_menu { - float: none; - clear: both; - overflow: hidden; - display: block; -} - -.swagger-section .swagger-ui-wrap .heading_with_menu ul { - display: block; - clear: none; - float: right; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - -ms-box-sizing: border-box; - box-sizing: border-box; - margin-top: 10px; -} - -.swagger-section .swagger-ui-wrap h2 { - color: black; - font-size: 1.3em; - padding: 10px 0 10px 0; -} - -.swagger-section .swagger-ui-wrap h2 a { - color: black; -} - -.swagger-section .swagger-ui-wrap h2 span.sub { - font-size: 0.7em; - color: #999999; - font-style: italic; -} - -.swagger-section .swagger-ui-wrap h2 span.sub a { - color: #777777; -} - -.swagger-section .swagger-ui-wrap span.weak { - color: #666666; -} - -.swagger-section .swagger-ui-wrap .message-success { - color: #89BF04; -} - -.swagger-section .swagger-ui-wrap caption, -.swagger-section .swagger-ui-wrap th, -.swagger-section .swagger-ui-wrap td { - text-align: left; - font-weight: normal; - vertical-align: middle; -} - -.swagger-section .swagger-ui-wrap .code { - font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; -} - -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.text textarea { - font-family: "Droid Sans", sans-serif; - height: 250px; - padding: 4px; - display: block; - clear: both; -} - -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.select select { - display: block; - clear: both; -} - -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean { - float: none; - clear: both; - overflow: hidden; - display: block; -} - -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean label { - display: block; - float: left; - clear: none; - margin: 0; - padding: 0; -} - -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean input { - display: block; - float: left; - clear: none; - margin: 0 5px 0 0; -} - -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.required label { - color: black; -} - -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label { - display: block; - clear: both; - width: auto; - padding: 0 0 3px; - color: #666666; -} - -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label abbr { - padding-left: 3px; - color: #888888; -} - -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li p.inline-hints { - margin-left: 0; - font-style: italic; - font-size: 0.9em; - margin: 0; -} - -.swagger-section .swagger-ui-wrap form.formtastic fieldset.buttons { - margin: 0; - padding: 0; -} - -.swagger-section .swagger-ui-wrap span.blank, -.swagger-section .swagger-ui-wrap span.empty { - color: #888888; - font-style: italic; -} - -.swagger-section .swagger-ui-wrap .markdown h3 { - color: #547f00; -} - -.swagger-section .swagger-ui-wrap .markdown h4 { - color: #666666; -} - -.swagger-section .swagger-ui-wrap .markdown pre { - font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; - background-color: #fcf6db; - border: 1px solid #e5e0c6; - padding: 10px; - margin: 0 0 10px 0; -} - -.swagger-section .swagger-ui-wrap .markdown pre code { - line-height: 1.6em; -} - -.swagger-section .swagger-ui-wrap div.gist { - margin: 20px 0 25px 0 !important; -} - -.swagger-section .swagger-ui-wrap ul#resources { - font-family: "Droid Sans", sans-serif; - font-size: 0.9em; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource { - border-bottom: 1px solid #dddddd; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading h2 a, -.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading h2 a { - color: black; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading ul.options li a, -.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading ul.options li a { - color: #555555; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource:last-child { - border-bottom: none; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading { - border: 1px solid transparent; - float: none; - clear: both; - overflow: hidden; - display: block; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options { - overflow: hidden; - padding: 0; - display: block; - clear: none; - float: right; - margin: 14px 10px 0 0; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li { - float: left; - clear: none; - margin: 0; - padding: 2px 10px; - border-right: 1px solid #dddddd; - color: #666666; - font-size: 0.9em; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a { - color: #aaaaaa; - text-decoration: none; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover { - text-decoration: underline; - color: black; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover, -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:active, -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a.active { - text-decoration: underline; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:first-child, -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.first { - padding-left: 0; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:last-child, -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.last { - padding-right: 0; - border-right: none; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options:first-child, -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options.first { - padding-left: 0; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 { - color: #999999; - padding-left: 0; - display: block; - clear: none; - float: left; - font-family: "Droid Sans", sans-serif; - font-weight: bold; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a { - color: #999999; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a:hover { - color: black; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation { - float: none; - clear: both; - overflow: hidden; - display: block; - margin: 0 0 10px; - padding: 0; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading { - float: none; - clear: both; - overflow: hidden; - display: block; - margin: 0; - padding: 0; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 { - display: block; - clear: none; - float: left; - width: auto; - margin: 0; - padding: 0; - line-height: 1.1em; - color: black; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path { - padding-left: 10px; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a { - color: black; - text-decoration: none; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a.toggleOperation.deprecated { - text-decoration: line-through; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a:hover { - text-decoration: underline; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.http_method a { - text-transform: uppercase; - text-decoration: none; - color: white; - display: inline-block; - width: 50px; - font-size: 0.7em; - text-align: center; - padding: 7px 0 4px; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - -o-border-radius: 2px; - -ms-border-radius: 2px; - -khtml-border-radius: 2px; - border-radius: 2px; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span { - margin: 0; - padding: 0; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options { - overflow: hidden; - padding: 0; - display: block; - clear: none; - float: right; - margin: 6px 10px 0 0; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li { - float: left; - clear: none; - margin: 0; - padding: 2px 10px; - font-size: 0.9em; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li a { - text-decoration: none; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li.access { - color: black; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content { - border-top: none; - padding: 10px; - -moz-border-radius-bottomleft: 6px; - -webkit-border-bottom-left-radius: 6px; - -o-border-bottom-left-radius: 6px; - -ms-border-bottom-left-radius: 6px; - -khtml-border-bottom-left-radius: 6px; - border-bottom-left-radius: 6px; - -moz-border-radius-bottomright: 6px; - -webkit-border-bottom-right-radius: 6px; - -o-border-bottom-right-radius: 6px; - -ms-border-bottom-right-radius: 6px; - -khtml-border-bottom-right-radius: 6px; - border-bottom-right-radius: 6px; - margin: 0 0 20px; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content h4 { - font-size: 1.1em; - margin: 0; - padding: 15px 0 5px; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header { - float: none; - clear: both; - overflow: hidden; - display: block; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header a { - padding: 4px 0 0 10px; - display: inline-block; - font-size: 0.9em; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header input.submit { - display: block; - clear: none; - float: left; - padding: 6px 8px; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header span.response_throbber { - background-image: url('../images/throbber.gif'); - width: 128px; - height: 16px; - display: block; - clear: none; - float: right; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form input[type='text'].error { - outline: 2px solid black; - outline-color: #cc0000; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form select[name='parameterContentType'] { - max-width: 300px; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.response div.block pre { - font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; - padding: 10px; - font-size: 0.9em; - max-height: 400px; - overflow-y: auto; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading { - background-color: #f9f2e9; - border: 1px solid #f0e0ca; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading h3 span.http_method a { - background-color: #c5862b; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li { - border-right: 1px solid #dddddd; - border-right-color: #f0e0ca; - color: #c5862b; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li a { - color: #c5862b; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content { - background-color: #faf5ee; - border: 1px solid #f0e0ca; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content h4 { - color: #c5862b; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content div.sandbox_header a { - color: #dcb67f; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading { - background-color: #fcffcd; - border: 1px solid black; - border-color: #ffd20f; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading h3 span.http_method a { - text-transform: uppercase; - background-color: #ffd20f; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li { - border-right: 1px solid #dddddd; - border-right-color: #ffd20f; - color: #ffd20f; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li a { - color: #ffd20f; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content { - background-color: #fcffcd; - border: 1px solid black; - border-color: #ffd20f; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content h4 { - color: #ffd20f; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content div.sandbox_header a { - color: #6fc992; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading { - background-color: #f5e8e8; - border: 1px solid #e8c6c7; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading h3 span.http_method a { - text-transform: uppercase; - background-color: #a41e22; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li { - border-right: 1px solid #dddddd; - border-right-color: #e8c6c7; - color: #a41e22; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li a { - color: #a41e22; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content { - background-color: #f7eded; - border: 1px solid #e8c6c7; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content h4 { - color: #a41e22; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content div.sandbox_header a { - color: #c8787a; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading { - background-color: #e7f6ec; - border: 1px solid #c3e8d1; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading h3 span.http_method a { - background-color: #10a54a; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li { - border-right: 1px solid #dddddd; - border-right-color: #c3e8d1; - color: #10a54a; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li a { - color: #10a54a; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content { - background-color: #ebf7f0; - border: 1px solid #c3e8d1; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content h4 { - color: #10a54a; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content div.sandbox_header a { - color: #6fc992; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading { - background-color: #FCE9E3; - border: 1px solid #F5D5C3; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading h3 span.http_method a { - background-color: #D38042; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li { - border-right: 1px solid #dddddd; - border-right-color: #f0cecb; - color: #D38042; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li a { - color: #D38042; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content { - background-color: #faf0ef; - border: 1px solid #f0cecb; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content h4 { - color: #D38042; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content div.sandbox_header a { - color: #dcb67f; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading { - background-color: #e7f0f7; - border: 1px solid #c3d9ec; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading h3 span.http_method a { - background-color: #0f6ab4; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li { - border-right: 1px solid #dddddd; - border-right-color: #c3d9ec; - color: #0f6ab4; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li a { - color: #0f6ab4; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content { - background-color: #ebf3f9; - border: 1px solid #c3d9ec; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content h4 { - color: #0f6ab4; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.sandbox_header a { - color: #6fa5d2; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading { - background-color: #e7f0f7; - border: 1px solid #c3d9ec; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading h3 span.http_method a { - background-color: #0f6ab4; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li { - border-right: 1px solid #dddddd; - border-right-color: #c3d9ec; - color: #0f6ab4; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li a { - color: #0f6ab4; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content { - background-color: #ebf3f9; - border: 1px solid #c3d9ec; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content h4 { - color: #0f6ab4; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content div.sandbox_header a { - color: #6fa5d2; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content { - border-top: none; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li:last-child, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li:last-child, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li:last-child, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li:last-child, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li:last-child, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li:last-child, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li.last, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li.last, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li.last, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li.last, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li.last, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li.last { - padding-right: 0; - border-right: none; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:hover, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:active, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a.active { - text-decoration: underline; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li:first-child, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li.first { - padding-left: 0; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations:first-child, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations.first { - padding-left: 0; -} - -.swagger-section .swagger-ui-wrap p#colophon { - margin: 0 15px 40px 15px; - padding: 10px 0; - font-size: 0.8em; - border-top: 1px solid #dddddd; - font-family: "Droid Sans", sans-serif; - color: #999999; - font-style: italic; -} - -.swagger-section .swagger-ui-wrap p#colophon a { - text-decoration: none; - color: #547f00; -} - -.swagger-section .swagger-ui-wrap h3 { - color: black; - font-size: 1.1em; - padding: 10px 0 10px 0; -} - -.swagger-section .swagger-ui-wrap .markdown ol, -.swagger-section .swagger-ui-wrap .markdown ul { - font-family: "Droid Sans", sans-serif; - margin: 5px 0 10px; - padding: 0 0 0 18px; - list-style-type: disc; -} - -.swagger-section .swagger-ui-wrap form.form_box { - background-color: #ebf3f9; - border: 1px solid #c3d9ec; - padding: 10px; -} - -.swagger-section .swagger-ui-wrap form.form_box label { - color: #0f6ab4 !important; -} - -.swagger-section .swagger-ui-wrap form.form_box input[type=submit] { - display: block; - padding: 10px; -} - -.swagger-section .swagger-ui-wrap form.form_box p.weak { - font-size: 0.8em; -} - -.swagger-section .swagger-ui-wrap form.form_box p { - font-size: 0.9em; - padding: 0 0 15px; - color: #7e7b6d; -} - -.swagger-section .swagger-ui-wrap form.form_box p a { - color: #646257; -} - -.swagger-section .swagger-ui-wrap form.form_box p strong { - color: black; -} - -.swagger-section .swagger-ui-wrap .operation-status td.markdown > p:last-child { - padding-bottom: 0; -} - -.swagger-section .title { - font-style: bold; -} - -.swagger-section .secondary_form { - display: none; -} - -.swagger-section .main_image { - display: block; - margin-left: auto; - margin-right: auto; -} - -.swagger-section .oauth_body { - margin-left: 100px; - margin-right: 100px; -} - -.swagger-section .oauth_submit { - text-align: center; -} - -.swagger-section .api-popup-dialog { - z-index: 10000; - position: absolute; - width: 500px; - background: #FFF; - padding: 20px; - border: 1px solid #ccc; - border-radius: 5px; - display: none; - font-size: 13px; - color: #777; -} - -.swagger-section .api-popup-dialog .api-popup-title { - font-size: 24px; - padding: 10px 0; -} - -.swagger-section .api-popup-dialog .api-popup-title { - font-size: 24px; - padding: 10px 0; -} - -.swagger-section .api-popup-dialog .error-msg { - padding-left: 5px; - padding-bottom: 5px; -} - -.swagger-section .api-popup-dialog .api-popup-authbtn { - height: 30px; -} - -.swagger-section .api-popup-dialog .api-popup-cancel { - height: 30px; -} - -.swagger-section .api-popup-scopes { - padding: 10px 20px; -} - -.swagger-section .api-popup-scopes li { - padding: 5px 0; - line-height: 20px; -} - -.swagger-section .api-popup-scopes li input { - position: relative; - top: 2px; -} - -.swagger-section .api-popup-scopes .api-scope-desc { - padding-left: 20px; - font-style: italic; -} - -.swagger-section .api-popup-actions { - padding-top: 10px; -} - -.swagger-section .access { - float: right; -} - -.swagger-section .auth { - float: right; -} - -.swagger-section .api-ic { - height: 18px; - vertical-align: middle; - display: inline-block; - background: url(../images/explorer_icons.png) no-repeat; -} - -.swagger-section .api-ic .api_information_panel { - position: relative; - margin-top: 20px; - margin-left: -5px; - background: #FFF; - border: 1px solid #ccc; - border-radius: 5px; - display: none; - font-size: 13px; - max-width: 300px; - line-height: 30px; - color: black; - padding: 5px; -} - -.swagger-section .api-ic .api_information_panel p .api-msg-enabled { - color: green; -} - -.swagger-section .api-ic .api_information_panel p .api-msg-disabled { - color: red; -} - -.swagger-section .api-ic:hover .api_information_panel { - position: absolute; - display: block; -} - -.swagger-section .ic-info { - background-position: 0 0; - width: 18px; - margin-top: -6px; - margin-left: 4px; -} - -.swagger-section .ic-warning { - background-position: -60px 0; - width: 18px; - margin-top: -6px; - margin-left: 4px; -} - -.swagger-section .ic-error { - background-position: -30px 0; - width: 18px; - margin-top: -6px; - margin-left: 4px; -} - -.swagger-section .ic-off { - background-position: -90px 0; - width: 58px; - margin-top: -4px; - cursor: pointer; -} - -.swagger-section .ic-on { - background-position: -160px 0; - width: 58px; - margin-top: -4px; - cursor: pointer; -} - -.swagger-section #header { - background-color: #89bf04; - padding: 14px; -} - -.swagger-section #input_baseUrl { - width: 400px; -} - -.swagger-section #api_selector { - display: block; - clear: none; - float: right; -} - -.swagger-section #api_selector .input { - display: block; - clear: none; - float: left; - margin: 0 10px 0 0; -} - -.swagger-section #api_selector input { - font-size: 0.9em; - padding: 3px; - margin: 0; -} - -.swagger-section #input_apiKey { - width: 200px; -} - -.swagger-section #explore { - display: block; - text-decoration: none; - font-weight: bold; - padding: 6px 8px; - font-size: 0.9em; - color: white; - background-color: #547f00; - -moz-border-radius: 4px; - -webkit-border-radius: 4px; - -o-border-radius: 4px; - -ms-border-radius: 4px; - -khtml-border-radius: 4px; - border-radius: 4px; -} - -.swagger-section #explore:hover { - background-color: #547f00; -} - -.swagger-section #header #logo { - font-size: 1.5em; - font-weight: bold; - text-decoration: none; - background: transparent url(../images/logo_small.png) no-repeat left center; - padding: 20px 0 20px 40px; - color: white; -} - -.swagger-section #content_message { - margin: 10px 15px; - font-style: italic; - color: #999999; -} - -.swagger-section #message-bar { - min-height: 30px; - text-align: center; - padding-top: 10px; -} - -.swagger-section .swagger-collapse:before { - content: "-"; -} - -.swagger-section .swagger-expand:before { - content: "+"; -} diff --git a/src/main/resources/static/swagger/css/style.css b/src/main/resources/static/swagger/css/style.css deleted file mode 100644 index 1a044ab9..00000000 --- a/src/main/resources/static/swagger/css/style.css +++ /dev/null @@ -1,301 +0,0 @@ -.swagger-section #header a#logo { - font-size: 1.5em; - font-weight: bold; - text-decoration: none; - background: transparent url(../images/logo.png) no-repeat left center; - padding: 20px 0 20px 40px; -} - -#text-head { - font-size: 80px; - font-family: 'Roboto', sans-serif; - color: #ffffff; - float: right; - margin-right: 20%; -} - -.navbar-fixed-top .navbar-nav { - height: auto; -} - -.navbar-fixed-top .navbar-brand { - height: auto; -} - -.navbar-header { - height: auto; -} - -.navbar-inverse { - background-color: #000; - border-color: #000; -} - -#navbar-brand { - margin-left: 20%; -} - -.navtext { - font-size: 10px; -} - -.h1, -h1 { - font-size: 60px; -} - -.navbar-default .navbar-header .navbar-brand { - color: #a2dfee; -} - -/* tag titles */ -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a { - color: #393939; - font-family: 'Arvo', serif; - font-size: 1.5em; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a:hover { - color: black; -} - -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 { - color: #525252; - padding-left: 0px; - display: block; - clear: none; - float: left; - font-family: 'Arvo', serif; - font-weight: bold; -} - -.navbar-default .navbar-collapse, -.navbar-default .navbar-form { - border-color: #0A0A0A; -} - -.container1 { - width: 1500px; - margin: auto; - margin-top: 0; - background-image: url('../images/shield.png'); - background-repeat: no-repeat; - background-position: -40px -20px; - margin-bottom: 210px; -} - -.container-inner { - width: 1200px; - margin: auto; - background-color: rgba(223, 227, 228, 0.75); - padding-bottom: 40px; - padding-top: 40px; - border-radius: 15px; -} - -.header-content { - padding: 0; - width: 1000px; -} - -.title1 { - font-size: 80px; - font-family: 'Vollkorn', serif; - color: #404040; - text-align: center; - padding-top: 40px; - padding-bottom: 100px; -} - -#icon { - margin-top: -18px; -} - -.subtext { - font-size: 25px; - font-style: italic; - color: #08b; - text-align: right; - padding-right: 250px; -} - -.bg-primary { - background-color: #00468b; -} - -.navbar-default .nav > li > a, -.navbar-default .nav > li > a:focus { - color: #08b; -} - -.navbar-default .nav > li > a, -.navbar-default .nav > li > a:hover { - color: #08b; -} - -.navbar-default .nav > li > a, -.navbar-default .nav > li > a:focus:hover { - color: #08b; -} - -.text-faded { - font-size: 25px; - font-family: 'Vollkorn', serif; -} - -.section-heading { - font-family: 'Vollkorn', serif; - font-size: 45px; - padding-bottom: 10px; -} - -hr { - border-color: #00468b; - padding-bottom: 10px; -} - -.description { - margin-top: 20px; - padding-bottom: 200px; -} - -.description li { - font-family: 'Vollkorn', serif; - font-size: 25px; - color: #525252; - margin-left: 28%; - padding-top: 5px; -} - -.gap { - margin-top: 200px; -} - -.troubleshootingtext { - color: rgba(255, 255, 255, 0.7); - padding-left: 30%; -} - -.troubleshootingtext li { - list-style-type: circle; - font-size: 25px; - padding-bottom: 5px; -} - -.overlay { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - z-index: 1000; -} - -.block.response_body.json:hover { - cursor: pointer; -} - -.backdrop { - color: blue; -} - -#myModal { - height: 100%; -} - -.modal-backdrop { - bottom: 0; - position: fixed; -} - -.curl { - padding: 10px; - font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; - font-size: 0.9em; - max-height: 400px; - margin-top: 5px; - overflow-y: auto; - background-color: #fcf6db; - border: 1px solid #e5e0c6; - border-radius: 4px; -} - -.curl_title { - font-size: 1.1em; - margin: 0; - padding: 15px 0 5px; - font-family: 'Open Sans', 'Helvetica Neue', Arial, sans-serif; - font-weight: 500; - line-height: 1.1; -} - -.footer { - display: none; -} - -.swagger-section .swagger-ui-wrap h2 { - padding: 0; -} - -h2 { - margin: 0; - margin-bottom: 5px; -} - -.markdown p { - font-size: 15px; - font-family: 'Arvo', serif; -} - -.swagger-section .swagger-ui-wrap .code { - font-size: 15px; - font-family: 'Arvo', serif; -} - -.swagger-section .swagger-ui-wrap b { - font-family: 'Arvo', serif; -} - -#signin:hover { - cursor: pointer; -} - -.dropdown-menu { - padding: 15px; -} - -.navbar-right .dropdown-menu { - left: 0; - right: auto; -} - -#signinbutton { - width: 100%; - height: 32px; - font-size: 13px; - font-weight: bold; - color: #08b; -} - -.navbar-default .nav > li .details { - color: #000000; - text-transform: none; - font-size: 15px; - font-weight: normal; - font-family: 'Open Sans', sans-serif; - font-style: italic; - line-height: 20px; - top: -2px; -} - -.navbar-default .nav > li .details:hover { - color: black; -} - -#signout { - width: 100%; - height: 32px; - font-size: 13px; - font-weight: bold; - color: #08b; -} diff --git a/src/main/resources/static/swagger/css/typography.css b/src/main/resources/static/swagger/css/typography.css deleted file mode 100644 index c7339b86..00000000 --- a/src/main/resources/static/swagger/css/typography.css +++ /dev/null @@ -1,15 +0,0 @@ -/* Google Font's Droid Sans */ -@font-face { - font-family: 'Droid Sans'; - font-style: normal; - font-weight: 400; - src: local('Droid Sans'), local('DroidSans'), url('../fonts/DroidSans.ttf') format('truetype'); -} - -/* Google Font's Droid Sans Bold */ -@font-face { - font-family: 'Droid Sans'; - font-style: normal; - font-weight: 700; - src: local('Droid Sans Bold'), local('DroidSans-Bold'), url('../fonts/DroidSans-Bold.ttf') format('truetype'); -} diff --git a/src/main/resources/static/swagger/fonts/DroidSans-Bold.ttf b/src/main/resources/static/swagger/fonts/DroidSans-Bold.ttf deleted file mode 100644 index 036c4d13..00000000 Binary files a/src/main/resources/static/swagger/fonts/DroidSans-Bold.ttf and /dev/null differ diff --git a/src/main/resources/static/swagger/fonts/DroidSans.ttf b/src/main/resources/static/swagger/fonts/DroidSans.ttf deleted file mode 100644 index e517a0c5..00000000 Binary files a/src/main/resources/static/swagger/fonts/DroidSans.ttf and /dev/null differ diff --git a/src/main/resources/static/swagger/images/collapse.gif b/src/main/resources/static/swagger/images/collapse.gif deleted file mode 100644 index 8843e8ce..00000000 Binary files a/src/main/resources/static/swagger/images/collapse.gif and /dev/null differ diff --git a/src/main/resources/static/swagger/images/expand.gif b/src/main/resources/static/swagger/images/expand.gif deleted file mode 100644 index 477bf137..00000000 Binary files a/src/main/resources/static/swagger/images/expand.gif and /dev/null differ diff --git a/src/main/resources/static/swagger/images/explorer_icons.png b/src/main/resources/static/swagger/images/explorer_icons.png deleted file mode 100644 index ed9d2fff..00000000 Binary files a/src/main/resources/static/swagger/images/explorer_icons.png and /dev/null differ diff --git a/src/main/resources/static/swagger/images/favicon-16x16.png b/src/main/resources/static/swagger/images/favicon-16x16.png deleted file mode 100755 index 66b1a5bf..00000000 Binary files a/src/main/resources/static/swagger/images/favicon-16x16.png and /dev/null differ diff --git a/src/main/resources/static/swagger/images/favicon-32x32.png b/src/main/resources/static/swagger/images/favicon-32x32.png deleted file mode 100755 index 32f319f8..00000000 Binary files a/src/main/resources/static/swagger/images/favicon-32x32.png and /dev/null differ diff --git a/src/main/resources/static/swagger/images/favicon.ico b/src/main/resources/static/swagger/images/favicon.ico deleted file mode 100755 index 8b60bcf0..00000000 Binary files a/src/main/resources/static/swagger/images/favicon.ico and /dev/null differ diff --git a/src/main/resources/static/swagger/images/logo_small.png b/src/main/resources/static/swagger/images/logo_small.png deleted file mode 100644 index 5496a655..00000000 Binary files a/src/main/resources/static/swagger/images/logo_small.png and /dev/null differ diff --git a/src/main/resources/static/swagger/images/pet_store_api.png b/src/main/resources/static/swagger/images/pet_store_api.png deleted file mode 100644 index f9f9cd4a..00000000 Binary files a/src/main/resources/static/swagger/images/pet_store_api.png and /dev/null differ diff --git a/src/main/resources/static/swagger/images/throbber.gif b/src/main/resources/static/swagger/images/throbber.gif deleted file mode 100644 index 06393889..00000000 Binary files a/src/main/resources/static/swagger/images/throbber.gif and /dev/null differ diff --git a/src/main/resources/static/swagger/images/wordnik_api.png b/src/main/resources/static/swagger/images/wordnik_api.png deleted file mode 100644 index dca4f145..00000000 Binary files a/src/main/resources/static/swagger/images/wordnik_api.png and /dev/null differ diff --git a/src/main/resources/static/swagger/index.html b/src/main/resources/static/swagger/index.html deleted file mode 100644 index 514d25fa..00000000 --- a/src/main/resources/static/swagger/index.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - - Swagger UI - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

- -
 
-
- - diff --git a/src/main/resources/static/swagger/lang/en.js b/src/main/resources/static/swagger/lang/en.js deleted file mode 100644 index 677ded21..00000000 --- a/src/main/resources/static/swagger/lang/en.js +++ /dev/null @@ -1,56 +0,0 @@ -'use strict'; - -/* jshint quotmark: double */ -window.SwaggerTranslator.learn({ - "Warning: Deprecated": "Warning: Deprecated", - "Implementation Notes": "Implementation Notes", - "Response Class": "Response Class", - "Status": "Status", - "Parameters": "Parameters", - "Parameter": "Parameter", - "Value": "Value", - "Description": "Description", - "Parameter Type": "Parameter Type", - "Data Type": "Data Type", - "Response Messages": "Response Messages", - "HTTP Status Code": "HTTP Status Code", - "Reason": "Reason", - "Response Model": "Response Model", - "Request URL": "Request URL", - "Response Body": "Response Body", - "Response Code": "Response Code", - "Response Headers": "Response Headers", - "Hide Response": "Hide Response", - "Headers": "Headers", - "Try it out!": "Try it out!", - "Show/Hide": "Show/Hide", - "List Operations": "List Operations", - "Expand Operations": "Expand Operations", - "Raw": "Raw", - "can't parse JSON. Raw result": "can't parse JSON. Raw result", - "Example Value": "Example Value", - "Model Schema": "Model Schema", - "Model": "Model", - "Click to set as parameter value": "Click to set as parameter value", - "apply": "apply", - "Username": "Username", - "Password": "Password", - "Terms of service": "Terms of service", - "Created by": "Created by", - "See more at": "See more at", - "Contact the developer": "Contact the developer", - "api version": "api version", - "Response Content Type": "Response Content Type", - "Parameter content type:": "Parameter content type:", - "fetching resource": "fetching resource", - "fetching resource list": "fetching resource list", - "Explore": "Explore", - "Show Swagger Petstore Example Apis": "Show Swagger Petstore Example Apis", - "Can't read from server. It may not have the appropriate access-control-origin settings.": "Can't read from server. It may not have the appropriate access-control-origin settings.", - "Please specify the protocol for": "Please specify the protocol for", - "Can't read swagger JSON from": "Can't read swagger JSON from", - "Finished Loading Resource Information. Rendering Swagger UI": "Finished Loading Resource Information. Rendering Swagger UI", - "Unable to read api": "Unable to read api", - "from path": "from path", - "server returned": "server returned" -}); diff --git a/src/main/resources/static/swagger/lang/es.js b/src/main/resources/static/swagger/lang/es.js deleted file mode 100644 index 89112c9d..00000000 --- a/src/main/resources/static/swagger/lang/es.js +++ /dev/null @@ -1,53 +0,0 @@ -'use strict'; - -/* jshint quotmark: double */ -window.SwaggerTranslator.learn({ - "Warning: Deprecated": "Advertencia: Obsoleto", - "Implementation Notes": "Notas de implementación", - "Response Class": "Clase de la Respuesta", - "Status": "Status", - "Parameters": "Parámetros", - "Parameter": "Parámetro", - "Value": "Valor", - "Description": "Descripción", - "Parameter Type": "Tipo del Parámetro", - "Data Type": "Tipo del Dato", - "Response Messages": "Mensajes de la Respuesta", - "HTTP Status Code": "Código de Status HTTP", - "Reason": "Razón", - "Response Model": "Modelo de la Respuesta", - "Request URL": "URL de la Solicitud", - "Response Body": "Cuerpo de la Respuesta", - "Response Code": "Código de la Respuesta", - "Response Headers": "Encabezados de la Respuesta", - "Hide Response": "Ocultar Respuesta", - "Try it out!": "Pruébalo!", - "Show/Hide": "Mostrar/Ocultar", - "List Operations": "Listar Operaciones", - "Expand Operations": "Expandir Operaciones", - "Raw": "Crudo", - "can't parse JSON. Raw result": "no puede parsear el JSON. Resultado crudo", - "Example Value": "Valor de Ejemplo", - "Model Schema": "Esquema del Modelo", - "Model": "Modelo", - "apply": "aplicar", - "Username": "Nombre de usuario", - "Password": "Contraseña", - "Terms of service": "Términos de Servicio", - "Created by": "Creado por", - "See more at": "Ver más en", - "Contact the developer": "Contactar al desarrollador", - "api version": "versión de la api", - "Response Content Type": "Tipo de Contenido (Content Type) de la Respuesta", - "fetching resource": "buscando recurso", - "fetching resource list": "buscando lista del recurso", - "Explore": "Explorar", - "Show Swagger Petstore Example Apis": "Mostrar Api Ejemplo de Swagger Petstore", - "Can't read from server. It may not have the appropriate access-control-origin settings.": "No se puede leer del servidor. Tal vez no tiene la configuración de control de acceso de origen (access-control-origin) apropiado.", - "Please specify the protocol for": "Por favor, especificar el protocola para", - "Can't read swagger JSON from": "No se puede leer el JSON de swagger desde", - "Finished Loading Resource Information. Rendering Swagger UI": "Finalizada la carga del recurso de Información. Mostrando Swagger UI", - "Unable to read api": "No se puede leer la api", - "from path": "desde ruta", - "server returned": "el servidor retornó" -}); diff --git a/src/main/resources/static/swagger/lang/fr.js b/src/main/resources/static/swagger/lang/fr.js deleted file mode 100644 index 8366857c..00000000 --- a/src/main/resources/static/swagger/lang/fr.js +++ /dev/null @@ -1,54 +0,0 @@ -'use strict'; - -/* jshint quotmark: double */ -window.SwaggerTranslator.learn({ - "Warning: Deprecated": "Avertissement : Obsolète", - "Implementation Notes": "Notes d'implémentation", - "Response Class": "Classe de la réponse", - "Status": "Statut", - "Parameters": "Paramètres", - "Parameter": "Paramètre", - "Value": "Valeur", - "Description": "Description", - "Parameter Type": "Type du paramètre", - "Data Type": "Type de données", - "Response Messages": "Messages de la réponse", - "HTTP Status Code": "Code de statut HTTP", - "Reason": "Raison", - "Response Model": "Modèle de réponse", - "Request URL": "URL appelée", - "Response Body": "Corps de la réponse", - "Response Code": "Code de la réponse", - "Response Headers": "En-têtes de la réponse", - "Hide Response": "Cacher la réponse", - "Headers": "En-têtes", - "Try it out!": "Testez !", - "Show/Hide": "Afficher/Masquer", - "List Operations": "Liste des opérations", - "Expand Operations": "Développer les opérations", - "Raw": "Brut", - "can't parse JSON. Raw result": "impossible de décoder le JSON. Résultat brut", - "Example Value": "Exemple la valeur", - "Model Schema": "Définition du modèle", - "Model": "Modèle", - "apply": "appliquer", - "Username": "Nom d'utilisateur", - "Password": "Mot de passe", - "Terms of service": "Conditions de service", - "Created by": "Créé par", - "See more at": "Voir plus sur", - "Contact the developer": "Contacter le développeur", - "api version": "version de l'api", - "Response Content Type": "Content Type de la réponse", - "fetching resource": "récupération de la ressource", - "fetching resource list": "récupération de la liste de ressources", - "Explore": "Explorer", - "Show Swagger Petstore Example Apis": "Montrer les Apis de l'exemple Petstore de Swagger", - "Can't read from server. It may not have the appropriate access-control-origin settings.": "Impossible de lire à partir du serveur. Il se peut que les réglages access-control-origin ne soient pas appropriés.", - "Please specify the protocol for": "Veuillez spécifier un protocole pour", - "Can't read swagger JSON from": "Impossible de lire le JSON swagger à partir de", - "Finished Loading Resource Information. Rendering Swagger UI": "Chargement des informations terminé. Affichage de Swagger UI", - "Unable to read api": "Impossible de lire l'api", - "from path": "à partir du chemin", - "server returned": "réponse du serveur" -}); diff --git a/src/main/resources/static/swagger/lang/geo.js b/src/main/resources/static/swagger/lang/geo.js deleted file mode 100644 index 0586c3ff..00000000 --- a/src/main/resources/static/swagger/lang/geo.js +++ /dev/null @@ -1,56 +0,0 @@ -'use strict'; - -/* jshint quotmark: double */ -window.SwaggerTranslator.learn({ - "Warning: Deprecated": "ყურადღება: აღარ გამოიყენება", - "Implementation Notes": "იმპლემენტაციის აღწერა", - "Response Class": "რესპონს კლასი", - "Status": "სტატუსი", - "Parameters": "პარამეტრები", - "Parameter": "პარამეტრი", - "Value": "მნიშვნელობა", - "Description": "აღწერა", - "Parameter Type": "პარამეტრის ტიპი", - "Data Type": "მონაცემის ტიპი", - "Response Messages": "პასუხი", - "HTTP Status Code": "HTTP სტატუსი", - "Reason": "მიზეზი", - "Response Model": "რესპონს მოდელი", - "Request URL": "მოთხოვნის URL", - "Response Body": "პასუხის სხეული", - "Response Code": "პასუხის კოდი", - "Response Headers": "პასუხის ჰედერები", - "Hide Response": "დამალე პასუხი", - "Headers": "ჰედერები", - "Try it out!": "ცადე !", - "Show/Hide": "გამოჩენა/დამალვა", - "List Operations": "ოპერაციების სია", - "Expand Operations": "ოპერაციები ვრცლად", - "Raw": "ნედლი", - "can't parse JSON. Raw result": "JSON-ის დამუშავება ვერ მოხერხდა. ნედლი პასუხი", - "Example Value": "მაგალითი", - "Model Schema": "მოდელის სტრუქტურა", - "Model": "მოდელი", - "Click to set as parameter value": "პარამეტრისთვის მნიშვნელობის მისანიჭებლად, დააკლიკე", - "apply": "გამოყენება", - "Username": "მოხმარებელი", - "Password": "პაროლი", - "Terms of service": "მომსახურების პირობები", - "Created by": "შექმნა", - "See more at": "ნახე ვრცლად", - "Contact the developer": "დაუკავშირდი დეველოპერს", - "api version": "api ვერსია", - "Response Content Type": "პასუხის კონტენტის ტიპი", - "Parameter content type:": "პარამეტრის კონტენტის ტიპი:", - "fetching resource": "რესურსების მიღება", - "fetching resource list": "რესურსების სიის მიღება", - "Explore": "ნახვა", - "Show Swagger Petstore Example Apis": "ნახე Swagger Petstore სამაგალითო Api", - "Can't read from server. It may not have the appropriate access-control-origin settings.": "სერვერთან დაკავშირება ვერ ხერხდება. შეამოწმეთ access-control-origin.", - "Please specify the protocol for": "მიუთითეთ პროტოკოლი", - "Can't read swagger JSON from": "swagger JSON წაკითხვა ვერ მოხერხდა", - "Finished Loading Resource Information. Rendering Swagger UI": "რესურსების ჩატვირთვა სრულდება. Swagger UI რენდერდება", - "Unable to read api": "api წაკითხვა ვერ მოხერხდა", - "from path": "მისამართიდან", - "server returned": "სერვერმა დააბრუნა" -}); diff --git a/src/main/resources/static/swagger/lang/it.js b/src/main/resources/static/swagger/lang/it.js deleted file mode 100644 index 5300a867..00000000 --- a/src/main/resources/static/swagger/lang/it.js +++ /dev/null @@ -1,52 +0,0 @@ -'use strict'; - -/* jshint quotmark: double */ -window.SwaggerTranslator.learn({ - "Warning: Deprecated": "Attenzione: Deprecato", - "Implementation Notes": "Note di implementazione", - "Response Class": "Classe della risposta", - "Status": "Stato", - "Parameters": "Parametri", - "Parameter": "Parametro", - "Value": "Valore", - "Description": "Descrizione", - "Parameter Type": "Tipo di parametro", - "Data Type": "Tipo di dato", - "Response Messages": "Messaggi della risposta", - "HTTP Status Code": "Codice stato HTTP", - "Reason": "Motivo", - "Response Model": "Modello di risposta", - "Request URL": "URL della richiesta", - "Response Body": "Corpo della risposta", - "Response Code": "Oggetto della risposta", - "Response Headers": "Intestazioni della risposta", - "Hide Response": "Nascondi risposta", - "Try it out!": "Provalo!", - "Show/Hide": "Mostra/Nascondi", - "List Operations": "Mostra operazioni", - "Expand Operations": "Espandi operazioni", - "Raw": "Grezzo (raw)", - "can't parse JSON. Raw result": "non è possibile parsare il JSON. Risultato grezzo (raw).", - "Model Schema": "Schema del modello", - "Model": "Modello", - "apply": "applica", - "Username": "Nome utente", - "Password": "Password", - "Terms of service": "Condizioni del servizio", - "Created by": "Creato da", - "See more at": "Informazioni aggiuntive:", - "Contact the developer": "Contatta lo sviluppatore", - "api version": "versione api", - "Response Content Type": "Tipo di contenuto (content type) della risposta", - "fetching resource": "recuperando la risorsa", - "fetching resource list": "recuperando lista risorse", - "Explore": "Esplora", - "Show Swagger Petstore Example Apis": "Mostra le api di esempio di Swagger Petstore", - "Can't read from server. It may not have the appropriate access-control-origin settings.": "Non è possibile leggere dal server. Potrebbe non avere le impostazioni di controllo accesso origine (access-control-origin) appropriate.", - "Please specify the protocol for": "Si prega di specificare il protocollo per", - "Can't read swagger JSON from": "Impossibile leggere JSON swagger da:", - "Finished Loading Resource Information. Rendering Swagger UI": "Lettura informazioni risorse termianta. Swagger UI viene mostrata", - "Unable to read api": "Impossibile leggere la api", - "from path": "da cartella", - "server returned": "il server ha restituito" -}); diff --git a/src/main/resources/static/swagger/lang/ja.js b/src/main/resources/static/swagger/lang/ja.js deleted file mode 100755 index 364c2859..00000000 --- a/src/main/resources/static/swagger/lang/ja.js +++ /dev/null @@ -1,53 +0,0 @@ -'use strict'; - -/* jshint quotmark: double */ -window.SwaggerTranslator.learn({ - "Warning: Deprecated": "警告: 廃止予定", - "Implementation Notes": "実装メモ", - "Response Class": "レスポンスクラス", - "Status": "ステータス", - "Parameters": "パラメータ群", - "Parameter": "パラメータ", - "Value": "値", - "Description": "説明", - "Parameter Type": "パラメータタイプ", - "Data Type": "データタイプ", - "Response Messages": "レスポンスメッセージ", - "HTTP Status Code": "HTTPステータスコード", - "Reason": "理由", - "Response Model": "レスポンスモデル", - "Request URL": "リクエストURL", - "Response Body": "レスポンスボディ", - "Response Code": "レスポンスコード", - "Response Headers": "レスポンスヘッダ", - "Hide Response": "レスポンスを隠す", - "Headers": "ヘッダ", - "Try it out!": "実際に実行!", - "Show/Hide": "表示/非表示", - "List Operations": "操作一覧", - "Expand Operations": "操作の展開", - "Raw": "Raw", - "can't parse JSON. Raw result": "JSONへ解釈できません. 未加工の結果", - "Model Schema": "モデルスキーマ", - "Model": "モデル", - "apply": "実行", - "Username": "ユーザ名", - "Password": "パスワード", - "Terms of service": "サービス利用規約", - "Created by": "Created by", - "See more at": "See more at", - "Contact the developer": "開発者に連絡", - "api version": "APIバージョン", - "Response Content Type": "レスポンス コンテンツタイプ", - "fetching resource": "リソースの取得", - "fetching resource list": "リソース一覧の取得", - "Explore": "Explore", - "Show Swagger Petstore Example Apis": "SwaggerペットストアAPIの表示", - "Can't read from server. It may not have the appropriate access-control-origin settings.": "サーバから読み込めません. 適切なaccess-control-origin設定を持っていない可能性があります.", - "Please specify the protocol for": "プロトコルを指定してください", - "Can't read swagger JSON from": "次からswagger JSONを読み込めません", - "Finished Loading Resource Information. Rendering Swagger UI": "リソース情報の読み込みが完了しました. Swagger UIを描画しています", - "Unable to read api": "APIを読み込めません", - "from path": "次のパスから", - "server returned": "サーバからの返答" -}); diff --git a/src/main/resources/static/swagger/lang/pl.js b/src/main/resources/static/swagger/lang/pl.js deleted file mode 100644 index 9efe96de..00000000 --- a/src/main/resources/static/swagger/lang/pl.js +++ /dev/null @@ -1,53 +0,0 @@ -'use strict'; - -/* jshint quotmark: double */ -window.SwaggerTranslator.learn({ - "Warning: Deprecated": "Uwaga: Wycofane", - "Implementation Notes": "Uwagi Implementacji", - "Response Class": "Klasa Odpowiedzi", - "Status": "Status", - "Parameters": "Parametry", - "Parameter": "Parametr", - "Value": "Wartość", - "Description": "Opis", - "Parameter Type": "Typ Parametru", - "Data Type": "Typ Danych", - "Response Messages": "Wiadomości Odpowiedzi", - "HTTP Status Code": "Kod Statusu HTTP", - "Reason": "Przyczyna", - "Response Model": "Model Odpowiedzi", - "Request URL": "URL Wywołania", - "Response Body": "Treść Odpowiedzi", - "Response Code": "Kod Odpowiedzi", - "Response Headers": "Nagłówki Odpowiedzi", - "Hide Response": "Ukryj Odpowiedź", - "Headers": "Nagłówki", - "Try it out!": "Wypróbuj!", - "Show/Hide": "Pokaż/Ukryj", - "List Operations": "Lista Operacji", - "Expand Operations": "Rozwiń Operacje", - "Raw": "Nieprzetworzone", - "can't parse JSON. Raw result": "nie można przetworzyć pliku JSON. Nieprzetworzone dane", - "Model Schema": "Schemat Modelu", - "Model": "Model", - "apply": "użyj", - "Username": "Nazwa użytkownika", - "Password": "Hasło", - "Terms of service": "Warunki używania", - "Created by": "Utworzone przez", - "See more at": "Zobacz więcej na", - "Contact the developer": "Kontakt z deweloperem", - "api version": "wersja api", - "Response Content Type": "Typ Zasobu Odpowiedzi", - "fetching resource": "ładowanie zasobu", - "fetching resource list": "ładowanie listy zasobów", - "Explore": "Eksploruj", - "Show Swagger Petstore Example Apis": "Pokaż Przykładowe Api Swagger Petstore", - "Can't read from server. It may not have the appropriate access-control-origin settings.": "Brak połączenia z serwerem. Może on nie mieć odpowiednich ustawień access-control-origin.", - "Please specify the protocol for": "Proszę podać protokół dla", - "Can't read swagger JSON from": "Nie można odczytać swagger JSON z", - "Finished Loading Resource Information. Rendering Swagger UI": "Ukończono Ładowanie Informacji o Zasobie. Renderowanie Swagger UI", - "Unable to read api": "Nie można odczytać api", - "from path": "ze ścieżki", - "server returned": "serwer zwrócił" -}); diff --git a/src/main/resources/static/swagger/lang/pt.js b/src/main/resources/static/swagger/lang/pt.js deleted file mode 100644 index 2f2c6338..00000000 --- a/src/main/resources/static/swagger/lang/pt.js +++ /dev/null @@ -1,53 +0,0 @@ -'use strict'; - -/* jshint quotmark: double */ -window.SwaggerTranslator.learn({ - "Warning: Deprecated": "Aviso: Depreciado", - "Implementation Notes": "Notas de Implementação", - "Response Class": "Classe de resposta", - "Status": "Status", - "Parameters": "Parâmetros", - "Parameter": "Parâmetro", - "Value": "Valor", - "Description": "Descrição", - "Parameter Type": "Tipo de parâmetro", - "Data Type": "Tipo de dados", - "Response Messages": "Mensagens de resposta", - "HTTP Status Code": "Código de status HTTP", - "Reason": "Razão", - "Response Model": "Modelo resposta", - "Request URL": "URL requisição", - "Response Body": "Corpo da resposta", - "Response Code": "Código da resposta", - "Response Headers": "Cabeçalho da resposta", - "Headers": "Cabeçalhos", - "Hide Response": "Esconder resposta", - "Try it out!": "Tente agora!", - "Show/Hide": "Mostrar/Esconder", - "List Operations": "Listar operações", - "Expand Operations": "Expandir operações", - "Raw": "Cru", - "can't parse JSON. Raw result": "Falha ao analisar JSON. Resulto cru", - "Model Schema": "Modelo esquema", - "Model": "Modelo", - "apply": "Aplicar", - "Username": "Usuário", - "Password": "Senha", - "Terms of service": "Termos do serviço", - "Created by": "Criado por", - "See more at": "Veja mais em", - "Contact the developer": "Contate o desenvolvedor", - "api version": "Versão api", - "Response Content Type": "Tipo de conteúdo da resposta", - "fetching resource": "busca recurso", - "fetching resource list": "buscando lista de recursos", - "Explore": "Explorar", - "Show Swagger Petstore Example Apis": "Show Swagger Petstore Example Apis", - "Can't read from server. It may not have the appropriate access-control-origin settings.": "Não é possível ler do servidor. Pode não ter as apropriadas configurações access-control-origin", - "Please specify the protocol for": "Por favor especifique o protocolo", - "Can't read swagger JSON from": "Não é possível ler o JSON Swagger de", - "Finished Loading Resource Information. Rendering Swagger UI": "Carregar informação de recurso finalizada. Renderizando Swagger UI", - "Unable to read api": "Não foi possível ler api", - "from path": "do caminho", - "server returned": "servidor retornou" -}); diff --git a/src/main/resources/static/swagger/lang/ru.js b/src/main/resources/static/swagger/lang/ru.js deleted file mode 100644 index 83bbf00e..00000000 --- a/src/main/resources/static/swagger/lang/ru.js +++ /dev/null @@ -1,56 +0,0 @@ -'use strict'; - -/* jshint quotmark: double */ -window.SwaggerTranslator.learn({ - "Warning: Deprecated": "Предупреждение: Устарело", - "Implementation Notes": "Заметки", - "Response Class": "Пример ответа", - "Status": "Статус", - "Parameters": "Параметры", - "Parameter": "Параметр", - "Value": "Значение", - "Description": "Описание", - "Parameter Type": "Тип параметра", - "Data Type": "Тип данных", - "HTTP Status Code": "HTTP код", - "Reason": "Причина", - "Response Model": "Структура ответа", - "Request URL": "URL запроса", - "Response Body": "Тело ответа", - "Response Code": "HTTP код ответа", - "Response Headers": "Заголовки ответа", - "Hide Response": "Спрятать ответ", - "Headers": "Заголовки", - "Response Messages": "Что может прийти в ответ", - "Try it out!": "Попробовать!", - "Show/Hide": "Показать/Скрыть", - "List Operations": "Операции кратко", - "Expand Operations": "Операции подробно", - "Raw": "В сыром виде", - "can't parse JSON. Raw result": "Не удается распарсить ответ:", - "Example Value": "Пример", - "Model Schema": "Структура", - "Model": "Описание", - "Click to set as parameter value": "Нажмите, чтобы испльзовать в качестве значения параметра", - "apply": "применить", - "Username": "Имя пользователя", - "Password": "Пароль", - "Terms of service": "Условия использования", - "Created by": "Разработано", - "See more at": "Еще тут", - "Contact the developer": "Связаться с разработчиком", - "api version": "Версия API", - "Response Content Type": "Content Type ответа", - "Parameter content type:": "Content Type параметра:", - "fetching resource": "Получение ресурса", - "fetching resource list": "Получение ресурсов", - "Explore": "Показать", - "Show Swagger Petstore Example Apis": "Показать примеры АПИ", - "Can't read from server. It may not have the appropriate access-control-origin settings.": "Не удается получить ответ от сервера. Возможно, проблема с настройками доступа", - "Please specify the protocol for": "Пожалуйста, укажите протокол для", - "Can't read swagger JSON from": "Не получается прочитать swagger json из", - "Finished Loading Resource Information. Rendering Swagger UI": "Загрузка информации о ресурсах завершена. Рендерим", - "Unable to read api": "Не удалось прочитать api", - "from path": "по адресу", - "server returned": "сервер сказал" -}); diff --git a/src/main/resources/static/swagger/lang/tr.js b/src/main/resources/static/swagger/lang/tr.js deleted file mode 100644 index e8ec9dec..00000000 --- a/src/main/resources/static/swagger/lang/tr.js +++ /dev/null @@ -1,53 +0,0 @@ -'use strict'; - -/* jshint quotmark: double */ -window.SwaggerTranslator.learn({ - "Warning: Deprecated": "Uyarı: Deprecated", - "Implementation Notes": "Gerçekleştirim Notları", - "Response Class": "Dönen Sınıf", - "Status": "Statü", - "Parameters": "Parametreler", - "Parameter": "Parametre", - "Value": "Değer", - "Description": "Açıklama", - "Parameter Type": "Parametre Tipi", - "Data Type": "Veri Tipi", - "Response Messages": "Dönüş Mesajı", - "HTTP Status Code": "HTTP Statü Kodu", - "Reason": "Gerekçe", - "Response Model": "Dönüş Modeli", - "Request URL": "İstek URL", - "Response Body": "Dönüş İçeriği", - "Response Code": "Dönüş Kodu", - "Response Headers": "Dönüş Üst Bilgileri", - "Hide Response": "Dönüşü Gizle", - "Headers": "Üst Bilgiler", - "Try it out!": "Dene!", - "Show/Hide": "Göster/Gizle", - "List Operations": "Operasyonları Listele", - "Expand Operations": "Operasyonları Aç", - "Raw": "Ham", - "can't parse JSON. Raw result": "JSON çözümlenemiyor. Ham sonuç", - "Model Schema": "Model Şema", - "Model": "Model", - "apply": "uygula", - "Username": "Kullanıcı Adı", - "Password": "Parola", - "Terms of service": "Servis şartları", - "Created by": "Oluşturan", - "See more at": "Daha fazlası için", - "Contact the developer": "Geliştirici ile İletişime Geçin", - "api version": "api versiyon", - "Response Content Type": "Dönüş İçerik Tipi", - "fetching resource": "kaynak getiriliyor", - "fetching resource list": "kaynak listesi getiriliyor", - "Explore": "Keşfet", - "Show Swagger Petstore Example Apis": "Swagger Petstore Örnek Api'yi Gör", - "Can't read from server. It may not have the appropriate access-control-origin settings.": "Sunucudan okuma yapılamıyor. Sunucu access-control-origin ayarlarınızı kontrol edin.", - "Please specify the protocol for": "Lütfen istenen adres için protokol belirtiniz", - "Can't read swagger JSON from": "Swagger JSON bu kaynaktan okunamıyor", - "Finished Loading Resource Information. Rendering Swagger UI": "Kaynak baglantısı tamamlandı. Swagger UI gösterime hazırlanıyor", - "Unable to read api": "api okunamadı", - "from path": "yoldan", - "server returned": "sunucuya dönüldü" -}); diff --git a/src/main/resources/static/swagger/lang/translator.js b/src/main/resources/static/swagger/lang/translator.js deleted file mode 100644 index cae3f12a..00000000 --- a/src/main/resources/static/swagger/lang/translator.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict'; - -/** - * Translator for documentation pages. - * - * To enable translation you should include one of language-files in your index.html - * after . - * For example - - * - * If you wish to translate some new texsts you should do two things: - * 1. Add a new phrase pair ("New Phrase": "New Translation") into your language file (for example lang/ru.js). It will be great if you add it in other language files too. - * 2. Mark that text it templates this way New Phrase or . - * The main thing here is attribute data-sw-translate. Only inner html, title-attribute and value-attribute are going to translate. - * - */ -window.SwaggerTranslator = { - - _words: [], - - translate: function (sel) { - var $this = this; - sel = sel || '[data-sw-translate]'; - - $(sel).each(function () { - $(this).html($this._tryTranslate($(this).html())); - - $(this).val($this._tryTranslate($(this).val())); - $(this).attr('title', $this._tryTranslate($(this).attr('title'))); - }); - }, - - _tryTranslate: function (word) { - return this._words[$.trim(word)] !== undefined ? this._words[$.trim(word)] : word; - }, - - learn: function (wordsMap) { - this._words = wordsMap; - } -}; diff --git a/src/main/resources/static/swagger/lang/zh-cn.js b/src/main/resources/static/swagger/lang/zh-cn.js deleted file mode 100644 index 530be030..00000000 --- a/src/main/resources/static/swagger/lang/zh-cn.js +++ /dev/null @@ -1,53 +0,0 @@ -'use strict'; - -/* jshint quotmark: double */ -window.SwaggerTranslator.learn({ - "Warning: Deprecated": "警告:已过时", - "Implementation Notes": "实现备注", - "Response Class": "响应类", - "Status": "状态", - "Parameters": "参数", - "Parameter": "参数", - "Value": "值", - "Description": "描述", - "Parameter Type": "参数类型", - "Data Type": "数据类型", - "Response Messages": "响应消息", - "HTTP Status Code": "HTTP状态码", - "Reason": "原因", - "Response Model": "响应模型", - "Request URL": "请求URL", - "Response Body": "响应体", - "Response Code": "响应码", - "Response Headers": "响应头", - "Hide Response": "隐藏响应", - "Headers": "头", - "Try it out!": "试一下!", - "Show/Hide": "显示/隐藏", - "List Operations": "显示操作", - "Expand Operations": "展开操作", - "Raw": "原始", - "can't parse JSON. Raw result": "无法解析JSON. 原始结果", - "Model Schema": "模型架构", - "Model": "模型", - "apply": "应用", - "Username": "用户名", - "Password": "密码", - "Terms of service": "服务条款", - "Created by": "创建者", - "See more at": "查看更多:", - "Contact the developer": "联系开发者", - "api version": "api版本", - "Response Content Type": "响应Content Type", - "fetching resource": "正在获取资源", - "fetching resource list": "正在获取资源列表", - "Explore": "浏览", - "Show Swagger Petstore Example Apis": "显示 Swagger Petstore 示例 Apis", - "Can't read from server. It may not have the appropriate access-control-origin settings.": "无法从服务器读取。可能没有正确设置access-control-origin。", - "Please specify the protocol for": "请指定协议:", - "Can't read swagger JSON from": "无法读取swagger JSON于", - "Finished Loading Resource Information. Rendering Swagger UI": "已加载资源信息。正在渲染Swagger UI", - "Unable to read api": "无法读取api", - "from path": "从路径", - "server returned": "服务器返回" -}); diff --git a/src/main/resources/static/swagger/lib/backbone-min.js b/src/main/resources/static/swagger/lib/backbone-min.js deleted file mode 100644 index 982be04f..00000000 --- a/src/main/resources/static/swagger/lib/backbone-min.js +++ /dev/null @@ -1,888 +0,0 @@ -// Backbone.js 1.1.2 - -(function (t, e) { - if (typeof define === "function" && define.amd) { - define(["underscore", "jquery", "exports"], function (i, r, s) { - t.Backbone = e(t, s, i, r) - }) - } else if (typeof exports !== "undefined") { - var i = require("underscore"); - e(t, exports, i) - } else { - t.Backbone = e(t, {}, t._, t.jQuery || t.Zepto || t.ender || t.$) - } -})(this, function (t, e, i, r) { - var s = t.Backbone; - var n = []; - var a = n.push; - var o = n.slice; - var h = n.splice; - e.VERSION = "1.1.2"; - e.$ = r; - e.noConflict = function () { - t.Backbone = s; - return this - }; - e.emulateHTTP = false; - e.emulateJSON = false; - var u = e.Events = { - on: function (t, e, i) { - if (!c(this, "on", t, [e, i]) || !e)return this; - this._events || (this._events = {}); - var r = this._events[t] || (this._events[t] = []); - r.push({callback: e, context: i, ctx: i || this}); - return this - }, once: function (t, e, r) { - if (!c(this, "once", t, [e, r]) || !e)return this; - var s = this; - var n = i.once(function () { - s.off(t, n); - e.apply(this, arguments) - }); - n._callback = e; - return this.on(t, n, r) - }, off: function (t, e, r) { - var s, n, a, o, h, u, l, f; - if (!this._events || !c(this, "off", t, [e, r]))return this; - if (!t && !e && !r) { - this._events = void 0; - return this - } - o = t ? [t] : i.keys(this._events); - for (h = 0, u = o.length; h < u; h++) { - t = o[h]; - if (a = this._events[t]) { - this._events[t] = s = []; - if (e || r) { - for (l = 0, f = a.length; l < f; l++) { - n = a[l]; - if (e && e !== n.callback && e !== n.callback._callback || r && r !== n.context) { - s.push(n) - } - } - } - if (!s.length)delete this._events[t] - } - } - return this - }, trigger: function (t) { - if (!this._events)return this; - var e = o.call(arguments, 1); - if (!c(this, "trigger", t, e))return this; - var i = this._events[t]; - var r = this._events.all; - if (i)f(i, e); - if (r)f(r, arguments); - return this - }, stopListening: function (t, e, r) { - var s = this._listeningTo; - if (!s)return this; - var n = !e && !r; - if (!r && typeof e === "object")r = this; - if (t)(s = {})[t._listenId] = t; - for (var a in s) { - t = s[a]; - t.off(e, r, this); - if (n || i.isEmpty(t._events))delete this._listeningTo[a] - } - return this - } - }; - var l = /\s+/; - var c = function (t, e, i, r) { - if (!i)return true; - if (typeof i === "object") { - for (var s in i) { - t[e].apply(t, [s, i[s]].concat(r)) - } - return false - } - if (l.test(i)) { - var n = i.split(l); - for (var a = 0, o = n.length; a < o; a++) { - t[e].apply(t, [n[a]].concat(r)) - } - return false - } - return true - }; - var f = function (t, e) { - var i, r = -1, s = t.length, n = e[0], a = e[1], o = e[2]; - switch (e.length) { - case 0: - while (++r < s)(i = t[r]).callback.call(i.ctx); - return; - case 1: - while (++r < s)(i = t[r]).callback.call(i.ctx, n); - return; - case 2: - while (++r < s)(i = t[r]).callback.call(i.ctx, n, a); - return; - case 3: - while (++r < s)(i = t[r]).callback.call(i.ctx, n, a, o); - return; - default: - while (++r < s)(i = t[r]).callback.apply(i.ctx, e); - return - } - }; - var d = {listenTo: "on", listenToOnce: "once"}; - i.each(d, function (t, e) { - u[e] = function (e, r, s) { - var n = this._listeningTo || (this._listeningTo = {}); - var a = e._listenId || (e._listenId = i.uniqueId("l")); - n[a] = e; - if (!s && typeof r === "object")s = this; - e[t](r, s, this); - return this - } - }); - u.bind = u.on; - u.unbind = u.off; - i.extend(e, u); - var p = e.Model = function (t, e) { - var r = t || {}; - e || (e = {}); - this.cid = i.uniqueId("c"); - this.attributes = {}; - if (e.collection)this.collection = e.collection; - if (e.parse)r = this.parse(r, e) || {}; - r = i.defaults({}, r, i.result(this, "defaults")); - this.set(r, e); - this.changed = {}; - this.initialize.apply(this, arguments) - }; - i.extend(p.prototype, u, { - changed: null, validationError: null, idAttribute: "id", initialize: function () { - }, toJSON: function (t) { - return i.clone(this.attributes) - }, sync: function () { - return e.sync.apply(this, arguments) - }, get: function (t) { - return this.attributes[t] - }, escape: function (t) { - return i.escape(this.get(t)) - }, has: function (t) { - return this.get(t) != null - }, set: function (t, e, r) { - var s, n, a, o, h, u, l, c; - if (t == null)return this; - if (typeof t === "object") { - n = t; - r = e - } else { - (n = {})[t] = e - } - r || (r = {}); - if (!this._validate(n, r))return false; - a = r.unset; - h = r.silent; - o = []; - u = this._changing; - this._changing = true; - if (!u) { - this._previousAttributes = i.clone(this.attributes); - this.changed = {} - } - c = this.attributes, l = this._previousAttributes; - if (this.idAttribute in n)this.id = n[this.idAttribute]; - for (s in n) { - e = n[s]; - if (!i.isEqual(c[s], e))o.push(s); - if (!i.isEqual(l[s], e)) { - this.changed[s] = e - } else { - delete this.changed[s] - } - a ? delete c[s] : c[s] = e - } - if (!h) { - if (o.length)this._pending = r; - for (var f = 0, d = o.length; f < d; f++) { - this.trigger("change:" + o[f], this, c[o[f]], r) - } - } - if (u)return this; - if (!h) { - while (this._pending) { - r = this._pending; - this._pending = false; - this.trigger("change", this, r) - } - } - this._pending = false; - this._changing = false; - return this - }, unset: function (t, e) { - return this.set(t, void 0, i.extend({}, e, {unset: true})) - }, clear: function (t) { - var e = {}; - for (var r in this.attributes)e[r] = void 0; - return this.set(e, i.extend({}, t, {unset: true})) - }, hasChanged: function (t) { - if (t == null)return !i.isEmpty(this.changed); - return i.has(this.changed, t) - }, changedAttributes: function (t) { - if (!t)return this.hasChanged() ? i.clone(this.changed) : false; - var e, r = false; - var s = this._changing ? this._previousAttributes : this.attributes; - for (var n in t) { - if (i.isEqual(s[n], e = t[n]))continue; - (r || (r = {}))[n] = e - } - return r - }, previous: function (t) { - if (t == null || !this._previousAttributes)return null; - return this._previousAttributes[t] - }, previousAttributes: function () { - return i.clone(this._previousAttributes) - }, fetch: function (t) { - t = t ? i.clone(t) : {}; - if (t.parse === void 0)t.parse = true; - var e = this; - var r = t.success; - t.success = function (i) { - if (!e.set(e.parse(i, t), t))return false; - if (r)r(e, i, t); - e.trigger("sync", e, i, t) - }; - q(this, t); - return this.sync("read", this, t) - }, save: function (t, e, r) { - var s, n, a, o = this.attributes; - if (t == null || typeof t === "object") { - s = t; - r = e - } else { - (s = {})[t] = e - } - r = i.extend({validate: true}, r); - if (s && !r.wait) { - if (!this.set(s, r))return false - } else { - if (!this._validate(s, r))return false - } - if (s && r.wait) { - this.attributes = i.extend({}, o, s) - } - if (r.parse === void 0)r.parse = true; - var h = this; - var u = r.success; - r.success = function (t) { - h.attributes = o; - var e = h.parse(t, r); - if (r.wait)e = i.extend(s || {}, e); - if (i.isObject(e) && !h.set(e, r)) { - return false - } - if (u)u(h, t, r); - h.trigger("sync", h, t, r) - }; - q(this, r); - n = this.isNew() ? "create" : r.patch ? "patch" : "update"; - if (n === "patch")r.attrs = s; - a = this.sync(n, this, r); - if (s && r.wait)this.attributes = o; - return a - }, destroy: function (t) { - t = t ? i.clone(t) : {}; - var e = this; - var r = t.success; - var s = function () { - e.trigger("destroy", e, e.collection, t) - }; - t.success = function (i) { - if (t.wait || e.isNew())s(); - if (r)r(e, i, t); - if (!e.isNew())e.trigger("sync", e, i, t) - }; - if (this.isNew()) { - t.success(); - return false - } - q(this, t); - var n = this.sync("delete", this, t); - if (!t.wait)s(); - return n - }, url: function () { - var t = i.result(this, "urlRoot") || i.result(this.collection, "url") || M(); - if (this.isNew())return t; - return t.replace(/([^\/])$/, "$1/") + encodeURIComponent(this.id) - }, parse: function (t, e) { - return t - }, clone: function () { - return new this.constructor(this.attributes) - }, isNew: function () { - return !this.has(this.idAttribute) - }, isValid: function (t) { - return this._validate({}, i.extend(t || {}, {validate: true})) - }, _validate: function (t, e) { - if (!e.validate || !this.validate)return true; - t = i.extend({}, this.attributes, t); - var r = this.validationError = this.validate(t, e) || null; - if (!r)return true; - this.trigger("invalid", this, r, i.extend(e, {validationError: r})); - return false - } - }); - var v = ["keys", "values", "pairs", "invert", "pick", "omit"]; - i.each(v, function (t) { - p.prototype[t] = function () { - var e = o.call(arguments); - e.unshift(this.attributes); - return i[t].apply(i, e) - } - }); - var g = e.Collection = function (t, e) { - e || (e = {}); - if (e.model)this.model = e.model; - if (e.comparator !== void 0)this.comparator = e.comparator; - this._reset(); - this.initialize.apply(this, arguments); - if (t)this.reset(t, i.extend({silent: true}, e)) - }; - var m = {add: true, remove: true, merge: true}; - var y = {add: true, remove: false}; - i.extend(g.prototype, u, { - model: p, initialize: function () { - }, toJSON: function (t) { - return this.map(function (e) { - return e.toJSON(t) - }) - }, sync: function () { - return e.sync.apply(this, arguments) - }, add: function (t, e) { - return this.set(t, i.extend({merge: false}, e, y)) - }, remove: function (t, e) { - var r = !i.isArray(t); - t = r ? [t] : i.clone(t); - e || (e = {}); - var s, n, a, o; - for (s = 0, n = t.length; s < n; s++) { - o = t[s] = this.get(t[s]); - if (!o)continue; - delete this._byId[o.id]; - delete this._byId[o.cid]; - a = this.indexOf(o); - this.models.splice(a, 1); - this.length--; - if (!e.silent) { - e.index = a; - o.trigger("remove", o, this, e) - } - this._removeReference(o, e) - } - return r ? t[0] : t - }, set: function (t, e) { - e = i.defaults({}, e, m); - if (e.parse)t = this.parse(t, e); - var r = !i.isArray(t); - t = r ? t ? [t] : [] : i.clone(t); - var s, n, a, o, h, u, l; - var c = e.at; - var f = this.model; - var d = this.comparator && c == null && e.sort !== false; - var v = i.isString(this.comparator) ? this.comparator : null; - var g = [], y = [], _ = {}; - var b = e.add, w = e.merge, x = e.remove; - var E = !d && b && x ? [] : false; - for (s = 0, n = t.length; s < n; s++) { - h = t[s] || {}; - if (h instanceof p) { - a = o = h - } else { - a = h[f.prototype.idAttribute || "id"] - } - if (u = this.get(a)) { - if (x)_[u.cid] = true; - if (w) { - h = h === o ? o.attributes : h; - if (e.parse)h = u.parse(h, e); - u.set(h, e); - if (d && !l && u.hasChanged(v))l = true - } - t[s] = u - } else if (b) { - o = t[s] = this._prepareModel(h, e); - if (!o)continue; - g.push(o); - this._addReference(o, e) - } - o = u || o; - if (E && (o.isNew() || !_[o.id]))E.push(o); - _[o.id] = true - } - if (x) { - for (s = 0, n = this.length; s < n; ++s) { - if (!_[(o = this.models[s]).cid])y.push(o) - } - if (y.length)this.remove(y, e) - } - if (g.length || E && E.length) { - if (d)l = true; - this.length += g.length; - if (c != null) { - for (s = 0, n = g.length; s < n; s++) { - this.models.splice(c + s, 0, g[s]) - } - } else { - if (E)this.models.length = 0; - var k = E || g; - for (s = 0, n = k.length; s < n; s++) { - this.models.push(k[s]) - } - } - } - if (l)this.sort({silent: true}); - if (!e.silent) { - for (s = 0, n = g.length; s < n; s++) { - (o = g[s]).trigger("add", o, this, e) - } - if (l || E && E.length)this.trigger("sort", this, e) - } - return r ? t[0] : t - }, reset: function (t, e) { - e || (e = {}); - for (var r = 0, s = this.models.length; r < s; r++) { - this._removeReference(this.models[r], e) - } - e.previousModels = this.models; - this._reset(); - t = this.add(t, i.extend({silent: true}, e)); - if (!e.silent)this.trigger("reset", this, e); - return t - }, push: function (t, e) { - return this.add(t, i.extend({at: this.length}, e)) - }, pop: function (t) { - var e = this.at(this.length - 1); - this.remove(e, t); - return e - }, unshift: function (t, e) { - return this.add(t, i.extend({at: 0}, e)) - }, shift: function (t) { - var e = this.at(0); - this.remove(e, t); - return e - }, slice: function () { - return o.apply(this.models, arguments) - }, get: function (t) { - if (t == null)return void 0; - return this._byId[t] || this._byId[t.id] || this._byId[t.cid] - }, at: function (t) { - return this.models[t] - }, where: function (t, e) { - if (i.isEmpty(t))return e ? void 0 : []; - return this[e ? "find" : "filter"](function (e) { - for (var i in t) { - if (t[i] !== e.get(i))return false - } - return true - }) - }, findWhere: function (t) { - return this.where(t, true) - }, sort: function (t) { - if (!this.comparator)throw new Error("Cannot sort a set without a comparator"); - t || (t = {}); - if (i.isString(this.comparator) || this.comparator.length === 1) { - this.models = this.sortBy(this.comparator, this) - } else { - this.models.sort(i.bind(this.comparator, this)) - } - if (!t.silent)this.trigger("sort", this, t); - return this - }, pluck: function (t) { - return i.invoke(this.models, "get", t) - }, fetch: function (t) { - t = t ? i.clone(t) : {}; - if (t.parse === void 0)t.parse = true; - var e = t.success; - var r = this; - t.success = function (i) { - var s = t.reset ? "reset" : "set"; - r[s](i, t); - if (e)e(r, i, t); - r.trigger("sync", r, i, t) - }; - q(this, t); - return this.sync("read", this, t) - }, create: function (t, e) { - e = e ? i.clone(e) : {}; - if (!(t = this._prepareModel(t, e)))return false; - if (!e.wait)this.add(t, e); - var r = this; - var s = e.success; - e.success = function (t, i) { - if (e.wait)r.add(t, e); - if (s)s(t, i, e) - }; - t.save(null, e); - return t - }, parse: function (t, e) { - return t - }, clone: function () { - return new this.constructor(this.models) - }, _reset: function () { - this.length = 0; - this.models = []; - this._byId = {} - }, _prepareModel: function (t, e) { - if (t instanceof p)return t; - e = e ? i.clone(e) : {}; - e.collection = this; - var r = new this.model(t, e); - if (!r.validationError)return r; - this.trigger("invalid", this, r.validationError, e); - return false - }, _addReference: function (t, e) { - this._byId[t.cid] = t; - if (t.id != null)this._byId[t.id] = t; - if (!t.collection)t.collection = this; - t.on("all", this._onModelEvent, this) - }, _removeReference: function (t, e) { - if (this === t.collection)delete t.collection; - t.off("all", this._onModelEvent, this) - }, _onModelEvent: function (t, e, i, r) { - if ((t === "add" || t === "remove") && i !== this)return; - if (t === "destroy")this.remove(e, r); - if (e && t === "change:" + e.idAttribute) { - delete this._byId[e.previous(e.idAttribute)]; - if (e.id != null)this._byId[e.id] = e - } - this.trigger.apply(this, arguments) - } - }); - var _ = ["forEach", "each", "map", "collect", "reduce", "foldl", "inject", "reduceRight", "foldr", "find", "detect", "filter", "select", "reject", "every", "all", "some", "any", "include", "contains", "invoke", "max", "min", "toArray", "size", "first", "head", "take", "initial", "rest", "tail", "drop", "last", "without", "difference", "indexOf", "shuffle", "lastIndexOf", "isEmpty", "chain", "sample"]; - i.each(_, function (t) { - g.prototype[t] = function () { - var e = o.call(arguments); - e.unshift(this.models); - return i[t].apply(i, e) - } - }); - var b = ["groupBy", "countBy", "sortBy", "indexBy"]; - i.each(b, function (t) { - g.prototype[t] = function (e, r) { - var s = i.isFunction(e) ? e : function (t) { - return t.get(e) - }; - return i[t](this.models, s, r) - } - }); - var w = e.View = function (t) { - this.cid = i.uniqueId("view"); - t || (t = {}); - i.extend(this, i.pick(t, E)); - this._ensureElement(); - this.initialize.apply(this, arguments); - this.delegateEvents() - }; - var x = /^(\S+)\s*(.*)$/; - var E = ["model", "collection", "el", "id", "attributes", "className", "tagName", "events"]; - i.extend(w.prototype, u, { - tagName: "div", $: function (t) { - return this.$el.find(t) - }, initialize: function () { - }, render: function () { - return this - }, remove: function () { - this.$el.remove(); - this.stopListening(); - return this - }, setElement: function (t, i) { - if (this.$el)this.undelegateEvents(); - this.$el = t instanceof e.$ ? t : e.$(t); - this.el = this.$el[0]; - if (i !== false)this.delegateEvents(); - return this - }, delegateEvents: function (t) { - if (!(t || (t = i.result(this, "events"))))return this; - this.undelegateEvents(); - for (var e in t) { - var r = t[e]; - if (!i.isFunction(r))r = this[t[e]]; - if (!r)continue; - var s = e.match(x); - var n = s[1], a = s[2]; - r = i.bind(r, this); - n += ".delegateEvents" + this.cid; - if (a === "") { - this.$el.on(n, r) - } else { - this.$el.on(n, a, r) - } - } - return this - }, undelegateEvents: function () { - this.$el.off(".delegateEvents" + this.cid); - return this - }, _ensureElement: function () { - if (!this.el) { - var t = i.extend({}, i.result(this, "attributes")); - if (this.id)t.id = i.result(this, "id"); - if (this.className)t["class"] = i.result(this, "className"); - var r = e.$("<" + i.result(this, "tagName") + ">").attr(t); - this.setElement(r, false) - } else { - this.setElement(i.result(this, "el"), false) - } - } - }); - e.sync = function (t, r, s) { - var n = T[t]; - i.defaults(s || (s = {}), {emulateHTTP: e.emulateHTTP, emulateJSON: e.emulateJSON}); - var a = {type: n, dataType: "json"}; - if (!s.url) { - a.url = i.result(r, "url") || M() - } - if (s.data == null && r && (t === "create" || t === "update" || t === "patch")) { - a.contentType = "application/json"; - a.data = JSON.stringify(s.attrs || r.toJSON(s)) - } - if (s.emulateJSON) { - a.contentType = "application/x-www-form-urlencoded"; - a.data = a.data ? {model: a.data} : {} - } - if (s.emulateHTTP && (n === "PUT" || n === "DELETE" || n === "PATCH")) { - a.type = "POST"; - if (s.emulateJSON)a.data._method = n; - var o = s.beforeSend; - s.beforeSend = function (t) { - t.setRequestHeader("X-HTTP-Method-Override", n); - if (o)return o.apply(this, arguments) - } - } - if (a.type !== "GET" && !s.emulateJSON) { - a.processData = false - } - if (a.type === "PATCH" && k) { - a.xhr = function () { - return new ActiveXObject("Microsoft.XMLHTTP") - } - } - var h = s.xhr = e.ajax(i.extend(a, s)); - r.trigger("request", r, h, s); - return h - }; - var k = typeof window !== "undefined" && !!window.ActiveXObject && !(window.XMLHttpRequest && (new XMLHttpRequest).dispatchEvent); - var T = {create: "POST", update: "PUT", patch: "PATCH", "delete": "DELETE", read: "GET"}; - e.ajax = function () { - return e.$.ajax.apply(e.$, arguments) - }; - var $ = e.Router = function (t) { - t || (t = {}); - if (t.routes)this.routes = t.routes; - this._bindRoutes(); - this.initialize.apply(this, arguments) - }; - var S = /\((.*?)\)/g; - var H = /(\(\?)?:\w+/g; - var A = /\*\w+/g; - var I = /[\-{}\[\]+?.,\\\^$|#\s]/g; - i.extend($.prototype, u, { - initialize: function () { - }, route: function (t, r, s) { - if (!i.isRegExp(t))t = this._routeToRegExp(t); - if (i.isFunction(r)) { - s = r; - r = "" - } - if (!s)s = this[r]; - var n = this; - e.history.route(t, function (i) { - var a = n._extractParameters(t, i); - n.execute(s, a); - n.trigger.apply(n, ["route:" + r].concat(a)); - n.trigger("route", r, a); - e.history.trigger("route", n, r, a) - }); - return this - }, execute: function (t, e) { - if (t)t.apply(this, e) - }, navigate: function (t, i) { - e.history.navigate(t, i); - return this - }, _bindRoutes: function () { - if (!this.routes)return; - this.routes = i.result(this, "routes"); - var t, e = i.keys(this.routes); - while ((t = e.pop()) != null) { - this.route(t, this.routes[t]) - } - }, _routeToRegExp: function (t) { - t = t.replace(I, "\\$&").replace(S, "(?:$1)?").replace(H, function (t, e) { - return e ? t : "([^/?]+)" - }).replace(A, "([^?]*?)"); - return new RegExp("^" + t + "(?:\\?([\\s\\S]*))?$") - }, _extractParameters: function (t, e) { - var r = t.exec(e).slice(1); - return i.map(r, function (t, e) { - if (e === r.length - 1)return t || null; - return t ? decodeURIComponent(t) : null - }) - } - }); - var N = e.History = function () { - this.handlers = []; - i.bindAll(this, "checkUrl"); - if (typeof window !== "undefined") { - this.location = window.location; - this.history = window.history - } - }; - var R = /^[#\/]|\s+$/g; - var O = /^\/+|\/+$/g; - var P = /msie [\w.]+/; - var C = /\/$/; - var j = /#.*$/; - N.started = false; - i.extend(N.prototype, u, { - interval: 50, atRoot: function () { - return this.location.pathname.replace(/[^\/]$/, "$&/") === this.root - }, getHash: function (t) { - var e = (t || this).location.href.match(/#(.*)$/); - return e ? e[1] : "" - }, getFragment: function (t, e) { - if (t == null) { - if (this._hasPushState || !this._wantsHashChange || e) { - t = decodeURI(this.location.pathname + this.location.search); - var i = this.root.replace(C, ""); - if (!t.indexOf(i))t = t.slice(i.length) - } else { - t = this.getHash() - } - } - return t.replace(R, "") - }, start: function (t) { - if (N.started)throw new Error("Backbone.history has already been started"); - N.started = true; - this.options = i.extend({root: "/"}, this.options, t); - this.root = this.options.root; - this._wantsHashChange = this.options.hashChange !== false; - this._wantsPushState = !!this.options.pushState; - this._hasPushState = !!(this.options.pushState && this.history && this.history.pushState); - var r = this.getFragment(); - var s = document.documentMode; - var n = P.exec(navigator.userAgent.toLowerCase()) && (!s || s <= 7); - this.root = ("/" + this.root + "/").replace(O, "/"); - if (n && this._wantsHashChange) { - var a = e.$('