I have a state-machine consisting of a first pre-process task that generates an array as output, which is used by a subsequent map state to loop over. The output array of the first task has gotten too big and the state-machine throws the error States.DataLimitExceeded: The state/task 'arn:aws:lambda:XYZ' returned a result with a size exceeding the maximum number of characters service limit.
Here is an example of the state-machine yaml:
stateMachines:
myStateMachine:
name: "myStateMachine"
definition:
StartAt: preProcess
States:
preProcess: …Run Code Online (Sandbox Code Playgroud) amazon-web-services aws-lambda aws-step-functions aws-serverless
考虑由 AWS-ApiGateway 和 -Lambda 组成的restapi 后端。
成功进行 oauth2 身份验证后,AWS Cognito在代码授权授予流程中向客户端返回 anaccess_token和 an 。id_token
在API调用期间,lambda函数需要知道经过身份验证的客户端的电子邮件地址,所以我基本上有两种选择:
id_token。Authorization让 Lambda 解密id_token并访问其中包含的电子邮件地址。access_token标头。让 Lambda 使用标头中的access_token 调用端点以获取电子邮件地址。Authorizationscope=openid emailGET/oauth2/userinfoAuthorization两者哪一个是最佳实践?为什么?
打字稿中是否有与 JSON 模式对象关联的特殊类型?我的班级有一个方法可以检查其成员是否满足动态 json 模式schema,现在我是这样做的,
<!-- language: typescript -->
verifySchema(schema: object): void {
// do verification
}
Run Code Online (Sandbox Code Playgroud)
例如在哪里
<!-- language: typescript -->
const schema = {
title: 'blabla',
description: 'Basic schema',
type: 'object',
properties: {
"firstName": {
"type": "string",
"description": "The person's first name."
},
"lastName": {
"type": "string",
"description": "The person's last name."
},
...
}
Run Code Online (Sandbox Code Playgroud)
但是为了保持通用性,我想允许检查任意的 json 模式,而不仅仅是这个特定的模式。是否可以schema: object为 JSON 模式对象设置或有最佳实践?