Skip to content
This repository was archived by the owner on Jan 7, 2020. It is now read-only.

Commit ff57aac

Browse files
authored
Merge pull request #335 from hunterlester/update
chore/move to before_deploy
2 parents 880a367 + 7e05d38 commit ff57aac

File tree

9 files changed

+23
-18
lines changed

9 files changed

+23
-18
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@ addons:
2626
- ubuntu-toolchain-r-test
2727
packages:
2828
- g++-4.8
29-
script:
29+
before_deploy:
3030
- yarn install-all
3131
- yarn package-all
32-
before_deploy:
3332
- export EMAIL_APP="$(ls email_app/out/*.zip)";
3433
- export WEB_HOSTING_MANAGER="$(ls web_hosting_manager/release/*.zip)";
3534
- export SHA_256_SUM_EMAIL_APP="$(ls email_app/out/*.txt)";

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[![Build status](https://ci.appveyor.com/api/projects/status/2fnekwfbm5h2ayk7/branch/master?svg=true)]
2+
13
# safe_examples
24
Examples showcasing various features of the SAFE Network
35

appveyor.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,19 @@ install:
1616
- node --version
1717
- npm --version
1818
- yarn --version
19+
- yarn config set child-concurrency 1
20+
- yarn
1921
- yarn add windows-build-tools --global
20-
- yarn --ignore-optional
2122

2223

2324
build_script:
2425
- node --version
2526
- yarn --version
26-
- yarn install-all
27-
- yarn package-all
2827

2928

30-
after_build:
29+
before_deploy:
30+
- yarn install-all
31+
- yarn package-all
3132
- echo %APPVEYOR_REPO_TAG%
3233
- echo %APPVEYOR_REPO_TAG_NAME%
3334
- ps: Get-ChildItem .\email_app\out\*.zip | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }

safe_web_api_playground/md

Whitespace-only changes.

safe_web_api_playground/static/js/api_variables.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ module.exports = [
2525
'rawPubEncKey',
2626
'rawSecEncKey',
2727
'encryptedBuffer',
28+
'decipheredBuffer',
2829
'idAddress',
2930
'serialisedMD',
3031
'hashedString',

safe_web_api_playground/static/js/code-snippets/safeCryptoEncKeyPair.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ module.exports = {
1919
},
2020

2121
decryptSealed: async () => {
22-
// let cipher = <encrypted data>;
22+
// let encryptedBuffer = <encrypted data>;
2323
try {
24-
var deciphered = await window.safeCryptoEncKeyPair.decryptSealed(encKeyPairHandle, cipher)
24+
decipheredBuffer = await window.safeCryptoEncKeyPair.decryptSealed(encKeyPairHandle, encryptedBuffer)
2525
} catch(err) {
2626
return err;
2727
}
28-
return `Returns decrypted data: ${String.fromCharCode.apply(null, new Uint8Array(deciphered))}`;
28+
return `Returns decrypted data: ${String.fromCharCode.apply(null, new Uint8Array(decipheredBuffer))}`;
2929
},
3030

3131
free: () => {

safe_web_api_playground/static/js/code-snippets/safeCryptoPubEncKey.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,27 @@ module.exports = {
1111

1212
encryptSealed: async () => {
1313
// For practical application use, pubEncKeyHandle should be the recipients public key
14-
// let str = <utf-8 string> or <buffer>;
14+
// let stringOrBuffer = <utf-8 string> or <buffer>;
15+
const stringOrBuffer = 'plain string to be encrypted';
1516
try {
16-
encryptedBuffer = await window.safeCryptoPubEncKey.encryptSealed(pubEncKeyHandle, str)
17+
encryptedBuffer = await window.safeCryptoPubEncKey.encryptSealed(pubEncKeyHandle, stringOrBuffer)
1718
} catch(err) {
1819
return err;
1920
}
20-
return `Returns encrypted data: ${String.fromCharCode.apply(null, new Uint8Array(res))}`;
21+
return `Returns encrypted data: ${String.fromCharCode.apply(null, new Uint8Array(encryptedBuffer))}`;
2122
},
2223

2324
encrypt: async () => {
2425
// For practical application use, pubEncKeyHandle should be the recipients public key
25-
// str can be <utf-8 string> or <buffer>;
26+
// stringOrBuffer can be <utf-8 string> or <buffer>;
2627
// secretKey must be 64-bit value
28+
const stringOrBuffer = 'plain string to be encrypted';
2729
try {
28-
encryptedBuffer = await window.safeCryptoPubEncKey.encrypt(pubEncKeyHandle, str, secretKey)
30+
encryptedBuffer = await window.safeCryptoPubEncKey.encrypt(pubEncKeyHandle, stringOrBuffer, secEncKeyHandle)
2931
} catch(err) {
3032
return err;
3133
}
32-
return `Returns encrypted data: ${String.fromCharCode.apply(null, new Uint8Array(res))}`;
34+
return `Returns encrypted data: ${String.fromCharCode.apply(null, new Uint8Array(encryptedBuffer))}`;
3335
},
3436

3537
free: () => {

safe_web_api_playground/static/js/code-snippets/safeCryptoSecEncKey.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ module.exports = {
1111

1212
decrypt: async () => {
1313
try {
14-
encryptedBuffer = await window.safeCryptoSecEncKey.decrypt(secEncKeyHandle, cipher, pubEncKeyHandle)
14+
decipheredBuffer = await window.safeCryptoSecEncKey.decrypt(secEncKeyHandle, encryptedBuffer, pubEncKeyHandle)
1515
} catch(err) {
1616
return err;
1717
}
18-
return `Returns encrypted data: ${String.fromCharCode.apply(null, new Uint8Array(res.buffer))}`;
18+
return `Returns deciphered data: ${String.fromCharCode.apply(null, new Uint8Array(decipheredBuffer))}`;
1919
},
2020

2121
free: () => {

safe_web_api_playground/static/js/code-snippets/safeMutableDataEntries.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ module.exports = {
3030
await window.safeMutableDataEntries.forEach(entriesHandle, (k, v) => {
3131

3232
let key = String.fromCharCode.apply(null, k);
33-
let value = String.fromCharCode.apply(null, new Uint8Array(v.buf));
33+
let value = String.fromCharCode.apply(null, v.buf);
3434

3535
console.log(key + ': ' + value);
3636

0 commit comments

Comments
 (0)