Interface DuoAdminClient

All Known Implementing Classes:
DefaultDuoAdminClient

public interface DuoAdminClient
A client that supports retrieval of information from the Duo Admin API.

Clients should be thread-safe and re-usable.

Since:
2.1.0
  • Method Details

    • getUser

      @Nullable User getUser(@Nonnull ProfileRequestContext context, @Nonnull @NotEmpty String username) throws DuoException
      Get the User that corresponds to the given username from the Duo Admin API.
      Parameters:
      context - context the profile request context, typically used in locating the DuoIntegration to use
      username - a user name (or username alias) to look up a single user
      Returns:
      the User iff found, or null
      Throws:
      DuoException - on error retrieving a response from the API
    • retrieve

      @Nonnull <T extends DuoAdminResponseWrapper<?>> T retrieve(@Nonnull ProfileRequestContext context, @Nonnull @NotEmpty String path, @Nullable @NonnullElements Map<String,String> parameters, @Nonnull com.fasterxml.jackson.core.type.TypeReference<T> wrapperTypeRef) throws DuoException
      Generic method for returning a type of DuoAdminResponseWrapper response from the given path and parameters.

      Note, only GET requests should be allowed and hence only retrieval operations should be supported.

      Type Parameters:
      T - the type of response
      Parameters:
      context - the profile request context, typically used in locating the DuoIntegration to use
      path - the path component of the API endpoint
      parameters - any name value pairs to add to the HTTP request parameters
      wrapperTypeRef - the type of response to return
      Returns:
      a DuoAdminResponseWrapper with the correct response type embedded
      Throws:
      DuoException - on error retrieving a response from the API
    • retrieve

      @Nonnull DuoAdminListMapResponseWrapper retrieve(@Nonnull ProfileRequestContext context, @Nonnull @NotEmpty String path, @Nullable @NonnullElements Map<String,String> parameters) throws DuoException
      Generic method for returning a DuoAdminListMapResponseWrapper response from the given path and parameters.

      Note, only GET requests should be allowed and hence only retrieval operations should be supported.

      Parameters:
      context - the profile request context, typically used in locating the DuoIntegration to use
      path - the path component of the API endpoint
      parameters - any name value pairs to add to the HTTP request parameters
      Returns:
      a DuoAdminListMapResponseWrapper with a List of Maps response type embedded
      Throws:
      DuoException - on error retrieving a response from the API