Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: error when using insecure identity on mainnet #4005

Merged
merged 5 commits into from
Nov 20, 2024

Conversation

lwshang
Copy link
Contributor

@lwshang lwshang commented Nov 19, 2024

SDK-1904

Description

This used to be a warning. A hard error can abort the command so that no insecure state will be on the mainnet.

Users can surpress this error by setting export DFX_WARNING=-mainnet_plaintext_identity.

The warning won't display when executing commands like dfx deploy --playground.

$ dfx deploy --ic
Error: Failed to create AgentEnvironment.
Caused by: Failed to create AgentEnvironment for network 'ic'.
Caused by: The default identity is not stored securely. Do not use it to control a lot of cycles/ICP.
- For enhanced security, create a new identity using the command:
    dfx identity new
  Then, specify the new identity in mainnet-facing commands with the --identity flag.
- If you understand the risks and still wish to use the insecure plaintext identity, you can suppress this warning by running:
    export DFX_WARNING="-mainnet_plaintext_identity"
  After setting this environment variable, re-run the command.

$ dfx deploy --playground
Deploying all canisters.
Reserving canisters in playground...
Reserved canister 'hello_backend' with id zrakb-eaaaa-aaaab-qacaq-cai with the playground.
Reserved canister 'hello_frontend' with id 6ldcj-gyaaa-aaaab-qacsa-cai with the playground.
Building canisters...
Building frontend...
Installing canisters...
...

How Has This Been Tested?

e2e tests in network.bash and identity.bash

Checklist:

  • The title of this PR complies with Conventional Commits.
  • I have edited the CHANGELOG accordingly.
  • I have made corresponding changes to the documentation.

@lwshang lwshang marked this pull request as ready for review November 19, 2024 17:13
@lwshang lwshang requested a review from a team as a code owner November 19, 2024 17:13
@lwshang lwshang enabled auto-merge (squash) November 19, 2024 22:20
@lwshang lwshang merged commit 06afa6f into master Nov 20, 2024
297 checks passed
@lwshang lwshang deleted the lwshang/insecure_identity branch November 20, 2024 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants