Update missing inputmode numeric when adding a new TOTP. (#3160)

This commit is contained in:
George Wu 2024-10-29 05:57:24 -07:00 committed by GitHub
parent ce31abeeb0
commit fbb3b6b2db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 24 additions and 23 deletions

View file

@ -35,7 +35,8 @@
name="checkTOTPCode" name="checkTOTPCode"
id="new-totp-check" id="new-totp-check"
value="(( totp_value ))" value="(( totp_value ))"
type="number" type="text"
inputmode="numeric"
required required
/> />

View file

@ -388,7 +388,7 @@ mod tests {
assert!(cr.is_ok()); assert!(cr.is_ok());
} }
// Tests it is not possible to create an applicatin without the linked group attribute // Tests it is not possible to create an application without the linked group attribute
#[idm_test] #[idm_test]
async fn test_idm_application_no_linked_group( async fn test_idm_application_no_linked_group(
idms: &IdmServer, idms: &IdmServer,
@ -418,7 +418,7 @@ mod tests {
assert!(cr.is_err()); assert!(cr.is_err());
} }
// Tests creating an applicatin with a real linked group attribute // Tests creating an application with a real linked group attribute
#[idm_test] #[idm_test]
async fn test_idm_application_linked_group( async fn test_idm_application_linked_group(
idms: &IdmServer, idms: &IdmServer,

View file

@ -2460,17 +2460,17 @@ impl<'a> IdmServerCredUpdateTransaction<'a> {
// Check the label. // Check the label.
if !LABEL_RE.is_match(&label) { if !LABEL_RE.is_match(&label) {
error!("SSH Pubilc Key label invalid"); error!("SSH Public Key label invalid");
return Err(OperationError::InvalidLabel); return Err(OperationError::InvalidLabel);
} }
if session.sshkeys.contains_key(&label) { if session.sshkeys.contains_key(&label) {
error!("SSH Pubilc Key label duplicate"); error!("SSH Public Key label duplicate");
return Err(OperationError::DuplicateLabel); return Err(OperationError::DuplicateLabel);
} }
if session.sshkeys.values().any(|sk| *sk == sshpubkey) { if session.sshkeys.values().any(|sk| *sk == sshpubkey) {
error!("SSH Pubilc Key duplicate"); error!("SSH Public Key duplicate");
return Err(OperationError::DuplicateKey); return Err(OperationError::DuplicateKey);
} }
@ -2692,7 +2692,7 @@ mod tests {
) -> (CredentialUpdateSessionToken, CredentialUpdateSessionStatus) { ) -> (CredentialUpdateSessionToken, CredentialUpdateSessionStatus) {
let mut idms_prox_write = idms.proxy_write(ct).await.unwrap(); let mut idms_prox_write = idms.proxy_write(ct).await.unwrap();
// Remove the default all persons policy, it interfers with our test. // Remove the default all persons policy, it interferes with our test.
let modlist = ModifyList::new_purge(Attribute::CredentialTypeMinimum); let modlist = ModifyList::new_purge(Attribute::CredentialTypeMinimum);
idms_prox_write idms_prox_write
.qs_write .qs_write
@ -3067,7 +3067,7 @@ mod tests {
let cutxn = idms.cred_update_transaction().await.unwrap(); let cutxn = idms.cred_update_transaction().await.unwrap();
// Now fake going back in time .... allows the tokne to decrypt, but the session // Now fake going back in time .... allows the token to decrypt, but the session
// is gone anyway! // is gone anyway!
let c_status = cutxn let c_status = cutxn
.credential_update_status(&cust, ct) .credential_update_status(&cust, ct)

View file

@ -6363,7 +6363,7 @@ mod tests {
btreeset!["value_b".to_string()], btreeset!["value_b".to_string()],
), ),
), ),
// Map with a different seperator // Map with a different separator
Modify::Present( Modify::Present(
Attribute::OAuth2RsClaimMap, Attribute::OAuth2RsClaimMap,
Value::OauthClaimMap( Value::OauthClaimMap(

View file

@ -2335,7 +2335,7 @@ mod tests {
// Check the uat. // Check the uat.
} }
_ => { _ => {
error!("A critical error has occurred! We have a non-succcess result!"); error!("A critical error has occurred! We have a non-success result!");
panic!(); panic!();
} }
} }
@ -2469,7 +2469,7 @@ mod tests {
token token
} }
_ => { _ => {
error!("A critical error has occurred! We have a non-succcess result!"); error!("A critical error has occurred! We have a non-success result!");
panic!(); panic!();
} }
} }
@ -2540,7 +2540,7 @@ mod tests {
// Check the uat. // Check the uat.
} }
_ => { _ => {
error!("A critical error has occurred! We have a non-succcess result!"); error!("A critical error has occurred! We have a non-success result!");
panic!(); panic!();
} }
} }
@ -3311,7 +3311,7 @@ mod tests {
// Check the uat. // Check the uat.
} }
_ => { _ => {
error!("A critical error has occurred! We have a non-succcess result!"); error!("A critical error has occurred! We have a non-success result!");
panic!(); panic!();
} }
} }
@ -3843,7 +3843,7 @@ mod tests {
match state { match state {
AuthState::Success(uat, AuthIssueSession::Token) => uat, AuthState::Success(uat, AuthIssueSession::Token) => uat,
_ => { _ => {
error!("A critical error has occurred! We have a non-succcess result!"); error!("A critical error has occurred! We have a non-success result!");
panic!(); panic!();
} }
} }

View file

@ -140,7 +140,7 @@ fn enforce_unique<VALID, STATE>(
// We can probably bisect over the filter to work this out? // We can probably bisect over the filter to work this out?
if conflict_cand { if conflict_cand {
// Some kind of confilct exists. We need to isolate which parts of the filter were suspect. // Some kind of conflict exists. We need to isolate which parts of the filter were suspect.
// To do this, we bisect over the filter and it's suspect elements. // To do this, we bisect over the filter and it's suspect elements.
// //
// In most cases there is likely only 1 suspect element. But in some there are more. To make // In most cases there is likely only 1 suspect element. But in some there are more. To make

View file

@ -56,7 +56,7 @@ const GID_NSPAWN_MAX: u32 = 1879048191;
const GID_UNUSED_D_MIN: u32 = 0x7000_0000; const GID_UNUSED_D_MIN: u32 = 0x7000_0000;
pub const GID_UNUSED_D_MAX: u32 = 0x7fff_ffff; pub const GID_UNUSED_D_MAX: u32 = 0x7fff_ffff;
/// Anything above 2147483648 can confuse the kernel (so basicly half the address space /// Anything above 2147483648 can confuse the kernel (so basically half the address space
/// can't be accessed. /// can't be accessed.
// const GID_UNSAFE_MAX: u32 = 2147483648; // const GID_UNSAFE_MAX: u32 = 2147483648;
@ -109,7 +109,7 @@ fn apply_gidnumber<T: Clone>(
|| (GID_UNUSED_B_MIN..= GID_UNUSED_B_MAX).contains(&gid) || (GID_UNUSED_B_MIN..= GID_UNUSED_B_MAX).contains(&gid)
|| (GID_UNUSED_C_MIN..=GID_UNUSED_C_MAX).contains(&gid) || (GID_UNUSED_C_MIN..=GID_UNUSED_C_MAX).contains(&gid)
// We won't ever generate an id in the nspawn range, but we do secretly allow // We won't ever generate an id in the nspawn range, but we do secretly allow
// it to be set for compatability with services like freeipa or openldap. TBH // it to be set for compatibility with services like freeipa or openldap. TBH
// most people don't even use systemd nspawn anyway ... // most people don't even use systemd nspawn anyway ...
// //
// I made this design choice to avoid a tunable that may confuse people to // I made this design choice to avoid a tunable that may confuse people to

View file

@ -216,7 +216,7 @@ fn do_leaf_memberof(
tgte.set_ava_set(&Attribute::MemberOf, mo); tgte.set_ava_set(&Attribute::MemberOf, mo);
} }
// If the group has memberOf attributes, we propogate these to // If the group has memberOf attributes, we propagate these to
// our entry now. // our entry now.
if let Some(group_mo) = memberof_ref { if let Some(group_mo) = memberof_ref {
// IMPORTANT this can't be a NONE because we just create MO in // IMPORTANT this can't be a NONE because we just create MO in
@ -359,7 +359,7 @@ fn apply_memberof(
); );
// Since our groups memberof (and related, direct member of) has changed, we // Since our groups memberof (and related, direct member of) has changed, we
// need to propogate these values forward into our members. At this point we // need to propagate these values forward into our members. At this point we
// mark all our members as being part of the affected set. // mark all our members as being part of the affected set.
let pre_member = pre.get_ava_refer(Attribute::Member); let pre_member = pre.get_ava_refer(Attribute::Member);
let post_member = tgte.get_ava_refer(Attribute::Member); let post_member = tgte.get_ava_refer(Attribute::Member);

View file

@ -1964,7 +1964,7 @@ async fn test_repl_increment_consumer_ruv_trim_past_valid(
drop(server_b_txn); drop(server_b_txn);
} }
// Test two synchronised nodes where changes are not occuring - this situation would previously // Test two synchronised nodes where changes are not occurring - this situation would previously
// cause issues because when a change did occur, the ruv would "jump" ahead and cause desyncs.w // cause issues because when a change did occur, the ruv would "jump" ahead and cause desyncs.w
#[qs_pair_test] #[qs_pair_test]
async fn test_repl_increment_consumer_ruv_trim_idle_servers( async fn test_repl_increment_consumer_ruv_trim_idle_servers(
@ -3438,7 +3438,7 @@ async fn test_repl_increment_session_new(server_a: &QueryServer, server_b: &Quer
/// ensures that any RUV state to a server is now fresh and unique /// ensures that any RUV state to a server is now fresh and unique
/// ///
/// Second, to prevent tainting the RUV with outdated information, we need to stop it /// Second, to prevent tainting the RUV with outdated information, we need to stop it
/// propogating when consumed. At the end of each consumption, the RUV should be trimmed /// propagating when consumed. At the end of each consumption, the RUV should be trimmed
/// if and only if entries exist in it that exceed the CL max. It is only trimmed conditionally /// if and only if entries exist in it that exceed the CL max. It is only trimmed conditionally
/// to prevent infinite replication loops since a trim implies the creation of a new anchor. /// to prevent infinite replication loops since a trim implies the creation of a new anchor.

View file

@ -2700,7 +2700,7 @@ mod tests {
async fn test_scim_entry_structure(server: &QueryServer) { async fn test_scim_entry_structure(server: &QueryServer) {
let mut read_txn = server.read().await.unwrap(); let mut read_txn = server.read().await.unwrap();
// Query entry (A buitin one ?) // Query entry (A builtin one ?)
let entry = read_txn let entry = read_txn
.internal_search_uuid(UUID_IDM_PEOPLE_SELF_NAME_WRITE) .internal_search_uuid(UUID_IDM_PEOPLE_SELF_NAME_WRITE)
.unwrap(); .unwrap();

View file

@ -256,7 +256,7 @@ mod tests {
use kanidm_lib_crypto::CryptoPolicy; use kanidm_lib_crypto::CryptoPolicy;
// Test the remove operation, removing all application passwords for an // Test the remove operation, removing all application passwords for an
// applicaiton should also remove the KV pair. // application should also remove the KV pair.
#[test] #[test]
fn test_valueset_application_password_remove() { fn test_valueset_application_password_remove() {
let app1_uuid = Uuid::new_v4(); let app1_uuid = Uuid::new_v4();