diff --git a/packages/authorization/src/__tests__/acceptance/authorization.acceptance.ts b/packages/authorization/src/__tests__/acceptance/authorization.acceptance.ts index 6b3ecc0384ad..31a254e697ff 100644 --- a/packages/authorization/src/__tests__/acceptance/authorization.acceptance.ts +++ b/packages/authorization/src/__tests__/acceptance/authorization.acceptance.ts @@ -37,7 +37,7 @@ describe('Authorization', () => { }, ]); expect(orderId).to.eql('order-1'); - expect(events).to.containEql('OrderController.prototype.placeOrder'); + expect(events).to.eql(['OrderController.prototype.placeOrder']); }); it('denies cancelOrder for regular user', async () => { @@ -45,7 +45,7 @@ describe('Authorization', () => { 'order-01', ]); await expect(result).to.be.rejectedWith('Access denied'); - expect(events).to.containEql('OrderController.prototype.cancelOrder'); + expect(events).to.eql(['OrderController.prototype.cancelOrder']); }); class Order { diff --git a/packages/authorization/src/authorize-interceptor.ts b/packages/authorization/src/authorize-interceptor.ts index 9ff14bd81e73..a1892b91163b 100644 --- a/packages/authorization/src/authorize-interceptor.ts +++ b/packages/authorization/src/authorize-interceptor.ts @@ -10,8 +10,6 @@ import { // eslint-disable-next-line @typescript-eslint/no-unused-vars config, Context, - filterByTag, - inject, Interceptor, InvocationContext, Next, @@ -37,8 +35,6 @@ export class AuthorizationInterceptor implements Provider { private options: AuthorizationOptions; constructor( - @inject(filterByTag(AuthorizationTags.AUTHORIZER)) - private authorizers: Authorizer[], @config({fromBinding: AuthorizationBindings.COMPONENT}) options: AuthorizationOptions = {}, ) { @@ -87,13 +83,12 @@ export class AuthorizationInterceptor implements Provider { }; debug('Security context for %s', description, authorizationCtx); - let authorizers = await loadAuthorizers( + const authorizers = await loadAuthorizers( invocationCtx, metadata.voters ?? [], ); let finalDecision = this.options.defaultDecision; - authorizers = authorizers.concat(this.authorizers); for (const fn of authorizers) { const decision = await fn(authorizationCtx, metadata); debug('Decision', decision);