From 221051f32f052033b276f9da527d5625537ec4c1 Mon Sep 17 00:00:00 2001 From: Michael Bromley Date: Fri, 18 Jun 2021 16:53:46 +0200 Subject: [PATCH] feat(core): Export PasswordCipher helper --- .../core/src/config/auth/native-authentication-strategy.ts | 6 +++--- .../{password-ciper.ts => password-cipher.ts} | 2 +- packages/core/src/service/index.ts | 1 + packages/core/src/service/service.module.ts | 4 ++-- packages/core/src/service/services/administrator.service.ts | 4 ++-- packages/core/src/service/services/user.service.ts | 4 ++-- 6 files changed, 11 insertions(+), 10 deletions(-) rename packages/core/src/service/helpers/password-cipher/{password-ciper.ts => password-cipher.ts} (93%) diff --git a/packages/core/src/config/auth/native-authentication-strategy.ts b/packages/core/src/config/auth/native-authentication-strategy.ts index 56ce4115ae..5f385a1d68 100644 --- a/packages/core/src/config/auth/native-authentication-strategy.ts +++ b/packages/core/src/config/auth/native-authentication-strategy.ts @@ -7,7 +7,7 @@ import { UnauthorizedError } from '../../common/error/errors'; import { Injector } from '../../common/injector'; import { NativeAuthenticationMethod } from '../../entity/authentication-method/native-authentication-method.entity'; import { User } from '../../entity/user/user.entity'; -import { PasswordCiper } from '../../service/helpers/password-cipher/password-ciper'; +import { PasswordCipher } from '../../service/helpers/password-cipher/password-cipher'; import { TransactionalConnection } from '../../service/transaction/transactional-connection'; import { AuthenticationStrategy } from './authentication-strategy'; @@ -31,11 +31,11 @@ export class NativeAuthenticationStrategy implements AuthenticationStrategy { return bcrypt.hash(plaintext, SALT_ROUNDS); } diff --git a/packages/core/src/service/index.ts b/packages/core/src/service/index.ts index 813d229e8d..21a6f9d3fb 100644 --- a/packages/core/src/service/index.ts +++ b/packages/core/src/service/index.ts @@ -8,6 +8,7 @@ export * from './helpers/order-calculator/order-calculator'; export * from './helpers/order-merger/order-merger'; export * from './helpers/order-modifier/order-modifier'; export * from './helpers/order-state-machine/order-state'; +export * from './helpers/password-cipher/password-cipher'; export * from './helpers/fulfillment-state-machine/fulfillment-state'; export * from './helpers/payment-state-machine/payment-state'; export * from './services/administrator.service'; diff --git a/packages/core/src/service/service.module.ts b/packages/core/src/service/service.module.ts index 5d424521f2..52c828a714 100644 --- a/packages/core/src/service/service.module.ts +++ b/packages/core/src/service/service.module.ts @@ -20,7 +20,7 @@ import { OrderCalculator } from './helpers/order-calculator/order-calculator'; import { OrderMerger } from './helpers/order-merger/order-merger'; import { OrderModifier } from './helpers/order-modifier/order-modifier'; import { OrderStateMachine } from './helpers/order-state-machine/order-state-machine'; -import { PasswordCiper } from './helpers/password-cipher/password-ciper'; +import { PasswordCipher } from './helpers/password-cipher/password-cipher'; import { PaymentStateMachine } from './helpers/payment-state-machine/payment-state-machine'; import { RefundStateMachine } from './helpers/refund-state-machine/refund-state-machine'; import { ShippingCalculator } from './helpers/shipping-calculator/shipping-calculator'; @@ -99,7 +99,7 @@ const services = [ const helpers = [ TranslatableSaver, - PasswordCiper, + PasswordCipher, OrderCalculator, OrderStateMachine, FulfillmentStateMachine, diff --git a/packages/core/src/service/services/administrator.service.ts b/packages/core/src/service/services/administrator.service.ts index 87b3af1e96..07de72022d 100644 --- a/packages/core/src/service/services/administrator.service.ts +++ b/packages/core/src/service/services/administrator.service.ts @@ -15,7 +15,7 @@ import { NativeAuthenticationMethod } from '../../entity/authentication-method/n import { User } from '../../entity/user/user.entity'; import { CustomFieldRelationService } from '../helpers/custom-field-relation/custom-field-relation.service'; import { ListQueryBuilder } from '../helpers/list-query-builder/list-query-builder'; -import { PasswordCiper } from '../helpers/password-cipher/password-ciper'; +import { PasswordCipher } from '../helpers/password-cipher/password-cipher'; import { patchEntity } from '../helpers/utils/patch-entity'; import { TransactionalConnection } from '../transaction/transactional-connection'; @@ -28,7 +28,7 @@ export class AdministratorService { private connection: TransactionalConnection, private configService: ConfigService, private listQueryBuilder: ListQueryBuilder, - private passwordCipher: PasswordCiper, + private passwordCipher: PasswordCipher, private userService: UserService, private roleService: RoleService, private customFieldRelationService: CustomFieldRelationService, diff --git a/packages/core/src/service/services/user.service.ts b/packages/core/src/service/services/user.service.ts index 8fe3d79d0c..cddb5e2c19 100644 --- a/packages/core/src/service/services/user.service.ts +++ b/packages/core/src/service/services/user.service.ts @@ -19,7 +19,7 @@ import { import { ConfigService } from '../../config/config.service'; import { NativeAuthenticationMethod } from '../../entity/authentication-method/native-authentication-method.entity'; import { User } from '../../entity/user/user.entity'; -import { PasswordCiper } from '../helpers/password-cipher/password-ciper'; +import { PasswordCipher } from '../helpers/password-cipher/password-cipher'; import { VerificationTokenGenerator } from '../helpers/verification-token-generator/verification-token-generator'; import { TransactionalConnection } from '../transaction/transactional-connection'; @@ -31,7 +31,7 @@ export class UserService { private connection: TransactionalConnection, private configService: ConfigService, private roleService: RoleService, - private passwordCipher: PasswordCiper, + private passwordCipher: PasswordCipher, private verificationTokenGenerator: VerificationTokenGenerator, ) {}