-
Notifications
You must be signed in to change notification settings - Fork 861
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Multi Auth Sihv4a for Service metadata
- Loading branch information
Showing
7 changed files
with
257 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...n/awssdk/codegen/poet/auth/scheme/ops-auth-sigv4a-value-auth-scheme-default-provider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package software.amazon.awssdk.services.database.auth.scheme.internal; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collections; | ||
import java.util.List; | ||
import software.amazon.awssdk.annotations.Generated; | ||
import software.amazon.awssdk.annotations.SdkInternalApi; | ||
import software.amazon.awssdk.http.auth.aws.signer.AwsV4HttpSigner; | ||
import software.amazon.awssdk.http.auth.aws.signer.AwsV4aHttpSigner; | ||
import software.amazon.awssdk.http.auth.spi.scheme.AuthSchemeOption; | ||
import software.amazon.awssdk.services.database.auth.scheme.DatabaseAuthSchemeParams; | ||
import software.amazon.awssdk.services.database.auth.scheme.DatabaseAuthSchemeProvider; | ||
|
||
@Generated("software.amazon.awssdk:codegen") | ||
@SdkInternalApi | ||
public final class DefaultDatabaseAuthSchemeProvider implements DatabaseAuthSchemeProvider { | ||
private static final DefaultDatabaseAuthSchemeProvider DEFAULT = new DefaultDatabaseAuthSchemeProvider(); | ||
|
||
private DefaultDatabaseAuthSchemeProvider() { | ||
} | ||
|
||
public static DefaultDatabaseAuthSchemeProvider create() { | ||
return DEFAULT; | ||
} | ||
|
||
@Override | ||
public List<AuthSchemeOption> resolveAuthScheme(DatabaseAuthSchemeParams params) { | ||
List<AuthSchemeOption> options = new ArrayList<>(); | ||
switch (params.operation()) { | ||
case "DeleteRow": | ||
case "PutRow": | ||
options.add(AuthSchemeOption.builder().schemeId("aws.auth#sigv4") | ||
.putSignerProperty(AwsV4HttpSigner.SERVICE_SIGNING_NAME, "database-service") | ||
.putSignerProperty(AwsV4HttpSigner.REGION_NAME, params.region().id()).build()); | ||
break; | ||
default: | ||
options.add(AuthSchemeOption.builder().schemeId("aws.auth#sigv4a") | ||
.putSignerProperty(AwsV4aHttpSigner.SERVICE_SIGNING_NAME, "database-service") | ||
.putSignerProperty(AwsV4aHttpSigner.REGION_SET, params.regionSet()).build()); | ||
options.add(AuthSchemeOption.builder().schemeId("aws.auth#sigv4") | ||
.putSignerProperty(AwsV4HttpSigner.SERVICE_SIGNING_NAME, "database-service") | ||
.putSignerProperty(AwsV4HttpSigner.REGION_NAME, params.region().id()).build()); | ||
break; | ||
} | ||
return Collections.unmodifiableList(options); | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
...are/amazon/awssdk/codegen/poet/client/c2j/ops-with-auth-sigv4a-value/customization.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"useMultiAuth": true | ||
} |
152 changes: 152 additions & 0 deletions
152
.../software/amazon/awssdk/codegen/poet/client/c2j/ops-with-auth-sigv4a-value/service-2.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
{ | ||
"version": "2.0", | ||
"metadata": { | ||
"apiVersion": "2023-06-08", | ||
"endpointPrefix": "database-service-endpoint", | ||
"globalEndpoint": "database-service.amazonaws.com", | ||
"protocol": "rest-json", | ||
"serviceAbbreviation": "Database Service", | ||
"serviceFullName": "Some Service That Uses AWS Database Protocol", | ||
"serviceId": "Database Service", | ||
"signingName": "database-service", | ||
"signatureVersion": "v4", | ||
"auth": ["aws.auth#sigv4a", "aws.auth#sigv4"], | ||
"uid": "database-service-2023-06-08", | ||
"xmlNamespace": "https://database-service.amazonaws.com/doc/2023-06-08/" | ||
}, | ||
"operations": { | ||
"GetRow": { | ||
"name": "GetRow", | ||
"http": { | ||
"method": "GET", | ||
"requestUri": "/get-row/" | ||
}, | ||
"input": { | ||
"shape": "GetRowRequest" | ||
}, | ||
"output": { | ||
"shape": "GetRowResponse" | ||
}, | ||
"errors": [ | ||
{ | ||
"shape": "InvalidInputException" | ||
} | ||
], | ||
"documentation": "<p>Performs a get row operation no output</p>" | ||
}, | ||
"PutRow": { | ||
"name": "PutRow", | ||
"auth": ["v4"], | ||
"http": { | ||
"method": "PUT", | ||
"requestUri": "/put-row/" | ||
}, | ||
"input": { | ||
"shape": "PutRowRequest" | ||
}, | ||
"output": { | ||
"shape": "PutRowResponse" | ||
}, | ||
"errors": [ | ||
{ | ||
"shape": "InvalidInputException" | ||
} | ||
], | ||
"documentation": "<p>Performs a get row operation no output</p>" | ||
}, | ||
"DeleteRow": { | ||
"name": "DeleteRow", | ||
"auth": [ "v4"], | ||
"http": { | ||
"method": "DELETE", | ||
"requestUri": "/delete-row/" | ||
}, | ||
"input": { | ||
"shape": "DeleteRowRequest" | ||
}, | ||
"output": { | ||
"shape": "DeleteRowResponse" | ||
}, | ||
"errors": [ | ||
{ | ||
"shape": "InvalidInputException" | ||
} | ||
], | ||
"documentation": "<p>Performs a get row operation no output</p>" | ||
} | ||
}, | ||
"shapes": { | ||
"GetRowRequest": { | ||
"type": "structure", | ||
"members": { | ||
"StringMember": { | ||
"shape": "String", | ||
"documentation": "<p>A string Memer</p>" | ||
} | ||
} | ||
}, | ||
"GetRowResponse": { | ||
"type": "structure", | ||
"members": { | ||
"StringMember": { | ||
"shape": "String", | ||
"documentation": "<p>A string Memer</p>" | ||
} | ||
} | ||
}, | ||
"PutRowRequest": { | ||
"type": "structure", | ||
"members": { | ||
"StringMember": { | ||
"shape": "String", | ||
"documentation": "<p>A string Memer</p>" | ||
} | ||
} | ||
}, | ||
"PutRowResponse": { | ||
"type": "structure", | ||
"members": { | ||
"StringMember": { | ||
"shape": "String", | ||
"documentation": "<p>A string Memer</p>" | ||
} | ||
} | ||
}, | ||
"DeleteRowRequest": { | ||
"type": "structure", | ||
"members": { | ||
"StringMember": { | ||
"shape": "String", | ||
"documentation": "<p>A string Memer</p>" | ||
} | ||
} | ||
}, | ||
"DeleteRowResponse": { | ||
"type": "structure", | ||
"members": { | ||
"StringMember": { | ||
"shape": "String", | ||
"documentation": "<p>A string Memer</p>" | ||
} | ||
} | ||
}, | ||
"InvalidInputException": { | ||
"type": "structure", | ||
"members": { | ||
"message": { | ||
"shape": "invalidInputMessage" | ||
} | ||
}, | ||
"documentation": "<p>The request was rejected because an invalid or out-of-range value was supplied for an input parameter.</p>", | ||
"error": { | ||
"code": "InvalidInput", | ||
"httpStatusCode": 400, | ||
"senderFault": true | ||
}, | ||
"exception": true | ||
}, | ||
"String":{"type":"string"}, | ||
"invalidInputMessage":{"type":"string"} | ||
}, | ||
"documentation": "A Database Service with Fine granularity authorization schemes" | ||
} |