mirror of
https://github.com/jlengrand/openapi-generator.git
synced 2026-05-16 15:54:31 +00:00
Refactored Pairs to use List instead of Set.
This commit is contained in:
@@ -3,7 +3,7 @@ package {{invokerPackage}}.auth;
|
||||
import {{invokerPackage}}.Pair;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.List;
|
||||
|
||||
public class ApiKeyAuth implements Authentication {
|
||||
private final String location;
|
||||
@@ -42,7 +42,7 @@ public class ApiKeyAuth implements Authentication {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyToParams(Set<Pair> queryParams, Map<String, String> headerParams) {
|
||||
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams) {
|
||||
String value;
|
||||
if (apiKeyPrefix != null) {
|
||||
value = apiKeyPrefix + " " + apiKey;
|
||||
|
||||
@@ -3,9 +3,9 @@ package {{invokerPackage}}.auth;
|
||||
import {{invokerPackage}}.Pair;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.List;
|
||||
|
||||
public interface Authentication {
|
||||
/** Apply authentication settings to header and query params. */
|
||||
void applyToParams(Set<Pair> queryParams, Map<String, String> headerParams);
|
||||
void applyToParams(List<Pair> queryParams, Map<String, String> headerParams);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package {{invokerPackage}}.auth;
|
||||
import {{invokerPackage}}.Pair;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.List;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import javax.xml.bind.DatatypeConverter;
|
||||
@@ -29,7 +29,7 @@ public class HttpBasicAuth implements Authentication {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyToParams(Set<Pair> queryParams, Map<String, String> headerParams) {
|
||||
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams) {
|
||||
String str = (username == null ? "" : username) + ":" + (password == null ? "" : password);
|
||||
try {
|
||||
headerParams.put("Authorization", "Basic " + DatatypeConverter.printBase64Binary(str.getBytes("UTF-8")));
|
||||
|
||||
@@ -3,11 +3,11 @@ package {{invokerPackage}}.auth;
|
||||
import {{invokerPackage}}.Pair;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.List;
|
||||
|
||||
public class OAuth implements Authentication {
|
||||
@Override
|
||||
public void applyToParams(Set<Pair> queryParams, Map<String, String> headerParams) {
|
||||
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams) {
|
||||
// TODO: support oauth
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user