-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Configure and updated Runtime HOST settings using in CLI #2455
Configure and updated Runtime HOST settings using in CLI #2455
Conversation
/azp run |
/azp run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, just few nits.
…/github.com/Azure/data-api-builder into dev/sezalchug/addConfigureHostRuntimeConfig
/azp run |
/azp run |
…/github.com/Azure/data-api-builder into dev/sezalchug/addConfigureHostRuntimeConfig
/azp run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
/azp run |
/azp run |
updatedValue = options?.RuntimeHostMode; | ||
if (updatedValue != null) | ||
{ | ||
updatedHostOptions = updatedHostOptions! with { Mode = (HostMode)updatedValue }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is updatedHostOptions
guaranteed to be not null here? If yes, why do we have the argument to the function defined to be nullable?
} | ||
else | ||
{ | ||
jwtOptions = updatedHostOptions.Authentication.Jwt with { Issuer = (string)updatedValue }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC, Authentication.Jwt and can have audience and issuer values only when Authentication.Provider is Jwt. Can we validate before updating audience/issuer values that Provider is Jwt? If not, fail the update?
## 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 <sezalchug@microsoft.com> Co-authored-by: aaronburtle <93220300+aaronburtle@users.noreply.github.com>
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.
What is this change?
How was this tested?
Sample Request(s)
dab configure --runtime.host.mode {value} -c {Config-File-Name}
dab configure --runtime.host.cors.origins {value} -c {Config-File-Name}
dab configure --runtime.host.cors.allow-credentials {value} -c {Config-File-Name}
dab configure --runtime.host.authentication.provider {value} -c {Config-File-Name}
dab configure --runtime.host.authentication.jwt.audience {value} -c {Config-File-Name}
dab configure --runtime.host.authentication.jwt.issuer {value} -c {Config-File-Name}