Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ApiGatewayRequestIdentity model is incomplete #136

Closed
Limess opened this issue Mar 15, 2018 · 5 comments
Closed

ApiGatewayRequestIdentity model is incomplete #136

Limess opened this issue Mar 15, 2018 · 5 comments
Assignees
Labels
Milestone

Comments

@Limess
Copy link

Limess commented Mar 15, 2018

  • Framework version: 1.0
  • Implementations: Jersey

Scenario

I'm attempting to map apiKeyId to some stored metadata, for this I need the apiKeyId from the ApiGatewayRequestIdentity model which is injectable into

See https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html for the full list of fields which should be available.

@sapessi
Copy link
Collaborator

sapessi commented Mar 15, 2018

Hey @Limess, it's not there because I couldn't see it in the documentation: https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html#api-gateway-simple-proxy-for-lambda-input-format. There's no harm in adding the field anyway so I'll do it for the next release. Do you see it in proxy events?

@sapessi
Copy link
Collaborator

sapessi commented Mar 15, 2018

Yes, confirmed it is there in proxy events too - just tested. Thanks again for the report.

@sapessi sapessi self-assigned this Mar 15, 2018
@sapessi sapessi added the bug label Mar 15, 2018
@sapessi sapessi added this to the Release 1.1 milestone Mar 15, 2018
@Limess
Copy link
Author

Limess commented Mar 15, 2018

Wonderful, thanks @sapessi.

@sapessi
Copy link
Collaborator

sapessi commented Mar 15, 2018

Adding latest proxy structure from my test here to check the rest of the model:

{
   "body":null,
   "headers":{
      "Accept":"*/*",
      "CloudFront-Forwarded-Proto":"https",
      "CloudFront-Is-Desktop-Viewer":"true",
      "CloudFront-Is-Mobile-Viewer":"false",
      "CloudFront-Is-SmartTV-Viewer":"false",
      "CloudFront-Is-Tablet-Viewer":"false",
      "CloudFront-Viewer-Country":"US",
      "Host":"XXXXXXXXXX",
      "User-Agent":"curl/7.54.0",
      "Via":"1.1 7bdfe469102431e5bc0938ba6b094eb7.cloudfront.net (CloudFront)",
      "X-Amz-Cf-Id":"rQsJg9YHCr8mOQcvugd0jLbsDQ_pN4rZvcXBJo539uAsyw8thlxodQ==",
      "X-Amzn-Trace-Id":"Root=1-5aaac46a-bcf88f88666182d299db4b0a",
      "X-Forwarded-For":"54.240.196.186, 54.182.214.94",
      "X-Forwarded-Port":"443",
      "X-Forwarded-Proto":"https"
   },
   "httpMethod":"GET",
   "isBase64Encoded":false,
   "path":"/proxy-test",
   "pathParameters":{
      "proxy":"proxy-test"
   },
   "queryStringParameters":null,
   "requestContext":{
      "accountId":"XXXXXXXXXX",
      "apiId":"xxxxxxxx",
      "httpMethod":"GET",
      "identity":{
         "apiKey": null,
         "apiKeyId": null,
         "accessKey":null,
         "accountId":null,
         "caller":null,
         "cognitoAuthenticationProvider":null,
         "cognitoAuthenticationType":null,
         "cognitoIdentityId":null,
         "cognitoIdentityPoolId":null,
         "sourceIp":"54.240.196.186",
         "user":null,
         "userAgent":"curl/7.54.0",
         "userArn":null
      },
      "path":"/dev/proxy-test",
      "protocol":"HTTP/1.1",
      "requestId":"1754d6b4-2884-11e8-a349-83c25a689b03",
      "requestTime":"15/Mar/2018:19:07:22 +0000",
      "requestTimeEpoch":1521140842703,
      "resourceId":"xxxxx",
      "resourcePath":"/{proxy+}",
      "stage":"dev"
   },
   "resource":"/{proxy+}",
   "stageVariables":null
}

sapessi added a commit that referenced this issue Apr 5, 2018
@sapessi
Copy link
Collaborator

sapessi commented Apr 6, 2018

Latest merge includes the new fields. Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants