Skip to content

Commit

Permalink
add FIPS to dataplane features
Browse files Browse the repository at this point in the history
  • Loading branch information
skpratt committed May 31, 2023
1 parent fdda7ad commit 3db4522
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 53 deletions.
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

0 comments on commit 3db4522

Please sign in to comment.