kristoferlund / ic-siwe

SIWE, Sign in with Ethereum for ICP, the Internet Computer. Build cross chain Ethereum apps on ICP!
https://shtr2-2iaaa-aaaal-qckva-cai.icp0.io
MIT License
20 stars 12 forks source link

Add/runtime feature disable eth icp mapping #6

Closed kristoferlund closed 8 months ago

kristoferlund commented 8 months ago

Adds additional runtime feature settings to the provider canister.

pub enum RuntimeFeature {
    // Enabling this feature will include the app frontend URI as part of the identity seed.
    IncludeUriInSeed,

    // (NEW) Disable the mapping of Ethereum address to principal. This also disables canister endpoints `get_principal`.
    DisableEthToPrincipalMapping,

    // (NEW) Disable the mapping of principal to Ethereum address. This also disables canister endpoints `get_address` and `get_caller_address`.
    DisablePrincipalToEthMapping,
}

To activate, add to deploy script or Makefile:

  runtime_features = opt vec { \
    variant { DisableEthToPrincipalMapping }; \
    variant { DisablePrincipalToEthMapping }; \
  }; \