Interface PluginBuildServerProvider


public interface PluginBuildServerProvider
Build Server Provider SPI.

Provides the ability for a plugin to be a "build server provider"; that is a plugin that provides the ability to access and manage build jobs on a build/automation server.

Since:
7.8
  • Method Details

    • getBuildServer

      Optional<PluginBuildServer> getBuildServer(@Nonnull String id)
      Get the PluginBuildServer for the given ID.
      Parameters:
      id - the ID of the build server to get
      Returns:
      the associated PluginBuildServer, or Optional.empty() if there is no build server for the given ID
    • getBuildServer

      @Nonnull Optional<PluginBuildServer> getBuildServer(@Nonnull javax.servlet.http.HttpServletRequest servletRequest, @Nonnull Map<String,Object> requestBody)
      Given a request, identify the build server that made the request.

      This is used to establish the concept of a trusted build status. A build status must be verified/trusted for the purposes of certain functions such as:

      • Presenting a list of downloadable build artifacts
      • Permitting actions such as running a build from Bitbucket
      Without establishing the authenticity of a build status, fraudulent build status reports may represent a security risk. As such it is critical that that method only return a build server if, and only if, the authenticity of the build status can be validated. If authenticity cannot be validated then this method MUST return Optional.empty().
      Parameters:
      servletRequest - the request for which the requester will be determined
      requestBody - a map of all fields included in the build status request, fields of this map can be used to verify the build server
      Returns:
      An Optional containing the build server if the request can be validated as certainly originating from that build server. If the request cannot be validated as coming from a known/trusted build server this provider is responsible for, then Optional.empty() is returned.