@@ -514,6 +514,45 @@ describe('Custom operations have @aws_iam directives when enableIamAuthorization
514514 expect ( out . schema ) . toMatch ( / t y p e E v e n t I n v o c a t i o n R e s p o n s e .* @ a w s _ i a m / ) ;
515515 } ) ;
516516
517+ test ( 'Does not add @aws_iam to interfaces' , ( ) => {
518+ const strategy = makeStrategy ( strategyType ) ;
519+ const schema = /* GraphQL */ `
520+ interface FooInterface {
521+ id: ID!
522+ }
523+ type Foo {
524+ description: String
525+ }
526+ type EventInvocationResponse @aws_api_key {
527+ success: Boolean!
528+ }
529+ type Query {
530+ getFooCustom: Foo
531+ }
532+ type Mutation {
533+ updateFooCustom: Foo
534+ doSomethingAsync(body: String!): EventInvocationResponse
535+ @function(name: "FnDoSomethingAsync", invocationType: Event)
536+ @auth(rules: [{ allow: public, provider: apiKey }])
537+ }
538+ type Subscription {
539+ onUpdateFooCustom: Foo @aws_subscribe(mutations: ["updateFooCustom"])
540+ }
541+ ` ;
542+
543+ const out = testTransform ( {
544+ schema,
545+ dataSourceStrategies : constructDataSourceStrategies ( schema , strategy ) ,
546+ authConfig : makeAuthConfig ( ) ,
547+ synthParameters : makeSynthParameters ( ) ,
548+ transformers : makeTransformers ( ) ,
549+ sqlDirectiveDataSourceStrategies : makeSqlDirectiveDataSourceStrategies ( schema , strategy ) ,
550+ } ) ;
551+
552+ // Also expect the custom type referenced by the custom operation to be authorized
553+ expect ( out . schema ) . not . toMatch ( / i n t e r f a c e F o o I n t e r f a c e .* @ a w s _ i a m / ) ;
554+ } ) ;
555+
517556 test ( 'Does not add duplicate @aws_iam directive to custom type if already present' , ( ) => {
518557 const strategy = makeStrategy ( strategyType ) ;
519558 const schema = /* GraphQL */ `
0 commit comments