-
Notifications
You must be signed in to change notification settings - Fork 311
[OBO] Add CLI support for user-delegated authentication configuration #3128
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
Open
Copilot
wants to merge
17
commits into
main
Choose a base branch
from
copilot/add-cli-support-obo-delegated-identity
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
f246618
Initial plan
Copilot 4792325
Add CLI support for user-delegated-auth configuration
Copilot 122f503
Add runtime parsing tests and verify CLI functionality
Copilot be514c8
Address code review feedback - improve documentation and validation
Copilot 099435a
Merge branch 'main' into copilot/add-cli-support-obo-delegated-identity
anushakolan b0f98fe
Align CLI implementation with PR #3151 - rename to UserDelegatedAuthO…
Copilot 4424cee
Revert global.json to original version
Copilot 7d74d47
Remove duplicate UserDelegatedAuthOptions.cs and restore base definit…
Copilot 8b5ccfe
Restore Config files to base - no changes needed
Copilot 0792079
Merge branch 'main' into copilot/add-cli-support-obo-delegated-identity
anushakolan 70f32f1
Add JSON structure validation tests for CLI user-delegated-auth commands
Copilot c0795d3
Refactor: Extract duplicate JSON config to TestHelper constant
Copilot ae4b942
Merge branch 'main' into copilot/add-cli-support-obo-delegated-identity
Aniruddh25 1cd2637
Address code review feedback - consolidate tests and update help text
Copilot c0fdd62
Enhance test assertions to verify default values
Copilot 572e924
Merge branch 'main' into copilot/add-cli-support-obo-delegated-identity
anushakolan 098fbcc
Remove redundant cloud-specific DataRows from tests
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| namespace Cli.Tests | ||
| { | ||
| [TestClass] | ||
| public class UserDelegatedAuthRuntimeParsingTests | ||
| { | ||
| [TestMethod] | ||
| public void TestRuntimeCanParseUserDelegatedAuthConfig() | ||
| { | ||
| // Arrange | ||
| string configJson = @"{ | ||
| ""$schema"": ""test"", | ||
| ""data-source"": { | ||
| ""database-type"": ""mssql"", | ||
| ""connection-string"": ""testconnectionstring"", | ||
| ""user-delegated-auth"": { | ||
| ""enabled"": true, | ||
| ""database-audience"": ""https://database.windows.net"" | ||
| } | ||
| }, | ||
| ""runtime"": { | ||
| ""rest"": { | ||
| ""enabled"": true, | ||
| ""path"": ""/api"" | ||
| }, | ||
| ""graphql"": { | ||
| ""enabled"": true, | ||
| ""path"": ""/graphql"", | ||
| ""allow-introspection"": true | ||
| }, | ||
| ""host"": { | ||
| ""mode"": ""development"", | ||
| ""cors"": { | ||
| ""origins"": [], | ||
| ""allow-credentials"": false | ||
| }, | ||
| ""authentication"": { | ||
| ""provider"": ""StaticWebApps"" | ||
| } | ||
| } | ||
| }, | ||
| ""entities"": {} | ||
| }"; | ||
|
|
||
| // Act | ||
| bool success = RuntimeConfigLoader.TryParseConfig(configJson, out RuntimeConfig? config); | ||
|
|
||
| // Assert | ||
| Assert.IsTrue(success); | ||
| Assert.IsNotNull(config); | ||
| Assert.IsNotNull(config.DataSource.UserDelegatedAuth); | ||
| Assert.IsTrue(config.DataSource.UserDelegatedAuth.Enabled); | ||
| Assert.AreEqual("https://database.windows.net", config.DataSource.UserDelegatedAuth.DatabaseAudience); | ||
| } | ||
|
|
||
| [TestMethod] | ||
| public void TestRuntimeCanParseConfigWithoutUserDelegatedAuth() | ||
| { | ||
| // Arrange | ||
| string configJson = @"{ | ||
| ""$schema"": ""test"", | ||
| ""data-source"": { | ||
| ""database-type"": ""mssql"", | ||
| ""connection-string"": ""testconnectionstring"" | ||
| }, | ||
| ""runtime"": { | ||
| ""rest"": { | ||
| ""enabled"": true, | ||
| ""path"": ""/api"" | ||
| }, | ||
| ""graphql"": { | ||
| ""enabled"": true, | ||
| ""path"": ""/graphql"", | ||
| ""allow-introspection"": true | ||
| }, | ||
| ""host"": { | ||
| ""mode"": ""development"", | ||
| ""cors"": { | ||
| ""origins"": [], | ||
| ""allow-credentials"": false | ||
| }, | ||
| ""authentication"": { | ||
| ""provider"": ""StaticWebApps"" | ||
| } | ||
| } | ||
| }, | ||
| ""entities"": {} | ||
| }"; | ||
|
|
||
| // Act | ||
| bool success = RuntimeConfigLoader.TryParseConfig(configJson, out RuntimeConfig? config); | ||
|
|
||
| // Assert | ||
| Assert.IsTrue(success); | ||
| Assert.IsNotNull(config); | ||
| Assert.IsNull(config.DataSource.UserDelegatedAuth); | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.