Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FIPS to dataplane features #17522

Merged
merged 1 commit into from
May 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

external "github.com/hashicorp/consul/agent/grpc-external"
"github.com/hashicorp/consul/proto-public/pbdataplane"
"github.com/hashicorp/consul/version"
)

func (s *Server) GetSupportedDataplaneFeatures(ctx context.Context, req *pbdataplane.GetSupportedDataplaneFeaturesRequest) (*pbdataplane.GetSupportedDataplaneFeaturesResponse, error) {
Expand Down Expand Up @@ -40,6 +41,10 @@ func (s *Server) GetSupportedDataplaneFeatures(ctx context.Context, req *pbdatap
FeatureName: pbdataplane.DataplaneFeatures_DATAPLANE_FEATURES_ENVOY_BOOTSTRAP_CONFIGURATION,
Supported: true,
},
{
FeatureName: pbdataplane.DataplaneFeatures_DATAPLANE_FEATURES_FIPS,
Supported: version.IsFIPS(),
},
}

return &pbdataplane.GetSupportedDataplaneFeaturesResponse{SupportedDataplaneFeatures: supportedFeatures}, nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func TestSupportedDataplaneFeatures_Success(t *testing.T) {
client := testClient(t, server)
resp, err := client.GetSupportedDataplaneFeatures(ctx, &pbdataplane.GetSupportedDataplaneFeaturesRequest{})
require.NoError(t, err)
require.Equal(t, 3, len(resp.SupportedDataplaneFeatures))
require.Equal(t, 4, len(resp.SupportedDataplaneFeatures))

for _, feature := range resp.SupportedDataplaneFeatures {
switch feature.GetFeatureName() {
Expand Down Expand Up @@ -72,7 +72,7 @@ func TestSupportedDataplaneFeatures_ACLsDisabled(t *testing.T) {
client := testClient(t, server)
resp, err := client.GetSupportedDataplaneFeatures(ctx, &pbdataplane.GetSupportedDataplaneFeaturesRequest{})
require.NoError(t, err)
require.Equal(t, 3, len(resp.SupportedDataplaneFeatures))
require.Equal(t, 4, len(resp.SupportedDataplaneFeatures))
}

func TestSupportedDataplaneFeatures_InvalidACLToken(t *testing.T) {
Expand Down
107 changes: 56 additions & 51 deletions proto-public/pbdataplane/dataplane.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions proto-public/pbdataplane/dataplane.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ enum DataplaneFeatures {
DATAPLANE_FEATURES_WATCH_SERVERS = 1;
DATAPLANE_FEATURES_EDGE_CERTIFICATE_MANAGEMENT = 2;
DATAPLANE_FEATURES_ENVOY_BOOTSTRAP_CONFIGURATION = 3;
DATAPLANE_FEATURES_FIPS = 4;
}

message DataplaneFeatureSupport {
Expand Down