This file contains 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
AWSTemplateFormatVersion: '2010-09-09' | |
Transform: AWS::Serverless-2016-10-31 | |
Description: > | |
villaData | |
Sample SAM Template for villaData | |
# More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst | |
Globals: | |
Function: |
This file contains 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
AWSTemplateFormatVersion: '2010-09-09' | |
Transform: AWS::Serverless-2016-10-31 | |
Description: > | |
inventory functions | |
Metadata: | |
AWS::ServerlessRepo::Application: | |
Name: inv-app | |
Description: for managing inventory | |
Author: nicWanavit |
This file contains 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
AWSTemplateFormatVersion: '2010-09-09' | |
Transform: AWS::Serverless-2016-10-31 | |
Description: > | |
villa-wallet-sam | |
Sample SAM Template for villa-wallet-sam | |
# More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst | |
Globals: | |
Function: |
This file contains 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
AWSTemplateFormatVersion: '2010-09-09' | |
Transform: AWS::Serverless-2016-10-31 | |
Description: > | |
villa-wallet-sam | |
Sample SAM Template for villa-wallet-sam | |
Metadata: | |
AWS::ServerlessRepo::Application: | |
Name: wallet-database-app |
This file contains 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
cd ./wallet-database\ | |
&&sam build --profile villaaws\ | |
&&sam package --profile villaaws --s3-bucket wallet-database-app --force-upload --output-template-file packaged.yaml\ | |
&&sam publish --profile villaaws --template packaged.yaml --region ap-southeast-1 | |
echo building wallet encryptor function |
This file contains 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
def make_negative( number ): | |
#return -abs(number) | |
#return -number if number > 0 else number | |
if number > 0: | |
return -number | |
else: | |
return number |
This file contains 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
def uploadImage(event, params): | |
''' create a signedurl for client to upload image to s3''' | |
# extract path (object key) from requester | |
path = event['path'] | |
# mock key (please remove when used in lambda) | |
KEY = '' | |
PW = '' | |
s3 = boto3.client('s3', | |
aws_access_key_id = KEY, |
This file contains 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
def generate_RSA(bits=2048): | |
new_key = RSA.generate(bits, e=65537) | |
public_key = new_key.publickey().exportKey("PEM").decode() | |
private_key = new_key.exportKey("PEM").decode() | |
return private_key, public_key |
This file contains 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
from Crypto.PublicKey import RSA | |
def newKey(phoneHash:str): | |
'''generat new rsa key and store in database''' | |
if len(list(PynamoSecret.query(phoneHash))) > 0 : | |
print('hash key exists, throwing error') | |
raise ValueError('secret key exists') | |
else: | |
print('there is no secret key, generating one') |
This file contains 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
class B: | |
def random_func(self, i, j, test=None): | |
print(2) | |
class A: | |
def random_func(self, i, j, test=None): | |
print(1) | |
class ModA(A): | |
def random_funcA(self, i, j, test=None): | |
super().random_func(i, j, test=test) |