fn validate_user_id_and_signature(
    ingress_signature_verifier: &dyn IngressSigVerifier,
    sender: &UserId,
    message_id: &MessageId,
    signature: Option<&UserSignature>,
    current_time: Time,
    registry_version: RegistryVersion,
) -> Result<CanisterIdSet, RequestValidationError> {
    match signature {
        None => {
            if sender.get().is_anonymous() {
                return Ok(CanisterIdSet::All);
            }
            Err(MissingSignature(*sender))
        }
        Some(signature) => {
            if sender.get().is_anonymous() {
                Err(AnonymousSignatureNotAllowed)
            } else {
                let sender_pubkey = &signature.signer_pubkey;
                validate_user_id(sender_pubkey, sender).and_then(|()| {
                    validate_signature(
                        ingress_signature_verifier,
                        message_id,
                        signature,
                        current_time,
                        registry_version,
                    )
                })
            }
        }
    }
}
// Verifies correct user and signature.
Verifies correct user and signature.
Verifies correct user and signature .
fn validate_user_id_and_signature(
    ingress_signature_verifier: &dyn IngressSigVerifier,
    sender: &UserId,
    message_id: &MessageId,
    signature: Option<&UserSignature>,
    current_time: Time,
    registry_version: RegistryVersion,
) -> Result<CanisterIdSet, RequestValidationError> {
    match signature {
        None => {
            if sender.get().is_anonymous() {
                return Ok(CanisterIdSet::All);
            }
            Err(MissingSignature(*sender))
        }
        Some(signature) => {
            if sender.get().is_anonymous() {
                Err(AnonymousSignatureNotAllowed)
            } else {
                let sender_pubkey = &signature.signer_pubkey;
                validate_user_id(sender_pubkey, sender).and_then(|()| {
                    validate_signature(
                        ingress_signature_verifier,
                        message_id,
                        signature,
                        current_time,
                        registry_version,
                    )
                })
            }
        }
    }
}
fn validate_user_id_and_signature ( ingress_signature_verifier : & dyn IngressSigVerifier , sender : & UserId , message_id : & MessageId , signature : Option < & UserSignature > , current_time : Time , registry_version : RegistryVersion , ) -> Result < CanisterIdSet , RequestValidationError > { match signature { None => { if sender . get ( ) . is_anonymous ( ) { return Ok ( CanisterIdSet :: All ) ; } Err ( MissingSignature ( * sender ) ) } Some ( signature ) => { if sender . get ( ) . is_anonymous ( ) { Err ( AnonymousSignatureNotAllowed ) } else { let sender_pubkey = & signature . signer_pubkey ; validate_user_id ( sender_pubkey , sender ) . and_then ( | ( ) | { validate_signature ( ingress_signature_verifier , message_id , signature , current_time , registry_version , ) } ) } } } }
Verifies correct user and signature.
Verifies correct user and signature .
ingress_signature_verifier
&dyn IngressSigVerifier
sender
&UserId
message_id
&MessageId
signature
Option<&UserSignature>
current_time
Time
registry_version
RegistryVersion
ingress_signature_verifier
&dyn IngressSigVerifier
sender
&UserId
message_id
&MessageId
signature
Option<&UserSignature>
current_time
Time
registry_version
RegistryVersion