Class AppSecConfiguration

java.lang.Object
com.vaadin.appsec.backend.AppSecConfiguration
All Implemented Interfaces:
Serializable

public class AppSecConfiguration extends Object implements Serializable
Configuration settings for AppSec Kit.

An instance of this class can be set to configure AppSecService with {@link AppSecService#setConfiguration(AppSecConfiguration).

See Also:
  • Constructor Details

    • AppSecConfiguration

      public AppSecConfiguration()
  • Method Details

    • getAppSecRoute

      public String getAppSecRoute()
      Gets the AppSec Kit route.
      Returns:
      the AppSec Kit route, not null
    • setAppSecRoute

      public void setAppSecRoute(String appSecRoute)
      Sets the AppSec Kit route.
      Parameters:
      appSecRoute - the AppSec Kit route, not null. By default, vaadin-appsec-kit
    • getDataFilePath

      public Path getDataFilePath()
      Gets the data-file path.
      Returns:
      the data-file path, not null
    • setDataFilePath

      public void setDataFilePath(Path dataFilePath)
      Sets the data-file path.
      Parameters:
      dataFilePath - the data-file path, not null
    • getBomFilePath

      public Path getBomFilePath()
      Gets the Maven BOM-file path.
      Returns:
      the Maven BOM-file path, not null
    • setBomFilePath

      public void setBomFilePath(Path bomFilePath)
      Sets the Maven BOM-file path.
      Parameters:
      bomFilePath - the Maven BOM-file path, not null
    • getBomNpmFilePath

      public Path getBomNpmFilePath()
      Gets the npm BOM-file path.
      Returns:
      the npm BOM-file path, not null
    • setBomNpmFilePath

      public void setBomNpmFilePath(Path bomNpmFilePath)
      Sets the npm BOM-file path.
      Parameters:
      bomNpmFilePath - the npm BOM-file path, not null
    • getTaskExecutor

      public ScheduledExecutorService getTaskExecutor()
      Gets the executor used to run asynchronous tasks.
      Returns:
      the task executor
    • setTaskExecutor

      public void setTaskExecutor(ScheduledExecutorService taskExecutor)
      Sets the executor used to run asynchronous tasks.
      Parameters:
      taskExecutor - the task executor
    • getAutoScanInterval

      public Duration getAutoScanInterval()
      Gets the duration of the interval between automatic scanning for vulnerabilities.
      Returns:
      the duration of the interval between automatic scanning
    • setAutoScanInterval

      public void setAutoScanInterval(Duration autoScanInterval)
      Sets the duration of the interval between automatic scanning for vulnerabilities. The default interval is 1 day.

      A custom interval can be created using Duration.of(long, java.time.temporal.TemporalUnit).

      Parameters:
      autoScanInterval - the duration of the interval between automatic scanning
    • getOsvApiRatePerSecond

      public int getOsvApiRatePerSecond()
      Gets the rate per second value for the OpenSourceVulnerability API calls.
      Returns:
      the rate per second value for the OpenSourceVulnerability API calls
    • setOsvApiRatePerSecond

      public void setOsvApiRatePerSecond(int osvApiRatePerSecond)
      Sets the rate per second value for the OpenSourceVulnerability API calls.
      Parameters:
      osvApiRatePerSecond - the rate per second value for the OpenSourceVulnerability API calls
    • isIncludeNpmDevDependencies

      public boolean isIncludeNpmDevDependencies()
      Gets if the npm development dependencies should be included during vulnerability scanning.
      Returns:
      true if the npm development dependencies should be included during vulnerability scanning, otherwise false
    • setIncludeNpmDevDependencies

      public void setIncludeNpmDevDependencies(boolean includeNpmDevDependencies)
      Sets if the npm development dependencies should be included during vulnerability scanning.
      Parameters:
      includeNpmDevDependencies - true if the npm development dependencies should be included during vulnerability scanning, otherwise false
    • setAutomaticallyActivatePush

      public void setAutomaticallyActivatePush(boolean automaticallyActivatePush)
      Sets whether server push should be automatically activated if needed. When enabled, which is the default, AppSec Kit will automatically activate PushMode#AUTOMATIC if neither push nor polling is active for a UI where AppSec Kit is used. When disabled, no automatic changes are made to the application's push configuration.
      Parameters:
      automaticallyActivatePush - true to automatically activate server push if needed, false to not make any automatic changes to the push configuration
    • isAutomaticallyActivatePush

      public boolean isAutomaticallyActivatePush()
      Checks whether automatic push activation is enabled.
      Returns:
      true if automatic server push configuration is enabled, false if it's no enabled
      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class Object