Skip to content

Commit 7599199

Browse files
Revert "feat(multiple-auth): add support for multiple auth (#51)"
This reverts commit f16afbe.
1 parent 65a347b commit 7599199

1 file changed

Lines changed: 7 additions & 49 deletions

File tree

src/main/java/io/apimatic/coreinterfaces/authentication/Authentication.java

Lines changed: 7 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -5,59 +5,17 @@
55
/**
66
* To setup methods for authentication
77
*/
8-
public abstract class Authentication {
8+
public interface Authentication {
99

1010
/**
11-
* Stores the validity of the auth scheme.
11+
* Apply the authentication on the httpRequest
12+
* @param httpRequest the request on which authentication is being applied
13+
* @return the authenticated request
1214
*/
13-
private boolean isValid;
15+
Request apply(Request httpRequest);
1416

1517
/**
16-
* Stores the error message for the auth scheme.
18+
* Validates the auth params for the httpRequest
1719
*/
18-
private String errorMessage;
19-
20-
/**
21-
* Applies the authentication on the httpRequest.
22-
* @param httpRequest the request on which authentication is being applied.
23-
* @return the authenticated request.
24-
*/
25-
public abstract Request apply(Request httpRequest);
26-
27-
/**
28-
* Validates the credentials for authentication.
29-
*/
30-
public abstract void validate();
31-
32-
/**
33-
* Checks if the auth credentials are valid.
34-
* @return true if the auth credentials are valid, false otherwise.
35-
*/
36-
public boolean isValid() {
37-
return isValid;
38-
}
39-
40-
/**
41-
* Sets the validatity of the auth credentials.
42-
* @param isValid the flag to set for validity.
43-
*/
44-
public void setValidity(boolean isValid) {
45-
this.isValid = isValid;
46-
}
47-
48-
/**
49-
* Returns the error message if the auth credentials are not valid.
50-
* @return the string message whenever the auth credentials are not valid.
51-
*/
52-
public String getErrorMessage() {
53-
return errorMessage;
54-
}
55-
56-
/**
57-
* Sets the error message for invalid auth credentials.
58-
* @param errorMessage the error message to set.
59-
*/
60-
public void setErrorMessage(String errorMessage) {
61-
this.errorMessage = errorMessage;
62-
}
20+
void validate();
6321
}

0 commit comments

Comments
 (0)