Skip to content

Commit

Permalink
refactor: remove access control list from configuration canister (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
saikatdas0790 authored Jul 20, 2023
1 parent 0e83bec commit 212da69
Show file tree
Hide file tree
Showing 18 changed files with 80 additions and 473 deletions.
22 changes: 11 additions & 11 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ candid = "0.8.4"
ciborium = "0.2.1"
ic-cdk = "0.8.1"
ic-cdk-timers = "0.2.0"
ic-stable-structures = "0.5.4"
ic-stable-structures = "0.5.6"
ic-test-state-machine-client = "2.2.1"
rmp-serde = "1.1.1"
serde = "1.0.164"
serde = "1.0.171"
shared_utils = { path = "./src/lib/shared_utils" }
test_utils = { path = "./src/lib/test_utils" }
2 changes: 1 addition & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ let
rev = "cc45a3f8c98e1c33ca996e3504adefbf660a72d1";
nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz";
pkgs = import nixpkgs { };
dfx-env = import (builtins.fetchTarball "https://github.com/ninegua/ic-nix/releases/latest/download/dfx-env.tar.gz") { version = "20230704"; inherit pkgs; };
dfx-env = import (builtins.fetchTarball "https://github.com/ninegua/ic-nix/releases/download/20230704/dfx-env.tar.gz") { version = "20230704"; inherit pkgs; };
in
dfx-env.overrideAttrs (old: {
nativeBuildInputs = with pkgs; old.nativeBuildInputs ++
Expand Down
150 changes: 1 addition & 149 deletions dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,124 +33,6 @@
"package": "individual_user_template",
"type": "rust"
},
"internet_identity": {
"build": "",
"candid": "candid/internet_identity.did",
"remote": {
"id": {
"local": "qhbym-qaaaa-aaaaa-aaafq-cai"
}
},
"type": "custom",
"wasm": ""
},
"nns-cycles-minting": {
"build": "",
"candid": "candid/nns-cycles-minting.did",
"remote": {
"id": {
"ic": "rkp4c-7iaaa-aaaaa-aaaca-cai",
"local": "rkp4c-7iaaa-aaaaa-aaaca-cai"
}
},
"type": "custom",
"wasm": ""
},
"nns-dapp": {
"build": "",
"candid": "candid/nns-dapp.did",
"remote": {
"id": {
"local": "qsgjb-riaaa-aaaaa-aaaga-cai"
}
},
"type": "custom",
"wasm": ""
},
"nns-genesis-token": {
"build": "",
"candid": "candid/nns-genesis-token.did",
"remote": {
"id": {
"ic": "renrk-eyaaa-aaaaa-aaada-cai",
"local": "renrk-eyaaa-aaaaa-aaada-cai"
}
},
"type": "custom",
"wasm": ""
},
"nns-governance": {
"build": "",
"candid": "candid/nns-governance.did",
"remote": {
"id": {
"ic": "rrkah-fqaaa-aaaaa-aaaaq-cai",
"local": "rrkah-fqaaa-aaaaa-aaaaq-cai"
}
},
"type": "custom",
"wasm": ""
},
"nns-ledger": {
"build": "",
"candid": "candid/nns-ledger.did",
"remote": {
"id": {
"ic": "ryjl3-tyaaa-aaaaa-aaaba-cai",
"local": "ryjl3-tyaaa-aaaaa-aaaba-cai"
}
},
"type": "custom",
"wasm": ""
},
"nns-lifeline": {
"build": "",
"candid": "candid/nns-lifeline.did",
"remote": {
"id": {
"ic": "rno2w-sqaaa-aaaaa-aaacq-cai",
"local": "rno2w-sqaaa-aaaaa-aaacq-cai"
}
},
"type": "custom",
"wasm": ""
},
"nns-registry": {
"build": "",
"candid": "candid/nns-registry.did",
"remote": {
"id": {
"ic": "rwlgt-iiaaa-aaaaa-aaaaa-cai",
"local": "rwlgt-iiaaa-aaaaa-aaaaa-cai"
}
},
"type": "custom",
"wasm": ""
},
"nns-root": {
"build": "",
"candid": "candid/nns-root.did",
"remote": {
"id": {
"ic": "r7inp-6aaaa-aaaaa-aaabq-cai",
"local": "r7inp-6aaaa-aaaaa-aaabq-cai"
}
},
"type": "custom",
"wasm": ""
},
"nns-sns-wasm": {
"build": "",
"candid": "candid/nns-sns-wasm.did",
"remote": {
"id": {
"ic": "qaa6y-5yaaa-aaaaa-aaafa-cai",
"local": "qaa6y-5yaaa-aaaaa-aaafa-cai"
}
},
"type": "custom",
"wasm": ""
},
"post_cache": {
"candid": "./src/canister/post_cache/can.did",
"declarations": {
Expand All @@ -162,36 +44,6 @@
"package": "post_cache",
"type": "rust"
},
"sns_governance": {
"build": "",
"candid": "candid/sns_governance.did",
"type": "custom",
"wasm": ""
},
"sns_index": {
"build": "",
"candid": "candid/sns_index.did",
"type": "custom",
"wasm": ""
},
"sns_ledger": {
"build": "",
"candid": "candid/sns_ledger.did",
"type": "custom",
"wasm": ""
},
"sns_root": {
"build": "",
"candid": "candid/sns_root.did",
"type": "custom",
"wasm": ""
},
"sns_swap": {
"build": "",
"candid": "candid/sns_swap.did",
"type": "custom",
"wasm": ""
},
"user_index": {
"candid": "./src/canister/user_index/can.did",
"declarations": {
Expand All @@ -205,4 +57,4 @@
}
},
"version": 1
}
}
2 changes: 1 addition & 1 deletion sns
Submodule sns updated from fdcf65 to a49bff
8 changes: 2 additions & 6 deletions src/canister/configuration/can.did
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ type ConfigurationInitArgs = record {
signups_enabled : opt bool;
access_control_map : opt vec record { principal; vec UserAccessRole };
};
type ErrorUpdateListOfWellKnownPrincipals = variant { Unauthorized };
type KnownPrincipalType = variant {
CanisterIdUserIndex;
CanisterIdConfiguration;
Expand All @@ -15,7 +14,7 @@ type KnownPrincipalType = variant {
CanisterIdSNSController;
UserIdGlobalSuperAdmin;
};
type Result = variant { Ok; Err : ErrorUpdateListOfWellKnownPrincipals };
type Result = variant { Ok; Err : text };
type UserAccessRole = variant {
CanisterController;
ProfileOwner;
Expand All @@ -27,14 +26,11 @@ service : (ConfigurationInitArgs) -> {
get_current_list_of_all_well_known_principal_values : () -> (
vec record { KnownPrincipalType; principal },
) query;
get_user_roles : (principal) -> (vec UserAccessRole) query;
get_well_known_principal_value : (KnownPrincipalType) -> (
opt principal,
) query;
toggle_signups_enabled : () -> ();
toggle_signups_enabled : () -> (Result);
update_list_of_well_known_principals : (KnownPrincipalType, principal) -> (
Result,
);
update_user_add_role : (UserAccessRole, principal) -> ();
update_user_remove_role : (UserAccessRole, principal) -> ();
}

This file was deleted.

3 changes: 0 additions & 3 deletions src/canister/configuration/src/api/access_control/mod.rs

This file was deleted.

Loading

0 comments on commit 212da69

Please sign in to comment.