| | | 1 | | // Licensed to the .NET Foundation under one or more agreements. |
| | | 2 | | // The .NET Foundation licenses this file to you under the MIT license. |
| | | 3 | | |
| | | 4 | | using Microsoft.CodeAnalysis; |
| | | 5 | | |
| | | 6 | | namespace CoreWCF.BuildTools; |
| | | 7 | | |
| | | 8 | | internal static class DiagnosticDescriptors |
| | | 9 | | { |
| | | 10 | | internal static class OperationParameterInjectionGenerator_01XX |
| | | 11 | | { |
| | 1 | 12 | | internal static readonly DiagnosticDescriptor ParentClassShouldBePartialError = new DiagnosticDescriptor(id: "CO |
| | 1 | 13 | | title: "Parent class should be partial", |
| | 1 | 14 | | messageFormat: "Parent class '{0}' of method '{1}' should be partial", |
| | 1 | 15 | | category: nameof(OperationParameterInjectionGenerator), |
| | 1 | 16 | | DiagnosticSeverity.Error, |
| | 1 | 17 | | isEnabledByDefault: true); |
| | | 18 | | |
| | 24 | 19 | | internal static Diagnostic RaiseParentClassShouldBePartialError(string parentClassName, string methodName, Locat |
| | | 20 | | |
| | 1 | 21 | | internal static readonly DiagnosticDescriptor PropertyNameCannotBeNullOrEmptyError = new DiagnosticDescriptor(id |
| | 1 | 22 | | title: "PropertyName cannot be null or empty", |
| | 1 | 23 | | messageFormat: "PropertyName value of CoreWCF.InjectedAttribute cannot be null or empty", |
| | 1 | 24 | | category: nameof(OperationParameterInjectionGenerator), |
| | 1 | 25 | | DiagnosticSeverity.Error, |
| | 1 | 26 | | isEnabledByDefault: true); |
| | | 27 | | |
| | 8 | 28 | | internal static Diagnostic RaisePropertyNameCannotBeNullOrEmptyError(Location location) => Diagnostic.Create(Pro |
| | | 29 | | |
| | 1 | 30 | | internal static readonly DiagnosticDescriptor EitherPropertyNameOrServiceKeyShouldBeSpecified = new DiagnosticDe |
| | 1 | 31 | | title: "Either PropertyName or ServiceKey should be specified", |
| | 1 | 32 | | messageFormat: "PropertyName value of CoreWCF.InjectedAttribute cannot be null or empty", |
| | 1 | 33 | | category: nameof(OperationParameterInjectionGenerator), |
| | 1 | 34 | | DiagnosticSeverity.Error, |
| | 1 | 35 | | isEnabledByDefault: true); |
| | | 36 | | |
| | 8 | 37 | | internal static Diagnostic RaiseEitherPropertyNameOrServiceKeyShouldBeSpecified(Location location) => Diagnostic |
| | | 38 | | } |
| | | 39 | | |
| | | 40 | | internal static class AuthorizationAttributesAnalyzer_02XX |
| | | 41 | | { |
| | 1 | 42 | | internal static readonly DiagnosticDescriptor AllowAnonymousAttributeIsNotSupported = new DiagnosticDescriptor(i |
| | 1 | 43 | | title: "[AllowAnonymous] attribute is not supported", |
| | 1 | 44 | | messageFormat: "[AllowAnonymous] attribute is not supported", |
| | 1 | 45 | | category: nameof(AuthorizationAttributesAnalyzer), |
| | 1 | 46 | | DiagnosticSeverity.Warning, |
| | 1 | 47 | | isEnabledByDefault: true); |
| | | 48 | | |
| | 16 | 49 | | internal static Diagnostic AllowAnonymousAttributeIsNotSupportedWarning(Location location) => Diagnostic.Create( |
| | | 50 | | |
| | 1 | 51 | | internal static readonly DiagnosticDescriptor AuthorizeDataAuthenticationSchemesPropertyIsNotSupported = new Dia |
| | 1 | 52 | | title: "Specifying 'AuthenticationSchemes' property of [Authorize] attribute is not supported", |
| | 1 | 53 | | messageFormat: "Specifying 'AuthenticationSchemes' property of [Authorize] attribute is not supported", |
| | 1 | 54 | | category: nameof(AuthorizationAttributesAnalyzer), |
| | 1 | 55 | | DiagnosticSeverity.Warning, |
| | 1 | 56 | | isEnabledByDefault: true); |
| | | 57 | | |
| | 4 | 58 | | internal static Diagnostic AuthorizeDataAuthenticationSchemesPropertyIsNotSupportedWarning(Location location) => |
| | | 59 | | |
| | 1 | 60 | | internal static readonly DiagnosticDescriptor AuthorizeDataRolesPropertyIsNotSupported = new DiagnosticDescripto |
| | 1 | 61 | | title: "Specifying 'Roles' property of [Authorize] attribute is not supported", |
| | 1 | 62 | | messageFormat: "Specifying 'Roles' property of [Authorize] attribute is not supported", |
| | 1 | 63 | | category: nameof(AuthorizationAttributesAnalyzer), |
| | 1 | 64 | | DiagnosticSeverity.Warning, |
| | 1 | 65 | | isEnabledByDefault: true); |
| | | 66 | | |
| | 4 | 67 | | internal static Diagnostic AuthorizeDataRolesPropertyIsNotSupportedWarning(Location location) => Diagnostic.Crea |
| | | 68 | | } |
| | | 69 | | |
| | | 70 | | internal static class PrivateServiceContractAnalyzer__03XX |
| | | 71 | | { |
| | 1 | 72 | | internal static readonly DiagnosticDescriptor PrivateServiceContract = new DiagnosticDescriptor(id: "COREWCF_030 |
| | 1 | 73 | | title: "Private ServiceContract interface", |
| | 1 | 74 | | messageFormat: "ServiceContract '{0}' accessibility should at least be internal to generate an OperationInvo |
| | 1 | 75 | | category: nameof(PrivateServiceContractAnalyzer), |
| | 1 | 76 | | DiagnosticSeverity.Warning, |
| | 1 | 77 | | isEnabledByDefault: true); |
| | | 78 | | |
| | | 79 | | internal static Diagnostic PrivateServiceContractError(string serviceContract, Location location) => |
| | 8 | 80 | | Diagnostic.Create(PrivateServiceContract, location, serviceContract); |
| | | 81 | | } |
| | | 82 | | } |
| | | 83 | | |