@@ -153,5 +153,94 @@ public static class DiagnosticDescriptors
153153 category : "AWSLambdaCSharpGenerator" ,
154154 DiagnosticSeverity . Error ,
155155 isEnabledByDefault : true ) ;
156+
157+ // Authorizer diagnostics (ALA0019-ALA0027 per design document)
158+ public static readonly DiagnosticDescriptor AuthorizerMissingName = new DiagnosticDescriptor (
159+ id : "AWSLambda0120" ,
160+ title : "Authorizer Name Required" ,
161+ messageFormat : "The Name property is required on [{0}] attribute" ,
162+ category : "AWSLambdaCSharpGenerator" ,
163+ DiagnosticSeverity . Error ,
164+ isEnabledByDefault : true ) ;
165+
166+ public static readonly DiagnosticDescriptor HttpApiAuthorizerNotFound = new DiagnosticDescriptor (
167+ id : "AWSLambda0121" ,
168+ title : "HTTP API Authorizer Not Found" ,
169+ messageFormat : "Authorizer '{0}' referenced in [HttpApi] attribute does not exist. Ensure a Lambda function with [HttpApiAuthorizer] exists with method name '{0}' or ResourceName = \" {0}\" ." ,
170+ category : "AWSLambdaCSharpGenerator" ,
171+ DiagnosticSeverity . Error ,
172+ isEnabledByDefault : true ) ;
173+
174+ public static readonly DiagnosticDescriptor RestApiAuthorizerNotFound = new DiagnosticDescriptor (
175+ id : "AWSLambda0122" ,
176+ title : "REST API Authorizer Not Found" ,
177+ messageFormat : "Authorizer '{0}' referenced in [RestApi] attribute does not exist. Ensure a Lambda function with [RestApiAuthorizer] exists with method name '{0}' or ResourceName = \" {0}\" ." ,
178+ category : "AWSLambdaCSharpGenerator" ,
179+ DiagnosticSeverity . Error ,
180+ isEnabledByDefault : true ) ;
181+
182+ public static readonly DiagnosticDescriptor HttpApiAuthorizerTypeMismatch = new DiagnosticDescriptor (
183+ id : "AWSLambda0123" ,
184+ title : "Authorizer Type Mismatch" ,
185+ messageFormat : "Cannot use REST API authorizer '{0}' with [HttpApi] attribute. Use an [HttpApiAuthorizer] instead." ,
186+ category : "AWSLambdaCSharpGenerator" ,
187+ DiagnosticSeverity . Error ,
188+ isEnabledByDefault : true ) ;
189+
190+ public static readonly DiagnosticDescriptor RestApiAuthorizerTypeMismatch = new DiagnosticDescriptor (
191+ id : "AWSLambda0124" ,
192+ title : "Authorizer Type Mismatch" ,
193+ messageFormat : "Cannot use HTTP API authorizer '{0}' with [RestApi] attribute. Use a [RestApiAuthorizer] instead." ,
194+ category : "AWSLambdaCSharpGenerator" ,
195+ DiagnosticSeverity . Error ,
196+ isEnabledByDefault : true ) ;
197+
198+ public static readonly DiagnosticDescriptor DuplicateAuthorizerName = new DiagnosticDescriptor (
199+ id : "AWSLambda0125" ,
200+ title : "Duplicate Authorizer Name" ,
201+ messageFormat : "Duplicate authorizer name '{0}'. Authorizer names must be unique within the same API type." ,
202+ category : "AWSLambdaCSharpGenerator" ,
203+ DiagnosticSeverity . Error ,
204+ isEnabledByDefault : true ) ;
205+
206+ public static readonly DiagnosticDescriptor InvalidAuthorizerResultTtl = new DiagnosticDescriptor (
207+ id : "AWSLambda0127" ,
208+ title : "Invalid Result TTL" ,
209+ messageFormat : "Invalid ResultTtlInSeconds '{0}'. Must be between 0 and 3600." ,
210+ category : "AWSLambdaCSharpGenerator" ,
211+ DiagnosticSeverity . Error ,
212+ isEnabledByDefault : true ) ;
213+
214+ public static readonly DiagnosticDescriptor AuthorizerPayloadVersionMismatch = new DiagnosticDescriptor (
215+ id : "AWSLambda0128" ,
216+ title : "Authorizer Payload Version Mismatch" ,
217+ messageFormat : "The authorizer '{0}' uses AuthorizerPayloadFormatVersion {1} but the endpoint uses HttpApiVersion {2}. This may cause unexpected behavior." ,
218+ category : "AWSLambdaCSharpGenerator" ,
219+ DiagnosticSeverity . Error ,
220+ isEnabledByDefault : true ) ;
221+
222+ public static readonly DiagnosticDescriptor MissingLambdaFunctionAttribute = new DiagnosticDescriptor (
223+ id : "AWSLambda0129" ,
224+ title : "Missing LambdaFunction Attribute" ,
225+ messageFormat : "Method has [{0}] attribute but is missing the required [LambdaFunction] attribute. Add [LambdaFunction] to this method." ,
226+ category : "AWSLambdaCSharpGenerator" ,
227+ DiagnosticSeverity . Error ,
228+ isEnabledByDefault : true ) ;
229+
230+ public static readonly DiagnosticDescriptor AuthorizerResultOnNonAuthorizerFunction = new DiagnosticDescriptor (
231+ id : "AWSLambda0130" ,
232+ title : $ "Invalid return type IAuthorizerResult",
233+ messageFormat : "IAuthorizerResult is not a valid return type for LambdaFunctions without HttpApiAuthorizer or RestApiAuthorizer attributes" ,
234+ category : "AWSLambdaCSharpGenerator" ,
235+ DiagnosticSeverity . Error ,
236+ isEnabledByDefault : true ) ;
237+
238+ public static readonly DiagnosticDescriptor FromBodyNotSupportedOnAuthorizer = new DiagnosticDescriptor (
239+ id : "AWSLambda0131" ,
240+ title : "FromBody not supported on Authorizer functions" ,
241+ messageFormat : "[FromBody] is not supported on authorizer functions. Authorizer functions only support [FromHeader], [FromQuery], and [FromRoute] parameter attributes." ,
242+ category : "AWSLambdaCSharpGenerator" ,
243+ DiagnosticSeverity . Error ,
244+ isEnabledByDefault : true ) ;
156245 }
157246}
0 commit comments