Skip to content
This repository has been archived by the owner on Jan 25, 2025. It is now read-only.

Commit

Permalink
Merge pull request #1 from Keyspace-cloud/migration
Browse files Browse the repository at this point in the history
pushed v1.0.0
  • Loading branch information
nimish-ks authored Jan 8, 2023
2 parents e6b7732 + 4d09e12 commit 8072a85
Show file tree
Hide file tree
Showing 2,517 changed files with 10,226 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
REACT_APP_API_HOST=api.keyspace.cloud
REACT_APP_KEYAUTH_HOST=api.keyspace.cloud/keyauth
28 changes: 28 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
## :recycle: Current situation

*Describe the current situation. Explain current problems, if there are any. Be as descriptive as possible (e.g., including examples or code snippets).*

## :bulb: Proposed solution

*Describe the proposed solution and changes. How does it affect the project? How does it affect the internal structure (e.g., refactorings)?*

## 📷: Screenshots

*Provide screenshots showcasing the changes before and after the proposed changes (if applicable).*

## 📋 : Release Notes

*Provide a summary of the changes or features from a user's point of view. If there are breaking changes, provide migration guides using code examples of the affected features.*



## :heavy_plus_sign: Additional Information
*If applicable, provide additional context in this section.*

### Testing

*Which tests were added? Which existing tests were adapted/changed? Which situations are covered, and what edge cases are missing?*

### Reviewer Nudging

*Where should the reviewer start? what is a good entry point?*
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# dependencies
/node_modules
yarn.lock

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

# IDE
.vscode
57 changes: 57 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Keyspace web wallet
A secure self-custodial cryptographic wallet for your digital life.

## For developers:

### Dev mode
`npm start`

Runs the app in the development mode.<br /> Open
[http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.<br /> You will also see any lint errors
in the console.

### To build
`yarn build`


## Plugin setup
### For chrome

1. Create a build folder with `npm run build` or `yarn build`

2. Open `chrome://extensions` with "Developer mode" on

3. Select "Load unpacked" and select the `build` folder


### For firefox

1. Create a build folder with `npm run build` or `yarn build`

2. Open `about:debugging` and select `This Firefox`

3. Select "Load temporary addon" and import the manifest.json file from the build folder.

## Cryptography

- [XChaCha20-Poly1305](https://doc.libsodium.org/secret-key_cryptography/aead/chacha20-poly1305/xchacha20-poly1305_construction)
- [Ed25519](https://doc.libsodium.org/secret-key_cryptography/aead/chacha20-poly1305/xchacha20-poly1305_construction)
- [X25519](https://doc.libsodium.org/key_exchange#usage)
- [PBKDF2](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki#from-mnemonic-to-seed)
- [BLAKE2B](https://doc.libsodium.org/key_derivation#deriving-keys-from-a-single-high-entropy-key)

## Credits

### The Keyspace Team

- **Rohan Chaturvedi** - Backend API, Browser and Desktop Apps
- **Nimish Karmali** - Cryptography, Architecture and Infrastructure
- **Owais Shaikh** - Android App

## License

[Copyright © 2023 Keyspace](LICENSE)

This project is licensed under the GNU GPLv3 License
21 changes: 21 additions & 0 deletions build-icons.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const path = require('path')
const fs = require('fs')

const IN_DIR = path.resolve(__dirname, './src/icons')
const OUT_DIR = path.resolve(__dirname, './src/icons/icons.json')

const buildIconsObject = (files) => {
return files
.map((file) => {
const name = path.basename(file, '.svg')
return name
})
}

console.log(`Getting icons from ${IN_DIR}`)
const svgFiles = fs.readdirSync(IN_DIR).filter((file) => path.extname(file) === '.svg')

console.log(`Building ${OUT_DIR}...`)
const icons = buildIconsObject(svgFiles)

fs.writeFileSync(OUT_DIR, JSON.stringify(icons))
45 changes: 45 additions & 0 deletions config-overrides.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@


// module.exports = function override(config, env) {
// //do stuff with the webpack config...
// config.resolve.fallback = {
// "path": false,
// "stream": false,
// "crypto": false
// }

// return config;
// }

/* config-overrides.js */
const webpack = require('webpack');
module.exports = function override(config, env) {
config.resolve.fallback = {
util: require.resolve('util/'),
url: require.resolve('url'),
assert: require.resolve('assert'),
buffer: require.resolve('buffer'),
stream: require.resolve('stream-browserify'),
path: require.resolve('path'),
fs: false,
crypto: false,
};
config.plugins.push(
new webpack.ProvidePlugin({
process: 'process/browser',
Buffer: ['buffer', 'Buffer'],
}),
new webpack.optimize.AggressiveSplittingPlugin({
minSize: 20000,
maxSize: 50000
}),
);
config.module.rules.push({
test: /\.m?js/,
resolve: {
fullySpecified: false
}
})

return config;
}
77 changes: 77 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"name": "keyspace-plugin",
"version": "0.1.0",
"private": true,
"dependencies": {
"@chakra-ui/icons": "^2.0.0",
"@chakra-ui/react": "^2.4.4",
"@emotion/react": "^11.8.2",
"@emotion/styled": "^11.8.1",
"@reduxjs/toolkit": "^1.8.2",
"@testing-library/jest-dom": "^5.16.2",
"@testing-library/react": "^10.4.9",
"@testing-library/user-event": "^12.8.3",
"@types/chrome": "^0.0.193",
"@types/firefox-webext-browser": "^94.0.1",
"@types/jest": "^25.2.3",
"@types/libsodium-wrappers": "^0.7.9",
"@types/node": "17.0.29",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.10",
"@types/uuid": "^8.3.4",
"@types/zxcvbn": "^4.4.1",
"bip39": "^3.0.4",
"buffer": "^6.0.3",
"framer-motion": "^4.1.17",
"js-base64": "^3.7.3",
"libsodium-wrappers": "^0.7.9",
"path": "^0.12.7",
"psl": "^1.9.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^4.7.1",
"react-markdown": "^8.0.3",
"react-qrcode-logo": "^2.6.0",
"react-redux": "^8.0.2",
"react-scripts": "5.0.0",
"react-use-websocket": "^3.0.0",
"sass": "^1.54.8",
"stream-browserify": "^3.0.0",
"totp-generator": "^0.0.13",
"typescript": "^4.6.2",
"uuid": "^8.3.2",
"web-vitals": "^0.2.4",
"zxcvbn": "^4.4.2"
},
"scripts": {
"start": "react-app-rewired start",
"build": "react-app-rewired build",
"build-icons": "node build-icons.js",
"test": "react-app-rewired test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"react-app-rewired": "^2.2.1"
},
"prettier": {
"trailingComma": "es5",
"tabWidth": 4,
"semi": false,
"singleQuote": true
}
}
26 changes: 26 additions & 0 deletions public/background.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
let session = undefined

chrome.runtime.onMessage.addListener(function (request, sender, sendResponse, tab) {
if (request.cmd === 'saveSession') {
session = request.message
sendResponse({ result: `saved session}` })
}

if (request.cmd === 'getSession') {
if (session) sendResponse({ result: 'success', message: session })
else sendResponse({ result: 'error', message: 'no session available' })
}

if (request.cmd === 'removeSession') {
session = undefined
sendResponse({ result: `removed session}` })
}

else {
sendResponse({ result: 'error', message: `Invalid 'cmd'` })
}
// Note: Returning true is required here!
// ref: http://stackoverflow.com/questions/20077487/chrome-extension-message-passing-response-not-sent
return true
})

Binary file added public/favicon.ico
Binary file not shown.
Binary file added public/images/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/favicon-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/favicon-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Public key infrastructure for everyone"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />

<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />

<title>Keyspace</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
</body>
</html>

<style>
body {
min-width: 780px;
min-height: 580px;
}
</style>
47 changes: 47 additions & 0 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name" :"Keyspace",
"description": "Keyspace wallet browser add-on",
"version": "1.0.0",
"manifest_version": 2,
"icons": {
"16": "./images/favicon-16x16.png",
"32": "./images/favicon-32x32.png",
"192": "./images/favicon-192x192.png",
"512": "./images/favicon-512x512.png"
},
"browser_action": {
"default_popup": "index.html",
"default_icon": {
"16": "./images/favicon-16x16.png",
"32": "./images/favicon-32x32.png",
"192": "./images/favicon-192x192.png",
"512": "./images/favicon-512x512.png"
}
},
"background": {
"scripts": ["background.js"],
"persistent": true
},
"permissions": [
"tabs",
"activeTab",
"contextMenus",
"storage",
"unlimitedStorage",
"clipboardRead",
"clipboardWrite",
"idle",
"http://*/*",
"https://*/*",
"webRequest",
"webRequestBlocking"
],
"commands": {
"_execute_browser_action": {
"suggested_key": {
"default": "Ctrl+Period"
},
"description": "keyboard call"
}
}
}
3 changes: 3 additions & 0 deletions public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:
10 changes: 10 additions & 0 deletions src/App.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from "react"
import { screen } from "@testing-library/react"
import { render } from "./test-utils"
import { App } from "./components/App"

test("renders plugin start screen", () => {
render(<App />)
const linkElement = screen.getByText(/keyspace/i)
expect(linkElement).toBeInTheDocument()
})
Loading

0 comments on commit 8072a85

Please sign in to comment.