-
Notifications
You must be signed in to change notification settings - Fork 96
Support Applying Configuration and Get Configuration #269
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
Merged
marcin-krystianc
merged 27 commits into
G-Research:master
from
sammychinedu2ky:setconfig1
Nov 23, 2023
Merged
Changes from 21 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
7912831
add config feature
sammychinedu2ky ba40d2a
style: fix whitespaces
octocat 8ac695a
added interface
sammychinedu2ky c82c313
made some changes
sammychinedu2ky 8cc9ac2
style: fix whitespaces
octocat 0ce7572
cleaning
sammychinedu2ky f5bbcc9
fixing
sammychinedu2ky 1d337f3
cleaning
sammychinedu2ky be75e89
some touches
sammychinedu2ky ba7a932
style: fix whitespaces
octocat ba3fafe
sweet!!!
sammychinedu2ky 6a82c4f
more types
sammychinedu2ky 85aa9fe
style: fix whitespaces
octocat dde2ab2
sweet!!
sammychinedu2ky 8bfa5cf
sweet
sammychinedu2ky 1657a5d
sweet!!
sammychinedu2ky 46a1f43
made MaxInboundConnections nullable
sammychinedu2ky a285d25
testing the mic
sammychinedu2ky 257a928
added get-config-endpoint
sammychinedu2ky 429dc9b
style: fix whitespaces
octocat 5d9ddf4
edit
sammychinedu2ky 2f51bd3
made some changes
sammychinedu2ky 23e7d08
style: fix whitespaces
octocat a98b877
edit
sammychinedu2ky 34cae68
removed duplication
sammychinedu2ky 128c0f1
style: fix whitespaces
octocat aa8e575
edit
sammychinedu2ky 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| // ----------------------------------------------------------------------- | ||
| // <copyright file="ConfigurationTest.cs" company="G-Research Limited"> | ||
| // Copyright 2020 G-Research Limited | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 (the "License"), | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
| // </copyright> | ||
| // ----------------------------------------------------------------------- | ||
|
|
||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Net; | ||
| using System.Text; | ||
| using System.Threading.Tasks; | ||
| using Xunit; | ||
|
|
||
| namespace Consul.Test | ||
| { | ||
| [CollectionDefinition("NonParallelCollection")] | ||
| public class NonParallelCollection : ICollectionFixture<ConfigurationTest> | ||
| { | ||
| } | ||
|
|
||
| [Collection("NonParallelCollection")] | ||
| public class ConfigurationTest : BaseFixture | ||
| { | ||
| [Fact] | ||
| public async Task Configuration_ApplyConfig() | ||
sammychinedu2ky marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| { | ||
| var payload = new ServiceDefaultsEntry | ||
| { | ||
| Kind = "service-defaults", | ||
| Name = "web", | ||
| Protocol = "http" | ||
sammychinedu2ky marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| }; | ||
| var writeResult = await _client.Configuration.ApplyConfig(payload); | ||
| Assert.Equal(HttpStatusCode.OK, writeResult.StatusCode); | ||
| var queryResult = await _client.Configuration.GetConfig<ServiceDefaultsEntry>(payload.Kind, payload.Name); | ||
| Assert.Equal(HttpStatusCode.OK, queryResult.StatusCode); | ||
| Assert.Equal(payload.Name, queryResult.Response.Name); | ||
| Assert.Equal(payload.Name, queryResult.Response.Name); | ||
sammychinedu2ky marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Assert.Equal(payload.Protocol, queryResult.Response.Protocol); | ||
| } | ||
| } | ||
| } | ||
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 |
|---|---|---|
| @@ -1,15 +1,16 @@ | ||
| { | ||
| "log_level": "TRACE", | ||
| "bind_addr": "127.0.0.1", | ||
| "server": true, | ||
| "bootstrap": true, | ||
| "acl": { | ||
| "enabled": true, | ||
| "default_policy": "allow", | ||
| "tokens": { | ||
| "master": "c6402d2b-f081-45ef-a0f2-73a4a812e9b1" | ||
| } | ||
| }, | ||
| "enable_script_checks": true, | ||
| "encrypt": "d8wu8CSUrqgtjVsvcBPmhQ==" | ||
| "log_level": "TRACE", | ||
| "bind_addr": "127.0.0.1", | ||
| "server": true, | ||
| "bootstrap": true, | ||
| "acl": { | ||
| "enabled": true, | ||
| "default_policy": "allow", | ||
| "tokens": { | ||
| "master": "c6402d2b-f081-45ef-a0f2-73a4a812e9b1" | ||
| } | ||
| }, | ||
| "enable_script_checks": true, | ||
| "encrypt": "d8wu8CSUrqgtjVsvcBPmhQ==", | ||
| "enable_central_service_config": true | ||
sammychinedu2ky marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
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
Oops, something went wrong.
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.