Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 27 additions & 19 deletions schemas/dab.draft.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
"postgresql",
"mysql",
"cosmosdb_nosql",
Comment thread
souvikghosh04 marked this conversation as resolved.
"cosmosdb_postgresql"
"dwsql"
]
},
"connection-string": {
"description": "Connection string for the selected database type",
"type": "string"
},
"options": {
"description": "Database specific properties for the backend database",
"description": "Database-specific connection and configuration properties. Available options depend on the database-type.",
"type": "object"
},
"health": {
Expand All @@ -42,7 +42,7 @@
"properties": {
"enabled": {
"$ref": "#/$defs/boolean-or-string",
"description": "Enable health check endpoint for something",
"description": "Enable health check for this data source.",
"default": true,
"additionalProperties": false
},
Expand Down Expand Up @@ -97,7 +97,7 @@
"then": {
"properties": {
"options": {
"description": "Database specific properties for the backend database",
"description": "Database-specific connection and configuration properties. Available options depend on the database-type.",
"type": "object",
"additionalProperties": false,
"properties": {
Expand All @@ -124,7 +124,7 @@
"if": {
"properties": {
"database-type": {
"const": "mssql"
"enum": ["mssql", "dwsql"]
}
}
},
Expand Down Expand Up @@ -212,12 +212,13 @@
},
"enabled": {
"$ref": "#/$defs/boolean-or-string",
"description": "Allow enabling/disabling REST requests for all entities."
"description": "Allow enabling/disabling REST requests for all entities.",
"default": true
},
"request-body-strict": {
"$ref": "#/$defs/boolean-or-string",
"description": "Does not allow extraneous fields in request body when set to true.",
"default": true
"default": false
Comment thread
souvikghosh04 marked this conversation as resolved.
}
}
},
Expand All @@ -237,11 +238,12 @@
},
"enabled": {
"$ref": "#/$defs/boolean-or-string",
"description": "Allow enabling/disabling GraphQL requests for all entities."
"description": "Allow enabling/disabling GraphQL requests for all entities.",
"default": true
},
"depth-limit": {
"type": [ "integer", "null" ],
"description": "Maximum allowed depth of a GraphQL query.",
"description": "Maximum allowed depth of a GraphQL query. Only positive integers are enforced. Default: null (no limit). Use -1 to explicitly remove a previously set limit.",
"default": null
},
"multiple-mutations": {
Expand Down Expand Up @@ -299,32 +301,32 @@
"describe-entities": {
"$ref": "#/$defs/boolean-or-string",
"description": "Enable/disable the describe-entities tool.",
"default": false
"default": true
},
"create-record": {
"$ref": "#/$defs/boolean-or-string",
"description": "Enable/disable the create-record tool.",
"default": false
"default": true
},
"read-records": {
"$ref": "#/$defs/boolean-or-string",
"description": "Enable/disable the read-records tool.",
"default": false
"default": true
},
"update-record": {
"$ref": "#/$defs/boolean-or-string",
"description": "Enable/disable the update-record tool.",
"default": false
"default": true
},
"delete-record": {
"$ref": "#/$defs/boolean-or-string",
"description": "Enable/disable the delete-record tool.",
"default": false
"default": true
},
"execute-entity": {
"$ref": "#/$defs/boolean-or-string",
"description": "Enable/disable the execute-entity tool.",
"default": false
"default": true
},
"aggregate-records": {
"description": "Enable/disable or configure the aggregate-records MCP tool.",
Expand Down Expand Up @@ -353,7 +355,7 @@
}
}
],
"default": false
"default": true
}
}
}
Expand Down Expand Up @@ -911,9 +913,11 @@
"additionalProperties": false,
"properties": {
"role": {
"type": "string"
"type": "string",
"description": "The role to which this permission applies (e.g. anonymous, authenticated, or a custom role)."
},
"actions": {
"description": "The operations permitted for this role. Use '*' to allow all, or specify an array of actions.",
"oneOf": [
{
"type": "string",
Expand Down Expand Up @@ -1304,9 +1308,11 @@
"additionalProperties": false,
"properties": {
"role": {
"type": "string"
"type": "string",
"description": "The role to which this permission applies (e.g. anonymous, authenticated, or a custom role)."
},
"actions": {
"description": "The operations permitted for this role. Use '*' to allow all, or specify an array of actions.",
"oneOf": [
{
"type": "string",
Expand Down Expand Up @@ -1378,9 +1384,11 @@
"additionalProperties": false,
"properties": {
"role": {
"type": "string"
"type": "string",
"description": "The role to which this permission applies (e.g. anonymous, authenticated, or a custom role)."
},
"actions": {
"description": "The operations permitted for this role. Use '*' to allow all, or specify an array of actions.",
"oneOf": [
{
"type": "string",
Expand Down
8 changes: 4 additions & 4 deletions src/Cli/Commands/AddTelemetryOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public AddTelemetryOptions(
public string? AppInsightsConnString { get; }

// To specify whether Application Insights telemetry should be enabled. This flag is optional and default value is false.
[Option("app-insights-enabled", Default = CliBool.False, Required = false, HelpText = "(Default: false) Enable/Disable Application Insights")]
[Option("app-insights-enabled", Default = CliBool.False, Required = false, HelpText = "Enable/Disable Application Insights.")]
public CliBool? AppInsightsEnabled { get; }

// Connection string for the Open Telemetry resource to which telemetry data should be sent.
Expand All @@ -53,19 +53,19 @@ public AddTelemetryOptions(
public string? OpenTelemetryEndpoint { get; }

// To specify whether Open Telemetry telemetry should be enabled. This flag is optional and default value is false.
[Option("otel-enabled", Default = CliBool.False, Required = false, HelpText = "(Default: false) Enable/Disable OTEL")]
[Option("otel-enabled", Default = CliBool.False, Required = false, HelpText = "Enable/Disable OTEL.")]
public CliBool? OpenTelemetryEnabled { get; }

// Headers for the Open Telemetry resource to which telemetry data should be sent.
[Option("otel-headers", Required = false, HelpText = "Headers for Open Telemetry for telemetry data")]
public string? OpenTelemetryHeaders { get; }

// Specify the Open Telemetry protocol. This flag is optional and default value is grpc.
[Option("otel-protocol", Default = OtlpExportProtocol.Grpc, Required = false, HelpText = "(Default: grpc) Accepted: grpc/httpprotobuf")]
[Option("otel-protocol", Default = OtlpExportProtocol.Grpc, Required = false, HelpText = "Accepted: grpc, httpprotobuf.")]
public OtlpExportProtocol? OpenTelemetryExportProtocol { get; }

// Service Name for the Open Telemetry resource to which telemetry data should be sent. This flag is optional and default value is dab.
[Option("otel-service-name", Default = "dab", Required = false, HelpText = "(Default: dab) Headers for Open Telemetry for telemetry data")]
[Option("otel-service-name", Default = "dab", Required = false, HelpText = "Service name for Open Telemetry.")]
public string? OpenTelemetryServiceName { get; }

public int Handler(ILogger logger, FileSystemRuntimeConfigLoader loader, IFileSystem fileSystem)
Expand Down
12 changes: 6 additions & 6 deletions src/Cli/Commands/ConfigureOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public ConfigureOptions(
ShowEffectivePermissions = showEffectivePermissions;
}

[Option("data-source.database-type", Required = false, HelpText = "Database type. Allowed values: MSSQL, PostgreSQL, CosmosDB_NoSQL, MySQL.")]
[Option("data-source.database-type", Required = false, HelpText = "Database type. Allowed values: mssql, postgresql, cosmosdb_nosql, mysql, dwsql.")]
Comment thread
souvikghosh04 marked this conversation as resolved.
public string? DataSourceDatabaseType { get; }

[Option("data-source.connection-string", Required = false, HelpText = "Connection string for the data source.")]
Expand All @@ -193,7 +193,7 @@ public ConfigureOptions(
[Option("data-source.options.schema", Required = false, HelpText = "Schema path for Cosmos DB for NoSql.")]
public string? DataSourceOptionsSchema { get; }

[Option("data-source.options.set-session-context", Required = false, HelpText = "Enable session context. Allowed values: true (default), false.")]
[Option("data-source.options.set-session-context", Required = false, HelpText = "Enable session context. Allowed values: true, false.")]
public bool? DataSourceOptionsSetSessionContext { get; }

[Option("data-source.health.name", Required = false, HelpText = "Identifier for data source in health check report.")]
Expand All @@ -217,7 +217,7 @@ public ConfigureOptions(
[Option("data-source-files", Required = false, Separator = ',', HelpText = "Comma-separated list of additional runtime config files for multi-database scenarios.")]
public IEnumerable<string>? DataSourceFiles { get; }

[Option("runtime.graphql.depth-limit", Required = false, HelpText = "Max allowed depth of the nested query. Allowed values: (0,2147483647] inclusive. Default is infinity. Use -1 to remove limit.")]
[Option("runtime.graphql.depth-limit", Required = false, HelpText = "Max allowed depth of a nested query. Allowed values: 1-2147483647, or -1 to remove a previously set limit. Default: -1.")]
Comment thread
souvikghosh04 marked this conversation as resolved.
public int? DepthLimit { get; }

[Option("runtime.graphql.enabled", Required = false, HelpText = "Enable DAB's GraphQL endpoint. Default: true (boolean).")]
Expand All @@ -229,7 +229,7 @@ public ConfigureOptions(
[Option("runtime.graphql.allow-introspection", Required = false, HelpText = "Allow/Deny GraphQL introspection requests in GraphQL Schema. Default: true (boolean).")]
public bool? RuntimeGraphQLAllowIntrospection { get; }

[Option("runtime.graphql.multiple-mutations.create.enabled", Required = false, HelpText = "Enable/Disable multiple-mutation create operations on DAB's generated GraphQL schema. Default: true (boolean).")]
[Option("runtime.graphql.multiple-mutations.create.enabled", Required = false, HelpText = "Enable/Disable multiple-mutation create operations on DAB's generated GraphQL schema. Default: false (boolean).")]
public bool? RuntimeGraphQLMultipleMutationsCreateEnabled { get; }

[Option("runtime.rest.enabled", Required = false, HelpText = "Enable DAB's Rest endpoint. Default: true (boolean).")]
Expand All @@ -238,7 +238,7 @@ public ConfigureOptions(
[Option("runtime.rest.path", Required = false, HelpText = "Customize DAB's REST endpoint path. Default: '/api' Conditions: Prefix path with '/'.")]
public string? RuntimeRestPath { get; }

[Option("runtime.rest.request-body-strict", Required = false, HelpText = "Prohibit extraneous REST request body fields. Default: true (boolean).")]
[Option("runtime.rest.request-body-strict", Required = false, HelpText = "Prohibit extraneous REST request body fields. Default: false (boolean).")]
Comment thread
souvikghosh04 marked this conversation as resolved.
public bool? RuntimeRestRequestBodyStrict { get; }

[Option("runtime.mcp.enabled", Required = false, HelpText = "Enable DAB's MCP endpoint. Default: true (boolean).")]
Expand Down Expand Up @@ -307,7 +307,7 @@ public ConfigureOptions(
[Option("runtime.health.roles", Required = false, Separator = ',', HelpText = "Comma-separated list of roles allowed to access health check details.")]
public IEnumerable<string>? RuntimeHealthRoles { get; }

[Option("runtime.host.mode", Required = false, HelpText = "Set the host running mode of DAB in Development or Production. Default: Development.")]
[Option("runtime.host.mode", Required = false, HelpText = "Set the host running mode of DAB in Development or Production. Default: Production.")]
public HostMode? RuntimeHostMode { get; }

[Option("runtime.host.cors.origins", Required = false, HelpText = "Overwrite Allowed Origins in CORS. Default: [] (Space separated array of strings).")]
Expand Down
4 changes: 2 additions & 2 deletions src/Cli/Commands/EntityOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ public EntityOptions(
[Option("rest", Required = false, HelpText = "Route for rest api.")]
public string? RestRoute { get; }

[Option("rest.methods", Required = false, Separator = ',', HelpText = "HTTP actions to be supported for stored procedure. Specify the actions as a comma separated list. Valid HTTP actions are : [GET, POST, PUT, PATCH, DELETE]")]
[Option("rest.methods", Required = false, Separator = ',', HelpText = "HTTP actions to be supported for stored procedure. Specify the actions as a comma separated list. Valid HTTP actions are: [get, post, put, patch, delete]")]
public IEnumerable<string>? RestMethodsForStoredProcedure { get; }

[Option("graphql", Required = false, HelpText = "Type of graphQL.")]
public string? GraphQLType { get; }

[Option("graphql.operation", Required = false, HelpText = $"GraphQL operation to be supported for stored procedure. Valid operations are : [Query, Mutation] ")]
[Option("graphql.operation", Required = false, HelpText = "GraphQL operation to be supported for stored procedure. Valid operations are: [query, mutation]")]
public string? GraphQLOperationForStoredProcedure { get; }

[Option("fields.include", Required = false, Separator = ',', HelpText = "Fields that are allowed access to permission.")]
Expand Down
2 changes: 1 addition & 1 deletion src/Cli/Commands/InitOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public InitOptions(
[Option("set-session-context", Default = false, Required = false, HelpText = "Enable sending data to MsSql using session context.")]
public bool SetSessionContext { get; }

[Option("host-mode", Default = HostMode.Production, Required = false, HelpText = "Specify the Host mode - Development or Production")]
[Option("host-mode", Default = HostMode.Production, Required = false, HelpText = "Specify the Host mode - development or production")]
public HostMode HostMode { get; }

[Option("cors-origin", Separator = ',', Required = false, HelpText = "Specify the list of allowed origins.")]
Expand Down
6 changes: 3 additions & 3 deletions src/Cli/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ public static bool TryConvertRestMethodNameToRestMethod(string? method, out Supp
{
if (!Enum.TryParse(method, ignoreCase: true, out restMethod))
{
_logger.LogError("Invalid REST Method. Supported methods are {restMethods}.", string.Join(", ", Enum.GetNames<SupportedHttpVerb>()));
_logger.LogError("Invalid REST Method. Supported methods are {restMethods}.", string.Join(", ", Enum.GetNames<SupportedHttpVerb>().Select(n => n.ToLowerInvariant())));
return false;
}

Expand Down Expand Up @@ -669,8 +669,8 @@ public static bool TryConvertGraphQLOperationNameToGraphQLOperation(string? oper
{
_logger.LogError(
"Invalid GraphQL Operation. Supported operations are {queryName} and {mutationName}.",
GraphQLOperation.Query,
GraphQLOperation.Mutation);
nameof(GraphQLOperation.Query).ToLowerInvariant(),
nameof(GraphQLOperation.Mutation).ToLowerInvariant());
return false;
}

Expand Down