Skip to content
Snippets Groups Projects
Select Git revision
  • 8562ab5b38557bf33c5b86cf34cd4668ba3854c0
  • main default protected
  • release/1.1
  • encrypt_comments
  • mnemonic_dewif
  • authors_rules
  • 0.14
  • rtd
  • 1.2.1 protected
  • 1.2.0 protected
  • 1.1.1 protected
  • 1.1.0 protected
  • 1.0.0 protected
  • 1.0.0rc1 protected
  • 1.0.0rc0 protected
  • 1.0.0-rc protected
  • 0.62.0 protected
  • 0.61.0 protected
  • 0.60.1 protected
  • 0.58.1 protected
  • 0.60.0 protected
  • 0.58.0 protected
  • 0.57.0 protected
  • 0.56.0 protected
  • 0.55.1 protected
  • 0.55.0 protected
  • 0.54.3 protected
  • 0.54.2 protected
28 results

make.bat

Blame
  • identities.rs 12.05 KiB
    //  Copyright (C) 2017-2019  The AXIOM TEAM Association.
    //
    // This program is free software: you can redistribute it and/or modify
    // it under the terms of the GNU Affero General Public License as
    // published by the Free Software Foundation, either version 3 of the
    // License, or (at your option) any later version.
    //
    // This program is distributed in the hope that it will be useful,
    // but WITHOUT ANY WARRANTY; without even the implied warranty of
    // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    // GNU Affero General Public License for more details.
    //
    // You should have received a copy of the GNU Affero General Public License
    // along with this program.  If not, see <https://www.gnu.org/licenses/>.
    
    //! Identities stored index.
    
    use crate::constants::*;
    use crate::paging::PagingFilter;
    use crate::*;
    use dubp_common_doc::traits::Document;
    use dubp_common_doc::{BlockNumber, Blockstamp};
    use dubp_user_docs::documents::identity::IdentityDocumentV10;
    use dup_crypto::keys::*;
    use durs_dbs_tools::DbError;
    use durs_wot::WotId;
    use serde::{Deserialize, Serialize};
    use std::collections::HashMap;
    
    #[derive(Debug, Copy, Clone, PartialEq, Eq)]
    /// Identities filter
    pub struct IdentitiesFilter {
        /// Pagination parameters
        pub paging: PagingFilter,
        /// Filter identities by public key
        pub by_pubkey: Option<PubKey>,
    }
    
    impl Default for IdentitiesFilter {
        fn default() -> Self {
            IdentitiesFilter {
                paging: PagingFilter::default(),
                by_pubkey: None,
            }
        }
    }
    
    impl IdentitiesFilter {
        /// Create "by pubkey" filter
        pub fn by_pubkey(pubkey: PubKey) -> Self {
            IdentitiesFilter {
                paging: PagingFilter::default(),
                by_pubkey: Some(pubkey),
            }
        }
    }
    
    #[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq, Hash)]
    /// Identity state
    pub enum DbIdentityState {
        /// Member
        Member(Vec<usize>),
        /// Expire Member
        ExpireMember(Vec<usize>),
        /// Explicit Revoked
        ExplicitRevoked(Vec<usize>),
        /// Explicit Revoked after expire
        ExplicitExpireRevoked(Vec<usize>),
        /// Implicit revoked
        ImplicitRevoked(Vec<usize>),