Skip to content

Commit

Permalink
Merge pull request #9 from kristoferlund/dev
Browse files Browse the repository at this point in the history
v0.0.7
  • Loading branch information
kristoferlund authored Jul 5, 2024
2 parents 553b5ef + f946d32 commit 7072092
Show file tree
Hide file tree
Showing 11 changed files with 781 additions and 272 deletions.
1,006 changes: 752 additions & 254 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions packages/ic_siwe/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.0.7] - 2024-07-05

### Changed

- Updated dependencies: candid, ic-cdk, ic-cdk-timers

## [0.0.6] - 2024-03-25

### Added
Expand Down
8 changes: 4 additions & 4 deletions packages/ic_siwe/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ic_siwe"
version = "0.0.6"
version = "0.0.7"
edition = "2021"
authors = ["Kristofer Lund <[email protected]>"]
description = "Integrate Ethereum wallet-based authentication (SIWE) with applications on the Internet Computer (ICP) platform."
Expand All @@ -15,10 +15,10 @@ serde = { version = "1.0.188", features = ["derive"] }
serde_json = "1.0.66"
serde_bytes = "0.11"
serde_cbor = "0.11"
candid = "0.9.11"
candid = "0.10.9"
hex = "0.4.3"
ic-cdk = "0.11.3"
ic-cdk-timers = { version = "0.5.1", optional = true }
ic-cdk = "0.15.0"
ic-cdk-timers = { version = "0.9.0", optional = true }
ic-certified-map = "0.4.0"
url = "2.4.1"
time = { version = "0.3.30", features = ["formatting"] }
Expand Down
2 changes: 1 addition & 1 deletion packages/ic_siwe/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ thread_local! {

// The settings control the behavior of the SIWE library. The settings must be initialized
// before any other library functions are called.
static SETTINGS: RefCell<Option<Settings>> = RefCell::new(None);
static SETTINGS: RefCell<Option<Settings>> = const { RefCell::new(None) };

// SIWE messages are stored in global state during the login process. The key is the
// Ethereum address as a byte array and the value is the SIWE message. After a successful
Expand Down
6 changes: 6 additions & 0 deletions packages/ic_siwe_provider/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.0.7] - 2024-07-05

### Changed

- Updated dependencies: candid, ic-cdk, ic-stable-structures

## [0.0.6] - 2024-03-25

### Added
Expand Down
14 changes: 7 additions & 7 deletions packages/ic_siwe_provider/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ic_siwe_provider"
version = "0.0.6"
version = "0.0.7"
edition = "2021"
authors = ["Kristofer Lund <[email protected]>"]
description = "Using the pre built ic_siwe_provider canister is the easiest way to integrate Ethereum wallet authentication into an Internet Computer (ICP) application."
Expand All @@ -12,10 +12,10 @@ repository = "https://github.com/kristoferlund/ic-siwe"
crate-type = ["cdylib"]

[dependencies]
candid = "0.9.11"
ic-cdk = "0.11.3"
candid = "0.10.9"
ic-cdk = "0.15.0"
ic_siwe = { path = "../ic_siwe" }
ic-stable-structures = "0.6.0"
ic-stable-structures = "0.6.5"
ic-certified-map = "0.4.0"
serde = "1.0.193"
serde_json = "1.0.108"
Expand All @@ -24,8 +24,8 @@ serde_bytes = "0.11"
[dev-dependencies]
ethers = "2.0.10"
hex = "0.4.3"
ic-agent = "0.29.0"
pocket-ic = "2.0.1"
ic-agent = "0.36.0"
pocket-ic = "3.1.0"
siwe = "0.6"
rand = "0.8.4"
ring = "0.16.20"
ring = "0.17.7"
Binary file modified packages/ic_siwe_provider/ic_siwe_provider.wasm.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions packages/ic_siwe_provider/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ thread_local! {
static MEMORY_MANAGER: RefCell<MemoryManager<DefaultMemoryImpl>> =
RefCell::new(MemoryManager::init(DefaultMemoryImpl::default()));

static SETTINGS: RefCell<Settings> = RefCell::new(Settings {
static SETTINGS: RefCell<Settings> = const { RefCell::new(Settings {
disable_eth_to_principal_mapping: false,
disable_principal_to_eth_mapping: false,
});
}) };

static PRINCIPAL_ADDRESS: RefCell<StableBTreeMap<Blob<29>, [u8;20], VirtualMemory<DefaultMemoryImpl>>> = RefCell::new(
StableBTreeMap::init(
Expand Down
1 change: 0 additions & 1 deletion packages/ic_siwe_provider/tests/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ pub fn create_delegated_identity(
pubkey: identity.public_key().unwrap(),
expiration: login_response.expiration,
targets,
senders: None,
},
signature,
};
Expand Down
4 changes: 2 additions & 2 deletions packages/test_canister/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
crate-type = ["cdylib"]

[dependencies]
candid = "0.9.11"
ic-cdk = "0.11.3"
candid = "0.10.9"
ic-cdk = "0.15.0"

[dev-dependencies]
2 changes: 1 addition & 1 deletion packages/test_canister/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use ic_cdk::{init, query};
type GetAddressResponse = Result<String, String>;

thread_local! {
static SIWE_PROVIDER_CANISTER: RefCell<Option<Principal>> = RefCell::new(None);
static SIWE_PROVIDER_CANISTER: RefCell<Option<Principal>> = const { RefCell::new(None) };
}

/// The whoami method returns the calling principal and the eth address of the caller. A prerequisite
Expand Down

0 comments on commit 7072092

Please sign in to comment.