Interface AuthorizationConfig
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
AuthorizationConfig.Jsii$Proxy
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:49.360Z")
@Stability(Experimental)
public interface AuthorizationConfig
extends software.amazon.jsii.JsiiSerializable
(experimental) Configuration of the API authorization modes.
Example:
GraphqlApi api = GraphqlApi.Builder.create(this, "Api") .name("demo") .schema(Schema.fromAsset(join(__dirname, "schema.graphql"))) .authorizationConfig(AuthorizationConfig.builder() .defaultAuthorization(AuthorizationMode.builder() .authorizationType(AuthorizationType.IAM) .build()) .build()) .xrayEnabled(true) .build(); Table demoTable = Table.Builder.create(this, "DemoTable") .partitionKey(Attribute.builder() .name("id") .type(AttributeType.STRING) .build()) .build(); DynamoDbDataSource demoDS = api.addDynamoDbDataSource("demoDataSource", demoTable); // Resolver for the Query "getDemos" that scans the DynamoDb table and returns the entire list. demoDS.createResolver(BaseResolverProps.builder() .typeName("Query") .fieldName("getDemos") .requestMappingTemplate(MappingTemplate.dynamoDbScanTable()) .responseMappingTemplate(MappingTemplate.dynamoDbResultList()) .build()); // Resolver for the Mutation "addDemo" that puts the item into the DynamoDb table. demoDS.createResolver(BaseResolverProps.builder() .typeName("Mutation") .fieldName("addDemo") .requestMappingTemplate(MappingTemplate.dynamoDbPutItem(PrimaryKey.partition("id").auto(), Values.projecting("input"))) .responseMappingTemplate(MappingTemplate.dynamoDbResultItem()) .build());
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
A builder forAuthorizationConfig
static final class
An implementation forAuthorizationConfig
-
Method Summary
Modifier and TypeMethodDescriptionstatic AuthorizationConfig.Builder
builder()
default List<AuthorizationMode>
(experimental) Additional authorization modes.default AuthorizationMode
(experimental) Optional authorization configuration.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getAdditionalAuthorizationModes
@Stability(Experimental) @Nullable default List<AuthorizationMode> getAdditionalAuthorizationModes()(experimental) Additional authorization modes.Default: - No other modes
-
getDefaultAuthorization
(experimental) Optional authorization configuration.Default: - API Key authorization
-
builder
- Returns:
- a
AuthorizationConfig.Builder
ofAuthorizationConfig
-