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 HOST in CLI #2420

Closed
sezal98 opened this issue Oct 13, 2024 · 0 comments · Fixed by #2455
Closed

[Enhancement] dab configure --runtime HOST in CLI #2420

sezal98 opened this issue Oct 13, 2024 · 0 comments · Fixed by #2455
Assignees
Labels
config changes related to config
Milestone

Comments

@sezal98
Copy link
Contributor

sezal98 commented Oct 13, 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.
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

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.

@sezal98 sezal98 added the config changes related to config label Oct 13, 2024
@sezal98 sezal98 added this to the 1.3 milestone Oct 13, 2024
@sezal98 sezal98 self-assigned this Oct 13, 2024
@abhishekkumams abhishekkumams modified the milestones: 1.3, 1.4 Nov 4, 2024
@sezal98 sezal98 linked a pull request Nov 10, 2024 that will close this issue
2 tasks
@sezal98 sezal98 linked a pull request Nov 10, 2024 that will close this issue
2 tasks
abhishekkumams pushed a commit that referenced this issue Nov 21, 2024
## Why make this change?
Resolved issue #2420 
This change is made to enable dab users to update/change values of Rest
and Cache runtime settings from CLI commands.
<img width="665" alt="image"
src="https://github.com/user-attachments/assets/7be7f69a-2621-4cb3-8283-9087df04b2b2">

## What is this change?

1. Made changes in ConfigureOptions.cs to include the additional
parameters for Host Runtime settings.
2. Changes in ConfigureGenerator.cs to include the function to update
the newly incoming values in the parameters of Host runtime settings
3. Changes in Tests to add individual tests for all Host individual
runtime settings like Host: Mode, Cors.Origins, Cors.AllowCredentials,
Authentication.Provider, Authentication.Jwt.Audience,
Authentication.Jwt.Issuer.

## How was this tested?

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

## Sample Request(s)
`dab configure --runtime.host.mode {value} -c {Config-File-Name}`
<img width="662" alt="mode"
src="https://github.com/user-attachments/assets/81e4208e-1719-4948-ac59-b1d4625997f6">

`dab configure --runtime.host.cors.origins {value} -c
{Config-File-Name}`
<img width="662" alt="corsOrigins"
src="https://github.com/user-attachments/assets/7370cae5-56bb-49c6-abcb-6522819b1da5">

`dab configure --runtime.host.cors.allow-credentials {value} -c
{Config-File-Name}`
<img width="655" alt="corsAllow"
src="https://github.com/user-attachments/assets/bb31dc6a-31c0-4259-b2bb-e9c2535cdb3e">

`dab configure --runtime.host.authentication.provider {value} -c
{Config-File-Name}`
<img width="674" alt="provider"
src="https://github.com/user-attachments/assets/03efd7c3-2370-45b9-9626-5ece37f2e6d7">

`dab configure --runtime.host.authentication.jwt.audience {value} -c
{Config-File-Name}`
<img width="671" alt="audience"
src="https://github.com/user-attachments/assets/b4547bde-5520-47d0-84ab-c4f099ed3052">

`dab configure --runtime.host.authentication.jwt.issuer {value} -c
{Config-File-Name}`
<img width="669" alt="issuer"
src="https://github.com/user-attachments/assets/1c71fee2-8a4c-4472-b012-a775a979a8a1">

---------

Co-authored-by: sezalchug <[email protected]>
Co-authored-by: aaronburtle <[email protected]>
abhishekkumams pushed a commit that referenced this issue Nov 28, 2024
## Why make this change?
Resolved issue #2420 
This change is made to enable dab users to update/change values of Rest
and Cache runtime settings from CLI commands.
<img width="665" alt="image"
src="https://github.com/user-attachments/assets/7be7f69a-2621-4cb3-8283-9087df04b2b2">

## What is this change?

1. Made changes in ConfigureOptions.cs to include the additional
parameters for Host Runtime settings.
2. Changes in ConfigureGenerator.cs to include the function to update
the newly incoming values in the parameters of Host runtime settings
3. Changes in Tests to add individual tests for all Host individual
runtime settings like Host: Mode, Cors.Origins, Cors.AllowCredentials,
Authentication.Provider, Authentication.Jwt.Audience,
Authentication.Jwt.Issuer.

## How was this tested?

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

## Sample Request(s)
`dab configure --runtime.host.mode {value} -c {Config-File-Name}`
<img width="662" alt="mode"
src="https://github.com/user-attachments/assets/81e4208e-1719-4948-ac59-b1d4625997f6">

`dab configure --runtime.host.cors.origins {value} -c
{Config-File-Name}`
<img width="662" alt="corsOrigins"
src="https://github.com/user-attachments/assets/7370cae5-56bb-49c6-abcb-6522819b1da5">

`dab configure --runtime.host.cors.allow-credentials {value} -c
{Config-File-Name}`
<img width="655" alt="corsAllow"
src="https://github.com/user-attachments/assets/bb31dc6a-31c0-4259-b2bb-e9c2535cdb3e">

`dab configure --runtime.host.authentication.provider {value} -c
{Config-File-Name}`
<img width="674" alt="provider"
src="https://github.com/user-attachments/assets/03efd7c3-2370-45b9-9626-5ece37f2e6d7">

`dab configure --runtime.host.authentication.jwt.audience {value} -c
{Config-File-Name}`
<img width="671" alt="audience"
src="https://github.com/user-attachments/assets/b4547bde-5520-47d0-84ab-c4f099ed3052">

`dab configure --runtime.host.authentication.jwt.issuer {value} -c
{Config-File-Name}`
<img width="669" alt="issuer"
src="https://github.com/user-attachments/assets/1c71fee2-8a4c-4472-b012-a775a979a8a1">

---------

Co-authored-by: sezalchug <[email protected]>
Co-authored-by: aaronburtle <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config changes related to config
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants