Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] dab configure --runtime in CLI #2403

Closed
abhishekkumams opened this issue Oct 2, 2024 · 2 comments · Fixed by #2455
Closed

[Enhancement] dab configure --runtime in CLI #2403

abhishekkumams opened this issue Oct 2, 2024 · 2 comments · Fixed by #2455
Assignees
Labels
good first issue Good for newcomers
Milestone

Comments

@abhishekkumams
Copy link
Contributor

abhishekkumams commented Oct 2, 2024

Below are the requirements for adding support for updating runtime section of the config using dab-configure command.

Configuration File Property Path CLI Flag Data Type Nullable
runtime.
rest.path
--runtime.rest.path String (default: /api)
runtime.
rest.enabled
--runtime.rest.enabled Boolean: true, false (default: true)
runtime.
rest.request-body-strict
--runtime.rest.request-body-strict Boolean: true, false (default: true)
runtime.
graphql.allow-introspection
--runtime.graphql.allow-introspection Boolean: true, false (default: true)
runtime.
graphql.path
--runtime.graphql.path String (default: /graphql)
runtime.
graphql.enabled
--runtime.graphql.enabled Boolean: true, false (default: true)
runtime.
graphql.multiple-mutations.create.enabled
--runtime.graphql.multiple-mutations.create.enabled Boolean: true, false (default: true)
runtime.
host.mode
--runtime.host.mode String: Development, Production
runtime.
host.cors.origins
--runtime.host.cors.origins Array of strings
runtime.
host.cors.allow-credentials
--runtime.host.cors.allow-credentials Boolean: true, false (default: false)
runtime.
host.authentication.provider
--runtime.host.authentication.provider String: StaticWebApps, AppService, AzureAD, Jwt
runtime.
host.authentication.jwt.audience
--runtime.host.authentication.jwt.audience Array of strings
runtime.
host.authentication.jwt.issuer
--runtime.host.authentication.jwt.issuer String
runtime.
cache.enabled
--runtime.cache.enabled Boolean: true, false (default: false)
runtime.
cache.ttl-seconds
--runtime.cache.ttl-seconds Integer (default: 3600)

Design guide: Design guide: https://github.com/Azure/data-api-builder/blob/main/docs/design/dab-configure.md

Have a look at the original issue: #2251
Attached to this issue are other PRs which can be used to get better understanding.

NOTE:
Feel free to break the task into multiple PRs such as rest/graphql/host.

@abhishekkumams abhishekkumams self-assigned this Oct 2, 2024
@abhishekkumams abhishekkumams added the good first issue Good for newcomers label Oct 2, 2024
@sezal98 sezal98 added this to the 1.3 milestone Oct 9, 2024
@sezal98 sezal98 changed the title [Enhancement] dab configure --runtime in CLI [Enhancement] dab configure --runtime GRAPHQL in CLI Oct 13, 2024
@abhishekkumams
Copy link
Contributor Author

abhishekkumams commented Oct 14, 2024

@sezal98, Please don't change the name of this issue. This was created to track dab-configure at a single place. Just like you created the issue for host and rest, create another one for graphQL. once done, you can add those as sub-issue to this task.

Image

https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/adding-sub-issues

@abhishekkumams abhishekkumams changed the title [Enhancement] dab configure --runtime GRAPHQL in CLI [Enhancement] dab configure --runtime in CLI Oct 14, 2024
@sezal98
Copy link
Contributor

sezal98 commented Oct 14, 2024

Added sub issues as suggested.

seantleonard pushed a commit that referenced this issue Oct 19, 2024
## Why make this change?
This change is related to allowing users to modify the config file with
a simple CLI command.
This PR covers adding changes for field for GRAPHQL config parameters
Related to issue: 
Parent Issue #2403
Sub Issue: #2422

## What is the Change?
This change is to accomodate updation in runtime config from the CLI
tool.
A change in adding RuntimeConfigValidatorUtil is added to make a static
class which contains all the statis functions in RuntimeConfigValidator
so that we dont have to create an object everytime we use this validator
function. We can simply call this using the static function class.

[-] RuntimeConfigValidatorUtil also added another validation condition
in the check where URI should not contain white-spaces along with
reserved characters and starts with '/'.

## How was this tested?

- [x] Integration Tests
- [x] Unit Tests

## Sample Request(s)
`dab configure --runtime.graphql.enabled true -c {ConfigFileName}`
`dab configure --runtime.graphql.path /updatedPath -c {ConfigFileName}`
`dab configure --runtime.graphql.allow-introspection true -c
{ConfigFileName}`
`dab configure --runtime.graphql.multiple-mutations.create.enabled true
-c {ConfigFileName}`

<img width="663" alt="image"
src="https://github.com/user-attachments/assets/e8230cad-1c85-4088-8c9d-6bacdc26aabd">

---------
@sezal98 sezal98 linked a pull request Nov 10, 2024 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants