forked from loafle/openapi-generator-original
parent
44ae981830
commit
97c1dc8a1a
@ -652,6 +652,29 @@ public class ApiClient {
|
|||||||
throw new RuntimeException("No AWS4 authentication configured!");
|
throw new RuntimeException("No AWS4 authentication configured!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper method to set credentials for AWSV4 Signature
|
||||||
|
*
|
||||||
|
* @param accessKey Access Key
|
||||||
|
* @param secretKey Secret Key
|
||||||
|
* @param sessionToken Session Token
|
||||||
|
* @param region Region
|
||||||
|
* @param service Service to access to
|
||||||
|
*/
|
||||||
|
public void setAWS4Configuration(String accessKey, String secretKey, String sessionToken, String region, String service) {
|
||||||
|
{{#withAWSV4Signature}}
|
||||||
|
for (Authentication auth : authentications.values()) {
|
||||||
|
if (auth instanceof AWS4Auth) {
|
||||||
|
((AWS4Auth) auth).setCredentials(accessKey, secretKey, sessionToken);
|
||||||
|
((AWS4Auth) auth).setRegion(region);
|
||||||
|
((AWS4Auth) auth).setService(service);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{{/withAWSV4Signature}}
|
||||||
|
throw new RuntimeException("No AWS4 authentication configured!");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the User-Agent header's value (by adding to the default header map).
|
* Set the User-Agent header's value (by adding to the default header map).
|
||||||
*
|
*
|
||||||
|
@ -16,6 +16,7 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
import software.amazon.awssdk.auth.credentials.AnonymousCredentialsProvider;
|
import software.amazon.awssdk.auth.credentials.AnonymousCredentialsProvider;
|
||||||
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
|
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
|
||||||
|
import software.amazon.awssdk.auth.credentials.AwsSessionCredentials;
|
||||||
import software.amazon.awssdk.auth.credentials.AwsCredentials;
|
import software.amazon.awssdk.auth.credentials.AwsCredentials;
|
||||||
import software.amazon.awssdk.auth.signer.Aws4Signer;
|
import software.amazon.awssdk.auth.signer.Aws4Signer;
|
||||||
import software.amazon.awssdk.auth.signer.params.Aws4SignerParams;
|
import software.amazon.awssdk.auth.signer.params.Aws4SignerParams;
|
||||||
@ -41,6 +42,10 @@ public class AWS4Auth implements Authentication {
|
|||||||
this.credentials = AwsBasicCredentials.create(accessKey, secretKey);
|
this.credentials = AwsBasicCredentials.create(accessKey, secretKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setCredentials(String accessKey, String secretKey, String sessionToken) {
|
||||||
|
this.credentials = AwsSessionCredentials.create(accessKey, secretKey, sessionToken);
|
||||||
|
}
|
||||||
|
|
||||||
public void setRegion(String region) {
|
public void setRegion(String region) {
|
||||||
this.region = region;
|
this.region = region;
|
||||||
}
|
}
|
||||||
|
@ -491,6 +491,19 @@ public class ApiClient {
|
|||||||
throw new RuntimeException("No AWS4 authentication configured!");
|
throw new RuntimeException("No AWS4 authentication configured!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper method to set credentials for AWSV4 Signature
|
||||||
|
*
|
||||||
|
* @param accessKey Access Key
|
||||||
|
* @param secretKey Secret Key
|
||||||
|
* @param sessionToken Session Token
|
||||||
|
* @param region Region
|
||||||
|
* @param service Service to access to
|
||||||
|
*/
|
||||||
|
public void setAWS4Configuration(String accessKey, String secretKey, String sessionToken, String region, String service) {
|
||||||
|
throw new RuntimeException("No AWS4 authentication configured!");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the User-Agent header's value (by adding to the default header map).
|
* Set the User-Agent header's value (by adding to the default header map).
|
||||||
*
|
*
|
||||||
|
@ -465,6 +465,19 @@ public class ApiClient {
|
|||||||
throw new RuntimeException("No AWS4 authentication configured!");
|
throw new RuntimeException("No AWS4 authentication configured!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper method to set credentials for AWSV4 Signature
|
||||||
|
*
|
||||||
|
* @param accessKey Access Key
|
||||||
|
* @param secretKey Secret Key
|
||||||
|
* @param sessionToken Session Token
|
||||||
|
* @param region Region
|
||||||
|
* @param service Service to access to
|
||||||
|
*/
|
||||||
|
public void setAWS4Configuration(String accessKey, String secretKey, String sessionToken, String region, String service) {
|
||||||
|
throw new RuntimeException("No AWS4 authentication configured!");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the User-Agent header's value (by adding to the default header map).
|
* Set the User-Agent header's value (by adding to the default header map).
|
||||||
*
|
*
|
||||||
|
@ -465,6 +465,19 @@ public class ApiClient {
|
|||||||
throw new RuntimeException("No AWS4 authentication configured!");
|
throw new RuntimeException("No AWS4 authentication configured!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper method to set credentials for AWSV4 Signature
|
||||||
|
*
|
||||||
|
* @param accessKey Access Key
|
||||||
|
* @param secretKey Secret Key
|
||||||
|
* @param sessionToken Session Token
|
||||||
|
* @param region Region
|
||||||
|
* @param service Service to access to
|
||||||
|
*/
|
||||||
|
public void setAWS4Configuration(String accessKey, String secretKey, String sessionToken, String region, String service) {
|
||||||
|
throw new RuntimeException("No AWS4 authentication configured!");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the User-Agent header's value (by adding to the default header map).
|
* Set the User-Agent header's value (by adding to the default header map).
|
||||||
*
|
*
|
||||||
|
@ -547,6 +547,19 @@ public class ApiClient {
|
|||||||
throw new RuntimeException("No AWS4 authentication configured!");
|
throw new RuntimeException("No AWS4 authentication configured!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper method to set credentials for AWSV4 Signature
|
||||||
|
*
|
||||||
|
* @param accessKey Access Key
|
||||||
|
* @param secretKey Secret Key
|
||||||
|
* @param sessionToken Session Token
|
||||||
|
* @param region Region
|
||||||
|
* @param service Service to access to
|
||||||
|
*/
|
||||||
|
public void setAWS4Configuration(String accessKey, String secretKey, String sessionToken, String region, String service) {
|
||||||
|
throw new RuntimeException("No AWS4 authentication configured!");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the User-Agent header's value (by adding to the default header map).
|
* Set the User-Agent header's value (by adding to the default header map).
|
||||||
*
|
*
|
||||||
|
@ -559,6 +559,27 @@ public class ApiClient {
|
|||||||
throw new RuntimeException("No AWS4 authentication configured!");
|
throw new RuntimeException("No AWS4 authentication configured!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper method to set credentials for AWSV4 Signature
|
||||||
|
*
|
||||||
|
* @param accessKey Access Key
|
||||||
|
* @param secretKey Secret Key
|
||||||
|
* @param sessionToken Session Token
|
||||||
|
* @param region Region
|
||||||
|
* @param service Service to access to
|
||||||
|
*/
|
||||||
|
public void setAWS4Configuration(String accessKey, String secretKey, String sessionToken, String region, String service) {
|
||||||
|
for (Authentication auth : authentications.values()) {
|
||||||
|
if (auth instanceof AWS4Auth) {
|
||||||
|
((AWS4Auth) auth).setCredentials(accessKey, secretKey, sessionToken);
|
||||||
|
((AWS4Auth) auth).setRegion(region);
|
||||||
|
((AWS4Auth) auth).setService(service);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new RuntimeException("No AWS4 authentication configured!");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the User-Agent header's value (by adding to the default header map).
|
* Set the User-Agent header's value (by adding to the default header map).
|
||||||
*
|
*
|
||||||
|
@ -27,6 +27,7 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
import software.amazon.awssdk.auth.credentials.AnonymousCredentialsProvider;
|
import software.amazon.awssdk.auth.credentials.AnonymousCredentialsProvider;
|
||||||
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
|
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
|
||||||
|
import software.amazon.awssdk.auth.credentials.AwsSessionCredentials;
|
||||||
import software.amazon.awssdk.auth.credentials.AwsCredentials;
|
import software.amazon.awssdk.auth.credentials.AwsCredentials;
|
||||||
import software.amazon.awssdk.auth.signer.Aws4Signer;
|
import software.amazon.awssdk.auth.signer.Aws4Signer;
|
||||||
import software.amazon.awssdk.auth.signer.params.Aws4SignerParams;
|
import software.amazon.awssdk.auth.signer.params.Aws4SignerParams;
|
||||||
@ -52,6 +53,10 @@ public class AWS4Auth implements Authentication {
|
|||||||
this.credentials = AwsBasicCredentials.create(accessKey, secretKey);
|
this.credentials = AwsBasicCredentials.create(accessKey, secretKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setCredentials(String accessKey, String secretKey, String sessionToken) {
|
||||||
|
this.credentials = AwsSessionCredentials.create(accessKey, secretKey, sessionToken);
|
||||||
|
}
|
||||||
|
|
||||||
public void setRegion(String region) {
|
public void setRegion(String region) {
|
||||||
this.region = region;
|
this.region = region;
|
||||||
}
|
}
|
||||||
|
@ -564,6 +564,19 @@ public class ApiClient {
|
|||||||
throw new RuntimeException("No AWS4 authentication configured!");
|
throw new RuntimeException("No AWS4 authentication configured!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper method to set credentials for AWSV4 Signature
|
||||||
|
*
|
||||||
|
* @param accessKey Access Key
|
||||||
|
* @param secretKey Secret Key
|
||||||
|
* @param sessionToken Session Token
|
||||||
|
* @param region Region
|
||||||
|
* @param service Service to access to
|
||||||
|
*/
|
||||||
|
public void setAWS4Configuration(String accessKey, String secretKey, String sessionToken, String region, String service) {
|
||||||
|
throw new RuntimeException("No AWS4 authentication configured!");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the User-Agent header's value (by adding to the default header map).
|
* Set the User-Agent header's value (by adding to the default header map).
|
||||||
*
|
*
|
||||||
|
@ -547,6 +547,19 @@ public class ApiClient {
|
|||||||
throw new RuntimeException("No AWS4 authentication configured!");
|
throw new RuntimeException("No AWS4 authentication configured!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper method to set credentials for AWSV4 Signature
|
||||||
|
*
|
||||||
|
* @param accessKey Access Key
|
||||||
|
* @param secretKey Secret Key
|
||||||
|
* @param sessionToken Session Token
|
||||||
|
* @param region Region
|
||||||
|
* @param service Service to access to
|
||||||
|
*/
|
||||||
|
public void setAWS4Configuration(String accessKey, String secretKey, String sessionToken, String region, String service) {
|
||||||
|
throw new RuntimeException("No AWS4 authentication configured!");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the User-Agent header's value (by adding to the default header map).
|
* Set the User-Agent header's value (by adding to the default header map).
|
||||||
*
|
*
|
||||||
|
@ -550,6 +550,19 @@ public class ApiClient {
|
|||||||
throw new RuntimeException("No AWS4 authentication configured!");
|
throw new RuntimeException("No AWS4 authentication configured!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper method to set credentials for AWSV4 Signature
|
||||||
|
*
|
||||||
|
* @param accessKey Access Key
|
||||||
|
* @param secretKey Secret Key
|
||||||
|
* @param sessionToken Session Token
|
||||||
|
* @param region Region
|
||||||
|
* @param service Service to access to
|
||||||
|
*/
|
||||||
|
public void setAWS4Configuration(String accessKey, String secretKey, String sessionToken, String region, String service) {
|
||||||
|
throw new RuntimeException("No AWS4 authentication configured!");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the User-Agent header's value (by adding to the default header map).
|
* Set the User-Agent header's value (by adding to the default header map).
|
||||||
*
|
*
|
||||||
|
@ -553,6 +553,19 @@ public class ApiClient {
|
|||||||
throw new RuntimeException("No AWS4 authentication configured!");
|
throw new RuntimeException("No AWS4 authentication configured!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper method to set credentials for AWSV4 Signature
|
||||||
|
*
|
||||||
|
* @param accessKey Access Key
|
||||||
|
* @param secretKey Secret Key
|
||||||
|
* @param sessionToken Session Token
|
||||||
|
* @param region Region
|
||||||
|
* @param service Service to access to
|
||||||
|
*/
|
||||||
|
public void setAWS4Configuration(String accessKey, String secretKey, String sessionToken, String region, String service) {
|
||||||
|
throw new RuntimeException("No AWS4 authentication configured!");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the User-Agent header's value (by adding to the default header map).
|
* Set the User-Agent header's value (by adding to the default header map).
|
||||||
*
|
*
|
||||||
|
@ -547,6 +547,19 @@ public class ApiClient {
|
|||||||
throw new RuntimeException("No AWS4 authentication configured!");
|
throw new RuntimeException("No AWS4 authentication configured!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper method to set credentials for AWSV4 Signature
|
||||||
|
*
|
||||||
|
* @param accessKey Access Key
|
||||||
|
* @param secretKey Secret Key
|
||||||
|
* @param sessionToken Session Token
|
||||||
|
* @param region Region
|
||||||
|
* @param service Service to access to
|
||||||
|
*/
|
||||||
|
public void setAWS4Configuration(String accessKey, String secretKey, String sessionToken, String region, String service) {
|
||||||
|
throw new RuntimeException("No AWS4 authentication configured!");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the User-Agent header's value (by adding to the default header map).
|
* Set the User-Agent header's value (by adding to the default header map).
|
||||||
*
|
*
|
||||||
|
@ -547,6 +547,19 @@ public class ApiClient {
|
|||||||
throw new RuntimeException("No AWS4 authentication configured!");
|
throw new RuntimeException("No AWS4 authentication configured!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper method to set credentials for AWSV4 Signature
|
||||||
|
*
|
||||||
|
* @param accessKey Access Key
|
||||||
|
* @param secretKey Secret Key
|
||||||
|
* @param sessionToken Session Token
|
||||||
|
* @param region Region
|
||||||
|
* @param service Service to access to
|
||||||
|
*/
|
||||||
|
public void setAWS4Configuration(String accessKey, String secretKey, String sessionToken, String region, String service) {
|
||||||
|
throw new RuntimeException("No AWS4 authentication configured!");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the User-Agent header's value (by adding to the default header map).
|
* Set the User-Agent header's value (by adding to the default header map).
|
||||||
*
|
*
|
||||||
|
@ -621,6 +621,19 @@ public class ApiClient {
|
|||||||
throw new RuntimeException("No AWS4 authentication configured!");
|
throw new RuntimeException("No AWS4 authentication configured!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper method to set credentials for AWSV4 Signature
|
||||||
|
*
|
||||||
|
* @param accessKey Access Key
|
||||||
|
* @param secretKey Secret Key
|
||||||
|
* @param sessionToken Session Token
|
||||||
|
* @param region Region
|
||||||
|
* @param service Service to access to
|
||||||
|
*/
|
||||||
|
public void setAWS4Configuration(String accessKey, String secretKey, String sessionToken, String region, String service) {
|
||||||
|
throw new RuntimeException("No AWS4 authentication configured!");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the User-Agent header's value (by adding to the default header map).
|
* Set the User-Agent header's value (by adding to the default header map).
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user