consul/proto-public/pbmesh/v2beta1
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
..
pbproxystate 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
common.pb.binary.go catalog,mesh,auth: Bump versions to v2beta1 (#18930) 2023-09-22 10:51:15 -06:00
common.pb.go 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
common.proto Create DeepCopy() and Json Marshal/Unmarshal for proto-public (#19015) 2023-10-13 14:55:58 +00:00
common_deepcopy.gen.go Backport of Clone proto into deepcopy correctly into release/1.17.x (#19207) 2023-10-13 22:07:49 +00:00
common_json.gen.go Create DeepCopy() and Json Marshal/Unmarshal for proto-public (#19015) 2023-10-13 14:55:58 +00:00
computed_explicit_destinations.pb.binary.go mesh: add computed destinations with a controller that computes them (#19067) 2023-10-12 12:04:12 -06:00
computed_explicit_destinations.pb.go 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
computed_explicit_destinations.proto mesh: add computed destinations with a controller that computes them (#19067) 2023-10-12 12:04:12 -06:00
computed_explicit_destinations_deepcopy.gen.go Backport of Clone proto into deepcopy correctly into release/1.17.x (#19207) 2023-10-13 22:07:49 +00:00
computed_explicit_destinations_json.gen.go Create DeepCopy() and Json Marshal/Unmarshal for proto-public (#19015) 2023-10-13 14:55:58 +00:00
computed_proxy_configuration.pb.binary.go mesh: Add ComputedProxyConfiguration and a controller that computes it. (#19043) 2023-10-10 17:34:53 -06:00
computed_proxy_configuration.pb.go 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
computed_proxy_configuration.proto mesh: Add ComputedProxyConfiguration and a controller that computes it. (#19043) 2023-10-10 17:34:53 -06:00
computed_proxy_configuration_deepcopy.gen.go Backport of Clone proto into deepcopy correctly into release/1.17.x (#19207) 2023-10-13 22:07:49 +00:00
computed_proxy_configuration_json.gen.go Create DeepCopy() and Json Marshal/Unmarshal for proto-public (#19015) 2023-10-13 14:55:58 +00:00
computed_routes.pb.binary.go catalog,mesh,auth: Bump versions to v2beta1 (#18930) 2023-09-22 10:51:15 -06:00
computed_routes.pb.go 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
computed_routes.proto Create DeepCopy() and Json Marshal/Unmarshal for proto-public (#19015) 2023-10-13 14:55:58 +00:00
computed_routes_deepcopy.gen.go Backport of Clone proto into deepcopy correctly into release/1.17.x (#19207) 2023-10-13 22:07:49 +00:00
computed_routes_json.gen.go Create DeepCopy() and Json Marshal/Unmarshal for proto-public (#19015) 2023-10-13 14:55:58 +00:00
connection.pb.binary.go catalog,mesh,auth: Bump versions to v2beta1 (#18930) 2023-09-22 10:51:15 -06:00
connection.pb.go 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
connection.proto Backport of NET-5073 - ProxyConfiguration: implement various connection options into release/1.17.x (#19213) 2023-10-14 14:11:57 +00:00
connection_deepcopy.gen.go Backport of Clone proto into deepcopy correctly into release/1.17.x (#19207) 2023-10-13 22:07:49 +00:00
connection_json.gen.go Create DeepCopy() and Json Marshal/Unmarshal for proto-public (#19015) 2023-10-13 14:55:58 +00:00
destination_policy.pb.binary.go catalog,mesh,auth: Bump versions to v2beta1 (#18930) 2023-09-22 10:51:15 -06:00
destination_policy.pb.go 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
destination_policy.proto Create DeepCopy() and Json Marshal/Unmarshal for proto-public (#19015) 2023-10-13 14:55:58 +00:00
destination_policy_deepcopy.gen.go Backport of Clone proto into deepcopy correctly into release/1.17.x (#19207) 2023-10-13 22:07:49 +00:00
destination_policy_json.gen.go Create DeepCopy() and Json Marshal/Unmarshal for proto-public (#19015) 2023-10-13 14:55:58 +00:00
destinations.pb.binary.go mesh: rename Upstreams and UpstreamsConfiguration to Destinations* (#18995) 2023-09-25 12:03:45 -06:00
destinations.pb.go 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
destinations.proto Create DeepCopy() and Json Marshal/Unmarshal for proto-public (#19015) 2023-10-13 14:55:58 +00:00
destinations_configuration.pb.binary.go mesh: rename Upstreams and UpstreamsConfiguration to Destinations* (#18995) 2023-09-25 12:03:45 -06:00
destinations_configuration.pb.go 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
destinations_configuration.proto Create DeepCopy() and Json Marshal/Unmarshal for proto-public (#19015) 2023-10-13 14:55:58 +00:00
destinations_configuration_deepcopy.gen.go Backport of Clone proto into deepcopy correctly into release/1.17.x (#19207) 2023-10-13 22:07:49 +00:00
destinations_configuration_json.gen.go Create DeepCopy() and Json Marshal/Unmarshal for proto-public (#19015) 2023-10-13 14:55:58 +00:00
destinations_deepcopy.gen.go Backport of Clone proto into deepcopy correctly into release/1.17.x (#19207) 2023-10-13 22:07:49 +00:00
destinations_json.gen.go Create DeepCopy() and Json Marshal/Unmarshal for proto-public (#19015) 2023-10-13 14:55:58 +00:00
expose.pb.binary.go catalog,mesh,auth: Bump versions to v2beta1 (#18930) 2023-09-22 10:51:15 -06:00
expose.pb.go 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
expose.proto Create DeepCopy() and Json Marshal/Unmarshal for proto-public (#19015) 2023-10-13 14:55:58 +00:00
expose_deepcopy.gen.go Backport of Clone proto into deepcopy correctly into release/1.17.x (#19207) 2023-10-13 22:07:49 +00:00
expose_json.gen.go Create DeepCopy() and Json Marshal/Unmarshal for proto-public (#19015) 2023-10-13 14:55:58 +00:00
grpc_route.pb.binary.go catalog,mesh,auth: Bump versions to v2beta1 (#18930) 2023-09-22 10:51:15 -06:00
grpc_route.pb.go 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
grpc_route.proto Create DeepCopy() and Json Marshal/Unmarshal for proto-public (#19015) 2023-10-13 14:55:58 +00:00
grpc_route_deepcopy.gen.go Backport of Clone proto into deepcopy correctly into release/1.17.x (#19207) 2023-10-13 22:07:49 +00:00
grpc_route_json.gen.go Create DeepCopy() and Json Marshal/Unmarshal for proto-public (#19015) 2023-10-13 14:55:58 +00:00
http_route.pb.binary.go catalog,mesh,auth: Bump versions to v2beta1 (#18930) 2023-09-22 10:51:15 -06:00
http_route.pb.go 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
http_route.proto Create DeepCopy() and Json Marshal/Unmarshal for proto-public (#19015) 2023-10-13 14:55:58 +00:00
http_route_deepcopy.gen.go Backport of Clone proto into deepcopy correctly into release/1.17.x (#19207) 2023-10-13 22:07:49 +00:00
http_route_json.gen.go Create DeepCopy() and Json Marshal/Unmarshal for proto-public (#19015) 2023-10-13 14:55:58 +00:00
http_route_retries.pb.binary.go catalog,mesh,auth: Bump versions to v2beta1 (#18930) 2023-09-22 10:51:15 -06:00
http_route_retries.pb.go 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
http_route_retries.proto catalog,mesh,auth: Bump versions to v2beta1 (#18930) 2023-09-22 10:51:15 -06:00
http_route_retries_deepcopy.gen.go Backport of Clone proto into deepcopy correctly into release/1.17.x (#19207) 2023-10-13 22:07:49 +00:00
http_route_retries_json.gen.go Create DeepCopy() and Json Marshal/Unmarshal for proto-public (#19015) 2023-10-13 14:55:58 +00:00
http_route_timeouts.pb.binary.go catalog,mesh,auth: Bump versions to v2beta1 (#18930) 2023-09-22 10:51:15 -06:00
http_route_timeouts.pb.go 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
http_route_timeouts.proto Create DeepCopy() and Json Marshal/Unmarshal for proto-public (#19015) 2023-10-13 14:55:58 +00:00
http_route_timeouts_deepcopy.gen.go Backport of Clone proto into deepcopy correctly into release/1.17.x (#19207) 2023-10-13 22:07:49 +00:00
http_route_timeouts_json.gen.go Create DeepCopy() and Json Marshal/Unmarshal for proto-public (#19015) 2023-10-13 14:55:58 +00:00
proxy_configuration.pb.binary.go catalog,mesh,auth: Bump versions to v2beta1 (#18930) 2023-09-22 10:51:15 -06:00
proxy_configuration.pb.go 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
proxy_configuration.proto Backport of mesh: add validation hook to proxy configuration into release/1.17.x (#19209) 2023-10-13 22:16:41 +00:00
proxy_configuration_addon.go mesh: sidecar proxy controller improvements (#19083) 2023-10-12 13:20:13 -06:00
proxy_configuration_addon_test.go mesh: sidecar proxy controller improvements (#19083) 2023-10-12 13:20:13 -06:00
proxy_configuration_deepcopy.gen.go Backport of Clone proto into deepcopy correctly into release/1.17.x (#19207) 2023-10-13 22:07:49 +00:00
proxy_configuration_json.gen.go Create DeepCopy() and Json Marshal/Unmarshal for proto-public (#19015) 2023-10-13 14:55:58 +00:00
proxy_state.pb.binary.go catalog,mesh,auth: Bump versions to v2beta1 (#18930) 2023-09-22 10:51:15 -06:00
proxy_state.pb.go 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
proxy_state.proto Create DeepCopy() and Json Marshal/Unmarshal for proto-public (#19015) 2023-10-13 14:55:58 +00:00
proxy_state_deepcopy.gen.go Backport of Clone proto into deepcopy correctly into release/1.17.x (#19207) 2023-10-13 22:07:49 +00:00
proxy_state_json.gen.go Create DeepCopy() and Json Marshal/Unmarshal for proto-public (#19015) 2023-10-13 14:55:58 +00:00
resource_types.gen.go mesh: add computed destinations with a controller that computes them (#19067) 2023-10-12 12:04:12 -06:00
routing.pb.go 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
routing.proto Backport of mesh: add validation hook to proxy configuration into release/1.17.x (#19209) 2023-10-13 22:16:41 +00:00
tcp_route.pb.binary.go catalog,mesh,auth: Bump versions to v2beta1 (#18930) 2023-09-22 10:51:15 -06:00
tcp_route.pb.go 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
tcp_route.proto Create DeepCopy() and Json Marshal/Unmarshal for proto-public (#19015) 2023-10-13 14:55:58 +00:00
tcp_route_deepcopy.gen.go Backport of Clone proto into deepcopy correctly into release/1.17.x (#19207) 2023-10-13 22:07:49 +00:00
tcp_route_json.gen.go Create DeepCopy() and Json Marshal/Unmarshal for proto-public (#19015) 2023-10-13 14:55:58 +00:00
xroute_addons.go catalog,mesh,auth: Bump versions to v2beta1 (#18930) 2023-09-22 10:51:15 -06:00
xroute_addons_test.go catalog,mesh,auth: Bump versions to v2beta1 (#18930) 2023-09-22 10:51:15 -06:00