Skip to content

Commit

Permalink
Merge branch 'fix/emergency-access' into 'rc'
Browse files Browse the repository at this point in the history
fix: cannot view shared items in emergency access view grantor

See merge request locker/web!47
  • Loading branch information
duchunter committed Sep 22, 2023
2 parents 30e858e + d498727 commit 139dd37
Show file tree
Hide file tree
Showing 10 changed files with 774 additions and 607 deletions.
12 changes: 8 additions & 4 deletions src/renderer/components/cipher/cipher-types/login/LoginInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,14 @@
/>
</template>
<!-- OTP -->
<div
class="my-5 text-black-700 text-head-6 font-semibold"
>
<div class="my-5 text-black-700 text-head-6 font-semibold">
{{ $t('data.ciphers.otp.setup') }}
</div>
<!-- Input -->
<div>
<PasswordOTP
:value="totp"
:disabled="isDeleted"
class="w-full"
@change="val => $emit('update:totp', val)"
@createNewOtp="val => $emit('update:isCreateAuthenticator', val)"
Expand All @@ -70,7 +69,12 @@ import PasswordGenerator from '../../../password/PasswordGenerator'
import PasswordOTP from './PasswordOTP.vue'
export default {
components: { InputText, PasswordStrengthBar, PasswordGenerator, PasswordOTP },
components: {
InputText,
PasswordStrengthBar,
PasswordGenerator,
PasswordOTP
},
props: {
isDeleted: {
type: Boolean,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
:label="$t('data.ciphers.otp.otp_option')"
:initial-value="option"
:options="options"
:disabled="disabled"
@change="changeOption"
/>
<InputSelect
Expand All @@ -14,13 +15,15 @@
:required="true"
:options="otps"
:filterable="true"
:disabled="disabled"
@change="changeOtp"
/>
<InputText
v-else-if="option === 'new' || initialValue"
v-model="notes"
:label="$t('data.ciphers.otp.secret_key')"
:required="true"
:disabled="disabled"
@input="changeOtp"
/>
<div class="flex items-center justify-between mt-3">
Expand Down Expand Up @@ -86,6 +89,10 @@ export default {
value: {
type: String,
default: ''
},
disabled: {
type: Boolean,
default: false
}
},
data () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -708,9 +708,9 @@
</template>

<script>
import EmergencyContact from './EmergencyContact.vue'
import { Utils } from '@/core/misc/utils.ts'
import PasswordStrengthBar from '@/components/password/PasswordStrengthBar'
import EmergencyContact from '@/components/setting/EmergencyContact.vue'
import { SymmetricCryptoKey } from '@/core/models/domain/symmetricCryptoKey'
import { MIN_MASTER_PW_LEN } from '@/constants'
export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@
</template>

<script>
import InputText from '../input/InputText'
import { Utils } from '../../core/misc/utils.ts'
import InputText from '../../input/InputText'
import { Utils } from '../../../core/misc/utils.ts'
export default {
components: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,10 @@
<!-- Body end -->

<!-- Footer -->
<div slot="footer" class="dialog-footer flex items-center text-left">
<div>
<button class="btn btn-default" @click="closeDialog">
{{ $t('common.close') }}
</button>
</div>
<div slot="footer" class="dialog-footer flex items-center justify-end">
<el-button @click="closeDialog">
{{ $t('common.close') }}
</el-button>
</div>
<!-- Footer end -->
</component>
Expand All @@ -180,30 +178,30 @@
<script>
import { Dialog } from 'element-ui'
import { ValidationProvider, ValidationObserver } from 'vee-validate'
import { SecureNoteType } from '../../core/enums'
import { CipherType } from '../../core/enums/cipherType'
import { Cipher } from '../../core/models/domain'
import { SecureNoteType } from '../../../core/enums'
import { CipherType } from '../../../core/enums/cipherType'
import { Cipher } from '../../../core/models/domain'
import {
CipherView,
LoginView,
SecureNoteView,
IdentityView,
CardView,
LoginUriView
} from '../../core/models/view'
import InputText from '../input/InputText'
import LoginInput from '../cipher/cipher-types/login/LoginInput.vue'
import CardInput from '../cipher/cipher-types/card/CardInput.vue'
import IdentityInput from '../cipher/cipher-types/identity/IdentityInput.vue'
import CryptoBackupInput from '../cipher/cipher-types/crypto-backup/CryptoBackupInput.vue'
import DriverLicenseInput from '../cipher/cipher-types/driver-license/DriverLicenseInput.vue'
import CitizenIdInput from '../cipher/cipher-types/citizen-id/CitizenIdInput.vue'
import PassportInput from '../cipher/cipher-types/passport/PassportInput.vue'
import SsnInput from '../cipher/cipher-types/ssn/SsnInput.vue'
import RouterInput from '../cipher/cipher-types/router/RouterInput.vue'
import ServerInput from '../cipher/cipher-types/server/ServerInput.vue'
import ApiInput from '../cipher/cipher-types/api/ApiInput.vue'
import DatabaseInput from '../cipher/cipher-types/database/DatabaseInput.vue'
} from '../../../core/models/view'
import InputText from '../../input/InputText'
import LoginInput from '../../cipher/cipher-types/login/LoginInput.vue'
import CardInput from '../../cipher/cipher-types/card/CardInput.vue'
import IdentityInput from '../../cipher/cipher-types/identity/IdentityInput.vue'
import CryptoBackupInput from '../../cipher/cipher-types/crypto-backup/CryptoBackupInput.vue'
import DriverLicenseInput from '../../cipher/cipher-types/driver-license/DriverLicenseInput.vue'
import CitizenIdInput from '../../cipher/cipher-types/citizen-id/CitizenIdInput.vue'
import PassportInput from '../../cipher/cipher-types/passport/PassportInput.vue'
import SsnInput from '../../cipher/cipher-types/ssn/SsnInput.vue'
import RouterInput from '../../cipher/cipher-types/router/RouterInput.vue'
import ServerInput from '../../cipher/cipher-types/server/ServerInput.vue'
import ApiInput from '../../cipher/cipher-types/api/ApiInput.vue'
import DatabaseInput from '../../cipher/cipher-types/database/DatabaseInput.vue'
export default {
components: {
Expand All @@ -229,10 +227,6 @@ export default {
type: {
type: [String, Number],
default: 1
},
routeName: {
type: String,
default: ''
}
},
Expand Down Expand Up @@ -341,11 +335,6 @@ export default {
this.cipher.folderId = this.cipher.collectionIds[0]
}
// Set current folder
setTimeout(() => {
this.$refs.inputSelectFolder.value = this.cipher.folderId
}, 0)
this.cipher = cipherData
return
}
Expand Down
9 changes: 7 additions & 2 deletions src/renderer/core/services/crypto.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,10 @@ export class CryptoService implements CryptoServiceAbstraction {
)
}

async rsaDecrypt (encValue: string): Promise<ArrayBuffer> {
async rsaDecrypt (
encValue: string,
privateKey?: ArrayBuffer
): Promise<ArrayBuffer> {
const headerPieces = encValue.split('.')
let encType: EncryptionType = null
let encPieces: string[]
Expand Down Expand Up @@ -579,7 +582,9 @@ export class CryptoService implements CryptoServiceAbstraction {
}

const data = Utils.fromB64ToArray(encPieces[0]).buffer
const privateKey = await this.getPrivateKey()
if (!privateKey) {
privateKey = await this.getPrivateKey()
}
if (privateKey == null) {
throw new Error('No private key.')
}
Expand Down
Loading

0 comments on commit 139dd37

Please sign in to comment.