Skip to content

Commit

Permalink
formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nb-goog committed Sep 23, 2024
1 parent 30a7dc6 commit 30f2011
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
14 changes: 14 additions & 0 deletions mockgcp/apis/mockgcp/cloud/kms/v1/service.proto
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto2";
package mockgcp.cloud.kms.v1;
import "google/api/annotations.proto";
Expand Down
7 changes: 3 additions & 4 deletions mockgcp/mockkms/autokeyconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ func (r *autokeyAdminServer) ShowEffectiveAutokeyConfig(ctx context.Context, req
}

type autokeyConfigName struct {
folder string
folder string
}

func (a *autokeyConfigName) String() string {
return "folders/" + a.folder + "/autokeyConfig";
return "folders/" + a.folder + "/autokeyConfig"
}

// parseAutokeyConfigName parses a string into an AutoKeyConfig name.
// The expected form is `folders/{FOLDER_NUMBER}/autokeyConfig`.
// The expected form is `folders/{FOLDER_NUMBER}/autokeyConfig`.
func (r *autokeyAdminServer) parseAutokeyConfigName(name string) (*autokeyConfigName, error) {
tokens := strings.Split(name, "/")
if len(tokens) == 3 && tokens[0] == "folders" && tokens[2] == "autokeyConfig" {
Expand All @@ -104,4 +104,3 @@ func (r *autokeyAdminServer) parseAutokeyConfigName(name string) (*autokeyConfig

return nil, status.Errorf(codes.InvalidArgument, "name %q is not valid", name)
}

2 changes: 1 addition & 1 deletion mockgcp/mockkms/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (s *MockService) ExpectedHosts() []string {

func (s *MockService) Register(grpcServer *grpc.Server) {
pb.RegisterKeyManagementServiceServer(grpcServer, &kmsServer{MockService: s})
pb.RegisterAutokeyAdminServer(grpcServer, &autokeyAdminServer{MockService: s})
pb.RegisterAutokeyAdminServer(grpcServer, &autokeyAdminServer{MockService: s})
}

func (s *MockService) NewHTTPMux(ctx context.Context, conn *grpc.ClientConn) (http.Handler, error) {
Expand Down

0 comments on commit 30f2011

Please sign in to comment.