This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create 'foo/bar' private endpoint on API Gateway, with POST method using HTTP integration | |
# Your APIG foo/bar endpoint will validate the request IAM session and if succeds, pass the request to your endpoint passing all data received including the user session | |
# It passes request headers, path, querystring, body and context (cognito user is here) to the endpoint as the body payload | |
ApiGatewayResourceFoo: | |
Type: AWS::ApiGateway::Resource | |
Properties: | |
PathPart: foo | |
ParentId: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var nextPage = () => { | |
return new Promise((resolve, reject) => { | |
console.log('Go to next page ...'); | |
const disabledIcon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAXCAYAAAARIY8tAAABVklEQVR42u1UsUrDUBStiyAoKAh+gn6Bk//gqKOOgpvgKDg5OaaFJE1K0iRNSJo2bSIdYhKIJehixoyd+wVS0+t5/YW8ReiFx+Pd4Z5z7j33tVrb2IbjOKeKonwbhnHJvfhwOLwAwHKxWFAQBD+WZV1xBQDrzzAMKc9zqqqKgayQu+EGMB6PT3RdL6GCZrMZlWVJyP32er07biCTyeQYBb80TaPRaERFUbC7liTpgRuI7/uH3W73A8OmwWBAWZYxJbUoik/cQARB2O90OjGKUr/fpyRJKIqiGvkXXnbdbbfbPlOhqiqZpklwGQFAaFx8Pp/voedvcBDBqpsjy/Iaal6JaKepkw7AOnVdd8PY8zzC0NcAeG7MfDqdHsE9BW7Wb2I7gfcaAI9c+o5i74jNQOM4Zn2vsRf3PO15btv2Mk1TwpBXsOgt9/8IrM+wAxXUXG+//v8Zf/3P6XuKEbAtAAAAAElFTkSuQmCC" | |
const nextImg = document.querySelector('#gwt-debug-pager td:last-child img'); | |
if (nextImg.src !== disabledIcon) { | |
nextImg.click(); | |
setTimeout(resolve, 1000); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Principal": { "Federated": "cognito-identity.amazonaws.com" }, | |
"Action": ["s3:ListBucket"], | |
"Resource": ["arn:aws:s3:::BUCKET_NAME"], | |
"Condition": {"StringLike": {"s3:prefix": ["${cognito-identity.amazonaws.com:sub}/*"]}} | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
/** | |
* Adds the posibility to configure AWS_IAM for your API Gateway endpoints | |
* and "Invoke with caller credentials" | |
* | |
* Usage: | |
* | |
* myFuncGetItem: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
TO USE THIS client: | |
- Go to the google developer console and get your client id. This is pretty | |
well documented somewhere else. Use your localhost(:port)? as url to work in | |
your local as always. | |
- Go to AWS and create a new Federated identity pool | |
* Associate an Authenticated role and Unauthenticated role to the pool | |
At least you need cognito-identity and apigateway, edit this for your needs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports.auth = (event, context, callback) => { | |
AWS.config.credentials = new AWS.CognitoIdentityCredentials({ | |
IdentityPoolId: IdentityPoolId, | |
Logins: { | |
'accounts.google.com': event.id_token | |
} | |
}); | |
AWS.config.credentials.get(() =>{ | |
if (!AWS.config.credentials.accessKeyId) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var rendererOptions = { | |
draggable: true, | |
polylineOptions: { | |
strokeColor: "#FF0000" | |
} | |
}; | |
var directionsDisplay = new google.maps.DirectionsRenderer(rendererOptions); | |
var directionsService = new google.maps.DirectionsService(); | |
var geocoder; | |
var map; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<user-avatar id="my-ids" class="my-classes" user="userObject"></user-avatar> |