├── .config
└── dotnet-tools.json
├── .devcontainer
└── devcontainer.json
├── .gitattributes
├── .github
├── ISSUE_TEMPLATE
│ └── bug_report.yaml
└── pull_request_template.md
├── .gitignore
├── .pipelines
├── azure-pipelines.yml
├── cosmos-pipelines.yml
├── dwsql-pipelines.yml
├── mssql-pipelines.yml
├── mysql-pipelines.yml
├── pg-pipelines.yml
├── templates
│ ├── CredScanSuppressions.json
│ ├── build-pipelines.yml
│ ├── code-signing.yml
│ ├── static-tools.yml
│ └── variables.yml
└── unittest-pipelines.yml
├── CODEOWNERS
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── Dockerfile
├── LICENSE.txt
├── Nuget.config
├── README.md
├── SECURITY.md
├── SUPPORT.md
├── config-generators
├── config-generator.ps1
├── config-generator.sh
├── cosmosdb_nosql-commands.txt
├── dwsql-commands.txt
├── mssql-commands.txt
├── mysql-commands.txt
└── postgresql-commands.txt
├── docker
├── docker-compose-cosmos.yml
├── docker-compose-mssql.yml
├── docker-compose-mysql.yml
└── docker-compose-postgresql.yml
├── docs
├── PushToExtContributorPR.md
├── design
│ ├── HealthEndpoint.md
│ ├── HotReloadDiagram.jpg
│ ├── HotReloadDoc.md
│ ├── dab-configure.md
│ ├── dab-validate.md
│ ├── dataSourceHealthCheckTestScenarioFlowchart.png
│ ├── entityHealthCheckTestScenarioFlowchart.png
│ └── query-caching.md
├── media
│ ├── dab-architecture-overview.png
│ ├── dab-logo.png
│ ├── invalid-config.png
│ └── validate-output.png
└── readme.md
├── external_licenses
└── Microsoft.Data.SqlClient.SNI.5.2.0.License.txt
├── global.json
├── nuget
├── README.md
└── nuget_icon.png
├── samples
├── azure
│ ├── azure-container-apps-deploy.sh
│ ├── azure-deploy.sh
│ ├── bicep
│ │ └── dab-on-aca.bicep
│ └── readme.md
├── basic-empty-dab-config.json
└── getting-started
│ ├── azure-cosmos-db
│ └── books.json
│ ├── azure-mysql-db
│ └── library.azure-mysql.sql
│ ├── azure-postgresql
│ ├── exercise-library.postgresql.sql
│ └── library.postgresql.sql
│ └── azure-sql-db
│ ├── .gitignore
│ ├── exercise
│ └── exercise-library.azure-sql.sql
│ └── library.azure-sql.sql
├── schemas
└── dab.draft.schema.json
├── scripts
├── create-manifest-file.ps1
├── dab-smoke-test-script.ps1
├── notice-generation.ps1
├── publish.ps1
└── start-mssql-server.bash
├── src
├── .editorconfig
├── Auth
│ ├── AuthorizationMetadataHelpers.cs
│ ├── Azure.DataApiBuilder.Auth.csproj
│ └── IAuthorizationResolver.cs
├── Azure.DataApiBuilder.sln
├── Cli.Tests
│ ├── AddEntityTests.cs
│ ├── AddOpenTelemetryTests.cs
│ ├── AddTelemetryTests.cs
│ ├── Cli.Tests.csproj
│ ├── ConfigGeneratorTests.cs
│ ├── ConfigureOptionsTests.cs
│ ├── EndToEndTests.cs
│ ├── EnvironmentTests.cs
│ ├── ExporterTests.cs
│ ├── FileSystemUtils.cs
│ ├── InitTests.cs
│ ├── ModuleInitializer.cs
│ ├── Snapshots
│ │ ├── AddEntityTests.AddEntityWithAnExistingNameButWithDifferentCase.verified.txt
│ │ ├── AddEntityTests.AddEntityWithCachingEnabled.verified.txt
│ │ ├── AddEntityTests.AddEntityWithPolicyAndFieldProperties_70de36ebf1478d0d.verified.txt
│ │ ├── AddEntityTests.AddEntityWithPolicyAndFieldProperties_9f612e68879149a3.verified.txt
│ │ ├── AddEntityTests.AddEntityWithPolicyAndFieldProperties_bea2d26f3e5462d8.verified.txt
│ │ ├── AddEntityTests.AddNewEntityWhenEntitiesEmpty.verified.txt
│ │ ├── AddEntityTests.AddNewEntityWhenEntitiesNotEmpty.verified.txt
│ │ ├── AddEntityTests.AddNewEntityWhenEntitiesWithSourceAsStoredProcedure.verified.txt
│ │ ├── AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_0c9cbb8942b4a4e5.verified.txt
│ │ ├── AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_286d268a654ece27.verified.txt
│ │ ├── AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_3048323e01b42681.verified.txt
│ │ ├── AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_3440d150a2282b9c.verified.txt
│ │ ├── AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_381c28d25063be0c.verified.txt
│ │ ├── AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_458373311f6ed4ed.verified.txt
│ │ ├── AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_66799c963a6306ae.verified.txt
│ │ ├── AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_66f598295b8682fd.verified.txt
│ │ ├── AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_73f95f7e2cd3ed71.verified.txt
│ │ ├── AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_79d59edde7f6a272.verified.txt
│ │ ├── AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_7ec82512a1df5293.verified.txt
│ │ ├── AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_cbb6e5548e4d3535.verified.txt
│ │ ├── AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_dc629052f38cea32.verified.txt
│ │ ├── AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_e4a97c7e3507d2c6.verified.txt
│ │ ├── AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_f8d0d0c2a38bd3b8.verified.txt
│ │ ├── AddEntityTests.TestAddStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt
│ │ ├── EndToEndTests.TestAddingStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt
│ │ ├── EndToEndTests.TestConfigGeneratedAfterAddingEntityWithSourceAsStoredProcedure.verified.txt
│ │ ├── EndToEndTests.TestConfigGeneratedAfterAddingEntityWithSourceWithDefaultType.verified.txt
│ │ ├── EndToEndTests.TestConfigGeneratedAfterAddingEntityWithoutIEnumerables.verified.txt
│ │ ├── EndToEndTests.TestConfigGeneratedAfterUpdatingEntityWithSourceAsStoredProcedure.verified.txt
│ │ ├── EndToEndTests.TestInitForCosmosDBNoSql.verified.txt
│ │ ├── EndToEndTests.TestUpdatingStoredProcedureWithRestMethods.verified.txt
│ │ ├── EndToEndTests.TestUpdatingStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt
│ │ ├── EnvironmentTests.TestEnvironmentFileIsConsumedCorrectly.verified.txt
│ │ ├── EnvironmentTests.TestEnvironmentVariableIsConsumedCorrectly.verified.txt
│ │ ├── EnvironmentTests.TestPrecedenceOfEnvironmentFileOverExistingVariables.verified.txt
│ │ ├── InitTests.CosmosDbNoSqlDatabase.verified.txt
│ │ ├── InitTests.CosmosDbPostgreSqlDatabase.verified.txt
│ │ ├── InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_171ea8114ff71814.verified.txt
│ │ ├── InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_2df7a1794712f154.verified.txt
│ │ ├── InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_59fe1a10aa78899d.verified.txt
│ │ ├── InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_b95b637ea87f16a7.verified.txt
│ │ ├── InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_daacbd948b7ef72f.verified.txt
│ │ ├── InitTests.GraphQLPathWithoutStartingSlashWillHaveItAdded.verified.txt
│ │ ├── InitTests.MsSQLDatabase.verified.txt
│ │ ├── InitTests.RestPathWithoutStartingSlashWillHaveItAdded.verified.txt
│ │ ├── InitTests.TestInitializingConfigWithoutConnectionString.verified.txt
│ │ ├── InitTests.TestSpecialCharactersInConnectionString.verified.txt
│ │ ├── InitTests.VerifyCorrectConfigGenerationWithMultipleMutationOptions_0546bef37027a950.verified.txt
│ │ ├── InitTests.VerifyCorrectConfigGenerationWithMultipleMutationOptions_0ac567dd32a2e8f5.verified.txt
│ │ ├── InitTests.VerifyCorrectConfigGenerationWithMultipleMutationOptions_0c06949221514e77.verified.txt
│ │ ├── InitTests.VerifyCorrectConfigGenerationWithMultipleMutationOptions_18667ab7db033e9d.verified.txt
│ │ ├── InitTests.VerifyCorrectConfigGenerationWithMultipleMutationOptions_2f42f44c328eb020.verified.txt
│ │ ├── InitTests.VerifyCorrectConfigGenerationWithMultipleMutationOptions_3243d3f3441fdcc1.verified.txt
│ │ ├── InitTests.VerifyCorrectConfigGenerationWithMultipleMutationOptions_53350b8b47df2112.verified.txt
│ │ ├── InitTests.VerifyCorrectConfigGenerationWithMultipleMutationOptions_6584e0ec46b8a11d.verified.txt
│ │ ├── InitTests.VerifyCorrectConfigGenerationWithMultipleMutationOptions_81cc88db3d4eecfb.verified.txt
│ │ ├── InitTests.VerifyCorrectConfigGenerationWithMultipleMutationOptions_8ea187616dbb5577.verified.txt
│ │ ├── InitTests.VerifyCorrectConfigGenerationWithMultipleMutationOptions_905845c29560a3ef.verified.txt
│ │ ├── InitTests.VerifyCorrectConfigGenerationWithMultipleMutationOptions_b2fd24fab5b80917.verified.txt
│ │ ├── InitTests.VerifyCorrectConfigGenerationWithMultipleMutationOptions_bd7cd088755287c9.verified.txt
│ │ ├── InitTests.VerifyCorrectConfigGenerationWithMultipleMutationOptions_d2eccba2f836b380.verified.txt
│ │ ├── InitTests.VerifyCorrectConfigGenerationWithMultipleMutationOptions_d463eed7fe5e4bbe.verified.txt
│ │ ├── InitTests.VerifyCorrectConfigGenerationWithMultipleMutationOptions_d5520dd5c33f7b8d.verified.txt
│ │ ├── InitTests.VerifyCorrectConfigGenerationWithMultipleMutationOptions_eab4a6010e602b59.verified.txt
│ │ ├── InitTests.VerifyCorrectConfigGenerationWithMultipleMutationOptions_ecaa688829b4030e.verified.txt
│ │ ├── UpdateEntityTests.TestConversionOfSourceObject_036a859f50ce167c.verified.txt
│ │ ├── UpdateEntityTests.TestConversionOfSourceObject_103655d39b48d89f.verified.txt
│ │ ├── UpdateEntityTests.TestConversionOfSourceObject_442649c7ef2176bd.verified.txt
│ │ ├── UpdateEntityTests.TestConversionOfSourceObject_7f2338fdc84aafc3.verified.txt
│ │ ├── UpdateEntityTests.TestConversionOfSourceObject_a70c086a74142c82.verified.txt
│ │ ├── UpdateEntityTests.TestConversionOfSourceObject_c26902b0e44f97cd.verified.txt
│ │ ├── UpdateEntityTests.TestUpdateEntityByAddingNewRelationship.verified.txt
│ │ ├── UpdateEntityTests.TestUpdateEntityByModifyingRelationship.verified.txt
│ │ ├── UpdateEntityTests.TestUpdateEntityCaching.verified.txt
│ │ ├── UpdateEntityTests.TestUpdateEntityPermission.verified.txt
│ │ ├── UpdateEntityTests.TestUpdateEntityPermissionByAddingNewRole.verified.txt
│ │ ├── UpdateEntityTests.TestUpdateEntityPermissionHavingWildcardAction.verified.txt
│ │ ├── UpdateEntityTests.TestUpdateEntityPermissionWithExistingAction.verified.txt
│ │ ├── UpdateEntityTests.TestUpdateEntityPermissionWithWildcardAction.verified.txt
│ │ ├── UpdateEntityTests.TestUpdateEntityWithMappings.verified.txt
│ │ ├── UpdateEntityTests.TestUpdateEntityWithPolicyAndFieldProperties_088d6237033e0a7c.verified.txt
│ │ ├── UpdateEntityTests.TestUpdateEntityWithPolicyAndFieldProperties_3ea32fdef7aed1b4.verified.txt
│ │ ├── UpdateEntityTests.TestUpdateEntityWithPolicyAndFieldProperties_4d25c2c012107597.verified.txt
│ │ ├── UpdateEntityTests.TestUpdateEntityWithSpecialCharacterInMappings.verified.txt
│ │ ├── UpdateEntityTests.TestUpdateExistingMappings.verified.txt
│ │ ├── UpdateEntityTests.TestUpdatePolicy.verified.txt
│ │ ├── UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_10ea92e3b25ab0c9.verified.txt
│ │ ├── UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_127bb81593f835fe.verified.txt
│ │ ├── UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_386efa1a113fac6b.verified.txt
│ │ ├── UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_53db4712d83be8e6.verified.txt
│ │ ├── UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_5e9ddd8c7c740efd.verified.txt
│ │ ├── UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_6c5b3bfc72e5878a.verified.txt
│ │ ├── UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_8398059a743d7027.verified.txt
│ │ ├── UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_a49380ce6d1fd8ba.verified.txt
│ │ ├── UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_c9b12fe27be53878.verified.txt
│ │ ├── UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_d19603117eb8b51b.verified.txt
│ │ ├── UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_d770d682c5802737.verified.txt
│ │ ├── UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_ef8cc721c9dfc7e4.verified.txt
│ │ ├── UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_f3897e2254996db0.verified.txt
│ │ ├── UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_f4cadb897fc5b0fe.verified.txt
│ │ ├── UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_f59b2a65fc1e18a3.verified.txt
│ │ ├── UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_574e1995f787740f.verified.txt
│ │ ├── UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_a13a9ca73b21f261.verified.txt
│ │ ├── UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_a5ce76c8bea25cc8.verified.txt
│ │ ├── UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_bba111332a1f973f.verified.txt
│ │ ├── UpdateEntityTests.UpdateDatabaseSourceKeyFields.verified.txt
│ │ ├── UpdateEntityTests.UpdateDatabaseSourceName.verified.txt
│ │ └── UpdateEntityTests.UpdateDatabaseSourceParameters.verified.txt
│ ├── StringLogger.cs
│ ├── TestHelper.cs
│ ├── TestLoggerSupport.cs
│ ├── UpdateEntityTests.cs
│ ├── Usings.cs
│ ├── UtilsTests.cs
│ └── ValidateConfigTests.cs
├── Cli
│ ├── Cli.csproj
│ ├── Commands
│ │ ├── AddOptions.cs
│ │ ├── AddTelemetryOptions.cs
│ │ ├── ConfigureOptions.cs
│ │ ├── EntityOptions.cs
│ │ ├── ExportOptions.cs
│ │ ├── InitOptions.cs
│ │ ├── StartOptions.cs
│ │ ├── UpdateOptions.cs
│ │ └── ValidateOptions.cs
│ ├── ConfigGenerator.cs
│ ├── ConfigMerger.cs
│ ├── Constants
│ │ └── CliReturnCode.cs
│ ├── CustomLoggerProvider.cs
│ ├── DabCliParserErrorHandler.cs
│ ├── Exporter.cs
│ ├── Options.cs
│ ├── Program.cs
│ ├── Properties
│ │ └── launchSettings.json
│ └── Utils.cs
├── Config
│ ├── Azure.DataApiBuilder.Config.csproj
│ ├── ConfigFileWatcher.cs
│ ├── Converters
│ │ ├── DataSourceConverterFactory.cs
│ │ ├── DataSourceFilesConverter.cs
│ │ ├── DatasourceHealthOptionsConvertorFactory.cs
│ │ ├── EntityActionConverterFactory.cs
│ │ ├── EntityCacheOptionsConverterFactory.cs
│ │ ├── EntityGraphQLOptionsConverterFactory.cs
│ │ ├── EntityHealthOptionsConvertorFactory.cs
│ │ ├── EntityRestOptionsConverterFactory.cs
│ │ ├── EntitySourceConverterFactory.cs
│ │ ├── EnumMemberJsonEnumConverterFactory.cs
│ │ ├── EnvironmentVariableReplacementFailureMode.cs
│ │ ├── GraphQLRuntimeOptionsConverterFactory.cs
│ │ ├── HostOptionsConverterFactory.cs
│ │ ├── MultipleCreateOptionsConverter.cs
│ │ ├── MultipleMutationOptionsConverter.cs
│ │ ├── RestRuntimeOptionsConverterFactory.cs
│ │ ├── RuntimeCacheLevel2OptionsConverterFactory.cs
│ │ ├── RuntimeCacheOptionsConverterFactory.cs
│ │ ├── RuntimeEntitiesConverter.cs
│ │ ├── RuntimeHealthOptionsConvertorFactory.cs
│ │ ├── StringJsonConverterFactory.cs
│ │ └── Utf8JsonReaderExtensions.cs
│ ├── DabChangeToken.cs
│ ├── DabConfigEvents.cs
│ ├── DataApiBuilderException.cs
│ ├── DatabasePrimitives
│ │ └── DatabaseObject.cs
│ ├── FeatureFlagConstants.cs
│ ├── FileSystemRuntimeConfigLoader.cs
│ ├── HealthCheck
│ │ ├── DatasourceHealthCheckConfig.cs
│ │ ├── EntityHealthCheckConfig.cs
│ │ ├── HealthCheckConfig.cs
│ │ ├── HealthCheckConstants.cs
│ │ └── RuntimeHealthCheckConfig.cs
│ ├── HotReloadEventArgs.cs
│ ├── HotReloadEventHandler.cs
│ ├── MergeJsonProvider.cs
│ ├── NamingPolicies
│ │ └── HyphenatedNamingPolicy.cs
│ ├── ObjectModel
│ │ ├── ApiType.cs
│ │ ├── ApplicationInsightsOptions.cs
│ │ ├── AuthenticationOptions.cs
│ │ ├── AuthorizationType.cs
│ │ ├── Cardinality.cs
│ │ ├── CliBool.cs
│ │ ├── CorsOptions.cs
│ │ ├── DataSource.cs
│ │ ├── DataSourceFiles.cs
│ │ ├── DatabaseType.cs
│ │ ├── EasyAuthType.cs
│ │ ├── Entity.cs
│ │ ├── EntityAction.cs
│ │ ├── EntityActionFields.cs
│ │ ├── EntityActionOperation.cs
│ │ ├── EntityActionPolicy.cs
│ │ ├── EntityCacheLevel.cs
│ │ ├── EntityCacheOptions.cs
│ │ ├── EntityDbPolicyCosmosModel.cs
│ │ ├── EntityGraphQLOptions.cs
│ │ ├── EntityPermission.cs
│ │ ├── EntityRelationship.cs
│ │ ├── EntityRelationshipKey.cs
│ │ ├── EntityRestOptions.cs
│ │ ├── EntitySource.cs
│ │ ├── EntitySourceType.cs
│ │ ├── FeatureFlags.cs
│ │ ├── GraphQLOperation.cs
│ │ ├── GraphQLRuntimeOptions.cs
│ │ ├── HostMode.cs
│ │ ├── HostOptions.cs
│ │ ├── JwtOptions.cs
│ │ ├── MultipleCreateOptions.cs
│ │ ├── MultipleCreateSupportingDatabaseType.cs
│ │ ├── MultipleMutationOptions.cs
│ │ ├── OpenTelemetryOptions.cs
│ │ ├── PaginationOptions.cs
│ │ ├── RelationshipRole.cs
│ │ ├── RestRuntimeOptions.cs
│ │ ├── RuntimeCacheLevel2Options.cs
│ │ ├── RuntimeCacheOptions.cs
│ │ ├── RuntimeConfig.cs
│ │ ├── RuntimeEntities.cs
│ │ ├── RuntimeOptions.cs
│ │ ├── SupportedHttpVerb.cs
│ │ └── TelemetryOptions.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── RuntimeConfigLoader.cs
│ └── Utilities
│ │ ├── FileUtilities.cs
│ │ └── HttpStatusCodeExtensions.cs
├── Core
│ ├── AuthenticationHelpers
│ │ ├── AppServiceAuthentication.cs
│ │ ├── AppServiceAuthenticationInformation.cs
│ │ ├── AuthenticationSimulator
│ │ │ ├── SimulatorAuthenticationBuilderExtensions.cs
│ │ │ ├── SimulatorAuthenticationDefaults.cs
│ │ │ └── SimulatorAuthenticationHandler.cs
│ │ ├── ClientRoleHeaderAuthenticationMiddleware.cs
│ │ ├── ConfigureJwtBearerOptions.cs
│ │ ├── EasyAuthAuthenticationBuilderExtensions.cs
│ │ ├── EasyAuthAuthenticationDefaults.cs
│ │ ├── EasyAuthAuthenticationHandler.cs
│ │ ├── EasyAuthAuthenticationOptions.cs
│ │ ├── GenericOAuthDefaults.cs
│ │ ├── StaticWebAppsAuthentication.cs
│ │ └── SupportedAuthNProviders.cs
│ ├── Authorization
│ │ ├── AuthorizationRequirements.cs
│ │ ├── AuthorizationResolver.cs
│ │ ├── ClientRoleHeaderAuthorizationMiddleware.cs
│ │ ├── GraphQLAuthorizationHandler.cs
│ │ └── RestAuthorizationHandler.cs
│ ├── Azure.DataApiBuilder.Core.csproj
│ ├── Configurations
│ │ ├── IConfigValidator.cs
│ │ ├── JsonConfigSchemaValidator.cs
│ │ ├── LoggerFilters.cs
│ │ ├── RuntimeConfigProvider.cs
│ │ ├── RuntimeConfigValidator.cs
│ │ └── RuntimeConfigValidatorUtil.cs
│ ├── EnumerableUtilities.cs
│ ├── Extensions
│ │ └── DabPathExtensions.cs
│ ├── Generator
│ │ ├── AttributeObject.cs
│ │ ├── Sampler
│ │ │ ├── CosmosExecutor.cs
│ │ │ ├── EligibleDataSampler.cs
│ │ │ ├── ISchemaGeneratorSampler.cs
│ │ │ ├── TimePartitionedSampler.cs
│ │ │ └── TopNExtractor.cs
│ │ ├── SamplingModes.cs
│ │ ├── SchemaGenerator.cs
│ │ └── SchemaGeneratorFactory.cs
│ ├── Models
│ │ ├── CosmosOperationMetadata.cs
│ │ ├── DatabaseQueryMetadata.cs
│ │ ├── DbConnectionParam.cs
│ │ ├── DbResultSet.cs
│ │ ├── GraphQLFilterParsers.cs
│ │ ├── GroupByMetadata.cs
│ │ ├── HttpConstants.cs
│ │ ├── HttpContextExtensions.cs
│ │ ├── HttpHeaders.cs
│ │ ├── IMetadata.cs
│ │ ├── JsonSchemaValidationResult.cs
│ │ ├── MultipleMutationEntityInputValidationContext.cs
│ │ ├── MutationResolver.cs
│ │ ├── PaginationMetadata.cs
│ │ ├── RelationshipFields.cs
│ │ ├── RestRequestContexts
│ │ │ ├── DeleteRequestContext.cs
│ │ │ ├── FindRequestContext.cs
│ │ │ ├── InsertRequestContext.cs
│ │ │ ├── RestRequestContext.cs
│ │ │ ├── StoredProcedureRequestContext.cs
│ │ │ └── UpsertRequestContext.cs
│ │ ├── SqlInformationalCodes.cs
│ │ ├── SqlQueryStructures.cs
│ │ └── SqlTypeConstants.cs
│ ├── Parsers
│ │ ├── ClaimsTypeDataUriResolver.cs
│ │ ├── EdmModelBuilder.cs
│ │ ├── EntitySourceNamesParser.cs
│ │ ├── FilterParser.cs
│ │ ├── IntrospectionInterceptor.cs
│ │ ├── ODataASTCosmosVisitor.cs
│ │ ├── ODataASTFieldVisitor.cs
│ │ ├── ODataASTVisitor.cs
│ │ └── RequestParser.cs
│ ├── Resolvers
│ │ ├── ArrayPoolWriter.cs
│ │ ├── AuthorizationPolicyHelpers.cs
│ │ ├── BaseQueryStructure.cs
│ │ ├── BaseSqlQueryBuilder.cs
│ │ ├── BaseTSqlQueryBuilder.cs
│ │ ├── CosmosClientProvider.cs
│ │ ├── CosmosExistsQueryStructure.cs
│ │ ├── CosmosMutationEngine.cs
│ │ ├── CosmosQueryBuilder.cs
│ │ ├── CosmosQueryEngine.cs
│ │ ├── CosmosQueryStructure.cs
│ │ ├── DWSqlQueryBuilder.cs
│ │ ├── DbExceptionParser.cs
│ │ ├── Factories
│ │ │ ├── IAbstractQueryManagerFactory.cs
│ │ │ ├── IMutationEngineFactory.cs
│ │ │ ├── IQueryEngineFactory.cs
│ │ │ ├── MutationEngineFactory.cs
│ │ │ ├── QueryEngineFactory.cs
│ │ │ └── QueryManagerFactory.cs
│ │ ├── IMutationEngine.cs
│ │ ├── IQueryBuilder.cs
│ │ ├── IQueryEngine.cs
│ │ ├── IQueryExecutor.cs
│ │ ├── JsonObjectExtensions.cs
│ │ ├── MsSqlDbExceptionParser.cs
│ │ ├── MsSqlQueryBuilder.cs
│ │ ├── MsSqlQueryExecutor.cs
│ │ ├── MultipleCreateOrderHelper.cs
│ │ ├── MySqlDbExceptionParser.cs
│ │ ├── MySqlQueryBuilder.cs
│ │ ├── MySqlQueryExecutor.cs
│ │ ├── PostgreSqlDbExceptionParser.cs
│ │ ├── PostgreSqlExecutor.cs
│ │ ├── PostgresQueryBuilder.cs
│ │ ├── QueryExecutor.cs
│ │ ├── Sql Query Structures
│ │ │ ├── BaseSqlQueryStructure.cs
│ │ │ ├── MultipleCreateStructure.cs
│ │ │ ├── SqlDeleteQueryStructure.cs
│ │ │ ├── SqlExecuteQueryStructure.cs
│ │ │ ├── SqlInsertQueryStructure.cs
│ │ │ ├── SqlQueryStructure.cs
│ │ │ ├── SqlUpdateQueryStructure.cs
│ │ │ └── SqlUpsertQueryStructure.cs
│ │ ├── SqlExistsQueryStructure.cs
│ │ ├── SqlMutationEngine.cs
│ │ ├── SqlPaginationUtil.cs
│ │ ├── SqlQueryEngine.cs
│ │ └── SqlResponseHelpers.cs
│ ├── Services
│ │ ├── BuildRequestStateMiddleware.cs
│ │ ├── Cache
│ │ │ └── DabCacheService.cs
│ │ ├── CorrelationIdMiddleware.cs
│ │ ├── DetermineStatusCodeMiddleware.cs
│ │ ├── ExecutionHelper.cs
│ │ ├── GraphQLSchemaCreator.cs
│ │ ├── MetadataProviders
│ │ │ ├── Converters
│ │ │ │ ├── DatabaseObjectConverter.cs
│ │ │ │ ├── ObjectConverter.cs
│ │ │ │ └── TypeConverter.cs
│ │ │ ├── CosmosSqlMetadataProvider.cs
│ │ │ ├── IMetadataProviderFactory.cs
│ │ │ ├── ISqlMetadataProvider.cs
│ │ │ ├── MetadataProviderFactory.cs
│ │ │ ├── MsSqlMetadataProvider.cs
│ │ │ ├── MySqlMetadataProvider.cs
│ │ │ ├── PostgreSqlMetadataProvider.cs
│ │ │ └── SqlMetadataProvider.cs
│ │ ├── MultipleMutationInputValidator.cs
│ │ ├── OpenAPI
│ │ │ ├── IOpenApiDocumentor.cs
│ │ │ ├── JsonDataType.cs
│ │ │ ├── OpenApiDocumentor.cs
│ │ │ └── SwaggerEndpointMapper.cs
│ │ ├── PathRewriteMiddleware.cs
│ │ ├── RequestValidator.cs
│ │ ├── ResolverTypeInterceptor.cs
│ │ ├── RestService.cs
│ │ └── TypeHelper.cs
│ └── Telemetry
│ │ ├── TelemetryMetricsHelper.cs
│ │ └── TelemetryTracesHelper.cs
├── Directory.Build.props
├── Directory.Packages.props
├── Product
│ ├── Azure.DataApiBuilder.Product.csproj
│ └── ProductInfo.cs
├── Service.GraphQLBuilder
│ ├── Azure.DataApiBuilder.Service.GraphQLBuilder.csproj
│ ├── CustomScalars
│ │ └── SingleType.cs
│ ├── Directives
│ │ ├── AutoGeneratedDirectiveType.cs
│ │ ├── DefaultValueDirectiveType.cs
│ │ ├── ModelDirective.cs
│ │ ├── PrimaryKeyDirective.cs
│ │ ├── ReferencingFieldDirectiveType.cs
│ │ └── RelationshipDirective.cs
│ ├── GraphQLNaming.cs
│ ├── GraphQLStoredProcedureBuilder.cs
│ ├── GraphQLTypes
│ │ ├── DefaultValueType.cs
│ │ ├── OrderByType.cs
│ │ └── SupportedTypes.cs
│ ├── GraphQLUtils.cs
│ ├── Mutations
│ │ ├── CreateMutationBuilder.cs
│ │ ├── DeleteMutationBuilder.cs
│ │ ├── MutationBuilder.cs
│ │ └── UpdateAndPatchMutationBuilder.cs
│ ├── Queries
│ │ ├── EnumTypeBuilder.cs
│ │ ├── InputTypeBuilder.cs
│ │ ├── QueryBuilder.cs
│ │ └── StandardQueryInputs.cs
│ └── Sql
│ │ └── SchemaConverter.cs
├── Service.Tests
│ ├── AuthTestHelper.cs
│ ├── Authentication
│ │ ├── EasyAuthAuthenticationUnitTests.cs
│ │ ├── Helpers
│ │ │ ├── AuthTestCertHelper.cs
│ │ │ ├── RuntimeConfigAuthHelper.cs
│ │ │ └── WebHostBuilderHelper.cs
│ │ ├── JwtTokenAuthenticationUnitTests.cs
│ │ └── SimulatorAuthenticationUnitTests.cs
│ ├── Authorization
│ │ ├── AuthorizationHelpers.cs
│ │ ├── AuthorizationResolverUnitTests.cs
│ │ ├── ClientRoleHeaderAuthorizationMiddlewareTests.cs
│ │ ├── GraphQL
│ │ │ ├── CreateMutationAuthorizationTests.cs
│ │ │ ├── GraphQLAuthorizationHandlerTests.cs
│ │ │ ├── GraphQLMutationAuthorizationTests.cs
│ │ │ ├── GraphQLMutationAuthorizationUnitTests.cs
│ │ │ ├── GraphQLQueryAuthorizationUnitTests.cs
│ │ │ └── Policies
│ │ │ │ ├── GraphQLDeleteMutationDatabasePolicyTestBase.cs
│ │ │ │ ├── GraphQLQueryDatabasePolicyTestBase.cs
│ │ │ │ ├── GraphQLUpdateMutationDatabasePolicyTestBase.cs
│ │ │ │ ├── MsSqlGraphQLDeleteMutationPolicyTests.cs
│ │ │ │ ├── MsSqlGraphQLQueryPolicyTests.cs
│ │ │ │ ├── MsSqlGraphQLUpdateMutationPolicyTests.cs
│ │ │ │ ├── MySqlGraphQLDeleteMutationPolicyTests.cs
│ │ │ │ ├── MySqlGraphQLQueryPolicyTests.cs
│ │ │ │ ├── MySqlGraphQLUpdateMutationPolicyTests.cs
│ │ │ │ ├── PostgresGraphQLDeleteMutationPolicyTests.cs
│ │ │ │ ├── PostgresGraphQLQueryPolicyTests.cs
│ │ │ │ └── PostgresGraphQLUpdateMutationPolicyTests.cs
│ │ ├── REST
│ │ │ └── RestAuthorizationHandlerUnitTests.cs
│ │ └── SimulatorIntegrationTests.cs
│ ├── Azure.DataApiBuilder.Service.Tests.csproj
│ ├── Caching
│ │ ├── CachingConfigProcessingTests.cs
│ │ ├── DabCacheServiceIntegrationTests.cs
│ │ └── HealthEndpointCachingTests.cs
│ ├── ConcurrentTests
│ │ ├── Helper.js
│ │ ├── SqlTests
│ │ │ ├── ParallelCreateOperations.js
│ │ │ ├── ParallelCrudOperationsTestCase.js
│ │ │ ├── ParallelDeleteOnSameItem.js
│ │ │ ├── ParallelReadsTestCase.js
│ │ │ ├── ParallelUpdateAndReadOnSameItem.js
│ │ │ ├── ParallelUpdatesOnSameItem.js
│ │ │ └── test.js
│ │ └── cgmanifest.json
│ ├── Configuration
│ │ ├── AuthenticationConfigValidatorUnitTests.cs
│ │ ├── ComprehensiveHealthReportResponse.json
│ │ ├── ConfigurationEndpoints.cs
│ │ ├── ConfigurationTests.cs
│ │ ├── CorrelationIdTests.cs
│ │ ├── CorsUnitTests.cs
│ │ ├── HealthEndpointRolesTests.cs
│ │ ├── HealthEndpointTests.cs
│ │ ├── HotReload
│ │ │ ├── AuthorizationResolverHotReloadTests.cs
│ │ │ └── ConfigurationHotReloadTests.cs
│ │ ├── LoadConfigViaEndpoint.cs
│ │ ├── OpenTelemetryTests.cs
│ │ ├── RuntimeConfigLoaderTests.cs
│ │ ├── TelemetryTests.cs
│ │ └── TestConfigFileReader.cs
│ ├── CosmosTests
│ │ ├── CosmosClientTests.cs
│ │ ├── CosmosTestHelper.cs
│ │ ├── MutationTests.cs
│ │ ├── QueryFilterTests.cs
│ │ ├── QueryTests.cs
│ │ ├── SamplerTests.cs
│ │ ├── SchemaGeneratorFactoryTests.cs
│ │ ├── SchemaGeneratorTest.cs
│ │ ├── TestBase.cs
│ │ └── TestData
│ │ │ ├── CosmosData
│ │ │ ├── EmulatorData.json
│ │ │ └── MultiItems
│ │ │ │ ├── 1.json
│ │ │ │ ├── 2.json
│ │ │ │ ├── 3.json
│ │ │ │ ├── 4.json
│ │ │ │ └── 5.json
│ │ │ └── GeneratedGqlSchema
│ │ │ ├── EmulatorData.gql
│ │ │ ├── MultiItems.gql
│ │ │ └── MultiItemsWithConfig.gql
│ ├── DatabaseSchema-DwSql.sql
│ ├── DatabaseSchema-MsSql.sql
│ ├── DatabaseSchema-MySql.sql
│ ├── DatabaseSchema-PostgreSql.sql
│ ├── GraphQLBuilder
│ │ ├── EnumTypeBuilderTests.cs
│ │ ├── Helpers
│ │ │ └── GraphQLTestHelpers.cs
│ │ ├── InputTypeBuilderTests.cs
│ │ ├── MsSqlMultipleMutationBuilderTests.cs
│ │ ├── MultiSourceBuilderTests.cs
│ │ ├── MultipleMutationBuilderTests.cs
│ │ ├── MutationBuilderTests.cs
│ │ ├── QueryBuilderTests.cs
│ │ └── Sql
│ │ │ ├── SchemaConverterTests.cs
│ │ │ └── StoredProcedureBuilderTests.cs
│ ├── GraphQLRequestExecutor.cs
│ ├── ModuleInitializer.cs
│ ├── MultiSourceTestSchema.gql
│ ├── Multidab-config.CosmosDb_NoSql.json
│ ├── Multidab-config.MsSql.json
│ ├── Multidab-config.MySql.json
│ ├── Multidab-config.PostgreSql.json
│ ├── OpenApiDocumentor
│ │ ├── CLRtoJsonValueTypeUnitTests.cs
│ │ ├── DocumentVerbosityTests.cs
│ │ ├── OpenApiDocumentorConstants.cs
│ │ ├── OpenApiTestBootstrap.cs
│ │ ├── ParameterValidationTests.cs
│ │ ├── PathValidationTests.cs
│ │ └── StoredProcedureGeneration.cs
│ ├── Resolvers
│ │ └── ArrayPoolWriterTests.cs
│ ├── Snapshots
│ │ ├── ConfigurationTests.TestReadingRuntimeConfigForCosmos.verified.txt
│ │ ├── ConfigurationTests.TestReadingRuntimeConfigForMsSql.verified.txt
│ │ ├── ConfigurationTests.TestReadingRuntimeConfigForMySql.verified.txt
│ │ ├── ConfigurationTests.TestReadingRuntimeConfigForPostgreSql.verified.txt
│ │ └── CorsUnitTests.TestCorsConfigReadCorrectly.verified.txt
│ ├── SqlTests
│ │ ├── GraphQLCollationTests
│ │ │ ├── GraphQLCollationTestBase.cs
│ │ │ ├── MsSqlGraphQLCollationTests.cs
│ │ │ ├── MySqlGraphQLCollationTests.cs
│ │ │ └── PostgreSqlGraphQLCollationTests.cs
│ │ ├── GraphQLFilterTests
│ │ │ ├── GraphQLFilterTestBase.cs
│ │ │ ├── MsSqlGQLFilterTests.cs
│ │ │ ├── MySqlGQLFilterTests.cs
│ │ │ └── PostgreSqlGQLFilterTests.cs
│ │ ├── GraphQLMutationTests
│ │ │ ├── DwSqlGraphQLMutationTests.cs
│ │ │ ├── GraphQLMutationTestBase.cs
│ │ │ ├── MsSqlGraphQLMutationTests.cs
│ │ │ ├── MultipleCreateMutationTests
│ │ │ │ ├── MsSqlMultipleCreateMutationTests.cs
│ │ │ │ └── MultipleCreateMutationTestBase.cs
│ │ │ ├── MultipleMutationIntegrationTests.cs
│ │ │ ├── MySqlGraphQLMutationTests.cs
│ │ │ └── PostgreSqlGraphQLMutationTests.cs
│ │ ├── GraphQLPaginationTests
│ │ │ ├── GraphQLPaginationTestBase.cs
│ │ │ ├── MsSqlGraphQLPaginationTests.cs
│ │ │ ├── MySqlGraphQLPaginationTests.cs
│ │ │ └── PostgreSqlGraphQLPaginationTests.cs
│ │ ├── GraphQLQueryTests
│ │ │ ├── DwSqlGraphQLQueryTests.cs
│ │ │ ├── GraphQLQueryTestBase.cs
│ │ │ ├── MsSqlGraphQLQueryTests.cs
│ │ │ ├── MySqlGraphQLQueryTests.cs
│ │ │ └── PostgreSqlGraphQLQueryTests.cs
│ │ ├── GraphQLSupportedTypesTests
│ │ │ ├── DabField.cs
│ │ │ ├── GraphQLSupportedTypesTestsBase.cs
│ │ │ ├── MsSqlGQLSupportedTypesTests.cs
│ │ │ ├── MySqlGQLSupportedTypesTests.cs
│ │ │ └── PostgreSqlGQLSupportedTypesTests.cs
│ │ ├── RestApiTests
│ │ │ ├── Delete
│ │ │ │ ├── DeleteApiTestBase.cs
│ │ │ │ ├── DwSqlDeleteApiTest.cs
│ │ │ │ ├── MsSqlDeleteApiTest.cs
│ │ │ │ ├── MySqlDeleteApiTest.cs
│ │ │ │ └── PostgreSqlDeleteApiTests.cs
│ │ │ ├── Find
│ │ │ │ ├── DwSqlFindApiTests.cs
│ │ │ │ ├── FindApiTestBase.cs
│ │ │ │ ├── MsSqlFindApiTests.cs
│ │ │ │ ├── MySqlFindApiTests.cs
│ │ │ │ └── PostgreSqlFindApiTests.cs
│ │ │ ├── Insert
│ │ │ │ ├── InsertApiTestBase.cs
│ │ │ │ ├── MsSqlInsertApiTests.cs
│ │ │ │ ├── MySqlInsertApiTests.cs
│ │ │ │ └── PostgreSqlInsertApiTests.cs
│ │ │ ├── OtherRestApiTests.cs
│ │ │ ├── Patch
│ │ │ │ ├── MsSqlPatchApiTests.cs
│ │ │ │ ├── MySqlPatchApiTests.cs
│ │ │ │ ├── PatchApiTestBase.cs
│ │ │ │ └── PostgreSqlPatchApiTests.cs
│ │ │ ├── Put
│ │ │ │ ├── MsSqlPutApiTests.cs
│ │ │ │ ├── MySqlPutApiTests.cs
│ │ │ │ ├── PostgreSqlPutApiTests.cs
│ │ │ │ └── PutApiTestBase.cs
│ │ │ ├── RestApiTestBase.cs
│ │ │ └── RestBodyNonStrictModeTests
│ │ │ │ ├── MsSqlRestBodyNonStrictModeTests.cs
│ │ │ │ ├── MySqlRestBodyNonStrictModeTests.cs
│ │ │ │ ├── PostgreSqlRestBodyNonStrictModeTests.cs
│ │ │ │ └── RestBodyNonStrictModeTests.cs
│ │ ├── RestBootstrapTests
│ │ │ └── PrimaryKeyTestsForCompositeViews.cs
│ │ ├── SqlTestBase.cs
│ │ └── SqlTestHelper.cs
│ ├── TestCategory.cs
│ ├── TestHelper.cs
│ ├── UnitTests
│ │ ├── ConfigFileWatcherUnitTests.cs
│ │ ├── ConfigValidationUnitTests.cs
│ │ ├── DbExceptionParserUnitTests.cs
│ │ ├── EntitySourceNamesParserUnitTests.cs
│ │ ├── EnvironmentTests.cs
│ │ ├── MultiSourceQueryExecutionUnitTests.cs
│ │ ├── MultipleCreateUnitTests
│ │ │ ├── MsSqlMultipleCreateOrderHelperUnitTests.cs
│ │ │ ├── MultipleCreateOrderHelperUnitTests.cs
│ │ │ ├── MySqlMultipleCreateOrderHelperUnitTests.cs
│ │ │ └── PgSqlMultipleCreateOrderHelperUnitTests.cs
│ │ ├── MySqlQueryExecutorUnitTests.cs
│ │ ├── ODataASTVisitorUnitTests.cs
│ │ ├── PostgreSqlQueryExecutorUnitTests.cs
│ │ ├── RequestContextUnitTests.cs
│ │ ├── RequestValidatorUnitTests.cs
│ │ ├── RestServiceUnitTests.cs
│ │ ├── RuntimeConfigLoaderJsonDeserializerTests.cs
│ │ ├── SerializationDeserializationTests.cs
│ │ ├── SqlMetadataProviderUnitTests.cs
│ │ └── SqlQueryExecutorUnitTests.cs
│ ├── dab-config.CosmosDb_NoSql.json
│ ├── dab-config.DwSql.json
│ ├── dab-config.MsSql.json
│ ├── dab-config.MySql.json
│ ├── dab-config.PostgreSql.json
│ └── schema.gql
└── Service
│ ├── Azure.DataApiBuilder.Service.csproj
│ ├── Controllers
│ ├── ConfigurationController.cs
│ ├── HealthController.cs
│ └── RestController.cs
│ ├── HealthCheck
│ ├── BasicHealthCheck.cs
│ ├── BasicHealthReportResponseWriter.cs
│ ├── ComprehensiveHealthReportResponseWriter.cs
│ ├── HealthCheckHelper.cs
│ ├── HttpUtilities.cs
│ ├── Model
│ │ ├── ComprehensiveHealthCheckReport.cs
│ │ ├── ConfigurationDetails.cs
│ │ └── HealthCheckResultEntry.cs
│ └── Utilities.cs
│ ├── JwtBearerOptionsChangeTokenSource.cs
│ ├── Program.cs
│ ├── Properties
│ └── launchSettings.json
│ ├── Startup.cs
│ ├── Telemetry
│ ├── AppInsightsTelemetryInitializer.cs
│ └── LogLevelInitializer.cs
│ └── appsettings.json
└── templates
└── CredScanSuppressions.json
/.config/dotnet-tools.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | "isRoot": true,
4 | "tools": {
5 | "dotnet-format": {
6 | "version": "5.1.225507",
7 | "commands": [
8 | "dotnet-format"
9 | ]
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/.devcontainer/devcontainer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": ".NET 8",
3 | "image": "mcr.microsoft.com/dotnet/sdk:8.0",
4 | "features": {
5 | // https://github.com/devcontainers/features/tree/main/src/dotnet
6 | "ghcr.io/devcontainers/features/dotnet:2": {
7 | "version": "latest",
8 | "dotnetRuntimeVersions": "8.0",
9 | "aspNetCoreRuntimeVersions": "8.0",
10 | "additionalVersions": "8.0"
11 | }
12 | },
13 | "customizations": {
14 | "vscode": {
15 | "extensions": [ "ms-dotnettools.csdevkit" ]
16 | }
17 | },
18 | "remoteEnv": {
19 | // https://docs.github.com/en/codespaces/developing-in-a-codespace/persisting-environment-variables-and-temporary-files#for-all-codespaces-for-a-repository
20 | // Set .NET tools directory to PATH since not automatically done by SDK image.
21 | "PATH": "${containerEnv:PATH}:/root/.dotnet/tools"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Thanks to: https://rehansaeed.com/gitattributes-best-practices/
2 |
3 | # Set default behavior to automatically normalize line endings.
4 | * text=auto
5 |
6 | # Force batch scripts to always use CRLF line endings so that if a repo is accessed
7 | # in Windows via a file share from Linux, the scripts will work.
8 | *.{cmd,[cC][mM][dD]} text eol=crlf
9 | *.{bat,[bB][aA][tT]} text eol=crlf
10 |
11 | # Force bash scripts to always use LF line endings so that if a repo is accessed
12 | # in Unix via a file share from Windows, the scripts will work.
13 | *.sh text eol=lf
14 |
15 | *.verified.txt text eol=lf working-tree-encoding=UTF-8
16 | *.verified.xml text eol=lf working-tree-encoding=UTF-8
17 | *.verified.json text eol=lf working-tree-encoding=UTF-8
18 |
--------------------------------------------------------------------------------
/.github/pull_request_template.md:
--------------------------------------------------------------------------------
1 | ## Why make this change?
2 |
3 | - Reference associated issue using `#` syntax. e.g. Closes #XX
4 | - Include summary (1-2 sentences) of linked issue to avoid redirecting reviewers to different pages.
5 | - Include links to any additional discussion threads related to this change.
6 |
7 | ## What is this change?
8 |
9 | - Summary of how your changes work to give reviewers context of your intent.
10 | - Links to relevant documentation / StackOverflow, if applicable.
11 |
12 | ## How was this tested?
13 |
14 | - [ ] Integration Tests
15 | - [ ] Unit Tests
16 |
17 | ## Sample Request(s)
18 |
19 | - Example REST and/or GraphQL request to demonstrate modifications
20 | - Example of CLI usage to demonstrate modifications
21 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Generated Files
2 | **/bin
3 | **/obj
4 | **/coverage
5 | **/coveragereport
6 | **/TestResults
7 | system-commandline-sentinel-files/
8 | out/
9 | publish/
10 | log.txt
11 |
12 | # only include appsettings for a few default environments
13 | appsettings.*.json
14 | dab-config*.json
15 | *.dab-config.json
16 | !dab-config.*reference.json
17 | !dab-config.*.example.json
18 |
19 | *.cd
20 |
21 | # IDE/editor related directories
22 | .vs/
23 | .idea/
24 | **/.vscode/**/*
25 | **/*.user
26 | .localhistory/
27 | *.code-workspace
28 |
29 | .fake
30 | .ionide
31 | *.orig
32 |
33 | # Nuget package
34 | **/nupkg
35 |
36 | # Local-Only files
37 | .env
38 |
39 | # Verify test files
40 | *.received.*
--------------------------------------------------------------------------------
/.pipelines/azure-pipelines.yml:
--------------------------------------------------------------------------------
1 | # Copyright (c) Microsoft Corporation.
2 | # Licensed under the MIT License.
3 |
4 | trigger:
5 | batch: true
6 | branches:
7 | include:
8 | - main
9 | - gh-readonly-queue/main
10 | - release/*
11 |
12 | variables:
13 | # DebugArguments: ' --filter "TestCategory!=ABC" --verbosity normal '
14 | # ReleaseArguments: ' --filter "TestCategory!=ABC" --verbosity normal '
15 | VmImage: windows-2022 # https://learn.microsoft.com/azure/devops/pipelines/agents/hosted?view=azure-devops
16 |
17 | jobs:
18 | - template: templates/static-tools.yml
19 | parameters:
20 | BuildConfiguration: Release
21 | VmImage: $(VmImage)
22 |
--------------------------------------------------------------------------------
/.pipelines/templates/CredScanSuppressions.json:
--------------------------------------------------------------------------------
1 | {
2 | "tool": "Credential Scanner",
3 | "suppressions": [
4 | {
5 | "placeholder" : "REPLACEME",
6 | "_justification": "Placeholder secret used for tests and samples."
7 | }
8 | ]
9 | }
10 |
--------------------------------------------------------------------------------
/.pipelines/templates/variables.yml:
--------------------------------------------------------------------------------
1 | # Copyright (c) Microsoft Corporation.
2 | # Licensed under the MIT License.
3 |
4 | variables:
5 | solution: '**/*.sln'
6 | buildPlatform: 'Any CPU'
7 | buildConfiguration: 'Release'
8 | # Maintain a separate patch value between CI and PR runs.
9 | # The counter is reset when the minor version is updated.
10 | patch: $[counter(format('{0}_{1}', variables['build.reason'], variables['minor']), 0)]
11 | isReleaseBuild: $(isNugetRelease)
12 | $id: 'https://github.com/Azure/data-api-builder/releases/download/v$(major).$(minor).$(patch)/dab.draft.schema.json'
13 | SNAPSHOOTER_STRICT_MODE: true
14 |
--------------------------------------------------------------------------------
/.pipelines/unittest-pipelines.yml:
--------------------------------------------------------------------------------
1 | # Copyright (c) Microsoft Corporation.
2 | # Licensed under the MIT License.
3 |
4 | pool:
5 | vmImage: 'ubuntu-latest' # examples of other options: 'macOS-10.15', 'windows-2019'
6 |
7 | variables:
8 | - template: templates/variables.yml
9 |
10 | steps:
11 | - template: templates/build-pipelines.yml
12 |
--------------------------------------------------------------------------------
/CODEOWNERS:
--------------------------------------------------------------------------------
1 | # These owners will be the default owners for everything in
2 | # the repo. Unless a later match takes precedence,
3 | # review when someone opens a pull request.
4 | * @Aniruddh25 @aaronburtle @anushakolan @RubenCerna2079 @sezal98 @souvikghosh04 @ravishetye @neeraj-sharma2592 @sourabh1007 @vadeveka @Alekhya-Polavarapu @rusamant
5 |
6 | code_of_conduct.md @jerrynixon
7 | contributing.md @jerrynixon
8 | license.txt @jerrynixon
9 | readme.md @jerrynixon
10 | security.md @jerrynixon
11 | support.md @jerrynixon
12 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Microsoft Open Source Code of Conduct
2 |
3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
4 |
5 | Resources:
6 |
7 | - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
8 | - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
9 | - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns
10 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | # Version values referenced from https://hub.docker.com/_/microsoft-dotnet-aspnet
2 |
3 | FROM mcr.microsoft.com/dotnet/sdk:8.0-cbl-mariner2.0. AS build
4 |
5 |
6 | WORKDIR /src
7 | COPY [".", "./"]
8 | RUN dotnet build "./src/Service/Azure.DataApiBuilder.Service.csproj" -c Docker -o /out -r linux-x64
9 |
10 | FROM mcr.microsoft.com/dotnet/aspnet:8.0-cbl-mariner2.0 AS runtime
11 |
12 | COPY --from=build /out /App
13 | WORKDIR /App
14 | ENV ASPNETCORE_URLS=http://+:5000
15 | ENTRYPOINT ["dotnet", "Azure.DataApiBuilder.Service.dll"]
16 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) Microsoft Corporation.
2 |
3 | MIT License
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Nuget.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/docker/docker-compose-cosmos.yml:
--------------------------------------------------------------------------------
1 | # Copyright (c) Microsoft Corporation.
2 | # Licensed under the MIT License.
3 |
4 | version: "3.9"
5 | services:
6 | hawaii:
7 | image: "mcr.microsoft.com/azure-databases/data-api-builder:latest"
8 | ports:
9 | - "5000:5000"
10 | volumes:
11 | - ":/App/dab-config.json"
12 | - ":/App/schema.gql"
13 |
--------------------------------------------------------------------------------
/docker/docker-compose-mssql.yml:
--------------------------------------------------------------------------------
1 | # Copyright (c) Microsoft Corporation.
2 | # Licensed under the MIT License.
3 |
4 | version: "3.9"
5 | services:
6 | hawaii:
7 | image: "mcr.microsoft.com/azure-databases/data-api-builder:latest"
8 | ports:
9 | - "5000:5000"
10 | volumes:
11 | - ":/App/dab-config.json"
12 |
--------------------------------------------------------------------------------
/docker/docker-compose-mysql.yml:
--------------------------------------------------------------------------------
1 | # Copyright (c) Microsoft Corporation.
2 | # Licensed under the MIT License.
3 |
4 | version: "3.9"
5 | services:
6 | hawaii:
7 | image: "mcr.microsoft.com/azure-databases/data-api-builder:latest"
8 | ports:
9 | - "5000:5000"
10 | volumes:
11 | - ":/App/dab-config.json"
12 |
--------------------------------------------------------------------------------
/docker/docker-compose-postgresql.yml:
--------------------------------------------------------------------------------
1 | # Copyright (c) Microsoft Corporation.
2 | # Licensed under the MIT License.
3 |
4 | version: "3.9"
5 | services:
6 | hawaii:
7 | image: "mcr.microsoft.com/azure-databases/data-api-builder:latest"
8 | ports:
9 | - "5000:5000"
10 | volumes:
11 | - ":/App/dab-config.json"
12 |
--------------------------------------------------------------------------------
/docs/design/HotReloadDiagram.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/data-api-builder/a3029b9b22ee2d5dfe7e1f70f881d5ad290a1d65/docs/design/HotReloadDiagram.jpg
--------------------------------------------------------------------------------
/docs/design/dataSourceHealthCheckTestScenarioFlowchart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/data-api-builder/a3029b9b22ee2d5dfe7e1f70f881d5ad290a1d65/docs/design/dataSourceHealthCheckTestScenarioFlowchart.png
--------------------------------------------------------------------------------
/docs/design/entityHealthCheckTestScenarioFlowchart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/data-api-builder/a3029b9b22ee2d5dfe7e1f70f881d5ad290a1d65/docs/design/entityHealthCheckTestScenarioFlowchart.png
--------------------------------------------------------------------------------
/docs/media/dab-architecture-overview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/data-api-builder/a3029b9b22ee2d5dfe7e1f70f881d5ad290a1d65/docs/media/dab-architecture-overview.png
--------------------------------------------------------------------------------
/docs/media/dab-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/data-api-builder/a3029b9b22ee2d5dfe7e1f70f881d5ad290a1d65/docs/media/dab-logo.png
--------------------------------------------------------------------------------
/docs/media/invalid-config.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/data-api-builder/a3029b9b22ee2d5dfe7e1f70f881d5ad290a1d65/docs/media/invalid-config.png
--------------------------------------------------------------------------------
/docs/media/validate-output.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/data-api-builder/a3029b9b22ee2d5dfe7e1f70f881d5ad290a1d65/docs/media/validate-output.png
--------------------------------------------------------------------------------
/docs/readme.md:
--------------------------------------------------------------------------------
1 | # Documentation
2 |
3 | All documentation has now been moved [here](https://learn.microsoft.com/azure/data-api-builder/)
4 |
5 | The process for updating Data API builder documentation on Learn is available [here](https://learn.microsoft.com/contribute/)
6 |
--------------------------------------------------------------------------------
/global.json:
--------------------------------------------------------------------------------
1 | {
2 | "sdk": {
3 | "version": "8.0.100",
4 | "rollForward": "latestFeature"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/nuget/nuget_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/data-api-builder/a3029b9b22ee2d5dfe7e1f70f881d5ad290a1d65/nuget/nuget_icon.png
--------------------------------------------------------------------------------
/samples/azure/readme.md:
--------------------------------------------------------------------------------
1 | # Azure Deploy Sample
2 |
3 | Use the provided `azure-deploy.sh` script to deploy Data API builder in an Azure Container Instance as described in [Running Data API Builder in Azure](https://learn.microsoft.com/azure/data-api-builder/running-in-azure)
4 |
5 | Use the provided `azure-container-apps-deploy.sh` script to deploy Data API builder in an Azure Container Apps as described in [Running Data API Builder in Azure](https://learn.microsoft.com/azure/data-api-builder/running-in-azure)
6 |
7 | Make sure to have a valid `dab-config.json` file in the same directory as the script.
--------------------------------------------------------------------------------
/samples/basic-empty-dab-config.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://github.com/Azure/data-api-builder/releases/download/v0.5.35/dab.draft.schema.json",
3 | "data-source": {
4 | "database-type": "",
5 | "connection-string": ""
6 | },
7 | "runtime": {
8 | "host": {
9 | "mode": "development"
10 | }
11 | },
12 | "entities": {
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/samples/getting-started/azure-postgresql/exercise-library.postgresql.sql:
--------------------------------------------------------------------------------
1 | -- Copyright (c) Microsoft Corporation.
2 | -- Licensed under the MIT License.
3 |
4 | DROP TABLE IF EXISTS series
5 | ;
6 |
7 | CREATE TABLE series
8 | (
9 | id INT PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
10 | name VARCHAR(1000) NOT NULL
11 | )
12 | ;
13 |
14 |
15 | ALTER TABLE books
16 | ADD series_id INT NULL
17 | ;
18 |
19 |
20 | ALTER TABLE books
21 | ADD FOREIGN KEY (series_id) REFERENCES series(id)
22 | ;
23 |
24 | INSERT INTO series
25 | OVERRIDING SYSTEM VALUE
26 | VALUES
27 | (10000, 'Foundation'),
28 | (10001, 'Hyperion Cantos')
29 |
30 | ;
31 |
32 | UPDATE books
33 | SET series_id = 10000
34 | WHERE id IN (1000, 1001, 1002, 1003, 1004, 1005, 1006)
35 | ;
36 |
37 | UPDATE books
38 | SET series_id = 10001
39 | WHERE id IN (1013, 1014, 1015, 1016)
40 | ;
41 |
42 |
--------------------------------------------------------------------------------
/samples/getting-started/azure-sql-db/.gitignore:
--------------------------------------------------------------------------------
1 | library-dab-config.json
2 |
--------------------------------------------------------------------------------
/samples/getting-started/azure-sql-db/exercise/exercise-library.azure-sql.sql:
--------------------------------------------------------------------------------
1 | drop table if exists dbo.series;
2 |
3 | create table dbo.series
4 | (
5 | id int not null primary key default (next value for dbo.globalId),
6 | [name] nvarchar(1000) not null
7 | )
8 | go
9 |
10 | alter table dbo.books
11 | add series_id int null;
12 | go
13 |
14 | alter table dbo.books
15 | add foreign key (series_id) references dbo.series(id)
16 | go
17 |
18 | insert into dbo.series values
19 | (10000, 'Foundation'),
20 | (10001, 'Hyperion Cantos')
21 | go
22 |
23 | update dbo.books
24 | set series_id = 10000
25 | where id in (1000, 1001, 1002, 1003, 1004, 1005, 1006)
26 | go
27 |
28 | update dbo.books
29 | set series_id = 10001
30 | where id in (1013, 1014, 1015, 1016)
31 | go
32 |
33 |
--------------------------------------------------------------------------------
/src/Auth/Azure.DataApiBuilder.Auth.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0
5 | enable
6 | enable
7 | $(BaseOutputPath)\engine
8 | true
9 | NU1603
10 |
11 |
12 |
13 | true
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src/Cli.Tests/FileSystemUtils.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using System.Reflection;
5 |
6 | namespace Cli.Tests;
7 |
8 | internal static class FileSystemUtils
9 | {
10 | public static MockFileSystem ProvisionMockFileSystem()
11 | {
12 | MockFileSystem fileSystem = new();
13 |
14 | // We need to have this file in the file system so that the schema can be resolved when we are
15 | // generating a new config file using the CLI. Since we're not using a "real" file system, we
16 | // need to add it here. See: https://github.com/Azure/data-api-builder/pull/1564#discussion_r1253806984
17 | fileSystem.AddFile(
18 | fileSystem.Path.Combine(
19 | fileSystem.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? "",
20 | "dab.draft.schema.json"),
21 | new MockFileData("{ \"$id\": \"https://github.com/Azure/data-api-builder/releases/download/vmajor.minor.patch/dab.draft.schema.json\" }"));
22 |
23 | return fileSystem;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/AddEntityTests.AddEntityWithCachingEnabled.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | CachingEntity: {
28 | Source: {
29 | Object: MyTable,
30 | Type: Table
31 | },
32 | GraphQL: {
33 | Singular: CachingEntity,
34 | Plural: CachingEntities,
35 | Enabled: true
36 | },
37 | Rest: {
38 | Enabled: true
39 | },
40 | Permissions: [
41 | {
42 | Role: anonymous,
43 | Actions: [
44 | {
45 | Action: *
46 | }
47 | ]
48 | }
49 | ],
50 | Cache: {
51 | Enabled: true,
52 | TtlSeconds: 1,
53 | Level: L1L2,
54 | UserProvidedLevelOptions: false
55 | }
56 | }
57 | }
58 | ]
59 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/AddEntityTests.AddEntityWithPolicyAndFieldProperties_70de36ebf1478d0d.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: MyTable,
30 | Type: Table
31 | },
32 | GraphQL: {
33 | Singular: MyEntity,
34 | Plural: MyEntities,
35 | Enabled: true
36 | },
37 | Rest: {
38 | Enabled: true
39 | },
40 | Permissions: [
41 | {
42 | Role: anonymous,
43 | Actions: [
44 | {
45 | Action: Delete,
46 | Fields: {
47 | Exclude: [
48 | level,
49 | rating
50 | ],
51 | Include: [
52 | *
53 | ]
54 | }
55 | }
56 | ]
57 | }
58 | ]
59 | }
60 | }
61 | ]
62 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/AddEntityTests.AddEntityWithPolicyAndFieldProperties_9f612e68879149a3.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: MyTable,
30 | Type: Table
31 | },
32 | GraphQL: {
33 | Singular: MyEntity,
34 | Plural: MyEntities,
35 | Enabled: true
36 | },
37 | Rest: {
38 | Enabled: true
39 | },
40 | Permissions: [
41 | {
42 | Role: anonymous,
43 | Actions: [
44 | {
45 | Action: Delete,
46 | Policy: {
47 | Request: @claims.name eq 'dab2',
48 | Database: @claims.id eq @item.id
49 | }
50 | }
51 | ]
52 | }
53 | ]
54 | }
55 | }
56 | ]
57 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/AddEntityTests.AddNewEntityWhenEntitiesEmpty.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | FirstEntity: {
28 | Source: {
29 | Object: MyTable,
30 | Type: Table
31 | },
32 | GraphQL: {
33 | Singular: FirstEntity,
34 | Plural: FirstEntities,
35 | Enabled: true
36 | },
37 | Rest: {
38 | Enabled: true
39 | },
40 | Permissions: [
41 | {
42 | Role: anonymous,
43 | Actions: [
44 | {
45 | Action: Read
46 | },
47 | {
48 | Action: Update
49 | }
50 | ]
51 | }
52 | ]
53 | }
54 | }
55 | ]
56 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/AddEntityTests.AddNewEntityWhenEntitiesWithSourceAsStoredProcedure.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: stored-procedure,
31 | Parameters: {
32 | param1: 123,
33 | param2: hello,
34 | param3: true
35 | }
36 | },
37 | GraphQL: {
38 | Singular: MyEntity,
39 | Plural: MyEntities,
40 | Enabled: true,
41 | Operation: Mutation
42 | },
43 | Rest: {
44 | Methods: [
45 | Post
46 | ],
47 | Enabled: true
48 | },
49 | Permissions: [
50 | {
51 | Role: anonymous,
52 | Actions: [
53 | {
54 | Action: Execute
55 | }
56 | ]
57 | }
58 | ]
59 | }
60 | }
61 | ]
62 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_0c9cbb8942b4a4e5.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: stored-procedure
31 | },
32 | GraphQL: {
33 | Singular: MyEntity,
34 | Plural: MyEntities,
35 | Enabled: true,
36 | Operation: Mutation
37 | },
38 | Rest: {
39 | Methods: [
40 | Post
41 | ],
42 | Enabled: true
43 | },
44 | Permissions: [
45 | {
46 | Role: anonymous,
47 | Actions: [
48 | {
49 | Action: Execute
50 | }
51 | ]
52 | }
53 | ]
54 | }
55 | }
56 | ]
57 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_286d268a654ece27.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: stored-procedure
31 | },
32 | GraphQL: {
33 | Singular: book,
34 | Plural: books,
35 | Enabled: true,
36 | Operation: Query
37 | },
38 | Rest: {
39 | Methods: [
40 | Post
41 | ],
42 | Enabled: true
43 | },
44 | Permissions: [
45 | {
46 | Role: anonymous,
47 | Actions: [
48 | {
49 | Action: Execute
50 | }
51 | ]
52 | }
53 | ]
54 | }
55 | }
56 | ]
57 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_3048323e01b42681.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: stored-procedure
31 | },
32 | GraphQL: {
33 | Singular: MyEntity,
34 | Plural: MyEntities,
35 | Enabled: true,
36 | Operation: Mutation
37 | },
38 | Rest: {
39 | Methods: [
40 | Get,
41 | Post,
42 | Patch
43 | ],
44 | Path: /book,
45 | Enabled: true
46 | },
47 | Permissions: [
48 | {
49 | Role: anonymous,
50 | Actions: [
51 | {
52 | Action: Execute
53 | }
54 | ]
55 | }
56 | ]
57 | }
58 | }
59 | ]
60 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_3440d150a2282b9c.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: stored-procedure
31 | },
32 | GraphQL: {
33 | Singular: MyEntity,
34 | Plural: MyEntities,
35 | Enabled: true,
36 | Operation: Mutation
37 | },
38 | Rest: {
39 | Methods: [
40 | Post
41 | ],
42 | Path: /book,
43 | Enabled: true
44 | },
45 | Permissions: [
46 | {
47 | Role: anonymous,
48 | Actions: [
49 | {
50 | Action: Execute
51 | }
52 | ]
53 | }
54 | ]
55 | }
56 | }
57 | ]
58 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_381c28d25063be0c.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: stored-procedure
31 | },
32 | GraphQL: {
33 | Singular: book,
34 | Plural: books,
35 | Enabled: true,
36 | Operation: Query
37 | },
38 | Rest: {
39 | Methods: [
40 | Post
41 | ],
42 | Enabled: true
43 | },
44 | Permissions: [
45 | {
46 | Role: anonymous,
47 | Actions: [
48 | {
49 | Action: Execute
50 | }
51 | ]
52 | }
53 | ]
54 | }
55 | }
56 | ]
57 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_458373311f6ed4ed.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: stored-procedure
31 | },
32 | GraphQL: {
33 | Singular: book,
34 | Plural: books,
35 | Enabled: true,
36 | Operation: Mutation
37 | },
38 | Rest: {
39 | Methods: [
40 | Post
41 | ],
42 | Enabled: true
43 | },
44 | Permissions: [
45 | {
46 | Role: anonymous,
47 | Actions: [
48 | {
49 | Action: Execute
50 | }
51 | ]
52 | }
53 | ]
54 | }
55 | }
56 | ]
57 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_66799c963a6306ae.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: stored-procedure
31 | },
32 | GraphQL: {
33 | Singular: MyEntity,
34 | Plural: MyEntities,
35 | Enabled: true,
36 | Operation: Query
37 | },
38 | Rest: {
39 | Methods: [
40 | Post
41 | ],
42 | Enabled: true
43 | },
44 | Permissions: [
45 | {
46 | Role: anonymous,
47 | Actions: [
48 | {
49 | Action: Execute
50 | }
51 | ]
52 | }
53 | ]
54 | }
55 | }
56 | ]
57 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_66f598295b8682fd.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: stored-procedure
31 | },
32 | GraphQL: {
33 | Singular: MyEntity,
34 | Plural: MyEntities,
35 | Enabled: true,
36 | Operation: Mutation
37 | },
38 | Rest: {
39 | Methods: [
40 | Get,
41 | Post,
42 | Patch
43 | ],
44 | Enabled: true
45 | },
46 | Permissions: [
47 | {
48 | Role: anonymous,
49 | Actions: [
50 | {
51 | Action: Execute
52 | }
53 | ]
54 | }
55 | ]
56 | }
57 | }
58 | ]
59 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_73f95f7e2cd3ed71.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: stored-procedure
31 | },
32 | GraphQL: {
33 | Singular: MyEntity,
34 | Plural: MyEntities,
35 | Enabled: true,
36 | Operation: Mutation
37 | },
38 | Rest: {
39 | Methods: [
40 | Post
41 | ],
42 | Enabled: true
43 | },
44 | Permissions: [
45 | {
46 | Role: anonymous,
47 | Actions: [
48 | {
49 | Action: Execute
50 | }
51 | ]
52 | }
53 | ]
54 | }
55 | }
56 | ]
57 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_79d59edde7f6a272.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: stored-procedure
31 | },
32 | GraphQL: {
33 | Singular: book,
34 | Plural: books,
35 | Enabled: true,
36 | Operation: Mutation
37 | },
38 | Rest: {
39 | Methods: [
40 | Post
41 | ],
42 | Enabled: true
43 | },
44 | Permissions: [
45 | {
46 | Role: anonymous,
47 | Actions: [
48 | {
49 | Action: Execute
50 | }
51 | ]
52 | }
53 | ]
54 | }
55 | }
56 | ]
57 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_7ec82512a1df5293.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: stored-procedure
31 | },
32 | GraphQL: {
33 | Singular: MyEntity,
34 | Plural: MyEntities,
35 | Enabled: true,
36 | Operation: Mutation
37 | },
38 | Rest: {
39 | Methods: [
40 | Post
41 | ],
42 | Enabled: true
43 | },
44 | Permissions: [
45 | {
46 | Role: anonymous,
47 | Actions: [
48 | {
49 | Action: Execute
50 | }
51 | ]
52 | }
53 | ]
54 | }
55 | }
56 | ]
57 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_cbb6e5548e4d3535.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: stored-procedure
31 | },
32 | GraphQL: {
33 | Singular: MyEntity,
34 | Plural: MyEntities,
35 | Enabled: true,
36 | Operation: Mutation
37 | },
38 | Rest: {
39 | Methods: [
40 | Post
41 | ],
42 | Enabled: true
43 | },
44 | Permissions: [
45 | {
46 | Role: anonymous,
47 | Actions: [
48 | {
49 | Action: Execute
50 | }
51 | ]
52 | }
53 | ]
54 | }
55 | }
56 | ]
57 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_dc629052f38cea32.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: stored-procedure
31 | },
32 | GraphQL: {
33 | Singular: book,
34 | Plural: books,
35 | Enabled: true,
36 | Operation: Query
37 | },
38 | Rest: {
39 | Methods: [
40 | Post,
41 | Patch,
42 | Put
43 | ],
44 | Path: /book,
45 | Enabled: true
46 | },
47 | Permissions: [
48 | {
49 | Role: anonymous,
50 | Actions: [
51 | {
52 | Action: Execute
53 | }
54 | ]
55 | }
56 | ]
57 | }
58 | }
59 | ]
60 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_e4a97c7e3507d2c6.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: stored-procedure
31 | },
32 | GraphQL: {
33 | Singular: MyEntity,
34 | Plural: MyEntities,
35 | Enabled: true,
36 | Operation: Query
37 | },
38 | Rest: {
39 | Methods: [
40 | Get
41 | ],
42 | Enabled: true
43 | },
44 | Permissions: [
45 | {
46 | Role: anonymous,
47 | Actions: [
48 | {
49 | Action: Execute
50 | }
51 | ]
52 | }
53 | ]
54 | }
55 | }
56 | ]
57 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_f8d0d0c2a38bd3b8.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: stored-procedure
31 | },
32 | GraphQL: {
33 | Singular: MyEntity,
34 | Plural: MyEntities,
35 | Enabled: true,
36 | Operation: Mutation
37 | },
38 | Rest: {
39 | Methods: [
40 | Get,
41 | Post,
42 | Patch
43 | ],
44 | Enabled: true
45 | },
46 | Permissions: [
47 | {
48 | Role: anonymous,
49 | Actions: [
50 | {
51 | Action: Execute
52 | }
53 | ]
54 | }
55 | ]
56 | }
57 | }
58 | ]
59 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/AddEntityTests.TestAddStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: stored-procedure,
31 | Parameters: {
32 | param1: 123,
33 | param2: hello,
34 | param3: true
35 | }
36 | },
37 | GraphQL: {
38 | Singular: MyEntity,
39 | Plural: MyEntities,
40 | Enabled: true,
41 | Operation: Query
42 | },
43 | Rest: {
44 | Methods: [
45 | Post,
46 | Put,
47 | Patch
48 | ],
49 | Enabled: true
50 | },
51 | Permissions: [
52 | {
53 | Role: anonymous,
54 | Actions: [
55 | {
56 | Action: Execute
57 | }
58 | ]
59 | }
60 | ]
61 | }
62 | }
63 | ]
64 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithSourceWithDefaultType.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL,
4 | Options: {
5 | set-session-context: true
6 | }
7 | },
8 | Runtime: {
9 | Rest: {
10 | Enabled: true,
11 | Path: /api,
12 | RequestBodyStrict: true
13 | },
14 | GraphQL: {
15 | Enabled: true,
16 | Path: /graphql,
17 | AllowIntrospection: true
18 | },
19 | Host: {
20 | Cors: {
21 | AllowCredentials: false
22 | },
23 | Authentication: {
24 | Provider: StaticWebApps
25 | }
26 | }
27 | },
28 | Entities: [
29 | {
30 | MyEntity: {
31 | Source: {
32 | Object: s001.book,
33 | Type: Table,
34 | KeyFields: [
35 | id,
36 | name
37 | ]
38 | },
39 | GraphQL: {
40 | Singular: MyEntity,
41 | Plural: MyEntities,
42 | Enabled: true
43 | },
44 | Rest: {
45 | Enabled: true
46 | },
47 | Permissions: [
48 | {
49 | Role: anonymous,
50 | Actions: [
51 | {
52 | Action: *
53 | }
54 | ]
55 | }
56 | ]
57 | }
58 | }
59 | ]
60 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithoutIEnumerables.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL,
4 | Options: {
5 | set-session-context: true
6 | }
7 | },
8 | Runtime: {
9 | Rest: {
10 | Enabled: true,
11 | Path: /api,
12 | RequestBodyStrict: true
13 | },
14 | GraphQL: {
15 | Enabled: true,
16 | Path: /graphql,
17 | AllowIntrospection: true
18 | },
19 | Host: {
20 | Cors: {
21 | AllowCredentials: false
22 | },
23 | Authentication: {
24 | Provider: StaticWebApps
25 | },
26 | Mode: Production
27 | }
28 | },
29 | Entities: [
30 | {
31 | book: {
32 | Source: {
33 | Object: s001.book,
34 | Type: Table
35 | },
36 | GraphQL: {
37 | Singular: book,
38 | Plural: books,
39 | Enabled: true
40 | },
41 | Rest: {
42 | Enabled: true
43 | },
44 | Permissions: [
45 | {
46 | Role: anonymous,
47 | Actions: [
48 | {
49 | Action: *
50 | }
51 | ]
52 | }
53 | ]
54 | }
55 | }
56 | ]
57 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterUpdatingEntityWithSourceAsStoredProcedure.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | Source: {
3 | Object: dbo.books,
4 | Type: stored-procedure,
5 | Parameters: {
6 | param1: 123,
7 | param2: hello,
8 | param3: true
9 | }
10 | },
11 | GraphQL: {
12 | Singular: MyEntity,
13 | Plural: MyEntities,
14 | Enabled: true,
15 | Operation: Mutation
16 | },
17 | Rest: {
18 | Methods: [
19 | Post
20 | ],
21 | Enabled: true
22 | },
23 | Permissions: [
24 | {
25 | Role: anonymous,
26 | Actions: [
27 | {
28 | Action: Execute
29 | }
30 | ]
31 | }
32 | ]
33 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/EndToEndTests.TestInitForCosmosDBNoSql.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | Options: {
4 | container: planet,
5 | database: graphqldb,
6 | schema: test-schema.gql
7 | }
8 | },
9 | Runtime: {
10 | Rest: {
11 | Enabled: false,
12 | Path: /api,
13 | RequestBodyStrict: true
14 | },
15 | GraphQL: {
16 | Enabled: true,
17 | Path: /graphql,
18 | AllowIntrospection: true
19 | },
20 | Host: {
21 | Cors: {
22 | Origins: [
23 | localhost:3000,
24 | www.nolocalhost.com:80
25 | ],
26 | AllowCredentials: false
27 | },
28 | Authentication: {
29 | Provider: StaticWebApps
30 | },
31 | Mode: Production
32 | }
33 | },
34 | Entities: []
35 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/EndToEndTests.TestUpdatingStoredProcedureWithRestMethods.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL,
4 | Options: {
5 | set-session-context: true
6 | }
7 | },
8 | Runtime: {
9 | Rest: {
10 | Enabled: true,
11 | Path: /api,
12 | RequestBodyStrict: true
13 | },
14 | GraphQL: {
15 | Enabled: true,
16 | Path: /graphql,
17 | AllowIntrospection: true
18 | },
19 | Host: {
20 | Cors: {
21 | AllowCredentials: false
22 | },
23 | Authentication: {
24 | Provider: StaticWebApps
25 | }
26 | }
27 | },
28 | Entities: [
29 | {
30 | MyEntity: {
31 | Source: {
32 | Object: s001.book,
33 | Type: stored-procedure,
34 | Parameters: {
35 | param1: 123,
36 | param2: hello,
37 | param3: true
38 | }
39 | },
40 | GraphQL: {
41 | Singular: MyEntity,
42 | Plural: MyEntities,
43 | Enabled: true,
44 | Operation: Query
45 | },
46 | Rest: {
47 | Methods: [
48 | Get
49 | ],
50 | Enabled: true
51 | },
52 | Permissions: [
53 | {
54 | Role: anonymous,
55 | Actions: [
56 | {
57 | Action: Execute
58 | }
59 | ]
60 | }
61 | ]
62 | }
63 | }
64 | ]
65 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/EnvironmentTests.TestEnvironmentFileIsConsumedCorrectly.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | EnvValue: DEVELOPMENT
3 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/EnvironmentTests.TestEnvironmentVariableIsConsumedCorrectly.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | EnvValue: TEST
3 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/EnvironmentTests.TestPrecedenceOfEnvironmentFileOverExistingVariables.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | EnvValue: DEVELOPMENT,
3 | HostingEnvValue: PHOENIX_TEST
4 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/InitTests.CosmosDbNoSqlDatabase.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | Options: {
4 | container: testcontainer,
5 | database: testdb,
6 | schema: test-schema.gql
7 | }
8 | },
9 | Runtime: {
10 | Rest: {
11 | Enabled: false,
12 | Path: /api,
13 | RequestBodyStrict: true
14 | },
15 | GraphQL: {
16 | Enabled: true,
17 | Path: /graphql,
18 | AllowIntrospection: true
19 | },
20 | Host: {
21 | Cors: {
22 | AllowCredentials: false
23 | },
24 | Authentication: {
25 | Provider: StaticWebApps
26 | },
27 | Mode: Production
28 | }
29 | },
30 | Entities: []
31 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/InitTests.CosmosDbPostgreSqlDatabase.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: CosmosDB_PostgreSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /rest-endpoint,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | Origins: [
19 | http://localhost:3000,
20 | http://nolocalhost:80
21 | ],
22 | AllowCredentials: false
23 | },
24 | Authentication: {
25 | Provider: StaticWebApps
26 | }
27 | }
28 | },
29 | Entities: []
30 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_171ea8114ff71814.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL,
4 | Options: {
5 | set-session-context: false
6 | }
7 | },
8 | Runtime: {
9 | Rest: {
10 | Enabled: true,
11 | Path: /api,
12 | RequestBodyStrict: true
13 | },
14 | GraphQL: {
15 | Enabled: true,
16 | Path: /graphql,
17 | AllowIntrospection: true
18 | },
19 | Host: {
20 | Cors: {
21 | AllowCredentials: false
22 | },
23 | Authentication: {
24 | Provider: AzureAD,
25 | Jwt: {
26 | Audience: aud-xxx,
27 | Issuer: issuer-xxx
28 | }
29 | },
30 | Mode: Production
31 | }
32 | },
33 | Entities: []
34 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_2df7a1794712f154.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL,
4 | Options: {
5 | set-session-context: false
6 | }
7 | },
8 | Runtime: {
9 | Rest: {
10 | Enabled: true,
11 | Path: /api,
12 | RequestBodyStrict: true
13 | },
14 | GraphQL: {
15 | Enabled: true,
16 | Path: /graphql,
17 | AllowIntrospection: true
18 | },
19 | Host: {
20 | Cors: {
21 | AllowCredentials: false
22 | },
23 | Authentication: {
24 | Provider: Simulator
25 | },
26 | Mode: Production
27 | }
28 | },
29 | Entities: []
30 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_59fe1a10aa78899d.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL,
4 | Options: {
5 | set-session-context: false
6 | }
7 | },
8 | Runtime: {
9 | Rest: {
10 | Enabled: true,
11 | Path: /api,
12 | RequestBodyStrict: true
13 | },
14 | GraphQL: {
15 | Enabled: true,
16 | Path: /graphql,
17 | AllowIntrospection: true
18 | },
19 | Host: {
20 | Cors: {
21 | AllowCredentials: false
22 | },
23 | Authentication: {
24 | Provider: StaticWebApps
25 | },
26 | Mode: Production
27 | }
28 | },
29 | Entities: []
30 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_b95b637ea87f16a7.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL,
4 | Options: {
5 | set-session-context: false
6 | }
7 | },
8 | Runtime: {
9 | Rest: {
10 | Enabled: true,
11 | Path: /api,
12 | RequestBodyStrict: true
13 | },
14 | GraphQL: {
15 | Enabled: true,
16 | Path: /graphql,
17 | AllowIntrospection: true
18 | },
19 | Host: {
20 | Cors: {
21 | AllowCredentials: false
22 | },
23 | Authentication: {
24 | Provider: AppService
25 | },
26 | Mode: Production
27 | }
28 | },
29 | Entities: []
30 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_daacbd948b7ef72f.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL,
4 | Options: {
5 | set-session-context: false
6 | }
7 | },
8 | Runtime: {
9 | Rest: {
10 | Enabled: true,
11 | Path: /api,
12 | RequestBodyStrict: true
13 | },
14 | GraphQL: {
15 | Enabled: true,
16 | Path: /graphql,
17 | AllowIntrospection: true
18 | },
19 | Host: {
20 | Cors: {
21 | AllowCredentials: false
22 | },
23 | Authentication: {
24 | Provider: EntraID,
25 | Jwt: {
26 | Audience: aud-xxx,
27 | Issuer: issuer-xxx
28 | }
29 | },
30 | Mode: Production
31 | }
32 | },
33 | Entities: []
34 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/InitTests.GraphQLPathWithoutStartingSlashWillHaveItAdded.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL,
4 | Options: {
5 | set-session-context: false
6 | }
7 | },
8 | Runtime: {
9 | Rest: {
10 | Enabled: true,
11 | Path: /api,
12 | RequestBodyStrict: true
13 | },
14 | GraphQL: {
15 | Enabled: true,
16 | Path: /abc,
17 | AllowIntrospection: true
18 | },
19 | Host: {
20 | Cors: {
21 | AllowCredentials: false
22 | },
23 | Authentication: {
24 | Provider: StaticWebApps
25 | },
26 | Mode: Production
27 | }
28 | },
29 | Entities: []
30 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/InitTests.MsSQLDatabase.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL,
4 | Options: {
5 | set-session-context: true
6 | }
7 | },
8 | Runtime: {
9 | Rest: {
10 | Enabled: true,
11 | Path: /rest-api,
12 | RequestBodyStrict: true
13 | },
14 | GraphQL: {
15 | Enabled: true,
16 | Path: /graphql,
17 | AllowIntrospection: true
18 | },
19 | Host: {
20 | Cors: {
21 | Origins: [
22 | http://localhost:3000,
23 | http://nolocalhost:80
24 | ],
25 | AllowCredentials: false
26 | },
27 | Authentication: {
28 | Provider: StaticWebApps
29 | }
30 | }
31 | },
32 | Entities: []
33 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/InitTests.RestPathWithoutStartingSlashWillHaveItAdded.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL,
4 | Options: {
5 | set-session-context: false
6 | }
7 | },
8 | Runtime: {
9 | Rest: {
10 | Enabled: true,
11 | Path: /abc,
12 | RequestBodyStrict: true
13 | },
14 | GraphQL: {
15 | Enabled: true,
16 | Path: /graphql,
17 | AllowIntrospection: true
18 | },
19 | Host: {
20 | Cors: {
21 | AllowCredentials: false
22 | },
23 | Authentication: {
24 | Provider: StaticWebApps
25 | },
26 | Mode: Production
27 | }
28 | },
29 | Entities: []
30 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/InitTests.TestInitializingConfigWithoutConnectionString.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL,
4 | Options: {
5 | set-session-context: false
6 | }
7 | },
8 | Runtime: {
9 | Rest: {
10 | Enabled: true,
11 | Path: /api,
12 | RequestBodyStrict: true
13 | },
14 | GraphQL: {
15 | Enabled: true,
16 | Path: /graphql,
17 | AllowIntrospection: true
18 | },
19 | Host: {
20 | Cors: {
21 | Origins: [
22 | http://localhost:3000,
23 | http://nolocalhost:80
24 | ],
25 | AllowCredentials: false
26 | },
27 | Authentication: {
28 | Provider: StaticWebApps
29 | }
30 | }
31 | },
32 | Entities: []
33 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/InitTests.TestSpecialCharactersInConnectionString.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL,
4 | Options: {
5 | set-session-context: false
6 | }
7 | },
8 | Runtime: {
9 | Rest: {
10 | Enabled: true,
11 | Path: /api,
12 | RequestBodyStrict: true
13 | },
14 | GraphQL: {
15 | Enabled: true,
16 | Path: /graphql,
17 | AllowIntrospection: true
18 | },
19 | Host: {
20 | Cors: {
21 | AllowCredentials: false
22 | },
23 | Authentication: {
24 | Provider: StaticWebApps
25 | },
26 | Mode: Production
27 | }
28 | },
29 | Entities: []
30 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithMultipleMutationOptions_0546bef37027a950.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: DWSQL,
4 | Options: {
5 | set-session-context: true
6 | }
7 | },
8 | Runtime: {
9 | Rest: {
10 | Enabled: true,
11 | Path: /rest-api,
12 | RequestBodyStrict: true
13 | },
14 | GraphQL: {
15 | Enabled: true,
16 | Path: /graphql,
17 | AllowIntrospection: true
18 | },
19 | Host: {
20 | Cors: {
21 | Origins: [
22 | http://localhost:3000,
23 | http://nolocalhost:80
24 | ],
25 | AllowCredentials: false
26 | },
27 | Authentication: {
28 | Provider: StaticWebApps
29 | }
30 | }
31 | },
32 | Entities: []
33 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithMultipleMutationOptions_0ac567dd32a2e8f5.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL,
4 | Options: {
5 | set-session-context: true
6 | }
7 | },
8 | Runtime: {
9 | Rest: {
10 | Enabled: true,
11 | Path: /rest-api,
12 | RequestBodyStrict: true
13 | },
14 | GraphQL: {
15 | Enabled: true,
16 | Path: /graphql,
17 | AllowIntrospection: true
18 | },
19 | Host: {
20 | Cors: {
21 | Origins: [
22 | http://localhost:3000,
23 | http://nolocalhost:80
24 | ],
25 | AllowCredentials: false
26 | },
27 | Authentication: {
28 | Provider: StaticWebApps
29 | }
30 | }
31 | },
32 | Entities: []
33 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithMultipleMutationOptions_0c06949221514e77.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL,
4 | Options: {
5 | set-session-context: true
6 | }
7 | },
8 | Runtime: {
9 | Rest: {
10 | Enabled: true,
11 | Path: /rest-api,
12 | RequestBodyStrict: true
13 | },
14 | GraphQL: {
15 | Enabled: true,
16 | Path: /graphql,
17 | AllowIntrospection: true,
18 | MultipleMutationOptions: {
19 | MultipleCreateOptions: {
20 | Enabled: false
21 | }
22 | }
23 | },
24 | Host: {
25 | Cors: {
26 | Origins: [
27 | http://localhost:3000,
28 | http://nolocalhost:80
29 | ],
30 | AllowCredentials: false
31 | },
32 | Authentication: {
33 | Provider: StaticWebApps
34 | }
35 | }
36 | },
37 | Entities: []
38 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithMultipleMutationOptions_18667ab7db033e9d.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: PostgreSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /rest-api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | Origins: [
19 | http://localhost:3000,
20 | http://nolocalhost:80
21 | ],
22 | AllowCredentials: false
23 | },
24 | Authentication: {
25 | Provider: StaticWebApps
26 | }
27 | }
28 | },
29 | Entities: []
30 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithMultipleMutationOptions_2f42f44c328eb020.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: DWSQL,
4 | Options: {
5 | set-session-context: true
6 | }
7 | },
8 | Runtime: {
9 | Rest: {
10 | Enabled: true,
11 | Path: /rest-api,
12 | RequestBodyStrict: true
13 | },
14 | GraphQL: {
15 | Enabled: true,
16 | Path: /graphql,
17 | AllowIntrospection: true
18 | },
19 | Host: {
20 | Cors: {
21 | Origins: [
22 | http://localhost:3000,
23 | http://nolocalhost:80
24 | ],
25 | AllowCredentials: false
26 | },
27 | Authentication: {
28 | Provider: StaticWebApps
29 | }
30 | }
31 | },
32 | Entities: []
33 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithMultipleMutationOptions_3243d3f3441fdcc1.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: PostgreSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /rest-api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | Origins: [
19 | http://localhost:3000,
20 | http://nolocalhost:80
21 | ],
22 | AllowCredentials: false
23 | },
24 | Authentication: {
25 | Provider: StaticWebApps
26 | }
27 | }
28 | },
29 | Entities: []
30 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithMultipleMutationOptions_53350b8b47df2112.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MySQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /rest-api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | Origins: [
19 | http://localhost:3000,
20 | http://nolocalhost:80
21 | ],
22 | AllowCredentials: false
23 | },
24 | Authentication: {
25 | Provider: StaticWebApps
26 | }
27 | }
28 | },
29 | Entities: []
30 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithMultipleMutationOptions_6584e0ec46b8a11d.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | Options: {
4 | container: testcontainer,
5 | database: testdb,
6 | schema: test-schema.gql
7 | }
8 | },
9 | Runtime: {
10 | Rest: {
11 | Enabled: false,
12 | Path: /api,
13 | RequestBodyStrict: true
14 | },
15 | GraphQL: {
16 | Enabled: true,
17 | Path: /graphql,
18 | AllowIntrospection: true
19 | },
20 | Host: {
21 | Cors: {
22 | Origins: [
23 | http://localhost:3000,
24 | http://nolocalhost:80
25 | ],
26 | AllowCredentials: false
27 | },
28 | Authentication: {
29 | Provider: StaticWebApps
30 | }
31 | }
32 | },
33 | Entities: []
34 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithMultipleMutationOptions_81cc88db3d4eecfb.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL,
4 | Options: {
5 | set-session-context: true
6 | }
7 | },
8 | Runtime: {
9 | Rest: {
10 | Enabled: true,
11 | Path: /rest-api,
12 | RequestBodyStrict: true
13 | },
14 | GraphQL: {
15 | Enabled: true,
16 | Path: /graphql,
17 | AllowIntrospection: true,
18 | MultipleMutationOptions: {
19 | MultipleCreateOptions: {
20 | Enabled: true
21 | }
22 | }
23 | },
24 | Host: {
25 | Cors: {
26 | Origins: [
27 | http://localhost:3000,
28 | http://nolocalhost:80
29 | ],
30 | AllowCredentials: false
31 | },
32 | Authentication: {
33 | Provider: StaticWebApps
34 | }
35 | }
36 | },
37 | Entities: []
38 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithMultipleMutationOptions_8ea187616dbb5577.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: CosmosDB_PostgreSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /rest-api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | Origins: [
19 | http://localhost:3000,
20 | http://nolocalhost:80
21 | ],
22 | AllowCredentials: false
23 | },
24 | Authentication: {
25 | Provider: StaticWebApps
26 | }
27 | }
28 | },
29 | Entities: []
30 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithMultipleMutationOptions_905845c29560a3ef.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: DWSQL,
4 | Options: {
5 | set-session-context: true
6 | }
7 | },
8 | Runtime: {
9 | Rest: {
10 | Enabled: true,
11 | Path: /rest-api,
12 | RequestBodyStrict: true
13 | },
14 | GraphQL: {
15 | Enabled: true,
16 | Path: /graphql,
17 | AllowIntrospection: true
18 | },
19 | Host: {
20 | Cors: {
21 | Origins: [
22 | http://localhost:3000,
23 | http://nolocalhost:80
24 | ],
25 | AllowCredentials: false
26 | },
27 | Authentication: {
28 | Provider: StaticWebApps
29 | }
30 | }
31 | },
32 | Entities: []
33 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithMultipleMutationOptions_b2fd24fab5b80917.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | Options: {
4 | container: testcontainer,
5 | database: testdb,
6 | schema: test-schema.gql
7 | }
8 | },
9 | Runtime: {
10 | Rest: {
11 | Enabled: false,
12 | Path: /api,
13 | RequestBodyStrict: true
14 | },
15 | GraphQL: {
16 | Enabled: true,
17 | Path: /graphql,
18 | AllowIntrospection: true
19 | },
20 | Host: {
21 | Cors: {
22 | Origins: [
23 | http://localhost:3000,
24 | http://nolocalhost:80
25 | ],
26 | AllowCredentials: false
27 | },
28 | Authentication: {
29 | Provider: StaticWebApps
30 | }
31 | }
32 | },
33 | Entities: []
34 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithMultipleMutationOptions_bd7cd088755287c9.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | Options: {
4 | container: testcontainer,
5 | database: testdb,
6 | schema: test-schema.gql
7 | }
8 | },
9 | Runtime: {
10 | Rest: {
11 | Enabled: false,
12 | Path: /api,
13 | RequestBodyStrict: true
14 | },
15 | GraphQL: {
16 | Enabled: true,
17 | Path: /graphql,
18 | AllowIntrospection: true
19 | },
20 | Host: {
21 | Cors: {
22 | Origins: [
23 | http://localhost:3000,
24 | http://nolocalhost:80
25 | ],
26 | AllowCredentials: false
27 | },
28 | Authentication: {
29 | Provider: StaticWebApps
30 | }
31 | }
32 | },
33 | Entities: []
34 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithMultipleMutationOptions_d2eccba2f836b380.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MySQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /rest-api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | Origins: [
19 | http://localhost:3000,
20 | http://nolocalhost:80
21 | ],
22 | AllowCredentials: false
23 | },
24 | Authentication: {
25 | Provider: StaticWebApps
26 | }
27 | }
28 | },
29 | Entities: []
30 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithMultipleMutationOptions_d463eed7fe5e4bbe.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: CosmosDB_PostgreSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /rest-api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | Origins: [
19 | http://localhost:3000,
20 | http://nolocalhost:80
21 | ],
22 | AllowCredentials: false
23 | },
24 | Authentication: {
25 | Provider: StaticWebApps
26 | }
27 | }
28 | },
29 | Entities: []
30 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithMultipleMutationOptions_d5520dd5c33f7b8d.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MySQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /rest-api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | Origins: [
19 | http://localhost:3000,
20 | http://nolocalhost:80
21 | ],
22 | AllowCredentials: false
23 | },
24 | Authentication: {
25 | Provider: StaticWebApps
26 | }
27 | }
28 | },
29 | Entities: []
30 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithMultipleMutationOptions_eab4a6010e602b59.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: PostgreSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /rest-api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | Origins: [
19 | http://localhost:3000,
20 | http://nolocalhost:80
21 | ],
22 | AllowCredentials: false
23 | },
24 | Authentication: {
25 | Provider: StaticWebApps
26 | }
27 | }
28 | },
29 | Entities: []
30 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithMultipleMutationOptions_ecaa688829b4030e.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: CosmosDB_PostgreSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /rest-api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | Origins: [
19 | http://localhost:3000,
20 | http://nolocalhost:80
21 | ],
22 | AllowCredentials: false
23 | },
24 | Authentication: {
25 | Provider: StaticWebApps
26 | }
27 | }
28 | },
29 | Entities: []
30 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_036a859f50ce167c.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: View,
31 | KeyFields: [
32 | col1,
33 | col2
34 | ]
35 | },
36 | GraphQL: {
37 | Singular: MyEntity,
38 | Plural: MyEntities,
39 | Enabled: true
40 | },
41 | Rest: {
42 | Enabled: true
43 | },
44 | Permissions: [
45 | {
46 | Role: anonymous,
47 | Actions: [
48 | {
49 | Action: *
50 | }
51 | ]
52 | }
53 | ]
54 | }
55 | }
56 | ]
57 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_103655d39b48d89f.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: Table,
31 | KeyFields: [
32 | id,
33 | name
34 | ]
35 | },
36 | GraphQL: {
37 | Singular: MyEntity,
38 | Plural: MyEntities,
39 | Enabled: true
40 | },
41 | Rest: {
42 | Enabled: true
43 | },
44 | Permissions: [
45 | {
46 | Role: anonymous,
47 | Actions: [
48 | {
49 | Action: *
50 | }
51 | ]
52 | }
53 | ]
54 | }
55 | }
56 | ]
57 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_442649c7ef2176bd.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: View,
31 | KeyFields: [
32 | col1,
33 | col2
34 | ]
35 | },
36 | GraphQL: {
37 | Singular: MyEntity,
38 | Plural: MyEntities,
39 | Enabled: true
40 | },
41 | Rest: {
42 | Enabled: true
43 | },
44 | Permissions: [
45 | {
46 | Role: anonymous,
47 | Actions: [
48 | {
49 | Action: *
50 | }
51 | ]
52 | }
53 | ]
54 | }
55 | }
56 | ]
57 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_7f2338fdc84aafc3.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: Table
31 | },
32 | GraphQL: {
33 | Singular: MyEntity,
34 | Plural: MyEntities,
35 | Enabled: true
36 | },
37 | Rest: {
38 | Enabled: true
39 | },
40 | Permissions: [
41 | {
42 | Role: anonymous,
43 | Actions: [
44 | {
45 | Action: Execute
46 | }
47 | ]
48 | }
49 | ]
50 | }
51 | }
52 | ]
53 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_a70c086a74142c82.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: stored-procedure,
31 | Parameters: {
32 | param1: 123,
33 | param2: hello,
34 | param3: true
35 | }
36 | },
37 | GraphQL: {
38 | Singular: MyEntity,
39 | Plural: MyEntities,
40 | Enabled: true,
41 | Operation: Mutation
42 | },
43 | Rest: {
44 | Methods: [
45 | Post
46 | ],
47 | Enabled: true
48 | },
49 | Permissions: [
50 | {
51 | Role: anonymous,
52 | Actions: [
53 | {
54 | Action: Execute
55 | }
56 | ]
57 | }
58 | ]
59 | }
60 | }
61 | ]
62 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_c26902b0e44f97cd.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: stored-procedure
31 | },
32 | GraphQL: {
33 | Singular: MyEntity,
34 | Plural: MyEntities,
35 | Enabled: true,
36 | Operation: Mutation
37 | },
38 | Rest: {
39 | Methods: [
40 | Post
41 | ],
42 | Enabled: true
43 | },
44 | Permissions: [
45 | {
46 | Role: anonymous,
47 | Actions: [
48 | {
49 | Action: *
50 | }
51 | ]
52 | }
53 | ]
54 | }
55 | }
56 | ]
57 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityCaching.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps,
22 | Jwt: {
23 | Audience: ,
24 | Issuer:
25 | }
26 | }
27 | }
28 | },
29 | Entities: [
30 | {
31 | MyEntity: {
32 | Source: {
33 | Object: MyTable,
34 | Type: Table
35 | },
36 | GraphQL: {
37 | Singular: MyEntity,
38 | Plural: MyEntities,
39 | Enabled: true
40 | },
41 | Rest: {
42 | Enabled: true
43 | },
44 | Cache: {
45 | Enabled: true,
46 | TtlSeconds: 1,
47 | Level: L1L2,
48 | UserProvidedLevelOptions: false
49 | }
50 | }
51 | }
52 | ]
53 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithMappings.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps,
22 | Jwt: {
23 | Audience: ,
24 | Issuer:
25 | }
26 | }
27 | }
28 | },
29 | Entities: [
30 | {
31 | MyEntity: {
32 | Source: {
33 | Object: MyTable,
34 | Type: Table
35 | },
36 | GraphQL: {
37 | Singular: MyEntity,
38 | Plural: MyEntities,
39 | Enabled: true
40 | },
41 | Rest: {
42 | Enabled: true
43 | },
44 | Permissions: [
45 | {
46 | Role: anonymous,
47 | Actions: [
48 | {
49 | Action: Read
50 | },
51 | {
52 | Action: Update
53 | }
54 | ]
55 | }
56 | ],
57 | Mappings: {
58 | id: Identity,
59 | name: Company Name
60 | }
61 | }
62 | }
63 | ]
64 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithPolicyAndFieldProperties_088d6237033e0a7c.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: MyTable,
30 | Type: Table
31 | },
32 | GraphQL: {
33 | Singular: MyEntity,
34 | Plural: MyEntities,
35 | Enabled: true
36 | },
37 | Rest: {
38 | Enabled: true
39 | },
40 | Permissions: [
41 | {
42 | Role: anonymous,
43 | Actions: [
44 | {
45 | Action: Delete,
46 | Fields: {
47 | Exclude: [
48 | level,
49 | rating
50 | ],
51 | Include: [
52 | *
53 | ]
54 | }
55 | }
56 | ]
57 | }
58 | ]
59 | }
60 | }
61 | ]
62 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithPolicyAndFieldProperties_4d25c2c012107597.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: MyTable,
30 | Type: Table
31 | },
32 | GraphQL: {
33 | Singular: MyEntity,
34 | Plural: MyEntities,
35 | Enabled: true
36 | },
37 | Rest: {
38 | Enabled: true
39 | },
40 | Permissions: [
41 | {
42 | Role: anonymous,
43 | Actions: [
44 | {
45 | Action: Delete,
46 | Policy: {
47 | Request: @claims.name eq 'dab',
48 | Database: @claims.id eq @item.id
49 | }
50 | }
51 | ]
52 | }
53 | ]
54 | }
55 | }
56 | ]
57 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateExistingMappings.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps,
22 | Jwt: {
23 | Audience: ,
24 | Issuer:
25 | }
26 | }
27 | }
28 | },
29 | Entities: [
30 | {
31 | MyEntity: {
32 | Source: {
33 | Object: MyTable,
34 | Type: Table
35 | },
36 | GraphQL: {
37 | Singular: MyEntity,
38 | Plural: MyEntities,
39 | Enabled: true
40 | },
41 | Rest: {
42 | Enabled: true
43 | },
44 | Permissions: [
45 | {
46 | Role: anonymous,
47 | Actions: [
48 | {
49 | Action: Read
50 | },
51 | {
52 | Action: Update
53 | }
54 | ]
55 | }
56 | ],
57 | Mappings: {
58 | addr: Company Address,
59 | name: Company Name,
60 | number: Contact Details
61 | }
62 | }
63 | }
64 | ]
65 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_10ea92e3b25ab0c9.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: stored-procedure
31 | },
32 | GraphQL: {
33 | Singular: book,
34 | Plural: books,
35 | Enabled: true,
36 | Operation: Mutation
37 | },
38 | Rest: {
39 | Methods: [
40 | Post
41 | ],
42 | Enabled: true
43 | },
44 | Permissions: [
45 | {
46 | Role: anonymous,
47 | Actions: [
48 | {
49 | Action: Execute
50 | }
51 | ]
52 | }
53 | ]
54 | }
55 | }
56 | ]
57 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_127bb81593f835fe.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: stored-procedure
31 | },
32 | GraphQL: {
33 | Singular: MyEntity,
34 | Plural: MyEntities,
35 | Enabled: true,
36 | Operation: Mutation
37 | },
38 | Rest: {
39 | Methods: [
40 | Get,
41 | Post,
42 | Patch
43 | ],
44 | Enabled: true
45 | },
46 | Permissions: [
47 | {
48 | Role: anonymous,
49 | Actions: [
50 | {
51 | Action: Execute
52 | }
53 | ]
54 | }
55 | ]
56 | }
57 | }
58 | ]
59 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_386efa1a113fac6b.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: stored-procedure
31 | },
32 | GraphQL: {
33 | Singular: MyEntity,
34 | Plural: MyEntities,
35 | Enabled: true,
36 | Operation: Mutation
37 | },
38 | Rest: {
39 | Methods: [
40 | Post
41 | ],
42 | Enabled: true
43 | },
44 | Permissions: [
45 | {
46 | Role: anonymous,
47 | Actions: [
48 | {
49 | Action: Execute
50 | }
51 | ]
52 | }
53 | ]
54 | }
55 | }
56 | ]
57 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_53db4712d83be8e6.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: stored-procedure
31 | },
32 | GraphQL: {
33 | Singular: MyEntity,
34 | Plural: MyEntities,
35 | Enabled: true,
36 | Operation: Mutation
37 | },
38 | Rest: {
39 | Methods: [
40 | Post
41 | ],
42 | Path: /book,
43 | Enabled: true
44 | },
45 | Permissions: [
46 | {
47 | Role: anonymous,
48 | Actions: [
49 | {
50 | Action: Execute
51 | }
52 | ]
53 | }
54 | ]
55 | }
56 | }
57 | ]
58 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_5e9ddd8c7c740efd.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: stored-procedure
31 | },
32 | GraphQL: {
33 | Singular: book,
34 | Plural: books,
35 | Enabled: true,
36 | Operation: Query
37 | },
38 | Rest: {
39 | Methods: [
40 | Post
41 | ],
42 | Enabled: true
43 | },
44 | Permissions: [
45 | {
46 | Role: anonymous,
47 | Actions: [
48 | {
49 | Action: Execute
50 | }
51 | ]
52 | }
53 | ]
54 | }
55 | }
56 | ]
57 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_6c5b3bfc72e5878a.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: stored-procedure
31 | },
32 | GraphQL: {
33 | Singular: MyEntity,
34 | Plural: MyEntities,
35 | Enabled: true,
36 | Operation: Mutation
37 | },
38 | Rest: {
39 | Methods: [
40 | Post
41 | ],
42 | Enabled: true
43 | },
44 | Permissions: [
45 | {
46 | Role: anonymous,
47 | Actions: [
48 | {
49 | Action: Execute
50 | }
51 | ]
52 | }
53 | ]
54 | }
55 | }
56 | ]
57 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_8398059a743d7027.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: stored-procedure
31 | },
32 | GraphQL: {
33 | Singular: MyEntity,
34 | Plural: MyEntities,
35 | Enabled: true,
36 | Operation: Mutation
37 | },
38 | Rest: {
39 | Methods: [
40 | Post
41 | ],
42 | Enabled: true
43 | },
44 | Permissions: [
45 | {
46 | Role: anonymous,
47 | Actions: [
48 | {
49 | Action: Execute
50 | }
51 | ]
52 | }
53 | ]
54 | }
55 | }
56 | ]
57 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_a49380ce6d1fd8ba.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: stored-procedure
31 | },
32 | GraphQL: {
33 | Singular: MyEntity,
34 | Plural: MyEntities,
35 | Enabled: true,
36 | Operation: Mutation
37 | },
38 | Rest: {
39 | Methods: [
40 | Get,
41 | Post,
42 | Patch
43 | ],
44 | Path: /book,
45 | Enabled: true
46 | },
47 | Permissions: [
48 | {
49 | Role: anonymous,
50 | Actions: [
51 | {
52 | Action: Execute
53 | }
54 | ]
55 | }
56 | ]
57 | }
58 | }
59 | ]
60 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_c9b12fe27be53878.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: stored-procedure
31 | },
32 | GraphQL: {
33 | Singular: MyEntity,
34 | Plural: MyEntities,
35 | Enabled: false,
36 | Operation: Mutation
37 | },
38 | Rest: {
39 | Methods: [
40 | Post
41 | ],
42 | Enabled: false
43 | },
44 | Permissions: [
45 | {
46 | Role: anonymous,
47 | Actions: [
48 | {
49 | Action: Execute
50 | }
51 | ]
52 | }
53 | ]
54 | }
55 | }
56 | ]
57 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_d19603117eb8b51b.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: stored-procedure
31 | },
32 | GraphQL: {
33 | Singular: book,
34 | Plural: books,
35 | Enabled: true,
36 | Operation: Query
37 | },
38 | Rest: {
39 | Methods: [
40 | Post
41 | ],
42 | Enabled: true
43 | },
44 | Permissions: [
45 | {
46 | Role: anonymous,
47 | Actions: [
48 | {
49 | Action: Execute
50 | }
51 | ]
52 | }
53 | ]
54 | }
55 | }
56 | ]
57 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_d770d682c5802737.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: stored-procedure
31 | },
32 | GraphQL: {
33 | Singular: book,
34 | Plural: books,
35 | Enabled: true,
36 | Operation: Mutation
37 | },
38 | Rest: {
39 | Methods: [
40 | Post
41 | ],
42 | Enabled: true
43 | },
44 | Permissions: [
45 | {
46 | Role: anonymous,
47 | Actions: [
48 | {
49 | Action: Execute
50 | }
51 | ]
52 | }
53 | ]
54 | }
55 | }
56 | ]
57 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_ef8cc721c9dfc7e4.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: stored-procedure
31 | },
32 | GraphQL: {
33 | Singular: MyEntity,
34 | Plural: MyEntities,
35 | Enabled: true,
36 | Operation: Query
37 | },
38 | Rest: {
39 | Methods: [
40 | Get
41 | ],
42 | Enabled: true
43 | },
44 | Permissions: [
45 | {
46 | Role: anonymous,
47 | Actions: [
48 | {
49 | Action: Execute
50 | }
51 | ]
52 | }
53 | ]
54 | }
55 | }
56 | ]
57 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_f3897e2254996db0.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: stored-procedure
31 | },
32 | GraphQL: {
33 | Singular: MyEntity,
34 | Plural: MyEntities,
35 | Enabled: true,
36 | Operation: Query
37 | },
38 | Rest: {
39 | Methods: [
40 | Post
41 | ],
42 | Enabled: true
43 | },
44 | Permissions: [
45 | {
46 | Role: anonymous,
47 | Actions: [
48 | {
49 | Action: Execute
50 | }
51 | ]
52 | }
53 | ]
54 | }
55 | }
56 | ]
57 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_f4cadb897fc5b0fe.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: stored-procedure
31 | },
32 | GraphQL: {
33 | Singular: book,
34 | Plural: books,
35 | Enabled: true,
36 | Operation: Query
37 | },
38 | Rest: {
39 | Methods: [
40 | Post,
41 | Patch,
42 | Put
43 | ],
44 | Path: /book,
45 | Enabled: true
46 | },
47 | Permissions: [
48 | {
49 | Role: anonymous,
50 | Actions: [
51 | {
52 | Action: Execute
53 | }
54 | ]
55 | }
56 | ]
57 | }
58 | }
59 | ]
60 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_f59b2a65fc1e18a3.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: stored-procedure
31 | },
32 | GraphQL: {
33 | Singular: MyEntity,
34 | Plural: MyEntities,
35 | Enabled: true,
36 | Operation: Mutation
37 | },
38 | Rest: {
39 | Methods: [
40 | Get,
41 | Post,
42 | Patch
43 | ],
44 | Enabled: true
45 | },
46 | Permissions: [
47 | {
48 | Role: anonymous,
49 | Actions: [
50 | {
51 | Action: Execute
52 | }
53 | ]
54 | }
55 | ]
56 | }
57 | }
58 | ]
59 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_574e1995f787740f.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: View,
31 | KeyFields: [
32 | col1,
33 | col2
34 | ]
35 | },
36 | GraphQL: {
37 | Singular: MyEntity,
38 | Plural: MyEntities,
39 | Enabled: true
40 | },
41 | Rest: {
42 | Enabled: true
43 | },
44 | Permissions: [
45 | {
46 | Role: anonymous,
47 | Actions: [
48 | {
49 | Action: *
50 | }
51 | ]
52 | }
53 | ]
54 | }
55 | }
56 | ]
57 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_a13a9ca73b21f261.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: Table,
31 | KeyFields: [
32 | id,
33 | name
34 | ]
35 | },
36 | GraphQL: {
37 | Singular: MyEntity,
38 | Plural: MyEntities,
39 | Enabled: true
40 | },
41 | Rest: {
42 | Enabled: true
43 | },
44 | Permissions: [
45 | {
46 | Role: anonymous,
47 | Actions: [
48 | {
49 | Action: *
50 | }
51 | ]
52 | }
53 | ]
54 | }
55 | }
56 | ]
57 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_a5ce76c8bea25cc8.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: Table,
31 | KeyFields: [
32 | id,
33 | name
34 | ]
35 | },
36 | GraphQL: {
37 | Singular: MyEntity,
38 | Plural: MyEntities,
39 | Enabled: true
40 | },
41 | Rest: {
42 | Enabled: true
43 | },
44 | Permissions: [
45 | {
46 | Role: anonymous,
47 | Actions: [
48 | {
49 | Action: *
50 | }
51 | ]
52 | }
53 | ]
54 | }
55 | }
56 | ]
57 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_bba111332a1f973f.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: Table
31 | },
32 | GraphQL: {
33 | Singular: MyEntity,
34 | Plural: MyEntities,
35 | Enabled: true
36 | },
37 | Rest: {
38 | Enabled: true
39 | },
40 | Permissions: [
41 | {
42 | Role: anonymous,
43 | Actions: [
44 | {
45 | Action: *
46 | }
47 | ]
48 | }
49 | ]
50 | }
51 | }
52 | ]
53 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/UpdateEntityTests.UpdateDatabaseSourceKeyFields.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: Table,
31 | KeyFields: [
32 | col1,
33 | col2
34 | ]
35 | },
36 | GraphQL: {
37 | Singular: MyEntity,
38 | Plural: MyEntities,
39 | Enabled: true
40 | },
41 | Rest: {
42 | Enabled: true
43 | },
44 | Permissions: [
45 | {
46 | Role: anonymous,
47 | Actions: [
48 | {
49 | Action: Read
50 | },
51 | {
52 | Action: Create
53 | },
54 | {
55 | Action: Update
56 | },
57 | {
58 | Action: Delete
59 | }
60 | ]
61 | }
62 | ]
63 | }
64 | }
65 | ]
66 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/UpdateEntityTests.UpdateDatabaseSourceName.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: newSourceName,
30 | Type: stored-procedure,
31 | Parameters: {
32 | param1: 123,
33 | param2: hello,
34 | param3: true
35 | }
36 | },
37 | GraphQL: {
38 | Singular: MyEntity,
39 | Plural: MyEntities,
40 | Enabled: true,
41 | Operation: Mutation
42 | },
43 | Rest: {
44 | Methods: [
45 | Post
46 | ],
47 | Enabled: true
48 | },
49 | Permissions: [
50 | {
51 | Role: anonymous,
52 | Actions: [
53 | {
54 | Action: Execute
55 | }
56 | ]
57 | }
58 | ]
59 | }
60 | }
61 | ]
62 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/Snapshots/UpdateEntityTests.UpdateDatabaseSourceParameters.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | DataSource: {
3 | DatabaseType: MSSQL
4 | },
5 | Runtime: {
6 | Rest: {
7 | Enabled: true,
8 | Path: /api,
9 | RequestBodyStrict: true
10 | },
11 | GraphQL: {
12 | Enabled: true,
13 | Path: /graphql,
14 | AllowIntrospection: true
15 | },
16 | Host: {
17 | Cors: {
18 | AllowCredentials: false
19 | },
20 | Authentication: {
21 | Provider: StaticWebApps
22 | }
23 | }
24 | },
25 | Entities: [
26 | {
27 | MyEntity: {
28 | Source: {
29 | Object: s001.book,
30 | Type: stored-procedure,
31 | Parameters: {
32 | param1: dab,
33 | param2: false
34 | }
35 | },
36 | GraphQL: {
37 | Singular: MyEntity,
38 | Plural: MyEntities,
39 | Enabled: true,
40 | Operation: Mutation
41 | },
42 | Rest: {
43 | Methods: [
44 | Post
45 | ],
46 | Enabled: true
47 | },
48 | Permissions: [
49 | {
50 | Role: anonymous,
51 | Actions: [
52 | {
53 | Action: Execute
54 | }
55 | ]
56 | }
57 | ]
58 | }
59 | }
60 | ]
61 | }
--------------------------------------------------------------------------------
/src/Cli.Tests/StringLogger.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Cli.Tests;
5 |
6 | ///
7 | /// Creates a logger that can be used in test methods to verify logging behavior
8 | /// by capturing the messages and making them available for verification.
9 | ///
10 | class StringLogger : ILogger
11 | {
12 | public List Messages { get; } = new();
13 |
14 | public IDisposable? BeginScope(TState state) where TState : notnull
15 | {
16 | return new Mock().Object;
17 | }
18 |
19 | public bool IsEnabled(LogLevel logLevel)
20 | {
21 | return true;
22 | }
23 |
24 | public void Log(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func formatter)
25 | {
26 | string message = formatter(state, exception);
27 | Messages.Add(message);
28 | }
29 |
30 | public string GetLog()
31 | {
32 | return string.Join(Environment.NewLine, Messages);
33 | }
34 | }
35 |
36 |
--------------------------------------------------------------------------------
/src/Cli.Tests/TestLoggerSupport.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Cli.Tests;
5 |
6 | internal static class TestLoggerSupport
7 | {
8 | public static ILoggerFactory ProvisionLoggerFactory() =>
9 | LoggerFactory.Create(builder =>
10 | {
11 | builder.AddConsole();
12 | });
13 | }
14 |
--------------------------------------------------------------------------------
/src/Cli.Tests/Usings.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | global using System.Diagnostics;
5 | global using System.IO.Abstractions;
6 | global using System.IO.Abstractions.TestingHelpers;
7 | global using System.Text.Json;
8 | global using Azure.DataApiBuilder.Config;
9 | global using Azure.DataApiBuilder.Config.ObjectModel;
10 | global using Azure.DataApiBuilder.Service.Exceptions;
11 | global using Cli.Commands;
12 | global using Microsoft.Extensions.Logging;
13 | global using Microsoft.VisualStudio.TestTools.UnitTesting;
14 | global using Moq;
15 | global using Newtonsoft.Json.Linq;
16 | global using static Azure.DataApiBuilder.Config.FileSystemRuntimeConfigLoader;
17 | global using static Cli.ConfigGenerator;
18 | global using static Cli.Tests.TestHelper;
19 | global using static Cli.Utils;
20 |
--------------------------------------------------------------------------------
/src/Cli/Constants/CliReturnCode.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using System.Runtime.CompilerServices;
5 |
6 | [assembly: InternalsVisibleTo("Cli.Tests")]
7 | namespace Cli.Constants
8 | {
9 | internal class CliReturnCode
10 | {
11 | public const int SUCCESS = 0;
12 | public const int GENERAL_ERROR = -1;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/Cli/Options.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using CommandLine;
5 |
6 | namespace Cli
7 | {
8 | ///
9 | /// Common options for all the commands
10 | ///
11 | public class Options
12 | {
13 | public Options(string? config)
14 | {
15 | Config = config;
16 | }
17 |
18 | [Option('c', "config", Required = false, HelpText = "Path to config file. " +
19 | "Defaults to 'dab-config.json' unless 'dab-config..json' exists," +
20 | " where DAB_ENVIRONMENT is an environment variable.")]
21 | public string? Config { get; }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/Cli/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "Cli": {
4 | "commandName": "Project",
5 | "commandLineArgs": "start",
6 | "httpPort": 5002
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Config/Converters/DataSourceFilesConverter.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using System.Text.Json;
5 | using System.Text.Json.Serialization;
6 | using Azure.DataApiBuilder.Config.ObjectModel;
7 |
8 | namespace Azure.DataApiBuilder.Config.Converters;
9 |
10 | ///
11 | /// Converter for DataSourceFiles
12 | ///
13 | class DataSourceFilesConverter : JsonConverter
14 | {
15 | ///
16 | public override DataSourceFiles? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
17 | {
18 | IEnumerable? dataSourceFiles =
19 | JsonSerializer.Deserialize>(ref reader, options);
20 |
21 | return new DataSourceFiles(dataSourceFiles);
22 | }
23 |
24 | ///
25 | public override void Write(Utf8JsonWriter writer, DataSourceFiles value, JsonSerializerOptions options)
26 | {
27 | // Remove the converter so we don't recurse.
28 | JsonSerializerOptions innerOptions = new(options);
29 | innerOptions.Converters.Remove(innerOptions.Converters.First(c => c is DataSourceFilesConverter));
30 |
31 | JsonSerializer.Serialize(writer, value.SourceFiles, innerOptions);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/Config/Converters/EnvironmentVariableReplacementFailureMode.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Config.Converters;
5 |
6 | ///
7 | /// Control how to handle environment variable replacement failures when deserializing strings in the JSON config file.
8 | ///
9 | public enum EnvironmentVariableReplacementFailureMode
10 | {
11 | ///
12 | /// Ignore the missing environment variable and return the original value, eg: @env('schema').
13 | ///
14 | Ignore,
15 | ///
16 | /// Throw an exception when a missing environment variable is encountered. This is the default behavior.
17 | ///
18 | Throw
19 | }
20 |
--------------------------------------------------------------------------------
/src/Config/Converters/RuntimeEntitiesConverter.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using System.Collections.ObjectModel;
5 | using System.Text.Json;
6 | using System.Text.Json.Serialization;
7 | using Azure.DataApiBuilder.Config.ObjectModel;
8 |
9 | namespace Azure.DataApiBuilder.Config.Converters;
10 |
11 | class RuntimeEntitiesConverter : JsonConverter
12 | {
13 | ///
14 | public override RuntimeEntities? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
15 | {
16 | IDictionary entities =
17 | JsonSerializer.Deserialize>(ref reader, options) ??
18 | throw new JsonException("Failed to read entities");
19 |
20 | return new RuntimeEntities(new ReadOnlyDictionary(entities));
21 | }
22 |
23 | ///
24 | public override void Write(Utf8JsonWriter writer, RuntimeEntities value, JsonSerializerOptions options)
25 | {
26 | writer.WriteStartObject();
27 | foreach ((string key, Entity entity) in value.Entities)
28 | {
29 | writer.WritePropertyName(key);
30 | JsonSerializer.Serialize(writer, entity, options);
31 | }
32 |
33 | writer.WriteEndObject();
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/Config/FeatureFlagConstants.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Config;
5 |
6 | public static class FeatureFlagConstants
7 | {
8 | public const string INMEMORYCACHE = "InMemoryCachingPreview";
9 | }
10 |
--------------------------------------------------------------------------------
/src/Config/HealthCheck/HealthCheckConfig.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using System.Text.Json.Serialization;
5 |
6 | namespace Azure.DataApiBuilder.Config.ObjectModel;
7 |
8 | public record HealthCheckConfig
9 | {
10 | public bool Enabled { get; set; }
11 |
12 | [JsonIgnore(Condition = JsonIgnoreCondition.Always)]
13 | public bool UserProvidedEnabled { get; init; } = false;
14 |
15 | public HealthCheckConfig()
16 | {
17 | Enabled = true;
18 | }
19 |
20 | public HealthCheckConfig(bool? enabled)
21 | {
22 | if (enabled is not null)
23 | {
24 | this.Enabled = (bool)enabled;
25 | UserProvidedEnabled = true;
26 | }
27 | else
28 | {
29 | this.Enabled = true;
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/Config/HealthCheck/HealthCheckConstants.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Config.HealthCheck
5 | {
6 | ///
7 | /// HealthCheckConstants is a common place to track all constant values related to health checks.
8 | ///
9 | public static class HealthCheckConstants
10 | {
11 | public const string ENDPOINT = "endpoint";
12 | public const string DATASOURCE = "data-source";
13 | public const string REST = "rest";
14 | public const string GRAPHQL = "graphql";
15 | public const int ERROR_RESPONSE_TIME_MS = -1;
16 | public const int DEFAULT_THRESHOLD_RESPONSE_TIME_MS = 1000;
17 | public const int DEFAULT_FIRST_VALUE = 100;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Config/HealthCheck/RuntimeHealthCheckConfig.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using System.Text.Json.Serialization;
5 |
6 | namespace Azure.DataApiBuilder.Config.ObjectModel;
7 |
8 | public record RuntimeHealthCheckConfig : HealthCheckConfig
9 | {
10 | [JsonPropertyName("cache-ttl-seconds")]
11 | public int CacheTtlSeconds { get; set; }
12 |
13 | public HashSet? Roles { get; set; }
14 |
15 | // TODO: Add support for parallel stream to run the health check query in upcoming PRs
16 | // public int MaxDop { get; set; } = 1; // Parallelized streams to run Health Check (Default: 1)
17 |
18 | [JsonIgnore(Condition = JsonIgnoreCondition.Always)]
19 | public bool UserProvidedTtlOptions { get; init; } = false;
20 |
21 | public RuntimeHealthCheckConfig() : base()
22 | {
23 | }
24 |
25 | public RuntimeHealthCheckConfig(bool? enabled, HashSet? roles = null, int? cacheTtlSeconds = null) : base(enabled)
26 | {
27 | this.Roles = roles;
28 |
29 | if (cacheTtlSeconds is not null)
30 | {
31 | this.CacheTtlSeconds = (int)cacheTtlSeconds;
32 | UserProvidedTtlOptions = true;
33 | }
34 | else
35 | {
36 | this.CacheTtlSeconds = EntityCacheOptions.DEFAULT_TTL_SECONDS;
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/Config/HotReloadEventArgs.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Config;
5 |
6 | public class HotReloadEventArgs : EventArgs
7 | {
8 | public string EventName { get; set; }
9 |
10 | public string Message { get; set; }
11 |
12 | public HotReloadEventArgs(string eventName, string message)
13 | {
14 | EventName = eventName;
15 | Message = message;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Config/NamingPolicies/HyphenatedNamingPolicy.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using System.Text.Json;
5 | using System.Text.RegularExpressions;
6 |
7 | namespace Azure.DataApiBuilder.Config.NamingPolicies;
8 |
9 | ///
10 | /// A that converts PascalCase to hyphenated-case.
11 | ///
12 | /// The only exception is the string "graphql", which is converted to "graphql" (lowercase).
13 | ///
14 | ///
15 | /// This is used to simplify how we deserialize the JSON fields of the config file,
16 | /// turning something like data-source to DataSource.
17 | ///
18 | ///
19 | ///
20 | /// Input: DataSource
21 | /// Output: data-source
22 | ///
23 | ///
24 | public sealed class HyphenatedNamingPolicy : JsonNamingPolicy
25 | {
26 | ///
27 | public override string ConvertName(string name)
28 | {
29 | if (string.Equals(name, "graphql", StringComparison.OrdinalIgnoreCase))
30 | {
31 | return name.ToLower();
32 | }
33 |
34 | return string.Join("-", Regex.Split(name, @"(?
7 | /// Different types of APIs supported by runtime engine.
8 | ///
9 | public enum ApiType
10 | {
11 | REST,
12 | GraphQL,
13 | // This is required to indicate features common between all APIs.
14 | All
15 | }
16 |
--------------------------------------------------------------------------------
/src/Config/ObjectModel/ApplicationInsightsOptions.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Config.ObjectModel;
5 |
6 | ///
7 | /// Represents the options for configuring Application Insights.
8 | ///
9 | public record ApplicationInsightsOptions(bool Enabled = false, string? ConnectionString = null)
10 | { }
11 |
--------------------------------------------------------------------------------
/src/Config/ObjectModel/AuthorizationType.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Config.ObjectModel;
5 |
6 | ///
7 | /// Authorization types supported in the service.
8 | ///
9 | public enum AuthorizationType
10 | {
11 | Anonymous,
12 | Authenticated
13 | }
14 |
--------------------------------------------------------------------------------
/src/Config/ObjectModel/Cardinality.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Config.ObjectModel;
5 |
6 | public enum Cardinality
7 | {
8 | One,
9 | Many
10 | }
11 |
--------------------------------------------------------------------------------
/src/Config/ObjectModel/CliBool.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Config.ObjectModel;
5 |
6 | ///
7 | /// Class to represent boolean values in CLI. This is required over primitive boolean types because of the limitation of the CommandLineParser library
8 | /// where if a boolean option is included in the CLI command, it is set as true.
9 | /// Doesn't matter what value we specify for the option as that value is ignored.
10 | ///
11 | public enum CliBool
12 | {
13 | // The enum value None is required to determine whether a value was provided for a CLI option. In case the option is not included in the init command,
14 | // the enum gets assigned a value of an uninitialized enum i.e. 0 (here 'None').
15 | None,
16 | True,
17 | False
18 | }
19 |
--------------------------------------------------------------------------------
/src/Config/ObjectModel/CorsOptions.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Config.ObjectModel;
5 |
6 | ///
7 | /// Configuration related to Cross Origin Resource Sharing (CORS).
8 | ///
9 | /// List of allowed origins.
10 | ///
11 | /// Whether to set Access-Control-Allow-Credentials CORS header.
12 | public record CorsOptions(string[] Origins, bool AllowCredentials = false);
13 |
--------------------------------------------------------------------------------
/src/Config/ObjectModel/DataSourceFiles.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Config.ObjectModel
5 | {
6 | ///
7 | /// DataSourceFiles is a record that contains a list of files defining the runtime configs for multi-db scenario.
8 | /// SourceFiles is null for single-db scenario.
9 | ///
10 | /// File names would match guidance as described in FileSystemRuntimeConfigLoader.cs
11 | public record DataSourceFiles(IEnumerable? SourceFiles = null);
12 | }
13 |
--------------------------------------------------------------------------------
/src/Config/ObjectModel/DatabaseType.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Config.ObjectModel;
5 |
6 | public enum DatabaseType
7 | {
8 | CosmosDB_NoSQL,
9 | MySQL,
10 | MSSQL,
11 | PostgreSQL,
12 | CosmosDB_PostgreSQL,
13 | DWSQL
14 | }
15 |
--------------------------------------------------------------------------------
/src/Config/ObjectModel/EasyAuthType.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Config.ObjectModel;
5 |
6 | public enum EasyAuthType
7 | {
8 | StaticWebApps,
9 | AppService
10 | }
11 |
--------------------------------------------------------------------------------
/src/Config/ObjectModel/EntityAction.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Config.ObjectModel;
5 |
6 | public record EntityAction(EntityActionOperation Action, EntityActionFields? Fields, EntityActionPolicy? Policy)
7 | {
8 | public static readonly HashSet ValidPermissionOperations = new() { EntityActionOperation.Create, EntityActionOperation.Read, EntityActionOperation.Update, EntityActionOperation.Delete };
9 | public static readonly HashSet ValidStoredProcedurePermissionOperations = new() { EntityActionOperation.Execute };
10 | }
11 |
--------------------------------------------------------------------------------
/src/Config/ObjectModel/EntityActionFields.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Config.ObjectModel;
5 |
6 | public record EntityActionFields(
7 | // Exclude cannot be null, it is initialized with an empty set - no field is excluded.
8 | HashSet Exclude,
9 |
10 | // Include being null indicates that it was not specified in the config.
11 | // This is used later (in authorization resolver) as an indicator that
12 | // Include resolves to all fields present in the config.
13 | // And so, unlike Exclude, we don't initialize it with an empty set when null.
14 | HashSet? Include = null);
15 |
--------------------------------------------------------------------------------
/src/Config/ObjectModel/EntityActionOperation.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using System.Runtime.Serialization;
5 |
6 | namespace Azure.DataApiBuilder.Config.ObjectModel;
7 |
8 | ///
9 | /// The operations supported by the service.
10 | ///
11 | public enum EntityActionOperation
12 | {
13 | None,
14 |
15 | // *
16 | [EnumMember(Value = "*")] All,
17 |
18 | // Common Operations
19 | Delete, Read,
20 |
21 | // cosmosdb_nosql operations
22 | Upsert, Create, Patch,
23 |
24 | // Sql operations
25 | Insert, Update, UpdateGraphQL,
26 |
27 | // Additional
28 | UpsertIncremental, UpdateIncremental,
29 |
30 | // Only valid operation for stored procedures
31 | Execute
32 | }
33 |
--------------------------------------------------------------------------------
/src/Config/ObjectModel/EntityCacheLevel.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Config.ObjectModel;
5 |
6 | public enum EntityCacheLevel
7 | {
8 | L1,
9 | L1L2
10 | }
11 |
--------------------------------------------------------------------------------
/src/Config/ObjectModel/EntityGraphQLOptions.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Config.ObjectModel;
5 |
6 | ///
7 | /// Describes the GraphQL settings specific to an entity.
8 | ///
9 | /// The singular type name for the GraphQL object. If none is provided this will be generated by the Entity key.
10 | /// The pluralisation of the entity. If none is provided a pluralisation of the Singular property is used.
11 | /// Indicates if GraphQL is enabled for the entity.
12 | /// When the entity maps to a stored procedure, this represents the GraphQL operation to use, otherwise it will be null.
13 | ///
14 | public record EntityGraphQLOptions(string Singular, string Plural, bool Enabled = true, GraphQLOperation? Operation = null);
15 |
--------------------------------------------------------------------------------
/src/Config/ObjectModel/EntityPermission.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Config.ObjectModel;
5 |
6 | ///
7 | /// Defines which Actions (Create, Read, Update, Delete, Execute) are permitted for a given role.
8 | ///
9 | /// Name of the role to which defined permission applies.
10 | /// An array of what can be performed against the entity for the actions.
11 | /// This can be written in JSON using shorthand notation, or as a full object, with a custom JsonConverter to convert that into the .NET type.
12 | #pragma warning disable CA1711 // Identifiers should not have incorrect suffix
13 | public record EntityPermission(string Role, EntityAction[] Actions);
14 | #pragma warning restore CA1711 // Identifiers should not have incorrect suffix
15 |
--------------------------------------------------------------------------------
/src/Config/ObjectModel/EntityRelationship.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using System.Text.Json.Serialization;
5 |
6 | namespace Azure.DataApiBuilder.Config.ObjectModel;
7 |
8 | public record EntityRelationship(
9 | Cardinality Cardinality,
10 | [property: JsonPropertyName("target.entity")] string TargetEntity,
11 | [property: JsonPropertyName("source.fields")] string[] SourceFields,
12 | [property: JsonPropertyName("target.fields")] string[] TargetFields,
13 | [property: JsonPropertyName("linking.object")] string? LinkingObject,
14 | [property: JsonPropertyName("linking.source.fields")] string[] LinkingSourceFields,
15 | [property: JsonPropertyName("linking.target.fields")] string[] LinkingTargetFields);
16 |
--------------------------------------------------------------------------------
/src/Config/ObjectModel/EntityRestOptions.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Config.ObjectModel;
5 |
6 | ///
7 | /// Describes the REST settings specific to an entity.
8 | ///
9 | /// Instructs the runtime to use this as the path
10 | /// at which the REST endpoint for this entity is exposed
11 | /// instead of using the entity-name. Can be a string type.
12 | ///
13 | /// The HTTP verbs that are supported for this entity. Has significance only for stored-procedures.
14 | /// For tables and views, all the 5 HTTP actions are enabled when REST endpoints are enabled
15 | /// for the entity. So, this property is insignificant for tables and views.
16 | /// Whether the entity is enabled for REST.
17 | public record EntityRestOptions(SupportedHttpVerb[]? Methods = null, string? Path = null, bool Enabled = true)
18 | {
19 | public static readonly SupportedHttpVerb[] DEFAULT_SUPPORTED_VERBS = new[] { SupportedHttpVerb.Get, SupportedHttpVerb.Post, SupportedHttpVerb.Put, SupportedHttpVerb.Patch, SupportedHttpVerb.Delete };
20 | public static readonly SupportedHttpVerb[] DEFAULT_HTTP_VERBS_ENABLED_FOR_SP = new[] { SupportedHttpVerb.Post };
21 | }
22 |
--------------------------------------------------------------------------------
/src/Config/ObjectModel/EntitySource.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Config.ObjectModel;
5 |
6 | ///
7 | /// Describes the type, name, parameters, and key fields for a
8 | /// database object source.
9 | ///
10 | /// The name of the database object.
11 | /// Type of the database object.
12 | /// Should be one of [table, view, stored-procedure].
13 | /// If Type is SourceType.StoredProcedure,
14 | /// Parameters to be passed as defaults to the procedure call
15 | /// The field(s) to be used as primary keys.
16 | public record EntitySource(string Object, EntitySourceType? Type, Dictionary? Parameters, string[]? KeyFields);
17 |
--------------------------------------------------------------------------------
/src/Config/ObjectModel/EntitySourceType.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using System.Runtime.Serialization;
5 |
6 | namespace Azure.DataApiBuilder.Config.ObjectModel;
7 |
8 | ///
9 | /// Supported source types as defined by json schema
10 | ///
11 | public enum EntitySourceType
12 | {
13 | Table,
14 | View,
15 | [EnumMember(Value = "stored-procedure")] StoredProcedure
16 | }
17 |
--------------------------------------------------------------------------------
/src/Config/ObjectModel/FeatureFlags.cs:
--------------------------------------------------------------------------------
1 | namespace Azure.DataApiBuilder.Config.ObjectModel
2 | {
3 | ///
4 | /// The class is used for ephemeral feature flags to turn on/off features in development
5 | ///
6 | public class FeatureFlags
7 | {
8 | ///
9 | /// By default EnableDwNto1JoinQueryOptimization is disabled
10 | /// We should change the default as True once got more confidence with the fix
11 | ///
12 | public bool EnableDwNto1JoinQueryOptimization { get; set; }
13 |
14 | public FeatureFlags()
15 | {
16 | this.EnableDwNto1JoinQueryOptimization = false;
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Config/ObjectModel/GraphQLOperation.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Config.ObjectModel;
5 |
6 | public enum GraphQLOperation
7 | {
8 | Query,
9 | Mutation
10 | }
11 |
--------------------------------------------------------------------------------
/src/Config/ObjectModel/HostMode.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using System.Text.Json.Serialization;
5 |
6 | namespace Azure.DataApiBuilder.Config.ObjectModel;
7 |
8 | [JsonConverter(typeof(JsonStringEnumConverter))]
9 | public enum HostMode
10 | {
11 | Development,
12 | Production
13 | }
14 |
--------------------------------------------------------------------------------
/src/Config/ObjectModel/JwtOptions.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Config.ObjectModel;
5 |
6 | public record JwtOptions(string? Audience, string? Issuer);
7 |
--------------------------------------------------------------------------------
/src/Config/ObjectModel/MultipleCreateOptions.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 | namespace Azure.DataApiBuilder.Config.ObjectModel;
4 |
5 | ///
6 | /// Options for multiple create operations.
7 | ///
8 | /// Indicates whether multiple create operation is enabled.
9 | public class MultipleCreateOptions
10 | {
11 | ///
12 | /// Indicates whether multiple create operation is enabled.
13 | ///
14 | public bool Enabled;
15 |
16 | public MultipleCreateOptions(bool enabled)
17 | {
18 | Enabled = enabled;
19 | }
20 | };
21 |
22 |
--------------------------------------------------------------------------------
/src/Config/ObjectModel/MultipleCreateSupportingDatabaseType.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Config.ObjectModel
5 | {
6 | public enum MultipleCreateSupportingDatabaseType
7 | {
8 | MSSQL
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Config/ObjectModel/MultipleMutationOptions.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Config.ObjectModel;
5 |
6 | ///
7 | /// Class that holds the options for all multiple mutation operations.
8 | ///
9 | /// Options for multiple create operation.
10 | public class MultipleMutationOptions
11 | {
12 | // Options for multiple create operation.
13 | public MultipleCreateOptions? MultipleCreateOptions;
14 |
15 | public MultipleMutationOptions(MultipleCreateOptions? multipleCreateOptions = null)
16 | {
17 | MultipleCreateOptions = multipleCreateOptions;
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/src/Config/ObjectModel/OpenTelemetryOptions.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using OpenTelemetry.Exporter;
5 |
6 | namespace Azure.DataApiBuilder.Config.ObjectModel;
7 |
8 | ///
9 | /// Represents the options for configuring Open Telemetry.
10 | ///
11 | public record OpenTelemetryOptions(bool Enabled = false, string? Endpoint = null, string? Headers = null, OtlpExportProtocol? ExporterProtocol = null, string? ServiceName = null)
12 | { }
13 |
--------------------------------------------------------------------------------
/src/Config/ObjectModel/RelationshipRole.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Config.ObjectModel;
5 |
6 | ///
7 | /// Denotes the role of a referencing or referenced table in a relationship.
8 | /// Default value is None because the role is only resolved to help DAB
9 | /// create join predicates for self-referencing relationships.
10 | /// In non self-join relationships, DAB uses the ForeignKeyDefinition.RelationShipPair
11 | /// to determine the referencing/referenced entity. RelationShipPair isn't sufficient
12 | /// for self-join relationships because the DatabaseObjects used to represent the pair
13 | /// reference the same object: e.g. both Referenced/Referencing entity would point to 'dbo.MyTable'
14 | ///
15 | public enum RelationshipRole
16 | {
17 | None,
18 | Source,
19 | Target,
20 | Linking
21 | }
22 |
--------------------------------------------------------------------------------
/src/Config/ObjectModel/RestRuntimeOptions.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Config.ObjectModel;
5 |
6 | ///
7 | /// Holds the global settings used at runtime for REST APIs.
8 | ///
9 | /// If the REST APIs are enabled.
10 | /// The URL prefix path at which endpoints
11 | /// for all entities will be exposed.
12 | /// Boolean property indicating whether extraneous fields are allowed in request body.
13 | /// The default value is true - meaning we don't allow extraneous fields by default in the rest request body.
14 | /// Changing the default value is a breaking change.
15 | public record RestRuntimeOptions(bool Enabled = true, string Path = RestRuntimeOptions.DEFAULT_PATH, bool RequestBodyStrict = true)
16 | {
17 | public const string DEFAULT_PATH = "/api";
18 | };
19 |
--------------------------------------------------------------------------------
/src/Config/ObjectModel/SupportedHttpVerb.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Config.ObjectModel;
5 |
6 | ///
7 | /// A subset of the HTTP verb list that is supported by the REST endpoints within the service.
8 | ///
9 | public enum SupportedHttpVerb
10 | {
11 | Get,
12 | Post,
13 | Put,
14 | Patch,
15 | Delete
16 | }
17 |
--------------------------------------------------------------------------------
/src/Config/ObjectModel/TelemetryOptions.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using System.Text.Json.Serialization;
5 | using Microsoft.Extensions.Logging;
6 |
7 | namespace Azure.DataApiBuilder.Config.ObjectModel;
8 |
9 | ///
10 | /// Represents the options for telemetry.
11 | ///
12 | public record TelemetryOptions(ApplicationInsightsOptions? ApplicationInsights = null, OpenTelemetryOptions? OpenTelemetry = null, Dictionary? LoggerLevel = null)
13 | {
14 | [JsonPropertyName("log-level")]
15 | public Dictionary? LoggerLevel { get; init; } = LoggerLevel;
16 | }
17 |
--------------------------------------------------------------------------------
/src/Config/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using System.Runtime.CompilerServices;
5 |
6 | [assembly: InternalsVisibleTo("Azure.DataApiBuilder.Service.Tests")]
7 |
--------------------------------------------------------------------------------
/src/Config/Utilities/HttpStatusCodeExtensions.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using System.Net;
5 |
6 | namespace Azure.DataApiBuilder.Config.Utilities;
7 |
8 | public static class HttpStatusCodeExtensions
9 | {
10 | ///
11 | /// Check for status code within 4xx range
12 | ///
13 | ///
14 | ///
15 | public static bool IsClientError(this HttpStatusCode statusCode)
16 | {
17 | int code = (int)statusCode;
18 | return code >= 400 && code < 500;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/Core/AuthenticationHelpers/AuthenticationSimulator/SimulatorAuthenticationDefaults.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Core.AuthenticationHelpers.AuthenticationSimulator;
5 |
6 | ///
7 | /// Default values related to SimulatorAuthentication handler.
8 | ///
9 | public static class SimulatorAuthenticationDefaults
10 | {
11 | ///
12 | /// The default value used for SimulatorAuthenticationOptions.AuthenticationScheme.
13 | ///
14 | public const string AUTHENTICATIONSCHEME = "SimulatorAuthentication";
15 | }
16 |
--------------------------------------------------------------------------------
/src/Core/AuthenticationHelpers/EasyAuthAuthenticationDefaults.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Core.AuthenticationHelpers;
5 |
6 | ///
7 | /// EasyAuth authentication scheme names granularized by provider
8 | /// to enable compatibility with HotReloading authentication settings.
9 | /// Authentication schemes:
10 | /// - Correlate to an authentication handler
11 | /// - Indicate to AuthenticateAsync which handler to use
12 | ///
13 | ///
14 | public static class EasyAuthAuthenticationDefaults
15 | {
16 | ///
17 | /// Used in ConfigureAuthentication() (AuthV1)
18 | /// The default value used for EasyAuthAuthenticationOptions.AuthenticationScheme.
19 | ///
20 | public const string AUTHENTICATIONSCHEME = "EasyAuthAuthentication";
21 |
22 | public const string SWAAUTHSCHEME = "StaticWebAppsAuthentication";
23 |
24 | public const string APPSERVICEAUTHSCHEME = "AppServiceAuthentication";
25 |
26 | ///
27 | /// Warning message emitted when the EasyAuth payload is invalid.
28 | ///
29 | public const string INVALID_PAYLOAD_ERROR = "Invalid EasyAuth Payload.";
30 | }
31 |
--------------------------------------------------------------------------------
/src/Core/AuthenticationHelpers/EasyAuthAuthenticationOptions.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using Azure.DataApiBuilder.Config.ObjectModel;
5 | using Microsoft.AspNetCore.Authentication;
6 |
7 | namespace Azure.DataApiBuilder.Core.AuthenticationHelpers;
8 |
9 | ///
10 | /// A stub class to expose named options for Azure Static Web Apps/App Service authentication (Easy Auth).
11 | /// Options are a required parameter of AuthenticationBuilder.AddScheme()
12 | /// which is utilized in the EasyAuthAuthenticationBuilderExtensions class.
13 | /// Microsoft Docs: https://docs.microsoft.com/dotnet/api/microsoft.aspnetcore.authentication.authenticationbuilder.addscheme
14 | /// Follows the model demonstrated by Microsoft.Identity.Web
15 | /// https://github.com/AzureAD/microsoft-identity-web/blob/master/src/Microsoft.Identity.Web/AppServicesAuth/AppServicesAuthenticationOptions.cs
16 | ///
17 | public class EasyAuthAuthenticationOptions : AuthenticationSchemeOptions
18 | {
19 | public EasyAuthType EasyAuthProvider { get; set; }
20 | }
21 |
--------------------------------------------------------------------------------
/src/Core/AuthenticationHelpers/GenericOAuthDefaults.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Core.AuthenticationHelpers;
5 |
6 | ///
7 | /// Authentication Scheme name for generic OAuth providers.
8 | ///
9 | public class GenericOAuthDefaults
10 | {
11 | public const string AUTHENTICATIONSCHEME = "OAuthAuthentication";
12 | }
13 |
--------------------------------------------------------------------------------
/src/Core/AuthenticationHelpers/SupportedAuthNProviders.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Core.AuthenticationHelpers;
5 |
6 | internal static class SupportedAuthNProviders
7 | {
8 | public const string APP_SERVICE = "AppService";
9 |
10 | public const string AZURE_AD = "AzureAD";
11 | public const string ENTRA_ID = "EntraID";
12 |
13 | public const string GENERIC_OAUTH = "Custom";
14 | public const string SIMULATOR = "Simulator";
15 |
16 | public const string STATIC_WEB_APPS = "StaticWebApps";
17 | }
18 |
--------------------------------------------------------------------------------
/src/Core/Configurations/IConfigValidator.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Core.Configurations;
5 |
6 | ///
7 | /// Validates the runtime config.
8 | ///
9 | public interface IConfigValidator
10 | {
11 | ///
12 | /// Validate the runtime config properties.
13 | ///
14 | void ValidateConfigProperties();
15 | }
16 |
--------------------------------------------------------------------------------
/src/Core/Configurations/LoggerFilters.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Core.Configurations
5 | {
6 | public static class LoggerFilters
7 | {
8 | public static List validFilters = new();
9 |
10 | public static void AddFilter(string? loggerFilter)
11 | {
12 | if (loggerFilter != null)
13 | {
14 | validFilters.Add(loggerFilter);
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/Core/EnumerableUtilities.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Core;
5 |
6 | ///
7 | /// A class which contains useful methods for processing collections.
8 | ///
9 | public static class EnumerableUtilities
10 | {
11 | ///
12 | /// Checks whether is null or empty.
13 | ///
14 | /// The type of the .
15 | /// The to be checked.
16 | /// True if is null or empty, false otherwise.
17 | public static bool IsNullOrEmpty(this IEnumerable? enumerable)
18 | {
19 | return enumerable == null || !enumerable.Any();
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/Core/Extensions/DabPathExtensions.cs:
--------------------------------------------------------------------------------
1 | namespace HotChocolate;
2 |
3 | internal static class DabPathExtensions
4 | {
5 | public static int Depth(this Path path)
6 | => path.Length - 1;
7 |
8 | public static bool IsRootField(this Path path)
9 | => path.Parent.IsRoot;
10 | }
11 |
--------------------------------------------------------------------------------
/src/Core/Generator/Sampler/ISchemaGeneratorSampler.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using System.Text.Json;
5 |
6 | namespace Azure.DataApiBuilder.Core.Generator.Sampler
7 | {
8 | ///
9 | /// Interface for schema generator samplers, which define methods for sampling data from a data source.
10 | /// Implementing classes should provide functionality to retrieve a subset of data, typically for the purpose of generating schema information.
11 | ///
12 | public interface ISchemaGeneratorSampler
13 | {
14 | ///
15 | /// Asynchronously retrieves a sample of data.
16 | /// Implementations of this method should define the criteria for sampling, such as the number of records, time range, or partitioning.
17 | ///
18 | /// A task that represents the asynchronous operation. The task result contains a list of objects, each representing a sampled data record.
19 | public Task> GetSampleAsync();
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/Core/Generator/SamplingModes.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Core.Generator
5 | {
6 | ///
7 | /// Defines the different modes of sampling data from Azure Cosmos DB database.
8 | ///
9 | public enum SamplingModes
10 | {
11 | ///
12 | /// Represents the mode where the top N records are sampled.
13 | /// This mode selects a specified number of records in descending order based on a timestamp or other sorting criteria.
14 | ///
15 | TopNExtractor,
16 |
17 | ///
18 | /// Represents the mode where data is sampled based on partitions.
19 | /// In this mode, data is fetched from each partition with a specified limit per partition, which helps in distributing the sampling across different data segments.
20 | ///
21 | EligibleDataSampler,
22 |
23 | ///
24 | /// Represents the mode where data is sampled by dividing the time range into subranges.
25 | /// This mode samples a specified number of records from each time-based subrange, allowing for temporal segmentation in the sampling process.
26 | ///
27 | TimePartitionedSampler
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/Core/Models/CosmosOperationMetadata.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using Azure.DataApiBuilder.Config.ObjectModel;
5 |
6 | namespace Azure.DataApiBuilder.Core.Models;
7 |
8 | ///
9 | /// Metadata for the Cosmos engines to understand an operation to undertake
10 | ///
11 | /// Name of the database
12 | /// Name of the container
13 | /// Type of operation to perform
14 | record CosmosOperationMetadata(string DatabaseName, string ContainerName, EntityActionOperation OperationType);
15 |
--------------------------------------------------------------------------------
/src/Core/Models/DatabaseQueryMetadata.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Core.Models;
5 |
6 | ///
7 | /// Represents the database query built from a query structure.
8 | /// Contains all query metadata need to create a cache key.
9 | ///
10 | public class DatabaseQueryMetadata
11 | {
12 | public string QueryText { get; }
13 | public string DataSource { get; }
14 | public Dictionary QueryParameters { get; }
15 |
16 | ///
17 | /// Creates a "Data Transfer Object" (DTO) used for provided query metadata to dependent services.
18 | ///
19 | /// Raw query text built from a query structure object.
20 | /// Name of the data source where the query will execute.
21 | /// Dictonary of query parameter names and values.
22 | public DatabaseQueryMetadata(string queryText, string dataSource, Dictionary queryParameters)
23 | {
24 | QueryText = queryText;
25 | DataSource = dataSource;
26 | QueryParameters = queryParameters;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/Core/Models/DbConnectionParam.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using System.Data;
5 |
6 | namespace Azure.DataApiBuilder.Core.Models;
7 |
8 | ///
9 | /// Represents a single parameter created for the database connection.
10 | ///
11 | public class DbConnectionParam
12 | {
13 | public DbConnectionParam(object? value, DbType? dbType = null, SqlDbType? sqlDbType = null)
14 | {
15 | Value = value;
16 | DbType = dbType;
17 | SqlDbType = sqlDbType;
18 | }
19 |
20 | ///
21 | /// Value of the parameter.
22 | ///
23 | public object? Value { get; set; }
24 |
25 | // DbType of the parameter.
26 | // This is being made nullable because GraphQL treats Sql Server types like datetime, datetimeoffset
27 | // identically and then implicit conversion cannot happen.
28 | // For more details refer: https://github.com/Azure/data-api-builder/pull/1442.
29 | public DbType? DbType { get; set; }
30 |
31 | // This is being made nullable
32 | // because it's not populated for DB's other than MSSQL.
33 | public SqlDbType? SqlDbType { get; set; }
34 | }
35 |
--------------------------------------------------------------------------------
/src/Core/Models/DbResultSet.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Core.Models;
5 |
6 | ///
7 | /// Represents a Result Set read from DbDataReader.
8 | ///
9 | public class DbResultSet
10 | {
11 | public DbResultSet(
12 | Dictionary resultProperties)
13 | {
14 | Rows = new();
15 | ResultProperties = resultProperties;
16 | }
17 |
18 | ///
19 | /// Represents the rows in the result set.
20 | ///
21 | public List Rows { get; private set; }
22 |
23 | ///
24 | /// Represents DbDataReader properties such as RecordsAffected and HasRows.
25 | ///
26 | public Dictionary ResultProperties { get; private set; }
27 | }
28 |
29 | ///
30 | /// Represents a single row present in the Result Set.
31 | ///
32 | public class DbResultSetRow
33 | {
34 | public DbResultSetRow() { }
35 |
36 | ///
37 | /// Represents a result set row in ColumnName: Value format, empty if no row was found.
38 | ///
39 | public Dictionary Columns { get; private set; } = new();
40 | }
41 |
--------------------------------------------------------------------------------
/src/Core/Models/HttpConstants.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Core.Models;
5 |
6 | ///
7 | /// Represents the constant values of HTTP Methods.
8 | ///
9 | public static class HttpConstants
10 | {
11 | public const string GET = "GET";
12 | public const string POST = "POST";
13 | public const string PATCH = "PATCH";
14 | public const string PUT = "PUT";
15 | public const string DELETE = "DELETE";
16 | }
17 |
--------------------------------------------------------------------------------
/src/Core/Models/HttpHeaders.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Core.Models;
5 |
6 | ///
7 | /// Represents the constant values of HTTP Headers.
8 | ///
9 | public static class HttpHeaders
10 | {
11 | public const string CORRELATION_ID = "x-ms-correlation-id";
12 | }
13 |
--------------------------------------------------------------------------------
/src/Core/Models/IMetadata.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Core.Models;
5 |
6 | ///
7 | /// Used to label classes considered metadata
8 | ///
9 | public interface IMetadata { }
10 |
--------------------------------------------------------------------------------
/src/Core/Models/MutationResolver.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Core.Models;
5 |
6 | public record MutationResolver(string Id, Operation OperationType, string DatabaseName, string ContainerName, string Fields, string Table);
7 |
--------------------------------------------------------------------------------
/src/Core/Models/RelationshipFields.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Core.Models
5 | {
6 | ///
7 | /// Class to represent a set of source/target fields for a relationship between source and target entities.
8 | ///
9 | public class RelationshipFields
10 | {
11 | // Relationship fields in source entity.
12 | public List SourceFields { get; }
13 |
14 | // Relationship fields in target entity.
15 | public List TargetFields { get; }
16 |
17 | public RelationshipFields(List sourceFields, List targetFields)
18 | {
19 | SourceFields = sourceFields;
20 | TargetFields = targetFields;
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/Core/Models/RestRequestContexts/DeleteRequestContext.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using Azure.DataApiBuilder.Config.DatabasePrimitives;
5 | using Azure.DataApiBuilder.Config.ObjectModel;
6 |
7 | namespace Azure.DataApiBuilder.Core.Models;
8 |
9 | ///
10 | /// DeleteRequestContext provides the major components of a REST query
11 | /// corresponding to the DeleteById or DeleteMany operations.
12 | ///
13 | public class DeleteRequestContext : RestRequestContext
14 | {
15 | ///
16 | /// Constructor.
17 | ///
18 | public DeleteRequestContext(string entityName, DatabaseObject dbo, bool isList)
19 | : base(entityName, dbo)
20 | {
21 | FieldsToBeReturned = new();
22 | PrimaryKeyValuePairs = new();
23 | FieldValuePairsInBody = new();
24 | IsMany = isList;
25 | OperationType = EntityActionOperation.Delete;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/Core/Models/RestRequestContexts/FindRequestContext.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using Azure.DataApiBuilder.Config.DatabasePrimitives;
5 | using Azure.DataApiBuilder.Config.ObjectModel;
6 |
7 | namespace Azure.DataApiBuilder.Core.Models;
8 |
9 | ///
10 | /// FindRequestContext provides the major components of a REST query
11 | /// corresponding to the FindById or FindMany operations.
12 | ///
13 | public class FindRequestContext : RestRequestContext
14 | {
15 | ///
16 | /// Constructor.
17 | ///
18 |
19 | public FindRequestContext(string entityName, DatabaseObject dbo, bool isList)
20 | : base(entityName, dbo)
21 | {
22 | FieldsToBeReturned = new();
23 | PrimaryKeyValuePairs = new();
24 | FieldValuePairsInBody = new();
25 | IsMany = isList;
26 | OperationType = EntityActionOperation.Read;
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/src/Core/Models/RestRequestContexts/InsertRequestContext.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using System.Text.Json;
5 | using Azure.DataApiBuilder.Config.DatabasePrimitives;
6 | using Azure.DataApiBuilder.Config.ObjectModel;
7 |
8 | namespace Azure.DataApiBuilder.Core.Models;
9 |
10 | ///
11 | /// InsertRequestContext provides the major components of a REST query
12 | /// corresponding to the InsertOne or InsertMany operations.
13 | ///
14 | public class InsertRequestContext : RestRequestContext
15 | {
16 | ///
17 | /// Constructor.
18 | ///
19 | public InsertRequestContext(
20 | string entityName,
21 | DatabaseObject dbo,
22 | JsonElement insertPayloadRoot,
23 | EntityActionOperation operationType)
24 | : base(entityName, dbo)
25 | {
26 | FieldsToBeReturned = new();
27 | PrimaryKeyValuePairs = new();
28 | OperationType = operationType;
29 |
30 | PopulateFieldValuePairsInBody(insertPayloadRoot);
31 | // We don't support InsertMany as yet.
32 | IsMany = false;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/Core/Models/RestRequestContexts/UpsertRequestContext.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using System.Text.Json;
5 | using Azure.DataApiBuilder.Config.DatabasePrimitives;
6 | using Azure.DataApiBuilder.Config.ObjectModel;
7 |
8 | namespace Azure.DataApiBuilder.Core.Models;
9 |
10 | ///
11 | /// UpsertRequestContext provides the major components of a REST query
12 | /// corresponding to the PutOne operations.
13 | ///
14 | public class UpsertRequestContext : RestRequestContext
15 | {
16 | ///
17 | /// Constructor.
18 | ///
19 | public UpsertRequestContext(
20 | string entityName,
21 | DatabaseObject dbo,
22 | JsonElement insertPayloadRoot,
23 | EntityActionOperation operationType)
24 | : base(entityName, dbo)
25 | {
26 | FieldsToBeReturned = new();
27 | PrimaryKeyValuePairs = new();
28 | OperationType = operationType;
29 |
30 | PopulateFieldValuePairsInBody(insertPayloadRoot);
31 |
32 | // We don't support UpsertMany as yet.
33 | IsMany = false;
34 | }
35 | }
36 |
37 |
--------------------------------------------------------------------------------
/src/Core/Models/SqlInformationalCodes.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Core.Models
5 | {
6 | public enum SqlInformationalCodes : int
7 | {
8 |
9 | ///
10 | /// MsSQL information code that contains the statement ID, query hash and
11 | /// distributed request ID. This information can be used for development purposes.
12 | ///
13 | MSSQL_STATEMENT_ID_INFORMATION_CODE = 15806,
14 |
15 | ///
16 | /// Prints statement ID for supportability purposes. If a non-distributed query hits an issue, it'd be helpful if the customer could share the statement id.
17 | ///
18 | ///
19 | /// Text in summary is copied verbatim from the engine definition.
20 | ///
21 | DW_FABRIC_QUERY_IDENTIFIER = 24528,
22 |
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/Core/Resolvers/CosmosExistsQueryStructure.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using Azure.DataApiBuilder.Auth;
5 | using Azure.DataApiBuilder.Core.Configurations;
6 | using Azure.DataApiBuilder.Core.Models;
7 | using Azure.DataApiBuilder.Core.Services;
8 | using HotChocolate.Resolvers;
9 |
10 | namespace Azure.DataApiBuilder.Core.Resolvers
11 | {
12 | public class CosmosExistsQueryStructure : CosmosQueryStructure
13 | {
14 | ///
15 | /// Constructor for Exists query.
16 | ///
17 | public CosmosExistsQueryStructure(IMiddlewareContext context,
18 | IDictionary parameters,
19 | RuntimeConfigProvider runtimeConfigProvider,
20 | ISqlMetadataProvider metadataProvider,
21 | IAuthorizationResolver authorizationResolver,
22 | GQLFilterParser gQLFilterParser,
23 | IncrementingInteger? counter = null,
24 | List? predicates = null)
25 | : base(context,
26 | parameters,
27 | runtimeConfigProvider,
28 | metadataProvider,
29 | authorizationResolver,
30 | gQLFilterParser,
31 | counter,
32 | predicates)
33 | {
34 | SourceAlias = CreateTableAlias();
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/Core/Resolvers/Factories/IMutationEngineFactory.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using Azure.DataApiBuilder.Config.ObjectModel;
5 |
6 | namespace Azure.DataApiBuilder.Core.Resolvers.Factories
7 | {
8 | ///
9 | /// MutationEngineFactory interface.
10 | /// Used in DI container to get the IMutationEngine based on database type.
11 | ///
12 | public interface IMutationEngineFactory
13 | {
14 | ///
15 | /// Gets the MutationEngine based on database type.
16 | ///
17 | /// databaseType.
18 | /// IMutationEngine based on database type..
19 | public IMutationEngine GetMutationEngine(DatabaseType databaseType);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/Core/Resolvers/Factories/IQueryEngineFactory.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using Azure.DataApiBuilder.Config.ObjectModel;
5 |
6 | namespace Azure.DataApiBuilder.Core.Resolvers.Factories
7 | {
8 | ///
9 | /// QueryEngineFactory interface.
10 | /// Used in DI container to retrieve appropriate queryEngine
11 | ///
12 | public interface IQueryEngineFactory
13 | {
14 | ///
15 | /// Gets the QueryEngine based on database type.
16 | ///
17 | /// databaseType.
18 | /// QueryEngine based on database type.
19 | public IQueryEngine GetQueryEngine(DatabaseType databaseType);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/Core/Services/MetadataProviders/Converters/TypeConverter.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using System.Text.Json;
5 | using System.Text.Json.Serialization;
6 |
7 | namespace Azure.DataApiBuilder.Core.Services.MetadataProviders.Converters
8 | {
9 | ///
10 | /// This is a converter to serialize and deserialize an object of Type : System.Type
11 | /// For example, the ColumnDefiniton object's default value property of type System.Type.
12 | ///
13 | public class TypeConverter : JsonConverter
14 | {
15 | public override Type Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
16 | {
17 | if (reader.TokenType != JsonTokenType.String)
18 | {
19 | throw new JsonException();
20 | }
21 |
22 | string typeName = reader.GetString()!;
23 | return Type.GetType(typeName)!;
24 | }
25 |
26 | public override void Write(Utf8JsonWriter writer, Type value, JsonSerializerOptions options)
27 | {
28 | // Full Name is a shorter version of the assembly qualified name, full name works for serialization and
29 | // deserialization of .Net types
30 | writer.WriteStringValue(value.FullName);
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/Core/Services/OpenAPI/JsonDataType.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Core.Services.OpenAPI
5 | {
6 | ///
7 | /// Specifies the data type of a JSON value.
8 | /// Distinguished from System.Text.Json enum JsonValueKind because there are no separate
9 | /// values for JsonValueKind.True or JsonValueKind.False, only a single value JsonDataType.Boolean.
10 | /// This distinction is necessary to facilitate OpenAPI schema creation which requires generic
11 | /// JSON types to be defined for parameters. Because no values are present, JsonValueKind.True/False
12 | /// can't be used.
13 | ///
14 | public enum JsonDataType
15 | {
16 | Undefined = 0,
17 | ///
18 | /// A JSON Object
19 | ///
20 | Object = 1,
21 | ///
22 | /// A JSON array
23 | ///
24 | Array = 2,
25 | ///
26 | /// A JSON string
27 | ///
28 | String = 3,
29 | ///
30 | /// A JSON number
31 | ///
32 | Number = 4,
33 | ///
34 | /// A JSON Boolean
35 | ///
36 | Boolean = 5,
37 | ///
38 | /// The JSON value null
39 | ///
40 | Null = 6
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/Directory.Build.props:
--------------------------------------------------------------------------------
1 |
2 |
3 | enable
4 | ..\out
5 | 1.6
6 |
7 |
8 |
9 | True
10 |
11 |
12 |
13 | True
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/Product/Azure.DataApiBuilder.Product.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0
5 | enable
6 | enable
7 | $(BaseOutputPath)\engine
8 | true
9 | NU1603
10 |
11 |
12 |
13 | true
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/Service.GraphQLBuilder/Azure.DataApiBuilder.Service.GraphQLBuilder.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0
5 | enable
6 | enable
7 | $(BaseOutputPath)\engine
8 | true
9 | NU1603
10 |
11 |
12 |
13 | true
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/src/Service.GraphQLBuilder/Directives/AutoGeneratedDirectiveType.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using HotChocolate.Types;
5 |
6 | namespace Azure.DataApiBuilder.Service.GraphQLBuilder.Directives
7 | {
8 | public class AutoGeneratedDirectiveType : DirectiveType
9 | {
10 | public static string DirectiveName { get; } = "autoGenerated";
11 |
12 | protected override void Configure(IDirectiveTypeDescriptor descriptor)
13 | {
14 | descriptor
15 | .Name(DirectiveName)
16 | .Description("Indicates that a field is auto generated by the database.")
17 | .Location(DirectiveLocation.FieldDefinition);
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/Service.GraphQLBuilder/Directives/ModelDirective.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using HotChocolate;
5 | using HotChocolate.Types;
6 |
7 | namespace Azure.DataApiBuilder.Service.GraphQLBuilder.Directives
8 | {
9 | [DirectiveType(
10 | DirectiveLocation.Object
11 | | DirectiveLocation.FieldDefinition,
12 | Name = Names.MODEL)]
13 | [GraphQLDescription(
14 | "A directive to indicate the type maps to a " +
15 | "storable entity not a nested entity.")]
16 | public class ModelDirective
17 | {
18 | [GraphQLDescription(
19 | "Underlying name of the database entity.")]
20 | public string? Name { get; set; }
21 |
22 | public static class Names
23 | {
24 | public const string MODEL = "model";
25 | public const string NAME_ARGUMENT = "name";
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/Service.GraphQLBuilder/Directives/PrimaryKeyDirective.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using HotChocolate.Types;
5 |
6 | namespace Azure.DataApiBuilder.Service.GraphQLBuilder.Directives
7 | {
8 | public class PrimaryKeyDirectiveType : DirectiveType
9 | {
10 | public static string DirectiveName { get; } = "primaryKey";
11 |
12 | protected override void Configure(IDirectiveTypeDescriptor descriptor)
13 | {
14 | descriptor
15 | .Name(DirectiveName)
16 | .Description("A directive to indicate the primary key field of an item.")
17 | .Location(DirectiveLocation.FieldDefinition);
18 |
19 | descriptor
20 | .Argument("databaseType")
21 | .Type()
22 | .Description("The underlying database type.");
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/Service.GraphQLBuilder/Directives/ReferencingFieldDirectiveType.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using HotChocolate.Types;
5 |
6 | namespace Azure.DataApiBuilder.Service.GraphQLBuilder.Directives
7 | {
8 | public class ReferencingFieldDirectiveType : DirectiveType
9 | {
10 | public static string DirectiveName { get; } = "dab_referencingField";
11 |
12 | protected override void Configure(IDirectiveTypeDescriptor descriptor)
13 | {
14 | descriptor
15 | .Name(DirectiveName)
16 | .Description("When present on a field in a database table, indicates that the field is a referencing field " +
17 | "to some field in the same/another database table.")
18 | .Location(DirectiveLocation.FieldDefinition);
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/Service.GraphQLBuilder/GraphQLTypes/OrderByType.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using HotChocolate.Types;
5 |
6 | namespace Azure.DataApiBuilder.Service.GraphQLBuilder.GraphQLTypes
7 | {
8 | public class OrderByType : EnumType
9 | {
10 | public static string EnumName { get; } = nameof(OrderBy);
11 |
12 | protected override void Configure(IEnumTypeDescriptor descriptor)
13 | {
14 | base.Configure(descriptor);
15 | descriptor.Name(EnumName);
16 | }
17 | }
18 |
19 | public enum OrderBy
20 | {
21 | ASC, DESC
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/Service.Tests/Authentication/Helpers/RuntimeConfigAuthHelper.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using System.Collections.Generic;
5 | using Azure.DataApiBuilder.Config;
6 | using Azure.DataApiBuilder.Config.ObjectModel;
7 |
8 | namespace Azure.DataApiBuilder.Service.Tests.Authentication.Helpers;
9 |
10 | internal static class RuntimeConfigAuthHelper
11 | {
12 | internal static RuntimeConfig CreateTestConfigWithAuthNProvider(AuthenticationOptions authenticationOptions)
13 | {
14 | DataSource dataSource = new(DatabaseType.MSSQL, "", new());
15 |
16 | Config.ObjectModel.HostOptions hostOptions = new(Cors: null, Authentication: authenticationOptions);
17 | RuntimeConfig config = new(
18 | Schema: FileSystemRuntimeConfigLoader.SCHEMA,
19 | DataSource: dataSource,
20 | Runtime: new(
21 | Rest: new(),
22 | GraphQL: new(),
23 | Host: hostOptions
24 | ),
25 | Entities: new(new Dictionary())
26 | );
27 | return config;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/Service.Tests/ConcurrentTests/cgmanifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/component-detection-manifest.json",
3 | "registrations": [
4 | {
5 | "component": {
6 | "type": "git",
7 | "git": {
8 | "repositoryUrl": "https://github.com/grafana/k6",
9 | "commitHash": "a45ab5a444da82148f25a9cb93932bed1c8566c9"
10 | }
11 | },
12 | "DevelopmentDependency": true
13 | }
14 | ],
15 | "version": 1
16 | }
17 |
--------------------------------------------------------------------------------
/src/Service.Tests/Configuration/ComprehensiveHealthReportResponse.json:
--------------------------------------------------------------------------------
1 | {
2 | "status": "Healthy",
3 | "version": "1.5.0",
4 | "app-name": "dab_oss_1.5.0",
5 | "configuration": {
6 | "rest": true,
7 | "graphql": true,
8 | "caching": false,
9 | "telemetry": false,
10 | "mode": "Production"
11 | },
12 | "checks": [
13 | {
14 | "status": "Healthy",
15 | "name": "MSSQL",
16 | "tags": [
17 | "data-source"
18 | ],
19 | "data": {
20 | "response-ms": 1,
21 | "threshold-ms": 1000
22 | }
23 | },
24 | {
25 | "status": "Healthy",
26 | "name": "Book",
27 | "tags": [
28 | "rest",
29 | "endpoint"
30 | ],
31 | "data": {
32 | "response-ms": 10,
33 | "threshold-ms": 100
34 | }
35 | },
36 | {
37 | "status": "Unhealthy",
38 | "name": "Book",
39 | "exception": "The threshold for executing the request has exceeded.",
40 | "tags": [
41 | "graphql",
42 | "endpoint"
43 | ],
44 | "data": {
45 | "response-ms": 20,
46 | "threshold-ms": 10
47 | }
48 | }
49 | ]
50 | }
--------------------------------------------------------------------------------
/src/Service.Tests/Configuration/ConfigurationEndpoints.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Service.Tests.Configuration;
5 |
6 | internal static class ConfigurationEndpoints
7 | {
8 | // TODO: Remove the old endpoint once we've updated all callers to use the new one.
9 | public const string CONFIGURATION_ENDPOINT = "/configuration";
10 | public const string CONFIGURATION_ENDPOINT_V2 = "/configuration/v2";
11 | }
12 |
--------------------------------------------------------------------------------
/src/Service.Tests/Configuration/TestConfigFileReader.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using System;
5 | using System.IO;
6 | using Azure.DataApiBuilder.Config;
7 | using Azure.DataApiBuilder.Config.ObjectModel;
8 | using static Azure.DataApiBuilder.Config.FileSystemRuntimeConfigLoader;
9 |
10 | namespace Azure.DataApiBuilder.Service.Tests.Configuration;
11 |
12 | ///
13 | /// Provides the methods to read the configuration files from disk for tests.
14 | ///
15 | internal static class TestConfigFileReader
16 | {
17 | public static RuntimeConfig ReadCosmosConfigurationFromFile()
18 | {
19 | string cosmosFile = $"{CONFIGFILE_NAME}.{TestCategory.COSMOSDBNOSQL}{CONFIG_EXTENSION}";
20 |
21 | string configurationFileContents = File.ReadAllText(cosmosFile);
22 | if (!RuntimeConfigLoader.TryParseConfig(configurationFileContents, out RuntimeConfig config))
23 | {
24 | throw new Exception("Failed to parse configuration file.");
25 | }
26 |
27 | // The Schema file isn't provided in the configuration file when going through the configuration endpoint so we're removing it.
28 | _ = config.DataSource.Options.Remove("Schema");
29 | return config;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/Service.Tests/CosmosTests/TestData/GeneratedGqlSchema/EmulatorData.gql:
--------------------------------------------------------------------------------
1 | type ContainerName @model(name: "ContainerName") {
2 | id: ID!,
3 | name: String!,
4 | dimension: String!,
5 | age: Int!,
6 | myBooleanProp: Boolean!,
7 | anotherPojo: AnotherPojo!,
8 | character: Character!,
9 | stars: [Star]!,
10 | suns: [Sun]!,
11 | moons: [Moon]!,
12 | earth: Earth!,
13 | additionalAttributes: [AdditionalAttribute]!,
14 | tags: [String]!
15 | }
16 | type AnotherPojo {
17 | anotherProp: String!,
18 | anotherIntProp: Int!,
19 | person: Person!
20 | }
21 | type Person {
22 | firstName: String!,
23 | lastName: String!,
24 | zipCode: Int!
25 | }
26 | type Character {
27 | id: ID!,
28 | name: String!,
29 | type: String!,
30 | homePlanet: Int!,
31 | primaryFunction: String!,
32 | star: Star!
33 | }
34 | type Star {
35 | name: String!,
36 | id: ID!,
37 | tag: Tag!
38 | }
39 | type Tag {
40 | id: ID!,
41 | name: String!
42 | }
43 | type Sun {
44 | id: ID!,
45 | name: String!
46 | }
47 | type Moon {
48 | id: ID!,
49 | name: String!,
50 | details: String!,
51 | moonAdditionalAttributes: [MoonAdditionalAttribute]!
52 | }
53 | type MoonAdditionalAttribute {
54 | id: ID!,
55 | name: String!,
56 | moreAttributes: [MoreAttribute]!
57 | }
58 | type MoreAttribute {
59 | id: ID!,
60 | name: String!
61 | }
62 | type Earth {
63 | id: ID!,
64 | name: String!,
65 | type: String!
66 | }
67 | type AdditionalAttribute {
68 | id: ID!,
69 | name: String!
70 | }
71 |
--------------------------------------------------------------------------------
/src/Service.Tests/CosmosTests/TestData/GeneratedGqlSchema/MultiItems.gql:
--------------------------------------------------------------------------------
1 | type Planet @model(name: "Planet") {
2 | id: ID!,
3 | name: String,
4 | dimension: String,
5 | age: Int,
6 | myBooleanProp: Boolean,
7 | anotherPojo: AnotherPojo,
8 | character: Character,
9 | stars: [Star],
10 | suns: [Sun],
11 | moons: [Moon],
12 | earth: Earth,
13 | additionalAttributes: [AdditionalAttribute],
14 | tags: [String]
15 | }
16 | type AnotherPojo {
17 | anotherProp: String!,
18 | anotherIntProp: Int,
19 | person: Person
20 | }
21 | type Person {
22 | firstName: String!,
23 | lastName: String,
24 | zipCode: Int
25 | }
26 | type Character {
27 | id: ID!,
28 | name: String,
29 | type: String,
30 | homePlanet: Int,
31 | primaryFunction: String,
32 | star: Star
33 | }
34 | type Star {
35 | name: String!,
36 | id: ID,
37 | tag: Tag
38 | }
39 | type Tag {
40 | id: ID!,
41 | name: String
42 | }
43 | type Sun {
44 | id: ID!,
45 | name: String
46 | }
47 | type Moon {
48 | id: ID!,
49 | name: String,
50 | details: String,
51 | moonAdditionalAttributes: [MoonAdditionalAttribute]
52 | }
53 | type MoonAdditionalAttribute {
54 | id: ID!,
55 | name: String,
56 | moreAttributes: [MoreAttribute]
57 | }
58 | type MoreAttribute {
59 | id: ID!,
60 | name: String
61 | }
62 | type Earth {
63 | id: ID!,
64 | name: String,
65 | type: String
66 | }
67 | type AdditionalAttribute {
68 | id: ID!,
69 | name: String
70 | }
71 |
--------------------------------------------------------------------------------
/src/Service.Tests/CosmosTests/TestData/GeneratedGqlSchema/MultiItemsWithConfig.gql:
--------------------------------------------------------------------------------
1 | type Planet @model(name:"PlanetAlias") {
2 | id: ID!,
3 | name: String,
4 | dimension: String,
5 | age: Int,
6 | myBooleanProp: Boolean,
7 | character: Character,
8 | stars: [Star],
9 | suns: [Sun],
10 | moons: [Moon],
11 | earth: Earth,
12 | additionalAttributes: [AdditionalAttribute],
13 | tags: [String]
14 | }
15 | type Character {
16 | id: ID!,
17 | name: String,
18 | type: String,
19 | homePlanet: Int,
20 | primaryFunction: String,
21 | star: Star
22 | }
23 | type Star {
24 | name: String!,
25 | id: ID,
26 | tag: Tag
27 | }
28 | type Tag {
29 | id: ID!,
30 | name: String
31 | }
32 | type Sun {
33 | id: ID!,
34 | name: String
35 | }
36 | type Moon {
37 | id: ID!,
38 | name: String,
39 | details: String,
40 | moonAdditionalAttributes: [MoonAdditionalAttribute]
41 | }
42 | type MoonAdditionalAttribute {
43 | id: ID!,
44 | name: String,
45 | moreAttributes: [MoreAttribute]
46 | }
47 | type MoreAttribute {
48 | id: ID!,
49 | name: String
50 | }
51 | type Earth {
52 | id: ID!,
53 | name: String,
54 | type: String
55 | }
56 | type AdditionalAttribute {
57 | id: ID!,
58 | name: String
59 | }
60 |
--------------------------------------------------------------------------------
/src/Service.Tests/GraphQLBuilder/MsSqlMultipleMutationBuilderTests.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using System.Threading.Tasks;
5 | using Microsoft.VisualStudio.TestTools.UnitTesting;
6 |
7 | namespace Azure.DataApiBuilder.Service.Tests.GraphQLBuilder
8 | {
9 | [TestClass, TestCategory(TestCategory.MSSQL)]
10 | public class MsSqlMultipleMutationBuilderTests : MultipleMutationBuilderTests
11 | {
12 | [ClassInitialize]
13 | public static async Task SetupAsync(TestContext context)
14 | {
15 | databaseEngine = TestCategory.MSSQL;
16 | await InitializeAsync();
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Service.Tests/OpenApiDocumentor/OpenApiDocumentorConstants.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Service.Tests.OpenApiIntegration
5 | {
6 | public class OpenApiDocumentorConstants
7 | {
8 | public const string TOPLEVELPROPERTY_OPENAPI = "openapi";
9 | public const string TOPLEVELPROPERTY_INFO = "info";
10 | public const string TOPLEVELPROPERTY_SERVERS = "servers";
11 | public const string TOPLEVELPROPERTY_PATHS = "paths";
12 | public const string TOPLEVELPROPERTY_COMPONENTS = "components";
13 | public const string PROPERTY_SCHEMAS = "schemas";
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Service.Tests/Snapshots/CorsUnitTests.TestCorsConfigReadCorrectly.verified.txt:
--------------------------------------------------------------------------------
1 | {
2 | Cors: {
3 | AllowCredentials: false
4 | },
5 | Authentication: {
6 | Provider: StaticWebApps
7 | }
8 | }
--------------------------------------------------------------------------------
/src/Service.Tests/TestCategory.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | namespace Azure.DataApiBuilder.Service.Tests
5 | {
6 | public class TestCategory
7 | {
8 | public const string COSMOSDBNOSQL = "CosmosDb_NoSql";
9 | public const string MSSQL = "MsSql";
10 | public const string POSTGRESQL = "PostgreSql";
11 | public const string MYSQL = "MySql";
12 | public const string DWSQL = "DwSql";
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/Service.Tests/UnitTests/MultipleCreateUnitTests/MsSqlMultipleCreateOrderHelperUnitTests.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using System.Threading.Tasks;
5 | using Microsoft.VisualStudio.TestTools.UnitTesting;
6 |
7 | namespace Azure.DataApiBuilder.Service.Tests.UnitTests
8 | {
9 | [TestClass, TestCategory(TestCategory.MSSQL)]
10 | public class MsSqlMultipleCreateOrderHelperUnitTests : MultipleCreateOrderHelperUnitTests
11 | {
12 | [ClassInitialize]
13 | public static async Task Initialize(TestContext testContext)
14 | {
15 | DatabaseEngine = TestCategory.MSSQL;
16 | await InitializeTestFixture();
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Service.Tests/UnitTests/MultipleCreateUnitTests/MySqlMultipleCreateOrderHelperUnitTests.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using System.Threading.Tasks;
5 | using Microsoft.VisualStudio.TestTools.UnitTesting;
6 |
7 | namespace Azure.DataApiBuilder.Service.Tests.UnitTests
8 | {
9 | ///
10 | /// Currently, we don't support multiple-create for MySql but the order determination logic for insertions is valid for MySql as well.
11 | ///
12 | [TestClass, TestCategory(TestCategory.MYSQL)]
13 | public class MySqlMultipleCreateOrderHelperUnitTests : MultipleCreateOrderHelperUnitTests
14 | {
15 | [ClassInitialize]
16 | public static async Task Initialize(TestContext testContext)
17 | {
18 | DatabaseEngine = TestCategory.MYSQL;
19 | await InitializeTestFixture();
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/Service.Tests/UnitTests/MultipleCreateUnitTests/PgSqlMultipleCreateOrderHelperUnitTests.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using System.Threading.Tasks;
5 | using Microsoft.VisualStudio.TestTools.UnitTesting;
6 |
7 | namespace Azure.DataApiBuilder.Service.Tests.UnitTests
8 | {
9 | ///
10 | /// Currently, we don't support multiple-create for PostgreSql but the order determination logic for insertions is valid for PostgreSql as well.
11 | ///
12 | [TestClass, TestCategory(TestCategory.POSTGRESQL)]
13 | public class PgSqlMultipleCreateOrderHelperUnitTests : MultipleCreateOrderHelperUnitTests
14 | {
15 | [ClassInitialize]
16 | public static async Task Initialize(TestContext testContext)
17 | {
18 | DatabaseEngine = TestCategory.POSTGRESQL;
19 | await InitializeTestFixture();
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/Service.Tests/schema.gql:
--------------------------------------------------------------------------------
1 | type Character @model(name:"Character") {
2 | id : ID,
3 | name : String,
4 | type: String,
5 | homePlanet: Int,
6 | primaryFunction: String,
7 | star: Star
8 | }
9 |
10 | type Planet @model(name:"PlanetAlias"){
11 | id : ID,
12 | name : String,
13 | character: Character,
14 | age : Int,
15 | dimension : String,
16 | stars: [Star]
17 | }
18 |
19 | type Star {
20 | id : ID,
21 | name : String
22 | }
23 |
--------------------------------------------------------------------------------
/src/Service/HealthCheck/Model/ConfigurationDetails.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using System.Text.Json.Serialization;
5 | using Azure.DataApiBuilder.Config.ObjectModel;
6 |
7 | namespace Azure.DataApiBuilder.Service.HealthCheck
8 | {
9 | ///
10 | /// The runtime configuration details of the DAB Engine.
11 | /// As taken from the runtime config file.
12 | ///
13 | public record ConfigurationDetails
14 | {
15 | [JsonPropertyName("rest")]
16 | public bool Rest { get; init; }
17 |
18 | [JsonPropertyName("graphql")]
19 | public bool GraphQL { get; init; }
20 |
21 | [JsonPropertyName("caching")]
22 | public bool Caching { get; init; }
23 |
24 | [JsonPropertyName("telemetry")]
25 | public bool Telemetry { get; init; }
26 |
27 | [JsonPropertyName("mode")]
28 | public HostMode Mode { get; init; }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/Service/HealthCheck/Model/HealthCheckResultEntry.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation.
2 | // Licensed under the MIT License.
3 |
4 | using System.Collections.Generic;
5 | using System.Text.Json.Serialization;
6 |
7 | namespace Azure.DataApiBuilder.Service.HealthCheck
8 | {
9 | ///
10 | /// The Health Check Entry Object
11 | ///
12 | public class HealthCheckResultEntry
13 | {
14 | [JsonPropertyName("status")]
15 | public HealthStatus Status { get; init; }
16 |
17 | [JsonPropertyName("name")]
18 | public string? Name { get; set; }
19 |
20 | [JsonPropertyName("exception")]
21 | public string? Exception { get; init; }
22 |
23 | [JsonPropertyName("tags")]
24 | public List? Tags { get; init; }
25 |
26 | [JsonPropertyName("data")]
27 | public ResponseTimeData? ResponseTimeData { get; init; }
28 | }
29 |
30 | public class ResponseTimeData
31 | {
32 | [JsonPropertyName("response-ms")]
33 | public int? ResponseTimeMs { get; set; }
34 |
35 | [JsonPropertyName("threshold-ms")]
36 | public int? ThresholdMs { get; set; }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/Service/Telemetry/AppInsightsTelemetryInitializer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using Azure.DataApiBuilder.Product;
4 | using Microsoft.ApplicationInsights.Channel;
5 | using Microsoft.ApplicationInsights.Extensibility;
6 |
7 | public class AppInsightsTelemetryInitializer : ITelemetryInitializer
8 | {
9 | public static readonly IReadOnlyDictionary GlobalProperties = new Dictionary
10 | {
11 | { "ProductName", $"{ProductInfo.DAB_USER_AGENT}"},
12 | { "UserAgent", $"{ProductInfo.GetDataApiBuilderUserAgent()}" }
13 | // Add more custom properties here
14 | };
15 |
16 | ///
17 | /// Initializes the telemetry context.
18 | ///
19 | /// The telemetry object to initialize
20 | public void Initialize(ITelemetry telemetry)
21 | {
22 | telemetry.Context.Cloud.RoleName = ProductInfo.CLOUD_ROLE_NAME;
23 | telemetry.Context.Session.Id = Guid.NewGuid().ToString();
24 | telemetry.Context.Component.Version = ProductInfo.GetProductVersion();
25 |
26 | foreach (KeyValuePair property in GlobalProperties)
27 | {
28 | telemetry.Context.GlobalProperties.TryAdd(property.Key, property.Value);
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/Service/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Error",
5 | "Microsoft": "Warning",
6 | "Microsoft.Hosting.Lifetime": "Information"
7 | }
8 | },
9 | "AllowedHosts": "*"
10 | }
11 |
--------------------------------------------------------------------------------
/templates/CredScanSuppressions.json:
--------------------------------------------------------------------------------
1 | {
2 | "tool": "Credential Scanner",
3 | "suppressions": [
4 | {
5 | "placeholder" : "REPLACEME",
6 | "_justification": "Placeholder secret used for tests and samples."
7 | }
8 | ]
9 | }
10 |
--------------------------------------------------------------------------------