mirror of
https://github.com/jlengrand/openapi-generator.git
synced 2026-05-16 08:31:26 +00:00
Refactor auth method naming, add comments
This commit is contained in:
@@ -39,7 +39,7 @@ public class ApiKeyAuth implements Authentication {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processParams(Map<String, String> queryParams, Map<String, String> headerParams) {
|
||||
public void applyToParams(Map<String, String> queryParams, Map<String, String> headerParams) {
|
||||
String value;
|
||||
if (apiKeyPrefix != null) {
|
||||
value = apiKeyPrefix + " " + apiKey;
|
||||
|
||||
@@ -3,5 +3,6 @@ package {{invokerPackage}}.auth;
|
||||
import java.util.Map;
|
||||
|
||||
public interface Authentication {
|
||||
void processParams(Map<String, String> queryParams, Map<String, String> headerParams);
|
||||
/** Apply authentication settings to header and query params. */
|
||||
void applyToParams(Map<String, String> queryParams, Map<String, String> headerParams);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ public class HttpBasicAuth implements Authentication {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processParams(Map<String, String> queryParams, Map<String, String> headerParams) {
|
||||
public void applyToParams(Map<String, String> queryParams, Map<String, String> headerParams) {
|
||||
try {
|
||||
headerParams.put("Authorization", "Basic " + DatatypeConverter.printBase64Binary((username + ":" + password).getBytes("UTF-8")));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import java.util.Map;
|
||||
|
||||
public class OAuth implements Authentication {
|
||||
@Override
|
||||
public void processParams(Map<String, String> queryParams, Map<String, String> headerParams) {
|
||||
public void applyToParams(Map<String, String> queryParams, Map<String, String> headerParams) {
|
||||
// TODO: support oauth
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user