open-consul/agent
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
..
ae copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
auto-config [BACKPORT] 1.16.x manual backport of OSS->CE branch (#18549) 2023-08-23 11:53:44 -05:00
blockingquery [OSS] gRPC Blocking Queries (#17426) 2023-05-23 17:29:10 -04:00
cache Revert "cache: refactor agent cache fetching to prevent unnecessary f… (#16818) (#17046) 2023-04-19 13:17:21 -05:00
cache-types Backport of agent: remove agent cache dependency from service mesh leaf certificate management into release/1.16.x (#17704) 2023-06-13 16:12:43 +00:00
checks Manual Backport of Add TCP+TLS Healthchecks into release/1.16.x (#18678) 2023-09-05 14:13:59 -07:00
config Backport of Add grpc keepalive configuration into release/1.16.x (#19339) (#19346) 2023-10-24 08:52:05 -05:00
configentry backport of commit fe5c145cddd89da804d0de7d19bdc5d0d276df3b (#18010) 2023-07-05 14:50:59 +00:00
connect [1.16.x] Vault CA bugfixes (#19285) (#19336) 2023-10-23 14:14:05 +00:00
consul 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
debug copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
dns copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
envoyextensions backport of commit c0afba3a0c2ae093fee756a9019d49db25367d69 (#17975) 2023-06-30 14:20:50 +00:00
exec copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
grpc-external Backport of Add grpc keepalive configuration into release/1.16.x (#19339) (#19346) 2023-10-24 08:52:05 -05:00
grpc-internal Backport of bump testcontainers-go to 0.22.0 into release/1.16.x (#18417) 2023-08-09 13:04:32 -04:00
grpc-middleware 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
hcp 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
leafcert Backport of agent: remove agent cache dependency from service mesh leaf certificate management into release/1.16.x (#17704) 2023-06-13 16:12:43 +00:00
local Backport of bug: prevent go routine leakage due to existing DeferCheck into release/1.16.x (#18565) 2023-08-23 15:04:19 +00:00
log-drop copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
metadata add necessary plumbing to implement per server ip based rate limiting (#17436) 2023-05-23 15:37:01 -04:00
metrics copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
mock copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
pool Backport of [NET-6459] Fix issue with wanfed lan ip conflicts. into release/1.16.x (#19522) 2023-11-06 15:14:59 +00:00
proxycfg Backport of Allow connections through Terminating Gateways from peered clusters NET-3463 into release/1.16.x (#19092) 2023-10-05 22:38:57 +00:00
proxycfg-glue Backport of Add extra logging for mesh health endpoints. into release/1.16.x (#18648) 2023-09-01 17:44:37 +00:00
proxycfg-sources copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
router copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
routine-leak-checker copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
rpc Backport of Add grpc keepalive configuration into release/1.16.x (#19339) (#19346) 2023-10-24 08:52:05 -05:00
rpcclient [BACKPORT] 1.16.x manual backport of OSS->CE branch (#18549) 2023-08-23 11:53:44 -05:00
structs [NET-5688] APIGateway UI Topology Fixes (#19657) Backport (#19763) 2023-11-29 11:22:56 -05:00
submatview * added Sameness Group to proto files (#16998) 2023-04-14 09:24:46 -07:00
systemd copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
token [BACKPORT] 1.16.x manual backport of OSS->CE branch (#18549) 2023-08-23 11:53:44 -05:00
uiserver [NET-5688] APIGateway UI Topology Fixes (#19657) Backport (#19763) 2023-11-29 11:22:56 -05:00
xds Backport of Golden File Tests for TermGW w/ Cluster Peering into release/1.16.x (#19192) 2023-10-30 11:04:47 -04:00
acl.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
acl_ce.go [BACKPORT] 1.16.x manual backport of OSS->CE branch (#18549) 2023-08-23 11:53:44 -05:00
acl_endpoint.go [NET-5399] Add support for querying tokens by service name. (#18689) 2023-09-06 13:16:27 -05:00
acl_endpoint_test.go [NET-5399] Add support for querying tokens by service name. (#18689) 2023-09-06 13:16:27 -05:00
acl_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
agent.go Backport of Add grpc keepalive configuration into release/1.16.x (#19339) (#19346) 2023-10-24 08:52:05 -05:00
agent_ce.go [BACKPORT] 1.16.x manual backport of OSS->CE branch (#18549) 2023-08-23 11:53:44 -05:00
agent_ce_test.go [BACKPORT] 1.16.x manual backport of OSS->CE branch (#18549) 2023-08-23 11:53:44 -05:00
agent_endpoint.go Backport of member cli: add -filter expression to flags into release/1.16.x (#18276) 2023-07-25 14:57:08 -04:00
agent_endpoint_ce.go [BACKPORT] 1.16.x manual backport of OSS->CE branch (#18549) 2023-08-23 11:53:44 -05:00
agent_endpoint_ce_test.go [BACKPORT] 1.16.x manual backport of OSS->CE branch (#18549) 2023-08-23 11:53:44 -05:00
agent_endpoint_test.go Backport of Remove flaky test assertions into release/1.16.x (#18871) 2023-09-18 23:10:50 +00:00
agent_test.go Manual Backport of Add TCP+TLS Healthchecks into release/1.16.x (#18678) 2023-09-05 14:13:59 -07:00
apiserver.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
apiserver_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
catalog_endpoint.go Add /v1/internal/service-virtual-ip for manually setting service VIPs (#17294) 2023-05-12 00:38:52 +00:00
catalog_endpoint_ce.go [BACKPORT] 1.16.x manual backport of OSS->CE branch (#18549) 2023-08-23 11:53:44 -05:00
catalog_endpoint_test.go Add /v1/internal/service-virtual-ip for manually setting service VIPs (#17294) 2023-05-12 00:38:52 +00:00
check.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
config_endpoint.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
config_endpoint_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
connect_auth.go Add sameness groups to service intentions. (#17064) 2023-04-20 12:16:04 -04:00
connect_ca_endpoint.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
connect_ca_endpoint_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
coordinate_endpoint.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
coordinate_endpoint_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
delegate_mock_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
denylist.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
denylist_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
discovery_chain_endpoint.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
discovery_chain_endpoint_test.go Attach service virtual IP info to compiled discovery chain (#17295) 2023-05-12 02:28:16 +00:00
dns.go Fix a bug that wrongly trims domains when there is an overlap with DC 1.16.x (#18164) 2023-07-18 10:03:41 -04:00
dns_ce.go [BACKPORT] 1.16.x manual backport of OSS->CE branch (#18549) 2023-08-23 11:53:44 -05:00
dns_ce_test.go [BACKPORT] 1.16.x manual backport of OSS->CE branch (#18549) 2023-08-23 11:53:44 -05:00
dns_test.go Fix a bug that wrongly trims domains when there is an overlap with DC 1.16.x (#18164) 2023-07-18 10:03:41 -04:00
enterprise_delegate_ce.go [BACKPORT] 1.16.x manual backport of OSS->CE branch (#18549) 2023-08-23 11:53:44 -05:00
event_endpoint.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
event_endpoint_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
federation_state_endpoint.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
health_endpoint.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
health_endpoint_test.go Backport of Remove flaky test assertions into release/1.16.x (#18871) 2023-09-18 23:10:50 +00:00
http.go Backport of feature - [NET - 4005] - [Supportability] Reloadable Configuration - enable_debug into release/1.16.x (#17969) 2023-06-30 18:40:20 +05:30
http_ce.go [BACKPORT] 1.16.x manual backport of OSS->CE branch (#18549) 2023-08-23 11:53:44 -05:00
http_ce_test.go [BACKPORT] 1.16.x manual backport of OSS->CE branch (#18549) 2023-08-23 11:53:44 -05:00
http_decode_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
http_register.go Add version endpoint (#17506) 2023-05-30 17:25:48 -05:00
http_test.go Backport of feature - [NET - 4005] - [Supportability] Reloadable Configuration - enable_debug into release/1.16.x (#17969) 2023-06-30 18:40:20 +05:30
intentions_endpoint.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
intentions_endpoint_ce_test.go [BACKPORT] 1.16.x manual backport of OSS->CE branch (#18549) 2023-08-23 11:53:44 -05:00
intentions_endpoint_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
keyring.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
keyring_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
kvs_endpoint.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
kvs_endpoint_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
metrics.go log warning about certificate expiring sooner and with more details 2023-04-07 20:38:07 +00:00
metrics_test.go Backport of Fix more test flakes into release/1.16.x (#19545) 2023-11-07 10:46:58 -06:00
nodeid.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
nodeid_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
notify.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
notify_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
operator_endpoint.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
operator_endpoint_ce.go [BACKPORT] 1.16.x manual backport of OSS->CE branch (#18549) 2023-08-23 11:53:44 -05:00
operator_endpoint_ce_test.go [BACKPORT] 1.16.x manual backport of OSS->CE branch (#18549) 2023-08-23 11:53:44 -05:00
operator_endpoint_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
peering_endpoint.go [BACKPORT] 1.16.x manual backport of OSS->CE branch (#18549) 2023-08-23 11:53:44 -05:00
peering_endpoint_ce_test.go [BACKPORT] 1.16.x manual backport of OSS->CE branch (#18549) 2023-08-23 11:53:44 -05:00
peering_endpoint_test.go [OSS] gRPC Blocking Queries (#17426) 2023-05-23 17:29:10 -04:00
prepared_query_endpoint.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
prepared_query_endpoint_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
proxycfg_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
reload.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
remote_exec.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
remote_exec_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
retry_join.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
retry_join_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
service_checks_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
service_manager.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
service_manager_test.go Remove deprecated service-defaults upstream behavior. (#16957) 2023-04-11 10:20:33 -05:00
session_endpoint.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
session_endpoint_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
setup.go [BACKPORT] 1.16.x manual backport of OSS->CE branch (#18549) 2023-08-23 11:53:44 -05:00
setup_ce.go [BACKPORT] 1.16.x manual backport of OSS->CE branch (#18549) 2023-08-23 11:53:44 -05:00
sidecar_service.go Backport of [NET-5217] [OSS] Derive sidecar proxy locality from parent service into release/1.16.x (#18438) 2023-08-10 18:47:38 +00:00
sidecar_service_test.go Backport of [NET-5217] [OSS] Derive sidecar proxy locality from parent service into release/1.16.x (#18438) 2023-08-10 18:47:38 +00:00
signal_unix.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
signal_windows.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
snapshot_endpoint.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
snapshot_endpoint_test.go Backport of Fix more test flakes into release/1.16.x (#19545) 2023-11-07 10:46:58 -06:00
status_endpoint.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
status_endpoint_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
streaming_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
testagent.go Revert "cache: refactor agent cache fetching to prevent unnecessary f… (#16818) (#17046) 2023-04-19 13:17:21 -05:00
testagent_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
translate_addr.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
txn_endpoint.go Manual Backport of Add TCP+TLS Healthchecks into release/1.16.x (#18678) 2023-09-05 14:13:59 -07:00
txn_endpoint_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
ui_endpoint.go [NET-5688] APIGateway UI Topology Fixes (#19657) Backport (#19763) 2023-11-29 11:22:56 -05:00
ui_endpoint_ce_test.go [BACKPORT] 1.16.x manual backport of OSS->CE branch (#18549) 2023-08-23 11:53:44 -05:00
ui_endpoint_test.go [BACKPORT] 1.16.x manual backport of OSS->CE branch (#18549) 2023-08-23 11:53:44 -05:00
user_event.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
user_event_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
util.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
util_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
watch_handler.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
watch_handler_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00