Browse Source

feat(lib): move simplewebauthn interfaces to common lib

This includes AssertionCredentialJSON, AttestationCredentialJSON, PublicKeyCredentialCreationOptionsJSON, PublicKeyCredentialRequestOptionsJSON.
pull/5944/head
KenTandrian 1 month ago
parent
commit
7a229cec79
  1. 10
      apps/api/src/app/auth/auth.controller.ts
  2. 9
      apps/api/src/app/auth/web-auth.service.ts
  3. 7
      apps/client/src/app/services/web-authn.service.ts
  4. 10
      libs/common/src/lib/interfaces/index.ts
  5. 0
      libs/common/src/lib/interfaces/simplewebauthn.interface.ts

10
apps/api/src/app/auth/auth.controller.ts

@ -2,7 +2,11 @@ import { WebAuthService } from '@ghostfolio/api/app/auth/web-auth.service';
import { HasPermissionGuard } from '@ghostfolio/api/guards/has-permission.guard';
import { ConfigurationService } from '@ghostfolio/api/services/configuration/configuration.service';
import { DEFAULT_LANGUAGE_CODE } from '@ghostfolio/common/config';
import { OAuthResponse } from '@ghostfolio/common/interfaces';
import {
AssertionCredentialJSON,
AttestationCredentialJSON,
OAuthResponse
} from '@ghostfolio/common/interfaces';
import {
Body,
@ -22,10 +26,6 @@ import { Request, Response } from 'express';
import { getReasonPhrase, StatusCodes } from 'http-status-codes';
import { AuthService } from './auth.service';
import {
AssertionCredentialJSON,
AttestationCredentialJSON
} from './interfaces/simplewebauthn';
@Controller('auth')
export class AuthController {

9
apps/api/src/app/auth/web-auth.service.ts

@ -2,6 +2,10 @@ import { AuthDeviceService } from '@ghostfolio/api/app/auth-device/auth-device.s
import { UserService } from '@ghostfolio/api/app/user/user.service';
import { ConfigurationService } from '@ghostfolio/api/services/configuration/configuration.service';
import { AuthDeviceDto } from '@ghostfolio/common/dtos';
import {
AssertionCredentialJSON,
AttestationCredentialJSON
} from '@ghostfolio/common/interfaces';
import type { RequestWithUser } from '@ghostfolio/common/types';
import {
@ -27,11 +31,6 @@ import {
import { isoBase64URL, isoUint8Array } from '@simplewebauthn/server/helpers';
import ms from 'ms';
import {
AssertionCredentialJSON,
AttestationCredentialJSON
} from './interfaces/simplewebauthn';
@Injectable()
export class WebAuthService {
public constructor(

7
apps/client/src/app/services/web-authn.service.ts

@ -1,10 +1,9 @@
/* eslint-disable @nx/enforce-module-boundaries */
import { SettingsStorageService } from '@ghostfolio/client/services/settings-storage.service';
import { AuthDeviceDto } from '@ghostfolio/common/dtos';
import {
PublicKeyCredentialCreationOptionsJSON,
PublicKeyCredentialRequestOptionsJSON
} from '@ghostfolio/api/app/auth/interfaces/simplewebauthn';
import { SettingsStorageService } from '@ghostfolio/client/services/settings-storage.service';
import { AuthDeviceDto } from '@ghostfolio/common/dtos';
} from '@ghostfolio/common/interfaces';
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';

10
libs/common/src/lib/interfaces/index.ts

@ -78,6 +78,12 @@ import type { QuotesResponse } from './responses/quotes-response.interface';
import type { WatchlistResponse } from './responses/watchlist-response.interface';
import type { RuleSettings } from './rule-settings.interface';
import type { ScraperConfiguration } from './scraper-configuration.interface';
import type {
AssertionCredentialJSON,
AttestationCredentialJSON,
PublicKeyCredentialCreationOptionsJSON,
PublicKeyCredentialRequestOptionsJSON
} from './simplewebauthn.interface';
import type { Statistics } from './statistics.interface';
import type { SubscriptionOffer } from './subscription-offer.interface';
import type { SymbolItem } from './symbol-item.interface';
@ -110,9 +116,11 @@ export {
AdminUsersResponse,
AiPromptResponse,
ApiKeyResponse,
AssertionCredentialJSON,
AssetClassSelectorOption,
AssetProfileIdentifier,
AssetResponse,
AttestationCredentialJSON,
Benchmark,
BenchmarkMarketDataDetailsResponse,
BenchmarkProperty,
@ -161,6 +169,8 @@ export {
PortfolioSummary,
Position,
Product,
PublicKeyCredentialCreationOptionsJSON,
PublicKeyCredentialRequestOptionsJSON,
PublicPortfolioResponse,
QuotesResponse,
ResponseError,

0
apps/api/src/app/auth/interfaces/simplewebauthn.ts → libs/common/src/lib/interfaces/simplewebauthn.interface.ts

Loading…
Cancel
Save