internal: incomplete vault systems behind feature flag (#2340)

This commit is contained in:
Mo
2023-06-30 09:01:56 -05:00
committed by GitHub
parent d16e401bb9
commit b032eb9c9b
638 changed files with 20321 additions and 4813 deletions

View File

@@ -1,3 +1,5 @@
import { ChallengeArtifacts } from './Types/ChallengeArtifacts'
import { ChallengeValue } from './Types/ChallengeValue'
import { RootKeyInterface } from '@standardnotes/models'
import { AbstractService } from '../Service/AbstractService'
@@ -5,6 +7,7 @@ import { ChallengeInterface } from './ChallengeInterface'
import { ChallengePromptInterface } from './Prompt/ChallengePromptInterface'
import { ChallengeResponseInterface } from './ChallengeResponseInterface'
import { ChallengeReason } from './Types/ChallengeReason'
import { ChallengeObserver } from './Types/ChallengeObserver'
export interface ChallengeServiceInterface extends AbstractService {
/**
@@ -20,7 +23,7 @@ export interface ChallengeServiceInterface extends AbstractService {
subheading?: string,
): ChallengeInterface
completeChallenge(challenge: ChallengeInterface): void
promptForAccountPassword(): Promise<boolean>
promptForAccountPassword(): Promise<string | null>
getWrappingKeyIfApplicable(passcode?: string): Promise<
| {
canceled?: undefined
@@ -35,4 +38,11 @@ export interface ChallengeServiceInterface extends AbstractService {
canceled?: undefined
}
>
addChallengeObserver(challenge: ChallengeInterface, observer: ChallengeObserver): () => void
setValidationStatusForChallenge(
challenge: ChallengeInterface,
value: ChallengeValue,
valid: boolean,
artifacts?: ChallengeArtifacts,
): void
}

View File

@@ -0,0 +1,10 @@
import { ChallengeResponseInterface } from '../ChallengeResponseInterface'
import { ChallengeValueCallback } from './ChallengeValueCallback'
export type ChallengeObserver = {
onValidValue?: ChallengeValueCallback
onInvalidValue?: ChallengeValueCallback
onNonvalidatedSubmit?: (response: ChallengeResponseInterface) => void
onComplete?: (response: ChallengeResponseInterface) => void
onCancel?: () => void
}

View File

@@ -0,0 +1,3 @@
import { ChallengeValue } from './ChallengeValue'
export type ChallengeValueCallback = (value: ChallengeValue) => void

View File

@@ -11,3 +11,5 @@ export * from './Types/ChallengeRawValue'
export * from './Types/ChallengeReason'
export * from './Types/ChallengeValidation'
export * from './Types/ChallengeValue'
export * from './Types/ChallengeObserver'
export * from './Types/ChallengeValueCallback'