Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qa 2024 09 27 #141

Merged
merged 41 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
01ef40b
sudoken: v0.0.5
zo-el Oct 3, 2022
bc62211
sudoken: v0.0.6
robbiecarlton Nov 17, 2022
14e74e3
hc_seed_bundle: v0.1.4
zo-el Nov 18, 2022
9c6c2f9
Merge pull request #117 from Holo-Host/bump-dependecies-22-11-17
robbiecarlton Nov 21, 2022
a27807a
holochain: v0.1.0-rc
zo-el Dec 28, 2022
8c0f5a0
version bump
zo-el Dec 28, 2022
607bdca
seed-bundle: holoport_key
zo-el Dec 28, 2022
5177e95
set code owners
alastairong Mar 6, 2023
2d2a1fe
Merge pull request #118 from Holo-Host/add-codeowner
alastairong Mar 7, 2023
bfaced6
sudoken: 0.0.9
zo-el May 15, 2023
cbb63d8
fix: quick-start-status-code
Feb 9, 2024
711b08e
Merge pull request #121 from Holo-Host/fix/quick-start-status-code
peeech Feb 9, 2024
d3900b5
bump sodoken
peeech Apr 25, 2024
83facc7
bump wasm-bindgen-cli
peeech Apr 25, 2024
42586e7
use workspace.dependencies
peeech Apr 25, 2024
a36f862
bump ed25519-dalek to 2.1.1
peeech Apr 25, 2024
ca14a0d
update versions in Cargo.toml
peeech Apr 26, 2024
fc27468
move to flake.nix
peeech May 1, 2024
ba35220
Merge pull request #126 from Holo-Host/audit-fixes
peeech Jun 5, 2024
fac41ee
update cargo deps
peeech Jun 14, 2024
27b81ea
Merge pull request #128 from Holo-Host/cargo-update
peeech Jun 14, 2024
b7bbda5
wip: v3
zo-el May 14, 2024
70075dc
wip: v3
zo-el May 14, 2024
e8a3e26
fix tests
zo-el May 29, 2024
beb45be
added todos
zo-el May 29, 2024
b8855a9
hpos-config: tests
zo-el Jun 3, 2024
7396ddc
Interim commit with tests passing
Jul 12, 2024
d1c7a78
ui tweaks and v3 updates
Paterick Jul 18, 2024
01a6d91
git ignore
Paterick Jul 18, 2024
526188a
pass pubkeys as bytes
zo-el Jul 18, 2024
557d5bb
fix error on multiple hps, ui tweaks, and re-enable memproof check
Paterick Jul 24, 2024
0a2a37a
design review changes
Paterick Jul 25, 2024
84a93ca
pr feedback suggestions
Paterick Jul 30, 2024
6125ac1
Merge pull request #130 from Holo-Host/v3_ui_tweaks-suggestion
Paterick Jul 30, 2024
4b907cc
fix package-lock issue
alastairong1 Aug 19, 2024
2247aaa
Added missing v3 implementation (#131)
mattgeddes Aug 21, 2024
77d740c
Added missing commit for host pub key (#134)
mattgeddes Aug 22, 2024
0f86dab
feat: set up direnv, formatter and format flake (#133)
steveej Aug 27, 2024
fc330e9
feat: add passphrase confirmation (#138)
mateuszRybczonek Sep 17, 2024
2bd060f
Added some basic logging (#139)
mattgeddes Sep 20, 2024
43ccdb2
Merge branch 'QA' into qa-2024-09-27
peeech Sep 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ structopt = "0.3.25"
serde = { version = "1.0.123", features = ["derive"] }
base64 = "0.13.0"
failure = "0.1.5"
log = "0.4.22"
6 changes: 6 additions & 0 deletions gen-web/res/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,12 @@ <h1 class="step-title">
<input id="seed-passphrase" class="input" name="seed-passphrase" type="text"/>
</div>
<span id="seed-passphrase-error-message" class="error-red"></span>

<div id="confirm-passphrase-form-item" class="input-container confirm-passphrase">
<label id="confirm-passphrase-label" class="input-label" for="confirm-passphrase">Confirm Passphrase</label>
<input id="confirm-passphrase" class="input" name="confirm-passphrase" type="text"/>
</div>
<span id="confirm-passphrase-error-message" class="error-red"></span>
</div>


Expand Down
6 changes: 4 additions & 2 deletions gen-web/res/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@ form > .input-container:not(:first-child) {
margin-bottom: 10px;
}


.confirm-passphrase {
margin-top: 30px;
}

/* Image & Icon Elements */
.holo-banner {
Expand Down Expand Up @@ -651,7 +653,7 @@ button {
background-color: #ffffff;
width: 151px;
height: 42px;
box-sizing: border-box;
box-sizing: border-box;
}

.action-button,
Expand Down
19 changes: 16 additions & 3 deletions gen-web/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
const inputs = {
registrationCode: document.querySelector('#registration-code'),
seedPassphrase: document.querySelector('#seed-passphrase'),
confirmPassphrase: document.querySelector('#confirm-passphrase'),
email: document.querySelector('#email'),
password: document.querySelector('#password'),
passwordCheck: document.querySelector('#password-check'),
Expand All @@ -61,6 +62,7 @@
emailInputArea: document.querySelector('#email-form-item'),
registrationCodeInputArea: document.querySelector('#registration-code-form-item'),
seedPassphraseInputArea: document.querySelector('#seed-passphrase-form-item'),
confirmPassphraseInputArea: document.querySelector('#confirm-passphrase-form-item'),
emailReadOnly: document.querySelector('#email-read-only'),
passwordInputArea: document.querySelector('#password-form-item'),
passwordCheckInputArea: document.querySelector('#password-check-form-item'),
Expand All @@ -73,6 +75,7 @@
const errorMessages = {
missingFields: 'Please complete missing fields.',
seedPassphrase: 'Your passphrase needs to be at least 20 characters in length',
confirmPassphrase: 'Passphrases do not match',
registrationCode: 'Invalid code',
email: 'Invalid email format',
password: 'Your password needs to be at least 8 characters in length',
Expand All @@ -88,6 +91,7 @@

// global variable used to pass seed passphrase between steps 2 and 3
let seedPassphrase
let confirmPassphrase

/** Actions executed at button click
* ======================================
Expand Down Expand Up @@ -124,6 +128,7 @@
return
}
seedPassphrase = inputs.seedPassphrase.value
confirmPassphrase = inputs.confirmPassphrase.value

updateUiStep(3)
updateProgressBar(2)
Expand Down Expand Up @@ -247,7 +252,7 @@
buttons.genSeed.disabled = true
buttons.genSeed.innerHTML = 'Saved Seed & Key Files'
verifySeedDownloadComplete(downloadSeedTracker)
}, 2000)
}, 2000)
},
download: async () => {
/* Communicate visually that something is happening in the background */
Expand Down Expand Up @@ -414,12 +419,14 @@
/* Bind input actions to inputArea actions */
inlineVariables.registrationCodeInputArea.onclick = e => { inputs.registrationCode.focus(); return click.activateInput(e) }
inlineVariables.seedPassphraseInputArea.onclick = e => { inputs.seedPassphrase.focus(); return click.activateInput(e) }
inlineVariables.confirmPassphraseInputArea.onclick = e => { inputs.confirmPassphrase.focus(); return click.activateInput(e) }
inlineVariables.emailInputArea.onclick = e => { inputs.email.focus(); return click.activateInput(e) }
inlineVariables.passwordInputArea.onclick = e => { inputs.password.focus(); return click.activateInput(e) }
inlineVariables.passwordCheckInputArea.onclick = e => { inputs.passwordCheck.focus(); return click.activateInput(e) }
/* Bind actions to inputs */
inputs.registrationCode.onfocus = click.activateInput
inputs.seedPassphrase.onfocus = click.activateInput
inputs.confirmPassphrase.onfocus = click.activateInput
inputs.email.onfocus = click.activateInput
inputs.password.onfocus = click.activateInput
inputs.passwordCheck.onfocus = click.activateInput
Expand Down Expand Up @@ -683,6 +690,7 @@
*/
const resetFields = (inputElements) => {
inlineVariables.formErrorMessage.innerHTML = ''

for (let inputElement of inputElements) {
inputElement.classList.remove('error-red')
document.querySelector(`#${inputElement.id}-error-message`).innerHTML = ''
Expand Down Expand Up @@ -766,14 +774,19 @@
return valid
}
const confirmValidPassPhrase = () => {
const inputElements = Object.values({ seedPassphrase: inputs.seedPassphrase })
const inputElements = Object.values({ seedPassphrase: inputs.seedPassphrase, confirmPassphrase: inputs.confirmPassphrase })
resetFields(inputElements)

if (!inputs.seedPassphrase.value) {
const missingFields = inputElements.filter(inputs => !inputs.value)
renderInputError(errorMessages.missingFields, missingFields)
} else if (!validatePassphrae(inputs.seedPassphrase.value)) {
renderInputError(errorMessages.seedPassphrase, [inputs.seedPassphrase])
} else return true
} else if (inputs.seedPassphrase.value !== inputs.confirmPassphrase.value) {
renderInputError(errorMessages.confirmPassphrase, [inputs.confirmPassphrase])
} else {
return true
}
}

})()
1 change: 1 addition & 0 deletions seed-bundle-explorer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ rmp-serde = "1.1.0"
thiserror = "1.0"
one_err = "0.0.8"
base36 = "0.0.1"
log = { workspace = true }

[dev-dependencies]
tokio = { workspace = true, features = [ "full" ] }
Expand Down
9 changes: 8 additions & 1 deletion seed-bundle-explorer/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use ed25519_dalek::{ed25519, SigningKey, VerifyingKey};
use hc_seed_bundle::*;
use hpos_config_core::Config;
use log::debug;

/// get pub key for the device bundle in the config
pub async fn holoport_public_key(
Expand Down Expand Up @@ -112,21 +113,27 @@ pub async fn unlock(
device_bundle: &String,
passphrase: Option<String>,
) -> SeedExplorerResult<SigningKey> {
debug!("Base64 decoding device bundle.");
let cipher = base64::decode_config(device_bundle, base64::URL_SAFE_NO_PAD)?;
debug!("Matching device bundle cipher.");
match UnlockedSeedBundle::from_locked(&cipher).await?.remove(0) {
LockedSeedCipher::PwHash(cipher) => {
let passphrase = passphrase
.as_ref()
.ok_or(SeedExplorerError::PasswordRequired)?;
debug!("PwHash cipher used and password present.");
let passphrase = sodoken::BufRead::from(passphrase.as_bytes().to_vec());
debug!("Unlocking seed with passphrase.");
let seed = cipher.unlock(passphrase).await?;

debug!("Casting seed to 32-byte slice.");
let seed_bytes: [u8; 32] = match (&*seed.get_seed().read_lock())[0..32].try_into() {
Ok(b) => b,
Err(_) => {
debug!("Seed not 32 bytes: {:?}", &seed.get_seed());
return Err(SeedExplorerError::Generic(
"Seed buffer is not 32 bytes long".into(),
))
));
}
};

Expand Down