Class DefaultAuthVerifierImpl

java.lang.Object
com.amilesend.discogs.connection.auth.DefaultAuthVerifierImpl
All Implemented Interfaces:
AuthVerifier

public class DefaultAuthVerifierImpl extends Object implements AuthVerifier
Helper to verify authentication defined for specific API calls to fail early if not configured for required calls.

Note: This class checks the call stack for classes annotated with the Api annotation. Next, it checks the method to see if it is annotated with either AuthenticationRequired or AuthenticationOptional. If auth is required, then an AuthException is thrown; else, an info log statement is recorded.

See Also:
  • Constructor Details

    • DefaultAuthVerifierImpl

      public DefaultAuthVerifierImpl()
      Creates a new DefaultAuthVerifierImpl instance with the default settings configured.
  • Method Details

    • checkIfAuthenticated

      public void checkIfAuthenticated(com.amilesend.client.connection.auth.AuthManager<?> authManager)
      Description copied from interface: AuthVerifier
      Checks to see if the given invocation has proper authorization configured prior to invoking the API.
      Specified by:
      checkIfAuthenticated in interface AuthVerifier
      Parameters:
      authManager - the configured authorization manager instance for the client connection