Consul is a distributed, highly available, and data center aware solution to connect and configure applications across dynamic, distributed infrastructure. https://www.consul.io
Go to file
lornasong edf4610ed9
[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
2023-12-04 10:25:18 -05:00
.changelog [Cloud][CC-6925] Updates to pushing server state (#19682) 2023-12-04 10:25:18 -05:00
.github NET-6692: Ensure 'upload test results' step is always run (#19783) 2023-12-01 09:23:25 +05:30
.release OSS -> CE (community edition) changes (#18517) 2023-08-22 09:46:03 -05:00
acl [NET-6640] Adds "Policy" BindType to BindingRule (#19499) 2023-11-20 13:11:08 +00:00
agent [Cloud][CC-6925] Updates to pushing server state (#19682) 2023-12-04 10:25:18 -05:00
api [NET-6249] Add templated policies description (#19735) 2023-11-27 10:34:22 -05:00
bench Gets benchmarks running again and does a rough pass for 0.7.1. 2016-11-29 13:02:26 -08:00
build-support Pin lint-consul-retry to v1.3.0 (#19781) 2023-11-29 22:44:22 +00:00
command grpc client default in plaintext mode (#19412) 2023-11-28 10:58:57 -08: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 Add engineering docs for controllers and v2 architecture (#19671) 2023-11-17 17:55:09 -07:00
envoyextensions build: dependency updates for 1.17.0 (#19453) 2023-11-03 12:29:59 -04:00
grafana grafana: fix a query metrics from ent and add consul version (#18998) 2023-09-25 12:41:13 -04:00
internal [Cloud][CC-6925] Updates to pushing server state (#19682) 2023-12-04 10:25:18 -05:00
ipaddr [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
lib add DeliverLatest as common function for use by Manager and ProxyTracker Open (#19564) 2023-11-07 23:03:37 +00:00
logging unhack: fix broken `make lint` on macbooks (#19611) 2023-11-13 11:19:50 -06:00
proto [Cloud][CC-6925] Updates to pushing server state (#19682) 2023-12-04 10:25:18 -05:00
proto-public [Cloud][CC-6925] Updates to pushing server state (#19682) 2023-12-04 10:25:18 -05:00
sdk [SECVULN-1533] chore: Clarify iptables Provider interface docs (#19704) 2023-11-21 09:01:48 -05: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 [Cloud][CC-6925] Updates to pushing server state (#19682) 2023-12-04 10:25:18 -05:00
test-integ resource: add v2tenancy feature flag to deployer tests (#19774) 2023-11-30 11:41:30 -06:00
testing/deployer added node health resource (#19803) 2023-12-02 11:14:03 +05:30
testrpc [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
tlsutil [Cloud][CC-6925] Updates to pushing server state (#19682) 2023-12-04 10:25:18 -05:00
tools/internal-grpc-proxy [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
troubleshoot build: dependency updates for 1.17.0 (#19453) 2023-11-03 12:29:59 -04:00
types [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
ui [NET-5688] APIGateway UI Topology Fixes (#19657) 2023-11-28 21:27:14 +00:00
version test: add test helper to detect if the current build is enterprise (#19201) 2023-11-13 10:30:07 -06:00
website docs: improvements to v2 catalog explanation (#19678) 2023-12-01 14:35:44 -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
.pre-commit-config.yaml unhack: add pre-commit guidelines (#19617) 2023-11-15 10:57:40 -06:00
CHANGELOG.md build: dependency updates for 1.17.0 (#19453) 2023-11-03 12:29:59 -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 file updates (#19750) 2023-11-28 11:59:45 -08:00
Makefile Pin lint-consul-retry to v1.3.0 (#19781) 2023-11-29 22:44:22 +00:00
README.md Update README.md (#19413) 2023-10-31 08:45:47 -07:00
buf.work.yaml [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
go.mod [Cloud][CC-6925] Updates to pushing server state (#19682) 2023-12-04 10:25:18 -05:00
go.sum [Cloud][CC-6925] Updates to pushing server state (#19682) 2023-12-04 10:25:18 -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.

  • API Gateway - Consul API Gateway manages access to services within Consul Service Mesh, allow users to define traffic and authorization policies to services deployed within the mesh.

  • 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.