Skip to content

Commit

Permalink
Revert "feat(multiple-auth): add support for multiple auth (#51)"
Browse files Browse the repository at this point in the history
This reverts commit f16afbe.
  • Loading branch information
sufyankhanrao committed Dec 8, 2023
1 parent 65622a8 commit ac9ca40
Showing 1 changed file with 7 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,59 +5,17 @@
/**
* To setup methods for authentication
*/
public abstract class Authentication {
public interface Authentication {

/**
* Stores the validity of the auth scheme.
* Apply the authentication on the httpRequest
* @param httpRequest the request on which authentication is being applied
* @return the authenticated request
*/
private boolean isValid;
Request apply(Request httpRequest);

/**
* Stores the error message for the auth scheme.
* Validates the auth params for the httpRequest
*/
private String errorMessage;

/**
* Applies the authentication on the httpRequest.
* @param httpRequest the request on which authentication is being applied.
* @return the authenticated request.
*/
public abstract Request apply(Request httpRequest);

/**
* Validates the credentials for authentication.
*/
public abstract void validate();

/**
* Checks if the auth credentials are valid.
* @return true if the auth credentials are valid, false otherwise.
*/
public boolean isValid() {
return isValid;
}

/**
* Sets the validatity of the auth credentials.
* @param isValid the flag to set for validity.
*/
public void setValidity(boolean isValid) {
this.isValid = isValid;
}

/**
* Returns the error message if the auth credentials are not valid.
* @return the string message whenever the auth credentials are not valid.
*/
public String getErrorMessage() {
return errorMessage;
}

/**
* Sets the error message for invalid auth credentials.
* @param errorMessage the error message to set.
*/
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
void validate();
}

0 comments on commit ac9ca40

Please sign in to comment.