Skip to content

Commit 6ef4541

Browse files
authored
fix: II init args in PocketIC (#10344)
1 parent 7813995 commit 6ef4541

2 files changed

Lines changed: 46 additions & 2 deletions

File tree

rs/pocket_ic_server/src/external_canister_types.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,25 @@ pub struct DummyAuthConfig {
126126
pub prompt_for_index: bool,
127127
}
128128

129+
#[derive(CandidType)]
130+
pub struct DnssecRootAnchor {
131+
pub key_tag: u16,
132+
pub algorithm: u8,
133+
pub digest_type: u8,
134+
pub digest: Vec<u8>,
135+
}
136+
137+
#[derive(CandidType)]
138+
pub struct DnssecConfig {
139+
pub root_anchors: Vec<DnssecRootAnchor>,
140+
}
141+
142+
#[derive(CandidType)]
143+
pub struct DohConfig {
144+
pub allowed_domains: Vec<String>,
145+
pub max_cache_age_secs: Option<u64>,
146+
}
147+
129148
#[derive(CandidType)]
130149
pub struct InternetIdentityFrontendInit {
131150
pub backend_canister_id: Principal,
@@ -154,4 +173,6 @@ pub struct InternetIdentityInit {
154173
pub backend_canister_id: Option<Principal>,
155174
pub backend_origin: Option<String>,
156175
pub sso_discoverable_domains: Option<Vec<String>>,
176+
pub dnssec_config: Option<Option<DnssecConfig>>,
177+
pub doh_config: Option<Option<DohConfig>>,
157178
}

rs/pocket_ic_server/src/pocket_ic.rs

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2058,6 +2058,10 @@ impl PocketIcSubnets {
20582058
// The initial values have been adapted from the mainnet values obtained by calling
20592059
// `dfx canister call rdmx6-jaaaa-aaaaa-aaadq-cai config --ic`:
20602060
// record {
2061+
// doh_config = opt opt record {
2062+
// max_cache_age_secs = opt (3_600 : nat64);
2063+
// allowed_domains = vec { "gmail.com"; "googlemail.com"; "outlook.com"; "hotmail.com"; "msn.com"; "live.com"; "icloud.com"; "me.com"; "mac.com"; "yahoo.com"; "ymail.com"; "aol.com"; "zoho.com"; "fastmail.com"; "fastmail.fm"; "hey.com"; "yandex.com"; "yandex.ru"; "mail.ru"; "qq.com"; "163.com"; "126.com"; "naver.com"; "daum.net";};
2064+
// };
20612065
// is_production = opt true;
20622066
// backend_canister_id = opt principal "rdmx6-jaaaa-aaaaa-aaadq-cai";
20632067
// enable_dapps_explorer = opt false;
@@ -2066,10 +2070,27 @@ impl PocketIcSubnets {
20662070
// 7_569_744 : nat64;
20672071
// };
20682072
// new_flow_origins = opt vec { "https://id.ai" };
2073+
// dnssec_config = opt opt record {
2074+
// root_anchors = vec {
2075+
// record {
2076+
// algorithm = 8 : nat8;
2077+
// key_tag = 20_326 : nat16;
2078+
// digest_type = 2 : nat8;
2079+
// digest = blob "\e0\6d\44\b8\0b\8f\1d\39\a9\5c\0b\0d\7c\65\d0\84\58\e8\80\40\9b\bc\68\34\57\10\42\37\c7\f8\ec\8d";
2080+
// };
2081+
// record {
2082+
// algorithm = 8 : nat8;
2083+
// key_tag = 38_696 : nat16;
2084+
// digest_type = 2 : nat8;
2085+
// digest = blob "\68\3d\2d\0a\cb\8c\9b\71\2a\19\48\b2\7f\74\12\19\29\8d\0a\45\0d\61\2c\48\3a\f4\44\a4\c0\fb\2b\16";
2086+
// };
2087+
// };
2088+
// };
2089+
// sso_discoverable_domains = null;
20692090
// archive_config = opt record {
20702091
// polling_interval_ns = 15_000_000_000 : nat64;
20712092
// entries_buffer_limit = 10_000 : nat64;
2072-
// module_hash = blob "\97\44\02\c9\03\a7\ff\da\36\20\8b\cc\5e\05\9d\df\2a\b0\d0\fa\8b\ef\19\a3\1a\d8\c9\99\1f\5b\db\9a";
2093+
// module_hash = blob "\00\73\a8\b8\4e\b1\57\86\da\34\9e\b3\98\0a\84\cb\c7\fb\f0\35\88\d9\d0\9c\52\37\a8\99\70\45\1d\98";
20732094
// entries_fetch_limit = 1_000 : nat16;
20742095
// };
20752096
// canister_creation_cycles_cost = opt (0 : nat64);
@@ -2083,10 +2104,10 @@ impl PocketIcSubnets {
20832104
// };
20842105
// related_origins = opt vec {
20852106
// "https://id.ai";
2086-
// "https://backend.id.ai";
20872107
// "https://identity.ic0.app";
20882108
// "https://identity.internetcomputer.org";
20892109
// "https://identity.icp0.io";
2110+
// "https://identity.icp.net";
20902111
// };
20912112
// openid_configs = opt vec {
20922113
// record {
@@ -2180,6 +2201,8 @@ impl PocketIcSubnets {
21802201
backend_canister_id: Some(IDENTITY_CANISTER_ID.get().0),
21812202
backend_origin: None,
21822203
sso_discoverable_domains: None,
2204+
dnssec_config: None, // DIFFERENT FROM ICP MAINNET
2205+
doh_config: None, // DIFFERENT FROM ICP MAINNET
21832206
});
21842207
ii_subnet
21852208
.state_machine

0 commit comments

Comments
 (0)