@Test public void shouldDetectCorsBeingEnabled() { config = restConfigWith(ImmutableMap.of( RestConfig.ACCESS_CONTROL_ALLOW_ORIGIN_CONFIG, "something")); assertThat(AuthUtil.isCorsEnabled(config), is(true)); }
public static boolean isCorsEnabled(final RestConfig restConfig) { String allowedOrigins = restConfig.getString(RestConfig.ACCESS_CONTROL_ALLOW_ORIGIN_CONFIG); return !allowedOrigins.trim().isEmpty(); }
AuthUtil { public static boolean isCorsEnabled(final RestConfig restConfig) { String allowedOrigins = restConfig.getString(RestConfig.ACCESS_CONTROL_ALLOW_ORIGIN_CONFIG); return !allowedOrigins.trim().isEmpty(); } }
AuthUtil { public static boolean isCorsEnabled(final RestConfig restConfig) { String allowedOrigins = restConfig.getString(RestConfig.ACCESS_CONTROL_ALLOW_ORIGIN_CONFIG); return !allowedOrigins.trim().isEmpty(); } private  AuthUtil(); }
AuthUtil { public static boolean isCorsEnabled(final RestConfig restConfig) { String allowedOrigins = restConfig.getString(RestConfig.ACCESS_CONTROL_ALLOW_ORIGIN_CONFIG); return !allowedOrigins.trim().isEmpty(); } private  AuthUtil(); static boolean isCorsEnabled(final RestConfig restConfig); static boolean isSkipOptionsAuth(final RestConfig restConfig); static ConstraintMapping createGlobalAuthConstraint(final RestConfig restConfig); static ConstraintMapping createSecuredConstraint(
      final RestConfig restConfig,
      final String pathSpec
  ); static ConstraintMapping createUnsecuredConstraint(
      final RestConfig restConfig,
      final String pathSpec
  ); static List<ConstraintMapping> createUnsecuredConstraints(final RestConfig restConfig); }
AuthUtil { public static boolean isCorsEnabled(final RestConfig restConfig) { String allowedOrigins = restConfig.getString(RestConfig.ACCESS_CONTROL_ALLOW_ORIGIN_CONFIG); return !allowedOrigins.trim().isEmpty(); } private  AuthUtil(); static boolean isCorsEnabled(final RestConfig restConfig); static boolean isSkipOptionsAuth(final RestConfig restConfig); static ConstraintMapping createGlobalAuthConstraint(final RestConfig restConfig); static ConstraintMapping createSecuredConstraint(
      final RestConfig restConfig,
      final String pathSpec
  ); static ConstraintMapping createUnsecuredConstraint(
      final RestConfig restConfig,
      final String pathSpec
  ); static List<ConstraintMapping> createUnsecuredConstraints(final RestConfig restConfig);  }