@Generated(value="jsii-pacmak/1.60.0 (build ebcefe6)",
date="2022-06-22T23:28:03.136Z")
public interface AuthorizationConfig
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());
Modifier and Type | Interface and Description |
---|---|
static class |
AuthorizationConfig.Builder
A builder for
AuthorizationConfig |
static class |
AuthorizationConfig.Jsii$Proxy
An implementation for
AuthorizationConfig |
Modifier and Type | Method and Description |
---|---|
static AuthorizationConfig.Builder |
builder() |
default java.util.List<AuthorizationMode> |
getAdditionalAuthorizationModes()
(experimental) Additional authorization modes.
|
default AuthorizationMode |
getDefaultAuthorization()
(experimental) Optional authorization configuration.
|
default java.util.List<AuthorizationMode> getAdditionalAuthorizationModes()
Default: - No other modes
default AuthorizationMode getDefaultAuthorization()
Default: - API Key authorization
static AuthorizationConfig.Builder builder()
AuthorizationConfig.Builder
of AuthorizationConfig