我今天升级了我的 flutter 版本并发现了这个问题:
../../../../../AppData/Local/Pub/Cache/hosted/pub.dev/modal_bottom_sheet-2.1.2/lib/src/bottom_sheets/bar_bottom_sheet.dart:102:13: Error: 'ModalBottomSheetRoute' is imported from both 'package:flutter/src/material/bottom_sheet.dart' and 'package:modal_bottom_sheet/src/bottom_sheet_route.dart'.
.push(ModalBottomSheetRoute<T>(
^^^^^^^^^^^^^^^^^^^^^
../../../../../AppData/Local/Pub/Cache/hosted/pub.dev/modal_bottom_sheet-2.1.2/lib/src/bottom_sheets/bar_bottom_sheet.dart:125:10: Error: A value of type 'Object?' can't be returned from an async function with return type 'Future<T?>'.
- 'Object' is from 'dart:core'.
- 'Future' is from 'dart:async'.
return result;
^
../../../../../AppData/Local/Pub/Cache/hosted/pub.dev/modal_bottom_sheet-2.1.2/lib/src/bottom_sheets/material_bottom_sheet.dart:28:13: Error: 'ModalBottomSheetRoute' is imported from both 'package:flutter/src/material/bottom_sheet.dart' and 'package:modal_bottom_sheet/src/bottom_sheet_route.dart'.
.push(ModalBottomSheetRoute<T>(
^^^^^^^^^^^^^^^^^^^^^
../../../../../AppData/Local/Pub/Cache/hosted/pub.dev/modal_bottom_sheet-2.1.2/lib/src/bottom_sheets/material_bottom_sheet.dart:50:10: Error: A value of type 'Object?' can't be returned from an async function with return type 'Future<T?>'.
- 'Object' is from …Run Code Online (Sandbox Code Playgroud) 我已经使用 CloudFormation 模板设置了一个 API 网关(v1,而不是 v2)REST API 资源。最近我注意到还创建了默认的 execute-api 端点,我可以在设置中禁用它。
这个 API 的类型是AWS::ApiGateway::RestApi.
自然,我希望通过模板来完成,所以问题是:这个设置可以在 CloudFormation 模板中定义,而不是在 AWS 控制台中手动单击吗?此选项可用于 CloudFormation 模板中的 APIGateway V2 API 资源 ( AWS::ApiGatewayV2::Api) 但不适用于 APIGateway V1 REST API 资源 ( AWS::ApiGateway::RestApi),即使可以在控制台中手动更改 APIGateway V1 REST API。
也有这样的CLI方式的AWS::ApiGateway::RestApi。
以下是我用来搜索此设置的一些链接:
AWS::ApiGatewayV2::API
AWS::ApiGateway::RestApi
Disabling default api-execute endpoint via CLI
rest amazon-web-services aws-cloudformation aws-api-gateway serverless-framework
据我了解,AWS API Gateway 的 AWS Cognito Authorizer 会自动验证 JWT 并解析有效负载,并在传递给 lambda 集成的参数event.requestContext.authorizer.claims部分中包含一些声明event。
这很方便,因为这意味着我不必从 JWT 手动提取数据,但cognito:groups在此过程中某些声明(尤其是 )的格式会发生变化。
例如,以下 JWT 负载:
{
"sub": "xxx",
"cognito:groups": [
"group-a",
"group-b"
],
"email_verified": true,
"iss": "https://cognito-idp.eu-west-1.amazonaws.com/xxx",
"cognito:username": "xxx",
"given_name": "xxx",
"origin_jti": "xxx",
"aud": "xxx",
"event_id": "xxx",
"token_use": "id",
"auth_time": 1666606318,
"exp": 1666692718,
"iat": 1666606318,
"family_name": "xxx",
"jti": "xxx",
"email": "xxx"
}
Run Code Online (Sandbox Code Playgroud)
结果以下参数被传递给 lambda event.requestContext.authorizer.claims:
{
"sub": "xxx",
"cognito:groups": "group-a,group-b",
"email_verified": "true",
"iss": "https://cognito-idp.eu-west-1.amazonaws.com/xxx",
"cognito:username": "xxx",
"given_name": "xxx",
"origin_jti": …Run Code Online (Sandbox Code Playgroud)