Skip to content

Latest commit

 

History

History
482 lines (452 loc) · 14.1 KB

migration-guide-0.1.x-0.2.0.md

File metadata and controls

482 lines (452 loc) · 14.1 KB

LibVCX migration guide from 0.1.x to 0.2.0

A Developer Guide for LibVCX migration

This document is written for developers using LibVCX to provide necessary information and to simplify their transition to LibVCX 0.1.x from LibVCX 0.2.

Notes

In the following tables, there are mappings for each LibVCX API part of how 0.1.x functionality maps to 0.2.0.

Functions from version 0.1.x are listed in the left column, and the equivalent 0.2.0 function is placed in the right column.

  • If some function had been added, the word 'NEW' would be placed in the left column.
  • If some function had been deleted, the word 'DELETED' would be placed in the right column.
  • If some function had been changed, the current format would be placed in the right column.
  • If some function had not been changed, the symbol '=' would be placed in the right column.
  • To get more details about current format of a function click on the description above it.
  • Bellow are signatures of functions in LibVCX C API. The params of cb (except command_handle and err) will be result values of the similar function in any LibVCX wrapper.

API

Credential Definition API

v0.1.x - Credential Definition API v0.2.0 - Credential Definition API
Get Payment Txn for Credential definition
get_payment_txn(handle: u32) 
            -> Result<PaymentTxn, CredDefError>
        
get_cred_def_payment_txn(handle: u32) 
            -> Result<PaymentTxn, CredDefError>
        
Get Revocation Registry ID
NEW
get_rev_reg_id(handle: u32) 
            -> Result<Option<String>, CredDefError>
        
Get Tails File
NEW
get_tails_file(handle: u32) 
            -> Result<Option<String>, CredDefError>
        
Get Revocation Registry Definition
NEW
get_rev_reg_def(handle: u32) 
            -> Result<Option<String>, CredDefError>
        
Get Revocation Registry Definition Payment Txn
NEW
get_rev_reg_def_payment_txn(handle: u32) 
            -> Result<Option<String>, CredDefError>
        
Get Revocation Registry Delta Payment Txn
NEW
get_rev_reg_delta_payment_txn(handle: u32) 
            -> Result<Option<String>, CredDefError>
        
Find Handle By Revocation Registry Id
NEW
find_handle(cred_def_id: &str) 
            -> Result<u32, CredDefError>
        

Wallet API

There are no actual API changes, but there is one new parameter available for vcx_provision_agent and vcx_agent_provision_async config variable. It is wallet_type - it can be used to enable different wallet types.

Issuer Credential API

v0.1.x - Issuer Credential API v0.2.0 - Issuer Credential API
Revoke Credential
vcx_issuer_create_credential(
    command_handle: u32,
    source_id: *const c_char,
    cred_def_handle: u32,
    issuer_did: *const c_char,
    credential_data: *const c_char,
    credential_name: *const c_char,
    price: *const c_char,
    cb: Option<fn(xcommand_handle: u32, 
                  err: u32, 
                  credential_handle: u32)>) -> u32
        
Changed the format of param credential_data. 
was "{"state":["UT"]}", now "{"state":"UT"}"
        
Revoke Credential
NEW
vcx_issuer_revoke_credential(
        command_handle: u32,
        credential_handle: u32,
        cb: Option<fn(xcommand_handle: u32, 
                      err: u32)>) -> u32
        
Revoke Credential (Rust API)
NEW
revoke_credential(handle: u32) 
                -> Result<(), u32>
        

Proof API

v0.1.x - Proof API v0.2.0 - Proof API
Create Proof
vcx_proof_create(
        command_handle: u32,
        source_id: *const c_char,
        requested_attrs: *const c_char,
        requested_predicates: *const c_char,
        name: *const c_char,
        cb: Option<extern fn(xcommand_handle: u32, 
                             err: u32, 
                             proof_handle: u32)>) -> u32
            
vcx_proof_create(
        command_handle: u32,
        source_id: *const c_char,
        requested_attrs: *const c_char,
        requested_predicates: *const c_char,
        revocation_interval: *const c_char,
        name: *const c_char,
        cb: Option<extern fn(xcommand_handle: u32, 
                             err: u32, 
                             proof_handle: u32)>) -> u32
            
vcx_disclosed_proof_generate_proof(
             proof_handle: u32,
             selected_credentials: *const c_char,
             self_attested_attrs: *const c_char,
             cb: Option) -> u32
        
Changed the format of param selected_credentials. 
was "{
    "attrs":{
        "attr_key": "cred_info":{}
    }
}", 
now "{
    "attrs":{
        "attr_key":{
            "credential":{"cred_info":{},"tails_file": Optional(string)}
        }
    }
}"
        

Logger API

The main purpose of this API is to forward logs of libvcx and wrappers to its consumers. It is needed if you consume libvcx as a .so or .dll - so you can forward logs from libvcx to your logging framework. You don't need this endpoints if you use libvcx through the wrapper -- in Java and Python wrappers they are already forwarded to slf4j for Java, log crate for Rust and default logging facade for python.
libvcx sets the same log function for libindy as well.

v0.1.x - Logger API v0.2.0 - Logger API
Set custom logger implementation
NEW
              vcx_set_logger(context: *const c_void,
                             enabled: Option bool>,
                             log: Option,
                              flush: Option) -> ErrorCode
          
Set default logger implementation.
NEW
              vcx_set_default_logger(pattern: *const c_char) -> ErrorCode
          
Get the currently used logger.
NEW
              vcx_get_logger(context_p: *mut *const c_void,
                             enabled_cb_p: *mut Option bool>,
                             log_cb_p: *mut Option,
                             flush_cb_p: *mut Option)
          

Libvcx 0.2.0 to 0.2.1 migration Guide

The Libvcx 0.2.1 release contains fixes that don't affect API functions.

Libvcx 0.2.1 to 0.2.2 migration Guide

The Libvcx 0.2.2 release contains fixes that don't affect API functions.

Libvcx 0.2.2 to 0.2.3 migration Guide

Changes

  • Migrated Libvcx to failure crate for better handling and error chaining.

  • Added synchronous vcx_get_current_error API function that returns details for last occurred error.

  • Updated Libvcx wrappers for automatic getting error details:

    • Python - added sdk_error_full_message, sdk_error_cause and sdk_error_backtrace fields to VcxError object.
    • Java - added sdkMessage, sdkFullMessage, sdkCause and sdkBacktrace fields to VcxException.
    • Objective-C - added error, message, cause, backtrace fields to userInfo dictionary in NSError object.
  • Updated Libvcx to support community A2A protocol. Added protocol_type field to VCX provisioning config with indicates A2A message format will be used.

  • Bugfixes

v0.2.2 - Libvcx API v0.2.3 - Libvcx API
Get details for last occurred error.
NEW
vcx_get_current_error(error_json_p: *mut *const c_char)

Libvcx 0.2.2 to 0.2.3 migration Guide

The Libvcx 0.2.3 release contains fixes that don't affect API functions.