From c43418010258e945086c4ce0a1fb2abbaeb2d4e7 Mon Sep 17 00:00:00 2001 From: William Scalf Date: Mon, 12 Feb 2024 22:21:24 -0500 Subject: [PATCH] Added /api prefix to routes --- api/health/v1/health.pb.go | 2 +- api/health/v1/health_grpc.pb.go | 2 +- api/health/v1/health_http.pb.go | 2 +- api/rebac/v1/relationships.pb.go | 49 +++++++++++++------------- api/rebac/v1/relationships.proto | 6 ++-- api/rebac/v1/relationships_grpc.pb.go | 2 +- api/rebac/v1/relationships_http.pb.go | 14 ++++---- internal/conf/conf.pb.go | 2 +- openapi.yaml | 50 +++++++++++++-------------- 9 files changed, 65 insertions(+), 64 deletions(-) diff --git a/api/health/v1/health.pb.go b/api/health/v1/health.pb.go index d987969..7d96c73 100644 --- a/api/health/v1/health.pb.go +++ b/api/health/v1/health.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.32.0 -// protoc v3.21.12 +// protoc v3.12.4 // source: health/v1/health.proto package v1 diff --git a/api/health/v1/health_grpc.pb.go b/api/health/v1/health_grpc.pb.go index 5b3eceb..8ac026b 100644 --- a/api/health/v1/health_grpc.pb.go +++ b/api/health/v1/health_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v3.21.12 +// - protoc v3.12.4 // source: health/v1/health.proto package v1 diff --git a/api/health/v1/health_http.pb.go b/api/health/v1/health_http.pb.go index b533dee..96dc1db 100644 --- a/api/health/v1/health_http.pb.go +++ b/api/health/v1/health_http.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-http. DO NOT EDIT. // versions: // - protoc-gen-go-http v2.7.2 -// - protoc v3.21.12 +// - protoc v3.12.4 // source: health/v1/health.proto package v1 diff --git a/api/rebac/v1/relationships.pb.go b/api/rebac/v1/relationships.pb.go index 1c73796..6170e71 100644 --- a/api/rebac/v1/relationships.pb.go +++ b/api/rebac/v1/relationships.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.32.0 -// protoc v3.21.12 +// protoc v3.12.4 // source: rebac/v1/relationships.proto package v1 @@ -673,36 +673,37 @@ var file_rebac_v1_relationships_proto_rawDesc = []byte{ 0x6a, 0x65, 0x63, 0x74, 0x22, 0x35, 0x0a, 0x0f, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x32, 0x9a, 0x03, 0x0a, 0x0d, - 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x12, 0x85, 0x01, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x32, 0xa7, 0x03, 0x0a, 0x0d, + 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x12, 0x89, 0x01, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x12, 0x28, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x62, 0x61, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x62, 0x61, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, - 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x13, 0x3a, 0x01, 0x2a, 0x22, 0x0e, 0x2f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x68, 0x69, 0x70, 0x73, 0x12, 0x7c, 0x0a, 0x11, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x6c, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x12, 0x26, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x72, 0x65, 0x62, 0x61, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, - 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x62, 0x61, 0x63, 0x2e, 0x76, - 0x31, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, - 0x69, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x10, 0x12, 0x0e, 0x2f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, - 0x69, 0x70, 0x73, 0x12, 0x82, 0x01, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, - 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x12, 0x28, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x72, 0x65, 0x62, 0x61, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x62, 0x61, - 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x61, 0x74, + 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1d, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x17, 0x3a, 0x01, 0x2a, 0x22, 0x12, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x12, 0x80, 0x01, 0x0a, 0x11, 0x52, 0x65, + 0x61, 0x64, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x12, + 0x26, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x62, 0x61, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, + 0x65, 0x61, 0x64, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, + 0x62, 0x61, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x2a, 0x0e, 0x2f, 0x72, 0x65, 0x6c, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x42, 0x2c, 0x0a, 0x0c, 0x61, 0x70, 0x69, 0x2e, - 0x72, 0x65, 0x62, 0x61, 0x63, 0x2e, 0x76, 0x31, 0x50, 0x01, 0x5a, 0x1a, 0x63, 0x69, 0x61, 0x6d, - 0x2d, 0x72, 0x65, 0x62, 0x61, 0x63, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x62, 0x61, 0x63, - 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x22, 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x12, 0x12, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, + 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x12, 0x86, 0x01, 0x0a, + 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x68, 0x69, 0x70, 0x73, 0x12, 0x28, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x62, 0x61, 0x63, + 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x62, 0x61, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x14, 0x2a, 0x12, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x68, 0x69, 0x70, 0x73, 0x42, 0x2c, 0x0a, 0x0c, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x62, + 0x61, 0x63, 0x2e, 0x76, 0x31, 0x50, 0x01, 0x5a, 0x1a, 0x63, 0x69, 0x61, 0x6d, 0x2d, 0x72, 0x65, + 0x62, 0x61, 0x63, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x62, 0x61, 0x63, 0x2f, 0x76, 0x31, + 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/rebac/v1/relationships.proto b/api/rebac/v1/relationships.proto index b92222a..067ca3c 100644 --- a/api/rebac/v1/relationships.proto +++ b/api/rebac/v1/relationships.proto @@ -11,18 +11,18 @@ option java_package = "api.rebac.v1"; service Relationships { rpc CreateRelationships (CreateRelationshipsRequest) returns (CreateRelationshipsResponse) { option (google.api.http) = { - post: "/relationships" + post: "/api/relationships" body: "*" }; }; rpc ReadRelationships (ReadRelationshipsRequest) returns (ReadRelationshipsResponse) { option (google.api.http) = { - get: "/relationships" + get: "/api/relationships" }; }; rpc DeleteRelationships (DeleteRelationshipsRequest) returns (DeleteRelationshipsResponse) { option (google.api.http) = { - delete: "/relationships" + delete: "/api/relationships" }; }; } diff --git a/api/rebac/v1/relationships_grpc.pb.go b/api/rebac/v1/relationships_grpc.pb.go index 915c03e..e01246c 100644 --- a/api/rebac/v1/relationships_grpc.pb.go +++ b/api/rebac/v1/relationships_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v3.21.12 +// - protoc v3.12.4 // source: rebac/v1/relationships.proto package v1 diff --git a/api/rebac/v1/relationships_http.pb.go b/api/rebac/v1/relationships_http.pb.go index 8fd479b..b7e84e6 100644 --- a/api/rebac/v1/relationships_http.pb.go +++ b/api/rebac/v1/relationships_http.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-http. DO NOT EDIT. // versions: // - protoc-gen-go-http v2.7.2 -// - protoc v3.21.12 +// - protoc v3.12.4 // source: rebac/v1/relationships.proto package v1 @@ -31,9 +31,9 @@ type RelationshipsHTTPServer interface { func RegisterRelationshipsHTTPServer(s *http.Server, srv RelationshipsHTTPServer) { r := s.Route("/") - r.POST("/relationships", _Relationships_CreateRelationships0_HTTP_Handler(srv)) - r.GET("/relationships", _Relationships_ReadRelationships0_HTTP_Handler(srv)) - r.DELETE("/relationships", _Relationships_DeleteRelationships0_HTTP_Handler(srv)) + r.POST("/api/relationships", _Relationships_CreateRelationships0_HTTP_Handler(srv)) + r.GET("/api/relationships", _Relationships_ReadRelationships0_HTTP_Handler(srv)) + r.DELETE("/api/relationships", _Relationships_DeleteRelationships0_HTTP_Handler(srv)) } func _Relationships_CreateRelationships0_HTTP_Handler(srv RelationshipsHTTPServer) func(ctx http.Context) error { @@ -112,7 +112,7 @@ func NewRelationshipsHTTPClient(client *http.Client) RelationshipsHTTPClient { func (c *RelationshipsHTTPClientImpl) CreateRelationships(ctx context.Context, in *CreateRelationshipsRequest, opts ...http.CallOption) (*CreateRelationshipsResponse, error) { var out CreateRelationshipsResponse - pattern := "/relationships" + pattern := "/api/relationships" path := binding.EncodeURL(pattern, in, false) opts = append(opts, http.Operation(OperationRelationshipsCreateRelationships)) opts = append(opts, http.PathTemplate(pattern)) @@ -125,7 +125,7 @@ func (c *RelationshipsHTTPClientImpl) CreateRelationships(ctx context.Context, i func (c *RelationshipsHTTPClientImpl) DeleteRelationships(ctx context.Context, in *DeleteRelationshipsRequest, opts ...http.CallOption) (*DeleteRelationshipsResponse, error) { var out DeleteRelationshipsResponse - pattern := "/relationships" + pattern := "/api/relationships" path := binding.EncodeURL(pattern, in, true) opts = append(opts, http.Operation(OperationRelationshipsDeleteRelationships)) opts = append(opts, http.PathTemplate(pattern)) @@ -138,7 +138,7 @@ func (c *RelationshipsHTTPClientImpl) DeleteRelationships(ctx context.Context, i func (c *RelationshipsHTTPClientImpl) ReadRelationships(ctx context.Context, in *ReadRelationshipsRequest, opts ...http.CallOption) (*ReadRelationshipsResponse, error) { var out ReadRelationshipsResponse - pattern := "/relationships" + pattern := "/api/relationships" path := binding.EncodeURL(pattern, in, true) opts = append(opts, http.Operation(OperationRelationshipsReadRelationships)) opts = append(opts, http.PathTemplate(pattern)) diff --git a/internal/conf/conf.pb.go b/internal/conf/conf.pb.go index 5c52f5c..443fc20 100644 --- a/internal/conf/conf.pb.go +++ b/internal/conf/conf.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.32.0 -// protoc v3.19.4 +// protoc v3.12.4 // source: conf/conf.proto package conf diff --git a/openapi.yaml b/openapi.yaml index e45692e..8dc3a1d 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -6,31 +6,7 @@ info: title: "" version: 0.0.1 paths: - /livez: - get: - tags: - - Health - operationId: Health_GetLivez - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/api.health.v1.GetLivezReply' - /readyz: - get: - tags: - - Health - operationId: Health_GetReadyz - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/api.health.v1.GetReadyzReply' - /relationships: + /api/relationships: get: tags: - Relationships @@ -120,6 +96,30 @@ paths: application/json: schema: $ref: '#/components/schemas/api.rebac.v1.DeleteRelationshipsResponse' + /livez: + get: + tags: + - Health + operationId: Health_GetLivez + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/api.health.v1.GetLivezReply' + /readyz: + get: + tags: + - Health + operationId: Health_GetReadyz + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/api.health.v1.GetReadyzReply' components: schemas: api.health.v1.GetLivezReply: