Skip to content

Commit 841ca60

Browse files
viviveeveerikonor
authored andcommitted
fix: dfx build no longer requires a password (#3813)
1 parent b5c4aae commit 841ca60

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
To do this, the `@dfinity/agent` version was updated as well.
1010

11+
### fix: `dfx build` no longer requires a password for password-protected identities
12+
1113
### feat: add `dfx schema` support for .json files related to extensions
1214

1315
- `dfx schema --for extension-manifest` corresponds to extension.json

e2e/tests-dfx/build.bash

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,3 +328,10 @@ teardown() {
328328
assert_command ls .dfx/actuallylocal/canisters/e2e_project_backend/
329329
assert_command ls .dfx/actuallylocal/canisters/e2e_project_backend/e2e_project_backend.wasm
330330
}
331+
332+
@test "dfx build does not require a password" {
333+
assert_command "${BATS_TEST_DIRNAME}/../assets/expect_scripts/init_alice_with_pw.exp"
334+
assert_command dfx identity use alice
335+
336+
assert_command timeout 30s dfx build --check
337+
}

scripts/workflows/provision-linux.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ if [ "$E2E_TEST" = "tests-dfx/identity_encryption.bash" ] \
3434
|| [ "$E2E_TEST" = "tests-dfx/generate.bash" ] \
3535
|| [ "$E2E_TEST" = "tests-dfx/start.bash" ] \
3636
|| [ "$E2E_TEST" = "tests-dfx/new.bash" ] \
37-
|| [ "$E2E_TEST" = "tests-dfx/call.bash" ]
37+
|| [ "$E2E_TEST" = "tests-dfx/call.bash" ] \
38+
|| [ "$E2E_TEST" = "tests-dfx/build.bash" ]
3839
then
3940
sudo apt-get install --yes expect
4041
fi

src/dfx/src/commands/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::config::cache::DiskBasedCache;
2-
use crate::lib::agent::create_agent_environment;
2+
use crate::lib::agent::create_anonymous_agent_environment;
33
use crate::lib::builders::BuildConfig;
44
use crate::lib::environment::Environment;
55
use crate::lib::error::DfxResult;
@@ -34,7 +34,7 @@ pub struct CanisterBuildOpts {
3434
}
3535

3636
pub fn exec(env: &dyn Environment, opts: CanisterBuildOpts) -> DfxResult {
37-
let env = create_agent_environment(env, opts.network.to_network_name())?;
37+
let env = create_anonymous_agent_environment(env, opts.network.to_network_name())?;
3838

3939
let logger = env.get_logger();
4040

0 commit comments

Comments
 (0)