Go to file
lornasong fa9de6f8b4
Manual Backport of [Cloud][CC-6925] Updates to pushing server state into release/1.16.x (#19818)
* [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

* Run make proto for files in 1.16 not in main

* update licensing per 1.16 licensing
2023-12-06 13:35:03 -05:00
.changelog Manual Backport of [Cloud][CC-6925] Updates to pushing server state into release/1.16.x (#19818) 2023-12-06 13:35:03 -05:00
.github Pin lint-consul-retry to v1.3.0 (#19777) 2023-11-29 21:37:51 +00:00
.release [BACKPORT] 1.16.x manual backport of OSS->CE branch (#18549) 2023-08-23 11:53:44 -05:00
acl [BACKPORT] 1.16.x manual backport of OSS->CE branch (#18549) 2023-08-23 11:53:44 -05:00
agent Manual Backport of [Cloud][CC-6925] Updates to pushing server state into release/1.16.x (#19818) 2023-12-06 13:35:03 -05:00
api Backport of fix: allow snake case keys for ip based rate limit config entry into release/1.16.x (#19292) 2023-10-19 16:28:53 +00: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 (#19777) 2023-11-29 21:37:51 +00:00
command NET-3860 - [Supportability] consul troubleshoot CLI for verifying ports (#19836) 2023-12-06 15:27:26 +05:30
connect Copyright headers for missing files/folders (#16708) 2023-03-28 18:48:58 -04:00
contributing Move contributing to docs 2021-08-30 16:17:09 -04:00
docs [BACKPORT] 1.16.x manual backport of OSS->CE branch (#18549) 2023-08-23 11:53:44 -05:00
envoyextensions release/1.16.x - Update supported Envoy versions (#19273) 2023-10-19 14:45:33 -07:00
grafana add readme outlining how to edit and publish 2021-01-12 14:47:11 -08:00
internal Manual Backport of [Cloud][CC-6925] Updates to pushing server state into release/1.16.x (#19818) 2023-12-06 13:35:03 -05:00
ipaddr Copyright headers for missing files/folders (#16708) 2023-03-28 18:48:58 -04:00
lib [BACKPORT] 1.16.x manual backport of OSS->CE branch (#18549) 2023-08-23 11:53:44 -05:00
logging Backport of Net 3181 consul gh issue 15709 allow log file naming like nomad - fix bug into release/1.16.x (#18642) 2023-09-04 17:09:59 +05:30
proto Manual Backport of [Cloud][CC-6925] Updates to pushing server state into release/1.16.x (#19818) 2023-12-06 13:35:03 -05:00
proto-public Manual Backport of [Cloud][CC-6925] Updates to pushing server state into release/1.16.x (#19818) 2023-12-06 13:35:03 -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.16.x (#19234) 2023-10-17 00:12:24 +00:00
sentinel [BACKPORT] 1.16.x manual backport of OSS->CE branch (#18549) 2023-08-23 11:53:44 -05:00
service_os Copyright headers for missing files/folders (#16708) 2023-03-28 18:48:58 -04:00
snapshot snapshot: some improvments to the snapshot process (#17236) 2023-05-09 15:28:52 -04:00
test Manual Backport of [Cloud][CC-6925] Updates to pushing server state into release/1.16.x (#19818) 2023-12-06 13:35:03 -05:00
testrpc Copyright headers for missing files/folders (#16708) 2023-03-28 18:48:58 -04:00
tlsutil Manual Backport of [Cloud][CC-6925] Updates to pushing server state into release/1.16.x (#19818) 2023-12-06 13:35:03 -05:00
tools/internal-grpc-proxy Copyright headers for missing files/folders (#16708) 2023-03-28 18:48:58 -04:00
troubleshoot NET-3860 - [Supportability] consul troubleshoot CLI for verifying ports (#19836) 2023-12-06 15:27:26 +05:30
types Copyright headers for missing files/folders (#16708) 2023-03-28 18:48:58 -04:00
ui [NET-5688] APIGateway UI Topology Fixes (#19657) Backport (#19763) 2023-11-29 11:22:56 -05:00
version Add changelog and put back replace statements (#18914) 2023-09-20 15:53:23 +00:00
website NET-3860 - [Supportability] consul troubleshoot CLI for verifying ports (#19836) 2023-12-06 15:27:26 +05:30
.copywrite.hcl Remove UI brand-loader copyright headers as they do not render appropriately (#16835) 2023-03-31 11:29:19 -04:00
.dockerignore Update the scripting 2018-06-14 21:42:47 -04:00
.gitattributes Initial commit 2013-11-04 14:15:27 -08:00
.gitignore Various bits of cleanup detected when using Go Workspaces (#17462) 2023-06-05 16:08:39 -04:00
.golangci.yml [BACKPORT] 1.16.x manual backport of OSS->CE branch (#18549) 2023-08-23 11:53:44 -05:00
CHANGELOG.md Add changelog and put back replace statements (#18914) 2023-09-20 15:53:23 +00:00
Dockerfile Backport of Bump Alpine to 3.18 into release/1.16.x (#17725) 2023-06-14 01:17:02 +00:00
GNUmakefile Pin lint-consul-retry to v1.3.0 (#19777) 2023-11-29 21:37:51 +00:00
LICENSE [COMPLIANCE] Update MPL-2.0 LICENSE (#14964) 2022-11-09 12:24:14 -06:00
NOTICE.md add copyright notice file 2018-07-09 10:58:26 -07:00
README.md manual backport of #18301 (#18497) 2023-08-17 02:22:48 +00:00
buf.work.yaml Copyright headers for missing files/folders (#16708) 2023-03-28 18:48:58 -04:00
fixup_acl_move.sh Copyright headers for missing files/folders (#16708) 2023-03-28 18:48:58 -04:00
go.mod Manual Backport of [Cloud][CC-6925] Updates to pushing server state into release/1.16.x (#19818) 2023-12-06 13:35:03 -05:00
go.sum Manual Backport of [Cloud][CC-6925] Updates to pushing server state into release/1.16.x (#19818) 2023-12-06 13:35:03 -05:00
main.go Copyright headers for missing files/folders (#16708) 2023-03-28 18:48:58 -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, like configuration parameters and application metadata, within Consul.

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.