Skip to content

Commit

Permalink
Merge pull request #124 from planetarium/improve-security
Browse files Browse the repository at this point in the history
Improve security
  • Loading branch information
boscohyun authored Aug 7, 2024
2 parents ba3a1b2 + f1bdc32 commit 7ceb768
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 11 deletions.
9 changes: 9 additions & 0 deletions extension/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@
"showPk": {
"message": "Show PrivateKey"
},
"hidePk": {
"message": "Hide PrivateKey"
},
"showPkDesc": {
"message": "If your private key is leaked, your account may be hacked. The service does not ask for your private key under any circumstances."
},
Expand All @@ -148,5 +151,11 @@
},
"bridgeWNCGDesc5": {
"message": "If failure, it is returned to the sender's account."
},
"showMnemonic": {
"message": "Show Seed Phrase"
},
"hideMnemonic": {
"message": "Hide Seed Phrase"
}
}
9 changes: 9 additions & 0 deletions extension/_locales/ko/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@
"showPk": {
"message": "개인키 보기"
},
"hidePk": {
"message": "개인키 가리기"
},
"showPkDesc": {
"message": "개인키 유출시 계정이 해킹될 수 있습니다. 서비스는 어떠한 경우에도 개인키를 요청하지 않습니다."
},
Expand All @@ -148,5 +151,11 @@
},
"bridgeWNCGDesc5": {
"message": "전송실패시 전송자 계정으로 반환됩니다."
},
"showMnemonic": {
"message": "시드 구문 보기"
},
"hideMnemonic": {
"message": "시드 구문 가리기"
}
}
34 changes: 33 additions & 1 deletion popup/src/components/AccountManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,38 @@
<v-file-input v-if="imports.importType == 'json'" label="Private Key File" v-model="imports.jsonFile" />
<v-text-field type="password" v-if="imports.importType == 'json'" color="pointyellow" :rules="requiredRule" :error-messages="imports.error" class="point-input" filled dense rows="4" label="Passphrase" v-model="imports.jsonPassphrase" />

<v-textarea v-if="imports.importType == 'raw'" color="pointyellow" :rules="requiredRule" :error-messages="imports.error" class="point-input" filled dense rows="4" label="Private Key" v-model="imports.privateKey"></v-textarea>
<v-text-field
v-if="imports.importType == 'raw' && !imports.showPrivateKey"
:type="'password'"
color="pointyellow"
:rules="requiredRule"
:error-messages="imports.error"
class="point-input"
filled
dense
rows="4"
label="Private Key"
v-model="imports.privateKey"
/>
<v-textarea
v-if="imports.importType == 'raw' && imports.showPrivateKey"
color="pointyellow"
:rules="requiredRule"
:error-messages="imports.error"
class="point-input"
filled
dense
rows="4"
label="Private Key"
v-model="imports.privateKey"
/>
<v-btn
color="point"
dark
outlined
@click="imports.showPrivateKey = !imports.showPrivateKey">
{{ imports.showPrivateKey ? t('hidePk') : t('showPk') }}
</v-btn>
</div>
</template>
<v-card-actions class="justify-space-between">
Expand Down Expand Up @@ -140,6 +171,7 @@ export default defineComponent({
dialog: false,
accountName: "",
privateKey: "",
showPrivateKey: false,
error: null as string | null,
importType: "raw",
jsonFile: undefined as File | undefined,
Expand Down
80 changes: 70 additions & 10 deletions popup/src/views/InitiateMnemonic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,77 @@
<v-card-text class="px-4 pb-0">
<v-row>
<v-col class="pa-0">
<v-tabs dark color="point" center-active v-model="tab" fixed-tabs height="36px">
<v-tab>{{t('createNewAccount')}}</v-tab>
<v-tab>{{t('recoverAccount')}}</v-tab>
</v-tabs>
<v-tabs dark color="point" center-active v-model="tab" fixed-tabs height="36px">
<v-tab>{{t('createNewAccount')}}</v-tab>
<v-tab>{{t('recoverAccount')}}</v-tab>
</v-tabs>
</v-col>
</v-row>

<v-row>
<v-col class="pa-2">
<div v-if="tab == 0" class="mt-4">
<v-textarea :label="t('mnemonic')" readonly height="128px" dark outlined background-color="#333" v-model="mnemonic"></v-textarea>
</div>
<div v-if="tab == 1" class="mt-4">
<v-textarea :label="t('mnemonicInput')" height="128px" :error-messages="errorRecoverMnemonic" dark outlined background-color="#333" v-model="recoverMnemonic"></v-textarea>
</div>
<div v-if="tab == 0" class="mt-4">
<v-text-field
v-if="!showMnemonic"
:label="t('mnemonic')"
:type="'password'"
readonly
multi-line
dark
outlined
background-color="#333"
v-model="mnemonic"
/>
<v-textarea
v-if="showMnemonic"
:label="t('mnemonic')"
readonly
rows="3"
dark
outlined
background-color="#333"
v-model="mnemonic"
/>
<v-btn
color="point"
dark
outlined
@click="showMnemonic = !showMnemonic">
{{ showMnemonic ? t('hideMnemonic') : t('showMnemonic') }}
</v-btn>
</div>
<div v-if="tab == 1" class="mt-4">
<v-text-field
v-if="!showRecoverMnemonic"
:label="t('mnemonicInput')"
:type="'password'"
multi-line
height="128px"
:error-messages="errorRecoverMnemonic"
dark
outlined
background-color="#333"
v-model="recoverMnemonic"
/>
<v-textarea
v-if="showRecoverMnemonic"
:label="t('mnemonicInput')"
readonly
rows="3"
:error-messages="errorRecoverMnemonic"
dark
outlined
background-color="#333"
v-model="recoverMnemonic"
/>
<v-btn
color="point"
dark
outlined
@click="showRecoverMnemonic = !showRecoverMnemonic">
{{ showRecoverMnemonic ? t('hideMnemonic') : t('showMnemonic') }}
</v-btn>
</div>
</v-col>
</v-row>

Expand Down Expand Up @@ -89,6 +145,8 @@ export default defineComponent({
errorRecoverMnemonic: string | null;
wallet: Raw<HDNodeWallet> | null;
loading: boolean;
showMnemonic: boolean;
showRecoverMnemonic: boolean;
} {
return {
checks: [false, false],
Expand All @@ -98,6 +156,8 @@ export default defineComponent({
errorRecoverMnemonic: null,
wallet: null,
loading: false,
showMnemonic: false,
showRecoverMnemonic: false,
};
},
computed: {
Expand Down

0 comments on commit 7ceb768

Please sign in to comment.