Uploaded image for project: 'MaidSafe-Core'
  1. MAID-2312

Add access container entry field to the AuthGranted struct

    Details

    • Type: New Feature
    • Status: In Review (View workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: Client Libs
    • Security Level: Public
    • Labels:
      None
    • Story Points:
      6

      Description

      When app receives AuthGranted from the authenticator, it might want to compare the permissions it got with the permissions it wanted, and if they differ, issue another container request. To do this, it currently needs to fetch its access container entry from the network.

      There is a opportunity to optimize this, because the authenticator, at the point it assembles the AuthGranted struct, already has the access container entry of the app, but currently it's throwing it away.

      So the task is: add the access container entry to the AuthGranted struct, to save the app the need to fetch it from the network.

      Proposed changes to the API:

      Rust side:

      pub struct AuthGranted {
          pub app_keys: AppKeys,
          pub bootstrap_config: BootstrapConfig,
          pub access_container_info: AccessContInfo,
          pub access_container_entry: AccessContainerEntry,
      }
      

      FFI side:

      pub struct AuthGranted {
          pub app_keys: AppKeys,
          pub bootstrap_config_ptr: *mut u8,
          pub bootstrap_config_len: usize,
          pub bootstrap_config_cap: usize,
          pub access_container_info: AccessContInfo,
          pub access_container_entry: AccessContainerEntry,
      }
      
      struct AccessContainerEntry {
          pub ptr: *mut ContainerInfo,
          pub len: usize,
          pub cap: usize,
      }
      
      struct ContainerInfo {
          name: *const c_char,
          mdata_info: MDataInfo,
          permissions: PermissionSet,
      }
      

      This requires to create FFI representation of MDataInfo and deprecating/removing the object cache paradigm it currently uses. Possible implementation:

      pub struct MDataInfo {
          pub name: XorNameArray,
          pub type_tag: u64,
      
          pub has_enc_key: bool,
          pub enc_key: SymSecretKey,
          
          pub has_enc_nonce: bool,
          pub enc_none: SymNonce,
      }
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                adam.ciganek Adam Cigánek
                Reporter:
                adam.ciganek Adam Cigánek
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: