Consul is a distributed, highly available, and data center aware solution to connect and configure applications across dynamic, distributed infrastructure.
 
 
 
 
 
 
Go to file
lornasong 81a22ae9b6
Manual Backport of [Cloud][CC-6925] Updates to pushing server state into release/1.17.x (#19810)
* [Cloud][CC-6925] Updates to pushing server state (#19682)

* Upgrade hcp-sdk-go to latest version v0.73

Changes:
- go get github.com/hashicorp/hcp-sdk-go
- go mod tidy

* From upgrade: regenerate protobufs for upgrade from 1.30 to 1.31

Ran: `make proto`

Slack: https://hashicorp.slack.com/archives/C0253EQ5B40/p1701105418579429

* From upgrade: fix mock interface implementation

After upgrading, there is the following compile error:

cannot use &mockHCPCfg{} (value of type *mockHCPCfg) as "github.com/hashicorp/hcp-sdk-go/config".HCPConfig value in return statement: *mockHCPCfg does not implement "github.com/hashicorp/hcp-sdk-go/config".HCPConfig (missing method Logout)

Solution: update the mock to have the missing Logout method

* From upgrade: Lint: remove usage of deprecated req.ServerState.TLS

Due to upgrade, linting is erroring due to usage of a newly deprecated field

22:47:56 [consul]: make lint
--> Running golangci-lint (.)
agent/hcp/testing.go:157:24: SA1019: req.ServerState.TLS is deprecated: use server_tls.internal_rpc instead. (staticcheck)
                time.Until(time.Time(req.ServerState.TLS.CertExpiry)).Hours()/24,
                                     ^

* From upgrade: adjust oidc error message

From the upgrade, this test started failing:

=== FAIL: internal/go-sso/oidcauth TestOIDC_ClaimsFromAuthCode/failed_code_exchange (re-run 2) (0.01s)
    oidc_test.go:393: unexpected error: Provider login failed: Error exchanging oidc code: oauth2: "invalid_grant" "unexpected auth code"

Prior to the upgrade, the error returned was:
```
Provider login failed: Error exchanging oidc code: oauth2: cannot fetch token: 401 Unauthorized\nResponse: {\"error\":\"invalid_grant\",\"error_description\":\"unexpected auth code\"}\n
```

Now the error returned is as below and does not contain "cannot fetch token"
```
Provider login failed: Error exchanging oidc code: oauth2: "invalid_grant" "unexpected auth code"

```

* Update AgentPushServerState structs with new fields

HCP-side changes for the new fields are in:
https://github.com/hashicorp/cloud-global-network-manager-service/pull/1195/files

* Minor refactor for hcpServerStatus to abstract tlsInfo into struct

This will make it easier to set the same tls-info information to both
 - status.TLS (deprecated field)
 - status.ServerTLSMetadata (new field to use instead)

* Update hcpServerStatus to parse out information for new fields

Changes:
 - Improve error message and handling (encountered some issues and was confused)
 - Set new field TLSInfo.CertIssuer
 - Collect certificate authority metadata and set on TLSInfo.CertificateAuthorities
 - Set TLSInfo on both server.TLS and server.ServerTLSMetadata.InternalRPC

* Update serverStatusToHCP to convert new fields to GNM rpc

* Add changelog

* Feedback: connect.ParseCert, caCerts

* Feedback: refactor and unit test server status

* Feedback: test to use expected struct

* Feedback: certificate with intermediate

* Feedback: catch no leaf, remove expectedErr

* Feedback: update todos with jira ticket

* Feedback: mock tlsConfigurator

* make proto for additional file in 1.17 not in main
2023-12-04 15:34:24 -05:00
.changelog Manual Backport of [Cloud][CC-6925] Updates to pushing server state into release/1.17.x (#19810) 2023-12-04 15:34:24 -05:00
.github Pin lint-consul-retry to version 1.3.0 (#19776) 2023-11-29 21:39:32 +00:00
.release OSS -> CE (community edition) changes (#18517) 2023-08-22 09:46:03 -05:00
acl Backport of acls,catalog,mesh: properly authorize workload selectors on writes into release/1.17.x (#19296) 2023-10-19 17:28:03 +00:00
agent Manual Backport of [Cloud][CC-6925] Updates to pushing server state into release/1.17.x (#19810) 2023-12-04 15:34:24 -05:00
api Backport of [NET-6249] Add templated policies description into release/1.17.x (#19736) 2023-11-27 16:43:14 -05:00
bench
build-support Pin lint-consul-retry to version 1.3.0 (#19776) 2023-11-29 21:39:32 +00:00
command Backport of [NET-6249] Add templated policies description into release/1.17.x (#19736) 2023-11-27 16:43:14 -05:00
connect [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
contributing Move contributing to docs 2021-08-30 16:17:09 -04:00
docs resource: allow for the ACLs.Read hook to request the entire data payload to perform the authz check (#18925) 2023-09-22 09:53:55 -05:00
envoyextensions Backport `1.17.x` - build: dependency updates for 1.17.0 (#19455) 2023-11-03 11:44:34 -04:00
grafana grafana: fix a query metrics from ent and add consul version (#18998) 2023-09-25 12:41:13 -04:00
internal Manual Backport of [Cloud][CC-6925] Updates to pushing server state into release/1.17.x (#19810) 2023-12-04 15:34:24 -05:00
ipaddr [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
lib OSS -> CE (community edition) changes (#18517) 2023-08-22 09:46:03 -05:00
logging Remove old build tags (#19128) 2023-10-10 10:58:06 -04:00
proto Manual Backport of [Cloud][CC-6925] Updates to pushing server state into release/1.17.x (#19810) 2023-12-04 15:34:24 -05:00
proto-public Manual Backport of [Cloud][CC-6925] Updates to pushing server state into release/1.17.x (#19810) 2023-12-04 15:34:24 -05:00
sdk Backport of [NET-5944] security: Update Go version to 1.20.10 and `x/net` to 0.17.0 into release/1.17.x (#19235) 2023-10-16 22:09:58 +00:00
sentinel Remove old build tags (#19128) 2023-10-10 10:58:06 -04:00
service_os Remove old build tags (#19128) 2023-10-10 10:58:06 -04:00
snapshot [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
test Manual Backport of [Cloud][CC-6925] Updates to pushing server state into release/1.17.x (#19810) 2023-12-04 15:34:24 -05:00
test-integ Backport of integ-test: fix upgrade test for CE into release/1.17.x (#19676) 2023-11-17 13:38:10 -05:00
testing/deployer Backport of Integ test (test/deployer): upgrade test with service mesh into release/1.17.x (#19659) 2023-11-16 14:13:33 -05:00
testrpc [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
tlsutil Manual Backport of [Cloud][CC-6925] Updates to pushing server state into release/1.17.x (#19810) 2023-12-04 15:34:24 -05:00
tools/internal-grpc-proxy [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
troubleshoot Backport `1.17.x` - build: dependency updates for 1.17.0 (#19455) 2023-11-03 11:44:34 -04:00
types [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
ui [NET-5688] APIGateway UI Topology Fixes (#19657) (#19765) 2023-11-29 11:23:52 -05:00
version Backport of test: add test helper to detect if the current build is enterprise into release/1.17.x (#19612) 2023-11-13 17:12:25 +00:00
website Backport of docs: improvements to v2 catalog explanation into release/1.17.x (#19802) 2023-12-01 14:57:02 -08:00
.copywrite.hcl Move ACL templated policies to hcl files (#18853) 2023-09-18 17:10:35 -04:00
.dockerignore Update the scripting 2018-06-14 21:42:47 -04:00
.gitignore add peering_commontopo tests [NET-3700] (#17951) 2023-07-18 16:41:30 -07:00
.golangci.yml dataplane: Allow getting bootstrap parameters when using V2 APIs (#18504) 2023-09-06 16:46:25 -06:00
CHANGELOG.md Backport `1.17.x` - build: dependency updates for 1.17.0 (#19455) 2023-11-03 11:44:34 -04:00
Dockerfile [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
Dockerfile-windows Envoy Integration Test Windows (#18007) 2023-07-21 20:26:00 +05:30
LICENSE LICENSE: manual backport of #19750 (#19759) 2023-11-28 20:44:28 +00:00
Makefile Pin lint-consul-retry to version 1.3.0 (#19776) 2023-11-29 21:39:32 +00:00
README.md README - re-order badges and update hub link (#18498) 2023-08-16 18:41:43 -07:00
buf.work.yaml [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
go.mod Manual Backport of [Cloud][CC-6925] Updates to pushing server state into release/1.17.x (#19810) 2023-12-04 15:34:24 -05:00
go.sum Manual Backport of [Cloud][CC-6925] Updates to pushing server state into release/1.17.x (#19810) 2023-12-04 15:34:24 -05:00
main.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00

README.md

Consul logo Consul

License: BUSL-1.1 Docker Pulls Go Report Card

Consul is a distributed, highly available, and data center aware solution to connect and configure applications across dynamic, distributed infrastructure.

Consul provides several key features:

  • Multi-Datacenter - Consul is built to be datacenter aware, and can support any number of regions without complex configuration.

  • Service Mesh - Consul Service Mesh enables secure service-to-service communication with automatic TLS encryption and identity-based authorization. Applications can use sidecar proxies in a service mesh configuration to establish TLS connections for inbound and outbound connections with Transparent Proxy.

  • Service Discovery - Consul makes it simple for services to register themselves and to discover other services via a DNS or HTTP interface. External services such as SaaS providers can be registered as well.

  • Health Checking - Health Checking enables Consul to quickly alert operators about any issues in a cluster. The integration with service discovery prevents routing traffic to unhealthy hosts and enables service level circuit breakers.

  • Dynamic App Configuration - An HTTP API that allows users to store indexed objects within Consul, for storing configuration parameters and application metadata.

Consul runs on Linux, macOS, FreeBSD, Solaris, and Windows and includes an optional browser based UI. A commercial version called Consul Enterprise is also available.

Please note: We take Consul's security and our users' trust very seriously. If you believe you have found a security issue in Consul, please responsibly disclose by contacting us at security@hashicorp.com.

Quick Start

A few quick start guides are available on the Consul website:

Documentation

Full, comprehensive documentation is available on the Consul website: https://consul.io/docs

Contributing

Thank you for your interest in contributing! Please refer to CONTRIBUTING.md for guidance. For contributions specifically to the browser based UI, please refer to the UI's README.md for guidance.