Skip to content

Commit

Permalink
fix: don't hidden deprecated validate_xxxxx APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
zensh committed Sep 27, 2024
1 parent 7f0b867 commit 3c82d90
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ strip = true
opt-level = 's'

[workspace.package]
version = "0.3.3"
version = "0.3.4"
edition = "2021"
repository = "https://github.com/ldclabs/ic-cose"
keywords = ["config", "cbor", "canister", "icp", "encryption"]
Expand Down
7 changes: 7 additions & 0 deletions src/declarations/ic_cose_canister/ic_cose_canister.did
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ type PublicKeyOutput = record { public_key : blob; chain_code : blob };
type Result = variant { Ok; Err : text };
type Result_1 = variant { Ok : NamespaceInfo; Err : text };
type Result_10 = variant { Ok : StateInfo; Err : text };
type Result_11 = variant { Ok : text; Err : text };
type Result_2 = variant { Ok : vec NamespaceInfo; Err : text };
type Result_3 = variant { Ok : ECDHOutput; Err : text };
type Result_4 = variant { Ok : PublicKeyOutput; Err : text };
Expand Down Expand Up @@ -166,6 +167,12 @@ service : (opt ChainArgs) -> {
Result_7,
);
state_get_info : () -> (Result_10) query;
validate2_admin_add_allowed_apis : (vec text) -> (Result_11);
validate2_admin_add_auditors : (vec principal) -> (Result_11);
validate2_admin_add_managers : (vec principal) -> (Result_11);
validate2_admin_remove_allowed_apis : (vec text) -> (Result_11);
validate2_admin_remove_auditors : (vec principal) -> (Result_11);
validate2_admin_remove_managers : (vec principal) -> (Result_11);
validate_admin_add_allowed_apis : (vec text) -> (Result);
validate_admin_add_auditors : (vec principal) -> (Result);
validate_admin_add_managers : (vec principal) -> (Result);
Expand Down
17 changes: 17 additions & 0 deletions src/declarations/ic_cose_canister/ic_cose_canister.did.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ export type Result_1 = { 'Ok' : NamespaceInfo } |
{ 'Err' : string };
export type Result_10 = { 'Ok' : StateInfo } |
{ 'Err' : string };
export type Result_11 = { 'Ok' : string } |
{ 'Err' : string };
export type Result_2 = { 'Ok' : Array<NamespaceInfo> } |
{ 'Err' : string };
export type Result_3 = { 'Ok' : ECDHOutput } |
Expand Down Expand Up @@ -209,6 +211,21 @@ export interface _SERVICE {
Result_7
>,
'state_get_info' : ActorMethod<[], Result_10>,
'validate2_admin_add_allowed_apis' : ActorMethod<[Array<string>], Result_11>,
'validate2_admin_add_auditors' : ActorMethod<[Array<Principal>], Result_11>,
'validate2_admin_add_managers' : ActorMethod<[Array<Principal>], Result_11>,
'validate2_admin_remove_allowed_apis' : ActorMethod<
[Array<string>],
Result_11
>,
'validate2_admin_remove_auditors' : ActorMethod<
[Array<Principal>],
Result_11
>,
'validate2_admin_remove_managers' : ActorMethod<
[Array<Principal>],
Result_11
>,
'validate_admin_add_allowed_apis' : ActorMethod<[Array<string>], Result>,
'validate_admin_add_auditors' : ActorMethod<[Array<Principal>], Result>,
'validate_admin_add_managers' : ActorMethod<[Array<Principal>], Result>,
Expand Down
31 changes: 31 additions & 0 deletions src/declarations/ic_cose_canister/ic_cose_canister.did.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ export const idlFactory = ({ IDL }) => {
'vetkd_key_name' : IDL.Text,
});
const Result_10 = IDL.Variant({ 'Ok' : StateInfo, 'Err' : IDL.Text });
const Result_11 = IDL.Variant({ 'Ok' : IDL.Text, 'Err' : IDL.Text });
return IDL.Service({
'admin_add_allowed_apis' : IDL.Func([IDL.Vec(IDL.Text)], [Result], []),
'admin_add_auditors' : IDL.Func([IDL.Vec(IDL.Principal)], [Result], []),
Expand Down Expand Up @@ -258,6 +259,36 @@ export const idlFactory = ({ IDL }) => {
[],
),
'state_get_info' : IDL.Func([], [Result_10], ['query']),
'validate2_admin_add_allowed_apis' : IDL.Func(
[IDL.Vec(IDL.Text)],
[Result_11],
[],
),
'validate2_admin_add_auditors' : IDL.Func(
[IDL.Vec(IDL.Principal)],
[Result_11],
[],
),
'validate2_admin_add_managers' : IDL.Func(
[IDL.Vec(IDL.Principal)],
[Result_11],
[],
),
'validate2_admin_remove_allowed_apis' : IDL.Func(
[IDL.Vec(IDL.Text)],
[Result_11],
[],
),
'validate2_admin_remove_auditors' : IDL.Func(
[IDL.Vec(IDL.Principal)],
[Result_11],
[],
),
'validate2_admin_remove_managers' : IDL.Func(
[IDL.Vec(IDL.Principal)],
[Result_11],
[],
),
'validate_admin_add_allowed_apis' : IDL.Func(
[IDL.Vec(IDL.Text)],
[Result],
Expand Down
6 changes: 6 additions & 0 deletions src/ic_cose_canister/ic_cose_canister.did
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ service : (opt ChainArgs) -> {
validate2_admin_remove_allowed_apis : (vec text) -> (Result_11);
validate2_admin_remove_auditors : (vec principal) -> (Result_11);
validate2_admin_remove_managers : (vec principal) -> (Result_11);
validate_admin_add_allowed_apis : (vec text) -> (Result);
validate_admin_add_auditors : (vec principal) -> (Result);
validate_admin_add_managers : (vec principal) -> (Result);
validate_admin_remove_allowed_apis : (vec text) -> (Result);
validate_admin_remove_auditors : (vec principal) -> (Result);
validate_admin_remove_managers : (vec principal) -> (Result);
vetkd_encrypted_key : (SettingPath, blob) -> (Result_5);
vetkd_public_key : (SettingPath) -> (Result_5);
}
12 changes: 6 additions & 6 deletions src/ic_cose_canister/src/api_admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ fn admin_list_namespace(

// ----- Use validate2_xxxxxx instead of validate_xxxxxx -----

#[ic_cdk::update(hidden = true)]
#[ic_cdk::update]
fn validate_admin_add_managers(args: BTreeSet<Principal>) -> Result<(), String> {
validate_principals(&args)?;
Ok(())
Expand All @@ -101,7 +101,7 @@ fn validate2_admin_add_managers(args: BTreeSet<Principal>) -> Result<String, Str
Ok("ok".to_string())
}

#[ic_cdk::update(hidden = true)]
#[ic_cdk::update]
fn validate_admin_remove_managers(args: BTreeSet<Principal>) -> Result<(), String> {
validate_principals(&args)?;
Ok(())
Expand All @@ -113,7 +113,7 @@ fn validate2_admin_remove_managers(args: BTreeSet<Principal>) -> Result<String,
Ok("ok".to_string())
}

#[ic_cdk::update(hidden = true)]
#[ic_cdk::update]
fn validate_admin_add_auditors(args: BTreeSet<Principal>) -> Result<(), String> {
validate_principals(&args)?;
Ok(())
Expand All @@ -125,7 +125,7 @@ fn validate2_admin_add_auditors(args: BTreeSet<Principal>) -> Result<String, Str
Ok("ok".to_string())
}

#[ic_cdk::update(hidden = true)]
#[ic_cdk::update]
fn validate_admin_remove_auditors(args: BTreeSet<Principal>) -> Result<(), String> {
validate_principals(&args)?;
Ok(())
Expand All @@ -137,7 +137,7 @@ fn validate2_admin_remove_auditors(args: BTreeSet<Principal>) -> Result<String,
Ok("ok".to_string())
}

#[ic_cdk::update(hidden = true)]
#[ic_cdk::update]
fn validate_admin_add_allowed_apis(_args: BTreeSet<String>) -> Result<(), String> {
Ok(())
}
Expand All @@ -147,7 +147,7 @@ fn validate2_admin_add_allowed_apis(_args: BTreeSet<String>) -> Result<String, S
Ok("ok".to_string())
}

#[ic_cdk::update(hidden = true)]
#[ic_cdk::update]
fn validate_admin_remove_allowed_apis(_args: BTreeSet<String>) -> Result<(), String> {
Ok(())
}
Expand Down

0 comments on commit 3c82d90

Please sign in to comment.