Merge branch 'main' of github.com:standardnotes/app
This commit is contained in:
@@ -3,6 +3,12 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.23.1](https://github.com/standardnotes/app/compare/@standardnotes/api@1.23.0...@standardnotes/api@1.23.1) (2023-01-11)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **snjs:** simplify authenticator api for generating options ([#2147](https://github.com/standardnotes/app/issues/2147)) ([5d20a53](https://github.com/standardnotes/app/commit/5d20a53e6ea9ec08fdc1403a36a1b371ffaf9cd2))
|
||||||
|
|
||||||
# [1.23.0](https://github.com/standardnotes/app/compare/@standardnotes/api@1.22.0...@standardnotes/api@1.23.0) (2023-01-09)
|
# [1.23.0](https://github.com/standardnotes/app/compare/@standardnotes/api@1.22.0...@standardnotes/api@1.23.0) (2023-01-09)
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@standardnotes/api",
|
"name": "@standardnotes/api",
|
||||||
"version": "1.23.0",
|
"version": "1.23.1",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16.0.0 <17.0.0"
|
"node": ">=16.0.0 <17.0.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -58,10 +58,7 @@ export class AuthenticatorApiService implements AuthenticatorApiServiceInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async generateRegistrationOptions(
|
async generateRegistrationOptions(): Promise<GenerateAuthenticatorRegistrationOptionsResponse> {
|
||||||
userUuid: string,
|
|
||||||
username: string,
|
|
||||||
): Promise<GenerateAuthenticatorRegistrationOptionsResponse> {
|
|
||||||
if (this.operationsInProgress.get(AuthenticatorApiOperations.GenerateRegistrationOptions)) {
|
if (this.operationsInProgress.get(AuthenticatorApiOperations.GenerateRegistrationOptions)) {
|
||||||
throw new ApiCallError(ErrorMessage.GenericInProgress)
|
throw new ApiCallError(ErrorMessage.GenericInProgress)
|
||||||
}
|
}
|
||||||
@@ -69,10 +66,7 @@ export class AuthenticatorApiService implements AuthenticatorApiServiceInterface
|
|||||||
this.operationsInProgress.set(AuthenticatorApiOperations.GenerateRegistrationOptions, true)
|
this.operationsInProgress.set(AuthenticatorApiOperations.GenerateRegistrationOptions, true)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await this.authenticatorServer.generateRegistrationOptions({
|
const response = await this.authenticatorServer.generateRegistrationOptions()
|
||||||
username,
|
|
||||||
userUuid,
|
|
||||||
})
|
|
||||||
|
|
||||||
return response
|
return response
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -116,7 +110,7 @@ export class AuthenticatorApiService implements AuthenticatorApiServiceInterface
|
|||||||
this.operationsInProgress.set(AuthenticatorApiOperations.GenerateAuthenticationOptions, true)
|
this.operationsInProgress.set(AuthenticatorApiOperations.GenerateAuthenticationOptions, true)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await this.authenticatorServer.generateAuthenticationOptions({})
|
const response = await this.authenticatorServer.generateAuthenticationOptions()
|
||||||
|
|
||||||
return response
|
return response
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -10,10 +10,7 @@ import {
|
|||||||
export interface AuthenticatorApiServiceInterface {
|
export interface AuthenticatorApiServiceInterface {
|
||||||
list(): Promise<ListAuthenticatorsResponse>
|
list(): Promise<ListAuthenticatorsResponse>
|
||||||
delete(authenticatorId: string): Promise<DeleteAuthenticatorResponse>
|
delete(authenticatorId: string): Promise<DeleteAuthenticatorResponse>
|
||||||
generateRegistrationOptions(
|
generateRegistrationOptions(): Promise<GenerateAuthenticatorRegistrationOptionsResponse>
|
||||||
userUuid: string,
|
|
||||||
username: string,
|
|
||||||
): Promise<GenerateAuthenticatorRegistrationOptionsResponse>
|
|
||||||
verifyRegistrationResponse(
|
verifyRegistrationResponse(
|
||||||
userUuid: string,
|
userUuid: string,
|
||||||
name: string,
|
name: string,
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
export interface GenerateAuthenticatorAuthenticationOptionsRequestParams {
|
|
||||||
[additionalParam: string]: unknown
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
export interface GenerateAuthenticatorRegistrationOptionsRequestParams {
|
|
||||||
userUuid: string
|
|
||||||
username: string
|
|
||||||
[additionalParam: string]: unknown
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,5 @@
|
|||||||
export * from './ApiEndpointParam'
|
export * from './ApiEndpointParam'
|
||||||
export * from './Authenticator/DeleteAuthenticatorRequestParams'
|
export * from './Authenticator/DeleteAuthenticatorRequestParams'
|
||||||
export * from './Authenticator/GenerateAuthenticatorAuthenticationOptionsRequestParams'
|
|
||||||
export * from './Authenticator/GenerateAuthenticatorRegistrationOptionsRequestParams'
|
|
||||||
export * from './Authenticator/ListAuthenticatorsRequestParams'
|
export * from './Authenticator/ListAuthenticatorsRequestParams'
|
||||||
export * from './Authenticator/VerifyAuthenticatorAuthenticationResponseRequestParams'
|
export * from './Authenticator/VerifyAuthenticatorAuthenticationResponseRequestParams'
|
||||||
export * from './Authenticator/VerifyAuthenticatorRegistrationResponseRequestParams'
|
export * from './Authenticator/VerifyAuthenticatorRegistrationResponseRequestParams'
|
||||||
|
|||||||
@@ -2,9 +2,7 @@ import { HttpServiceInterface } from '../../Http/HttpServiceInterface'
|
|||||||
import {
|
import {
|
||||||
ListAuthenticatorsRequestParams,
|
ListAuthenticatorsRequestParams,
|
||||||
DeleteAuthenticatorRequestParams,
|
DeleteAuthenticatorRequestParams,
|
||||||
GenerateAuthenticatorRegistrationOptionsRequestParams,
|
|
||||||
VerifyAuthenticatorRegistrationResponseRequestParams,
|
VerifyAuthenticatorRegistrationResponseRequestParams,
|
||||||
GenerateAuthenticatorAuthenticationOptionsRequestParams,
|
|
||||||
VerifyAuthenticatorAuthenticationResponseRequestParams,
|
VerifyAuthenticatorAuthenticationResponseRequestParams,
|
||||||
} from '../../Request'
|
} from '../../Request'
|
||||||
import {
|
import {
|
||||||
@@ -33,10 +31,8 @@ export class AuthenticatorServer implements AuthenticatorServerInterface {
|
|||||||
return response as DeleteAuthenticatorResponse
|
return response as DeleteAuthenticatorResponse
|
||||||
}
|
}
|
||||||
|
|
||||||
async generateRegistrationOptions(
|
async generateRegistrationOptions(): Promise<GenerateAuthenticatorRegistrationOptionsResponse> {
|
||||||
params: GenerateAuthenticatorRegistrationOptionsRequestParams,
|
const response = await this.httpService.get(Paths.v1.generateRegistrationOptions)
|
||||||
): Promise<GenerateAuthenticatorRegistrationOptionsResponse> {
|
|
||||||
const response = await this.httpService.get(Paths.v1.generateRegistrationOptions, params)
|
|
||||||
|
|
||||||
return response as GenerateAuthenticatorRegistrationOptionsResponse
|
return response as GenerateAuthenticatorRegistrationOptionsResponse
|
||||||
}
|
}
|
||||||
@@ -49,10 +45,8 @@ export class AuthenticatorServer implements AuthenticatorServerInterface {
|
|||||||
return response as VerifyAuthenticatorRegistrationResponseResponse
|
return response as VerifyAuthenticatorRegistrationResponseResponse
|
||||||
}
|
}
|
||||||
|
|
||||||
async generateAuthenticationOptions(
|
async generateAuthenticationOptions(): Promise<GenerateAuthenticatorAuthenticationOptionsResponse> {
|
||||||
params: GenerateAuthenticatorAuthenticationOptionsRequestParams,
|
const response = await this.httpService.get(Paths.v1.generateAuthenticationOptions)
|
||||||
): Promise<GenerateAuthenticatorAuthenticationOptionsResponse> {
|
|
||||||
const response = await this.httpService.get(Paths.v1.generateAuthenticationOptions, params)
|
|
||||||
|
|
||||||
return response as GenerateAuthenticatorAuthenticationOptionsResponse
|
return response as GenerateAuthenticatorAuthenticationOptionsResponse
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
import {
|
import {
|
||||||
ListAuthenticatorsRequestParams,
|
ListAuthenticatorsRequestParams,
|
||||||
DeleteAuthenticatorRequestParams,
|
DeleteAuthenticatorRequestParams,
|
||||||
GenerateAuthenticatorRegistrationOptionsRequestParams,
|
|
||||||
VerifyAuthenticatorRegistrationResponseRequestParams,
|
VerifyAuthenticatorRegistrationResponseRequestParams,
|
||||||
GenerateAuthenticatorAuthenticationOptionsRequestParams,
|
|
||||||
VerifyAuthenticatorAuthenticationResponseRequestParams,
|
VerifyAuthenticatorAuthenticationResponseRequestParams,
|
||||||
} from '../../Request'
|
} from '../../Request'
|
||||||
import {
|
import {
|
||||||
@@ -18,15 +16,11 @@ import {
|
|||||||
export interface AuthenticatorServerInterface {
|
export interface AuthenticatorServerInterface {
|
||||||
list(params: ListAuthenticatorsRequestParams): Promise<ListAuthenticatorsResponse>
|
list(params: ListAuthenticatorsRequestParams): Promise<ListAuthenticatorsResponse>
|
||||||
delete(params: DeleteAuthenticatorRequestParams): Promise<DeleteAuthenticatorResponse>
|
delete(params: DeleteAuthenticatorRequestParams): Promise<DeleteAuthenticatorResponse>
|
||||||
generateRegistrationOptions(
|
generateRegistrationOptions(): Promise<GenerateAuthenticatorRegistrationOptionsResponse>
|
||||||
params: GenerateAuthenticatorRegistrationOptionsRequestParams,
|
|
||||||
): Promise<GenerateAuthenticatorRegistrationOptionsResponse>
|
|
||||||
verifyRegistrationResponse(
|
verifyRegistrationResponse(
|
||||||
params: VerifyAuthenticatorRegistrationResponseRequestParams,
|
params: VerifyAuthenticatorRegistrationResponseRequestParams,
|
||||||
): Promise<VerifyAuthenticatorRegistrationResponseResponse>
|
): Promise<VerifyAuthenticatorRegistrationResponseResponse>
|
||||||
generateAuthenticationOptions(
|
generateAuthenticationOptions(): Promise<GenerateAuthenticatorAuthenticationOptionsResponse>
|
||||||
params: GenerateAuthenticatorAuthenticationOptionsRequestParams,
|
|
||||||
): Promise<GenerateAuthenticatorAuthenticationOptionsResponse>
|
|
||||||
verifyAuthenticationResponse(
|
verifyAuthenticationResponse(
|
||||||
params: VerifyAuthenticatorAuthenticationResponseRequestParams,
|
params: VerifyAuthenticatorAuthenticationResponseRequestParams,
|
||||||
): Promise<VerifyAuthenticatorAuthenticationResponseResponse>
|
): Promise<VerifyAuthenticatorAuthenticationResponseResponse>
|
||||||
|
|||||||
@@ -3,6 +3,10 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.12.4](https://github.com/standardnotes/app/compare/@standardnotes/blocks-editor@1.12.3...@standardnotes/blocks-editor@1.12.4) (2023-01-11)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/blocks-editor
|
||||||
|
|
||||||
## [1.12.3](https://github.com/standardnotes/app/compare/@standardnotes/blocks-editor@1.12.2...@standardnotes/blocks-editor@1.12.3) (2023-01-11)
|
## [1.12.3](https://github.com/standardnotes/app/compare/@standardnotes/blocks-editor@1.12.2...@standardnotes/blocks-editor@1.12.3) (2023-01-11)
|
||||||
|
|
||||||
**Note:** Version bump only for package @standardnotes/blocks-editor
|
**Note:** Version bump only for package @standardnotes/blocks-editor
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@standardnotes/blocks-editor",
|
"name": "@standardnotes/blocks-editor",
|
||||||
"version": "1.12.3",
|
"version": "1.12.4",
|
||||||
"private": true,
|
"private": true,
|
||||||
"main": "./src/index.ts",
|
"main": "./src/index.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -3,6 +3,10 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [3.104.84](https://github.com/standardnotes/app/compare/@standardnotes/desktop@3.137.2...@standardnotes/desktop@3.104.84) (2023-01-11)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/desktop
|
||||||
|
|
||||||
## [3.104.83](https://github.com/standardnotes/app/compare/@standardnotes/desktop@3.137.1...@standardnotes/desktop@3.104.83) (2023-01-11)
|
## [3.104.83](https://github.com/standardnotes/app/compare/@standardnotes/desktop@3.137.1...@standardnotes/desktop@3.104.83) (2023-01-11)
|
||||||
|
|
||||||
**Note:** Version bump only for package @standardnotes/desktop
|
**Note:** Version bump only for package @standardnotes/desktop
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@standardnotes/desktop",
|
"name": "@standardnotes/desktop",
|
||||||
"main": "./app/dist/index.js",
|
"main": "./app/dist/index.js",
|
||||||
"version": "3.104.83",
|
"version": "3.104.84",
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"author": "Standard Notes.",
|
"author": "Standard Notes.",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
|||||||
@@ -3,6 +3,10 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [3.50.20](https://github.com/standardnotes/app/compare/@standardnotes/mobile@3.50.19...@standardnotes/mobile@3.50.20) (2023-01-11)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/mobile
|
||||||
|
|
||||||
## [3.50.19](https://github.com/standardnotes/app/compare/@standardnotes/mobile@3.50.18...@standardnotes/mobile@3.50.19) (2023-01-11)
|
## [3.50.19](https://github.com/standardnotes/app/compare/@standardnotes/mobile@3.50.18...@standardnotes/mobile@3.50.19) (2023-01-11)
|
||||||
|
|
||||||
**Note:** Version bump only for package @standardnotes/mobile
|
**Note:** Version bump only for package @standardnotes/mobile
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@standardnotes/mobile",
|
"name": "@standardnotes/mobile",
|
||||||
"version": "3.50.19",
|
"version": "3.50.20",
|
||||||
"author": "Standard Notes.",
|
"author": "Standard Notes.",
|
||||||
"private": true,
|
"private": true,
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
|
|||||||
@@ -3,6 +3,10 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.4.107](https://github.com/standardnotes/app/compare/@standardnotes/releases@1.4.106...@standardnotes/releases@1.4.107) (2023-01-11)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/releases
|
||||||
|
|
||||||
## [1.4.106](https://github.com/standardnotes/app/compare/@standardnotes/releases@1.4.105...@standardnotes/releases@1.4.106) (2023-01-11)
|
## [1.4.106](https://github.com/standardnotes/app/compare/@standardnotes/releases@1.4.105...@standardnotes/releases@1.4.106) (2023-01-11)
|
||||||
|
|
||||||
**Note:** Version bump only for package @standardnotes/releases
|
**Note:** Version bump only for package @standardnotes/releases
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@standardnotes/releases",
|
"name": "@standardnotes/releases",
|
||||||
"version": "1.4.106",
|
"version": "1.4.107",
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"main": "dist/releases.json",
|
"main": "dist/releases.json",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
|
|||||||
@@ -3,6 +3,12 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.55.1](https://github.com/standardnotes/app/compare/@standardnotes/services@1.55.0...@standardnotes/services@1.55.1) (2023-01-11)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **snjs:** simplify authenticator api for generating options ([#2147](https://github.com/standardnotes/app/issues/2147)) ([5d20a53](https://github.com/standardnotes/app/commit/5d20a53e6ea9ec08fdc1403a36a1b371ffaf9cd2))
|
||||||
|
|
||||||
# [1.55.0](https://github.com/standardnotes/app/compare/@standardnotes/services@1.54.0...@standardnotes/services@1.55.0) (2023-01-11)
|
# [1.55.0](https://github.com/standardnotes/app/compare/@standardnotes/services@1.54.0...@standardnotes/services@1.55.0) (2023-01-11)
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@standardnotes/services",
|
"name": "@standardnotes/services",
|
||||||
"version": "1.55.0",
|
"version": "1.55.1",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16.0.0 <17.0.0"
|
"node": ">=16.0.0 <17.0.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { Username, Uuid } from '@standardnotes/domain-core'
|
import { Uuid } from '@standardnotes/domain-core'
|
||||||
|
|
||||||
export interface AuthenticatorClientInterface {
|
export interface AuthenticatorClientInterface {
|
||||||
list(): Promise<Array<{ id: string; name: string }>>
|
list(): Promise<Array<{ id: string; name: string }>>
|
||||||
delete(authenticatorId: Uuid): Promise<boolean>
|
delete(authenticatorId: Uuid): Promise<boolean>
|
||||||
generateRegistrationOptions(userUuid: Uuid, username: Username): Promise<Record<string, unknown> | null>
|
generateRegistrationOptions(): Promise<Record<string, unknown> | null>
|
||||||
verifyRegistrationResponse(
|
verifyRegistrationResponse(
|
||||||
userUuid: Uuid,
|
userUuid: Uuid,
|
||||||
name: string,
|
name: string,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/* istanbul ignore file */
|
/* istanbul ignore file */
|
||||||
|
|
||||||
import { AuthenticatorApiServiceInterface } from '@standardnotes/api'
|
import { AuthenticatorApiServiceInterface } from '@standardnotes/api'
|
||||||
import { Username, Uuid } from '@standardnotes/domain-core'
|
import { Uuid } from '@standardnotes/domain-core'
|
||||||
|
|
||||||
import { InternalEventBusInterface } from '../Internal/InternalEventBusInterface'
|
import { InternalEventBusInterface } from '../Internal/InternalEventBusInterface'
|
||||||
import { AbstractService } from '../Service/AbstractService'
|
import { AbstractService } from '../Service/AbstractService'
|
||||||
@@ -43,9 +43,9 @@ export class AuthenticatorManager extends AbstractService implements Authenticat
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async generateRegistrationOptions(userUuid: Uuid, username: Username): Promise<Record<string, unknown> | null> {
|
async generateRegistrationOptions(): Promise<Record<string, unknown> | null> {
|
||||||
try {
|
try {
|
||||||
const result = await this.authenticatorApiService.generateRegistrationOptions(userUuid.value, username.value)
|
const result = await this.authenticatorApiService.generateRegistrationOptions()
|
||||||
|
|
||||||
if (result.data.error) {
|
if (result.data.error) {
|
||||||
return null
|
return null
|
||||||
|
|||||||
@@ -3,6 +3,12 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [2.163.1](https://github.com/standardnotes/app/compare/@standardnotes/snjs@2.163.0...@standardnotes/snjs@2.163.1) (2023-01-11)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **snjs:** simplify authenticator api for generating options ([#2147](https://github.com/standardnotes/app/issues/2147)) ([5d20a53](https://github.com/standardnotes/app/commit/5d20a53e6ea9ec08fdc1403a36a1b371ffaf9cd2))
|
||||||
|
|
||||||
# [2.163.0](https://github.com/standardnotes/app/compare/@standardnotes/snjs@2.162.0...@standardnotes/snjs@2.163.0) (2023-01-11)
|
# [2.163.0](https://github.com/standardnotes/app/compare/@standardnotes/snjs@2.162.0...@standardnotes/snjs@2.163.0) (2023-01-11)
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ describe('AddAuthenticator', () => {
|
|||||||
|
|
||||||
const result = await useCase.execute({
|
const result = await useCase.execute({
|
||||||
userUuid: 'invalid',
|
userUuid: 'invalid',
|
||||||
username: 'username',
|
|
||||||
authenticatorName: 'authenticatorName',
|
authenticatorName: 'authenticatorName',
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -31,25 +30,11 @@ describe('AddAuthenticator', () => {
|
|||||||
expect(result.getError()).toBe('Could not generate authenticator registration options: Given value is not a valid uuid: invalid')
|
expect(result.getError()).toBe('Could not generate authenticator registration options: Given value is not a valid uuid: invalid')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should return error if username is invalid', async () => {
|
|
||||||
const useCase = createUseCase()
|
|
||||||
|
|
||||||
const result = await useCase.execute({
|
|
||||||
userUuid: '00000000-0000-0000-0000-000000000000',
|
|
||||||
username: '',
|
|
||||||
authenticatorName: 'authenticatorName',
|
|
||||||
})
|
|
||||||
|
|
||||||
expect(result.isFailed()).toBe(true)
|
|
||||||
expect(result.getError()).toBe('Could not generate authenticator registration options: Username cannot be empty')
|
|
||||||
})
|
|
||||||
|
|
||||||
it('should return error if authenticatorName is invalid', async () => {
|
it('should return error if authenticatorName is invalid', async () => {
|
||||||
const useCase = createUseCase()
|
const useCase = createUseCase()
|
||||||
|
|
||||||
const result = await useCase.execute({
|
const result = await useCase.execute({
|
||||||
userUuid: '00000000-0000-0000-0000-000000000000',
|
userUuid: '00000000-0000-0000-0000-000000000000',
|
||||||
username: 'username',
|
|
||||||
authenticatorName: '',
|
authenticatorName: '',
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -64,7 +49,6 @@ describe('AddAuthenticator', () => {
|
|||||||
|
|
||||||
const result = await useCase.execute({
|
const result = await useCase.execute({
|
||||||
userUuid: '00000000-0000-0000-0000-000000000000',
|
userUuid: '00000000-0000-0000-0000-000000000000',
|
||||||
username: 'username',
|
|
||||||
authenticatorName: 'authenticator',
|
authenticatorName: 'authenticator',
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -79,7 +63,6 @@ describe('AddAuthenticator', () => {
|
|||||||
|
|
||||||
const result = await useCase.execute({
|
const result = await useCase.execute({
|
||||||
userUuid: '00000000-0000-0000-0000-000000000000',
|
userUuid: '00000000-0000-0000-0000-000000000000',
|
||||||
username: 'username',
|
|
||||||
authenticatorName: 'authenticator',
|
authenticatorName: 'authenticator',
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -96,7 +79,6 @@ describe('AddAuthenticator', () => {
|
|||||||
|
|
||||||
const result = await useCase.execute({
|
const result = await useCase.execute({
|
||||||
userUuid: '00000000-0000-0000-0000-000000000000',
|
userUuid: '00000000-0000-0000-0000-000000000000',
|
||||||
username: 'username',
|
|
||||||
authenticatorName: 'authenticator',
|
authenticatorName: 'authenticator',
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -111,7 +93,7 @@ describe('AddAuthenticator', () => {
|
|||||||
|
|
||||||
const result = await useCase.execute({
|
const result = await useCase.execute({
|
||||||
userUuid: '00000000-0000-0000-0000-000000000000',
|
userUuid: '00000000-0000-0000-0000-000000000000',
|
||||||
username: 'username',
|
|
||||||
authenticatorName: 'authenticator',
|
authenticatorName: 'authenticator',
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -124,7 +106,6 @@ describe('AddAuthenticator', () => {
|
|||||||
|
|
||||||
const result = await useCase.execute({
|
const result = await useCase.execute({
|
||||||
userUuid: '00000000-0000-0000-0000-000000000000',
|
userUuid: '00000000-0000-0000-0000-000000000000',
|
||||||
username: 'username',
|
|
||||||
authenticatorName: 'authenticator',
|
authenticatorName: 'authenticator',
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -136,7 +117,6 @@ describe('AddAuthenticator', () => {
|
|||||||
|
|
||||||
const result = await useCase.execute({
|
const result = await useCase.execute({
|
||||||
userUuid: '00000000-0000-0000-0000-000000000000',
|
userUuid: '00000000-0000-0000-0000-000000000000',
|
||||||
username: 'username',
|
|
||||||
authenticatorName: 'authenticator',
|
authenticatorName: 'authenticator',
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { AuthenticatorClientInterface } from '@standardnotes/services'
|
import { AuthenticatorClientInterface } from '@standardnotes/services'
|
||||||
import { Result, UseCaseInterface, Username, Uuid, Validator } from '@standardnotes/domain-core'
|
import { Result, UseCaseInterface, Uuid, Validator } from '@standardnotes/domain-core'
|
||||||
|
|
||||||
import { AddAuthenticatorDTO } from './AddAuthenticatorDTO'
|
import { AddAuthenticatorDTO } from './AddAuthenticatorDTO'
|
||||||
|
|
||||||
@@ -24,12 +24,6 @@ export class AddAuthenticator implements UseCaseInterface<void> {
|
|||||||
}
|
}
|
||||||
const userUuid = userUuidOrError.getValue()
|
const userUuid = userUuidOrError.getValue()
|
||||||
|
|
||||||
const usernameOrError = Username.create(dto.username)
|
|
||||||
if (usernameOrError.isFailed()) {
|
|
||||||
return Result.fail(`Could not generate authenticator registration options: ${usernameOrError.getError()}`)
|
|
||||||
}
|
|
||||||
const username = usernameOrError.getValue()
|
|
||||||
|
|
||||||
const authenticatorNameValidatorResult = Validator.isNotEmpty(dto.authenticatorName)
|
const authenticatorNameValidatorResult = Validator.isNotEmpty(dto.authenticatorName)
|
||||||
if (authenticatorNameValidatorResult.isFailed()) {
|
if (authenticatorNameValidatorResult.isFailed()) {
|
||||||
return Result.fail(
|
return Result.fail(
|
||||||
@@ -37,7 +31,7 @@ export class AddAuthenticator implements UseCaseInterface<void> {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const registrationOptions = await this.authenticatorClient.generateRegistrationOptions(userUuid, username)
|
const registrationOptions = await this.authenticatorClient.generateRegistrationOptions()
|
||||||
if (registrationOptions === null) {
|
if (registrationOptions === null) {
|
||||||
return Result.fail('Could not generate authenticator registration options')
|
return Result.fail('Could not generate authenticator registration options')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
export interface AddAuthenticatorDTO {
|
export interface AddAuthenticatorDTO {
|
||||||
userUuid: string
|
userUuid: string
|
||||||
username: string
|
|
||||||
authenticatorName: string
|
authenticatorName: string
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@standardnotes/snjs",
|
"name": "@standardnotes/snjs",
|
||||||
"version": "2.163.0",
|
"version": "2.163.1",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16.0.0 <17.0.0"
|
"node": ">=16.0.0 <17.0.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,6 +3,10 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.23.9](https://github.com/standardnotes/app/compare/@standardnotes/ui-services@1.23.8...@standardnotes/ui-services@1.23.9) (2023-01-11)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/ui-services
|
||||||
|
|
||||||
## [1.23.8](https://github.com/standardnotes/app/compare/@standardnotes/ui-services@1.23.7...@standardnotes/ui-services@1.23.8) (2023-01-11)
|
## [1.23.8](https://github.com/standardnotes/app/compare/@standardnotes/ui-services@1.23.7...@standardnotes/ui-services@1.23.8) (2023-01-11)
|
||||||
|
|
||||||
**Note:** Version bump only for package @standardnotes/ui-services
|
**Note:** Version bump only for package @standardnotes/ui-services
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@standardnotes/ui-services",
|
"name": "@standardnotes/ui-services",
|
||||||
"version": "1.23.8",
|
"version": "1.23.9",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16.0.0 <17.0.0"
|
"node": ">=16.0.0 <17.0.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,6 +3,10 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [3.137.3](https://github.com/standardnotes/app/compare/@standardnotes/web@3.137.2...@standardnotes/web@3.137.3) (2023-01-11)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/web
|
||||||
|
|
||||||
## [3.137.2](https://github.com/standardnotes/app/compare/@standardnotes/web@3.137.1...@standardnotes/web@3.137.2) (2023-01-11)
|
## [3.137.2](https://github.com/standardnotes/app/compare/@standardnotes/web@3.137.1...@standardnotes/web@3.137.2) (2023-01-11)
|
||||||
|
|
||||||
**Note:** Version bump only for package @standardnotes/web
|
**Note:** Version bump only for package @standardnotes/web
|
||||||
|
|||||||
@@ -1,5 +1,16 @@
|
|||||||
{
|
{
|
||||||
"versions": [
|
"versions": [
|
||||||
|
{
|
||||||
|
"version": "3.137.3",
|
||||||
|
"title": "[3.137.3](https://github.com/standardnotes/app/compare/@standardnotes/web@3.137.2...@standardnotes/web@3.137.3) (2023-01-11)",
|
||||||
|
"date": null,
|
||||||
|
"body": "**Note:** Version bump only for package @standardnotes/web",
|
||||||
|
"parsed": {
|
||||||
|
"_": [
|
||||||
|
"Note: Version bump only for package @standardnotes/web"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"version": "3.137.2",
|
"version": "3.137.2",
|
||||||
"title": "[3.137.2](https://github.com/standardnotes/app/compare/@standardnotes/web@3.137.1...@standardnotes/web@3.137.2) (2023-01-11)",
|
"title": "[3.137.2](https://github.com/standardnotes/app/compare/@standardnotes/web@3.137.1...@standardnotes/web@3.137.2) (2023-01-11)",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@standardnotes/web",
|
"name": "@standardnotes/web",
|
||||||
"version": "3.137.2",
|
"version": "3.137.3",
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"main": "dist/app.js",
|
"main": "dist/app.js",
|
||||||
"author": "Standard Notes.",
|
"author": "Standard Notes.",
|
||||||
|
|||||||
Reference in New Issue
Block a user