All Downloads are FREE. Search and download functionalities are using the official Maven repository.

datadog.appsec.api.blocking.BlockingService Maven / Gradle / Ivy

There is a newer version: 1.42.2
Show newest version
package datadog.appsec.api.blocking;

import java.util.Map;
import javax.annotation.Nonnull;

public interface BlockingService {
  BlockingService NOOP = new BlockingServiceNoop();

  BlockingDetails shouldBlockUser(@Nonnull String userId);

  boolean tryCommitBlockingResponse(
      int statusCode, @Nonnull BlockingContentType type, @Nonnull Map extraHeaders);

  class BlockingServiceNoop implements BlockingService {
    private BlockingServiceNoop() {}

    @Override
    public BlockingDetails shouldBlockUser(@Nonnull String userId) {
      return null;
    }

    @Override
    public boolean tryCommitBlockingResponse(
        int statusCode,
        @Nonnull BlockingContentType type,
        @Nonnull Map extraHeaders) {
      return false;
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy