Skip to content

Consul: fix invalid port number in app registration#1596

Merged
bart-vmware merged 1 commit intomainfrom
consul-fix-scheme
Sep 24, 2025
Merged

Consul: fix invalid port number in app registration#1596
bart-vmware merged 1 commit intomainfrom
consul-fix-scheme

Conversation

@bart-vmware
Copy link
Member

@bart-vmware bart-vmware commented Sep 23, 2025

Description

Fixed: Without any configuration, an app listening on both https and http would be registered as non-secure (but with the https port number) in Consul.

The default value of Scheme at https://steeltoe.io/docs/v4/discovery/hashicorp-consul.html#configuration-settings should be changed to computed.

When no explicit scheme or port is configured, and the app listens on both schemes, we now prefer https over http (similar to Eureka).

Quality checklist

  • Your code complies with our Coding Style.
  • You've updated unit and/or integration tests for your change, where applicable.
  • You've updated documentation for your change, where applicable.
    If your change affects other repositories, such as Documentation, Samples and/or MainSite, add linked PRs here.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.
  • You've added required license files and/or file headers (explaining where the code came from with proper attribution), where code is copied from StackOverflow, a blog, or OSS.

@bart-vmware bart-vmware changed the title Consul: fix invalid app registration Consul: fix invalid port number in app registration Sep 23, 2025
@bart-vmware bart-vmware added Component/Discovery Issues related to Steeltoe Service Discovery ReleaseLine/4.x Identified as a feature/fix for the 4.x release line labels Sep 23, 2025
…http would be registered as non-secure (but with the https port number) in Consul
@bart-vmware bart-vmware marked this pull request as ready for review September 23, 2025 15:38
@bart-vmware bart-vmware requested a review from TimHess September 23, 2025 15:38
@sonarqubecloud
Copy link

@github-actions
Copy link
Contributor

Summary - All Code Coverage (ubuntu-latest)

Line coverage Branch coverage

Assembly Line coverage Branch coverage
Steeltoe.Bootstrap.AutoConfiguration 97.4% 100%
Steeltoe.Common 85.6% 79.8%
Steeltoe.Common.Certificates 96.2% 85.2%
Steeltoe.Common.Hosting 84% 70%
Steeltoe.Common.Http 100% 85.2%
Steeltoe.Common.Logging 81.1% 41.6%
Steeltoe.Common.Net 64.5% 66.6%
Steeltoe.Configuration.Abstractions 97.8% 92.6%
Steeltoe.Configuration.CloudFoundry 99.1% 91.6%
Steeltoe.Configuration.ConfigServer 97.2% 91.6%
Steeltoe.Configuration.Encryption 97.6% 92.4%
Steeltoe.Configuration.Kubernetes.ServiceBindings 95.1% 89.3%
Steeltoe.Configuration.Placeholder 93.8% 84.7%
Steeltoe.Configuration.RandomValue 93.2% 90%
Steeltoe.Configuration.SpringBoot 98.4% 95.4%
Steeltoe.Connectors 93.9% 89.4%
Steeltoe.Connectors.EntityFrameworkCore 81.5% 75%
Steeltoe.Discovery.Configuration 90.4% 100%
Steeltoe.Discovery.Consul 98% 95%
Steeltoe.Discovery.Eureka 92.7% 85.6%
Steeltoe.Discovery.HttpClients 94% 95.4%
Steeltoe.Logging.Abstractions 99.4% 96.9%
Steeltoe.Logging.DynamicConsole 100% 95.4%
Steeltoe.Logging.DynamicSerilog 99.1% 95%
Steeltoe.Management.Abstractions 100% 100%
Steeltoe.Management.Endpoint 95.5% 89.1%
Steeltoe.Management.Prometheus 95.9% 91.6%
Steeltoe.Management.Tasks 100% ****
Steeltoe.Management.Tracing 100% 75%
Steeltoe.Security.Authentication.JwtBearer 100% 100%
Steeltoe.Security.Authentication.OpenIdConnect 73.8% 59%
Steeltoe.Security.Authorization.Certificate 96.3% 75%
Steeltoe.Security.DataProtection.Redis 100% ****

Copy link
Member

@TimHess TimHess left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bart-vmware bart-vmware merged commit a8c3a98 into main Sep 24, 2025
15 checks passed
@bart-vmware bart-vmware deleted the consul-fix-scheme branch September 24, 2025 04:09
bart-vmware added a commit to SteeltoeOSS/Samples that referenced this pull request Sep 24, 2025
bart-vmware added a commit to SteeltoeOSS/Documentation that referenced this pull request Sep 24, 2025
bart-vmware added a commit to SteeltoeOSS/Samples that referenced this pull request Sep 24, 2025
bart-vmware added a commit to SteeltoeOSS/Documentation that referenced this pull request Sep 24, 2025
@bart-vmware bart-vmware added this to the 4.1.0 milestone Oct 2, 2025
bart-vmware added a commit to SteeltoeOSS/Documentation that referenced this pull request Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component/Discovery Issues related to Steeltoe Service Discovery .NET Aspire ReleaseLine/4.x Identified as a feature/fix for the 4.x release line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants