mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-28 12:45:45 +01:00
support defaultMatch for getAllDecryptedForUrl
This commit is contained in:
parent
0a20face13
commit
3bf322a904
@ -1,4 +1,5 @@
|
|||||||
import { CipherType } from '../enums/cipherType';
|
import { CipherType } from '../enums/cipherType';
|
||||||
|
import { UriMatchType } from '../enums/uriMatchType';
|
||||||
|
|
||||||
import { CipherData } from '../models/data/cipherData';
|
import { CipherData } from '../models/data/cipherData';
|
||||||
|
|
||||||
@ -21,7 +22,8 @@ export abstract class CipherService {
|
|||||||
getAll: () => Promise<Cipher[]>;
|
getAll: () => Promise<Cipher[]>;
|
||||||
getAllDecrypted: () => Promise<CipherView[]>;
|
getAllDecrypted: () => Promise<CipherView[]>;
|
||||||
getAllDecryptedForGrouping: (groupingId: string, folder?: boolean) => Promise<CipherView[]>;
|
getAllDecryptedForGrouping: (groupingId: string, folder?: boolean) => Promise<CipherView[]>;
|
||||||
getAllDecryptedForUrl: (url: string, includeOtherTypes?: CipherType[]) => Promise<CipherView[]>;
|
getAllDecryptedForUrl: (url: string, includeOtherTypes?: CipherType[],
|
||||||
|
defaultMatch?: UriMatchType) => Promise<CipherView[]>;
|
||||||
getAllFromApiForOrganization: (organizationId: string) => Promise<CipherView[]>;
|
getAllFromApiForOrganization: (organizationId: string) => Promise<CipherView[]>;
|
||||||
getLastUsedForUrl: (url: string) => Promise<CipherView>;
|
getLastUsedForUrl: (url: string) => Promise<CipherView>;
|
||||||
getNextCipherForUrl: (url: string) => Promise<CipherView>;
|
getNextCipherForUrl: (url: string) => Promise<CipherView>;
|
||||||
|
@ -328,7 +328,8 @@ export class CipherService implements CipherServiceAbstraction {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async getAllDecryptedForUrl(url: string, includeOtherTypes?: CipherType[]): Promise<CipherView[]> {
|
async getAllDecryptedForUrl(url: string, includeOtherTypes?: CipherType[],
|
||||||
|
defaultMatch: UriMatchType = null): Promise<CipherView[]> {
|
||||||
if (url == null && includeOtherTypes == null) {
|
if (url == null && includeOtherTypes == null) {
|
||||||
return Promise.resolve([]);
|
return Promise.resolve([]);
|
||||||
}
|
}
|
||||||
@ -354,10 +355,12 @@ export class CipherService implements CipherServiceAbstraction {
|
|||||||
const matchingDomains = result[0];
|
const matchingDomains = result[0];
|
||||||
const ciphers = result[1];
|
const ciphers = result[1];
|
||||||
|
|
||||||
let defaultMatch = await this.storageService.get<UriMatchType>(ConstantsService.defaultUriMatch);
|
if (defaultMatch == null) {
|
||||||
|
defaultMatch = await this.storageService.get<UriMatchType>(ConstantsService.defaultUriMatch);
|
||||||
if (defaultMatch == null) {
|
if (defaultMatch == null) {
|
||||||
defaultMatch = UriMatchType.Domain;
|
defaultMatch = UriMatchType.Domain;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return ciphers.filter((cipher) => {
|
return ciphers.filter((cipher) => {
|
||||||
if (cipher.deletedDate != null) {
|
if (cipher.deletedDate != null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user