feat-dev: add U2F iframe for desktop client authentication (#2236)

This commit is contained in:
Karol Sójko
2023-03-07 00:52:35 +01:00
committed by GitHub
parent e5ca69fc8e
commit cf5330d7cf
25 changed files with 362 additions and 73 deletions

View File

@@ -79,7 +79,6 @@ import {
DecryptedItemInterface,
EncryptedItemInterface,
Environment,
HistoryEntry,
ItemStream,
Platform,
} from '@standardnotes/models'
@@ -90,7 +89,7 @@ import { SNLog } from '../Log'
import { ChallengeResponse, ListedClientInterface } from '../Services'
import { ApplicationConstructorOptions, FullyResolvedApplicationOptions } from './Options/ApplicationOptions'
import { ApplicationOptionsDefaults } from './Options/Defaults'
import { LegacySession, MapperInterface, Session, UseCaseInterface } from '@standardnotes/domain-core'
import { LegacySession, MapperInterface, Session } from '@standardnotes/domain-core'
import { SessionStorageMapper } from '@Lib/Services/Mapping/SessionStorageMapper'
import { LegacySessionStorageMapper } from '@Lib/Services/Mapping/LegacySessionStorageMapper'
import { SignInWithRecoveryCodes } from '@Lib/Domain/UseCase/SignInWithRecoveryCodes/SignInWithRecoveryCodes'
@@ -102,7 +101,6 @@ import { DeleteAuthenticator } from '@Lib/Domain/UseCase/DeleteAuthenticator/Del
import { ListRevisions } from '@Lib/Domain/UseCase/ListRevisions/ListRevisions'
import { GetRevision } from '@Lib/Domain/UseCase/GetRevision/GetRevision'
import { DeleteRevision } from '@Lib/Domain/UseCase/DeleteRevision/DeleteRevision'
import { RevisionMetadata } from '@Lib/Domain/Revision/RevisionMetadata'
import { GetAuthenticatorAuthenticationResponse } from '@Lib/Domain/UseCase/GetAuthenticatorAuthenticationResponse/GetAuthenticatorAuthenticationResponse'
/** How often to automatically sync, in milliseconds */
@@ -266,39 +264,39 @@ export class SNApplication implements ApplicationInterface, AppGroupManagedAppli
return this.subscriptionManager
}
get signInWithRecoveryCodes(): UseCaseInterface<void> {
get signInWithRecoveryCodes(): SignInWithRecoveryCodes {
return this._signInWithRecoveryCodes
}
get getRecoveryCodes(): UseCaseInterface<string> {
get getRecoveryCodes(): GetRecoveryCodes {
return this._getRecoveryCodes
}
get addAuthenticator(): UseCaseInterface<void> {
get addAuthenticator(): AddAuthenticator {
return this._addAuthenticator
}
get listAuthenticators(): UseCaseInterface<Array<{ id: string; name: string }>> {
get listAuthenticators(): ListAuthenticators {
return this._listAuthenticators
}
get deleteAuthenticator(): UseCaseInterface<void> {
get deleteAuthenticator(): DeleteAuthenticator {
return this._deleteAuthenticator
}
get getAuthenticatorAuthenticationResponse(): UseCaseInterface<Record<string, unknown>> {
get getAuthenticatorAuthenticationResponse(): GetAuthenticatorAuthenticationResponse {
return this._getAuthenticatorAuthenticationResponse
}
get listRevisions(): UseCaseInterface<Array<RevisionMetadata>> {
get listRevisions(): ListRevisions {
return this._listRevisions
}
get getRevision(): UseCaseInterface<HistoryEntry> {
get getRevision(): GetRevision {
return this._getRevision
}
get deleteRevision(): UseCaseInterface<void> {
get deleteRevision(): DeleteRevision {
return this._deleteRevision
}

View File

@@ -1,16 +1,21 @@
import { HistoryEntry } from '@standardnotes/models'
import { UseCaseInterface } from '@standardnotes/domain-core'
import { RevisionMetadata } from '../Revision/RevisionMetadata'
import { AddAuthenticator } from './AddAuthenticator/AddAuthenticator'
import { GetRecoveryCodes } from './GetRecoveryCodes/GetRecoveryCodes'
import { SignInWithRecoveryCodes } from './SignInWithRecoveryCodes/SignInWithRecoveryCodes'
import { ListAuthenticators } from './ListAuthenticators/ListAuthenticators'
import { DeleteAuthenticator } from './DeleteAuthenticator/DeleteAuthenticator'
import { GetAuthenticatorAuthenticationResponse } from './GetAuthenticatorAuthenticationResponse/GetAuthenticatorAuthenticationResponse'
import { ListRevisions } from './ListRevisions/ListRevisions'
import { GetRevision } from './GetRevision/GetRevision'
import { DeleteRevision } from './DeleteRevision/DeleteRevision'
export interface UseCaseContainerInterface {
get signInWithRecoveryCodes(): UseCaseInterface<void>
get getRecoveryCodes(): UseCaseInterface<string>
get addAuthenticator(): UseCaseInterface<void>
get listAuthenticators(): UseCaseInterface<Array<{ id: string; name: string }>>
get deleteAuthenticator(): UseCaseInterface<void>
get getAuthenticatorAuthenticationResponse(): UseCaseInterface<Record<string, unknown>>
get listRevisions(): UseCaseInterface<Array<RevisionMetadata>>
get getRevision(): UseCaseInterface<HistoryEntry>
get deleteRevision(): UseCaseInterface<void>
get signInWithRecoveryCodes(): SignInWithRecoveryCodes
get getRecoveryCodes(): GetRecoveryCodes
get addAuthenticator(): AddAuthenticator
get listAuthenticators(): ListAuthenticators
get deleteAuthenticator(): DeleteAuthenticator
get getAuthenticatorAuthenticationResponse(): GetAuthenticatorAuthenticationResponse
get listRevisions(): ListRevisions
get getRevision(): GetRevision
get deleteRevision(): DeleteRevision
}

View File

@@ -1,2 +1,18 @@
export * from './Revision/Revision'
export * from './Revision/RevisionMetadata'
export * from './UseCase/AddAuthenticator/AddAuthenticator'
export * from './UseCase/AddAuthenticator/AddAuthenticatorDTO'
export * from './UseCase/DeleteAuthenticator/DeleteAuthenticator'
export * from './UseCase/DeleteAuthenticator/DeleteAuthenticatorDTO'
export * from './UseCase/DeleteRevision/DeleteRevision'
export * from './UseCase/DeleteRevision/DeleteRevisionDTO'
export * from './UseCase/GetAuthenticatorAuthenticationResponse/GetAuthenticatorAuthenticationResponse'
export * from './UseCase/GetAuthenticatorAuthenticationResponse/GetAuthenticatorAuthenticationResponseDTO'
export * from './UseCase/GetRecoveryCodes/GetRecoveryCodes'
export * from './UseCase/GetRevision/GetRevision'
export * from './UseCase/GetRevision/GetRevisionDTO'
export * from './UseCase/ListAuthenticators/ListAuthenticators'
export * from './UseCase/ListRevisions/ListRevisions'
export * from './UseCase/ListRevisions/ListRevisionsDTO'
export * from './UseCase/SignInWithRecoveryCodes/SignInWithRecoveryCodes'
export * from './UseCase/SignInWithRecoveryCodes/SignInWithRecoveryCodesDTO'