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'; | |
| const AWS = require('aws-sdk'); | |
| const dynamoClient = new AWS.DynamoDB.DocumentClient(); | |
| const crypto = require('crypto'); | |
| const headers = { | |
| 'Access-Control-Allow-Origin': '*', | |
| 'Access-Control-Allow-Credentials': true, | |
| }; |
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'; | |
| const AWS = require('aws-sdk'); | |
| const dynamo = new AWS.DynamoDB(); | |
| const headers = { | |
| 'Access-Control-Allow-Origin': '*', | |
| 'Access-Control-Allow-Credentials': true, | |
| }; | |
| module.exports.handler = async (event, context, callback) => { | |
| const { |
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
| GetNonce: | |
| handler: src/get_nonce/index.handler | |
| events: | |
| - http: | |
| path: nonce | |
| method: get | |
| cors: true | |
| request: | |
| parameters: | |
| querystrings: |
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
| UserTable: | |
| Type: AWS::DynamoDB::Table | |
| Properties: | |
| TableName: ${self:custom.userTable} | |
| SSESpecification: | |
| SSEEnabled: true | |
| AttributeDefinitions: | |
| - AttributeName: address | |
| AttributeType: S | |
| KeySchema: |
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
| import React, { useEffect } from 'react'; | |
| import Web3 from 'web3'; | |
| import axios from 'axios'; | |
| import { AwsClient } from 'aws4fetch'; | |
| import MetaMaskOnboarding from '@metamask/onboarding'; | |
| import logo from '../logo.svg'; | |
| import { AuthContext } from '../context/AuthProvider'; | |
| import { AwsContext } from '../context/AwsProvider'; | |
| const web3 = new Web3(Web3.givenProvider); |
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
| const signature = await web3.eth.personal.sign( | |
| web3.utils.sha3(`Welcome message, nonce: ${nonce}`), | |
| address | |
| ); |
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
| if (window.ethereum) { | |
| try { | |
| const accounts = await window.ethereum.request({ | |
| method: 'eth_requestAccounts', | |
| }); | |
| const address = accounts[0]; | |
| } catch (error) { | |
| //throw error | |
| } | |
| } |
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
| apiVersion: v1 | |
| kind: Secret | |
| data: | |
| CLIENT_ID: CLIENT_ID_ENCODED_WITH_BASE64 | |
| metadata: | |
| name: sp-secret | |
| type: Opaque |
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
| apiVersion: v1 | |
| kind: ConfigMap | |
| metadata: | |
| name: sp-config | |
| data: | |
| DS_INIT_MODE: always | |
| DB_USER: myuser@my-sp-db-server | |
| DB_HOST: jdbc:postgresql://my-sp-db-server.postgres.database.azure.com:5432/my-sp-db?sslmode=require | |
| DB_NAME: my-sp-db | |
| DB_SCHEMA: config/schema.sql |
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
| apiVersion: kustomize.config.k8s.io/v1beta1 | |
| kind: Kustomization | |
| namePrefix: dev- | |
| namespace: dev-ns | |
| commonLabels: | |
| variant: dev | |
| # patchesStrategicMerge: | |
| resources: | |
| - configmap.yaml | |
| - secret.yaml |