diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c675af9 --- /dev/null +++ b/Makefile @@ -0,0 +1,25 @@ +.PHONY: tidy +tidy: + GOPRIVATE=github.com/RafaySystems/* go mod tidy +.PHONY: vendor +vendor: + go mod vendor + +.PHONY: build-proto +build-proto: + cd components; buf build + +.PHONY: gen-proto +gen-proto: + cd components/common; buf generate + cd components/adminsrv; buf generate + +.PHONY: check +check: + go fmt ./... + go vet ./... + +.PHONY: clean +clean: + rm -rf components/**/gen + find . -name "*.pb*" -type f -delete \ No newline at end of file diff --git a/components/adminsrv/buf.gen.yaml b/components/adminsrv/buf.gen.yaml new file mode 100644 index 0000000..86e1ee8 --- /dev/null +++ b/components/adminsrv/buf.gen.yaml @@ -0,0 +1,23 @@ +version: v1 +managed: + enabled: true + go_package_prefix: + default: github.com/RafaySystems/rcloud-base/components/adminsrv + except: + - buf.build/googleapis/googleapis + - buf.build/grpc-ecosystem/grpc-gateway + - buf.build/gogo/protobuf +plugins: + - name: go + out: . + opt: paths=source_relative + - name: go-grpc + out: . + opt: + - paths=source_relative + - require_unimplemented_servers=false + - name: grpc-gateway + out: . + opt: paths=source_relative + - name: openapiv2 + out: gen/openapi \ No newline at end of file diff --git a/components/adminsrv/buf.lock b/components/adminsrv/buf.lock new file mode 100644 index 0000000..ee65047 --- /dev/null +++ b/components/adminsrv/buf.lock @@ -0,0 +1,24 @@ +# Generated by buf. DO NOT EDIT. +version: v1 +deps: + - remote: buf.build + owner: gogo + repository: protobuf + branch: main + commit: 4df00b267f944190a229ce3695781e99 + digest: b1-sjLgsg7CzrkOrIjBDh3s-l0aMjE6oqTj85-OsoopKAw= + create_time: 2021-08-10T00:14:28.345069Z + - remote: buf.build + owner: googleapis + repository: googleapis + branch: main + commit: 9088184d3ed04821b7e990024ff05656 + digest: b1---R9Xre3yvH8peoJPQ0dsUYp37KzdlBlx5fjPsYekyI= + create_time: 2021-12-23T15:04:49.66847Z + - remote: buf.build + owner: grpc-ecosystem + repository: grpc-gateway + branch: main + commit: ff83506eb9cc4cf8972f49ce87e6ed3e + digest: b1-iLPHgLaoeWWinMiXXqPnxqE4BThtY3eSbswVGh9GOGI= + create_time: 2021-10-23T16:26:52.283938Z diff --git a/components/adminsrv/buf.yaml b/components/adminsrv/buf.yaml new file mode 100644 index 0000000..f8e98e2 --- /dev/null +++ b/components/adminsrv/buf.yaml @@ -0,0 +1,12 @@ +version: v1 +name: buf.build/nparikh/adminsrv +deps: + - buf.build/googleapis/googleapis + - buf.build/grpc-ecosystem/grpc-gateway + - buf.build/gogo/protobuf +breaking: + use: + - FILE +lint: + use: + - DEFAULT diff --git a/components/adminsrv/gen/openapi/proto/rpc/v3/organization.swagger.json b/components/adminsrv/gen/openapi/proto/rpc/v3/organization.swagger.json new file mode 100644 index 0000000..dccf5c7 --- /dev/null +++ b/components/adminsrv/gen/openapi/proto/rpc/v3/organization.swagger.json @@ -0,0 +1,1888 @@ +{ + "swagger": "2.0", + "info": { + "title": "Organization Service", + "version": "3.0", + "contact": { + "name": "Rafay Dev" + } + }, + "tags": [ + { + "name": "Organization" + } + ], + "schemes": [ + "https" + ], + "consumes": [ + "application/json", + "application/yaml" + ], + "produces": [ + "application/json", + "application/yaml" + ], + "paths": { + "/auth/v3/partner/{metadata.partner}/organization": { + "post": { + "operationId": "Organization_CreateOrganization", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v3Organization" + } + }, + "201": { + "description": "Returned when organization is created successfully.", + "schema": {} + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": {} + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "type": "string", + "format": "string" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + }, + "parameters": [ + { + "name": "metadata.partner", + "description": "Partner to which the resource belongs", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v3Organization" + } + } + ], + "tags": [ + "Organization" + ] + } + }, + "/auth/v3/partner/{metadata.partner}/organization/{metadata.id}": { + "get": { + "operationId": "Organization_GetOrganization2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v3Organization" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": {} + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "type": "string", + "format": "string" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + }, + "parameters": [ + { + "name": "metadata.partner", + "description": "Partner to which the resource belongs", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "metadata.id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "apiVersion", + "description": "API Version. API Version of the resource", + "in": "query", + "required": false, + "type": "string", + "default": "system.k8smgmt.io/v3" + }, + { + "name": "kind", + "description": "Kind. Kind of the resource", + "in": "query", + "required": false, + "type": "string", + "default": "Organization" + }, + { + "name": "metadata.name", + "description": "Name. name of the resource", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.description", + "description": "Description. description of the resource", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.project", + "description": "Project. Project of the resource", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.organization", + "description": "Organization. Organization to which the resource belongs", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.modifiedAt", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "spec.billingAddress", + "description": "Billing Address. Billing address of the organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.active", + "description": "Active. Represents if this organization is active", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "spec.approved", + "description": "Approved. Is this organization active", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "spec.type", + "description": "Type. Type of organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.addressLine1", + "description": "Address Line 1. Address of the organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.addressLine2", + "description": "Address Line 2. Address of the organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.city", + "description": "City. City", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.country", + "description": "Country. Country of the organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.phone", + "description": "Phone. Phone number of the organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.state", + "description": "State. State of the organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.zipcode", + "description": "Zipcode. Zipcode", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.isPrivate", + "description": "Is Private. Is Private Organization", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "spec.isTotpEnabled", + "description": "Is TOTP Enabled. Is TOTP enabled at organization level", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "spec.areClustersShared", + "description": "Clusters Shared. Are clusters shared", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "spec.settings.lockout.enabled", + "description": "Enabled. Is lockout settings enabled?", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "spec.settings.lockout.periodMin", + "description": "Period Minutes. Lockout period in Minutes", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "spec.settings.lockout.attempts", + "description": "Attempts. Max number of attempts before lockout", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "spec.settings.idleLogoutMin", + "description": "Idle Logout Minutes. Idle Logout time in minutes", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "status.conditionType", + "description": "Condition Type. type of the status condition", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "status.conditionStatus", + "description": "Condition Status. status of the condition", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "StatusNotSet", + "StatusSubmitted", + "StatusOK", + "StatusFailed" + ], + "default": "StatusNotSet" + }, + { + "name": "status.lastUpdated", + "description": "Last Updated. when the condition status is last updated", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "status.reason", + "description": "Reason. reason of the last condition status", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "Organization" + ] + }, + "delete": { + "operationId": "Organization_DeleteOrganization2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v3Organization" + } + }, + "204": { + "description": "Returned when organization is deleted successfully.", + "schema": {} + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": {} + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "type": "string", + "format": "string" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + }, + "parameters": [ + { + "name": "metadata.partner", + "description": "Partner to which the resource belongs", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "metadata.id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "apiVersion", + "description": "API Version. API Version of the resource", + "in": "query", + "required": false, + "type": "string", + "default": "system.k8smgmt.io/v3" + }, + { + "name": "kind", + "description": "Kind. Kind of the resource", + "in": "query", + "required": false, + "type": "string", + "default": "Organization" + }, + { + "name": "metadata.name", + "description": "Name. name of the resource", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.description", + "description": "Description. description of the resource", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.project", + "description": "Project. Project of the resource", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.organization", + "description": "Organization. Organization to which the resource belongs", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.modifiedAt", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "spec.billingAddress", + "description": "Billing Address. Billing address of the organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.active", + "description": "Active. Represents if this organization is active", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "spec.approved", + "description": "Approved. Is this organization active", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "spec.type", + "description": "Type. Type of organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.addressLine1", + "description": "Address Line 1. Address of the organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.addressLine2", + "description": "Address Line 2. Address of the organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.city", + "description": "City. City", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.country", + "description": "Country. Country of the organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.phone", + "description": "Phone. Phone number of the organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.state", + "description": "State. State of the organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.zipcode", + "description": "Zipcode. Zipcode", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.isPrivate", + "description": "Is Private. Is Private Organization", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "spec.isTotpEnabled", + "description": "Is TOTP Enabled. Is TOTP enabled at organization level", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "spec.areClustersShared", + "description": "Clusters Shared. Are clusters shared", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "spec.settings.lockout.enabled", + "description": "Enabled. Is lockout settings enabled?", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "spec.settings.lockout.periodMin", + "description": "Period Minutes. Lockout period in Minutes", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "spec.settings.lockout.attempts", + "description": "Attempts. Max number of attempts before lockout", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "spec.settings.idleLogoutMin", + "description": "Idle Logout Minutes. Idle Logout time in minutes", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "status.conditionType", + "description": "Condition Type. type of the status condition", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "status.conditionStatus", + "description": "Condition Status. status of the condition", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "StatusNotSet", + "StatusSubmitted", + "StatusOK", + "StatusFailed" + ], + "default": "StatusNotSet" + }, + { + "name": "status.lastUpdated", + "description": "Last Updated. when the condition status is last updated", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "status.reason", + "description": "Reason. reason of the last condition status", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "Organization" + ] + }, + "put": { + "operationId": "Organization_UpdateOrganization2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v3Organization" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": {} + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "type": "string", + "format": "string" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + }, + "parameters": [ + { + "name": "metadata.partner", + "description": "Partner to which the resource belongs", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "metadata.id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v3Organization" + } + } + ], + "tags": [ + "Organization" + ] + } + }, + "/auth/v3/partner/{metadata.partner}/organization/{metadata.name}": { + "get": { + "operationId": "Organization_GetOrganization", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v3Organization" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": {} + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "type": "string", + "format": "string" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + }, + "parameters": [ + { + "name": "metadata.partner", + "description": "Partner to which the resource belongs", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "metadata.name", + "description": "name of the resource", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "apiVersion", + "description": "API Version. API Version of the resource", + "in": "query", + "required": false, + "type": "string", + "default": "system.k8smgmt.io/v3" + }, + { + "name": "kind", + "description": "Kind. Kind of the resource", + "in": "query", + "required": false, + "type": "string", + "default": "Organization" + }, + { + "name": "metadata.description", + "description": "Description. description of the resource", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.project", + "description": "Project. Project of the resource", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.organization", + "description": "Organization. Organization to which the resource belongs", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.id", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.modifiedAt", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "spec.billingAddress", + "description": "Billing Address. Billing address of the organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.active", + "description": "Active. Represents if this organization is active", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "spec.approved", + "description": "Approved. Is this organization active", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "spec.type", + "description": "Type. Type of organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.addressLine1", + "description": "Address Line 1. Address of the organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.addressLine2", + "description": "Address Line 2. Address of the organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.city", + "description": "City. City", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.country", + "description": "Country. Country of the organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.phone", + "description": "Phone. Phone number of the organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.state", + "description": "State. State of the organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.zipcode", + "description": "Zipcode. Zipcode", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.isPrivate", + "description": "Is Private. Is Private Organization", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "spec.isTotpEnabled", + "description": "Is TOTP Enabled. Is TOTP enabled at organization level", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "spec.areClustersShared", + "description": "Clusters Shared. Are clusters shared", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "spec.settings.lockout.enabled", + "description": "Enabled. Is lockout settings enabled?", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "spec.settings.lockout.periodMin", + "description": "Period Minutes. Lockout period in Minutes", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "spec.settings.lockout.attempts", + "description": "Attempts. Max number of attempts before lockout", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "spec.settings.idleLogoutMin", + "description": "Idle Logout Minutes. Idle Logout time in minutes", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "status.conditionType", + "description": "Condition Type. type of the status condition", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "status.conditionStatus", + "description": "Condition Status. status of the condition", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "StatusNotSet", + "StatusSubmitted", + "StatusOK", + "StatusFailed" + ], + "default": "StatusNotSet" + }, + { + "name": "status.lastUpdated", + "description": "Last Updated. when the condition status is last updated", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "status.reason", + "description": "Reason. reason of the last condition status", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "Organization" + ] + }, + "delete": { + "operationId": "Organization_DeleteOrganization", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v3Organization" + } + }, + "204": { + "description": "Returned when organization is deleted successfully.", + "schema": {} + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": {} + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "type": "string", + "format": "string" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + }, + "parameters": [ + { + "name": "metadata.partner", + "description": "Partner to which the resource belongs", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "metadata.name", + "description": "name of the resource", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "apiVersion", + "description": "API Version. API Version of the resource", + "in": "query", + "required": false, + "type": "string", + "default": "system.k8smgmt.io/v3" + }, + { + "name": "kind", + "description": "Kind. Kind of the resource", + "in": "query", + "required": false, + "type": "string", + "default": "Organization" + }, + { + "name": "metadata.description", + "description": "Description. description of the resource", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.project", + "description": "Project. Project of the resource", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.organization", + "description": "Organization. Organization to which the resource belongs", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.id", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.modifiedAt", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "spec.billingAddress", + "description": "Billing Address. Billing address of the organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.active", + "description": "Active. Represents if this organization is active", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "spec.approved", + "description": "Approved. Is this organization active", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "spec.type", + "description": "Type. Type of organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.addressLine1", + "description": "Address Line 1. Address of the organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.addressLine2", + "description": "Address Line 2. Address of the organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.city", + "description": "City. City", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.country", + "description": "Country. Country of the organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.phone", + "description": "Phone. Phone number of the organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.state", + "description": "State. State of the organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.zipcode", + "description": "Zipcode. Zipcode", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.isPrivate", + "description": "Is Private. Is Private Organization", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "spec.isTotpEnabled", + "description": "Is TOTP Enabled. Is TOTP enabled at organization level", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "spec.areClustersShared", + "description": "Clusters Shared. Are clusters shared", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "spec.settings.lockout.enabled", + "description": "Enabled. Is lockout settings enabled?", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "spec.settings.lockout.periodMin", + "description": "Period Minutes. Lockout period in Minutes", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "spec.settings.lockout.attempts", + "description": "Attempts. Max number of attempts before lockout", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "spec.settings.idleLogoutMin", + "description": "Idle Logout Minutes. Idle Logout time in minutes", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "status.conditionType", + "description": "Condition Type. type of the status condition", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "status.conditionStatus", + "description": "Condition Status. status of the condition", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "StatusNotSet", + "StatusSubmitted", + "StatusOK", + "StatusFailed" + ], + "default": "StatusNotSet" + }, + { + "name": "status.lastUpdated", + "description": "Last Updated. when the condition status is last updated", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "status.reason", + "description": "Reason. reason of the last condition status", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "Organization" + ] + }, + "put": { + "operationId": "Organization_UpdateOrganization", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v3Organization" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": {} + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "type": "string", + "format": "string" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + }, + "parameters": [ + { + "name": "metadata.partner", + "description": "Partner to which the resource belongs", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "metadata.name", + "description": "name of the resource", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v3Organization" + } + } + ], + "tags": [ + "Organization" + ] + } + }, + "/auth/v3/partner/{metadata.partner}/organizations": { + "get": { + "operationId": "Organization_GetOrganizations", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v3OrganizationList" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": {} + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "type": "string", + "format": "string" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + }, + "parameters": [ + { + "name": "metadata.partner", + "description": "Partner to which the resource belongs", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "apiVersion", + "description": "API Version. API Version of the resource", + "in": "query", + "required": false, + "type": "string", + "default": "system.k8smgmt.io/v3" + }, + { + "name": "kind", + "description": "Kind. Kind of the resource", + "in": "query", + "required": false, + "type": "string", + "default": "Organization" + }, + { + "name": "metadata.name", + "description": "Name. name of the resource", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.description", + "description": "Description. description of the resource", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.project", + "description": "Project. Project of the resource", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.organization", + "description": "Organization. Organization to which the resource belongs", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.id", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.modifiedAt", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "spec.billingAddress", + "description": "Billing Address. Billing address of the organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.active", + "description": "Active. Represents if this organization is active", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "spec.approved", + "description": "Approved. Is this organization active", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "spec.type", + "description": "Type. Type of organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.addressLine1", + "description": "Address Line 1. Address of the organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.addressLine2", + "description": "Address Line 2. Address of the organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.city", + "description": "City. City", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.country", + "description": "Country. Country of the organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.phone", + "description": "Phone. Phone number of the organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.state", + "description": "State. State of the organization", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.zipcode", + "description": "Zipcode. Zipcode", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.isPrivate", + "description": "Is Private. Is Private Organization", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "spec.isTotpEnabled", + "description": "Is TOTP Enabled. Is TOTP enabled at organization level", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "spec.areClustersShared", + "description": "Clusters Shared. Are clusters shared", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "spec.settings.lockout.enabled", + "description": "Enabled. Is lockout settings enabled?", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "spec.settings.lockout.periodMin", + "description": "Period Minutes. Lockout period in Minutes", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "spec.settings.lockout.attempts", + "description": "Attempts. Max number of attempts before lockout", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "spec.settings.idleLogoutMin", + "description": "Idle Logout Minutes. Idle Logout time in minutes", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "status.conditionType", + "description": "Condition Type. type of the status condition", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "status.conditionStatus", + "description": "Condition Status. status of the condition", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "StatusNotSet", + "StatusSubmitted", + "StatusOK", + "StatusFailed" + ], + "default": "StatusNotSet" + }, + { + "name": "status.lastUpdated", + "description": "Last Updated. when the condition status is last updated", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "status.reason", + "description": "Reason. reason of the last condition status", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "Organization" + ] + } + } + }, + "definitions": { + "commonv3Status": { + "type": "object", + "properties": { + "conditionType": { + "type": "string", + "description": "type of the status condition", + "title": "Condition Type", + "readOnly": true + }, + "conditionStatus": { + "$ref": "#/definitions/v3ConditionStatus", + "enum": [ + "StatusNotSet", + "StatusSubmitted", + "StatusOK", + "StatusFailed" + ], + "description": "status of the condition", + "title": "Condition Status", + "readOnly": true + }, + "lastUpdated": { + "type": "string", + "format": "date-time", + "description": "when the condition status is last updated", + "title": "Last Updated", + "readOnly": true + }, + "reason": { + "type": "string", + "description": "reason of the last condition status", + "title": "Reason", + "readOnly": true + } + }, + "description": "status of a resource", + "title": "Status", + "readOnly": true + }, + "googlerpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "v3ConditionStatus": { + "type": "string", + "enum": [ + "StatusNotSet", + "StatusSubmitted", + "StatusOK", + "StatusFailed" + ], + "default": "StatusNotSet", + "title": "$title: ConditionStatus\n$description: status of a condition for a resource" + }, + "v3ListMetadata": { + "type": "object", + "properties": { + "count": { + "type": "string", + "format": "int64" + }, + "offset": { + "type": "string", + "format": "int64" + }, + "limt": { + "type": "string", + "format": "int64" + } + }, + "title": "$title: ListMetadata\n$description: metadata for a list of resources\n$required: enabled" + }, + "v3Lockout": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Is lockout settings enabled?", + "title": "Enabled" + }, + "periodMin": { + "type": "integer", + "format": "int32", + "description": "Lockout period in Minutes", + "title": "Period Minutes" + }, + "attempts": { + "type": "integer", + "format": "int32", + "description": "Max number of attempts before lockout", + "title": "Attempts" + } + } + }, + "v3Metadata": { + "type": "object", + "example": { + "name": "some-name", + "project": "defaultproject" + }, + "properties": { + "name": { + "type": "string", + "description": "name of the resource", + "title": "Name" + }, + "description": { + "type": "string", + "description": "description of the resource", + "title": "Description" + }, + "labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "labels of the resource", + "title": "Lables" + }, + "annotations": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "annotations of the resource", + "title": "Annotations" + }, + "project": { + "type": "string", + "description": "Project of the resource", + "title": "Project" + }, + "organization": { + "type": "string", + "description": "Organization to which the resource belongs", + "title": "Organization" + }, + "partner": { + "type": "string", + "description": "Partner to which the resource belongs", + "title": "Partner" + }, + "id": { + "type": "string", + "readOnly": true + }, + "modifiedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + }, + "description": "metadata of the resource", + "title": "Metadata", + "required": [ + "name", + "project" + ] + }, + "v3Organization": { + "type": "object", + "properties": { + "apiVersion": { + "type": "string", + "default": "system.k8smgmt.io/v3", + "description": "API Version of the resource", + "title": "API Version", + "readOnly": true + }, + "kind": { + "type": "string", + "default": "Organization", + "description": "Kind of the resource", + "title": "Kind", + "readOnly": true + }, + "metadata": { + "$ref": "#/definitions/v3Metadata", + "description": "Metadata of the resource", + "title": "Metadata" + }, + "spec": { + "$ref": "#/definitions/v3OrganizationSpec", + "description": "Spec of the resource", + "title": "Spec" + }, + "status": { + "$ref": "#/definitions/commonv3Status", + "description": "Status of the resource", + "title": "Status", + "readOnly": true + } + }, + "description": "Organization", + "title": "Organization", + "required": [ + "apiVersion", + "kind", + "metadata", + "spec" + ] + }, + "v3OrganizationList": { + "type": "object", + "properties": { + "apiVersion": { + "type": "string", + "default": "system.k8smgmt.io/v3", + "description": "API Version of the list resource", + "title": "API Version", + "readOnly": true + }, + "kind": { + "type": "string", + "default": "OrganizationList", + "description": "Kind of the list resource", + "title": "Kind", + "readOnly": true + }, + "metadata": { + "$ref": "#/definitions/v3ListMetadata", + "description": "Metadata of the list resource", + "title": "ListMetadata", + "readOnly": true + }, + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/v3Organization" + }, + "description": "List of the resources", + "title": "Items", + "readOnly": true + } + } + }, + "v3OrganizationSettings": { + "type": "object", + "properties": { + "lockout": { + "$ref": "#/definitions/v3Lockout", + "description": "Lockout settings of the organization", + "title": "Lockout" + }, + "idleLogoutMin": { + "type": "integer", + "format": "int32", + "description": "Idle Logout time in minutes", + "title": "Idle Logout Minutes" + } + } + }, + "v3OrganizationSpec": { + "type": "object", + "properties": { + "billingAddress": { + "type": "string", + "description": "Billing address of the organization", + "title": "Billing Address" + }, + "active": { + "type": "boolean", + "description": "Represents if this organization is active", + "title": "Active" + }, + "approved": { + "type": "boolean", + "description": "Is this organization active", + "title": "Approved" + }, + "type": { + "type": "string", + "description": "Type of organization", + "title": "Type" + }, + "addressLine1": { + "type": "string", + "description": "Address of the organization", + "title": "Address Line 1" + }, + "addressLine2": { + "type": "string", + "description": "Address of the organization", + "title": "Address Line 2" + }, + "city": { + "type": "string", + "description": "City", + "title": "City" + }, + "country": { + "type": "string", + "description": "Country of the organization", + "title": "Country" + }, + "phone": { + "type": "string", + "description": "Phone number of the organization", + "title": "Phone" + }, + "state": { + "type": "string", + "description": "State of the organization", + "title": "State" + }, + "zipcode": { + "type": "string", + "description": "Zipcode", + "title": "Zipcode" + }, + "isPrivate": { + "type": "boolean", + "description": "Is Private Organization", + "title": "Is Private" + }, + "isTotpEnabled": { + "type": "boolean", + "description": "Is TOTP enabled at organization level", + "title": "Is TOTP Enabled" + }, + "areClustersShared": { + "type": "boolean", + "description": "Are clusters shared", + "title": "Clusters Shared" + }, + "settings": { + "$ref": "#/definitions/v3OrganizationSettings", + "description": "Various settings like lockout, auto-logout configuration", + "title": "Settings" + } + } + } + }, + "securityDefinitions": { + "ApiKeyAuth": { + "type": "apiKey", + "name": "X-RAFAY-API-KEYID", + "in": "header" + }, + "BasicAuth": { + "type": "basic" + } + }, + "security": [ + { + "ApiKeyAuth": [], + "BasicAuth": [] + } + ] +} diff --git a/components/adminsrv/gen/openapi/proto/rpc/v3/partner.swagger.json b/components/adminsrv/gen/openapi/proto/rpc/v3/partner.swagger.json new file mode 100644 index 0000000..3d04549 --- /dev/null +++ b/components/adminsrv/gen/openapi/proto/rpc/v3/partner.swagger.json @@ -0,0 +1,1300 @@ +{ + "swagger": "2.0", + "info": { + "title": "Partner Service", + "version": "3.0", + "contact": { + "name": "Rafay Dev" + } + }, + "tags": [ + { + "name": "Partner" + } + ], + "schemes": [ + "https" + ], + "consumes": [ + "application/json", + "application/yaml" + ], + "produces": [ + "application/json", + "application/yaml" + ], + "paths": { + "/auth/v3/partner": { + "post": { + "operationId": "Partner_CreatePartner", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v3Partner" + } + }, + "201": { + "description": "Returned when partner is created successfully.", + "schema": {} + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": {} + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "type": "string", + "format": "string" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v3Partner" + } + } + ], + "tags": [ + "Partner" + ] + } + }, + "/auth/v3/partner/{metadata.id}": { + "get": { + "operationId": "Partner_GetPartner2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v3Partner" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": {} + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "type": "string", + "format": "string" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + }, + "parameters": [ + { + "name": "metadata.id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "apiVersion", + "description": "API Version. API Version of the resource", + "in": "query", + "required": false, + "type": "string", + "default": "system.k8smgmt.io/v3" + }, + { + "name": "kind", + "description": "Kind. Kind of the resource", + "in": "query", + "required": false, + "type": "string", + "default": "Partner" + }, + { + "name": "metadata.name", + "description": "Name. name of the resource", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.description", + "description": "Description. description of the resource", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.project", + "description": "Project. Project of the resource", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.organization", + "description": "Organization. Organization to which the resource belongs", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.partner", + "description": "Partner. Partner to which the resource belongs", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.modifiedAt", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "spec.host", + "description": "Host. Host of the partner", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.domain", + "description": "Domain. Domain of the partner", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.tosLink", + "description": "TOS. Terms of service url of the partner", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.logoLink", + "description": "Logo. Logo url of the partner", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.notificationEmail", + "description": "Notification Email. Notification email of the partner", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.helpdeskEmail", + "description": "Helpdesk Email. Helpdesk email of the partner", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.productName", + "description": "Product Name. Product Name", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.supportTeamName", + "description": "Support Team Name. Support Team Name", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.opsHost", + "description": "OPS Host. Operations host of the partner", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.favIconLink", + "description": "Fav Icon Link. Fav Icon Link", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.isTOTPEnabled", + "description": "TOTP Enabled. TOTP Enabled flag at the partner level", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "status.conditionType", + "description": "Condition Type. type of the status condition", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "status.conditionStatus", + "description": "Condition Status. status of the condition", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "StatusNotSet", + "StatusSubmitted", + "StatusOK", + "StatusFailed" + ], + "default": "StatusNotSet" + }, + { + "name": "status.lastUpdated", + "description": "Last Updated. when the condition status is last updated", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "status.reason", + "description": "Reason. reason of the last condition status", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "Partner" + ] + }, + "delete": { + "operationId": "Partner_DeletePartner2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v3Partner" + } + }, + "204": { + "description": "Returned when partner is deleted successfully.", + "schema": {} + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": {} + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "type": "string", + "format": "string" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + }, + "parameters": [ + { + "name": "metadata.id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "apiVersion", + "description": "API Version. API Version of the resource", + "in": "query", + "required": false, + "type": "string", + "default": "system.k8smgmt.io/v3" + }, + { + "name": "kind", + "description": "Kind. Kind of the resource", + "in": "query", + "required": false, + "type": "string", + "default": "Partner" + }, + { + "name": "metadata.name", + "description": "Name. name of the resource", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.description", + "description": "Description. description of the resource", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.project", + "description": "Project. Project of the resource", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.organization", + "description": "Organization. Organization to which the resource belongs", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.partner", + "description": "Partner. Partner to which the resource belongs", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.modifiedAt", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "spec.host", + "description": "Host. Host of the partner", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.domain", + "description": "Domain. Domain of the partner", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.tosLink", + "description": "TOS. Terms of service url of the partner", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.logoLink", + "description": "Logo. Logo url of the partner", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.notificationEmail", + "description": "Notification Email. Notification email of the partner", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.helpdeskEmail", + "description": "Helpdesk Email. Helpdesk email of the partner", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.productName", + "description": "Product Name. Product Name", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.supportTeamName", + "description": "Support Team Name. Support Team Name", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.opsHost", + "description": "OPS Host. Operations host of the partner", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.favIconLink", + "description": "Fav Icon Link. Fav Icon Link", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.isTOTPEnabled", + "description": "TOTP Enabled. TOTP Enabled flag at the partner level", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "status.conditionType", + "description": "Condition Type. type of the status condition", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "status.conditionStatus", + "description": "Condition Status. status of the condition", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "StatusNotSet", + "StatusSubmitted", + "StatusOK", + "StatusFailed" + ], + "default": "StatusNotSet" + }, + { + "name": "status.lastUpdated", + "description": "Last Updated. when the condition status is last updated", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "status.reason", + "description": "Reason. reason of the last condition status", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "Partner" + ] + }, + "put": { + "operationId": "Partner_UpdatePartner2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v3Partner" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": {} + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "type": "string", + "format": "string" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + }, + "parameters": [ + { + "name": "metadata.id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v3Partner" + } + } + ], + "tags": [ + "Partner" + ] + } + }, + "/auth/v3/partner/{metadata.name}": { + "get": { + "operationId": "Partner_GetPartner", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v3Partner" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": {} + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "type": "string", + "format": "string" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + }, + "parameters": [ + { + "name": "metadata.name", + "description": "name of the resource", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "apiVersion", + "description": "API Version. API Version of the resource", + "in": "query", + "required": false, + "type": "string", + "default": "system.k8smgmt.io/v3" + }, + { + "name": "kind", + "description": "Kind. Kind of the resource", + "in": "query", + "required": false, + "type": "string", + "default": "Partner" + }, + { + "name": "metadata.description", + "description": "Description. description of the resource", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.project", + "description": "Project. Project of the resource", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.organization", + "description": "Organization. Organization to which the resource belongs", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.partner", + "description": "Partner. Partner to which the resource belongs", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.id", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.modifiedAt", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "spec.host", + "description": "Host. Host of the partner", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.domain", + "description": "Domain. Domain of the partner", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.tosLink", + "description": "TOS. Terms of service url of the partner", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.logoLink", + "description": "Logo. Logo url of the partner", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.notificationEmail", + "description": "Notification Email. Notification email of the partner", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.helpdeskEmail", + "description": "Helpdesk Email. Helpdesk email of the partner", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.productName", + "description": "Product Name. Product Name", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.supportTeamName", + "description": "Support Team Name. Support Team Name", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.opsHost", + "description": "OPS Host. Operations host of the partner", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.favIconLink", + "description": "Fav Icon Link. Fav Icon Link", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.isTOTPEnabled", + "description": "TOTP Enabled. TOTP Enabled flag at the partner level", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "status.conditionType", + "description": "Condition Type. type of the status condition", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "status.conditionStatus", + "description": "Condition Status. status of the condition", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "StatusNotSet", + "StatusSubmitted", + "StatusOK", + "StatusFailed" + ], + "default": "StatusNotSet" + }, + { + "name": "status.lastUpdated", + "description": "Last Updated. when the condition status is last updated", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "status.reason", + "description": "Reason. reason of the last condition status", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "Partner" + ] + }, + "delete": { + "operationId": "Partner_DeletePartner", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v3Partner" + } + }, + "204": { + "description": "Returned when partner is deleted successfully.", + "schema": {} + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": {} + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "type": "string", + "format": "string" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + }, + "parameters": [ + { + "name": "metadata.name", + "description": "name of the resource", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "apiVersion", + "description": "API Version. API Version of the resource", + "in": "query", + "required": false, + "type": "string", + "default": "system.k8smgmt.io/v3" + }, + { + "name": "kind", + "description": "Kind. Kind of the resource", + "in": "query", + "required": false, + "type": "string", + "default": "Partner" + }, + { + "name": "metadata.description", + "description": "Description. description of the resource", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.project", + "description": "Project. Project of the resource", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.organization", + "description": "Organization. Organization to which the resource belongs", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.partner", + "description": "Partner. Partner to which the resource belongs", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.id", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.modifiedAt", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "spec.host", + "description": "Host. Host of the partner", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.domain", + "description": "Domain. Domain of the partner", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.tosLink", + "description": "TOS. Terms of service url of the partner", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.logoLink", + "description": "Logo. Logo url of the partner", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.notificationEmail", + "description": "Notification Email. Notification email of the partner", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.helpdeskEmail", + "description": "Helpdesk Email. Helpdesk email of the partner", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.productName", + "description": "Product Name. Product Name", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.supportTeamName", + "description": "Support Team Name. Support Team Name", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.opsHost", + "description": "OPS Host. Operations host of the partner", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.favIconLink", + "description": "Fav Icon Link. Fav Icon Link", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "spec.isTOTPEnabled", + "description": "TOTP Enabled. TOTP Enabled flag at the partner level", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "status.conditionType", + "description": "Condition Type. type of the status condition", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "status.conditionStatus", + "description": "Condition Status. status of the condition", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "StatusNotSet", + "StatusSubmitted", + "StatusOK", + "StatusFailed" + ], + "default": "StatusNotSet" + }, + { + "name": "status.lastUpdated", + "description": "Last Updated. when the condition status is last updated", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "status.reason", + "description": "Reason. reason of the last condition status", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "Partner" + ] + }, + "put": { + "operationId": "Partner_UpdatePartner", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v3Partner" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": {} + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "type": "string", + "format": "string" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + }, + "parameters": [ + { + "name": "metadata.name", + "description": "name of the resource", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v3Partner" + } + } + ], + "tags": [ + "Partner" + ] + } + } + }, + "definitions": { + "commonv3Status": { + "type": "object", + "properties": { + "conditionType": { + "type": "string", + "description": "type of the status condition", + "title": "Condition Type", + "readOnly": true + }, + "conditionStatus": { + "$ref": "#/definitions/v3ConditionStatus", + "enum": [ + "StatusNotSet", + "StatusSubmitted", + "StatusOK", + "StatusFailed" + ], + "description": "status of the condition", + "title": "Condition Status", + "readOnly": true + }, + "lastUpdated": { + "type": "string", + "format": "date-time", + "description": "when the condition status is last updated", + "title": "Last Updated", + "readOnly": true + }, + "reason": { + "type": "string", + "description": "reason of the last condition status", + "title": "Reason", + "readOnly": true + } + }, + "description": "status of a resource", + "title": "Status", + "readOnly": true + }, + "googlerpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "protobufNullValue": { + "type": "string", + "enum": [ + "NULL_VALUE" + ], + "default": "NULL_VALUE", + "description": "`NullValue` is a singleton enumeration to represent the null value for the\n`Value` type union.\n\n The JSON representation for `NullValue` is JSON `null`.\n\n - NULL_VALUE: Null value." + }, + "v3ConditionStatus": { + "type": "string", + "enum": [ + "StatusNotSet", + "StatusSubmitted", + "StatusOK", + "StatusFailed" + ], + "default": "StatusNotSet", + "title": "$title: ConditionStatus\n$description: status of a condition for a resource" + }, + "v3Metadata": { + "type": "object", + "example": { + "name": "some-name", + "project": "defaultproject" + }, + "properties": { + "name": { + "type": "string", + "description": "name of the resource", + "title": "Name" + }, + "description": { + "type": "string", + "description": "description of the resource", + "title": "Description" + }, + "labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "labels of the resource", + "title": "Lables" + }, + "annotations": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "annotations of the resource", + "title": "Annotations" + }, + "project": { + "type": "string", + "description": "Project of the resource", + "title": "Project" + }, + "organization": { + "type": "string", + "description": "Organization to which the resource belongs", + "title": "Organization" + }, + "partner": { + "type": "string", + "description": "Partner to which the resource belongs", + "title": "Partner" + }, + "id": { + "type": "string", + "readOnly": true + }, + "modifiedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + }, + "description": "metadata of the resource", + "title": "Metadata", + "required": [ + "name", + "project" + ] + }, + "v3Partner": { + "type": "object", + "properties": { + "apiVersion": { + "type": "string", + "default": "system.k8smgmt.io/v3", + "description": "API Version of the resource", + "title": "API Version", + "readOnly": true + }, + "kind": { + "type": "string", + "default": "Partner", + "description": "Kind of the resource", + "title": "Kind", + "readOnly": true + }, + "metadata": { + "$ref": "#/definitions/v3Metadata", + "description": "Metadata of the resource", + "title": "Metadata" + }, + "spec": { + "$ref": "#/definitions/v3PartnerSpec", + "description": "Spec of the resource", + "title": "Spec" + }, + "status": { + "$ref": "#/definitions/commonv3Status", + "description": "Status of the resource", + "title": "Status", + "readOnly": true + } + }, + "description": "Partner", + "title": "Partner", + "required": [ + "apiVersion", + "kind", + "metadata", + "spec" + ] + }, + "v3PartnerSpec": { + "type": "object", + "properties": { + "host": { + "type": "string", + "description": "Host of the partner", + "title": "Host" + }, + "domain": { + "type": "string", + "description": "Domain of the partner", + "title": "Domain" + }, + "tosLink": { + "type": "string", + "description": "Terms of service url of the partner", + "title": "TOS" + }, + "logoLink": { + "type": "string", + "description": "Logo url of the partner", + "title": "Logo" + }, + "notificationEmail": { + "type": "string", + "description": "Notification email of the partner", + "title": "Notification Email" + }, + "helpdeskEmail": { + "type": "string", + "description": "Helpdesk email of the partner", + "title": "Helpdesk Email" + }, + "productName": { + "type": "string", + "description": "Product Name", + "title": "Product Name" + }, + "supportTeamName": { + "type": "string", + "description": "Support Team Name", + "title": "Support Team Name" + }, + "opsHost": { + "type": "string", + "description": "Operations host of the partner", + "title": "OPS Host" + }, + "favIconLink": { + "type": "string", + "description": "Fav Icon Link", + "title": "Fav Icon Link" + }, + "isTOTPEnabled": { + "type": "boolean", + "description": "TOTP Enabled flag at the partner level", + "title": "TOTP Enabled" + }, + "settings": { + "type": "object", + "description": "Settings of the partner", + "title": "Settings" + } + }, + "description": "Partner Specification", + "title": "Partner Specification" + } + }, + "securityDefinitions": { + "ApiKeyAuth": { + "type": "apiKey", + "name": "X-RAFAY-API-KEYID", + "in": "header" + }, + "BasicAuth": { + "type": "basic" + } + }, + "security": [ + { + "ApiKeyAuth": [], + "BasicAuth": [] + } + ] +} diff --git a/components/adminsrv/gen/openapi/proto/rpc/v3/project.swagger.json b/components/adminsrv/gen/openapi/proto/rpc/v3/project.swagger.json new file mode 100644 index 0000000..4ffa84d --- /dev/null +++ b/components/adminsrv/gen/openapi/proto/rpc/v3/project.swagger.json @@ -0,0 +1,1195 @@ +{ + "swagger": "2.0", + "info": { + "title": "Project Service", + "version": "3.0", + "contact": { + "name": "Rafay Dev" + } + }, + "tags": [ + { + "name": "Project" + } + ], + "schemes": [ + "https" + ], + "consumes": [ + "application/json", + "application/yaml" + ], + "produces": [ + "application/json", + "application/yaml" + ], + "paths": { + "/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/project": { + "post": { + "operationId": "Project_CreateProject", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v3Project" + } + }, + "201": { + "description": "Returned when project is created successfully.", + "schema": {} + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": {} + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "type": "string", + "format": "string" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + }, + "parameters": [ + { + "name": "metadata.partner", + "description": "Partner to which the resource belongs", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "metadata.organization", + "description": "Organization to which the resource belongs", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v3Project" + } + } + ], + "tags": [ + "Project" + ] + } + }, + "/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/project/{metadata.id}": { + "get": { + "operationId": "Project_GetProject2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v3Project" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": {} + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "type": "string", + "format": "string" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + }, + "parameters": [ + { + "name": "metadata.partner", + "description": "Partner to which the resource belongs", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "metadata.organization", + "description": "Organization to which the resource belongs", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "metadata.id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "apiVersion", + "description": "API Version. API Version of the resource", + "in": "query", + "required": false, + "type": "string", + "default": "system.k8smgmt.io/v3" + }, + { + "name": "kind", + "description": "Kind. Kind of the resource", + "in": "query", + "required": false, + "type": "string", + "default": "Project" + }, + { + "name": "metadata.name", + "description": "Name. name of the resource", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.description", + "description": "Description. description of the resource", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.project", + "description": "Project. Project of the resource", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.modifiedAt", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "spec.default", + "description": "Default. flag to indicate if this is the default project in the organization", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "status.conditionType", + "description": "Condition Type. type of the status condition", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "status.conditionStatus", + "description": "Condition Status. status of the condition", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "StatusNotSet", + "StatusSubmitted", + "StatusOK", + "StatusFailed" + ], + "default": "StatusNotSet" + }, + { + "name": "status.lastUpdated", + "description": "Last Updated. when the condition status is last updated", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "status.reason", + "description": "Reason. reason of the last condition status", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "Project" + ] + }, + "delete": { + "operationId": "Project_DeleteProject2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v3Project" + } + }, + "204": { + "description": "Returned when project is deleted successfully.", + "schema": {} + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": {} + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "type": "string", + "format": "string" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + }, + "parameters": [ + { + "name": "metadata.partner", + "description": "Partner to which the resource belongs", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "metadata.organization", + "description": "Organization to which the resource belongs", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "metadata.id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "apiVersion", + "description": "API Version. API Version of the resource", + "in": "query", + "required": false, + "type": "string", + "default": "system.k8smgmt.io/v3" + }, + { + "name": "kind", + "description": "Kind. Kind of the resource", + "in": "query", + "required": false, + "type": "string", + "default": "Project" + }, + { + "name": "metadata.name", + "description": "Name. name of the resource", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.description", + "description": "Description. description of the resource", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.project", + "description": "Project. Project of the resource", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.modifiedAt", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "spec.default", + "description": "Default. flag to indicate if this is the default project in the organization", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "status.conditionType", + "description": "Condition Type. type of the status condition", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "status.conditionStatus", + "description": "Condition Status. status of the condition", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "StatusNotSet", + "StatusSubmitted", + "StatusOK", + "StatusFailed" + ], + "default": "StatusNotSet" + }, + { + "name": "status.lastUpdated", + "description": "Last Updated. when the condition status is last updated", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "status.reason", + "description": "Reason. reason of the last condition status", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "Project" + ] + }, + "put": { + "operationId": "Project_UpdateProject2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v3Project" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": {} + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "type": "string", + "format": "string" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + }, + "parameters": [ + { + "name": "metadata.partner", + "description": "Partner to which the resource belongs", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "metadata.organization", + "description": "Organization to which the resource belongs", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "metadata.id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v3Project" + } + } + ], + "tags": [ + "Project" + ] + } + }, + "/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/project/{metadata.name}": { + "get": { + "operationId": "Project_GetProject", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v3Project" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": {} + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "type": "string", + "format": "string" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + }, + "parameters": [ + { + "name": "metadata.partner", + "description": "Partner to which the resource belongs", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "metadata.organization", + "description": "Organization to which the resource belongs", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "metadata.name", + "description": "name of the resource", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "apiVersion", + "description": "API Version. API Version of the resource", + "in": "query", + "required": false, + "type": "string", + "default": "system.k8smgmt.io/v3" + }, + { + "name": "kind", + "description": "Kind. Kind of the resource", + "in": "query", + "required": false, + "type": "string", + "default": "Project" + }, + { + "name": "metadata.description", + "description": "Description. description of the resource", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.project", + "description": "Project. Project of the resource", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.id", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.modifiedAt", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "spec.default", + "description": "Default. flag to indicate if this is the default project in the organization", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "status.conditionType", + "description": "Condition Type. type of the status condition", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "status.conditionStatus", + "description": "Condition Status. status of the condition", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "StatusNotSet", + "StatusSubmitted", + "StatusOK", + "StatusFailed" + ], + "default": "StatusNotSet" + }, + { + "name": "status.lastUpdated", + "description": "Last Updated. when the condition status is last updated", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "status.reason", + "description": "Reason. reason of the last condition status", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "Project" + ] + }, + "delete": { + "operationId": "Project_DeleteProject", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v3Project" + } + }, + "204": { + "description": "Returned when project is deleted successfully.", + "schema": {} + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": {} + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "type": "string", + "format": "string" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + }, + "parameters": [ + { + "name": "metadata.partner", + "description": "Partner to which the resource belongs", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "metadata.organization", + "description": "Organization to which the resource belongs", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "metadata.name", + "description": "name of the resource", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "apiVersion", + "description": "API Version. API Version of the resource", + "in": "query", + "required": false, + "type": "string", + "default": "system.k8smgmt.io/v3" + }, + { + "name": "kind", + "description": "Kind. Kind of the resource", + "in": "query", + "required": false, + "type": "string", + "default": "Project" + }, + { + "name": "metadata.description", + "description": "Description. description of the resource", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.project", + "description": "Project. Project of the resource", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.id", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.modifiedAt", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "spec.default", + "description": "Default. flag to indicate if this is the default project in the organization", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "status.conditionType", + "description": "Condition Type. type of the status condition", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "status.conditionStatus", + "description": "Condition Status. status of the condition", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "StatusNotSet", + "StatusSubmitted", + "StatusOK", + "StatusFailed" + ], + "default": "StatusNotSet" + }, + { + "name": "status.lastUpdated", + "description": "Last Updated. when the condition status is last updated", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "status.reason", + "description": "Reason. reason of the last condition status", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "Project" + ] + }, + "put": { + "operationId": "Project_UpdateProject", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v3Project" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": {} + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "type": "string", + "format": "string" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + }, + "parameters": [ + { + "name": "metadata.partner", + "description": "Partner to which the resource belongs", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "metadata.organization", + "description": "Organization to which the resource belongs", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "metadata.name", + "description": "name of the resource", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v3Project" + } + } + ], + "tags": [ + "Project" + ] + } + }, + "/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/projects": { + "get": { + "operationId": "Project_GetProjects", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v3ProjectList" + } + }, + "403": { + "description": "Returned when the user does not have permission to access the resource.", + "schema": {} + }, + "404": { + "description": "Returned when the resource does not exist.", + "schema": { + "type": "string", + "format": "string" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + }, + "parameters": [ + { + "name": "metadata.partner", + "description": "Partner to which the resource belongs", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "metadata.organization", + "description": "Organization to which the resource belongs", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "apiVersion", + "description": "API Version. API Version of the resource", + "in": "query", + "required": false, + "type": "string", + "default": "system.k8smgmt.io/v3" + }, + { + "name": "kind", + "description": "Kind. Kind of the resource", + "in": "query", + "required": false, + "type": "string", + "default": "Project" + }, + { + "name": "metadata.name", + "description": "Name. name of the resource", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.description", + "description": "Description. description of the resource", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.project", + "description": "Project. Project of the resource", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.id", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "metadata.modifiedAt", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "spec.default", + "description": "Default. flag to indicate if this is the default project in the organization", + "in": "query", + "required": false, + "type": "boolean" + }, + { + "name": "status.conditionType", + "description": "Condition Type. type of the status condition", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "status.conditionStatus", + "description": "Condition Status. status of the condition", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "StatusNotSet", + "StatusSubmitted", + "StatusOK", + "StatusFailed" + ], + "default": "StatusNotSet" + }, + { + "name": "status.lastUpdated", + "description": "Last Updated. when the condition status is last updated", + "in": "query", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "status.reason", + "description": "Reason. reason of the last condition status", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "Project" + ] + } + } + }, + "definitions": { + "commonv3Status": { + "type": "object", + "properties": { + "conditionType": { + "type": "string", + "description": "type of the status condition", + "title": "Condition Type", + "readOnly": true + }, + "conditionStatus": { + "$ref": "#/definitions/v3ConditionStatus", + "enum": [ + "StatusNotSet", + "StatusSubmitted", + "StatusOK", + "StatusFailed" + ], + "description": "status of the condition", + "title": "Condition Status", + "readOnly": true + }, + "lastUpdated": { + "type": "string", + "format": "date-time", + "description": "when the condition status is last updated", + "title": "Last Updated", + "readOnly": true + }, + "reason": { + "type": "string", + "description": "reason of the last condition status", + "title": "Reason", + "readOnly": true + } + }, + "description": "status of a resource", + "title": "Status", + "readOnly": true + }, + "googlerpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "v3ConditionStatus": { + "type": "string", + "enum": [ + "StatusNotSet", + "StatusSubmitted", + "StatusOK", + "StatusFailed" + ], + "default": "StatusNotSet", + "title": "$title: ConditionStatus\n$description: status of a condition for a resource" + }, + "v3ListMetadata": { + "type": "object", + "properties": { + "count": { + "type": "string", + "format": "int64" + }, + "offset": { + "type": "string", + "format": "int64" + }, + "limt": { + "type": "string", + "format": "int64" + } + }, + "title": "$title: ListMetadata\n$description: metadata for a list of resources\n$required: enabled" + }, + "v3Metadata": { + "type": "object", + "example": { + "name": "some-name", + "project": "defaultproject" + }, + "properties": { + "name": { + "type": "string", + "description": "name of the resource", + "title": "Name" + }, + "description": { + "type": "string", + "description": "description of the resource", + "title": "Description" + }, + "labels": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "labels of the resource", + "title": "Lables" + }, + "annotations": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "annotations of the resource", + "title": "Annotations" + }, + "project": { + "type": "string", + "description": "Project of the resource", + "title": "Project" + }, + "organization": { + "type": "string", + "description": "Organization to which the resource belongs", + "title": "Organization" + }, + "partner": { + "type": "string", + "description": "Partner to which the resource belongs", + "title": "Partner" + }, + "id": { + "type": "string", + "readOnly": true + }, + "modifiedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + }, + "description": "metadata of the resource", + "title": "Metadata", + "required": [ + "name", + "project" + ] + }, + "v3Project": { + "type": "object", + "properties": { + "apiVersion": { + "type": "string", + "default": "system.k8smgmt.io/v3", + "description": "API Version of the resource", + "title": "API Version", + "readOnly": true + }, + "kind": { + "type": "string", + "default": "Project", + "description": "Kind of the resource", + "title": "Kind", + "readOnly": true + }, + "metadata": { + "$ref": "#/definitions/v3Metadata", + "description": "Metadata of the resource", + "title": "Metadata" + }, + "spec": { + "$ref": "#/definitions/v3ProjectSpec", + "description": "Spec of the resource", + "title": "Spec" + }, + "status": { + "$ref": "#/definitions/commonv3Status", + "description": "Status of the resource", + "title": "Status", + "readOnly": true + } + }, + "description": "Project", + "title": "Project", + "required": [ + "apiVersion", + "kind", + "metadata", + "spec" + ] + }, + "v3ProjectList": { + "type": "object", + "properties": { + "apiVersion": { + "type": "string", + "default": "system.k8smgmt.io/v3", + "description": "API Version of the list resource", + "title": "API Version", + "readOnly": true + }, + "kind": { + "type": "string", + "default": "Project", + "description": "Kind of the list resource", + "title": "Kind", + "readOnly": true + }, + "metadata": { + "$ref": "#/definitions/v3ListMetadata", + "description": "Metadata of the list resource", + "title": "ListMetadata", + "readOnly": true + }, + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/v3Project" + }, + "description": "List of the resources", + "title": "Items", + "readOnly": true + } + }, + "description": "Project list", + "title": "ProjectList" + }, + "v3ProjectSpec": { + "type": "object", + "properties": { + "default": { + "type": "boolean", + "description": "flag to indicate if this is the default project in the organization", + "title": "Default" + } + }, + "description": "project specification", + "title": "Project Specification" + } + }, + "securityDefinitions": { + "ApiKeyAuth": { + "type": "apiKey", + "name": "X-RAFAY-API-KEYID", + "in": "header" + }, + "BasicAuth": { + "type": "basic" + } + }, + "security": [ + { + "ApiKeyAuth": [], + "BasicAuth": [] + } + ] +} diff --git a/components/adminsrv/gen/openapi/proto/types/systempb/v3/organization.swagger.json b/components/adminsrv/gen/openapi/proto/types/systempb/v3/organization.swagger.json new file mode 100644 index 0000000..25946e0 --- /dev/null +++ b/components/adminsrv/gen/openapi/proto/types/systempb/v3/organization.swagger.json @@ -0,0 +1,43 @@ +{ + "swagger": "2.0", + "info": { + "title": "proto/types/systempb/v3/organization.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "googlerpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + } + } +} diff --git a/components/adminsrv/gen/openapi/proto/types/systempb/v3/partner.swagger.json b/components/adminsrv/gen/openapi/proto/types/systempb/v3/partner.swagger.json new file mode 100644 index 0000000..1c2b231 --- /dev/null +++ b/components/adminsrv/gen/openapi/proto/types/systempb/v3/partner.swagger.json @@ -0,0 +1,43 @@ +{ + "swagger": "2.0", + "info": { + "title": "proto/types/systempb/v3/partner.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "googlerpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + } + } +} diff --git a/components/adminsrv/gen/openapi/proto/types/systempb/v3/project.swagger.json b/components/adminsrv/gen/openapi/proto/types/systempb/v3/project.swagger.json new file mode 100644 index 0000000..8a16155 --- /dev/null +++ b/components/adminsrv/gen/openapi/proto/types/systempb/v3/project.swagger.json @@ -0,0 +1,43 @@ +{ + "swagger": "2.0", + "info": { + "title": "proto/types/systempb/v3/project.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "googlerpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + } + } +} diff --git a/components/adminsrv/go.mod b/components/adminsrv/go.mod new file mode 100644 index 0000000..1d6e1ca --- /dev/null +++ b/components/adminsrv/go.mod @@ -0,0 +1,58 @@ +module github.com/RafaySystems/rcloud-base/components/adminsrv + +go 1.17 + +require ( + github.com/RafaySystems/rcloud-base/components/common v0.0.0-unpublished + github.com/gogo/protobuf v1.3.2 + github.com/grpc-ecosystem/grpc-gateway v1.16.0 + github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.2 + github.com/jinzhu/inflection v1.0.0 // indirect + github.com/spf13/viper v1.10.1 + github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc // indirect + github.com/uptrace/bun v1.0.20 + github.com/uptrace/bun/dialect/pgdialect v1.0.20 + github.com/uptrace/bun/driver/pgdriver v1.0.20 + github.com/uptrace/bun/extra/bundebug v1.0.20 + github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect + github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect + golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3 // indirect + golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect + google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa + google.golang.org/grpc v1.43.0 + google.golang.org/protobuf v1.27.1 + mellium.im/sasl v0.2.1 // indirect + sigs.k8s.io/controller-runtime v0.11.0 +) + +require ( + github.com/fatih/color v1.13.0 // indirect + github.com/fsnotify/fsnotify v1.5.1 // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/google/uuid v1.3.0 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/julienschmidt/httprouter v1.3.0 // indirect + github.com/klauspost/cpuid/v2 v2.0.6 // indirect + github.com/magiconair/properties v1.8.5 // indirect + github.com/mattn/go-colorable v0.1.12 // indirect + github.com/mattn/go-isatty v0.0.14 // indirect + github.com/mitchellh/mapstructure v1.4.3 // indirect + github.com/pelletier/go-toml v1.9.4 // indirect + github.com/processout/grpc-go-pool v1.2.1 // indirect + github.com/segmentio/asm v1.1.0 // indirect + github.com/segmentio/encoding v0.3.2 // indirect + github.com/speps/go-hashids v2.0.0+incompatible // indirect + github.com/spf13/afero v1.6.0 // indirect + github.com/spf13/cast v1.4.1 // indirect + github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/subosito/gotenv v1.2.0 // indirect + go.uber.org/atomic v1.7.0 // indirect + go.uber.org/multierr v1.6.0 // indirect + go.uber.org/zap v1.19.1 // indirect + golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect + golang.org/x/text v0.3.7 // indirect + gopkg.in/ini.v1 v1.66.2 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + sigs.k8s.io/yaml v1.3.0 // indirect +) \ No newline at end of file diff --git a/components/adminsrv/go.sum b/components/adminsrv/go.sum new file mode 100644 index 0000000..10c3a96 --- /dev/null +++ b/components/adminsrv/go.sum @@ -0,0 +1,287 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= +github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.2 h1:I/pwhnUln5wbMnTyRbzswA0/JxpK8sZj0aUfI3TV1So= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.2/go.mod h1:lsuH8kb4GlMdSlI4alNIBBSAt5CHJtg3i+0WuN9J5YM= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= +github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= +github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/cpuid/v2 v2.0.6 h1:dQ5ueTiftKxp0gyjKSx5+8BtPWkyQbd95m8Gys/RarI= +github.com/klauspost/cpuid/v2 v2.0.6/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls= +github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs= +github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/gomega v1.17.0 h1:9Luw4uT5HTjHTN8+aNcSThgH1vdXnmdJ8xIfZ4wyTRE= +github.com/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM= +github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/processout/grpc-go-pool v1.2.1 h1:hbp1BOA02CIxEAoRLHGpUhhPFv77nwfBLBeO3Ya9P7I= +github.com/processout/grpc-go-pool v1.2.1/go.mod h1:F4hiNj96O6VQ87jv4rdz8R9tkHdelQQJ/J2B1a5VSt4= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/segmentio/asm v1.1.0 h1:fkVr8k5J4sKoFjTGVD6r1yKvDKqmvrEh3K7iyVxgBs8= +github.com/segmentio/asm v1.1.0/go.mod h1:4EUJGaKsB8ImLUwOGORVsNd9vTRDeh44JGsY4aKp5I4= +github.com/segmentio/encoding v0.3.2 h1:gkXXteOfNaPPlrXTEf/e5tWvaQGVJWnvT3LqMzUeH7U= +github.com/segmentio/encoding v0.3.2/go.mod h1:waft2p6XI4z2pk07M0YzZV4wEiqaRvsBSyWNHxVx4gU= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/speps/go-hashids v2.0.0+incompatible h1:kSfxGfESueJKTx0mpER9Y/1XHl+FVQjtCqRyYcviFbw= +github.com/speps/go-hashids v2.0.0+incompatible/go.mod h1:P7hqPzMdnZOfyIk+xrlG1QaSMw+gCBdHKsBDnhpaZvc= +github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY= +github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= +github.com/spf13/cast v1.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA= +github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.10.1 h1:nuJZuYpG7gTj/XqiUwg8bA0cp1+M2mC3J4g5luUYBKk= +github.com/spf13/viper v1.10.1/go.mod h1:IGlFPqhNAPKRxohIzWpI5QEy4kuI7tcl5WvR+8qy1rU= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= +github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc h1:9lRDQMhESg+zvGYmW5DyG0UqvY96Bu5QYsTLvCHdrgo= +github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc/go.mod h1:bciPuU6GHm1iF1pBvUfxfsH0Wmnc2VbpgvbI9ZWuIRs= +github.com/uptrace/bun v1.0.20 h1:/T4p9C9tEN75U3cFMBr5njlP+rBfs4An8BmlQQPbcfE= +github.com/uptrace/bun v1.0.20/go.mod h1:Uv7z0z+7dXnUS9P5hMF0hdiM/4M+xOUHQCrZpyDrpRc= +github.com/uptrace/bun/dialect/pgdialect v1.0.20 h1:1Yajz0M2AhOzvxFEQSAQ8TpqzSRFxYOg+saksIQ0dmU= +github.com/uptrace/bun/dialect/pgdialect v1.0.20/go.mod h1:Z2UoOgTKHXgFOuInXsJKkNQJiFIaPkCvsj0EayOI2yk= +github.com/uptrace/bun/driver/pgdriver v1.0.20 h1:CEWHL5NS5FQIJAJxY40t0llwe8XxVlsblbgi9Upm0fA= +github.com/uptrace/bun/driver/pgdriver v1.0.20/go.mod h1:KAONvCIiI4A6HdMTZ8zCdGxh7P6+23Todz+bL8HRzV4= +github.com/uptrace/bun/extra/bundebug v1.0.20 h1:lwuGUMiqujR3NuGDKgJu1j7XL3LsULSv1MDFHlYBAGs= +github.com/uptrace/bun/extra/bundebug v1.0.20/go.mod h1:tDoi/zmjHkumthaCujwfI2+mni0G41HfJD4HC2oMdpk= +github.com/vmihailenco/msgpack/v5 v5.3.5 h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9znI5mJU= +github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= +github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= +github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= +go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/zap v1.19.1 h1:ue41HOKd1vGURxrmeKIgELGb3jPW9DMUDGtsinblHwI= +go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= +golang.org/x/crypto v0.0.0-20180910181607-0e37d006457b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3 h1:0es+/5331RGQPcXlMfP+WrnIIS6dNnNRe0WB02W0F4M= +golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 h1:CIJ76btIcR3eFI5EgSo6k1qKw9KJexJuRLI9G7Hp5wE= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211123173158-ef496fb156ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa h1:I0YcKz0I7OAhddo7ya8kMnvprhcWM045PmkBdMO9zN0= +google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.43.0 h1:Eeu7bZtDZ2DpRCsLhUlcrLnvYaMK1Gz86a+hMVvELmM= +google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/ini.v1 v1.66.2 h1:XfR1dOYubytKy4Shzc2LHrrGhU0lDCfDGG1yLPmpgsI= +gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +k8s.io/apimachinery v0.23.0 h1:mIfWRMjBuMdolAWJ3Fd+aPTMv3X9z+waiARMpvvb0HQ= +mellium.im/sasl v0.2.1 h1:nspKSRg7/SyO0cRGY71OkfHab8tf9kCts6a6oTDut0w= +mellium.im/sasl v0.2.1/go.mod h1:ROaEDLQNuf9vjKqE1SrAfnsobm2YKXT1gnN1uDp1PjQ= +sigs.k8s.io/controller-runtime v0.11.0 h1:DqO+c8mywcZLFJWILq4iktoECTyn30Bkj0CwgqMpZWQ= +sigs.k8s.io/controller-runtime v0.11.0/go.mod h1:KKwLiTooNGu+JmLZGn9Sl3Gjmfj66eMbCQznLP5zcqA= +sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/components/adminsrv/main.go b/components/adminsrv/main.go new file mode 100644 index 0000000..02e669b --- /dev/null +++ b/components/adminsrv/main.go @@ -0,0 +1,243 @@ +package main + +import ( + "context" + "database/sql" + "fmt" + "net" + "net/http" + goruntime "runtime" + "sync" + "time" + + "github.com/RafaySystems/rcloud-base/components/adminsrv/pkg/service" + pbrpcv3 "github.com/RafaySystems/rcloud-base/components/adminsrv/proto/rpc/v3" + "github.com/RafaySystems/rcloud-base/components/common/pkg/auth/interceptors" + authv3 "github.com/RafaySystems/rcloud-base/components/common/pkg/auth/v3" + "github.com/RafaySystems/rcloud-base/components/common/pkg/gateway" + logv2 "github.com/RafaySystems/rcloud-base/components/common/pkg/log/v2" + configrpc "github.com/RafaySystems/rcloud-base/components/common/proto/rpc/config" + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/spf13/viper" + "github.com/uptrace/bun" + "github.com/uptrace/bun/dialect/pgdialect" + "github.com/uptrace/bun/driver/pgdriver" + "github.com/uptrace/bun/extra/bundebug" + "google.golang.org/grpc" + _grpc "google.golang.org/grpc" + "sigs.k8s.io/controller-runtime/pkg/manager/signals" +) + +const ( + rpcPortEnv = "RPC_PORT" + apiPortEnv = "API_PORT" + debugPortEnv = "DEBUG_PORT" + dbAddrEnv = "DB_ADDR" + dbNameEnv = "DB_NAME" + dbUserEnv = "DB_USER" + dbPasswordEnv = "DB_PASSWORD" + devEnv = "DEV" + configAddrENV = "CONFIG_ADDR" +) + +var ( + rpcPort int + apiPort int + debugPort int + rpcRelayPeeringPort int + dbAddr string + dbName string + dbUser string + dbPassword string + dev bool + db *bun.DB + ps service.PartnerService + os service.OrganizationService + pps service.ProjectService + _log = logv2.GetLogger() + authPool authv3.AuthPool + configPool configrpc.ConfigPool + configAddr string +) + +func setup() { + viper.SetDefault(rpcPortEnv, 10000) + viper.SetDefault(apiPortEnv, 11000) + viper.SetDefault(debugPortEnv, 12000) + viper.SetDefault(dbAddr, ":5432") + viper.SetDefault(dbNameEnv, "admindb") + viper.SetDefault(dbUserEnv, "admindbuser") + viper.SetDefault(dbPasswordEnv, "admindbpassword") + viper.SetDefault(devEnv, true) + viper.SetDefault(configAddrENV, "localhost:7000") + + viper.BindEnv(rpcPortEnv) + viper.BindEnv(apiPortEnv) + viper.BindEnv(debugPortEnv) + viper.BindEnv(dbAddrEnv) + viper.BindEnv(dbNameEnv) + viper.BindEnv(dbPasswordEnv) + viper.BindEnv(dbPasswordEnv) + viper.BindEnv(devEnv) + viper.BindEnv(dbUserEnv) + viper.BindEnv(configAddrENV) + + rpcPort = viper.GetInt(rpcPortEnv) + apiPort = viper.GetInt(apiPortEnv) + debugPort = viper.GetInt(debugPortEnv) + dbAddr = viper.GetString(dbAddrEnv) + dbName = viper.GetString(dbNameEnv) + dbUser = viper.GetString(dbUserEnv) + dbPassword = viper.GetString(dbPasswordEnv) + dev = viper.GetBool(devEnv) + configAddr = viper.GetString(configAddrENV) + + rpcRelayPeeringPort = rpcPort + 1 + + dsn := "postgres://admindbuser:admindbpassword@localhost:5432/admindb?sslmode=disable" + sqldb := sql.OpenDB(pgdriver.NewConnector(pgdriver.WithDSN(dsn))) + + db := bun.NewDB(sqldb, pgdialect.New()) + + db.AddQueryHook(bundebug.NewQueryHook( + bundebug.WithVerbose(true), + bundebug.FromEnv("BUNDEBUG"), + )) + + _log.Infow("printing db", "db", db) + + configPool = configrpc.NewConfigPool(configAddr, 5*goruntime.NumCPU()) + + ps = service.NewPartnerService(db) + os = service.NewOrganizationService(db) + pps = service.NewProjectService(db) +} + +func run() { + + ctx := signals.SetupSignalHandler() + + var wg sync.WaitGroup + + wg.Add(4) + + go runAPI(&wg, ctx) + go runRPC(&wg, ctx) + go runDebug(&wg, ctx) + + <-ctx.Done() + wg.Wait() +} + +func runAPI(wg *sync.WaitGroup, ctx context.Context) { + defer wg.Done() + ctx, cancel := context.WithCancel(ctx) + defer cancel() + mux := http.NewServeMux() + + gwHandler, err := gateway.NewGateway( + ctx, + fmt.Sprintf(":%d", rpcPort), + make([]runtime.ServeMuxOption, 0), + pbrpcv3.RegisterPartnerHandlerFromEndpoint, + pbrpcv3.RegisterOrganizationHandlerFromEndpoint, + pbrpcv3.RegisterProjectHandlerFromEndpoint, + ) + if err != nil { + _log.Fatalw("unable to create gateway", "error", err) + } + + mux.Handle("/", gwHandler) + + s := http.Server{ + Addr: fmt.Sprintf(":%d", apiPort), + Handler: mux, + } + go func() { + defer s.Shutdown(context.TODO()) + <-ctx.Done() + }() + + _log.Infow("starting gateway server", "port", apiPort) + + err = s.ListenAndServe() + if err != nil { + _log.Fatalw("unable to start gateway", "error", err) + } +} + +func runRPC(wg *sync.WaitGroup, ctx context.Context) { + defer wg.Done() + defer ps.Close() + defer configPool.Close() + + partnerServer := pbrpcv3.NewPartnerServer(ps) + organizationServer := pbrpcv3.NewOrganizationServer(os) + projectServer := pbrpcv3.NewProjectServer(pps) + + l, err := net.Listen("tcp", fmt.Sprintf(":%d", rpcPort)) + if err != nil { + _log.Fatalw("unable to start rpc listener", "error", err) + } + + var opts []_grpc.ServerOption + if !dev { + opts = append(opts, _grpc.UnaryInterceptor( + interceptors.NewAuthInterceptorWithOptions( + interceptors.WithLogRequest(), + interceptors.WithAuthPool(authPool), + interceptors.WithExclude("POST", "/v2/sentry/bootstrap/:templateToken/register"), + ), + )) + defer authPool.Close() + } else { + opts = append(opts, _grpc.UnaryInterceptor( + interceptors.NewAuthInterceptorWithOptions(interceptors.WithDummy())), + ) + } + s := grpc.NewServer(opts...) + if err != nil { + _log.Fatalw("unable to create grpc server", "error", err) + } + + go func() { + defer s.GracefulStop() + + <-ctx.Done() + _log.Infow("context done") + }() + + pbrpcv3.RegisterPartnerServer(s, partnerServer) + pbrpcv3.RegisterOrganizationServer(s, organizationServer) + pbrpcv3.RegisterProjectServer(s, projectServer) + + _log.Infow("starting rpc server", "port", rpcPort) + err = s.Serve(l) + if err != nil { + _log.Fatalw("unable to start rpc server", "error", err) + } +} + +func runDebug(wg *sync.WaitGroup, ctx context.Context) { + defer wg.Done() + s := http.Server{ + Addr: fmt.Sprintf(":%d", debugPort), + } + go func() { + err := s.ListenAndServe() + if err != nil { + _log.Fatalw("unable to start debug server", "error", err) + } + }() + + <-ctx.Done() + ctx, cancel := context.WithTimeout(ctx, time.Second*10) + defer cancel() + s.Shutdown(ctx) + +} + +func main() { + setup() + run() +} diff --git a/components/adminsrv/pkg/internal/models/organization.go b/components/adminsrv/pkg/internal/models/organization.go new file mode 100644 index 0000000..920f4a2 --- /dev/null +++ b/components/adminsrv/pkg/internal/models/organization.go @@ -0,0 +1,41 @@ +package models + +import ( + "encoding/json" + "time" + + "github.com/google/uuid" + "github.com/uptrace/bun" +) + +type Organization struct { + bun.BaseModel `bun:"table:authsrv_organization,alias:organization"` + + ID uuid.UUID `bun:"id,type:uuid,pk,default:uuid_generate_v4()"` + Name string `bun:"name,notnull"` + Description string `bun:"description,notnull"` + CreatedAt time.Time `bun:"created_at,notnull,default:current_timestamp"` + ModifiedAt time.Time `bun:"modified_at,notnull,default:current_timestamp"` + Trash bool `bun:"trash,notnull"` + Settings json.RawMessage `bun:"settings,notnull,type:jsonb"` + BillingAddress string `bun:"billing_address,notnull,type:text"` + PartnerId uuid.UUID `bun:"partner_id,notnull,type:uuid"` + Active bool `bun:"active,notnull"` + Approved bool `bun:"approved,notnull"` + Type string `bun:"type,notnull"` + AddressLine1 string `bun:"address_line1,notnull,type:text"` + AddressLine2 string `bun:"address_line2,notnull,type:text"` + City string `bun:"city,notnull,type:text"` + Country string `bun:"country,notnull,type:text"` + Phone string `bun:"phone,notnull,type:text"` + State string `bun:"state,notnull,type:text"` + Zipcode string `bun:"zipcode,notnull,type:text"` + DeletedName string `bun:"deleted_name"` + IsPrivate bool `bun:"is_private"` + IsTOTPEnabled bool `bun:"is_totp_enabled,notnull"` + AreClustersShared bool `bun:"are_clusters_shared,notnull"` + PspsEnabled bool `bun:"psps_enabled,default:true"` + CustomPspsEnabled bool `bun:"custom_psps_enabled"` + DefaultBlueprintsEnabled bool `bun:"default_blueprints_enabled,default:true"` + Referer string `bun:"referer"` +} diff --git a/components/adminsrv/pkg/internal/models/partner.go b/components/adminsrv/pkg/internal/models/partner.go new file mode 100644 index 0000000..b18ba14 --- /dev/null +++ b/components/adminsrv/pkg/internal/models/partner.go @@ -0,0 +1,34 @@ +package models + +import ( + "encoding/json" + "time" + + "github.com/google/uuid" + "github.com/uptrace/bun" +) + +type Partner struct { + bun.BaseModel `bun:"table:authsrv_partner,alias:partner"` + + ID uuid.UUID `bun:"id,type:uuid,pk,default:uuid_generate_v4()"` + Name string `bun:"name,notnull"` + Description string `bun:"description,notnull"` + CreatedAt time.Time `bun:"created_at,notnull,default:current_timestamp"` + ModifiedAt time.Time `bun:"modified_at,notnull,default:current_timestamp"` + Trash bool `bun:"trash,notnull"` + Settings json.RawMessage `bun:"settings,notnull,type:jsonb"` + Host string `bun:"host,notnull"` + Domain string `bun:"domain,notnull"` + TosLink string `bun:"tos_link,notnull"` + LogoLink string `bun:"logo_link,notnull"` + NotificationEmail string `bun:"notification_email,notnull"` + ParentId uuid.UUID `bun:"parent_id,type:uuid"` + HelpdeskEmail string `bun:"partner_helpdesk_email,notnull"` + ProductName string `bun:"partner_product_name"` + SupportTeamName string `bun:"support_team_name,notnull"` + OpsHost string `bun:"ops_host,notnull"` + FavIconLink string `bun:"fav_icon_link,notnull"` + IsTOTPEnabled bool `bun:"is_totp_enabled,notnull"` + IsSyntheticPartnerEnabled bool `bun:"is_synthetic_partner_enabled,notnull"` +} diff --git a/components/adminsrv/pkg/internal/models/project.go b/components/adminsrv/pkg/internal/models/project.go new file mode 100644 index 0000000..f570419 --- /dev/null +++ b/components/adminsrv/pkg/internal/models/project.go @@ -0,0 +1,22 @@ +package models + +import ( + "time" + + "github.com/google/uuid" + "github.com/uptrace/bun" +) + +type Project struct { + bun.BaseModel `bun:"table:authsrv_project,alias:project"` + + ID uuid.UUID `bun:"id,type:uuid,pk,default:uuid_generate_v4()"` + Name string `bun:"name,notnull"` + Description string `bun:"description,notnull"` + CreatedAt time.Time `bun:"created_at,notnull,default:current_timestamp"` + ModifiedAt time.Time `bun:"modified_at,notnull,default:current_timestamp"` + Trash bool `bun:"trash,notnull"` + OrganizationId uuid.UUID `bun:"organization_id,type:uuid"` + PartnerId uuid.UUID `bun:"partner_id,type:uuid"` + Default bool `bun:"default,notnull"` +} diff --git a/components/adminsrv/pkg/internal/persistence/provider/pg/entity_dao.go b/components/adminsrv/pkg/internal/persistence/provider/pg/entity_dao.go new file mode 100644 index 0000000..5d55f68 --- /dev/null +++ b/components/adminsrv/pkg/internal/persistence/provider/pg/entity_dao.go @@ -0,0 +1,98 @@ +package pg + +import ( + "context" + + "github.com/google/uuid" + bun "github.com/uptrace/bun" +) + +// DAO is the interface for database operations +type EntityDAO interface { + Close() error + // create entity + Create(ctx context.Context, entity interface{}) (interface{}, error) + // get entity by id + GetByID(ctx context.Context, id uuid.UUID, entity interface{}) (interface{}, error) + // get entity by name + GetByName(ctx context.Context, name string, entity interface{}) (interface{}, error) + //Update entity + Update(ctx context.Context, id uuid.UUID, entity interface{}) (interface{}, error) + // delete entity + Delete(ctx context.Context, id uuid.UUID, entity interface{}) error + // get list of entities + List(ctx context.Context, partnerId uuid.NullUUID, organizationId uuid.NullUUID, entities interface{}) (interface{}, error) +} + +type entityDAO struct { + db *bun.DB +} + +func (dao *entityDAO) Close() error { + return dao.db.Close() +} + +// NewEntityDao return new entity dao +func NewEntityDAO(db *bun.DB) EntityDAO { + return &entityDAO{db} +} + +func (dao *entityDAO) Create(ctx context.Context, entity interface{}) (interface{}, error) { + + if _, err := dao.db.NewInsert().Model(entity).Exec(ctx); err != nil { + return nil, err + } + + return entity, nil +} + +func (dao *entityDAO) GetByID(ctx context.Context, id uuid.UUID, entity interface{}) (interface{}, error) { + + err := dao.db.NewSelect().Model(entity). + Where("id = ?", id). + Scan(ctx) + if err != nil { + return nil, err + } + + return entity, nil +} + +func (dao *entityDAO) GetByName(ctx context.Context, name string, entity interface{}) (interface{}, error) { + + err := dao.db.NewSelect().Model(entity). + Where("name = ?", name). + Scan(ctx) + if err != nil { + return nil, err + } + + return entity, nil +} + +func (dao *entityDAO) Update(ctx context.Context, id uuid.UUID, entity interface{}) (interface{}, error) { + if _, err := dao.db.NewUpdate().Model(entity).Where("id = ?", id).Exec(ctx); err != nil { + return nil, err + } + return entity, nil +} + +func (dao *entityDAO) Delete(ctx context.Context, id uuid.UUID, entity interface{}) error { + _, err := dao.db.NewDelete(). + Model(entity). + Where("id = ?", id). + Exec(ctx) + return err +} + +func (dao *entityDAO) List(ctx context.Context, partnerId uuid.NullUUID, organizationId uuid.NullUUID, entities interface{}) (interface{}, error) { + sq := dao.db.NewSelect().Model(entities) + if partnerId.Valid { + sq = sq.Where("partner_id = ?", partnerId) + } + if organizationId.Valid { + sq = sq.Where("organization_id = ?", organizationId) + } + err := sq.Scan(ctx) + return entities, err +} diff --git a/components/adminsrv/pkg/service/organization.go b/components/adminsrv/pkg/service/organization.go new file mode 100644 index 0000000..e7bd5e1 --- /dev/null +++ b/components/adminsrv/pkg/service/organization.go @@ -0,0 +1,468 @@ +package service + +import ( + "context" + "encoding/json" + "fmt" + "time" + + "github.com/RafaySystems/rcloud-base/components/adminsrv/pkg/internal/models" + "github.com/RafaySystems/rcloud-base/components/adminsrv/pkg/internal/persistence/provider/pg" + systemv3 "github.com/RafaySystems/rcloud-base/components/adminsrv/proto/types/systempb/v3" + v3 "github.com/RafaySystems/rcloud-base/components/common/proto/types/commonpb/v3" + "github.com/google/uuid" + bun "github.com/uptrace/bun" + "google.golang.org/protobuf/types/known/timestamppb" +) + +const ( + organizationKind = "Organization" + organizationListKind = "OrganizationList" +) + +// OrganizationService is the interface for organization operations +type OrganizationService interface { + Close() error + // create organization + Create(ctx context.Context, organization *systemv3.Organization) (*systemv3.Organization, error) + // get organization by id + GetByID(ctx context.Context, id string) (*systemv3.Organization, error) + // get organization by id + GetByName(ctx context.Context, name string) (*systemv3.Organization, error) + // create or update organization + Update(ctx context.Context, organization *systemv3.Organization) (*systemv3.Organization, error) + // delete organization + Delete(ctx context.Context, organization *systemv3.Organization) (*systemv3.Organization, error) + // list organization + List(ctx context.Context, organization *systemv3.Organization) (*systemv3.OrganizationList, error) +} + +// organizationService implements OrganizationService +type organizationService struct { + dao pg.EntityDAO +} + +// NewOrganizationService return new organization service +func NewOrganizationService(db *bun.DB) OrganizationService { + return &organizationService{ + dao: pg.NewEntityDAO(db), + } +} + +func (s *organizationService) Create(ctx context.Context, org *systemv3.Organization) (*systemv3.Organization, error) { + + partnerId, _ := uuid.Parse(org.GetMetadata().GetPartner()) + + //update default organization setting values + org.Spec.Settings = &systemv3.OrganizationSettings{ + Lockout: &systemv3.Lockout{ + Enabled: true, + PeriodMin: 15, + Attempts: 5, + }, + IdleLogoutMin: 60, + } + sb, err := json.MarshalIndent(org.GetSpec().GetSettings(), "", "\t") + if err != nil { + org.Status = &v3.Status{ + ConditionType: "Create", + ConditionStatus: v3.ConditionStatus_StatusFailed, + LastUpdated: timestamppb.Now(), + Reason: err.Error(), + } + } + //convert v3 spec to internal models + organization := models.Organization{ + Name: org.GetMetadata().GetName(), + Description: org.GetMetadata().GetDescription(), + Trash: false, + Settings: json.RawMessage(sb), + BillingAddress: org.GetSpec().GetBillingAddress(), + PartnerId: partnerId, + Active: org.GetSpec().GetActive(), + Approved: org.GetSpec().GetApproved(), + Type: org.GetSpec().GetType(), + AddressLine1: org.GetSpec().GetAddressLine1(), + AddressLine2: org.GetSpec().GetAddressLine2(), + City: org.GetSpec().GetCity(), + Country: org.GetSpec().GetCountry(), + Phone: org.GetSpec().GetPhone(), + State: org.GetSpec().GetState(), + Zipcode: org.GetSpec().GetZipcode(), + IsPrivate: org.GetSpec().GetIsPrivate(), + IsTOTPEnabled: org.GetSpec().GetIsTotpEnabled(), + AreClustersShared: org.GetSpec().GetAreClustersShared(), + CreatedAt: time.Now(), + ModifiedAt: time.Now(), + } + entity, err := s.dao.Create(ctx, &organization) + if err != nil { + org.Status = &v3.Status{ + ConditionType: "Create", + ConditionStatus: v3.ConditionStatus_StatusFailed, + LastUpdated: timestamppb.Now(), + Reason: err.Error(), + } + return org, err + } + + if createdOrg, ok := entity.(*models.Organization); ok { + //update v3 spec + org.Metadata.Id = createdOrg.ID.String() + org.Status = &v3.Status{ + ConditionType: "Create", + ConditionStatus: v3.ConditionStatus_StatusOK, + LastUpdated: timestamppb.Now(), + } + } + + return org, nil +} + +func (s *organizationService) GetByID(ctx context.Context, id string) (*systemv3.Organization, error) { + + organization := &systemv3.Organization{ + ApiVersion: apiVersion, + Kind: organizationKind, + Metadata: &v3.Metadata{ + Id: id, + }, + Spec: &systemv3.OrganizationSpec{}, + } + + uid, err := uuid.Parse(id) + if err != nil { + organization.Status = &v3.Status{ + ConditionType: "Describe", + LastUpdated: timestamppb.Now(), + ConditionStatus: v3.ConditionStatus_StatusFailed, + } + return organization, err + } + entity, err := s.dao.GetByID(ctx, uid, &models.Organization{}) + if err != nil { + organization.Status = &v3.Status{ + ConditionType: "Describe", + LastUpdated: timestamppb.Now(), + ConditionStatus: v3.ConditionStatus_StatusFailed, + } + return organization, err + } + + if org, ok := entity.(*models.Organization); ok { + + var settings systemv3.OrganizationSettings + err := json.Unmarshal(org.Settings, &settings) + if err != nil { + organization.Status = &v3.Status{ + ConditionType: "Describe", + LastUpdated: timestamppb.Now(), + ConditionStatus: v3.ConditionStatus_StatusFailed, + } + return organization, err + } + + organization.Metadata = &v3.Metadata{ + Name: org.Name, + Description: org.Description, + Id: org.ID.String(), + Partner: org.PartnerId.String(), + ModifiedAt: timestamppb.New(org.ModifiedAt), + } + organization.Spec = &systemv3.OrganizationSpec{ + BillingAddress: org.BillingAddress, + Active: org.Active, + Approved: org.Approved, + Type: org.Type, + AddressLine1: org.AddressLine1, + AddressLine2: org.AddressLine2, + City: org.City, + Country: org.Country, + Phone: org.Phone, + State: org.State, + Zipcode: org.Zipcode, + IsPrivate: org.IsPrivate, + IsTotpEnabled: org.IsTOTPEnabled, + AreClustersShared: org.AreClustersShared, + Settings: &settings, + } + organization.Status = &v3.Status{ + ConditionType: "Describe", + LastUpdated: timestamppb.Now(), + ConditionStatus: v3.ConditionStatus_StatusOK, + } + + return organization, nil + + } else { + organization := &systemv3.Organization{ + ApiVersion: apiVersion, + Kind: organizationKind, + Metadata: &v3.Metadata{ + Id: id, + }, + Status: &v3.Status{ + ConditionType: "Describe", + ConditionStatus: v3.ConditionStatus_StatusNotSet, + Reason: "Unable to fetch organization information", + LastUpdated: timestamppb.Now(), + }, + } + + return organization, nil + } + +} + +func (s *organizationService) GetByName(ctx context.Context, name string) (*systemv3.Organization, error) { + + organization := &systemv3.Organization{ + ApiVersion: apiVersion, + Kind: organizationKind, + Metadata: &v3.Metadata{ + Name: name, + }, + } + entity, err := s.dao.GetByName(ctx, name, &models.Organization{}) + if err != nil { + organization.Metadata = &v3.Metadata{ + Name: name, + } + organization.Status = &v3.Status{ + ConditionType: "Describe", + ConditionStatus: v3.ConditionStatus_StatusFailed, + Reason: err.Error(), + LastUpdated: timestamppb.Now(), + } + return organization, err + } + + if org, ok := entity.(*models.Organization); ok { + + var settings systemv3.OrganizationSettings + err := json.Unmarshal(org.Settings, &settings) + if err != nil { + organization.Status = &v3.Status{ + ConditionType: "Describe", + ConditionStatus: v3.ConditionStatus_StatusFailed, + } + return organization, err + } + + organization.Metadata = &v3.Metadata{ + Name: org.Name, + Description: org.Description, + Id: org.ID.String(), + Partner: org.PartnerId.String(), + ModifiedAt: timestamppb.New(org.ModifiedAt), + } + organization.Spec = &systemv3.OrganizationSpec{ + BillingAddress: org.BillingAddress, + Active: org.Active, + Approved: org.Approved, + Type: org.Type, + AddressLine1: org.AddressLine1, + AddressLine2: org.AddressLine2, + City: org.City, + Country: org.Country, + Phone: org.Phone, + State: org.State, + Zipcode: org.Zipcode, + IsPrivate: org.IsPrivate, + IsTotpEnabled: org.IsTOTPEnabled, + AreClustersShared: org.AreClustersShared, + Settings: &settings, + } + organization.Status = &v3.Status{ + ConditionType: "Describe", + LastUpdated: timestamppb.Now(), + ConditionStatus: v3.ConditionStatus_StatusOK, + } + } + + return organization, nil +} + +func (s *organizationService) Update(ctx context.Context, organization *systemv3.Organization) (*systemv3.Organization, error) { + + id, _ := uuid.Parse(organization.Metadata.Id) + entity, err := s.dao.GetByID(ctx, id, &models.Organization{}) + if err != nil { + organization.Status = &v3.Status{ + ConditionType: "Update", + ConditionStatus: v3.ConditionStatus_StatusFailed, + Reason: err.Error(), + LastUpdated: timestamppb.Now(), + } + return organization, err + } + + if org, ok := entity.(*models.Organization); ok { + + sb, err := json.MarshalIndent(organization.GetSpec().GetSettings(), "", "\t") + if err != nil { + organization.Status = &v3.Status{ + ConditionType: "Update", + ConditionStatus: v3.ConditionStatus_StatusFailed, + Reason: err.Error(), + LastUpdated: timestamppb.Now(), + } + } + + //update organization details + org.Name = organization.GetMetadata().GetName() + org.Description = organization.GetMetadata().GetDescription() + org.ModifiedAt = time.Now() + org.Trash = false + org.Settings = json.RawMessage(sb) + org.BillingAddress = organization.GetSpec().GetBillingAddress() + org.Active = organization.GetSpec().GetActive() + org.Approved = organization.GetSpec().GetApproved() + org.Type = organization.GetSpec().GetType() + org.AddressLine1 = organization.GetSpec().GetAddressLine1() + org.AddressLine2 = organization.GetSpec().GetAddressLine2() + org.City = organization.GetSpec().GetCity() + org.Country = organization.GetSpec().GetCountry() + org.Phone = organization.GetSpec().GetPhone() + org.State = organization.GetSpec().GetState() + org.Zipcode = organization.GetSpec().GetZipcode() + org.IsPrivate = organization.GetSpec().GetIsPrivate() + org.IsTOTPEnabled = organization.GetSpec().GetIsTotpEnabled() + org.AreClustersShared = organization.GetSpec().GetAreClustersShared() + + _, err = s.dao.Update(ctx, id, org) + if err != nil { + organization.Status = &v3.Status{ + ConditionType: "Update", + ConditionStatus: v3.ConditionStatus_StatusFailed, + LastUpdated: timestamppb.Now(), + Reason: err.Error(), + } + return organization, err + } + + //update status + if organization.Status != nil { + organization.Status = &v3.Status{ + ConditionType: "Update", + ConditionStatus: v3.ConditionStatus_StatusOK, + LastUpdated: timestamppb.Now(), + } + } + } + + return organization, nil +} + +func (s *organizationService) Delete(ctx context.Context, organization *systemv3.Organization) (*systemv3.Organization, error) { + id, err := uuid.Parse(organization.Metadata.Id) + if err != nil { + return nil, err + } + entity, err := s.dao.GetByID(ctx, id, &models.Organization{}) + if err != nil { + organization.Status = &v3.Status{ + ConditionType: "Delete", + ConditionStatus: v3.ConditionStatus_StatusFailed, + Reason: err.Error(), + LastUpdated: timestamppb.Now(), + } + return organization, err + } + + if org, ok := entity.(*models.Organization); ok { + err = s.dao.Delete(ctx, id, org) + if err != nil { + organization.Status = &v3.Status{ + ConditionType: "Delete", + ConditionStatus: v3.ConditionStatus_StatusFailed, + Reason: err.Error(), + LastUpdated: timestamppb.Now(), + } + return organization, err + } + //update v3 status + organization.Metadata.Id = org.ID.String() + organization.Metadata.Name = org.Name + organization.Metadata.ModifiedAt = timestamppb.New(org.ModifiedAt) + organization.Status = &v3.Status{ + ConditionType: "Deleted", + ConditionStatus: v3.ConditionStatus_StatusOK, + LastUpdated: timestamppb.Now(), + } + } + return organization, nil + +} + +func (s *organizationService) List(ctx context.Context, organization *systemv3.Organization) (*systemv3.OrganizationList, error) { + + var organizations []*systemv3.Organization + organinzationList := &systemv3.OrganizationList{ + ApiVersion: apiVersion, + Kind: organizationListKind, + Metadata: &v3.ListMetadata{ + Count: 0, + }, + } + if len(organization.Metadata.Partner) > 0 { + id, err := uuid.Parse(organization.Metadata.Partner) + if err != nil { + return organinzationList, err + } + var orgs []models.Organization + entities, err := s.dao.List(ctx, uuid.NullUUID{UUID: id, Valid: true}, uuid.NullUUID{UUID: uuid.Nil}, &orgs) + if err != nil { + return organinzationList, err + } + if orgs, ok := entities.(*[]models.Organization); ok { + for _, org := range *orgs { + var settings systemv3.OrganizationSettings + err := json.Unmarshal(org.Settings, &settings) + if err != nil { + fmt.Print(err) + return nil, err + } + organization.Metadata = &v3.Metadata{ + Name: org.Name, + Description: org.Description, + Id: org.ID.String(), + Partner: org.PartnerId.String(), + ModifiedAt: timestamppb.New(org.ModifiedAt), + } + organization.Spec = &systemv3.OrganizationSpec{ + BillingAddress: org.BillingAddress, + Active: org.Active, + Approved: org.Approved, + Type: org.Type, + AddressLine1: org.AddressLine1, + AddressLine2: org.AddressLine2, + City: org.City, + Country: org.Country, + Phone: org.Phone, + State: org.State, + Zipcode: org.Zipcode, + IsPrivate: org.IsPrivate, + IsTotpEnabled: org.IsTOTPEnabled, + AreClustersShared: org.AreClustersShared, + Settings: &settings, + } + organizations = append(organizations, organization) + } + + //update the list metadata and items response + organinzationList.Metadata = &v3.ListMetadata{ + Count: int64(len(organizations)), + } + organinzationList.Items = organizations + } + + } else { + return organinzationList, fmt.Errorf("missing partner id in metadata") + } + return organinzationList, nil +} + +func (s *organizationService) Close() error { + return s.dao.Close() +} diff --git a/components/adminsrv/pkg/service/partner.go b/components/adminsrv/pkg/service/partner.go new file mode 100644 index 0000000..5d2a393 --- /dev/null +++ b/components/adminsrv/pkg/service/partner.go @@ -0,0 +1,362 @@ +package service + +import ( + "context" + "encoding/json" + "time" + + "github.com/RafaySystems/rcloud-base/components/adminsrv/pkg/internal/models" + "github.com/RafaySystems/rcloud-base/components/adminsrv/pkg/internal/persistence/provider/pg" + systemv3 "github.com/RafaySystems/rcloud-base/components/adminsrv/proto/types/systempb/v3" + v3 "github.com/RafaySystems/rcloud-base/components/common/proto/types/commonpb/v3" + "github.com/google/uuid" + bun "github.com/uptrace/bun" + "google.golang.org/protobuf/types/known/timestamppb" +) + +const ( + apiVersion = "system.k8smgmt.io/v3" + partnerKind = "Partner" +) + +// PartnerService is the interface for partner operations +type PartnerService interface { + Close() error + // create partner + Create(ctx context.Context, partner *systemv3.Partner) (*systemv3.Partner, error) + // get partner by id + GetByID(ctx context.Context, partnerId string) (*systemv3.Partner, error) + // get partner by id + GetByName(ctx context.Context, name string) (*systemv3.Partner, error) + // create or update partner + Update(ctx context.Context, partner *systemv3.Partner) (*systemv3.Partner, error) + // delete partner + Delete(ctx context.Context, partner *systemv3.Partner) (*systemv3.Partner, error) +} + +// partnerService implements PartnerService +type partnerService struct { + dao pg.EntityDAO +} + +// NewPartnerService return new partner service +func NewPartnerService(db *bun.DB) PartnerService { + return &partnerService{ + dao: pg.NewEntityDAO(db), + } +} + +func (s *partnerService) Create(ctx context.Context, partner *systemv3.Partner) (*systemv3.Partner, error) { + + var sb []byte + if partner.GetSpec().GetSettings() != nil { + sb = json.RawMessage(partner.GetSpec().GetSettings().String()) + } + //convert v3 spec to internal models + part := models.Partner{ + Name: partner.GetMetadata().GetName(), + Description: partner.GetMetadata().GetDescription(), + Trash: false, + Settings: sb, + Host: partner.GetSpec().GetHost(), + Domain: partner.GetSpec().GetDomain(), + TosLink: partner.GetSpec().GetTosLink(), + LogoLink: partner.GetSpec().GetLogoLink(), + NotificationEmail: partner.GetSpec().GetNotificationEmail(), + HelpdeskEmail: partner.GetSpec().GetHelpdeskEmail(), + ProductName: partner.GetSpec().GetProductName(), + SupportTeamName: partner.GetSpec().GetSupportTeamName(), + OpsHost: partner.GetSpec().GetOpsHost(), + FavIconLink: partner.GetSpec().GetFavIconLink(), + IsTOTPEnabled: partner.GetSpec().GetIsTOTPEnabled(), + IsSyntheticPartnerEnabled: false, + CreatedAt: time.Now(), + ModifiedAt: time.Now(), + } + entity, err := s.dao.Create(ctx, &part) + if err != nil { + partner.Status = &v3.Status{ + ConditionStatus: v3.ConditionStatus_StatusFailed, + Reason: err.Error(), + } + return partner, err + } + + if createdPartner, ok := entity.(*models.Partner); ok { + //update v3 spec + partner.Metadata.Id = createdPartner.ID.String() + partner.Metadata.ModifiedAt = timestamppb.New(createdPartner.ModifiedAt) + if partner.Status != nil { + partner.Status = &v3.Status{ + ConditionStatus: v3.ConditionStatus_StatusOK, + LastUpdated: timestamppb.Now(), + } + } + } + + return partner, nil + +} + +func (s *partnerService) GetByID(ctx context.Context, id string) (*systemv3.Partner, error) { + + partner := &systemv3.Partner{ + ApiVersion: apiVersion, + Kind: partnerKind, + Metadata: &v3.Metadata{ + Id: id, + }, + } + + uid, err := uuid.Parse(id) + if err != nil { + partner.Status = &v3.Status{ + ConditionType: "Describe", + ConditionStatus: v3.ConditionStatus_StatusFailed, + Reason: err.Error(), + LastUpdated: timestamppb.Now(), + } + return partner, err + } + entity, err := s.dao.GetByID(ctx, uid, &models.Partner{}) + if err != nil { + partner.Status = &v3.Status{ + ConditionType: "Describe", + ConditionStatus: v3.ConditionStatus_StatusFailed, + Reason: err.Error(), + LastUpdated: timestamppb.Now(), + } + return partner, err + } + + if part, ok := entity.(*models.Partner); ok { + + partner.Metadata = &v3.Metadata{ + Name: part.Name, + Description: part.Description, + Id: part.ID.String(), + ModifiedAt: timestamppb.New(part.ModifiedAt), + } + partner.Spec = &systemv3.PartnerSpec{ + Host: part.Host, + Domain: part.Domain, + TosLink: part.TosLink, + LogoLink: part.LogoLink, + NotificationEmail: part.NotificationEmail, + HelpdeskEmail: part.HelpdeskEmail, + ProductName: part.ProductName, + SupportTeamName: part.SupportTeamName, + OpsHost: part.OpsHost, + FavIconLink: part.FavIconLink, + IsTOTPEnabled: part.IsTOTPEnabled, + Settings: nil, //TODO + } + partner.Status = &v3.Status{ + ConditionType: "Describe", + ConditionStatus: v3.ConditionStatus_StatusOK, + LastUpdated: timestamppb.New(part.ModifiedAt), + } + + return partner, nil + + } else { + partner := &systemv3.Partner{ + ApiVersion: apiVersion, + Kind: partnerKind, + Metadata: &v3.Metadata{ + Id: id, + }, + Status: &v3.Status{ + ConditionStatus: v3.ConditionStatus_StatusNotSet, + Reason: "Unable to fetch partner information", + LastUpdated: timestamppb.Now(), + }, + } + + return partner, nil + } + +} + +func (s *partnerService) GetByName(ctx context.Context, name string) (*systemv3.Partner, error) { + + partner := &systemv3.Partner{ + ApiVersion: apiVersion, + Kind: partnerKind, + Metadata: &v3.Metadata{ + Name: name, + }, + } + + entity, err := s.dao.GetByName(ctx, name, &models.Partner{}) + if err != nil { + partner.Status = &v3.Status{ + ConditionType: "Describe", + ConditionStatus: v3.ConditionStatus_StatusFailed, + Reason: err.Error(), + LastUpdated: timestamppb.Now(), + } + return partner, err + } + + if part, ok := entity.(*models.Partner); ok { + + partner.Metadata = &v3.Metadata{ + Name: part.Name, + Description: part.Description, + Id: part.ID.String(), + ModifiedAt: timestamppb.New(part.ModifiedAt), + } + partner.Spec = &systemv3.PartnerSpec{ + Host: part.Host, + Domain: part.Domain, + TosLink: part.TosLink, + LogoLink: part.LogoLink, + NotificationEmail: part.NotificationEmail, + HelpdeskEmail: part.HelpdeskEmail, + ProductName: part.ProductName, + SupportTeamName: part.SupportTeamName, + OpsHost: part.OpsHost, + FavIconLink: part.FavIconLink, + IsTOTPEnabled: part.IsTOTPEnabled, + Settings: nil, //TODO + } + partner.Status = &v3.Status{ + ConditionType: "Describe", + ConditionStatus: v3.ConditionStatus_StatusOK, + LastUpdated: timestamppb.New(part.ModifiedAt), + } + + return partner, nil + } else { + partner := &systemv3.Partner{ + ApiVersion: apiVersion, + Kind: partnerKind, + Metadata: &v3.Metadata{ + Name: name, + }, + Status: &v3.Status{ + ConditionType: "Describe", + ConditionStatus: v3.ConditionStatus_StatusNotSet, + Reason: "Unable to fetch partner information", + LastUpdated: timestamppb.Now(), + }, + } + + return partner, nil + } + +} + +func (s *partnerService) Update(ctx context.Context, partner *systemv3.Partner) (*systemv3.Partner, error) { + + id, _ := uuid.Parse(partner.Metadata.Id) + entity, err := s.dao.GetByID(ctx, id, &models.Partner{}) + if err != nil { + partner.Status = &v3.Status{ + ConditionStatus: v3.ConditionStatus_StatusFailed, + Reason: err.Error(), + LastUpdated: timestamppb.Now(), + } + return partner, err + } + + var sb []byte + if partner.GetSpec().GetSettings() != nil { + sb = json.RawMessage(partner.GetSpec().GetSettings().String()) + } + + if part, ok := entity.(*models.Partner); ok { + //update partner details + part.ID = id + part.Name = partner.GetMetadata().Name + part.Description = partner.GetMetadata().GetDescription() + part.Settings = sb + part.Host = partner.GetSpec().GetHost() + part.Domain = partner.GetSpec().GetDomain() + part.TosLink = partner.GetSpec().GetTosLink() + part.LogoLink = partner.GetSpec().GetLogoLink() + part.NotificationEmail = partner.GetSpec().GetNotificationEmail() + part.HelpdeskEmail = partner.GetSpec().GetHelpdeskEmail() + part.ProductName = partner.GetSpec().GetProductName() + part.SupportTeamName = partner.GetSpec().GetSupportTeamName() + part.OpsHost = partner.GetSpec().GetOpsHost() + part.FavIconLink = partner.GetSpec().GetFavIconLink() + part.IsTOTPEnabled = partner.GetSpec().GetIsTOTPEnabled() + part.ModifiedAt = time.Now() + + //Update the partner details + _, err = s.dao.Update(ctx, id, part) + if err != nil { + partner.Status = &v3.Status{ + ConditionStatus: v3.ConditionStatus_StatusFailed, + Reason: err.Error(), + LastUpdated: timestamppb.Now(), + } + return partner, err + } + + //update metadata and status + partner.Metadata.ModifiedAt = timestamppb.New(part.ModifiedAt) + partner.Status = &v3.Status{ + ConditionStatus: v3.ConditionStatus_StatusOK, + LastUpdated: timestamppb.Now(), + } + + } + + return partner, nil +} + +func (s *partnerService) Delete(ctx context.Context, partner *systemv3.Partner) (*systemv3.Partner, error) { + id, err := uuid.Parse(partner.Metadata.Id) + if err != nil { + partner.Status = &v3.Status{ + ConditionType: "Delete", + ConditionStatus: v3.ConditionStatus_StatusFailed, + Reason: err.Error(), + LastUpdated: timestamppb.Now(), + } + return partner, err + } + entity, err := s.dao.GetByID(ctx, id, &models.Partner{}) + if err != nil { + partner.Status = &v3.Status{ + ConditionType: "Delete", + ConditionStatus: v3.ConditionStatus_StatusFailed, + Reason: err.Error(), + LastUpdated: timestamppb.Now(), + } + return partner, err + } + + if part, ok := entity.(*models.Partner); ok { + err = s.dao.Delete(ctx, id, part) + if err != nil { + partner.Status = &v3.Status{ + ConditionType: "Delete", + ConditionStatus: v3.ConditionStatus_StatusFailed, + Reason: err.Error(), + LastUpdated: timestamppb.Now(), + } + return partner, err + } + //update status + if partner != nil { + partner.Metadata.Id = part.ID.String() + partner.Metadata.Name = part.Name + partner.Status = &v3.Status{ + ConditionStatus: v3.ConditionStatus_StatusOK, + ConditionType: "Delete", + } + } + return partner, nil + } + + return partner, nil + +} + +func (s *partnerService) Close() error { + return s.dao.Close() +} diff --git a/components/adminsrv/pkg/service/project.go b/components/adminsrv/pkg/service/project.go new file mode 100644 index 0000000..17cbb2b --- /dev/null +++ b/components/adminsrv/pkg/service/project.go @@ -0,0 +1,355 @@ +package service + +import ( + "context" + "fmt" + "time" + + "github.com/RafaySystems/rcloud-base/components/adminsrv/pkg/internal/models" + "github.com/RafaySystems/rcloud-base/components/adminsrv/pkg/internal/persistence/provider/pg" + systemv3 "github.com/RafaySystems/rcloud-base/components/adminsrv/proto/types/systempb/v3" + v3 "github.com/RafaySystems/rcloud-base/components/common/proto/types/commonpb/v3" + "github.com/google/uuid" + bun "github.com/uptrace/bun" + "google.golang.org/protobuf/types/known/timestamppb" +) + +const ( + projectKind = "Project" + projectListKind = "ProjectList" +) + +// ProjectService is the interface for project operations +type ProjectService interface { + Close() error + // create project + Create(ctx context.Context, project *systemv3.Project) (*systemv3.Project, error) + // get project by id + GetByID(ctx context.Context, id string) (*systemv3.Project, error) + // get project by name + GetByName(ctx context.Context, name string) (*systemv3.Project, error) + // create or update project + Update(ctx context.Context, project *systemv3.Project) (*systemv3.Project, error) + // delete project + Delete(ctx context.Context, project *systemv3.Project) (*systemv3.Project, error) + // list projects + List(ctx context.Context, project *systemv3.Project) (*systemv3.ProjectList, error) + //TODO Associate project with groups, user, roles +} + +// projectService implements ProjectService +type projectService struct { + dao pg.EntityDAO +} + +// NewProjectService return new project service +func NewProjectService(db *bun.DB) ProjectService { + return &projectService{ + dao: pg.NewEntityDAO(db), + } +} + +func (s *projectService) Create(ctx context.Context, project *systemv3.Project) (*systemv3.Project, error) { + + partnerId, _ := uuid.Parse(project.GetMetadata().GetPartner()) + organizationId, _ := uuid.Parse(project.GetMetadata().GetOrganization()) + //convert v3 spec to internal models + proj := models.Project{ + Name: project.GetMetadata().GetName(), + Description: project.GetMetadata().GetDescription(), + CreatedAt: time.Now(), + ModifiedAt: time.Now(), + Trash: false, + OrganizationId: organizationId, + PartnerId: partnerId, + Default: project.GetSpec().GetDefault(), + } + entity, err := s.dao.Create(ctx, &proj) + if err != nil { + project.Status = &v3.Status{ + ConditionType: "Create", + ConditionStatus: v3.ConditionStatus_StatusFailed, + LastUpdated: timestamppb.Now(), + } + return project, err + } + + //update v3 spec + if createdProject, ok := entity.(*models.Project); ok { + project.Metadata.Id = createdProject.ID.String() + project.Spec = &systemv3.ProjectSpec{ + Default: createdProject.Default, + } + if project.Status != nil { + project.Status = &v3.Status{ + ConditionType: "Create", + ConditionStatus: v3.ConditionStatus_StatusOK, + LastUpdated: timestamppb.Now(), + } + } + } + + return project, nil + +} + +func (s *projectService) GetByID(ctx context.Context, id string) (*systemv3.Project, error) { + + project := &systemv3.Project{ + ApiVersion: apiVersion, + Kind: projectKind, + Metadata: &v3.Metadata{ + Id: id, + }, + } + + uid, err := uuid.Parse(id) + if err != nil { + project.Status = &v3.Status{ + ConditionType: "Describe", + ConditionStatus: v3.ConditionStatus_StatusFailed, + LastUpdated: timestamppb.Now(), + Reason: err.Error(), + } + return project, err + } + entity, err := s.dao.GetByID(ctx, uid, &models.Project{}) + if err != nil { + project.Status = &v3.Status{ + ConditionType: "Describe", + ConditionStatus: v3.ConditionStatus_StatusFailed, + LastUpdated: timestamppb.Now(), + Reason: err.Error(), + } + return project, err + } + + if proj, ok := entity.(*models.Project); ok { + labels := make(map[string]string) + labels["organization"] = proj.OrganizationId.String() + + project.Metadata = &v3.Metadata{ + Name: proj.Name, + Description: proj.Description, + Id: proj.ID.String(), + Organization: proj.OrganizationId.String(), + Partner: proj.PartnerId.String(), + Labels: labels, + ModifiedAt: timestamppb.New(proj.ModifiedAt), + } + project.Spec = &systemv3.ProjectSpec{ + Default: proj.Default, + } + project.Status = &v3.Status{ + LastUpdated: timestamppb.Now(), + ConditionType: "Describe", + ConditionStatus: v3.ConditionStatus_StatusOK, + } + + return project, nil + } + return project, nil + +} + +func (s *projectService) GetByName(ctx context.Context, name string) (*systemv3.Project, error) { + + project := &systemv3.Project{ + ApiVersion: apiVersion, + Kind: projectKind, + Metadata: &v3.Metadata{ + Name: name, + }, + } + + entity, err := s.dao.GetByName(ctx, name, &models.Project{}) + if err != nil { + project.Status = &v3.Status{ + ConditionType: "Describe", + ConditionStatus: v3.ConditionStatus_StatusFailed, + LastUpdated: timestamppb.Now(), + Reason: err.Error(), + } + return project, err + } + + if proj, ok := entity.(*models.Project); ok { + labels := make(map[string]string) + labels["organization"] = proj.OrganizationId.String() + + project.Metadata = &v3.Metadata{ + Name: proj.Name, + Description: proj.Description, + Id: proj.ID.String(), + Organization: proj.OrganizationId.String(), + Partner: proj.PartnerId.String(), + Labels: labels, + ModifiedAt: timestamppb.New(proj.ModifiedAt), + } + project.Spec = &systemv3.ProjectSpec{ + Default: proj.Default, + } + project.Status = &v3.Status{ + LastUpdated: timestamppb.Now(), + ConditionType: "Describe", + ConditionStatus: v3.ConditionStatus_StatusOK, + } + + return project, nil + } + return project, nil + +} + +func (s *projectService) Update(ctx context.Context, project *systemv3.Project) (*systemv3.Project, error) { + + id, _ := uuid.Parse(project.Metadata.Id) + entity, err := s.dao.GetByID(ctx, id, &models.Project{}) + if err != nil { + project.Status = &v3.Status{ + ConditionType: "Update", + ConditionStatus: v3.ConditionStatus_StatusFailed, + LastUpdated: timestamppb.Now(), + Reason: err.Error(), + } + return project, err + } + + if proj, ok := entity.(*models.Project); ok { + //update project details + proj.Name = project.Metadata.Name + proj.Description = project.Metadata.Description + proj.Default = project.Spec.Default + proj.ModifiedAt = time.Now() + + _, err = s.dao.Update(ctx, id, proj) + if err != nil { + project.Status = &v3.Status{ + ConditionType: "Update", + ConditionStatus: v3.ConditionStatus_StatusFailed, + LastUpdated: timestamppb.Now(), + Reason: err.Error(), + } + return project, err + } + + //update spec and status + project.Spec = &systemv3.ProjectSpec{ + Default: proj.Default, + } + project.Status = &v3.Status{ + ConditionType: "Update", + ConditionStatus: v3.ConditionStatus_StatusOK, + LastUpdated: timestamppb.Now(), + } + } + + return project, nil +} + +func (s *projectService) Delete(ctx context.Context, project *systemv3.Project) (*systemv3.Project, error) { + id, err := uuid.Parse(project.Metadata.Id) + if err != nil { + project.Status = &v3.Status{ + ConditionType: "Delete", + ConditionStatus: v3.ConditionStatus_StatusFailed, + LastUpdated: timestamppb.Now(), + Reason: err.Error(), + } + return project, err + } + entity, err := s.dao.GetByID(ctx, id, &models.Project{}) + if err != nil { + project.Status = &v3.Status{ + ConditionType: "Delete", + ConditionStatus: v3.ConditionStatus_StatusFailed, + LastUpdated: timestamppb.Now(), + Reason: err.Error(), + } + return project, err + } + if proj, ok := entity.(*models.Project); ok { + err = s.dao.Delete(ctx, id, proj) + if err != nil { + project.Status = &v3.Status{ + ConditionType: "Delete", + ConditionStatus: v3.ConditionStatus_StatusFailed, + LastUpdated: timestamppb.Now(), + Reason: err.Error(), + } + return project, err + } + //update v3 spec + project.Metadata.Id = proj.ID.String() + project.Metadata.Name = proj.Name + project.Status = &v3.Status{ + ConditionType: "Delete", + ConditionStatus: v3.ConditionStatus_StatusOK, + LastUpdated: timestamppb.Now(), + } + } + + return project, nil +} + +func (s *projectService) List(ctx context.Context, project *systemv3.Project) (*systemv3.ProjectList, error) { + + var projects []*systemv3.Project + projectList := &systemv3.ProjectList{ + ApiVersion: apiVersion, + Kind: projectListKind, + Metadata: &v3.ListMetadata{ + Count: 0, + }, + } + if len(project.Metadata.Organization) > 0 { + orgId, err := uuid.Parse(project.Metadata.Organization) + if err != nil { + return projectList, err + } + partId, err := uuid.Parse(project.Metadata.Partner) + if err != nil { + return projectList, err + } + var projs []models.Project + entities, err := s.dao.List(ctx, uuid.NullUUID{UUID: partId, Valid: true}, uuid.NullUUID{UUID: orgId, Valid: true}, &projs) + if err != nil { + return projectList, err + } + if projs, ok := entities.(*[]models.Project); ok { + for _, proj := range *projs { + labels := make(map[string]string) + labels["organization"] = proj.OrganizationId.String() + labels["partner"] = proj.PartnerId.String() + + project.Metadata = &v3.Metadata{ + Name: proj.Name, + Description: proj.Description, + Id: proj.ID.String(), + Organization: proj.OrganizationId.String(), + Partner: proj.PartnerId.String(), + Labels: labels, + ModifiedAt: timestamppb.New(proj.ModifiedAt), + } + project.Spec = &systemv3.ProjectSpec{ + Default: proj.Default, + } + projects = append(projects, project) + } + + //update the list metadata and items response + projectList.Metadata = &v3.ListMetadata{ + Count: int64(len(projects)), + } + projectList.Items = projects + } + + } else { + return projectList, fmt.Errorf("missing organization id in metadata") + } + return projectList, nil +} + +func (s *projectService) Close() error { + return s.dao.Close() +} diff --git a/components/adminsrv/proto/rpc/v3/organization.go b/components/adminsrv/proto/rpc/v3/organization.go new file mode 100644 index 0000000..196c7b0 --- /dev/null +++ b/components/adminsrv/proto/rpc/v3/organization.go @@ -0,0 +1,62 @@ +package rpcv3 + +import ( + "context" + + "github.com/RafaySystems/rcloud-base/components/adminsrv/pkg/service" + systempbv3 "github.com/RafaySystems/rcloud-base/components/adminsrv/proto/types/systempb/v3" +) + +type organizationServer struct { + service.OrganizationService +} + +// NewOrganizationServer returns new organization server implementation +func NewOrganizationServer(ps service.OrganizationService) OrganizationServer { + return &organizationServer{ps} +} + +func (s *organizationServer) CreateOrganization(ctx context.Context, o *systempbv3.Organization) (*systempbv3.Organization, error) { + organization, err := s.Create(ctx, o) + if err != nil { + return o, err + } + return organization, nil +} + +func (s *organizationServer) GetOrganizations(ctx context.Context, o *systempbv3.Organization) (*systempbv3.OrganizationList, error) { + organizations, err := s.List(ctx, o) + if err != nil { + return nil, err + } + return organizations, nil +} + +func (s *organizationServer) GetOrganization(ctx context.Context, o *systempbv3.Organization) (*systempbv3.Organization, error) { + + organization, err := s.GetByName(ctx, o.Metadata.Name) + if err != nil { + organization, err = s.GetByID(ctx, o.Metadata.Id) + if err != nil { + return o, err + } + } + + return organization, nil +} + +func (s *organizationServer) DeleteOrganization(ctx context.Context, o *systempbv3.Organization) (*systempbv3.Organization, error) { + organization, err := s.Delete(ctx, o) + if err != nil { + return o, err + } + return organization, nil +} + +func (s *organizationServer) UpdateOrganization(ctx context.Context, o *systempbv3.Organization) (*systempbv3.Organization, error) { + organization, err := s.Update(ctx, o) + if err != nil { + return o, err + } + return organization, nil +} diff --git a/components/adminsrv/proto/rpc/v3/organization.pb.go b/components/adminsrv/proto/rpc/v3/organization.pb.go new file mode 100644 index 0000000..9b60ba1 --- /dev/null +++ b/components/adminsrv/proto/rpc/v3/organization.pb.go @@ -0,0 +1,202 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc (unknown) +// source: proto/rpc/v3/organization.proto + +package rpcv3 + +import ( + v3 "github.com/RafaySystems/rcloud-base/components/adminsrv/proto/types/systempb/v3" + _ "github.com/gogo/protobuf/gogoproto" + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_proto_rpc_v3_organization_proto protoreflect.FileDescriptor + +var file_proto_rpc_v3_organization_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x33, 0x2f, 0x6f, + 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x10, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x70, 0x63, + 0x2e, 0x76, 0x33, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, + 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, + 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2a, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x70, 0x62, 0x2f, 0x76, 0x33, + 0x2f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x32, 0xc4, 0x09, 0x0a, 0x0c, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0xe4, 0x01, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, + 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x2e, 0x72, 0x61, + 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, + 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x76, 0x33, 0x2e, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x27, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x76, 0x33, + 0x2e, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x7c, 0x92, + 0x41, 0x3e, 0x4a, 0x3c, 0x0a, 0x03, 0x32, 0x30, 0x31, 0x12, 0x35, 0x0a, 0x33, 0x52, 0x65, 0x74, + 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x6f, 0x72, 0x67, 0x61, 0x6e, + 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x20, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x66, 0x75, 0x6c, 0x6c, 0x79, 0x2e, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x35, 0x22, 0x30, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x33, + 0x2f, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x2e, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x7d, 0x2f, 0x6f, 0x72, 0x67, 0x61, + 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x01, 0x2a, 0x12, 0xa3, 0x01, 0x0a, 0x10, + 0x47, 0x65, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x12, 0x27, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x76, 0x33, 0x2e, 0x4f, 0x72, 0x67, + 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x2b, 0x2e, 0x72, 0x61, 0x66, 0x61, + 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x2e, 0x76, 0x33, 0x2e, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x39, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x33, 0x12, 0x31, + 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, + 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x61, 0x72, 0x74, 0x6e, + 0x65, 0x72, 0x7d, 0x2f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x12, 0xf1, 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, + 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x76, + 0x33, 0x2e, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x27, + 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x76, 0x33, 0x2e, 0x4f, 0x72, 0x67, 0x61, 0x6e, + 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x8b, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x84, + 0x01, 0x12, 0x40, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x61, 0x72, 0x74, + 0x6e, 0x65, 0x72, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x61, + 0x72, 0x74, 0x6e, 0x65, 0x72, 0x7d, 0x2f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6e, 0x61, + 0x6d, 0x65, 0x7d, 0x5a, 0x40, 0x12, 0x3e, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x33, 0x2f, + 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x2e, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x7d, 0x2f, 0x6f, 0x72, 0x67, 0x61, 0x6e, + 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x2e, 0x69, 0x64, 0x7d, 0x12, 0xfa, 0x01, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x2e, 0x72, + 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, + 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x76, 0x33, 0x2e, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x27, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, + 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x76, + 0x33, 0x2e, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x91, + 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x8a, 0x01, 0x1a, 0x40, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, + 0x76, 0x33, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x7d, 0x2f, 0x6f, 0x72, + 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x3a, 0x01, 0x2a, 0x5a, 0x43, 0x1a, + 0x3e, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, + 0x72, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x61, 0x72, 0x74, + 0x6e, 0x65, 0x72, 0x7d, 0x2f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x69, 0x64, 0x7d, 0x3a, + 0x01, 0x2a, 0x12, 0xb5, 0x02, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x72, 0x67, + 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x2e, 0x72, 0x61, 0x66, 0x61, + 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x2e, 0x76, 0x33, 0x2e, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x1a, 0x27, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x76, 0x33, 0x2e, 0x4f, + 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xcc, 0x01, 0x92, 0x41, + 0x3e, 0x4a, 0x3c, 0x0a, 0x03, 0x32, 0x30, 0x34, 0x12, 0x35, 0x0a, 0x33, 0x52, 0x65, 0x74, 0x75, + 0x72, 0x6e, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, + 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x64, 0x20, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x66, 0x75, 0x6c, 0x6c, 0x79, 0x2e, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x84, 0x01, 0x2a, 0x40, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x33, + 0x2f, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x2e, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x7d, 0x2f, 0x6f, 0x72, 0x67, 0x61, + 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x5a, 0x40, 0x2a, 0x3e, 0x2f, 0x61, 0x75, 0x74, + 0x68, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x2f, 0x7b, 0x6d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x7d, 0x2f, + 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x7b, 0x6d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x69, 0x64, 0x7d, 0x42, 0xcf, 0x04, 0x0a, 0x14, 0x63, + 0x6f, 0x6d, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x70, 0x63, + 0x2e, 0x76, 0x33, 0x42, 0x11, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x52, 0x61, 0x66, 0x61, 0x79, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, + 0x73, 0x2f, 0x72, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x63, 0x6f, + 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x73, 0x72, + 0x76, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x33, 0x3b, 0x72, + 0x70, 0x63, 0x76, 0x33, 0xa2, 0x02, 0x03, 0x52, 0x44, 0x52, 0xaa, 0x02, 0x10, 0x52, 0x61, 0x66, + 0x61, 0x79, 0x2e, 0x44, 0x65, 0x76, 0x2e, 0x52, 0x70, 0x63, 0x2e, 0x56, 0x33, 0xca, 0x02, 0x10, + 0x52, 0x61, 0x66, 0x61, 0x79, 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x52, 0x70, 0x63, 0x5c, 0x56, 0x33, + 0xe2, 0x02, 0x1c, 0x52, 0x61, 0x66, 0x61, 0x79, 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x52, 0x70, 0x63, + 0x5c, 0x56, 0x33, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x13, 0x52, 0x61, 0x66, 0x61, 0x79, 0x3a, 0x3a, 0x44, 0x65, 0x76, 0x3a, 0x3a, 0x52, 0x70, + 0x63, 0x3a, 0x3a, 0x56, 0x33, 0x92, 0x41, 0xdf, 0x02, 0x12, 0x28, 0x0a, 0x14, 0x4f, 0x72, 0x67, + 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x22, 0x0b, 0x0a, 0x09, 0x52, 0x61, 0x66, 0x61, 0x79, 0x20, 0x44, 0x65, 0x76, 0x32, 0x03, + 0x33, 0x2e, 0x30, 0x2a, 0x01, 0x02, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x10, 0x61, 0x70, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x79, 0x61, 0x6d, 0x6c, 0x52, 0x50, + 0x0a, 0x03, 0x34, 0x30, 0x33, 0x12, 0x49, 0x0a, 0x47, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, + 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x73, 0x65, 0x72, 0x20, + 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x70, 0x65, + 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, + 0x52, 0x3b, 0x0a, 0x03, 0x34, 0x30, 0x34, 0x12, 0x34, 0x0a, 0x2a, 0x52, 0x65, 0x74, 0x75, 0x72, + 0x6e, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x65, + 0x78, 0x69, 0x73, 0x74, 0x2e, 0x12, 0x06, 0x0a, 0x04, 0x9a, 0x02, 0x01, 0x07, 0x5a, 0x38, 0x0a, + 0x25, 0x0a, 0x0a, 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x41, 0x75, 0x74, 0x68, 0x12, 0x17, 0x08, + 0x02, 0x1a, 0x11, 0x58, 0x2d, 0x52, 0x41, 0x46, 0x41, 0x59, 0x2d, 0x41, 0x50, 0x49, 0x2d, 0x4b, + 0x45, 0x59, 0x49, 0x44, 0x20, 0x02, 0x0a, 0x0f, 0x0a, 0x09, 0x42, 0x61, 0x73, 0x69, 0x63, 0x41, + 0x75, 0x74, 0x68, 0x12, 0x02, 0x08, 0x01, 0x62, 0x1f, 0x0a, 0x0e, 0x0a, 0x0a, 0x41, 0x70, 0x69, + 0x4b, 0x65, 0x79, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x0a, 0x0d, 0x0a, 0x09, 0x42, 0x61, 0x73, + 0x69, 0x63, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0xc8, 0xe2, 0x1e, 0x01, 0xd0, 0xe2, 0x1e, 0x01, + 0xe0, 0xe2, 0x1e, 0x01, 0xc0, 0xe3, 0x1e, 0x01, 0xc8, 0xe3, 0x1e, 0x01, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var file_proto_rpc_v3_organization_proto_goTypes = []interface{}{ + (*v3.Organization)(nil), // 0: rafay.dev.types.system.v3.Organization + (*v3.OrganizationList)(nil), // 1: rafay.dev.types.system.v3.OrganizationList +} +var file_proto_rpc_v3_organization_proto_depIdxs = []int32{ + 0, // 0: rafay.dev.rpc.v3.Organization.CreateOrganization:input_type -> rafay.dev.types.system.v3.Organization + 0, // 1: rafay.dev.rpc.v3.Organization.GetOrganizations:input_type -> rafay.dev.types.system.v3.Organization + 0, // 2: rafay.dev.rpc.v3.Organization.GetOrganization:input_type -> rafay.dev.types.system.v3.Organization + 0, // 3: rafay.dev.rpc.v3.Organization.UpdateOrganization:input_type -> rafay.dev.types.system.v3.Organization + 0, // 4: rafay.dev.rpc.v3.Organization.DeleteOrganization:input_type -> rafay.dev.types.system.v3.Organization + 0, // 5: rafay.dev.rpc.v3.Organization.CreateOrganization:output_type -> rafay.dev.types.system.v3.Organization + 1, // 6: rafay.dev.rpc.v3.Organization.GetOrganizations:output_type -> rafay.dev.types.system.v3.OrganizationList + 0, // 7: rafay.dev.rpc.v3.Organization.GetOrganization:output_type -> rafay.dev.types.system.v3.Organization + 0, // 8: rafay.dev.rpc.v3.Organization.UpdateOrganization:output_type -> rafay.dev.types.system.v3.Organization + 0, // 9: rafay.dev.rpc.v3.Organization.DeleteOrganization:output_type -> rafay.dev.types.system.v3.Organization + 5, // [5:10] is the sub-list for method output_type + 0, // [0:5] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_proto_rpc_v3_organization_proto_init() } +func file_proto_rpc_v3_organization_proto_init() { + if File_proto_rpc_v3_organization_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_proto_rpc_v3_organization_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_proto_rpc_v3_organization_proto_goTypes, + DependencyIndexes: file_proto_rpc_v3_organization_proto_depIdxs, + }.Build() + File_proto_rpc_v3_organization_proto = out.File + file_proto_rpc_v3_organization_proto_rawDesc = nil + file_proto_rpc_v3_organization_proto_goTypes = nil + file_proto_rpc_v3_organization_proto_depIdxs = nil +} diff --git a/components/adminsrv/proto/rpc/v3/organization.pb.gw.go b/components/adminsrv/proto/rpc/v3/organization.pb.gw.go new file mode 100644 index 0000000..737a82d --- /dev/null +++ b/components/adminsrv/proto/rpc/v3/organization.pb.gw.go @@ -0,0 +1,1137 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: proto/rpc/v3/organization.proto + +/* +Package rpcv3 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package rpcv3 + +import ( + "context" + "io" + "net/http" + + "github.com/RafaySystems/rcloud-base/components/adminsrv/proto/types/systempb/v3" + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_Organization_CreateOrganization_0(ctx context.Context, marshaler runtime.Marshaler, client OrganizationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Organization + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.partner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.partner") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.partner", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.partner", err) + } + + msg, err := client.CreateOrganization(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Organization_CreateOrganization_0(ctx context.Context, marshaler runtime.Marshaler, server OrganizationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Organization + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.partner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.partner") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.partner", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.partner", err) + } + + msg, err := server.CreateOrganization(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Organization_GetOrganizations_0 = &utilities.DoubleArray{Encoding: map[string]int{"metadata": 0, "partner": 1}, Base: []int{1, 1, 1, 0}, Check: []int{0, 1, 2, 3}} +) + +func request_Organization_GetOrganizations_0(ctx context.Context, marshaler runtime.Marshaler, client OrganizationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Organization + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.partner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.partner") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.partner", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.partner", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Organization_GetOrganizations_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetOrganizations(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Organization_GetOrganizations_0(ctx context.Context, marshaler runtime.Marshaler, server OrganizationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Organization + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.partner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.partner") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.partner", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.partner", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Organization_GetOrganizations_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetOrganizations(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Organization_GetOrganization_0 = &utilities.DoubleArray{Encoding: map[string]int{"metadata": 0, "partner": 1, "name": 2}, Base: []int{1, 1, 1, 2, 0, 0}, Check: []int{0, 1, 2, 2, 3, 4}} +) + +func request_Organization_GetOrganization_0(ctx context.Context, marshaler runtime.Marshaler, client OrganizationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Organization + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.partner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.partner") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.partner", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.partner", err) + } + + val, ok = pathParams["metadata.name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.name") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.name", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.name", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Organization_GetOrganization_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetOrganization(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Organization_GetOrganization_0(ctx context.Context, marshaler runtime.Marshaler, server OrganizationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Organization + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.partner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.partner") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.partner", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.partner", err) + } + + val, ok = pathParams["metadata.name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.name") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.name", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.name", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Organization_GetOrganization_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetOrganization(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Organization_GetOrganization_1 = &utilities.DoubleArray{Encoding: map[string]int{"metadata": 0, "partner": 1, "id": 2}, Base: []int{1, 1, 1, 2, 0, 0}, Check: []int{0, 1, 2, 2, 3, 4}} +) + +func request_Organization_GetOrganization_1(ctx context.Context, marshaler runtime.Marshaler, client OrganizationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Organization + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.partner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.partner") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.partner", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.partner", err) + } + + val, ok = pathParams["metadata.id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.id") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.id", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Organization_GetOrganization_1); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetOrganization(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Organization_GetOrganization_1(ctx context.Context, marshaler runtime.Marshaler, server OrganizationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Organization + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.partner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.partner") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.partner", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.partner", err) + } + + val, ok = pathParams["metadata.id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.id") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.id", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Organization_GetOrganization_1); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetOrganization(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Organization_UpdateOrganization_0(ctx context.Context, marshaler runtime.Marshaler, client OrganizationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Organization + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.partner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.partner") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.partner", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.partner", err) + } + + val, ok = pathParams["metadata.name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.name") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.name", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.name", err) + } + + msg, err := client.UpdateOrganization(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Organization_UpdateOrganization_0(ctx context.Context, marshaler runtime.Marshaler, server OrganizationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Organization + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.partner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.partner") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.partner", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.partner", err) + } + + val, ok = pathParams["metadata.name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.name") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.name", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.name", err) + } + + msg, err := server.UpdateOrganization(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Organization_UpdateOrganization_1(ctx context.Context, marshaler runtime.Marshaler, client OrganizationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Organization + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.partner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.partner") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.partner", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.partner", err) + } + + val, ok = pathParams["metadata.id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.id") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.id", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.id", err) + } + + msg, err := client.UpdateOrganization(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Organization_UpdateOrganization_1(ctx context.Context, marshaler runtime.Marshaler, server OrganizationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Organization + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.partner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.partner") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.partner", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.partner", err) + } + + val, ok = pathParams["metadata.id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.id") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.id", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.id", err) + } + + msg, err := server.UpdateOrganization(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Organization_DeleteOrganization_0 = &utilities.DoubleArray{Encoding: map[string]int{"metadata": 0, "partner": 1, "name": 2}, Base: []int{1, 1, 1, 2, 0, 0}, Check: []int{0, 1, 2, 2, 3, 4}} +) + +func request_Organization_DeleteOrganization_0(ctx context.Context, marshaler runtime.Marshaler, client OrganizationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Organization + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.partner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.partner") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.partner", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.partner", err) + } + + val, ok = pathParams["metadata.name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.name") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.name", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.name", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Organization_DeleteOrganization_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DeleteOrganization(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Organization_DeleteOrganization_0(ctx context.Context, marshaler runtime.Marshaler, server OrganizationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Organization + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.partner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.partner") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.partner", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.partner", err) + } + + val, ok = pathParams["metadata.name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.name") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.name", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.name", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Organization_DeleteOrganization_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DeleteOrganization(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Organization_DeleteOrganization_1 = &utilities.DoubleArray{Encoding: map[string]int{"metadata": 0, "partner": 1, "id": 2}, Base: []int{1, 1, 1, 2, 0, 0}, Check: []int{0, 1, 2, 2, 3, 4}} +) + +func request_Organization_DeleteOrganization_1(ctx context.Context, marshaler runtime.Marshaler, client OrganizationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Organization + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.partner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.partner") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.partner", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.partner", err) + } + + val, ok = pathParams["metadata.id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.id") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.id", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Organization_DeleteOrganization_1); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DeleteOrganization(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Organization_DeleteOrganization_1(ctx context.Context, marshaler runtime.Marshaler, server OrganizationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Organization + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.partner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.partner") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.partner", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.partner", err) + } + + val, ok = pathParams["metadata.id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.id") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.id", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Organization_DeleteOrganization_1); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DeleteOrganization(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterOrganizationHandlerServer registers the http handlers for service Organization to "mux". +// UnaryRPC :call OrganizationServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterOrganizationHandlerFromEndpoint instead. +func RegisterOrganizationHandlerServer(ctx context.Context, mux *runtime.ServeMux, server OrganizationServer) error { + + mux.Handle("POST", pattern_Organization_CreateOrganization_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rafay.dev.rpc.v3.Organization/CreateOrganization", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.partner}/organization")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Organization_CreateOrganization_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Organization_CreateOrganization_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Organization_GetOrganizations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rafay.dev.rpc.v3.Organization/GetOrganizations", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.partner}/organizations")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Organization_GetOrganizations_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Organization_GetOrganizations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Organization_GetOrganization_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rafay.dev.rpc.v3.Organization/GetOrganization", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.partner}/organization/{metadata.name}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Organization_GetOrganization_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Organization_GetOrganization_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Organization_GetOrganization_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rafay.dev.rpc.v3.Organization/GetOrganization", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.partner}/organization/{metadata.id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Organization_GetOrganization_1(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Organization_GetOrganization_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_Organization_UpdateOrganization_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rafay.dev.rpc.v3.Organization/UpdateOrganization", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.partner}/organization/{metadata.name}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Organization_UpdateOrganization_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Organization_UpdateOrganization_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_Organization_UpdateOrganization_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rafay.dev.rpc.v3.Organization/UpdateOrganization", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.partner}/organization/{metadata.id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Organization_UpdateOrganization_1(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Organization_UpdateOrganization_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_Organization_DeleteOrganization_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rafay.dev.rpc.v3.Organization/DeleteOrganization", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.partner}/organization/{metadata.name}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Organization_DeleteOrganization_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Organization_DeleteOrganization_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_Organization_DeleteOrganization_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rafay.dev.rpc.v3.Organization/DeleteOrganization", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.partner}/organization/{metadata.id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Organization_DeleteOrganization_1(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Organization_DeleteOrganization_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterOrganizationHandlerFromEndpoint is same as RegisterOrganizationHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterOrganizationHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterOrganizationHandler(ctx, mux, conn) +} + +// RegisterOrganizationHandler registers the http handlers for service Organization to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterOrganizationHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterOrganizationHandlerClient(ctx, mux, NewOrganizationClient(conn)) +} + +// RegisterOrganizationHandlerClient registers the http handlers for service Organization +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "OrganizationClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "OrganizationClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "OrganizationClient" to call the correct interceptors. +func RegisterOrganizationHandlerClient(ctx context.Context, mux *runtime.ServeMux, client OrganizationClient) error { + + mux.Handle("POST", pattern_Organization_CreateOrganization_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rafay.dev.rpc.v3.Organization/CreateOrganization", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.partner}/organization")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Organization_CreateOrganization_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Organization_CreateOrganization_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Organization_GetOrganizations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rafay.dev.rpc.v3.Organization/GetOrganizations", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.partner}/organizations")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Organization_GetOrganizations_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Organization_GetOrganizations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Organization_GetOrganization_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rafay.dev.rpc.v3.Organization/GetOrganization", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.partner}/organization/{metadata.name}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Organization_GetOrganization_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Organization_GetOrganization_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Organization_GetOrganization_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rafay.dev.rpc.v3.Organization/GetOrganization", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.partner}/organization/{metadata.id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Organization_GetOrganization_1(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Organization_GetOrganization_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_Organization_UpdateOrganization_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rafay.dev.rpc.v3.Organization/UpdateOrganization", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.partner}/organization/{metadata.name}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Organization_UpdateOrganization_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Organization_UpdateOrganization_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_Organization_UpdateOrganization_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rafay.dev.rpc.v3.Organization/UpdateOrganization", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.partner}/organization/{metadata.id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Organization_UpdateOrganization_1(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Organization_UpdateOrganization_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_Organization_DeleteOrganization_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rafay.dev.rpc.v3.Organization/DeleteOrganization", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.partner}/organization/{metadata.name}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Organization_DeleteOrganization_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Organization_DeleteOrganization_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_Organization_DeleteOrganization_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rafay.dev.rpc.v3.Organization/DeleteOrganization", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.partner}/organization/{metadata.id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Organization_DeleteOrganization_1(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Organization_DeleteOrganization_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Organization_CreateOrganization_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"auth", "v3", "partner", "metadata.partner", "organization"}, "")) + + pattern_Organization_GetOrganizations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"auth", "v3", "partner", "metadata.partner", "organizations"}, "")) + + pattern_Organization_GetOrganization_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"auth", "v3", "partner", "metadata.partner", "organization", "metadata.name"}, "")) + + pattern_Organization_GetOrganization_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"auth", "v3", "partner", "metadata.partner", "organization", "metadata.id"}, "")) + + pattern_Organization_UpdateOrganization_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"auth", "v3", "partner", "metadata.partner", "organization", "metadata.name"}, "")) + + pattern_Organization_UpdateOrganization_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"auth", "v3", "partner", "metadata.partner", "organization", "metadata.id"}, "")) + + pattern_Organization_DeleteOrganization_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"auth", "v3", "partner", "metadata.partner", "organization", "metadata.name"}, "")) + + pattern_Organization_DeleteOrganization_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"auth", "v3", "partner", "metadata.partner", "organization", "metadata.id"}, "")) +) + +var ( + forward_Organization_CreateOrganization_0 = runtime.ForwardResponseMessage + + forward_Organization_GetOrganizations_0 = runtime.ForwardResponseMessage + + forward_Organization_GetOrganization_0 = runtime.ForwardResponseMessage + + forward_Organization_GetOrganization_1 = runtime.ForwardResponseMessage + + forward_Organization_UpdateOrganization_0 = runtime.ForwardResponseMessage + + forward_Organization_UpdateOrganization_1 = runtime.ForwardResponseMessage + + forward_Organization_DeleteOrganization_0 = runtime.ForwardResponseMessage + + forward_Organization_DeleteOrganization_1 = runtime.ForwardResponseMessage +) diff --git a/components/adminsrv/proto/rpc/v3/organization.proto b/components/adminsrv/proto/rpc/v3/organization.proto new file mode 100644 index 0000000..e942467 --- /dev/null +++ b/components/adminsrv/proto/rpc/v3/organization.proto @@ -0,0 +1,138 @@ +syntax = "proto3"; +package rafay.dev.rpc.v3; + +import "google/api/annotations.proto"; +import "gogoproto/gogo.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; +import "proto/types/systempb/v3/organization.proto"; + +// Enable custom Marshal method. +option (gogoproto.marshaler_all) = true; +// Enable custom Unmarshal method. +option (gogoproto.unmarshaler_all) = true; +// Enable custom Size method (Required by Marshal and Unmarshal). +option (gogoproto.sizer_all) = true; +// Enable registration with golang/protobuf for the grpc-gateway. +option (gogoproto.goproto_registration) = true; +// Enable generation of XXX_MessageName methods for grpc-go/status. +option (gogoproto.messagename_all) = true; + +option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + info: { + title: "Organization Service" + version: "3.0" + contact: { name: "Rafay Dev" } + } + schemes: HTTPS + consumes: "application/json" + consumes: "application/yaml" + produces: "application/json" + produces: "application/yaml" + security_definitions: { + security: { + key: "BasicAuth" + value: { type: TYPE_BASIC } + } + security: { + key: "ApiKeyAuth" + value: { type: TYPE_API_KEY in: IN_HEADER name: "X-RAFAY-API-KEYID" } + } + } + security: { + security_requirement: { + key: "BasicAuth" + value: {} + } + security_requirement: { + key: "ApiKeyAuth" + value: {} + } + } + responses: { + key: "403" + value: { + description: "Returned when the user does not have permission to access the resource." + } + } + responses: { + key: "404" + value: { + description: "Returned when the resource does not exist." + schema: { json_schema: { type: STRING } } + } + } +}; + +service Organization { + rpc CreateOrganization(rafay.dev.types.system.v3.Organization) + returns (rafay.dev.types.system.v3.Organization) { + option (google.api.http) = { + post : "/auth/v3/partner/{metadata.partner}/organization" + body : "*" + }; + + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + responses : { + key : "201" + value : { + description : "Returned when organization is created successfully." + } + } + }; + }; + + rpc GetOrganizations(rafay.dev.types.system.v3.Organization) + returns (rafay.dev.types.system.v3.OrganizationList) { + option (google.api.http) = { + get : "/auth/v3/partner/{metadata.partner}/organizations" + }; + }; + + rpc GetOrganization(rafay.dev.types.system.v3.Organization) + returns (rafay.dev.types.system.v3.Organization) { + option (google.api.http) = { + get : "/auth/v3/partner/{metadata.partner}/organization/" + "{metadata.name}" + additional_bindings { + get : "/auth/v3/partner/{metadata.partner}/organization/" + "{metadata.id}" + } + }; + }; + + rpc UpdateOrganization(rafay.dev.types.system.v3.Organization) + returns (rafay.dev.types.system.v3.Organization) { + option (google.api.http) = { + put : "/auth/v3/partner/{metadata.partner}/organization/" + "{metadata.name}" + body : "*" + additional_bindings { + put : "/auth/v3/partner/{metadata.partner}/organization/" + "{metadata.id}" + body : "*" + } + }; + }; + + rpc DeleteOrganization(rafay.dev.types.system.v3.Organization) + returns (rafay.dev.types.system.v3.Organization) { + option (google.api.http) = { + delete : "/auth/v3/partner/{metadata.partner}/organization/" + "{metadata.name}" + additional_bindings { + delete : "/auth/v3/partner/{metadata.partner}/organization/" + "{metadata.id}" + } + }; + + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + responses : { + key : "204" + value : { + description : "Returned when organization is deleted successfully." + } + } + }; + }; + +} \ No newline at end of file diff --git a/components/adminsrv/proto/rpc/v3/organization_grpc.pb.go b/components/adminsrv/proto/rpc/v3/organization_grpc.pb.go new file mode 100644 index 0000000..c8f374f --- /dev/null +++ b/components/adminsrv/proto/rpc/v3/organization_grpc.pb.go @@ -0,0 +1,248 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc (unknown) +// source: proto/rpc/v3/organization.proto + +package rpcv3 + +import ( + context "context" + v3 "github.com/RafaySystems/rcloud-base/components/adminsrv/proto/types/systempb/v3" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// OrganizationClient is the client API for Organization service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type OrganizationClient interface { + CreateOrganization(ctx context.Context, in *v3.Organization, opts ...grpc.CallOption) (*v3.Organization, error) + GetOrganizations(ctx context.Context, in *v3.Organization, opts ...grpc.CallOption) (*v3.OrganizationList, error) + GetOrganization(ctx context.Context, in *v3.Organization, opts ...grpc.CallOption) (*v3.Organization, error) + UpdateOrganization(ctx context.Context, in *v3.Organization, opts ...grpc.CallOption) (*v3.Organization, error) + DeleteOrganization(ctx context.Context, in *v3.Organization, opts ...grpc.CallOption) (*v3.Organization, error) +} + +type organizationClient struct { + cc grpc.ClientConnInterface +} + +func NewOrganizationClient(cc grpc.ClientConnInterface) OrganizationClient { + return &organizationClient{cc} +} + +func (c *organizationClient) CreateOrganization(ctx context.Context, in *v3.Organization, opts ...grpc.CallOption) (*v3.Organization, error) { + out := new(v3.Organization) + err := c.cc.Invoke(ctx, "/rafay.dev.rpc.v3.Organization/CreateOrganization", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *organizationClient) GetOrganizations(ctx context.Context, in *v3.Organization, opts ...grpc.CallOption) (*v3.OrganizationList, error) { + out := new(v3.OrganizationList) + err := c.cc.Invoke(ctx, "/rafay.dev.rpc.v3.Organization/GetOrganizations", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *organizationClient) GetOrganization(ctx context.Context, in *v3.Organization, opts ...grpc.CallOption) (*v3.Organization, error) { + out := new(v3.Organization) + err := c.cc.Invoke(ctx, "/rafay.dev.rpc.v3.Organization/GetOrganization", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *organizationClient) UpdateOrganization(ctx context.Context, in *v3.Organization, opts ...grpc.CallOption) (*v3.Organization, error) { + out := new(v3.Organization) + err := c.cc.Invoke(ctx, "/rafay.dev.rpc.v3.Organization/UpdateOrganization", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *organizationClient) DeleteOrganization(ctx context.Context, in *v3.Organization, opts ...grpc.CallOption) (*v3.Organization, error) { + out := new(v3.Organization) + err := c.cc.Invoke(ctx, "/rafay.dev.rpc.v3.Organization/DeleteOrganization", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// OrganizationServer is the server API for Organization service. +// All implementations should embed UnimplementedOrganizationServer +// for forward compatibility +type OrganizationServer interface { + CreateOrganization(context.Context, *v3.Organization) (*v3.Organization, error) + GetOrganizations(context.Context, *v3.Organization) (*v3.OrganizationList, error) + GetOrganization(context.Context, *v3.Organization) (*v3.Organization, error) + UpdateOrganization(context.Context, *v3.Organization) (*v3.Organization, error) + DeleteOrganization(context.Context, *v3.Organization) (*v3.Organization, error) +} + +// UnimplementedOrganizationServer should be embedded to have forward compatible implementations. +type UnimplementedOrganizationServer struct { +} + +func (UnimplementedOrganizationServer) CreateOrganization(context.Context, *v3.Organization) (*v3.Organization, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateOrganization not implemented") +} +func (UnimplementedOrganizationServer) GetOrganizations(context.Context, *v3.Organization) (*v3.OrganizationList, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetOrganizations not implemented") +} +func (UnimplementedOrganizationServer) GetOrganization(context.Context, *v3.Organization) (*v3.Organization, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetOrganization not implemented") +} +func (UnimplementedOrganizationServer) UpdateOrganization(context.Context, *v3.Organization) (*v3.Organization, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateOrganization not implemented") +} +func (UnimplementedOrganizationServer) DeleteOrganization(context.Context, *v3.Organization) (*v3.Organization, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteOrganization not implemented") +} + +// UnsafeOrganizationServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to OrganizationServer will +// result in compilation errors. +type UnsafeOrganizationServer interface { + mustEmbedUnimplementedOrganizationServer() +} + +func RegisterOrganizationServer(s grpc.ServiceRegistrar, srv OrganizationServer) { + s.RegisterService(&Organization_ServiceDesc, srv) +} + +func _Organization_CreateOrganization_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v3.Organization) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrganizationServer).CreateOrganization(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/rafay.dev.rpc.v3.Organization/CreateOrganization", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrganizationServer).CreateOrganization(ctx, req.(*v3.Organization)) + } + return interceptor(ctx, in, info, handler) +} + +func _Organization_GetOrganizations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v3.Organization) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrganizationServer).GetOrganizations(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/rafay.dev.rpc.v3.Organization/GetOrganizations", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrganizationServer).GetOrganizations(ctx, req.(*v3.Organization)) + } + return interceptor(ctx, in, info, handler) +} + +func _Organization_GetOrganization_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v3.Organization) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrganizationServer).GetOrganization(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/rafay.dev.rpc.v3.Organization/GetOrganization", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrganizationServer).GetOrganization(ctx, req.(*v3.Organization)) + } + return interceptor(ctx, in, info, handler) +} + +func _Organization_UpdateOrganization_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v3.Organization) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrganizationServer).UpdateOrganization(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/rafay.dev.rpc.v3.Organization/UpdateOrganization", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrganizationServer).UpdateOrganization(ctx, req.(*v3.Organization)) + } + return interceptor(ctx, in, info, handler) +} + +func _Organization_DeleteOrganization_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v3.Organization) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrganizationServer).DeleteOrganization(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/rafay.dev.rpc.v3.Organization/DeleteOrganization", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrganizationServer).DeleteOrganization(ctx, req.(*v3.Organization)) + } + return interceptor(ctx, in, info, handler) +} + +// Organization_ServiceDesc is the grpc.ServiceDesc for Organization service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Organization_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "rafay.dev.rpc.v3.Organization", + HandlerType: (*OrganizationServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateOrganization", + Handler: _Organization_CreateOrganization_Handler, + }, + { + MethodName: "GetOrganizations", + Handler: _Organization_GetOrganizations_Handler, + }, + { + MethodName: "GetOrganization", + Handler: _Organization_GetOrganization_Handler, + }, + { + MethodName: "UpdateOrganization", + Handler: _Organization_UpdateOrganization_Handler, + }, + { + MethodName: "DeleteOrganization", + Handler: _Organization_DeleteOrganization_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "proto/rpc/v3/organization.proto", +} diff --git a/components/adminsrv/proto/rpc/v3/partner.go b/components/adminsrv/proto/rpc/v3/partner.go new file mode 100644 index 0000000..62e414a --- /dev/null +++ b/components/adminsrv/proto/rpc/v3/partner.go @@ -0,0 +1,53 @@ +package rpcv3 + +import ( + "context" + + "github.com/RafaySystems/rcloud-base/components/adminsrv/pkg/service" + systempbv3 "github.com/RafaySystems/rcloud-base/components/adminsrv/proto/types/systempb/v3" +) + +type partnerServer struct { + service.PartnerService +} + +// NewPartnerServer returns new partner server implementation +func NewPartnerServer(ps service.PartnerService) PartnerServer { + return &partnerServer{ps} +} + +func (s *partnerServer) CreatePartner(ctx context.Context, p *systempbv3.Partner) (*systempbv3.Partner, error) { + p, err := s.Create(ctx, p) + if err != nil { + return nil, err + } + return p, nil +} +func (s *partnerServer) GetPartner(ctx context.Context, p *systempbv3.Partner) (*systempbv3.Partner, error) { + + partner, err := s.GetByName(ctx, p.Metadata.Name) + if err != nil { + partner, err = s.GetByID(ctx, p.Metadata.Id) + if err != nil { + return nil, err + } + } + + return partner, nil +} + +func (s *partnerServer) DeletePartner(ctx context.Context, p *systempbv3.Partner) (*systempbv3.Partner, error) { + partner, err := s.Delete(ctx, p) + if err != nil { + return nil, err + } + return partner, nil +} + +func (s *partnerServer) UpdatePartner(ctx context.Context, p *systempbv3.Partner) (*systempbv3.Partner, error) { + partner, err := s.Update(ctx, p) + if err != nil { + return nil, err + } + return partner, nil +} diff --git a/components/adminsrv/proto/rpc/v3/partner.pb.go b/components/adminsrv/proto/rpc/v3/partner.pb.go new file mode 100644 index 0000000..4d153e4 --- /dev/null +++ b/components/adminsrv/proto/rpc/v3/partner.pb.go @@ -0,0 +1,168 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc (unknown) +// source: proto/rpc/v3/partner.proto + +package rpcv3 + +import ( + v3 "github.com/RafaySystems/rcloud-base/components/adminsrv/proto/types/systempb/v3" + _ "github.com/gogo/protobuf/gogoproto" + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_proto_rpc_v3_partner_proto protoreflect.FileDescriptor + +var file_proto_rpc_v3_partner_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x33, 0x2f, 0x70, + 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x72, 0x61, + 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x33, 0x1a, 0x1c, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, + 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, + 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x25, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, + 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x70, 0x62, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x61, 0x72, 0x74, + 0x6e, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xee, 0x05, 0x0a, 0x07, 0x50, 0x61, + 0x72, 0x74, 0x6e, 0x65, 0x72, 0x12, 0xb0, 0x01, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x50, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x12, 0x22, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, + 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, + 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x1a, 0x22, 0x2e, 0x72, 0x61, + 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, + 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x22, + 0x57, 0x92, 0x41, 0x39, 0x4a, 0x37, 0x0a, 0x03, 0x32, 0x30, 0x31, 0x12, 0x30, 0x0a, 0x2e, 0x52, + 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x70, 0x61, 0x72, + 0x74, 0x6e, 0x65, 0x72, 0x20, 0x69, 0x73, 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, + 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x66, 0x75, 0x6c, 0x6c, 0x79, 0x2e, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x15, 0x22, 0x10, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x61, + 0x72, 0x74, 0x6e, 0x65, 0x72, 0x3a, 0x01, 0x2a, 0x12, 0xa0, 0x01, 0x0a, 0x0a, 0x47, 0x65, 0x74, + 0x50, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x12, 0x22, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, + 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, + 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x1a, 0x22, 0x2e, 0x72, 0x61, + 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, + 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x22, + 0x4a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x44, 0x12, 0x20, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, + 0x33, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x5a, 0x20, 0x12, 0x1e, 0x2f, 0x61, 0x75, + 0x74, 0x68, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x2f, 0x7b, 0x6d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x69, 0x64, 0x7d, 0x12, 0xa9, 0x01, 0x0a, 0x0d, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x12, 0x22, 0x2e, + 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x6e, 0x65, + 0x72, 0x1a, 0x22, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x61, + 0x72, 0x74, 0x6e, 0x65, 0x72, 0x22, 0x50, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x4a, 0x1a, 0x20, 0x2f, + 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x2f, + 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x3a, + 0x01, 0x2a, 0x5a, 0x23, 0x1a, 0x1e, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x33, 0x2f, 0x70, + 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x2e, 0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0xe0, 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x50, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x12, 0x22, 0x2e, 0x72, 0x61, 0x66, 0x61, + 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x1a, 0x22, 0x2e, + 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x6e, 0x65, + 0x72, 0x22, 0x86, 0x01, 0x92, 0x41, 0x39, 0x4a, 0x37, 0x0a, 0x03, 0x32, 0x30, 0x34, 0x12, 0x30, + 0x0a, 0x2e, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, + 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x20, 0x69, 0x73, 0x20, 0x64, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x64, 0x20, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x66, 0x75, 0x6c, 0x6c, 0x79, 0x2e, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x44, 0x2a, 0x20, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x33, + 0x2f, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x5a, 0x20, 0x2a, 0x1e, 0x2f, 0x61, 0x75, 0x74, + 0x68, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x2f, 0x7b, 0x6d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x69, 0x64, 0x7d, 0x42, 0xc5, 0x04, 0x0a, 0x14, 0x63, + 0x6f, 0x6d, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x70, 0x63, + 0x2e, 0x76, 0x33, 0x42, 0x0c, 0x50, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x52, 0x61, 0x66, 0x61, 0x79, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x73, 0x2f, 0x72, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x2d, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, + 0x6e, 0x74, 0x73, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x73, 0x72, 0x76, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x33, 0x3b, 0x72, 0x70, 0x63, 0x76, 0x33, 0xa2, + 0x02, 0x03, 0x52, 0x44, 0x52, 0xaa, 0x02, 0x10, 0x52, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x44, 0x65, + 0x76, 0x2e, 0x52, 0x70, 0x63, 0x2e, 0x56, 0x33, 0xca, 0x02, 0x10, 0x52, 0x61, 0x66, 0x61, 0x79, + 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x52, 0x70, 0x63, 0x5c, 0x56, 0x33, 0xe2, 0x02, 0x1c, 0x52, 0x61, + 0x66, 0x61, 0x79, 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x52, 0x70, 0x63, 0x5c, 0x56, 0x33, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x52, 0x61, 0x66, + 0x61, 0x79, 0x3a, 0x3a, 0x44, 0x65, 0x76, 0x3a, 0x3a, 0x52, 0x70, 0x63, 0x3a, 0x3a, 0x56, 0x33, + 0x92, 0x41, 0xda, 0x02, 0x12, 0x23, 0x0a, 0x0f, 0x50, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x20, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x0b, 0x0a, 0x09, 0x52, 0x61, 0x66, 0x61, 0x79, + 0x20, 0x44, 0x65, 0x76, 0x32, 0x03, 0x33, 0x2e, 0x30, 0x2a, 0x01, 0x02, 0x32, 0x10, 0x61, 0x70, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x32, 0x10, + 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x79, 0x61, 0x6d, 0x6c, + 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, + 0x6f, 0x6e, 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, + 0x79, 0x61, 0x6d, 0x6c, 0x52, 0x50, 0x0a, 0x03, 0x34, 0x30, 0x33, 0x12, 0x49, 0x0a, 0x47, 0x52, + 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x65, + 0x20, 0x75, 0x73, 0x65, 0x72, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x68, + 0x61, 0x76, 0x65, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x74, + 0x6f, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x3b, 0x0a, 0x03, 0x34, 0x30, 0x34, 0x12, 0x34, 0x0a, + 0x2a, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x74, + 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x64, 0x6f, 0x65, 0x73, + 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x65, 0x78, 0x69, 0x73, 0x74, 0x2e, 0x12, 0x06, 0x0a, 0x04, 0x9a, + 0x02, 0x01, 0x07, 0x5a, 0x38, 0x0a, 0x25, 0x0a, 0x0a, 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x41, + 0x75, 0x74, 0x68, 0x12, 0x17, 0x08, 0x02, 0x1a, 0x11, 0x58, 0x2d, 0x52, 0x41, 0x46, 0x41, 0x59, + 0x2d, 0x41, 0x50, 0x49, 0x2d, 0x4b, 0x45, 0x59, 0x49, 0x44, 0x20, 0x02, 0x0a, 0x0f, 0x0a, 0x09, + 0x42, 0x61, 0x73, 0x69, 0x63, 0x41, 0x75, 0x74, 0x68, 0x12, 0x02, 0x08, 0x01, 0x62, 0x1f, 0x0a, + 0x0e, 0x0a, 0x0a, 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x0a, + 0x0d, 0x0a, 0x09, 0x42, 0x61, 0x73, 0x69, 0x63, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0xc8, 0xe2, + 0x1e, 0x01, 0xd0, 0xe2, 0x1e, 0x01, 0xe0, 0xe2, 0x1e, 0x01, 0xc0, 0xe3, 0x1e, 0x01, 0xc8, 0xe3, + 0x1e, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var file_proto_rpc_v3_partner_proto_goTypes = []interface{}{ + (*v3.Partner)(nil), // 0: rafay.dev.types.system.v3.Partner +} +var file_proto_rpc_v3_partner_proto_depIdxs = []int32{ + 0, // 0: rafay.dev.rpc.v3.Partner.CreatePartner:input_type -> rafay.dev.types.system.v3.Partner + 0, // 1: rafay.dev.rpc.v3.Partner.GetPartner:input_type -> rafay.dev.types.system.v3.Partner + 0, // 2: rafay.dev.rpc.v3.Partner.UpdatePartner:input_type -> rafay.dev.types.system.v3.Partner + 0, // 3: rafay.dev.rpc.v3.Partner.DeletePartner:input_type -> rafay.dev.types.system.v3.Partner + 0, // 4: rafay.dev.rpc.v3.Partner.CreatePartner:output_type -> rafay.dev.types.system.v3.Partner + 0, // 5: rafay.dev.rpc.v3.Partner.GetPartner:output_type -> rafay.dev.types.system.v3.Partner + 0, // 6: rafay.dev.rpc.v3.Partner.UpdatePartner:output_type -> rafay.dev.types.system.v3.Partner + 0, // 7: rafay.dev.rpc.v3.Partner.DeletePartner:output_type -> rafay.dev.types.system.v3.Partner + 4, // [4:8] is the sub-list for method output_type + 0, // [0:4] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_proto_rpc_v3_partner_proto_init() } +func file_proto_rpc_v3_partner_proto_init() { + if File_proto_rpc_v3_partner_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_proto_rpc_v3_partner_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_proto_rpc_v3_partner_proto_goTypes, + DependencyIndexes: file_proto_rpc_v3_partner_proto_depIdxs, + }.Build() + File_proto_rpc_v3_partner_proto = out.File + file_proto_rpc_v3_partner_proto_rawDesc = nil + file_proto_rpc_v3_partner_proto_goTypes = nil + file_proto_rpc_v3_partner_proto_depIdxs = nil +} diff --git a/components/adminsrv/proto/rpc/v3/partner.pb.gw.go b/components/adminsrv/proto/rpc/v3/partner.pb.gw.go new file mode 100644 index 0000000..f600f36 --- /dev/null +++ b/components/adminsrv/proto/rpc/v3/partner.pb.gw.go @@ -0,0 +1,866 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: proto/rpc/v3/partner.proto + +/* +Package rpcv3 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package rpcv3 + +import ( + "context" + "io" + "net/http" + + "github.com/RafaySystems/rcloud-base/components/adminsrv/proto/types/systempb/v3" + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_Partner_CreatePartner_0(ctx context.Context, marshaler runtime.Marshaler, client PartnerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Partner + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CreatePartner(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Partner_CreatePartner_0(ctx context.Context, marshaler runtime.Marshaler, server PartnerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Partner + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CreatePartner(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Partner_GetPartner_0 = &utilities.DoubleArray{Encoding: map[string]int{"metadata": 0, "name": 1}, Base: []int{1, 1, 1, 0}, Check: []int{0, 1, 2, 3}} +) + +func request_Partner_GetPartner_0(ctx context.Context, marshaler runtime.Marshaler, client PartnerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Partner + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.name") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.name", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.name", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Partner_GetPartner_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetPartner(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Partner_GetPartner_0(ctx context.Context, marshaler runtime.Marshaler, server PartnerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Partner + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.name") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.name", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.name", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Partner_GetPartner_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetPartner(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Partner_GetPartner_1 = &utilities.DoubleArray{Encoding: map[string]int{"metadata": 0, "id": 1}, Base: []int{1, 1, 1, 0}, Check: []int{0, 1, 2, 3}} +) + +func request_Partner_GetPartner_1(ctx context.Context, marshaler runtime.Marshaler, client PartnerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Partner + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.id") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.id", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Partner_GetPartner_1); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetPartner(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Partner_GetPartner_1(ctx context.Context, marshaler runtime.Marshaler, server PartnerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Partner + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.id") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.id", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Partner_GetPartner_1); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetPartner(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Partner_UpdatePartner_0(ctx context.Context, marshaler runtime.Marshaler, client PartnerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Partner + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.name") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.name", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.name", err) + } + + msg, err := client.UpdatePartner(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Partner_UpdatePartner_0(ctx context.Context, marshaler runtime.Marshaler, server PartnerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Partner + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.name") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.name", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.name", err) + } + + msg, err := server.UpdatePartner(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Partner_UpdatePartner_1(ctx context.Context, marshaler runtime.Marshaler, client PartnerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Partner + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.id") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.id", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.id", err) + } + + msg, err := client.UpdatePartner(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Partner_UpdatePartner_1(ctx context.Context, marshaler runtime.Marshaler, server PartnerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Partner + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.id") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.id", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.id", err) + } + + msg, err := server.UpdatePartner(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Partner_DeletePartner_0 = &utilities.DoubleArray{Encoding: map[string]int{"metadata": 0, "name": 1}, Base: []int{1, 1, 1, 0}, Check: []int{0, 1, 2, 3}} +) + +func request_Partner_DeletePartner_0(ctx context.Context, marshaler runtime.Marshaler, client PartnerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Partner + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.name") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.name", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.name", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Partner_DeletePartner_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DeletePartner(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Partner_DeletePartner_0(ctx context.Context, marshaler runtime.Marshaler, server PartnerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Partner + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.name") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.name", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.name", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Partner_DeletePartner_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DeletePartner(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Partner_DeletePartner_1 = &utilities.DoubleArray{Encoding: map[string]int{"metadata": 0, "id": 1}, Base: []int{1, 1, 1, 0}, Check: []int{0, 1, 2, 3}} +) + +func request_Partner_DeletePartner_1(ctx context.Context, marshaler runtime.Marshaler, client PartnerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Partner + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.id") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.id", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Partner_DeletePartner_1); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DeletePartner(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Partner_DeletePartner_1(ctx context.Context, marshaler runtime.Marshaler, server PartnerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Partner + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.id") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.id", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Partner_DeletePartner_1); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DeletePartner(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterPartnerHandlerServer registers the http handlers for service Partner to "mux". +// UnaryRPC :call PartnerServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterPartnerHandlerFromEndpoint instead. +func RegisterPartnerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PartnerServer) error { + + mux.Handle("POST", pattern_Partner_CreatePartner_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rafay.dev.rpc.v3.Partner/CreatePartner", runtime.WithHTTPPathPattern("/auth/v3/partner")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Partner_CreatePartner_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Partner_CreatePartner_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Partner_GetPartner_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rafay.dev.rpc.v3.Partner/GetPartner", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.name}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Partner_GetPartner_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Partner_GetPartner_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Partner_GetPartner_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rafay.dev.rpc.v3.Partner/GetPartner", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Partner_GetPartner_1(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Partner_GetPartner_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_Partner_UpdatePartner_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rafay.dev.rpc.v3.Partner/UpdatePartner", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.name}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Partner_UpdatePartner_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Partner_UpdatePartner_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_Partner_UpdatePartner_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rafay.dev.rpc.v3.Partner/UpdatePartner", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Partner_UpdatePartner_1(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Partner_UpdatePartner_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_Partner_DeletePartner_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rafay.dev.rpc.v3.Partner/DeletePartner", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.name}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Partner_DeletePartner_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Partner_DeletePartner_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_Partner_DeletePartner_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rafay.dev.rpc.v3.Partner/DeletePartner", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Partner_DeletePartner_1(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Partner_DeletePartner_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterPartnerHandlerFromEndpoint is same as RegisterPartnerHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterPartnerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterPartnerHandler(ctx, mux, conn) +} + +// RegisterPartnerHandler registers the http handlers for service Partner to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterPartnerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterPartnerHandlerClient(ctx, mux, NewPartnerClient(conn)) +} + +// RegisterPartnerHandlerClient registers the http handlers for service Partner +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "PartnerClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "PartnerClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "PartnerClient" to call the correct interceptors. +func RegisterPartnerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PartnerClient) error { + + mux.Handle("POST", pattern_Partner_CreatePartner_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rafay.dev.rpc.v3.Partner/CreatePartner", runtime.WithHTTPPathPattern("/auth/v3/partner")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Partner_CreatePartner_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Partner_CreatePartner_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Partner_GetPartner_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rafay.dev.rpc.v3.Partner/GetPartner", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.name}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Partner_GetPartner_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Partner_GetPartner_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Partner_GetPartner_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rafay.dev.rpc.v3.Partner/GetPartner", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Partner_GetPartner_1(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Partner_GetPartner_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_Partner_UpdatePartner_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rafay.dev.rpc.v3.Partner/UpdatePartner", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.name}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Partner_UpdatePartner_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Partner_UpdatePartner_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_Partner_UpdatePartner_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rafay.dev.rpc.v3.Partner/UpdatePartner", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Partner_UpdatePartner_1(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Partner_UpdatePartner_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_Partner_DeletePartner_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rafay.dev.rpc.v3.Partner/DeletePartner", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.name}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Partner_DeletePartner_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Partner_DeletePartner_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_Partner_DeletePartner_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rafay.dev.rpc.v3.Partner/DeletePartner", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Partner_DeletePartner_1(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Partner_DeletePartner_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Partner_CreatePartner_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"auth", "v3", "partner"}, "")) + + pattern_Partner_GetPartner_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"auth", "v3", "partner", "metadata.name"}, "")) + + pattern_Partner_GetPartner_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"auth", "v3", "partner", "metadata.id"}, "")) + + pattern_Partner_UpdatePartner_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"auth", "v3", "partner", "metadata.name"}, "")) + + pattern_Partner_UpdatePartner_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"auth", "v3", "partner", "metadata.id"}, "")) + + pattern_Partner_DeletePartner_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"auth", "v3", "partner", "metadata.name"}, "")) + + pattern_Partner_DeletePartner_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"auth", "v3", "partner", "metadata.id"}, "")) +) + +var ( + forward_Partner_CreatePartner_0 = runtime.ForwardResponseMessage + + forward_Partner_GetPartner_0 = runtime.ForwardResponseMessage + + forward_Partner_GetPartner_1 = runtime.ForwardResponseMessage + + forward_Partner_UpdatePartner_0 = runtime.ForwardResponseMessage + + forward_Partner_UpdatePartner_1 = runtime.ForwardResponseMessage + + forward_Partner_DeletePartner_0 = runtime.ForwardResponseMessage + + forward_Partner_DeletePartner_1 = runtime.ForwardResponseMessage +) diff --git a/components/adminsrv/proto/rpc/v3/partner.proto b/components/adminsrv/proto/rpc/v3/partner.proto new file mode 100644 index 0000000..26a868a --- /dev/null +++ b/components/adminsrv/proto/rpc/v3/partner.proto @@ -0,0 +1,125 @@ +syntax = "proto3"; +package rafay.dev.rpc.v3; + +import "google/api/annotations.proto"; +import "gogoproto/gogo.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; +import "proto/types/systempb/v3/partner.proto"; + +// Enable custom Marshal method. +option (gogoproto.marshaler_all) = true; +// Enable custom Unmarshal method. +option (gogoproto.unmarshaler_all) = true; +// Enable custom Size method (Required by Marshal and Unmarshal). +option (gogoproto.sizer_all) = true; +// Enable registration with golang/protobuf for the grpc-gateway. +option (gogoproto.goproto_registration) = true; +// Enable generation of XXX_MessageName methods for grpc-go/status. +option (gogoproto.messagename_all) = true; + +option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + info: { + title: "Partner Service" + version: "3.0" + contact: { name: "Rafay Dev" } + } + schemes: HTTPS + consumes: "application/json" + consumes: "application/yaml" + produces: "application/json" + produces: "application/yaml" + security_definitions: { + security: { + key: "BasicAuth" + value: { type: TYPE_BASIC } + } + security: { + key: "ApiKeyAuth" + value: { type: TYPE_API_KEY in: IN_HEADER name: "X-RAFAY-API-KEYID" } + } + } + security: { + security_requirement: { + key: "BasicAuth" + value: {} + } + security_requirement: { + key: "ApiKeyAuth" + value: {} + } + } + responses: { + key: "403" + value: { + description: "Returned when the user does not have permission to access the resource." + } + } + responses: { + key: "404" + value: { + description: "Returned when the resource does not exist." + schema: { json_schema: { type: STRING } } + } + } +}; + +service Partner { + rpc CreatePartner(rafay.dev.types.system.v3.Partner) + returns (rafay.dev.types.system.v3.Partner) { + option (google.api.http) = { + post : "/auth/v3/partner" + body : "*" + }; + + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + responses : { + key : "201" + value : { + description : "Returned when partner is created successfully." + } + } + }; + }; + + rpc GetPartner(rafay.dev.types.system.v3.Partner) + returns (rafay.dev.types.system.v3.Partner) { + option (google.api.http) = { + get : "/auth/v3/partner/{metadata.name}" + additional_bindings { + get : "/auth/v3/partner/{metadata.id}" + } + }; + }; + + rpc UpdatePartner(rafay.dev.types.system.v3.Partner) + returns (rafay.dev.types.system.v3.Partner) { + option (google.api.http) = { + put : "/auth/v3/partner/{metadata.name}" + body : "*" + additional_bindings { + put : "/auth/v3/partner/{metadata.id}" + body : "*" + } + }; + }; + + rpc DeletePartner(rafay.dev.types.system.v3.Partner) + returns (rafay.dev.types.system.v3.Partner) { + option (google.api.http) = { + delete : "/auth/v3/partner/{metadata.name}" + additional_bindings { + delete : "/auth/v3/partner/{metadata.id}" + } + }; + + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + responses : { + key : "204" + value : { + description : "Returned when partner is deleted successfully." + } + } + }; + }; + +} \ No newline at end of file diff --git a/components/adminsrv/proto/rpc/v3/partner_grpc.pb.go b/components/adminsrv/proto/rpc/v3/partner_grpc.pb.go new file mode 100644 index 0000000..28c0fbd --- /dev/null +++ b/components/adminsrv/proto/rpc/v3/partner_grpc.pb.go @@ -0,0 +1,212 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc (unknown) +// source: proto/rpc/v3/partner.proto + +package rpcv3 + +import ( + context "context" + v3 "github.com/RafaySystems/rcloud-base/components/adminsrv/proto/types/systempb/v3" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// PartnerClient is the client API for Partner service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type PartnerClient interface { + CreatePartner(ctx context.Context, in *v3.Partner, opts ...grpc.CallOption) (*v3.Partner, error) + GetPartner(ctx context.Context, in *v3.Partner, opts ...grpc.CallOption) (*v3.Partner, error) + UpdatePartner(ctx context.Context, in *v3.Partner, opts ...grpc.CallOption) (*v3.Partner, error) + DeletePartner(ctx context.Context, in *v3.Partner, opts ...grpc.CallOption) (*v3.Partner, error) +} + +type partnerClient struct { + cc grpc.ClientConnInterface +} + +func NewPartnerClient(cc grpc.ClientConnInterface) PartnerClient { + return &partnerClient{cc} +} + +func (c *partnerClient) CreatePartner(ctx context.Context, in *v3.Partner, opts ...grpc.CallOption) (*v3.Partner, error) { + out := new(v3.Partner) + err := c.cc.Invoke(ctx, "/rafay.dev.rpc.v3.Partner/CreatePartner", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *partnerClient) GetPartner(ctx context.Context, in *v3.Partner, opts ...grpc.CallOption) (*v3.Partner, error) { + out := new(v3.Partner) + err := c.cc.Invoke(ctx, "/rafay.dev.rpc.v3.Partner/GetPartner", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *partnerClient) UpdatePartner(ctx context.Context, in *v3.Partner, opts ...grpc.CallOption) (*v3.Partner, error) { + out := new(v3.Partner) + err := c.cc.Invoke(ctx, "/rafay.dev.rpc.v3.Partner/UpdatePartner", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *partnerClient) DeletePartner(ctx context.Context, in *v3.Partner, opts ...grpc.CallOption) (*v3.Partner, error) { + out := new(v3.Partner) + err := c.cc.Invoke(ctx, "/rafay.dev.rpc.v3.Partner/DeletePartner", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// PartnerServer is the server API for Partner service. +// All implementations should embed UnimplementedPartnerServer +// for forward compatibility +type PartnerServer interface { + CreatePartner(context.Context, *v3.Partner) (*v3.Partner, error) + GetPartner(context.Context, *v3.Partner) (*v3.Partner, error) + UpdatePartner(context.Context, *v3.Partner) (*v3.Partner, error) + DeletePartner(context.Context, *v3.Partner) (*v3.Partner, error) +} + +// UnimplementedPartnerServer should be embedded to have forward compatible implementations. +type UnimplementedPartnerServer struct { +} + +func (UnimplementedPartnerServer) CreatePartner(context.Context, *v3.Partner) (*v3.Partner, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreatePartner not implemented") +} +func (UnimplementedPartnerServer) GetPartner(context.Context, *v3.Partner) (*v3.Partner, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPartner not implemented") +} +func (UnimplementedPartnerServer) UpdatePartner(context.Context, *v3.Partner) (*v3.Partner, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdatePartner not implemented") +} +func (UnimplementedPartnerServer) DeletePartner(context.Context, *v3.Partner) (*v3.Partner, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeletePartner not implemented") +} + +// UnsafePartnerServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to PartnerServer will +// result in compilation errors. +type UnsafePartnerServer interface { + mustEmbedUnimplementedPartnerServer() +} + +func RegisterPartnerServer(s grpc.ServiceRegistrar, srv PartnerServer) { + s.RegisterService(&Partner_ServiceDesc, srv) +} + +func _Partner_CreatePartner_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v3.Partner) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PartnerServer).CreatePartner(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/rafay.dev.rpc.v3.Partner/CreatePartner", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PartnerServer).CreatePartner(ctx, req.(*v3.Partner)) + } + return interceptor(ctx, in, info, handler) +} + +func _Partner_GetPartner_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v3.Partner) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PartnerServer).GetPartner(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/rafay.dev.rpc.v3.Partner/GetPartner", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PartnerServer).GetPartner(ctx, req.(*v3.Partner)) + } + return interceptor(ctx, in, info, handler) +} + +func _Partner_UpdatePartner_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v3.Partner) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PartnerServer).UpdatePartner(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/rafay.dev.rpc.v3.Partner/UpdatePartner", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PartnerServer).UpdatePartner(ctx, req.(*v3.Partner)) + } + return interceptor(ctx, in, info, handler) +} + +func _Partner_DeletePartner_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v3.Partner) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PartnerServer).DeletePartner(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/rafay.dev.rpc.v3.Partner/DeletePartner", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PartnerServer).DeletePartner(ctx, req.(*v3.Partner)) + } + return interceptor(ctx, in, info, handler) +} + +// Partner_ServiceDesc is the grpc.ServiceDesc for Partner service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Partner_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "rafay.dev.rpc.v3.Partner", + HandlerType: (*PartnerServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreatePartner", + Handler: _Partner_CreatePartner_Handler, + }, + { + MethodName: "GetPartner", + Handler: _Partner_GetPartner_Handler, + }, + { + MethodName: "UpdatePartner", + Handler: _Partner_UpdatePartner_Handler, + }, + { + MethodName: "DeletePartner", + Handler: _Partner_DeletePartner_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "proto/rpc/v3/partner.proto", +} diff --git a/components/adminsrv/proto/rpc/v3/project.go b/components/adminsrv/proto/rpc/v3/project.go new file mode 100644 index 0000000..e1c7cb8 --- /dev/null +++ b/components/adminsrv/proto/rpc/v3/project.go @@ -0,0 +1,62 @@ +package rpcv3 + +import ( + "context" + + "github.com/RafaySystems/rcloud-base/components/adminsrv/pkg/service" + systempbv3 "github.com/RafaySystems/rcloud-base/components/adminsrv/proto/types/systempb/v3" +) + +type projectServer struct { + service.ProjectService +} + +// NewProjectServer returns new project server implementation +func NewProjectServer(ps service.ProjectService) ProjectServer { + return &projectServer{ps} +} + +func (s *projectServer) CreateProject(ctx context.Context, p *systempbv3.Project) (*systempbv3.Project, error) { + project, err := s.Create(ctx, p) + if err != nil { + return nil, err + } + return project, nil +} + +func (s *projectServer) GetProjects(ctx context.Context, p *systempbv3.Project) (*systempbv3.ProjectList, error) { + projects, err := s.List(ctx, p) + if err != nil { + return nil, err + } + return projects, nil +} + +func (s *projectServer) GetProject(ctx context.Context, p *systempbv3.Project) (*systempbv3.Project, error) { + + project, err := s.GetByName(ctx, p.Metadata.Name) + if err != nil { + project, err = s.GetByID(ctx, p.Metadata.Id) + if err != nil { + return nil, err + } + } + + return project, nil +} + +func (s *projectServer) DeleteProject(ctx context.Context, p *systempbv3.Project) (*systempbv3.Project, error) { + project, err := s.Delete(ctx, p) + if err != nil { + return nil, err + } + return project, nil +} + +func (s *projectServer) UpdateProject(ctx context.Context, p *systempbv3.Project) (*systempbv3.Project, error) { + project, err := s.Update(ctx, p) + if err != nil { + return nil, err + } + return project, nil +} diff --git a/components/adminsrv/proto/rpc/v3/project.pb.go b/components/adminsrv/proto/rpc/v3/project.pb.go new file mode 100644 index 0000000..be99ad7 --- /dev/null +++ b/components/adminsrv/proto/rpc/v3/project.pb.go @@ -0,0 +1,211 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc (unknown) +// source: proto/rpc/v3/project.proto + +package rpcv3 + +import ( + v3 "github.com/RafaySystems/rcloud-base/components/adminsrv/proto/types/systempb/v3" + _ "github.com/gogo/protobuf/gogoproto" + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_proto_rpc_v3_project_proto protoreflect.FileDescriptor + +var file_proto_rpc_v3_project_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x33, 0x2f, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x72, 0x61, + 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x33, 0x1a, 0x1c, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, + 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, + 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x25, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, + 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x70, 0x62, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xeb, 0x0a, 0x0a, 0x07, 0x50, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0xf1, 0x01, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x22, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, + 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, + 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x1a, 0x22, 0x2e, 0x72, 0x61, + 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, + 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x22, + 0x97, 0x01, 0x92, 0x41, 0x39, 0x4a, 0x37, 0x0a, 0x03, 0x32, 0x30, 0x31, 0x12, 0x30, 0x0a, 0x2e, + 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x69, 0x73, 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x20, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x66, 0x75, 0x6c, 0x6c, 0x79, 0x2e, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x55, 0x22, 0x50, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x33, 0x2f, 0x70, + 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x2e, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x7d, 0x2f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, + 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x2e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x01, 0x2a, 0x12, 0xb4, 0x01, 0x0a, 0x0b, 0x47, 0x65, + 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x22, 0x2e, 0x72, 0x61, 0x66, 0x61, + 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x1a, 0x26, 0x2e, + 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x59, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x53, 0x12, 0x51, 0x2f, + 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x2f, + 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, + 0x72, 0x7d, 0x2f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, + 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, + 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, + 0x12, 0xa2, 0x02, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, + 0x22, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x1a, 0x22, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x76, 0x33, 0x2e, + 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x22, 0xcb, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0xc4, + 0x01, 0x12, 0x60, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x61, 0x72, 0x74, + 0x6e, 0x65, 0x72, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x61, + 0x72, 0x74, 0x6e, 0x65, 0x72, 0x7d, 0x2f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6f, 0x72, + 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x70, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6e, 0x61, + 0x6d, 0x65, 0x7d, 0x5a, 0x60, 0x12, 0x5e, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x33, 0x2f, + 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x2e, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x7d, 0x2f, 0x6f, 0x72, 0x67, 0x61, 0x6e, + 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x2e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x2e, 0x69, 0x64, 0x7d, 0x12, 0xab, 0x02, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x22, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, + 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, + 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x1a, 0x22, 0x2e, 0x72, 0x61, + 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, + 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x22, + 0xd1, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0xca, 0x01, 0x1a, 0x60, 0x2f, 0x61, 0x75, 0x74, 0x68, + 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x2f, 0x7b, 0x6d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x7d, 0x2f, 0x6f, + 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x7b, 0x6d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x7d, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x6d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x3a, 0x01, 0x2a, 0x5a, 0x63, + 0x1a, 0x5e, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x6e, + 0x65, 0x72, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x61, 0x72, + 0x74, 0x6e, 0x65, 0x72, 0x7d, 0x2f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6f, 0x72, 0x67, + 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x69, 0x64, 0x7d, + 0x3a, 0x01, 0x2a, 0x12, 0xe1, 0x02, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x22, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, + 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x76, + 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x1a, 0x22, 0x2e, 0x72, 0x61, 0x66, 0x61, + 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x87, 0x02, + 0x92, 0x41, 0x39, 0x4a, 0x37, 0x0a, 0x03, 0x32, 0x30, 0x34, 0x12, 0x30, 0x0a, 0x2e, 0x52, 0x65, + 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x70, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x20, 0x69, 0x73, 0x20, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x20, 0x73, + 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x66, 0x75, 0x6c, 0x6c, 0x79, 0x2e, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0xc4, 0x01, 0x2a, 0x60, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x61, + 0x72, 0x74, 0x6e, 0x65, 0x72, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, + 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x7d, 0x2f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, + 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, + 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x5a, 0x60, 0x2a, 0x5e, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, + 0x33, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x2e, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x7d, 0x2f, 0x6f, 0x72, 0x67, + 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x2e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x7d, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x2e, 0x69, 0x64, 0x7d, 0x42, 0xc5, 0x04, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, + 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x33, + 0x42, 0x0c, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, + 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x52, 0x61, 0x66, + 0x61, 0x79, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x73, 0x2f, 0x72, 0x63, 0x6c, 0x6f, 0x75, 0x64, + 0x2d, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, + 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x73, 0x72, 0x76, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x72, 0x70, 0x63, 0x2f, 0x76, 0x33, 0x3b, 0x72, 0x70, 0x63, 0x76, 0x33, 0xa2, 0x02, 0x03, 0x52, + 0x44, 0x52, 0xaa, 0x02, 0x10, 0x52, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x44, 0x65, 0x76, 0x2e, 0x52, + 0x70, 0x63, 0x2e, 0x56, 0x33, 0xca, 0x02, 0x10, 0x52, 0x61, 0x66, 0x61, 0x79, 0x5c, 0x44, 0x65, + 0x76, 0x5c, 0x52, 0x70, 0x63, 0x5c, 0x56, 0x33, 0xe2, 0x02, 0x1c, 0x52, 0x61, 0x66, 0x61, 0x79, + 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x52, 0x70, 0x63, 0x5c, 0x56, 0x33, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x52, 0x61, 0x66, 0x61, 0x79, 0x3a, + 0x3a, 0x44, 0x65, 0x76, 0x3a, 0x3a, 0x52, 0x70, 0x63, 0x3a, 0x3a, 0x56, 0x33, 0x92, 0x41, 0xda, + 0x02, 0x12, 0x23, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x22, 0x0b, 0x0a, 0x09, 0x52, 0x61, 0x66, 0x61, 0x79, 0x20, 0x44, 0x65, + 0x76, 0x32, 0x03, 0x33, 0x2e, 0x30, 0x2a, 0x01, 0x02, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x32, 0x10, 0x61, 0x70, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x10, 0x61, + 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, + 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x79, 0x61, 0x6d, + 0x6c, 0x52, 0x50, 0x0a, 0x03, 0x34, 0x30, 0x33, 0x12, 0x49, 0x0a, 0x47, 0x52, 0x65, 0x74, 0x75, + 0x72, 0x6e, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x73, + 0x65, 0x72, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x68, 0x61, 0x76, 0x65, + 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x61, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x2e, 0x52, 0x3b, 0x0a, 0x03, 0x34, 0x30, 0x34, 0x12, 0x34, 0x0a, 0x2a, 0x52, 0x65, + 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, + 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, 0x6f, + 0x74, 0x20, 0x65, 0x78, 0x69, 0x73, 0x74, 0x2e, 0x12, 0x06, 0x0a, 0x04, 0x9a, 0x02, 0x01, 0x07, + 0x5a, 0x38, 0x0a, 0x25, 0x0a, 0x0a, 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x41, 0x75, 0x74, 0x68, + 0x12, 0x17, 0x08, 0x02, 0x1a, 0x11, 0x58, 0x2d, 0x52, 0x41, 0x46, 0x41, 0x59, 0x2d, 0x41, 0x50, + 0x49, 0x2d, 0x4b, 0x45, 0x59, 0x49, 0x44, 0x20, 0x02, 0x0a, 0x0f, 0x0a, 0x09, 0x42, 0x61, 0x73, + 0x69, 0x63, 0x41, 0x75, 0x74, 0x68, 0x12, 0x02, 0x08, 0x01, 0x62, 0x1f, 0x0a, 0x0e, 0x0a, 0x0a, + 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x0a, 0x0d, 0x0a, 0x09, + 0x42, 0x61, 0x73, 0x69, 0x63, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0xc8, 0xe2, 0x1e, 0x01, 0xd0, + 0xe2, 0x1e, 0x01, 0xe0, 0xe2, 0x1e, 0x01, 0xc0, 0xe3, 0x1e, 0x01, 0xc8, 0xe3, 0x1e, 0x01, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var file_proto_rpc_v3_project_proto_goTypes = []interface{}{ + (*v3.Project)(nil), // 0: rafay.dev.types.system.v3.Project + (*v3.ProjectList)(nil), // 1: rafay.dev.types.system.v3.ProjectList +} +var file_proto_rpc_v3_project_proto_depIdxs = []int32{ + 0, // 0: rafay.dev.rpc.v3.Project.CreateProject:input_type -> rafay.dev.types.system.v3.Project + 0, // 1: rafay.dev.rpc.v3.Project.GetProjects:input_type -> rafay.dev.types.system.v3.Project + 0, // 2: rafay.dev.rpc.v3.Project.GetProject:input_type -> rafay.dev.types.system.v3.Project + 0, // 3: rafay.dev.rpc.v3.Project.UpdateProject:input_type -> rafay.dev.types.system.v3.Project + 0, // 4: rafay.dev.rpc.v3.Project.DeleteProject:input_type -> rafay.dev.types.system.v3.Project + 0, // 5: rafay.dev.rpc.v3.Project.CreateProject:output_type -> rafay.dev.types.system.v3.Project + 1, // 6: rafay.dev.rpc.v3.Project.GetProjects:output_type -> rafay.dev.types.system.v3.ProjectList + 0, // 7: rafay.dev.rpc.v3.Project.GetProject:output_type -> rafay.dev.types.system.v3.Project + 0, // 8: rafay.dev.rpc.v3.Project.UpdateProject:output_type -> rafay.dev.types.system.v3.Project + 0, // 9: rafay.dev.rpc.v3.Project.DeleteProject:output_type -> rafay.dev.types.system.v3.Project + 5, // [5:10] is the sub-list for method output_type + 0, // [0:5] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_proto_rpc_v3_project_proto_init() } +func file_proto_rpc_v3_project_proto_init() { + if File_proto_rpc_v3_project_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_proto_rpc_v3_project_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_proto_rpc_v3_project_proto_goTypes, + DependencyIndexes: file_proto_rpc_v3_project_proto_depIdxs, + }.Build() + File_proto_rpc_v3_project_proto = out.File + file_proto_rpc_v3_project_proto_rawDesc = nil + file_proto_rpc_v3_project_proto_goTypes = nil + file_proto_rpc_v3_project_proto_depIdxs = nil +} diff --git a/components/adminsrv/proto/rpc/v3/project.pb.gw.go b/components/adminsrv/proto/rpc/v3/project.pb.gw.go new file mode 100644 index 0000000..b28a96c --- /dev/null +++ b/components/adminsrv/proto/rpc/v3/project.pb.gw.go @@ -0,0 +1,1297 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: proto/rpc/v3/project.proto + +/* +Package rpcv3 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package rpcv3 + +import ( + "context" + "io" + "net/http" + + "github.com/RafaySystems/rcloud-base/components/adminsrv/proto/types/systempb/v3" + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_Project_CreateProject_0(ctx context.Context, marshaler runtime.Marshaler, client ProjectClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Project + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.partner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.partner") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.partner", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.partner", err) + } + + val, ok = pathParams["metadata.organization"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.organization") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.organization", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.organization", err) + } + + msg, err := client.CreateProject(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Project_CreateProject_0(ctx context.Context, marshaler runtime.Marshaler, server ProjectServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Project + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.partner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.partner") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.partner", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.partner", err) + } + + val, ok = pathParams["metadata.organization"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.organization") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.organization", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.organization", err) + } + + msg, err := server.CreateProject(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Project_GetProjects_0 = &utilities.DoubleArray{Encoding: map[string]int{"metadata": 0, "partner": 1, "organization": 2}, Base: []int{1, 1, 1, 2, 0, 0}, Check: []int{0, 1, 2, 2, 3, 4}} +) + +func request_Project_GetProjects_0(ctx context.Context, marshaler runtime.Marshaler, client ProjectClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Project + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.partner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.partner") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.partner", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.partner", err) + } + + val, ok = pathParams["metadata.organization"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.organization") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.organization", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.organization", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Project_GetProjects_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetProjects(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Project_GetProjects_0(ctx context.Context, marshaler runtime.Marshaler, server ProjectServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Project + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.partner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.partner") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.partner", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.partner", err) + } + + val, ok = pathParams["metadata.organization"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.organization") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.organization", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.organization", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Project_GetProjects_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetProjects(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Project_GetProject_0 = &utilities.DoubleArray{Encoding: map[string]int{"metadata": 0, "partner": 1, "organization": 2, "name": 3}, Base: []int{1, 1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 2, 2, 2, 3, 4, 5}} +) + +func request_Project_GetProject_0(ctx context.Context, marshaler runtime.Marshaler, client ProjectClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Project + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.partner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.partner") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.partner", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.partner", err) + } + + val, ok = pathParams["metadata.organization"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.organization") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.organization", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.organization", err) + } + + val, ok = pathParams["metadata.name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.name") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.name", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.name", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Project_GetProject_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetProject(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Project_GetProject_0(ctx context.Context, marshaler runtime.Marshaler, server ProjectServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Project + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.partner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.partner") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.partner", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.partner", err) + } + + val, ok = pathParams["metadata.organization"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.organization") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.organization", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.organization", err) + } + + val, ok = pathParams["metadata.name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.name") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.name", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.name", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Project_GetProject_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetProject(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Project_GetProject_1 = &utilities.DoubleArray{Encoding: map[string]int{"metadata": 0, "partner": 1, "organization": 2, "id": 3}, Base: []int{1, 1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 2, 2, 2, 3, 4, 5}} +) + +func request_Project_GetProject_1(ctx context.Context, marshaler runtime.Marshaler, client ProjectClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Project + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.partner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.partner") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.partner", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.partner", err) + } + + val, ok = pathParams["metadata.organization"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.organization") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.organization", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.organization", err) + } + + val, ok = pathParams["metadata.id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.id") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.id", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Project_GetProject_1); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetProject(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Project_GetProject_1(ctx context.Context, marshaler runtime.Marshaler, server ProjectServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Project + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.partner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.partner") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.partner", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.partner", err) + } + + val, ok = pathParams["metadata.organization"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.organization") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.organization", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.organization", err) + } + + val, ok = pathParams["metadata.id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.id") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.id", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Project_GetProject_1); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetProject(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Project_UpdateProject_0(ctx context.Context, marshaler runtime.Marshaler, client ProjectClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Project + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.partner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.partner") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.partner", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.partner", err) + } + + val, ok = pathParams["metadata.organization"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.organization") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.organization", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.organization", err) + } + + val, ok = pathParams["metadata.name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.name") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.name", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.name", err) + } + + msg, err := client.UpdateProject(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Project_UpdateProject_0(ctx context.Context, marshaler runtime.Marshaler, server ProjectServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Project + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.partner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.partner") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.partner", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.partner", err) + } + + val, ok = pathParams["metadata.organization"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.organization") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.organization", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.organization", err) + } + + val, ok = pathParams["metadata.name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.name") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.name", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.name", err) + } + + msg, err := server.UpdateProject(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Project_UpdateProject_1(ctx context.Context, marshaler runtime.Marshaler, client ProjectClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Project + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.partner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.partner") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.partner", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.partner", err) + } + + val, ok = pathParams["metadata.organization"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.organization") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.organization", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.organization", err) + } + + val, ok = pathParams["metadata.id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.id") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.id", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.id", err) + } + + msg, err := client.UpdateProject(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Project_UpdateProject_1(ctx context.Context, marshaler runtime.Marshaler, server ProjectServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Project + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.partner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.partner") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.partner", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.partner", err) + } + + val, ok = pathParams["metadata.organization"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.organization") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.organization", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.organization", err) + } + + val, ok = pathParams["metadata.id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.id") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.id", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.id", err) + } + + msg, err := server.UpdateProject(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Project_DeleteProject_0 = &utilities.DoubleArray{Encoding: map[string]int{"metadata": 0, "partner": 1, "organization": 2, "name": 3}, Base: []int{1, 1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 2, 2, 2, 3, 4, 5}} +) + +func request_Project_DeleteProject_0(ctx context.Context, marshaler runtime.Marshaler, client ProjectClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Project + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.partner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.partner") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.partner", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.partner", err) + } + + val, ok = pathParams["metadata.organization"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.organization") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.organization", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.organization", err) + } + + val, ok = pathParams["metadata.name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.name") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.name", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.name", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Project_DeleteProject_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DeleteProject(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Project_DeleteProject_0(ctx context.Context, marshaler runtime.Marshaler, server ProjectServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Project + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.partner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.partner") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.partner", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.partner", err) + } + + val, ok = pathParams["metadata.organization"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.organization") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.organization", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.organization", err) + } + + val, ok = pathParams["metadata.name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.name") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.name", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.name", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Project_DeleteProject_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DeleteProject(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Project_DeleteProject_1 = &utilities.DoubleArray{Encoding: map[string]int{"metadata": 0, "partner": 1, "organization": 2, "id": 3}, Base: []int{1, 1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 2, 2, 2, 3, 4, 5}} +) + +func request_Project_DeleteProject_1(ctx context.Context, marshaler runtime.Marshaler, client ProjectClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Project + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.partner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.partner") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.partner", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.partner", err) + } + + val, ok = pathParams["metadata.organization"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.organization") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.organization", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.organization", err) + } + + val, ok = pathParams["metadata.id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.id") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.id", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Project_DeleteProject_1); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DeleteProject(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Project_DeleteProject_1(ctx context.Context, marshaler runtime.Marshaler, server ProjectServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq systemv3.Project + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.partner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.partner") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.partner", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.partner", err) + } + + val, ok = pathParams["metadata.organization"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.organization") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.organization", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.organization", err) + } + + val, ok = pathParams["metadata.id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.id") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.id", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Project_DeleteProject_1); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DeleteProject(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterProjectHandlerServer registers the http handlers for service Project to "mux". +// UnaryRPC :call ProjectServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterProjectHandlerFromEndpoint instead. +func RegisterProjectHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ProjectServer) error { + + mux.Handle("POST", pattern_Project_CreateProject_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rafay.dev.rpc.v3.Project/CreateProject", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/project")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Project_CreateProject_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Project_CreateProject_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Project_GetProjects_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rafay.dev.rpc.v3.Project/GetProjects", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/projects")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Project_GetProjects_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Project_GetProjects_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Project_GetProject_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rafay.dev.rpc.v3.Project/GetProject", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/project/{metadata.name}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Project_GetProject_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Project_GetProject_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Project_GetProject_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rafay.dev.rpc.v3.Project/GetProject", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/project/{metadata.id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Project_GetProject_1(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Project_GetProject_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_Project_UpdateProject_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rafay.dev.rpc.v3.Project/UpdateProject", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/project/{metadata.name}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Project_UpdateProject_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Project_UpdateProject_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_Project_UpdateProject_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rafay.dev.rpc.v3.Project/UpdateProject", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/project/{metadata.id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Project_UpdateProject_1(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Project_UpdateProject_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_Project_DeleteProject_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rafay.dev.rpc.v3.Project/DeleteProject", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/project/{metadata.name}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Project_DeleteProject_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Project_DeleteProject_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_Project_DeleteProject_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/rafay.dev.rpc.v3.Project/DeleteProject", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/project/{metadata.id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Project_DeleteProject_1(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Project_DeleteProject_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterProjectHandlerFromEndpoint is same as RegisterProjectHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterProjectHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterProjectHandler(ctx, mux, conn) +} + +// RegisterProjectHandler registers the http handlers for service Project to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterProjectHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterProjectHandlerClient(ctx, mux, NewProjectClient(conn)) +} + +// RegisterProjectHandlerClient registers the http handlers for service Project +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ProjectClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ProjectClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "ProjectClient" to call the correct interceptors. +func RegisterProjectHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ProjectClient) error { + + mux.Handle("POST", pattern_Project_CreateProject_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rafay.dev.rpc.v3.Project/CreateProject", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/project")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Project_CreateProject_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Project_CreateProject_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Project_GetProjects_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rafay.dev.rpc.v3.Project/GetProjects", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/projects")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Project_GetProjects_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Project_GetProjects_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Project_GetProject_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rafay.dev.rpc.v3.Project/GetProject", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/project/{metadata.name}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Project_GetProject_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Project_GetProject_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Project_GetProject_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rafay.dev.rpc.v3.Project/GetProject", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/project/{metadata.id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Project_GetProject_1(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Project_GetProject_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_Project_UpdateProject_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rafay.dev.rpc.v3.Project/UpdateProject", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/project/{metadata.name}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Project_UpdateProject_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Project_UpdateProject_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PUT", pattern_Project_UpdateProject_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rafay.dev.rpc.v3.Project/UpdateProject", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/project/{metadata.id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Project_UpdateProject_1(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Project_UpdateProject_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_Project_DeleteProject_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rafay.dev.rpc.v3.Project/DeleteProject", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/project/{metadata.name}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Project_DeleteProject_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Project_DeleteProject_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_Project_DeleteProject_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/rafay.dev.rpc.v3.Project/DeleteProject", runtime.WithHTTPPathPattern("/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/project/{metadata.id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Project_DeleteProject_1(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Project_DeleteProject_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Project_CreateProject_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6}, []string{"auth", "v3", "partner", "metadata.partner", "organization", "metadata.organization", "project"}, "")) + + pattern_Project_GetProjects_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6}, []string{"auth", "v3", "partner", "metadata.partner", "organization", "metadata.organization", "projects"}, "")) + + pattern_Project_GetProject_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6, 1, 0, 4, 1, 5, 7}, []string{"auth", "v3", "partner", "metadata.partner", "organization", "metadata.organization", "project", "metadata.name"}, "")) + + pattern_Project_GetProject_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6, 1, 0, 4, 1, 5, 7}, []string{"auth", "v3", "partner", "metadata.partner", "organization", "metadata.organization", "project", "metadata.id"}, "")) + + pattern_Project_UpdateProject_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6, 1, 0, 4, 1, 5, 7}, []string{"auth", "v3", "partner", "metadata.partner", "organization", "metadata.organization", "project", "metadata.name"}, "")) + + pattern_Project_UpdateProject_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6, 1, 0, 4, 1, 5, 7}, []string{"auth", "v3", "partner", "metadata.partner", "organization", "metadata.organization", "project", "metadata.id"}, "")) + + pattern_Project_DeleteProject_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6, 1, 0, 4, 1, 5, 7}, []string{"auth", "v3", "partner", "metadata.partner", "organization", "metadata.organization", "project", "metadata.name"}, "")) + + pattern_Project_DeleteProject_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6, 1, 0, 4, 1, 5, 7}, []string{"auth", "v3", "partner", "metadata.partner", "organization", "metadata.organization", "project", "metadata.id"}, "")) +) + +var ( + forward_Project_CreateProject_0 = runtime.ForwardResponseMessage + + forward_Project_GetProjects_0 = runtime.ForwardResponseMessage + + forward_Project_GetProject_0 = runtime.ForwardResponseMessage + + forward_Project_GetProject_1 = runtime.ForwardResponseMessage + + forward_Project_UpdateProject_0 = runtime.ForwardResponseMessage + + forward_Project_UpdateProject_1 = runtime.ForwardResponseMessage + + forward_Project_DeleteProject_0 = runtime.ForwardResponseMessage + + forward_Project_DeleteProject_1 = runtime.ForwardResponseMessage +) diff --git a/components/adminsrv/proto/rpc/v3/project.proto b/components/adminsrv/proto/rpc/v3/project.proto new file mode 100644 index 0000000..efb97cf --- /dev/null +++ b/components/adminsrv/proto/rpc/v3/project.proto @@ -0,0 +1,139 @@ +syntax = "proto3"; +package rafay.dev.rpc.v3; + +import "google/api/annotations.proto"; +import "gogoproto/gogo.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; +import "proto/types/systempb/v3/project.proto"; + +// Enable custom Marshal method. +option (gogoproto.marshaler_all) = true; +// Enable custom Unmarshal method. +option (gogoproto.unmarshaler_all) = true; +// Enable custom Size method (Required by Marshal and Unmarshal). +option (gogoproto.sizer_all) = true; +// Enable registration with golang/protobuf for the grpc-gateway. +option (gogoproto.goproto_registration) = true; +// Enable generation of XXX_MessageName methods for grpc-go/status. +option (gogoproto.messagename_all) = true; + +option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + info : { + title : "Project Service" + version : "3.0" + contact : {name : "Rafay Dev"} + } + schemes : HTTPS + consumes : "application/json" + consumes : "application/yaml" + produces : "application/json" + produces : "application/yaml" + security_definitions : { + security : { + key : "BasicAuth" + value : {type : TYPE_BASIC} + } + security : { + key : "ApiKeyAuth" + value : {type : TYPE_API_KEY in : IN_HEADER name : "X-RAFAY-API-KEYID"} + } + } + security : { + security_requirement : { + key : "BasicAuth" + value : {} + } + security_requirement : { + key : "ApiKeyAuth" + value : {} + } + } + responses : { + key : "403" + value : { + description : "Returned when the user does not have permission to access " + "the resource." + } + } + responses : { + key : "404" + value : { + description : "Returned when the resource does not exist." + schema : {json_schema : {type : STRING}} + } + } +}; + +service Project { + rpc CreateProject(rafay.dev.types.system.v3.Project) + returns (rafay.dev.types.system.v3.Project) { + option (google.api.http) = { + post : "/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/project" + body : "*" + }; + + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + responses : { + key : "201" + value : { + description : "Returned when project is created successfully." + } + } + }; + }; + + rpc GetProjects(rafay.dev.types.system.v3.Project) + returns (rafay.dev.types.system.v3.ProjectList) { + option (google.api.http) = { + get : "/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/projects" + }; + }; + + rpc GetProject(rafay.dev.types.system.v3.Project) + returns (rafay.dev.types.system.v3.Project) { + option (google.api.http) = { + get : "/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/project/" + "{metadata.name}" + additional_bindings { + get : "/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/project/" + "{metadata.id}" + } + }; + }; + + rpc UpdateProject(rafay.dev.types.system.v3.Project) + returns (rafay.dev.types.system.v3.Project) { + option (google.api.http) = { + put : "/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/project/" + "{metadata.name}" + body : "*" + additional_bindings { + put : "/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/project/" + "{metadata.id}" + body : "*" + } + }; + }; + + rpc DeleteProject(rafay.dev.types.system.v3.Project) + returns (rafay.dev.types.system.v3.Project) { + option (google.api.http) = { + delete : "/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/project/" + "{metadata.name}" + additional_bindings { + delete : "/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/project/" + "{metadata.id}" + } + }; + + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + responses : { + key : "204" + value : { + description : "Returned when project is deleted successfully." + } + } + }; + }; + + } \ No newline at end of file diff --git a/components/adminsrv/proto/rpc/v3/project_grpc.pb.go b/components/adminsrv/proto/rpc/v3/project_grpc.pb.go new file mode 100644 index 0000000..f7e4afd --- /dev/null +++ b/components/adminsrv/proto/rpc/v3/project_grpc.pb.go @@ -0,0 +1,248 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc (unknown) +// source: proto/rpc/v3/project.proto + +package rpcv3 + +import ( + context "context" + v3 "github.com/RafaySystems/rcloud-base/components/adminsrv/proto/types/systempb/v3" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// ProjectClient is the client API for Project service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ProjectClient interface { + CreateProject(ctx context.Context, in *v3.Project, opts ...grpc.CallOption) (*v3.Project, error) + GetProjects(ctx context.Context, in *v3.Project, opts ...grpc.CallOption) (*v3.ProjectList, error) + GetProject(ctx context.Context, in *v3.Project, opts ...grpc.CallOption) (*v3.Project, error) + UpdateProject(ctx context.Context, in *v3.Project, opts ...grpc.CallOption) (*v3.Project, error) + DeleteProject(ctx context.Context, in *v3.Project, opts ...grpc.CallOption) (*v3.Project, error) +} + +type projectClient struct { + cc grpc.ClientConnInterface +} + +func NewProjectClient(cc grpc.ClientConnInterface) ProjectClient { + return &projectClient{cc} +} + +func (c *projectClient) CreateProject(ctx context.Context, in *v3.Project, opts ...grpc.CallOption) (*v3.Project, error) { + out := new(v3.Project) + err := c.cc.Invoke(ctx, "/rafay.dev.rpc.v3.Project/CreateProject", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *projectClient) GetProjects(ctx context.Context, in *v3.Project, opts ...grpc.CallOption) (*v3.ProjectList, error) { + out := new(v3.ProjectList) + err := c.cc.Invoke(ctx, "/rafay.dev.rpc.v3.Project/GetProjects", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *projectClient) GetProject(ctx context.Context, in *v3.Project, opts ...grpc.CallOption) (*v3.Project, error) { + out := new(v3.Project) + err := c.cc.Invoke(ctx, "/rafay.dev.rpc.v3.Project/GetProject", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *projectClient) UpdateProject(ctx context.Context, in *v3.Project, opts ...grpc.CallOption) (*v3.Project, error) { + out := new(v3.Project) + err := c.cc.Invoke(ctx, "/rafay.dev.rpc.v3.Project/UpdateProject", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *projectClient) DeleteProject(ctx context.Context, in *v3.Project, opts ...grpc.CallOption) (*v3.Project, error) { + out := new(v3.Project) + err := c.cc.Invoke(ctx, "/rafay.dev.rpc.v3.Project/DeleteProject", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ProjectServer is the server API for Project service. +// All implementations should embed UnimplementedProjectServer +// for forward compatibility +type ProjectServer interface { + CreateProject(context.Context, *v3.Project) (*v3.Project, error) + GetProjects(context.Context, *v3.Project) (*v3.ProjectList, error) + GetProject(context.Context, *v3.Project) (*v3.Project, error) + UpdateProject(context.Context, *v3.Project) (*v3.Project, error) + DeleteProject(context.Context, *v3.Project) (*v3.Project, error) +} + +// UnimplementedProjectServer should be embedded to have forward compatible implementations. +type UnimplementedProjectServer struct { +} + +func (UnimplementedProjectServer) CreateProject(context.Context, *v3.Project) (*v3.Project, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateProject not implemented") +} +func (UnimplementedProjectServer) GetProjects(context.Context, *v3.Project) (*v3.ProjectList, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetProjects not implemented") +} +func (UnimplementedProjectServer) GetProject(context.Context, *v3.Project) (*v3.Project, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetProject not implemented") +} +func (UnimplementedProjectServer) UpdateProject(context.Context, *v3.Project) (*v3.Project, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateProject not implemented") +} +func (UnimplementedProjectServer) DeleteProject(context.Context, *v3.Project) (*v3.Project, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteProject not implemented") +} + +// UnsafeProjectServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ProjectServer will +// result in compilation errors. +type UnsafeProjectServer interface { + mustEmbedUnimplementedProjectServer() +} + +func RegisterProjectServer(s grpc.ServiceRegistrar, srv ProjectServer) { + s.RegisterService(&Project_ServiceDesc, srv) +} + +func _Project_CreateProject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v3.Project) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProjectServer).CreateProject(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/rafay.dev.rpc.v3.Project/CreateProject", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProjectServer).CreateProject(ctx, req.(*v3.Project)) + } + return interceptor(ctx, in, info, handler) +} + +func _Project_GetProjects_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v3.Project) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProjectServer).GetProjects(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/rafay.dev.rpc.v3.Project/GetProjects", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProjectServer).GetProjects(ctx, req.(*v3.Project)) + } + return interceptor(ctx, in, info, handler) +} + +func _Project_GetProject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v3.Project) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProjectServer).GetProject(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/rafay.dev.rpc.v3.Project/GetProject", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProjectServer).GetProject(ctx, req.(*v3.Project)) + } + return interceptor(ctx, in, info, handler) +} + +func _Project_UpdateProject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v3.Project) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProjectServer).UpdateProject(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/rafay.dev.rpc.v3.Project/UpdateProject", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProjectServer).UpdateProject(ctx, req.(*v3.Project)) + } + return interceptor(ctx, in, info, handler) +} + +func _Project_DeleteProject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v3.Project) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProjectServer).DeleteProject(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/rafay.dev.rpc.v3.Project/DeleteProject", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProjectServer).DeleteProject(ctx, req.(*v3.Project)) + } + return interceptor(ctx, in, info, handler) +} + +// Project_ServiceDesc is the grpc.ServiceDesc for Project service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Project_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "rafay.dev.rpc.v3.Project", + HandlerType: (*ProjectServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateProject", + Handler: _Project_CreateProject_Handler, + }, + { + MethodName: "GetProjects", + Handler: _Project_GetProjects_Handler, + }, + { + MethodName: "GetProject", + Handler: _Project_GetProject_Handler, + }, + { + MethodName: "UpdateProject", + Handler: _Project_UpdateProject_Handler, + }, + { + MethodName: "DeleteProject", + Handler: _Project_DeleteProject_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "proto/rpc/v3/project.proto", +} diff --git a/components/adminsrv/proto/types/systempb/v3/organization.pb.go b/components/adminsrv/proto/types/systempb/v3/organization.pb.go new file mode 100644 index 0000000..69886d0 --- /dev/null +++ b/components/adminsrv/proto/types/systempb/v3/organization.pb.go @@ -0,0 +1,774 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc (unknown) +// source: proto/types/systempb/v3/organization.proto + +package systemv3 + +import ( + v3 "github.com/RafaySystems/rcloud-base/components/common/proto/types/commonpb/v3" + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Lockout struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` + PeriodMin int32 `protobuf:"varint,2,opt,name=period_min,json=periodMin,proto3" json:"period_min,omitempty"` + Attempts int32 `protobuf:"varint,3,opt,name=attempts,proto3" json:"attempts,omitempty"` +} + +func (x *Lockout) Reset() { + *x = Lockout{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_types_systempb_v3_organization_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Lockout) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Lockout) ProtoMessage() {} + +func (x *Lockout) ProtoReflect() protoreflect.Message { + mi := &file_proto_types_systempb_v3_organization_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Lockout.ProtoReflect.Descriptor instead. +func (*Lockout) Descriptor() ([]byte, []int) { + return file_proto_types_systempb_v3_organization_proto_rawDescGZIP(), []int{0} +} + +func (x *Lockout) GetEnabled() bool { + if x != nil { + return x.Enabled + } + return false +} + +func (x *Lockout) GetPeriodMin() int32 { + if x != nil { + return x.PeriodMin + } + return 0 +} + +func (x *Lockout) GetAttempts() int32 { + if x != nil { + return x.Attempts + } + return 0 +} + +type OrganizationSettings struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Lockout *Lockout `protobuf:"bytes,1,opt,name=lockout,proto3" json:"lockout,omitempty"` + IdleLogoutMin int32 `protobuf:"varint,2,opt,name=idleLogoutMin,proto3" json:"idleLogoutMin,omitempty"` +} + +func (x *OrganizationSettings) Reset() { + *x = OrganizationSettings{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_types_systempb_v3_organization_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OrganizationSettings) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OrganizationSettings) ProtoMessage() {} + +func (x *OrganizationSettings) ProtoReflect() protoreflect.Message { + mi := &file_proto_types_systempb_v3_organization_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OrganizationSettings.ProtoReflect.Descriptor instead. +func (*OrganizationSettings) Descriptor() ([]byte, []int) { + return file_proto_types_systempb_v3_organization_proto_rawDescGZIP(), []int{1} +} + +func (x *OrganizationSettings) GetLockout() *Lockout { + if x != nil { + return x.Lockout + } + return nil +} + +func (x *OrganizationSettings) GetIdleLogoutMin() int32 { + if x != nil { + return x.IdleLogoutMin + } + return 0 +} + +type OrganizationSpec struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BillingAddress string `protobuf:"bytes,1,opt,name=billingAddress,proto3" json:"billingAddress,omitempty"` + Active bool `protobuf:"varint,2,opt,name=active,proto3" json:"active,omitempty"` + Approved bool `protobuf:"varint,3,opt,name=approved,proto3" json:"approved,omitempty"` + Type string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"` + AddressLine1 string `protobuf:"bytes,5,opt,name=addressLine1,proto3" json:"addressLine1,omitempty"` + AddressLine2 string `protobuf:"bytes,6,opt,name=addressLine2,proto3" json:"addressLine2,omitempty"` + City string `protobuf:"bytes,7,opt,name=city,proto3" json:"city,omitempty"` + Country string `protobuf:"bytes,8,opt,name=country,proto3" json:"country,omitempty"` + Phone string `protobuf:"bytes,9,opt,name=phone,proto3" json:"phone,omitempty"` + State string `protobuf:"bytes,10,opt,name=state,proto3" json:"state,omitempty"` + Zipcode string `protobuf:"bytes,11,opt,name=zipcode,proto3" json:"zipcode,omitempty"` + IsPrivate bool `protobuf:"varint,12,opt,name=isPrivate,proto3" json:"isPrivate,omitempty"` + IsTotpEnabled bool `protobuf:"varint,13,opt,name=isTotpEnabled,proto3" json:"isTotpEnabled,omitempty"` + AreClustersShared bool `protobuf:"varint,14,opt,name=areClustersShared,proto3" json:"areClustersShared,omitempty"` + Settings *OrganizationSettings `protobuf:"bytes,15,opt,name=settings,proto3" json:"settings,omitempty"` +} + +func (x *OrganizationSpec) Reset() { + *x = OrganizationSpec{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_types_systempb_v3_organization_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OrganizationSpec) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OrganizationSpec) ProtoMessage() {} + +func (x *OrganizationSpec) ProtoReflect() protoreflect.Message { + mi := &file_proto_types_systempb_v3_organization_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OrganizationSpec.ProtoReflect.Descriptor instead. +func (*OrganizationSpec) Descriptor() ([]byte, []int) { + return file_proto_types_systempb_v3_organization_proto_rawDescGZIP(), []int{2} +} + +func (x *OrganizationSpec) GetBillingAddress() string { + if x != nil { + return x.BillingAddress + } + return "" +} + +func (x *OrganizationSpec) GetActive() bool { + if x != nil { + return x.Active + } + return false +} + +func (x *OrganizationSpec) GetApproved() bool { + if x != nil { + return x.Approved + } + return false +} + +func (x *OrganizationSpec) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *OrganizationSpec) GetAddressLine1() string { + if x != nil { + return x.AddressLine1 + } + return "" +} + +func (x *OrganizationSpec) GetAddressLine2() string { + if x != nil { + return x.AddressLine2 + } + return "" +} + +func (x *OrganizationSpec) GetCity() string { + if x != nil { + return x.City + } + return "" +} + +func (x *OrganizationSpec) GetCountry() string { + if x != nil { + return x.Country + } + return "" +} + +func (x *OrganizationSpec) GetPhone() string { + if x != nil { + return x.Phone + } + return "" +} + +func (x *OrganizationSpec) GetState() string { + if x != nil { + return x.State + } + return "" +} + +func (x *OrganizationSpec) GetZipcode() string { + if x != nil { + return x.Zipcode + } + return "" +} + +func (x *OrganizationSpec) GetIsPrivate() bool { + if x != nil { + return x.IsPrivate + } + return false +} + +func (x *OrganizationSpec) GetIsTotpEnabled() bool { + if x != nil { + return x.IsTotpEnabled + } + return false +} + +func (x *OrganizationSpec) GetAreClustersShared() bool { + if x != nil { + return x.AreClustersShared + } + return false +} + +func (x *OrganizationSpec) GetSettings() *OrganizationSettings { + if x != nil { + return x.Settings + } + return nil +} + +type Organization struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ApiVersion string `protobuf:"bytes,1,opt,name=apiVersion,proto3" json:"apiVersion,omitempty"` + Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"` + Metadata *v3.Metadata `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + Spec *OrganizationSpec `protobuf:"bytes,4,opt,name=spec,proto3" json:"spec,omitempty"` + Status *v3.Status `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"` +} + +func (x *Organization) Reset() { + *x = Organization{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_types_systempb_v3_organization_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Organization) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Organization) ProtoMessage() {} + +func (x *Organization) ProtoReflect() protoreflect.Message { + mi := &file_proto_types_systempb_v3_organization_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Organization.ProtoReflect.Descriptor instead. +func (*Organization) Descriptor() ([]byte, []int) { + return file_proto_types_systempb_v3_organization_proto_rawDescGZIP(), []int{3} +} + +func (x *Organization) GetApiVersion() string { + if x != nil { + return x.ApiVersion + } + return "" +} + +func (x *Organization) GetKind() string { + if x != nil { + return x.Kind + } + return "" +} + +func (x *Organization) GetMetadata() *v3.Metadata { + if x != nil { + return x.Metadata + } + return nil +} + +func (x *Organization) GetSpec() *OrganizationSpec { + if x != nil { + return x.Spec + } + return nil +} + +func (x *Organization) GetStatus() *v3.Status { + if x != nil { + return x.Status + } + return nil +} + +type OrganizationList struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ApiVersion string `protobuf:"bytes,1,opt,name=apiVersion,proto3" json:"apiVersion,omitempty"` + Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"` + Metadata *v3.ListMetadata `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + Items []*Organization `protobuf:"bytes,4,rep,name=items,proto3" json:"items,omitempty"` +} + +func (x *OrganizationList) Reset() { + *x = OrganizationList{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_types_systempb_v3_organization_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OrganizationList) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OrganizationList) ProtoMessage() {} + +func (x *OrganizationList) ProtoReflect() protoreflect.Message { + mi := &file_proto_types_systempb_v3_organization_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OrganizationList.ProtoReflect.Descriptor instead. +func (*OrganizationList) Descriptor() ([]byte, []int) { + return file_proto_types_systempb_v3_organization_proto_rawDescGZIP(), []int{4} +} + +func (x *OrganizationList) GetApiVersion() string { + if x != nil { + return x.ApiVersion + } + return "" +} + +func (x *OrganizationList) GetKind() string { + if x != nil { + return x.Kind + } + return "" +} + +func (x *OrganizationList) GetMetadata() *v3.ListMetadata { + if x != nil { + return x.Metadata + } + return nil +} + +func (x *OrganizationList) GetItems() []*Organization { + if x != nil { + return x.Items + } + return nil +} + +var File_proto_types_systempb_v3_organization_proto protoreflect.FileDescriptor + +var file_proto_types_systempb_v3_organization_proto_rawDesc = []byte{ + 0x0a, 0x2a, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x73, 0x79, + 0x73, 0x74, 0x65, 0x6d, 0x70, 0x62, 0x2f, 0x76, 0x33, 0x2f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, + 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x72, 0x61, + 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, + 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x76, 0x33, 0x1a, 0x24, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2f, 0x76, 0x33, + 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, + 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf0, 0x01, + 0x0a, 0x07, 0x4c, 0x6f, 0x63, 0x6b, 0x6f, 0x75, 0x74, 0x12, 0x44, 0x0a, 0x07, 0x65, 0x6e, 0x61, + 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x42, 0x2a, 0x92, 0x41, 0x27, 0x2a, + 0x07, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x32, 0x1c, 0x49, 0x73, 0x20, 0x6c, 0x6f, 0x63, + 0x6b, 0x6f, 0x75, 0x74, 0x20, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x20, 0x65, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3f, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, + 0x4d, 0x0a, 0x0a, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x5f, 0x6d, 0x69, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x42, 0x2e, 0x92, 0x41, 0x2b, 0x2a, 0x0e, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, + 0x20, 0x4d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x73, 0x32, 0x19, 0x4c, 0x6f, 0x63, 0x6b, 0x6f, 0x75, + 0x74, 0x20, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x4d, 0x69, 0x6e, 0x75, + 0x74, 0x65, 0x73, 0x52, 0x09, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x4d, 0x69, 0x6e, 0x12, 0x50, + 0x0a, 0x08, 0x61, 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x42, 0x34, 0x92, 0x41, 0x31, 0x2a, 0x08, 0x41, 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x73, 0x32, + 0x25, 0x4d, 0x61, 0x78, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x6f, 0x66, 0x20, 0x61, + 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x73, 0x20, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x20, 0x6c, + 0x6f, 0x63, 0x6b, 0x6f, 0x75, 0x74, 0x52, 0x08, 0x61, 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x73, + 0x22, 0xe5, 0x01, 0x0a, 0x14, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x70, 0x0a, 0x07, 0x6c, 0x6f, 0x63, + 0x6b, 0x6f, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x72, 0x61, 0x66, + 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, 0x73, + 0x74, 0x65, 0x6d, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x6f, 0x63, 0x6b, 0x6f, 0x75, 0x74, 0x42, 0x32, + 0x92, 0x41, 0x2f, 0x2a, 0x07, 0x4c, 0x6f, 0x63, 0x6b, 0x6f, 0x75, 0x74, 0x32, 0x24, 0x4c, 0x6f, + 0x63, 0x6b, 0x6f, 0x75, 0x74, 0x20, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x20, 0x6f, + 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x07, 0x6c, 0x6f, 0x63, 0x6b, 0x6f, 0x75, 0x74, 0x12, 0x5b, 0x0a, 0x0d, 0x69, + 0x64, 0x6c, 0x65, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x4d, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x05, 0x42, 0x35, 0x92, 0x41, 0x32, 0x2a, 0x13, 0x49, 0x64, 0x6c, 0x65, 0x20, 0x4c, 0x6f, + 0x67, 0x6f, 0x75, 0x74, 0x20, 0x4d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x73, 0x32, 0x1b, 0x49, 0x64, + 0x6c, 0x65, 0x20, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x20, 0x69, + 0x6e, 0x20, 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x73, 0x52, 0x0d, 0x69, 0x64, 0x6c, 0x65, 0x4c, + 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x4d, 0x69, 0x6e, 0x22, 0xa5, 0x09, 0x0a, 0x10, 0x4f, 0x72, 0x67, + 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x70, 0x65, 0x63, 0x12, 0x61, 0x0a, + 0x0e, 0x62, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x39, 0x92, 0x41, 0x36, 0x2a, 0x0f, 0x42, 0x69, 0x6c, 0x6c, + 0x69, 0x6e, 0x67, 0x20, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x32, 0x23, 0x42, 0x69, 0x6c, + 0x6c, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x6f, 0x66, 0x20, + 0x74, 0x68, 0x65, 0x20, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x0e, 0x62, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x12, 0x4e, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, + 0x42, 0x36, 0x92, 0x41, 0x33, 0x2a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x32, 0x29, 0x52, + 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x69, 0x66, 0x20, 0x74, 0x68, 0x69, + 0x73, 0x20, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, + 0x73, 0x20, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, + 0x12, 0x46, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x08, 0x42, 0x2a, 0x92, 0x41, 0x27, 0x2a, 0x08, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, + 0x64, 0x32, 0x1b, 0x49, 0x73, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x72, 0x67, 0x61, 0x6e, + 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x52, 0x08, + 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x12, 0x33, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1f, 0x92, 0x41, 0x1c, 0x2a, 0x04, 0x54, 0x79, 0x70, + 0x65, 0x32, 0x14, 0x54, 0x79, 0x70, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x6f, 0x72, 0x67, 0x61, 0x6e, + 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x54, 0x0a, + 0x0c, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x4c, 0x69, 0x6e, 0x65, 0x31, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x30, 0x92, 0x41, 0x2d, 0x2a, 0x0e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x20, 0x4c, 0x69, 0x6e, 0x65, 0x20, 0x31, 0x32, 0x1b, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x4c, 0x69, + 0x6e, 0x65, 0x31, 0x12, 0x54, 0x0a, 0x0c, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x4c, 0x69, + 0x6e, 0x65, 0x32, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x30, 0x92, 0x41, 0x2d, 0x2a, 0x0e, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x4c, 0x69, 0x6e, 0x65, 0x20, 0x32, 0x32, 0x1b, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, + 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x4c, 0x69, 0x6e, 0x65, 0x32, 0x12, 0x23, 0x0a, 0x04, 0x63, 0x69, 0x74, + 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0f, 0x92, 0x41, 0x0c, 0x2a, 0x04, 0x43, 0x69, + 0x74, 0x79, 0x32, 0x04, 0x43, 0x69, 0x74, 0x79, 0x52, 0x04, 0x63, 0x69, 0x74, 0x79, 0x12, 0x43, + 0x0a, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x29, 0x92, 0x41, 0x26, 0x2a, 0x07, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x32, 0x1b, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x72, + 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x42, 0x0a, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x2c, 0x92, 0x41, 0x29, 0x2a, 0x05, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x32, 0x20, + 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x6f, 0x66, 0x20, + 0x74, 0x68, 0x65, 0x20, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x3b, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0x92, 0x41, 0x22, 0x2a, 0x05, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x32, 0x19, 0x53, 0x74, 0x61, 0x74, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, + 0x20, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x12, 0x2f, 0x0a, 0x07, 0x7a, 0x69, 0x70, 0x63, 0x6f, 0x64, 0x65, 0x18, + 0x0b, 0x20, 0x01, 0x28, 0x09, 0x42, 0x15, 0x92, 0x41, 0x12, 0x2a, 0x07, 0x5a, 0x69, 0x70, 0x63, + 0x6f, 0x64, 0x65, 0x32, 0x07, 0x5a, 0x69, 0x70, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x07, 0x7a, 0x69, + 0x70, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x46, 0x0a, 0x09, 0x69, 0x73, 0x50, 0x72, 0x69, 0x76, 0x61, + 0x74, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x42, 0x28, 0x92, 0x41, 0x25, 0x2a, 0x0a, 0x49, + 0x73, 0x20, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x32, 0x17, 0x49, 0x73, 0x20, 0x50, 0x72, + 0x69, 0x76, 0x61, 0x74, 0x65, 0x20, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x09, 0x69, 0x73, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x12, 0x61, 0x0a, + 0x0d, 0x69, 0x73, 0x54, 0x6f, 0x74, 0x70, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x0d, + 0x20, 0x01, 0x28, 0x08, 0x42, 0x3b, 0x92, 0x41, 0x38, 0x2a, 0x0f, 0x49, 0x73, 0x20, 0x54, 0x4f, + 0x54, 0x50, 0x20, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x32, 0x25, 0x49, 0x73, 0x20, 0x54, + 0x4f, 0x54, 0x50, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x20, 0x61, 0x74, 0x20, 0x6f, + 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x65, 0x76, 0x65, + 0x6c, 0x52, 0x0d, 0x69, 0x73, 0x54, 0x6f, 0x74, 0x70, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, + 0x12, 0x57, 0x0a, 0x11, 0x61, 0x72, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x53, + 0x68, 0x61, 0x72, 0x65, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x42, 0x29, 0x92, 0x41, 0x26, + 0x2a, 0x0f, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x20, 0x53, 0x68, 0x61, 0x72, 0x65, + 0x64, 0x32, 0x13, 0x41, 0x72, 0x65, 0x20, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x20, + 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x52, 0x11, 0x61, 0x72, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, + 0x65, 0x72, 0x73, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x12, 0x94, 0x01, 0x0a, 0x08, 0x73, 0x65, + 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x72, + 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, + 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x76, 0x33, 0x2e, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x42, 0x47, 0x92, + 0x41, 0x44, 0x2a, 0x08, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x32, 0x38, 0x56, 0x61, + 0x72, 0x69, 0x6f, 0x75, 0x73, 0x20, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x20, 0x6c, + 0x69, 0x6b, 0x65, 0x20, 0x6c, 0x6f, 0x63, 0x6b, 0x6f, 0x75, 0x74, 0x2c, 0x20, 0x61, 0x75, 0x74, + 0x6f, 0x2d, 0x6c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, + 0x22, 0xb1, 0x04, 0x0a, 0x0c, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x65, 0x0a, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x45, 0x92, 0x41, 0x42, 0x2a, 0x0b, 0x41, 0x50, 0x49, 0x20, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x32, 0x1b, 0x41, 0x50, 0x49, 0x20, 0x56, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x3a, 0x14, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x6b, 0x38, 0x73, + 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x69, 0x6f, 0x2f, 0x76, 0x33, 0x40, 0x01, 0x52, 0x0a, 0x61, 0x70, + 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x43, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2f, 0x92, 0x41, 0x2c, 0x2a, 0x04, 0x4b, 0x69, 0x6e, + 0x64, 0x32, 0x14, 0x4b, 0x69, 0x6e, 0x64, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3a, 0x0c, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x40, 0x01, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x68, 0x0a, + 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x23, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x42, 0x27, 0x92, 0x41, 0x24, 0x2a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x32, 0x18, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x20, 0x6f, 0x66, + 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x6d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x60, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, + 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x76, + 0x33, 0x2e, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x70, + 0x65, 0x63, 0x42, 0x1f, 0x92, 0x41, 0x1c, 0x2a, 0x04, 0x53, 0x70, 0x65, 0x63, 0x32, 0x14, 0x53, + 0x70, 0x65, 0x63, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x60, 0x0a, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x72, 0x61, 0x66, 0x61, + 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x25, 0x92, 0x41, + 0x22, 0x2a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x32, 0x16, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x40, 0x01, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x3a, 0x47, 0x92, 0x41, 0x44, + 0x0a, 0x42, 0x2a, 0x0c, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x32, 0x0c, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xd2, 0x01, + 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0xd2, 0x01, 0x04, 0x6b, 0x69, + 0x6e, 0x64, 0xd2, 0x01, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xd2, 0x01, 0x04, + 0x73, 0x70, 0x65, 0x63, 0x22, 0xa9, 0x03, 0x0a, 0x10, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x6a, 0x0a, 0x0a, 0x61, 0x70, 0x69, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x4a, 0x92, + 0x41, 0x47, 0x2a, 0x0b, 0x41, 0x50, 0x49, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x32, + 0x20, 0x41, 0x50, 0x49, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, + 0x74, 0x68, 0x65, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x3a, 0x14, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x6b, 0x38, 0x73, 0x6d, 0x67, 0x6d, + 0x74, 0x2e, 0x69, 0x6f, 0x2f, 0x76, 0x33, 0x40, 0x01, 0x52, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x4c, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x38, 0x92, 0x41, 0x35, 0x2a, 0x04, 0x4b, 0x69, 0x6e, 0x64, 0x32, 0x19, + 0x4b, 0x69, 0x6e, 0x64, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x69, 0x73, 0x74, + 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3a, 0x10, 0x4f, 0x72, 0x67, 0x61, 0x6e, + 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x40, 0x01, 0x52, 0x04, 0x6b, + 0x69, 0x6e, 0x64, 0x12, 0x77, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, + 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, + 0x33, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x32, + 0x92, 0x41, 0x2f, 0x2a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x32, 0x1d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x20, 0x6f, 0x66, 0x20, 0x74, + 0x68, 0x65, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x40, 0x01, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x62, 0x0a, 0x05, + 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x72, 0x61, + 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, + 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x76, 0x33, 0x2e, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x23, 0x92, 0x41, 0x20, 0x2a, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, + 0x32, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x40, 0x01, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, + 0x42, 0x95, 0x02, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, + 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, + 0x76, 0x33, 0x42, 0x11, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x58, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x52, 0x61, 0x66, 0x61, 0x79, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x73, + 0x2f, 0x72, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x63, 0x6f, 0x6d, + 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x73, 0x72, 0x76, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x73, 0x79, 0x73, + 0x74, 0x65, 0x6d, 0x70, 0x62, 0x2f, 0x76, 0x33, 0x3b, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x76, + 0x33, 0xa2, 0x02, 0x04, 0x52, 0x44, 0x54, 0x53, 0xaa, 0x02, 0x19, 0x52, 0x61, 0x66, 0x61, 0x79, + 0x2e, 0x44, 0x65, 0x76, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x2e, 0x56, 0x33, 0xca, 0x02, 0x19, 0x52, 0x61, 0x66, 0x61, 0x79, 0x5c, 0x44, 0x65, 0x76, + 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5c, 0x56, 0x33, + 0xe2, 0x02, 0x25, 0x52, 0x61, 0x66, 0x61, 0x79, 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x54, 0x79, 0x70, + 0x65, 0x73, 0x5c, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5c, 0x56, 0x33, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1d, 0x52, 0x61, 0x66, 0x61, 0x79, + 0x3a, 0x3a, 0x44, 0x65, 0x76, 0x3a, 0x3a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x3a, 0x3a, 0x53, 0x79, + 0x73, 0x74, 0x65, 0x6d, 0x3a, 0x3a, 0x56, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_proto_types_systempb_v3_organization_proto_rawDescOnce sync.Once + file_proto_types_systempb_v3_organization_proto_rawDescData = file_proto_types_systempb_v3_organization_proto_rawDesc +) + +func file_proto_types_systempb_v3_organization_proto_rawDescGZIP() []byte { + file_proto_types_systempb_v3_organization_proto_rawDescOnce.Do(func() { + file_proto_types_systempb_v3_organization_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_types_systempb_v3_organization_proto_rawDescData) + }) + return file_proto_types_systempb_v3_organization_proto_rawDescData +} + +var file_proto_types_systempb_v3_organization_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_proto_types_systempb_v3_organization_proto_goTypes = []interface{}{ + (*Lockout)(nil), // 0: rafay.dev.types.system.v3.Lockout + (*OrganizationSettings)(nil), // 1: rafay.dev.types.system.v3.OrganizationSettings + (*OrganizationSpec)(nil), // 2: rafay.dev.types.system.v3.OrganizationSpec + (*Organization)(nil), // 3: rafay.dev.types.system.v3.Organization + (*OrganizationList)(nil), // 4: rafay.dev.types.system.v3.OrganizationList + (*v3.Metadata)(nil), // 5: rafay.dev.types.common.v3.Metadata + (*v3.Status)(nil), // 6: rafay.dev.types.common.v3.Status + (*v3.ListMetadata)(nil), // 7: rafay.dev.types.common.v3.ListMetadata +} +var file_proto_types_systempb_v3_organization_proto_depIdxs = []int32{ + 0, // 0: rafay.dev.types.system.v3.OrganizationSettings.lockout:type_name -> rafay.dev.types.system.v3.Lockout + 1, // 1: rafay.dev.types.system.v3.OrganizationSpec.settings:type_name -> rafay.dev.types.system.v3.OrganizationSettings + 5, // 2: rafay.dev.types.system.v3.Organization.metadata:type_name -> rafay.dev.types.common.v3.Metadata + 2, // 3: rafay.dev.types.system.v3.Organization.spec:type_name -> rafay.dev.types.system.v3.OrganizationSpec + 6, // 4: rafay.dev.types.system.v3.Organization.status:type_name -> rafay.dev.types.common.v3.Status + 7, // 5: rafay.dev.types.system.v3.OrganizationList.metadata:type_name -> rafay.dev.types.common.v3.ListMetadata + 3, // 6: rafay.dev.types.system.v3.OrganizationList.items:type_name -> rafay.dev.types.system.v3.Organization + 7, // [7:7] is the sub-list for method output_type + 7, // [7:7] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name +} + +func init() { file_proto_types_systempb_v3_organization_proto_init() } +func file_proto_types_systempb_v3_organization_proto_init() { + if File_proto_types_systempb_v3_organization_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_proto_types_systempb_v3_organization_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Lockout); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_types_systempb_v3_organization_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OrganizationSettings); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_types_systempb_v3_organization_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OrganizationSpec); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_types_systempb_v3_organization_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Organization); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_types_systempb_v3_organization_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OrganizationList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_proto_types_systempb_v3_organization_proto_rawDesc, + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_proto_types_systempb_v3_organization_proto_goTypes, + DependencyIndexes: file_proto_types_systempb_v3_organization_proto_depIdxs, + MessageInfos: file_proto_types_systempb_v3_organization_proto_msgTypes, + }.Build() + File_proto_types_systempb_v3_organization_proto = out.File + file_proto_types_systempb_v3_organization_proto_rawDesc = nil + file_proto_types_systempb_v3_organization_proto_goTypes = nil + file_proto_types_systempb_v3_organization_proto_depIdxs = nil +} diff --git a/components/adminsrv/proto/types/systempb/v3/organization.proto b/components/adminsrv/proto/types/systempb/v3/organization.proto new file mode 100644 index 0000000..546e71c --- /dev/null +++ b/components/adminsrv/proto/types/systempb/v3/organization.proto @@ -0,0 +1,183 @@ +syntax = "proto3"; +package rafay.dev.types.system.v3; + +import "proto/types/commonpb/v3/common.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; + +message Lockout { + bool enabled = 1 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Enabled" + description : "Is lockout settings enabled?" + } ]; + int32 period_min = 2 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Period Minutes" + description : "Lockout period in Minutes" + } ]; + int32 attempts = 3 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Attempts" + description : "Max number of attempts before lockout" + } ]; +} + +message OrganizationSettings { + Lockout lockout = 1 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Lockout" + description : "Lockout settings of the organization" + } ]; + int32 idleLogoutMin = 2 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Idle Logout Minutes" + description : "Idle Logout time in minutes" + } ]; +} + +message OrganizationSpec { + string billingAddress = 1 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Billing Address" + description : "Billing address of the organization" + } ]; + bool active = 2 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Active" + description : "Represents if this organization is active" + } ]; + bool approved = 3 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Approved" + description : "Is this organization active" + } ]; + string type = 4 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Type" + description : "Type of organization" + } ]; + string addressLine1 = 5 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Address Line 1" + description : "Address of the organization" + } ]; + string addressLine2 = 6 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Address Line 2" + description : "Address of the organization" + } ]; + string city = 7 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "City" + description : "City" + } ]; + string country = 8 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Country" + description : "Country of the organization" + } ]; + string phone = 9 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Phone" + description : "Phone number of the organization" + } ]; + string state = 10 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "State" + description : "State of the organization" + } ]; + string zipcode = 11 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Zipcode" + description : "Zipcode" + } ]; + bool isPrivate = 12 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Is Private" + description : "Is Private Organization" + } ]; + bool isTotpEnabled = 13 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Is TOTP Enabled" + description : "Is TOTP enabled at organization level" + } ]; + bool areClustersShared = 14 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Clusters Shared" + description : "Are clusters shared" + } ]; + OrganizationSettings settings = 15 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Settings" + description : "Various settings like lockout, auto-logout configuration" + } ]; +} + +message Organization { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema : { + title : "Organization" + description : "Organization" + required : [ "apiVersion", "kind", "metadata", "spec" ] + } + }; + string apiVersion = 1 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "API Version", + description : "API Version of the resource" + default : "system.k8smgmt.io/v3" + read_only : true + } ]; + string kind = 2 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Kind", + description : "Kind of the resource" + default : "Organization" + read_only : true + } ]; + rafay.dev.types.common.v3.Metadata metadata = 3 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Metadata", + description : "Metadata of the resource" + } ]; + OrganizationSpec spec = 4 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Spec", + description : "Spec of the resource" + } ]; + rafay.dev.types.common.v3.Status status = 5 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Status", + description : "Status of the resource" + read_only : true + } ]; +} + +message OrganizationList { + string apiVersion = 1 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "API Version", + description : "API Version of the list resource" + default : "system.k8smgmt.io/v3" + read_only : true + } ]; + string kind = 2 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Kind", + description : "Kind of the list resource" + default : "OrganizationList" + read_only : true + } ]; + rafay.dev.types.common.v3.ListMetadata metadata = 3 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "ListMetadata", + description : "Metadata of the list resource" + read_only : true + } ]; + repeated Organization items = 4 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Items", + description : "List of the resources" + read_only : true + } ]; +} \ No newline at end of file diff --git a/components/adminsrv/proto/types/systempb/v3/partner.pb.go b/components/adminsrv/proto/types/systempb/v3/partner.pb.go new file mode 100644 index 0000000..def5f77 --- /dev/null +++ b/components/adminsrv/proto/types/systempb/v3/partner.pb.go @@ -0,0 +1,452 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc (unknown) +// source: proto/types/systempb/v3/partner.proto + +package systemv3 + +import ( + v3 "github.com/RafaySystems/rcloud-base/components/common/proto/types/commonpb/v3" + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + structpb "google.golang.org/protobuf/types/known/structpb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type PartnerSpec struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` + Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"` + TosLink string `protobuf:"bytes,3,opt,name=tosLink,proto3" json:"tosLink,omitempty"` + LogoLink string `protobuf:"bytes,4,opt,name=logoLink,proto3" json:"logoLink,omitempty"` + NotificationEmail string `protobuf:"bytes,5,opt,name=notificationEmail,proto3" json:"notificationEmail,omitempty"` + HelpdeskEmail string `protobuf:"bytes,6,opt,name=helpdeskEmail,proto3" json:"helpdeskEmail,omitempty"` + ProductName string `protobuf:"bytes,7,opt,name=productName,proto3" json:"productName,omitempty"` + SupportTeamName string `protobuf:"bytes,8,opt,name=supportTeamName,proto3" json:"supportTeamName,omitempty"` + OpsHost string `protobuf:"bytes,9,opt,name=opsHost,proto3" json:"opsHost,omitempty"` + FavIconLink string `protobuf:"bytes,10,opt,name=favIconLink,proto3" json:"favIconLink,omitempty"` + IsTOTPEnabled bool `protobuf:"varint,11,opt,name=isTOTPEnabled,proto3" json:"isTOTPEnabled,omitempty"` + Settings *structpb.Struct `protobuf:"bytes,12,opt,name=settings,proto3" json:"settings,omitempty"` +} + +func (x *PartnerSpec) Reset() { + *x = PartnerSpec{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_types_systempb_v3_partner_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PartnerSpec) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PartnerSpec) ProtoMessage() {} + +func (x *PartnerSpec) ProtoReflect() protoreflect.Message { + mi := &file_proto_types_systempb_v3_partner_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PartnerSpec.ProtoReflect.Descriptor instead. +func (*PartnerSpec) Descriptor() ([]byte, []int) { + return file_proto_types_systempb_v3_partner_proto_rawDescGZIP(), []int{0} +} + +func (x *PartnerSpec) GetHost() string { + if x != nil { + return x.Host + } + return "" +} + +func (x *PartnerSpec) GetDomain() string { + if x != nil { + return x.Domain + } + return "" +} + +func (x *PartnerSpec) GetTosLink() string { + if x != nil { + return x.TosLink + } + return "" +} + +func (x *PartnerSpec) GetLogoLink() string { + if x != nil { + return x.LogoLink + } + return "" +} + +func (x *PartnerSpec) GetNotificationEmail() string { + if x != nil { + return x.NotificationEmail + } + return "" +} + +func (x *PartnerSpec) GetHelpdeskEmail() string { + if x != nil { + return x.HelpdeskEmail + } + return "" +} + +func (x *PartnerSpec) GetProductName() string { + if x != nil { + return x.ProductName + } + return "" +} + +func (x *PartnerSpec) GetSupportTeamName() string { + if x != nil { + return x.SupportTeamName + } + return "" +} + +func (x *PartnerSpec) GetOpsHost() string { + if x != nil { + return x.OpsHost + } + return "" +} + +func (x *PartnerSpec) GetFavIconLink() string { + if x != nil { + return x.FavIconLink + } + return "" +} + +func (x *PartnerSpec) GetIsTOTPEnabled() bool { + if x != nil { + return x.IsTOTPEnabled + } + return false +} + +func (x *PartnerSpec) GetSettings() *structpb.Struct { + if x != nil { + return x.Settings + } + return nil +} + +type Partner struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ApiVersion string `protobuf:"bytes,1,opt,name=apiVersion,proto3" json:"apiVersion,omitempty"` + Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"` + Metadata *v3.Metadata `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + Spec *PartnerSpec `protobuf:"bytes,4,opt,name=spec,proto3" json:"spec,omitempty"` + Status *v3.Status `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"` +} + +func (x *Partner) Reset() { + *x = Partner{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_types_systempb_v3_partner_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Partner) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Partner) ProtoMessage() {} + +func (x *Partner) ProtoReflect() protoreflect.Message { + mi := &file_proto_types_systempb_v3_partner_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Partner.ProtoReflect.Descriptor instead. +func (*Partner) Descriptor() ([]byte, []int) { + return file_proto_types_systempb_v3_partner_proto_rawDescGZIP(), []int{1} +} + +func (x *Partner) GetApiVersion() string { + if x != nil { + return x.ApiVersion + } + return "" +} + +func (x *Partner) GetKind() string { + if x != nil { + return x.Kind + } + return "" +} + +func (x *Partner) GetMetadata() *v3.Metadata { + if x != nil { + return x.Metadata + } + return nil +} + +func (x *Partner) GetSpec() *PartnerSpec { + if x != nil { + return x.Spec + } + return nil +} + +func (x *Partner) GetStatus() *v3.Status { + if x != nil { + return x.Status + } + return nil +} + +var File_proto_types_systempb_v3_partner_proto protoreflect.FileDescriptor + +var file_proto_types_systempb_v3_partner_proto_rawDesc = []byte{ + 0x0a, 0x25, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x73, 0x79, + 0x73, 0x74, 0x65, 0x6d, 0x70, 0x62, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, + 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, + 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, + 0x76, 0x33, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x24, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2f, 0x76, 0x33, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, + 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe3, 0x07, 0x0a, 0x0b, 0x50, 0x61, 0x72, 0x74, 0x6e, + 0x65, 0x72, 0x53, 0x70, 0x65, 0x63, 0x12, 0x32, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x1e, 0x92, 0x41, 0x1b, 0x2a, 0x04, 0x48, 0x6f, 0x73, 0x74, 0x32, + 0x13, 0x48, 0x6f, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x61, 0x72, + 0x74, 0x6e, 0x65, 0x72, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x3a, 0x0a, 0x06, 0x64, 0x6f, + 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x22, 0x92, 0x41, 0x1f, 0x2a, + 0x06, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x32, 0x15, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x20, + 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x52, 0x06, + 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x47, 0x0a, 0x07, 0x74, 0x6f, 0x73, 0x4c, 0x69, 0x6e, + 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2d, 0x92, 0x41, 0x2a, 0x2a, 0x03, 0x54, 0x4f, + 0x53, 0x32, 0x23, 0x54, 0x65, 0x72, 0x6d, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x20, 0x75, 0x72, 0x6c, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, + 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x52, 0x07, 0x74, 0x6f, 0x73, 0x4c, 0x69, 0x6e, 0x6b, 0x12, + 0x3e, 0x0a, 0x08, 0x6c, 0x6f, 0x67, 0x6f, 0x4c, 0x69, 0x6e, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x22, 0x92, 0x41, 0x1f, 0x2a, 0x04, 0x4c, 0x6f, 0x67, 0x6f, 0x32, 0x17, 0x4c, 0x6f, + 0x67, 0x6f, 0x20, 0x75, 0x72, 0x6c, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x61, + 0x72, 0x74, 0x6e, 0x65, 0x72, 0x52, 0x08, 0x6c, 0x6f, 0x67, 0x6f, 0x4c, 0x69, 0x6e, 0x6b, 0x12, + 0x68, 0x0a, 0x11, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, + 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x3a, 0x92, 0x41, 0x37, 0x2a, + 0x12, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x45, 0x6d, + 0x61, 0x69, 0x6c, 0x32, 0x21, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, + 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x52, 0x11, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x58, 0x0a, 0x0d, 0x68, 0x65, 0x6c, + 0x70, 0x64, 0x65, 0x73, 0x6b, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x32, 0x92, 0x41, 0x2f, 0x2a, 0x0e, 0x48, 0x65, 0x6c, 0x70, 0x64, 0x65, 0x73, 0x6b, 0x20, + 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x32, 0x1d, 0x48, 0x65, 0x6c, 0x70, 0x64, 0x65, 0x73, 0x6b, 0x20, + 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x61, 0x72, + 0x74, 0x6e, 0x65, 0x72, 0x52, 0x0d, 0x68, 0x65, 0x6c, 0x70, 0x64, 0x65, 0x73, 0x6b, 0x45, 0x6d, + 0x61, 0x69, 0x6c, 0x12, 0x41, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4e, 0x61, + 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1f, 0x92, 0x41, 0x1c, 0x2a, 0x0c, 0x50, + 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x20, 0x4e, 0x61, 0x6d, 0x65, 0x32, 0x0c, 0x50, 0x72, 0x6f, + 0x64, 0x75, 0x63, 0x74, 0x20, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x64, 0x75, + 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x53, 0x0a, 0x0f, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, + 0x74, 0x54, 0x65, 0x61, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x29, 0x92, 0x41, 0x26, 0x2a, 0x11, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x54, 0x65, + 0x61, 0x6d, 0x20, 0x4e, 0x61, 0x6d, 0x65, 0x32, 0x11, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, + 0x20, 0x54, 0x65, 0x61, 0x6d, 0x20, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x0f, 0x73, 0x75, 0x70, 0x70, + 0x6f, 0x72, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x47, 0x0a, 0x07, 0x6f, + 0x70, 0x73, 0x48, 0x6f, 0x73, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2d, 0x92, 0x41, + 0x2a, 0x2a, 0x08, 0x4f, 0x50, 0x53, 0x20, 0x48, 0x6f, 0x73, 0x74, 0x32, 0x1e, 0x4f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x68, 0x6f, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, + 0x74, 0x68, 0x65, 0x20, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x52, 0x07, 0x6f, 0x70, 0x73, + 0x48, 0x6f, 0x73, 0x74, 0x12, 0x43, 0x0a, 0x0b, 0x66, 0x61, 0x76, 0x49, 0x63, 0x6f, 0x6e, 0x4c, + 0x69, 0x6e, 0x6b, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0x92, 0x41, 0x1e, 0x2a, 0x0d, + 0x46, 0x61, 0x76, 0x20, 0x49, 0x63, 0x6f, 0x6e, 0x20, 0x4c, 0x69, 0x6e, 0x6b, 0x32, 0x0d, 0x46, + 0x61, 0x76, 0x20, 0x49, 0x63, 0x6f, 0x6e, 0x20, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x0b, 0x66, 0x61, + 0x76, 0x49, 0x63, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x5f, 0x0a, 0x0d, 0x69, 0x73, 0x54, + 0x4f, 0x54, 0x50, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, + 0x42, 0x39, 0x92, 0x41, 0x36, 0x2a, 0x0c, 0x54, 0x4f, 0x54, 0x50, 0x20, 0x45, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x32, 0x26, 0x54, 0x4f, 0x54, 0x50, 0x20, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x64, 0x20, 0x66, 0x6c, 0x61, 0x67, 0x20, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x61, + 0x72, 0x74, 0x6e, 0x65, 0x72, 0x20, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x0d, 0x69, 0x73, 0x54, + 0x4f, 0x54, 0x50, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x5b, 0x0a, 0x08, 0x73, 0x65, + 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, + 0x74, 0x72, 0x75, 0x63, 0x74, 0x42, 0x26, 0x92, 0x41, 0x23, 0x2a, 0x08, 0x53, 0x65, 0x74, 0x74, + 0x69, 0x6e, 0x67, 0x73, 0x32, 0x17, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x20, 0x6f, + 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x52, 0x08, 0x73, + 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x3a, 0x33, 0x92, 0x41, 0x30, 0x0a, 0x2e, 0x2a, 0x15, + 0x50, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x20, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x15, 0x50, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x20, 0x53, + 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x98, 0x04, 0x0a, + 0x07, 0x50, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x12, 0x65, 0x0a, 0x0a, 0x61, 0x70, 0x69, 0x56, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x45, 0x92, 0x41, + 0x42, 0x2a, 0x0b, 0x41, 0x50, 0x49, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x32, 0x1b, + 0x41, 0x50, 0x49, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, + 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3a, 0x14, 0x73, 0x79, 0x73, + 0x74, 0x65, 0x6d, 0x2e, 0x6b, 0x38, 0x73, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x69, 0x6f, 0x2f, 0x76, + 0x33, 0x40, 0x01, 0x52, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, + 0x3e, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2a, 0x92, + 0x41, 0x27, 0x2a, 0x04, 0x4b, 0x69, 0x6e, 0x64, 0x32, 0x14, 0x4b, 0x69, 0x6e, 0x64, 0x20, 0x6f, + 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3a, 0x07, + 0x50, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x40, 0x01, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, + 0x68, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x23, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x27, 0x92, 0x41, 0x24, 0x2a, 0x08, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x32, 0x18, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x20, + 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, + 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x5b, 0x0a, 0x04, 0x73, 0x70, 0x65, + 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, + 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, + 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x53, 0x70, 0x65, 0x63, 0x42, + 0x1f, 0x92, 0x41, 0x1c, 0x2a, 0x04, 0x53, 0x70, 0x65, 0x63, 0x32, 0x14, 0x53, 0x70, 0x65, 0x63, + 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x60, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, + 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x76, 0x33, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x25, 0x92, 0x41, 0x22, 0x2a, 0x06, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x32, 0x16, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x20, 0x6f, + 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x40, 0x01, + 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x3a, 0x3d, 0x92, 0x41, 0x3a, 0x0a, 0x38, 0x2a, + 0x07, 0x50, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x32, 0x07, 0x50, 0x61, 0x72, 0x74, 0x6e, 0x65, + 0x72, 0xd2, 0x01, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0xd2, 0x01, + 0x04, 0x6b, 0x69, 0x6e, 0x64, 0xd2, 0x01, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xd2, 0x01, 0x04, 0x73, 0x70, 0x65, 0x63, 0x42, 0x90, 0x02, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, + 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x76, 0x33, 0x42, 0x0c, 0x50, 0x61, 0x72, 0x74, 0x6e, + 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x58, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x52, 0x61, 0x66, 0x61, 0x79, 0x53, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x73, 0x2f, 0x72, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x63, + 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x73, + 0x72, 0x76, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x73, + 0x79, 0x73, 0x74, 0x65, 0x6d, 0x70, 0x62, 0x2f, 0x76, 0x33, 0x3b, 0x73, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x76, 0x33, 0xa2, 0x02, 0x04, 0x52, 0x44, 0x54, 0x53, 0xaa, 0x02, 0x19, 0x52, 0x61, 0x66, + 0x61, 0x79, 0x2e, 0x44, 0x65, 0x76, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, 0x79, 0x73, + 0x74, 0x65, 0x6d, 0x2e, 0x56, 0x33, 0xca, 0x02, 0x19, 0x52, 0x61, 0x66, 0x61, 0x79, 0x5c, 0x44, + 0x65, 0x76, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5c, + 0x56, 0x33, 0xe2, 0x02, 0x25, 0x52, 0x61, 0x66, 0x61, 0x79, 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x54, + 0x79, 0x70, 0x65, 0x73, 0x5c, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5c, 0x56, 0x33, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1d, 0x52, 0x61, 0x66, + 0x61, 0x79, 0x3a, 0x3a, 0x44, 0x65, 0x76, 0x3a, 0x3a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x3a, 0x3a, + 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x3a, 0x3a, 0x56, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_proto_types_systempb_v3_partner_proto_rawDescOnce sync.Once + file_proto_types_systempb_v3_partner_proto_rawDescData = file_proto_types_systempb_v3_partner_proto_rawDesc +) + +func file_proto_types_systempb_v3_partner_proto_rawDescGZIP() []byte { + file_proto_types_systempb_v3_partner_proto_rawDescOnce.Do(func() { + file_proto_types_systempb_v3_partner_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_types_systempb_v3_partner_proto_rawDescData) + }) + return file_proto_types_systempb_v3_partner_proto_rawDescData +} + +var file_proto_types_systempb_v3_partner_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_proto_types_systempb_v3_partner_proto_goTypes = []interface{}{ + (*PartnerSpec)(nil), // 0: rafay.dev.types.system.v3.PartnerSpec + (*Partner)(nil), // 1: rafay.dev.types.system.v3.Partner + (*structpb.Struct)(nil), // 2: google.protobuf.Struct + (*v3.Metadata)(nil), // 3: rafay.dev.types.common.v3.Metadata + (*v3.Status)(nil), // 4: rafay.dev.types.common.v3.Status +} +var file_proto_types_systempb_v3_partner_proto_depIdxs = []int32{ + 2, // 0: rafay.dev.types.system.v3.PartnerSpec.settings:type_name -> google.protobuf.Struct + 3, // 1: rafay.dev.types.system.v3.Partner.metadata:type_name -> rafay.dev.types.common.v3.Metadata + 0, // 2: rafay.dev.types.system.v3.Partner.spec:type_name -> rafay.dev.types.system.v3.PartnerSpec + 4, // 3: rafay.dev.types.system.v3.Partner.status:type_name -> rafay.dev.types.common.v3.Status + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_proto_types_systempb_v3_partner_proto_init() } +func file_proto_types_systempb_v3_partner_proto_init() { + if File_proto_types_systempb_v3_partner_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_proto_types_systempb_v3_partner_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PartnerSpec); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_types_systempb_v3_partner_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Partner); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_proto_types_systempb_v3_partner_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_proto_types_systempb_v3_partner_proto_goTypes, + DependencyIndexes: file_proto_types_systempb_v3_partner_proto_depIdxs, + MessageInfos: file_proto_types_systempb_v3_partner_proto_msgTypes, + }.Build() + File_proto_types_systempb_v3_partner_proto = out.File + file_proto_types_systempb_v3_partner_proto_rawDesc = nil + file_proto_types_systempb_v3_partner_proto_goTypes = nil + file_proto_types_systempb_v3_partner_proto_depIdxs = nil +} diff --git a/components/adminsrv/proto/types/systempb/v3/partner.proto b/components/adminsrv/proto/types/systempb/v3/partner.proto new file mode 100644 index 0000000..5987e94 --- /dev/null +++ b/components/adminsrv/proto/types/systempb/v3/partner.proto @@ -0,0 +1,115 @@ +syntax = "proto3"; +package rafay.dev.types.system.v3; + +import "google/protobuf/struct.proto"; +import "proto/types/commonpb/v3/common.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; + +message PartnerSpec { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema : { + title : "Partner Specification" + description : "Partner Specification" + } + }; + string host = 1 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Host" + description : "Host of the partner" + } ]; + string domain = 2 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Domain" + description : "Domain of the partner" + } ]; + string tosLink = 3 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "TOS" + description : "Terms of service url of the partner" + } ]; + string logoLink = 4 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Logo" + description : "Logo url of the partner" + } ]; + string notificationEmail = 5 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Notification Email" + description : "Notification email of the partner" + } ]; + string helpdeskEmail = 6 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Helpdesk Email" + description : "Helpdesk email of the partner" + } ]; + string productName = 7 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Product Name" + description : "Product Name" + } ]; + string supportTeamName = 8 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Support Team Name" + description : "Support Team Name" + } ]; + string opsHost = 9 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "OPS Host" + description : "Operations host of the partner" + } ]; + string favIconLink = 10 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Fav Icon Link" + description : "Fav Icon Link" + } ]; + bool isTOTPEnabled = 11 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "TOTP Enabled" + description : "TOTP Enabled flag at the partner level" + } ]; + google.protobuf.Struct settings = 12 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Settings" + description : "Settings of the partner" + } ]; +} + +message Partner { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema : { + title : "Partner" + description : "Partner" + required : [ "apiVersion", "kind", "metadata", "spec" ] + } + }; + string apiVersion = 1 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "API Version", + description : "API Version of the resource" + default : "system.k8smgmt.io/v3" + read_only : true + } ]; + string kind = 2 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Kind", + description : "Kind of the resource" + default : "Partner" + read_only : true + } ]; + rafay.dev.types.common.v3.Metadata metadata = 3 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Metadata", + description : "Metadata of the resource" + } ]; + PartnerSpec spec = 4 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Spec", + description : "Spec of the resource" + } ]; + rafay.dev.types.common.v3.Status status = 5 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Status", + description : "Status of the resource" + read_only : true + } ]; +} \ No newline at end of file diff --git a/components/adminsrv/proto/types/systempb/v3/project.pb.go b/components/adminsrv/proto/types/systempb/v3/project.pb.go new file mode 100644 index 0000000..ee5458c --- /dev/null +++ b/components/adminsrv/proto/types/systempb/v3/project.pb.go @@ -0,0 +1,425 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc (unknown) +// source: proto/types/systempb/v3/project.proto + +package systemv3 + +import ( + v3 "github.com/RafaySystems/rcloud-base/components/common/proto/types/commonpb/v3" + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ProjectSpec struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Default bool `protobuf:"varint,1,opt,name=default,proto3" json:"default,omitempty"` +} + +func (x *ProjectSpec) Reset() { + *x = ProjectSpec{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_types_systempb_v3_project_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProjectSpec) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProjectSpec) ProtoMessage() {} + +func (x *ProjectSpec) ProtoReflect() protoreflect.Message { + mi := &file_proto_types_systempb_v3_project_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProjectSpec.ProtoReflect.Descriptor instead. +func (*ProjectSpec) Descriptor() ([]byte, []int) { + return file_proto_types_systempb_v3_project_proto_rawDescGZIP(), []int{0} +} + +func (x *ProjectSpec) GetDefault() bool { + if x != nil { + return x.Default + } + return false +} + +type Project struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ApiVersion string `protobuf:"bytes,1,opt,name=apiVersion,proto3" json:"apiVersion,omitempty"` + Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"` + Metadata *v3.Metadata `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + Spec *ProjectSpec `protobuf:"bytes,4,opt,name=spec,proto3" json:"spec,omitempty"` + Status *v3.Status `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"` +} + +func (x *Project) Reset() { + *x = Project{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_types_systempb_v3_project_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Project) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Project) ProtoMessage() {} + +func (x *Project) ProtoReflect() protoreflect.Message { + mi := &file_proto_types_systempb_v3_project_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Project.ProtoReflect.Descriptor instead. +func (*Project) Descriptor() ([]byte, []int) { + return file_proto_types_systempb_v3_project_proto_rawDescGZIP(), []int{1} +} + +func (x *Project) GetApiVersion() string { + if x != nil { + return x.ApiVersion + } + return "" +} + +func (x *Project) GetKind() string { + if x != nil { + return x.Kind + } + return "" +} + +func (x *Project) GetMetadata() *v3.Metadata { + if x != nil { + return x.Metadata + } + return nil +} + +func (x *Project) GetSpec() *ProjectSpec { + if x != nil { + return x.Spec + } + return nil +} + +func (x *Project) GetStatus() *v3.Status { + if x != nil { + return x.Status + } + return nil +} + +type ProjectList struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ApiVersion string `protobuf:"bytes,1,opt,name=apiVersion,proto3" json:"apiVersion,omitempty"` + Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"` + Metadata *v3.ListMetadata `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + Items []*Project `protobuf:"bytes,4,rep,name=items,proto3" json:"items,omitempty"` +} + +func (x *ProjectList) Reset() { + *x = ProjectList{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_types_systempb_v3_project_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProjectList) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProjectList) ProtoMessage() {} + +func (x *ProjectList) ProtoReflect() protoreflect.Message { + mi := &file_proto_types_systempb_v3_project_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProjectList.ProtoReflect.Descriptor instead. +func (*ProjectList) Descriptor() ([]byte, []int) { + return file_proto_types_systempb_v3_project_proto_rawDescGZIP(), []int{2} +} + +func (x *ProjectList) GetApiVersion() string { + if x != nil { + return x.ApiVersion + } + return "" +} + +func (x *ProjectList) GetKind() string { + if x != nil { + return x.Kind + } + return "" +} + +func (x *ProjectList) GetMetadata() *v3.ListMetadata { + if x != nil { + return x.Metadata + } + return nil +} + +func (x *ProjectList) GetItems() []*Project { + if x != nil { + return x.Items + } + return nil +} + +var File_proto_types_systempb_v3_project_proto protoreflect.FileDescriptor + +var file_proto_types_systempb_v3_project_proto_rawDesc = []byte{ + 0x0a, 0x25, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x73, 0x79, + 0x73, 0x74, 0x65, 0x6d, 0x70, 0x62, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, + 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, + 0x76, 0x33, 0x1a, 0x24, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2f, 0x76, 0x33, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, + 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xaf, 0x01, 0x0a, 0x0b, 0x50, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x12, 0x6b, 0x0a, 0x07, 0x64, 0x65, 0x66, + 0x61, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x42, 0x51, 0x92, 0x41, 0x4e, 0x2a, + 0x07, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x32, 0x43, 0x66, 0x6c, 0x61, 0x67, 0x20, 0x74, + 0x6f, 0x20, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x20, 0x69, 0x66, 0x20, 0x74, 0x68, + 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x20, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, + 0x20, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x64, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x3a, 0x33, 0x92, 0x41, 0x30, 0x0a, 0x2e, 0x2a, 0x15, 0x50, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x15, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x73, 0x70, + 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x98, 0x04, 0x0a, 0x07, + 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x65, 0x0a, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x45, 0x92, 0x41, 0x42, + 0x2a, 0x0b, 0x41, 0x50, 0x49, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x32, 0x1b, 0x41, + 0x50, 0x49, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, + 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3a, 0x14, 0x73, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x2e, 0x6b, 0x38, 0x73, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x69, 0x6f, 0x2f, 0x76, 0x33, + 0x40, 0x01, 0x52, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3e, + 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2a, 0x92, 0x41, + 0x27, 0x2a, 0x04, 0x4b, 0x69, 0x6e, 0x64, 0x32, 0x14, 0x4b, 0x69, 0x6e, 0x64, 0x20, 0x6f, 0x66, + 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3a, 0x07, 0x50, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x40, 0x01, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x68, + 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x23, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x27, 0x92, 0x41, 0x24, 0x2a, 0x08, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x32, 0x18, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x20, 0x6f, + 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, + 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x5b, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, + 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, + 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x42, 0x1f, + 0x92, 0x41, 0x1c, 0x2a, 0x04, 0x53, 0x70, 0x65, 0x63, 0x32, 0x14, 0x53, 0x70, 0x65, 0x63, 0x20, + 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, + 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x60, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, + 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, + 0x33, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x25, 0x92, 0x41, 0x22, 0x2a, 0x06, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x32, 0x16, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x20, 0x6f, 0x66, + 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x40, 0x01, 0x52, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x3a, 0x3d, 0x92, 0x41, 0x3a, 0x0a, 0x38, 0x2a, 0x07, + 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x32, 0x07, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0xd2, 0x01, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0xd2, 0x01, 0x04, + 0x6b, 0x69, 0x6e, 0x64, 0xd2, 0x01, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xd2, + 0x01, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0xb8, 0x03, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x6a, 0x0a, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x4a, 0x92, 0x41, 0x47, 0x2a, + 0x0b, 0x41, 0x50, 0x49, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x32, 0x20, 0x41, 0x50, + 0x49, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, + 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3a, 0x14, + 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x6b, 0x38, 0x73, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x69, + 0x6f, 0x2f, 0x76, 0x33, 0x40, 0x01, 0x52, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x43, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x2f, 0x92, 0x41, 0x2c, 0x2a, 0x04, 0x4b, 0x69, 0x6e, 0x64, 0x32, 0x19, 0x4b, 0x69, 0x6e, + 0x64, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3a, 0x07, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x40, + 0x01, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x77, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x72, 0x61, 0x66, 0x61, + 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x42, 0x32, 0x92, 0x41, 0x2f, 0x2a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x32, 0x1d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x20, + 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x40, 0x01, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x12, 0x5d, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x22, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x42, 0x23, 0x92, 0x41, 0x20, 0x2a, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x32, + 0x15, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x40, 0x01, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x3a, + 0x20, 0x92, 0x41, 0x1d, 0x0a, 0x1b, 0x2a, 0x0b, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4c, + 0x69, 0x73, 0x74, 0x32, 0x0c, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x6c, 0x69, 0x73, + 0x74, 0x42, 0x90, 0x02, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, + 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, + 0x2e, 0x76, 0x33, 0x42, 0x0c, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x58, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x52, 0x61, 0x66, 0x61, 0x79, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x73, 0x2f, 0x72, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x2d, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, + 0x6e, 0x74, 0x73, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x73, 0x72, 0x76, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x70, + 0x62, 0x2f, 0x76, 0x33, 0x3b, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x76, 0x33, 0xa2, 0x02, 0x04, + 0x52, 0x44, 0x54, 0x53, 0xaa, 0x02, 0x19, 0x52, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x44, 0x65, 0x76, + 0x2e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x56, 0x33, + 0xca, 0x02, 0x19, 0x52, 0x61, 0x66, 0x61, 0x79, 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x54, 0x79, 0x70, + 0x65, 0x73, 0x5c, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5c, 0x56, 0x33, 0xe2, 0x02, 0x25, 0x52, + 0x61, 0x66, 0x61, 0x79, 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x53, + 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5c, 0x56, 0x33, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1d, 0x52, 0x61, 0x66, 0x61, 0x79, 0x3a, 0x3a, 0x44, 0x65, + 0x76, 0x3a, 0x3a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x3a, 0x3a, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, + 0x3a, 0x3a, 0x56, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_proto_types_systempb_v3_project_proto_rawDescOnce sync.Once + file_proto_types_systempb_v3_project_proto_rawDescData = file_proto_types_systempb_v3_project_proto_rawDesc +) + +func file_proto_types_systempb_v3_project_proto_rawDescGZIP() []byte { + file_proto_types_systempb_v3_project_proto_rawDescOnce.Do(func() { + file_proto_types_systempb_v3_project_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_types_systempb_v3_project_proto_rawDescData) + }) + return file_proto_types_systempb_v3_project_proto_rawDescData +} + +var file_proto_types_systempb_v3_project_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_proto_types_systempb_v3_project_proto_goTypes = []interface{}{ + (*ProjectSpec)(nil), // 0: rafay.dev.types.system.v3.ProjectSpec + (*Project)(nil), // 1: rafay.dev.types.system.v3.Project + (*ProjectList)(nil), // 2: rafay.dev.types.system.v3.ProjectList + (*v3.Metadata)(nil), // 3: rafay.dev.types.common.v3.Metadata + (*v3.Status)(nil), // 4: rafay.dev.types.common.v3.Status + (*v3.ListMetadata)(nil), // 5: rafay.dev.types.common.v3.ListMetadata +} +var file_proto_types_systempb_v3_project_proto_depIdxs = []int32{ + 3, // 0: rafay.dev.types.system.v3.Project.metadata:type_name -> rafay.dev.types.common.v3.Metadata + 0, // 1: rafay.dev.types.system.v3.Project.spec:type_name -> rafay.dev.types.system.v3.ProjectSpec + 4, // 2: rafay.dev.types.system.v3.Project.status:type_name -> rafay.dev.types.common.v3.Status + 5, // 3: rafay.dev.types.system.v3.ProjectList.metadata:type_name -> rafay.dev.types.common.v3.ListMetadata + 1, // 4: rafay.dev.types.system.v3.ProjectList.items:type_name -> rafay.dev.types.system.v3.Project + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_proto_types_systempb_v3_project_proto_init() } +func file_proto_types_systempb_v3_project_proto_init() { + if File_proto_types_systempb_v3_project_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_proto_types_systempb_v3_project_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProjectSpec); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_types_systempb_v3_project_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Project); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_types_systempb_v3_project_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProjectList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_proto_types_systempb_v3_project_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_proto_types_systempb_v3_project_proto_goTypes, + DependencyIndexes: file_proto_types_systempb_v3_project_proto_depIdxs, + MessageInfos: file_proto_types_systempb_v3_project_proto_msgTypes, + }.Build() + File_proto_types_systempb_v3_project_proto = out.File + file_proto_types_systempb_v3_project_proto_rawDesc = nil + file_proto_types_systempb_v3_project_proto_goTypes = nil + file_proto_types_systempb_v3_project_proto_depIdxs = nil +} diff --git a/components/adminsrv/proto/types/systempb/v3/project.proto b/components/adminsrv/proto/types/systempb/v3/project.proto new file mode 100644 index 0000000..0d20851 --- /dev/null +++ b/components/adminsrv/proto/types/systempb/v3/project.proto @@ -0,0 +1,100 @@ +syntax = "proto3"; +package rafay.dev.types.system.v3; + +import "proto/types/commonpb/v3/common.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; +import "google/api/field_behavior.proto"; + +message ProjectSpec { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema : { + title : "Project Specification" + description : "project specification" + } + }; + + bool default = 1 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Default" + description : "flag to indicate if this is the default project in the " + "organization" + } ]; +} + +message Project { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema : { + title : "Project" + description : "Project" + required : [ "apiVersion", "kind", "metadata", "spec" ] + } + }; + + string apiVersion = 1 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "API Version", + description : "API Version of the resource" + default : "system.k8smgmt.io/v3" + read_only : true + + } ]; + string kind = 2 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Kind", + description : "Kind of the resource" + default : "Project" + read_only : true + } ]; + rafay.dev.types.common.v3.Metadata metadata = 3 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Metadata", + description : "Metadata of the resource" + } ]; + ProjectSpec spec = 4 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Spec", + description : "Spec of the resource" + } ]; + rafay.dev.types.common.v3.Status status = 5 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Status", + description : "Status of the resource" + read_only : true + } ]; +} + +message ProjectList { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema : { + title : "ProjectList" + description : "Project list" + } + }; + + string apiVersion = 1 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "API Version", + description : "API Version of the list resource" + read_only : true + default : "system.k8smgmt.io/v3" + } ]; + string kind = 2 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Kind", + description : "Kind of the list resource" + read_only : true + default : "Project" + } ]; + rafay.dev.types.common.v3.ListMetadata metadata = 3 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "ListMetadata", + description : "Metadata of the list resource" + read_only : true + } ]; + repeated Project items = 4 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Items", + description : "List of the resources" + read_only : true + } ]; +} \ No newline at end of file diff --git a/components/buf.work.yaml b/components/buf.work.yaml new file mode 100644 index 0000000..bfcca79 --- /dev/null +++ b/components/buf.work.yaml @@ -0,0 +1,5 @@ +version: v1 +directories: + - common + - adminsrv + - usermgmt diff --git a/components/common/buf.gen.yaml b/components/common/buf.gen.yaml new file mode 100644 index 0000000..511e41e --- /dev/null +++ b/components/common/buf.gen.yaml @@ -0,0 +1,23 @@ +version: v1 +managed: + enabled: true + go_package_prefix: + default: github.com/RafaySystems/rcloud-base/components/common + except: + - buf.build/googleapis/googleapis + - buf.build/grpc-ecosystem/grpc-gateway + - buf.build/gogo/protobuf +plugins: + - name: go + out: . + opt: paths=source_relative + - name: go-grpc + out: . + opt: + - paths=source_relative + - require_unimplemented_servers=false + - name: grpc-gateway + out: . + opt: paths=source_relative + - name: openapiv2 + out: gen/openapi \ No newline at end of file diff --git a/components/common/buf.lock b/components/common/buf.lock new file mode 100644 index 0000000..ee65047 --- /dev/null +++ b/components/common/buf.lock @@ -0,0 +1,24 @@ +# Generated by buf. DO NOT EDIT. +version: v1 +deps: + - remote: buf.build + owner: gogo + repository: protobuf + branch: main + commit: 4df00b267f944190a229ce3695781e99 + digest: b1-sjLgsg7CzrkOrIjBDh3s-l0aMjE6oqTj85-OsoopKAw= + create_time: 2021-08-10T00:14:28.345069Z + - remote: buf.build + owner: googleapis + repository: googleapis + branch: main + commit: 9088184d3ed04821b7e990024ff05656 + digest: b1---R9Xre3yvH8peoJPQ0dsUYp37KzdlBlx5fjPsYekyI= + create_time: 2021-12-23T15:04:49.66847Z + - remote: buf.build + owner: grpc-ecosystem + repository: grpc-gateway + branch: main + commit: ff83506eb9cc4cf8972f49ce87e6ed3e + digest: b1-iLPHgLaoeWWinMiXXqPnxqE4BThtY3eSbswVGh9GOGI= + create_time: 2021-10-23T16:26:52.283938Z diff --git a/components/common/buf.yaml b/components/common/buf.yaml new file mode 100644 index 0000000..e1a0e71 --- /dev/null +++ b/components/common/buf.yaml @@ -0,0 +1,12 @@ +version: v1 +name: buf.build/nparikh/rafay-common +deps: + - buf.build/googleapis/googleapis + - buf.build/grpc-ecosystem/grpc-gateway + - buf.build/gogo/protobuf +breaking: + use: + - FILE +lint: + use: + - DEFAULT diff --git a/components/common/gen/openapi/pkg/auth/v3/auth.swagger.json b/components/common/gen/openapi/pkg/auth/v3/auth.swagger.json new file mode 100644 index 0000000..1037366 --- /dev/null +++ b/components/common/gen/openapi/pkg/auth/v3/auth.swagger.json @@ -0,0 +1,275 @@ +{ + "swagger": "2.0", + "info": { + "title": "pkg/auth/v3/auth.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "Auth" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "v3APIKeyStatus": { + "type": "string", + "enum": [ + "APIKeyNotFound", + "APIKeyExists" + ], + "default": "APIKeyNotFound" + }, + "v3AuthType": { + "type": "string", + "enum": [ + "AuthTypeNotSet", + "SessionLogin", + "APIKey" + ], + "default": "AuthTypeNotSet" + }, + "v3ClientType": { + "type": "string", + "enum": [ + "ClientTypeNotSet", + "BROWSER", + "CLI" + ], + "default": "ClientTypeNotSet" + }, + "v3GetAPIKeyResponse": { + "type": "object", + "properties": { + "status": { + "$ref": "#/definitions/v3APIKeyStatus" + }, + "reason": { + "type": "string" + }, + "secret": { + "type": "string" + }, + "data": { + "$ref": "#/definitions/v3SessionData" + } + } + }, + "v3GetSessionResponse": { + "type": "object", + "properties": { + "status": { + "$ref": "#/definitions/v3SessionStatus" + }, + "reason": { + "type": "string" + }, + "data": { + "$ref": "#/definitions/v3SessionData" + } + } + }, + "v3IsRequestAllowedResponse": { + "type": "object", + "properties": { + "status": { + "$ref": "#/definitions/v3RequestStatus" + }, + "reason": { + "type": "string" + }, + "sessionData": { + "$ref": "#/definitions/v3SessionData" + } + } + }, + "v3NamespaceData": { + "type": "object", + "properties": { + "projectId": { + "type": "string" + }, + "namespaceId": { + "type": "string" + }, + "role": { + "type": "string" + } + } + }, + "v3ProjectData": { + "type": "object", + "properties": { + "all": { + "type": "boolean" + }, + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/v3ProjectRole" + } + } + } + }, + "v3ProjectRole": { + "type": "object", + "properties": { + "projectId": { + "type": "string" + }, + "role": { + "type": "string" + } + } + }, + "v3RequestStatus": { + "type": "string", + "enum": [ + "RequestAllowed", + "RequestNotAuthenticated", + "RequestMethodOrURLNotAllowed" + ], + "default": "RequestAllowed" + }, + "v3ResourceURLMethods": { + "type": "object", + "properties": { + "methods": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "v3SessionData": { + "type": "object", + "properties": { + "account": { + "type": "string" + }, + "organization": { + "type": "string" + }, + "partner": { + "type": "string" + }, + "role": { + "type": "string" + }, + "permissions": { + "type": "array", + "items": { + "type": "string" + } + }, + "partnerDomain": { + "type": "string" + }, + "username": { + "type": "string" + }, + "isSuperAdmin": { + "type": "boolean" + }, + "isPartnerAdmin": { + "type": "boolean" + }, + "isSsoUser": { + "type": "boolean" + }, + "resourceUrls": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v3ResourceURLMethods" + } + }, + "ttl": { + "type": "string" + }, + "groups": { + "type": "array", + "items": { + "type": "string" + } + }, + "authType": { + "$ref": "#/definitions/v3AuthType" + }, + "idp": { + "type": "string" + }, + "isOrgAdmin": { + "type": "object", + "additionalProperties": { + "type": "boolean" + } + }, + "clientType": { + "$ref": "#/definitions/v3ClientType" + }, + "isAllNsAccess": { + "type": "object", + "additionalProperties": { + "type": "boolean" + } + }, + "namespaces": { + "type": "array", + "items": { + "$ref": "#/definitions/v3NamespaceData" + } + }, + "project": { + "$ref": "#/definitions/v3ProjectData" + }, + "isReadonlyOrgAdmin": { + "type": "object", + "additionalProperties": { + "type": "boolean" + } + } + } + }, + "v3SessionStatus": { + "type": "string", + "enum": [ + "SessionNotFound", + "SessionExists" + ], + "default": "SessionNotFound" + } + } +} diff --git a/components/common/gen/openapi/pkg/gateway/testdata/test.swagger.json b/components/common/gen/openapi/pkg/gateway/testdata/test.swagger.json new file mode 100644 index 0000000..81c0c09 --- /dev/null +++ b/components/common/gen/openapi/pkg/gateway/testdata/test.swagger.json @@ -0,0 +1,113 @@ +{ + "swagger": "2.0", + "info": { + "title": "pkg/gateway/testdata/test.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "Test" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v3/test/{metadata.name}/test/{metadata.name}": { + "get": { + "operationId": "Test_Get", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/testdataTestObject" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "metadata.name", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "metadata.name", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "Test" + ] + } + } + }, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "testdataTestMetadata": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + }, + "testdataTestObject": { + "type": "object", + "properties": { + "metadata": { + "$ref": "#/definitions/testdataTestMetadata" + }, + "spec": { + "$ref": "#/definitions/testdataTestObjectSpec" + }, + "status": { + "$ref": "#/definitions/testdataTestObjectStatus" + } + } + }, + "testdataTestObjectSpec": { + "type": "object" + }, + "testdataTestObjectStatus": { + "type": "object" + } + } +} diff --git a/components/common/gen/openapi/proto/types/commonpb/v3/artifacts.swagger.json b/components/common/gen/openapi/proto/types/commonpb/v3/artifacts.swagger.json new file mode 100644 index 0000000..3d94cae --- /dev/null +++ b/components/common/gen/openapi/proto/types/commonpb/v3/artifacts.swagger.json @@ -0,0 +1,43 @@ +{ + "swagger": "2.0", + "info": { + "title": "proto/types/commonpb/v3/artifacts.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "googlerpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + } + } +} diff --git a/components/common/gen/openapi/proto/types/commonpb/v3/common.swagger.json b/components/common/gen/openapi/proto/types/commonpb/v3/common.swagger.json new file mode 100644 index 0000000..26d0a30 --- /dev/null +++ b/components/common/gen/openapi/proto/types/commonpb/v3/common.swagger.json @@ -0,0 +1,43 @@ +{ + "swagger": "2.0", + "info": { + "title": "proto/types/commonpb/v3/common.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "googlerpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + } + } +} diff --git a/components/common/go.mod b/components/common/go.mod new file mode 100644 index 0000000..28bc11c --- /dev/null +++ b/components/common/go.mod @@ -0,0 +1,31 @@ +module github.com/RafaySystems/rcloud-base/components/common + +go 1.17 + +require ( + github.com/gogo/protobuf v1.3.2 + github.com/grpc-ecosystem/grpc-gateway v1.16.0 + github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.2 + github.com/julienschmidt/httprouter v1.3.0 + github.com/processout/grpc-go-pool v1.2.1 + github.com/segmentio/encoding v0.3.2 + github.com/speps/go-hashids v2.0.0+incompatible + go.uber.org/zap v1.19.1 + google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa + google.golang.org/grpc v1.43.0 + google.golang.org/protobuf v1.27.1 + sigs.k8s.io/yaml v1.3.0 +) + +require ( + github.com/golang/protobuf v1.5.2 // indirect + github.com/klauspost/cpuid/v2 v2.0.6 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/segmentio/asm v1.1.0 // indirect + go.uber.org/atomic v1.7.0 // indirect + go.uber.org/multierr v1.6.0 // indirect + golang.org/x/net v0.0.0-20210916014120-12bc252f5db8 // indirect + golang.org/x/sys v0.0.0-20210510120138-977fb7262007 // indirect + golang.org/x/text v0.3.6 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect +) \ No newline at end of file diff --git a/components/common/go.sum b/components/common/go.sum new file mode 100644 index 0000000..2d28021 --- /dev/null +++ b/components/common/go.sum @@ -0,0 +1,468 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= +github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.2 h1:I/pwhnUln5wbMnTyRbzswA0/JxpK8sZj0aUfI3TV1So= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.2/go.mod h1:lsuH8kb4GlMdSlI4alNIBBSAt5CHJtg3i+0WuN9J5YM= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/cpuid/v2 v2.0.6 h1:dQ5ueTiftKxp0gyjKSx5+8BtPWkyQbd95m8Gys/RarI= +github.com/klauspost/cpuid/v2 v2.0.6/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/processout/grpc-go-pool v1.2.1 h1:hbp1BOA02CIxEAoRLHGpUhhPFv77nwfBLBeO3Ya9P7I= +github.com/processout/grpc-go-pool v1.2.1/go.mod h1:F4hiNj96O6VQ87jv4rdz8R9tkHdelQQJ/J2B1a5VSt4= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/segmentio/asm v1.1.0 h1:fkVr8k5J4sKoFjTGVD6r1yKvDKqmvrEh3K7iyVxgBs8= +github.com/segmentio/asm v1.1.0/go.mod h1:4EUJGaKsB8ImLUwOGORVsNd9vTRDeh44JGsY4aKp5I4= +github.com/segmentio/encoding v0.3.2 h1:gkXXteOfNaPPlrXTEf/e5tWvaQGVJWnvT3LqMzUeH7U= +github.com/segmentio/encoding v0.3.2/go.mod h1:waft2p6XI4z2pk07M0YzZV4wEiqaRvsBSyWNHxVx4gU= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/speps/go-hashids v2.0.0+incompatible h1:kSfxGfESueJKTx0mpER9Y/1XHl+FVQjtCqRyYcviFbw= +github.com/speps/go-hashids v2.0.0+incompatible/go.mod h1:P7hqPzMdnZOfyIk+xrlG1QaSMw+gCBdHKsBDnhpaZvc= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.1.11-0.20210813005559-691160354723 h1:sHOAIxRGBp443oHZIPB+HsUGaksVCXVQENPxwTfQdH4= +go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/zap v1.19.1 h1:ue41HOKd1vGURxrmeKIgELGb3jPW9DMUDGtsinblHwI= +go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210916014120-12bc252f5db8 h1:/6y1LfuqNuQdHAm0jjtPtgRcxIxjVZgm5OTu8/QhZvk= +golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007 h1:gG67DSER+11cZvqIMb8S8bt0vZtiN6xWYARwirrOSfE= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa h1:I0YcKz0I7OAhddo7ya8kMnvprhcWM045PmkBdMO9zN0= +google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.43.0 h1:Eeu7bZtDZ2DpRCsLhUlcrLnvYaMK1Gz86a+hMVvELmM= +google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/components/common/pkg/auth/interceptors/auth.go b/components/common/pkg/auth/interceptors/auth.go new file mode 100644 index 0000000..4b83053 --- /dev/null +++ b/components/common/pkg/auth/interceptors/auth.go @@ -0,0 +1,356 @@ +package interceptors + +import ( + "context" + "errors" + "fmt" + "net/http" + "strings" + "time" + + authv3 "github.com/RafaySystems/rcloud-base/components/common/pkg/auth/v3" + "github.com/RafaySystems/rcloud-base/components/common/pkg/gateway" + "github.com/RafaySystems/rcloud-base/components/common/pkg/hashid" + logv2 "github.com/RafaySystems/rcloud-base/components/common/pkg/log/v2" + commonv3 "github.com/RafaySystems/rcloud-base/components/common/proto/types/commonpb/v3" + "github.com/julienschmidt/httprouter" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" +) + +var _log = logv2.GetLogger() + +var _dummyHandler = func(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {} + +const ( + cookieHeader = "cookie" + apiKeyHeader = "x-rafay-api-keyid" + rafaySession = "rsid" +) + +func getAPIKey(ctx context.Context) string { + md, ok := metadata.FromIncomingContext(ctx) + if !ok { + return "" + } + apiKeys, ok := md[apiKeyHeader] + if !ok { + return "" + } + return apiKeys[0] +} + +func getRsid(ctx context.Context) string { + //If rsid is present in the header, use it directly + md, ok := metadata.FromIncomingContext(ctx) + if !ok { + return "" + } + _log.Debugw("incoming metadta", "md", md) + //rsid is part of Cookies + cookies, ok := md[cookieHeader] + if !ok { + return "" + } + return readCookies(cookies[0], rafaySession) +} + +func readCookies(cookies, filter string) string { + parts := strings.Split(strings.TrimSpace(cookies), ";") + // Per-line attributes + for i := 0; i < len(parts); i++ { + parts[i] = strings.TrimSpace(parts[i]) + if len(parts[i]) == 0 { + continue + } + name, val := parts[i], "" + if j := strings.Index(name, "="); j >= 0 { + name, val = name[:j], name[j+1:] + } + if filter != "" && filter != name { + continue + } + return val + } + return "" +} + +func allowRequest(ctx context.Context, opts *options, req interface{}) error { + if md, ok := metadata.FromIncomingContext(ctx); ok { + isGateway := func() bool { + if vals := md.Get(gateway.GatewayRequest); vals != nil { + return true + } + return false + } + + url := func() string { + if urls, ok := md[gateway.GatewayURL]; ok { + return urls[0] + } + return "" + } + + rsid := func() string { + if rsids, ok := md[gateway.GatewayRSID]; ok { + return rsids[0] + } + return "" + } + + apiKey := func() string { + if apiKeys, ok := md[gateway.GatewayAPIKey]; ok { + return apiKeys[0] + } + return "" + } + + method := func() string { + if methods, ok := md[gateway.GatewayMethod]; ok { + return methods[0] + } + return "" + } + + excluded := func() bool { + if opts.exclude == nil { + return false + } + + if h, _, _ := opts.exclude.Lookup(method(), url()); h != nil { + return true + } + return false + } + + if opts.logRequest { + _log.Infow("allowRequest", "url", url(), "isGateway", isGateway(), "rsid", rsid(), "apiKey", apiKey(), "method", method(), "excluded", excluded()) + } + + // if request originates from gateway and method and path are not in excluded + if isGateway() && !excluded() { + allowed := func() error { + aCtx, cancel := context.WithTimeout(ctx, time.Second*10) + defer cancel() + + client, err := opts.pool.NewClient(aCtx) + if err != nil { + _log.Infow("unable to get new auth client", "error", err.Error()) + return err + } + defer client.Close() + + resp, err := client.IsRequestAllowed(aCtx, func() *authv3.IsRequestAllowedRequest { + return &authv3.IsRequestAllowedRequest{ + Url: url(), + Method: method(), + Rsid: rsid(), + ApiKey: apiKey(), + } + }()) + if err != nil { + return err + } + + if resp.GetStatus() != authv3.RequestStatus_RequestAllowed { + err = fmt.Errorf("%s", resp.Reason) + return err + } + + if resp.SessionData != nil { + + var partnerID int64 + var organizationID int64 + + if _, ok := req.(commonv3.Metadata); ok { + _log.Debugw("adding request meta") + _, err := hashid.IDFromString(resp.SessionData.Account) + if err != nil { + _log.Infow("unable to convert account id", "accountID", resp.SessionData.Account, "error", err.Error()) + return err + } + partnerID, err = hashid.IDFromString(resp.SessionData.Partner) + if err != nil { + _log.Infow("unable to convert partner id", "partnerID", resp.SessionData.Partner, "error", err.Error()) + return err + } + organizationID, err = hashid.IDFromString(resp.SessionData.Organization) + if err != nil { + _log.Infow("unable to convert organization id", "organizationID", resp.SessionData.Organization, "error", err.Error()) + return err + } + fmt.Println(partnerID) + fmt.Println(organizationID) + /*rmo.SetAccountID(accountID) + rmo.SetPartnerID(partnerID) + rmo.SetOrganizationID(organizationID) + rmo.SetIsSSOUser(resp.SessionData.IsSsoUser) + rmo.SetGroups(resp.SessionData.Groups) + rmo.SetUsername(resp.SessionData.Username) + rmo.SetAuthType(resp.SessionData.AuthType.String()) + rmo.SetClientType(resp.SessionData.ClientType.String()) + rmo.SetIdp(resp.SessionData.Idp) + rmo.SetIsAllNsAccess(resp.SessionData.IsAllNsAccess) + rmo.SetIsOrgAdmin(resp.SessionData.IsOrgAdmin) + rmo.SetIsPartnerAdmin(resp.SessionData.IsPartnerAdmin) + rmo.SetIsSuperAdmin(resp.SessionData.IsSuperAdmin) + rmo.SetNamespaces(authv3.ConvertFromAuthNamespaces(resp.SessionData.Namespaces)) + rmo.SetProject(authv3.ConvertFormAuthProject(resp.SessionData.Project)) + rmo.SetIsReadonlyOrgAdmin(resp.SessionData.IsReadonlyOrgAdmin)*/ + } + } + + return nil + } + + if err := allowed(); err != nil { + return err + } + return nil + } + + } + return nil + +} + +func addRequestMeta(ctx context.Context, pool authv3.AuthPool, req interface{}, validateSession bool) error { + _log.Debugw("adding request meta") + aCtx, cancel := context.WithTimeout(ctx, time.Second*10) + defer cancel() + + client, err := pool.NewClient(aCtx) + if err != nil { + _log.Infow("unable to get new auth client", "error", err.Error()) + return err + } + defer client.Close() + + rsid := getRsid(ctx) + apiKey := getAPIKey(ctx) + + var data *authv3.SessionData + + if rsid != "" { + _log.Debugw("found session", "rsid", rsid) + resp, err := client.GetSession(ctx, &authv3.GetSessionRequest{ + SessionId: rsid, + }) + if err != nil { + _log.Infof("unable to get session for id %s", err.Error()) + return err + } + + if resp.Status == authv3.SessionStatus_SessionExists { + _log.Debugw("session exists", "rsid", rsid) + data = resp.Data + } + } else if apiKey != "" { + resp, err := client.GetAPIKey(ctx, &authv3.GetAPIKeyRequest{ + ApiKey: apiKey, + }) + + if err != nil { + _log.Infow("unable to get api key", "key", apiKey, "error", err) + return err + } + + if resp.Status == authv3.APIKeyStatus_APIKeyExists { + data = resp.Data + } + } + + if data != nil { + _, err := hashid.IDFromString(data.Partner) + if err != nil { + _log.Infow("unable to convert partner id", "partnerID", data.Partner, "error", err.Error()) + return err + } + _, err = hashid.IDFromString(data.Organization) + if err != nil { + _log.Infow("unable to convert organization id", "organizationID", data.Organization, "error", err.Error()) + return err + } + + if _, ok := req.(commonv3.Metadata); ok { + _log.Debugw("adding request meta") + //rmo.SetPartnerID(partnerID) + //rmo.SetOrganizationID(organizationID) + } + } + if validateSession { + if data == nil { + return errors.New("403 Forbidden error") + } + } + return nil +} + +type options struct { + pool authv3.AuthPool + exclude *httprouter.Router + dummy bool + logRequest bool +} + +// Option is the functional arg for building auth interceptor +type Option func(*options) + +// WithExclude excludes the method and path from enforcing authn/authz +func WithExclude(method, path string) Option { + return func(opts *options) { + if opts.exclude == nil { + opts.exclude = httprouter.New() + } + + opts.exclude.Handle(method, path, _dummyHandler) + } +} + +// WithAuthPool adds auth pool +func WithAuthPool(pool authv3.AuthPool) Option { + return func(opts *options) { + opts.pool = pool + } +} + +// WithDummy creates a dummy auth interceptor +func WithDummy() Option { + return func(opts *options) { + opts.dummy = true + } +} + +// WithLogRequest logs request info +func WithLogRequest() Option { + return func(opts *options) { + opts.logRequest = true + } +} + +// authInterceptor implements the Authentication interceptor +type authInterceptor struct { + opts *options +} + +// NewAuthInterceptorWithOptions creates auth interceptor with options +func NewAuthInterceptorWithOptions(opts ...Option) grpc.UnaryServerInterceptor { + aOpts := &options{} + for _, opt := range opts { + opt(aOpts) + } + + if aOpts.dummy { + return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) { + //addDummyMeta(req) + return handler(ctx, req) + } + } + + return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) { + if err := allowRequest(ctx, aOpts, req); err != nil { + return nil, err + } + return handler(ctx, req) + } +} diff --git a/components/common/pkg/auth/interceptors/auth_test.go b/components/common/pkg/auth/interceptors/auth_test.go new file mode 100644 index 0000000..79191f3 --- /dev/null +++ b/components/common/pkg/auth/interceptors/auth_test.go @@ -0,0 +1,19 @@ +package interceptors + +import ( + "context" + "testing" + + "google.golang.org/grpc/metadata" +) + +func TestGetRSID(t *testing.T) { + mapWithRsid := make(map[string]string) + mapWithRsid[cookieHeader] = "csrftoken=FpkPDGFZ2sAfgB1N7qZuQQfv7swEZb7Xr0q4e9tHlZAncVbt5u1a3rCa93Q2fC5s; rsid=v7eylddj5p2fl0l8q5wb6kton1t3kby5; logo_link=; support_email=support@rafay.co" + md := metadata.New(mapWithRsid) + ctx := metadata.NewIncomingContext(context.Background(), md) + rsid := getRsid(ctx) + if rsid != "v7eylddj5p2fl0l8q5wb6kton1t3kby5" { + t.Errorf("wrong rsid") + } +} diff --git a/components/common/pkg/auth/v3/auth.pb.go b/components/common/pkg/auth/v3/auth.pb.go new file mode 100644 index 0000000..3d100e2 --- /dev/null +++ b/components/common/pkg/auth/v3/auth.pb.go @@ -0,0 +1,1645 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc (unknown) +// source: pkg/auth/v3/auth.proto + +package authv3 + +import ( + _ "github.com/gogo/protobuf/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type AuthType int32 + +const ( + AuthType_AuthTypeNotSet AuthType = 0 + AuthType_SessionLogin AuthType = 1 + AuthType_APIKey AuthType = 2 +) + +// Enum value maps for AuthType. +var ( + AuthType_name = map[int32]string{ + 0: "AuthTypeNotSet", + 1: "SessionLogin", + 2: "APIKey", + } + AuthType_value = map[string]int32{ + "AuthTypeNotSet": 0, + "SessionLogin": 1, + "APIKey": 2, + } +) + +func (x AuthType) Enum() *AuthType { + p := new(AuthType) + *p = x + return p +} + +func (x AuthType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (AuthType) Descriptor() protoreflect.EnumDescriptor { + return file_pkg_auth_v3_auth_proto_enumTypes[0].Descriptor() +} + +func (AuthType) Type() protoreflect.EnumType { + return &file_pkg_auth_v3_auth_proto_enumTypes[0] +} + +func (x AuthType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use AuthType.Descriptor instead. +func (AuthType) EnumDescriptor() ([]byte, []int) { + return file_pkg_auth_v3_auth_proto_rawDescGZIP(), []int{0} +} + +type ClientType int32 + +const ( + ClientType_ClientTypeNotSet ClientType = 0 + ClientType_BROWSER ClientType = 1 + ClientType_CLI ClientType = 2 +) + +// Enum value maps for ClientType. +var ( + ClientType_name = map[int32]string{ + 0: "ClientTypeNotSet", + 1: "BROWSER", + 2: "CLI", + } + ClientType_value = map[string]int32{ + "ClientTypeNotSet": 0, + "BROWSER": 1, + "CLI": 2, + } +) + +func (x ClientType) Enum() *ClientType { + p := new(ClientType) + *p = x + return p +} + +func (x ClientType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ClientType) Descriptor() protoreflect.EnumDescriptor { + return file_pkg_auth_v3_auth_proto_enumTypes[1].Descriptor() +} + +func (ClientType) Type() protoreflect.EnumType { + return &file_pkg_auth_v3_auth_proto_enumTypes[1] +} + +func (x ClientType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ClientType.Descriptor instead. +func (ClientType) EnumDescriptor() ([]byte, []int) { + return file_pkg_auth_v3_auth_proto_rawDescGZIP(), []int{1} +} + +type SessionStatus int32 + +const ( + SessionStatus_SessionNotFound SessionStatus = 0 + SessionStatus_SessionExists SessionStatus = 1 +) + +// Enum value maps for SessionStatus. +var ( + SessionStatus_name = map[int32]string{ + 0: "SessionNotFound", + 1: "SessionExists", + } + SessionStatus_value = map[string]int32{ + "SessionNotFound": 0, + "SessionExists": 1, + } +) + +func (x SessionStatus) Enum() *SessionStatus { + p := new(SessionStatus) + *p = x + return p +} + +func (x SessionStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SessionStatus) Descriptor() protoreflect.EnumDescriptor { + return file_pkg_auth_v3_auth_proto_enumTypes[2].Descriptor() +} + +func (SessionStatus) Type() protoreflect.EnumType { + return &file_pkg_auth_v3_auth_proto_enumTypes[2] +} + +func (x SessionStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use SessionStatus.Descriptor instead. +func (SessionStatus) EnumDescriptor() ([]byte, []int) { + return file_pkg_auth_v3_auth_proto_rawDescGZIP(), []int{2} +} + +type APIKeyStatus int32 + +const ( + APIKeyStatus_APIKeyNotFound APIKeyStatus = 0 + APIKeyStatus_APIKeyExists APIKeyStatus = 1 +) + +// Enum value maps for APIKeyStatus. +var ( + APIKeyStatus_name = map[int32]string{ + 0: "APIKeyNotFound", + 1: "APIKeyExists", + } + APIKeyStatus_value = map[string]int32{ + "APIKeyNotFound": 0, + "APIKeyExists": 1, + } +) + +func (x APIKeyStatus) Enum() *APIKeyStatus { + p := new(APIKeyStatus) + *p = x + return p +} + +func (x APIKeyStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (APIKeyStatus) Descriptor() protoreflect.EnumDescriptor { + return file_pkg_auth_v3_auth_proto_enumTypes[3].Descriptor() +} + +func (APIKeyStatus) Type() protoreflect.EnumType { + return &file_pkg_auth_v3_auth_proto_enumTypes[3] +} + +func (x APIKeyStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use APIKeyStatus.Descriptor instead. +func (APIKeyStatus) EnumDescriptor() ([]byte, []int) { + return file_pkg_auth_v3_auth_proto_rawDescGZIP(), []int{3} +} + +type RequestStatus int32 + +const ( + RequestStatus_RequestAllowed RequestStatus = 0 + RequestStatus_RequestNotAuthenticated RequestStatus = 1 + RequestStatus_RequestMethodOrURLNotAllowed RequestStatus = 2 +) + +// Enum value maps for RequestStatus. +var ( + RequestStatus_name = map[int32]string{ + 0: "RequestAllowed", + 1: "RequestNotAuthenticated", + 2: "RequestMethodOrURLNotAllowed", + } + RequestStatus_value = map[string]int32{ + "RequestAllowed": 0, + "RequestNotAuthenticated": 1, + "RequestMethodOrURLNotAllowed": 2, + } +) + +func (x RequestStatus) Enum() *RequestStatus { + p := new(RequestStatus) + *p = x + return p +} + +func (x RequestStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (RequestStatus) Descriptor() protoreflect.EnumDescriptor { + return file_pkg_auth_v3_auth_proto_enumTypes[4].Descriptor() +} + +func (RequestStatus) Type() protoreflect.EnumType { + return &file_pkg_auth_v3_auth_proto_enumTypes[4] +} + +func (x RequestStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use RequestStatus.Descriptor instead. +func (RequestStatus) EnumDescriptor() ([]byte, []int) { + return file_pkg_auth_v3_auth_proto_rawDescGZIP(), []int{4} +} + +type GetSessionRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` +} + +func (x *GetSessionRequest) Reset() { + *x = GetSessionRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_auth_v3_auth_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetSessionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetSessionRequest) ProtoMessage() {} + +func (x *GetSessionRequest) ProtoReflect() protoreflect.Message { + mi := &file_pkg_auth_v3_auth_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetSessionRequest.ProtoReflect.Descriptor instead. +func (*GetSessionRequest) Descriptor() ([]byte, []int) { + return file_pkg_auth_v3_auth_proto_rawDescGZIP(), []int{0} +} + +func (x *GetSessionRequest) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +type ResourceURLMethods struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Methods []string `protobuf:"bytes,1,rep,name=methods,proto3" json:"methods,omitempty"` +} + +func (x *ResourceURLMethods) Reset() { + *x = ResourceURLMethods{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_auth_v3_auth_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResourceURLMethods) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResourceURLMethods) ProtoMessage() {} + +func (x *ResourceURLMethods) ProtoReflect() protoreflect.Message { + mi := &file_pkg_auth_v3_auth_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResourceURLMethods.ProtoReflect.Descriptor instead. +func (*ResourceURLMethods) Descriptor() ([]byte, []int) { + return file_pkg_auth_v3_auth_proto_rawDescGZIP(), []int{1} +} + +func (x *ResourceURLMethods) GetMethods() []string { + if x != nil { + return x.Methods + } + return nil +} + +type NamespaceData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + NamespaceId string `protobuf:"bytes,2,opt,name=namespace_id,json=namespaceId,proto3" json:"namespace_id,omitempty"` + Role string `protobuf:"bytes,3,opt,name=role,proto3" json:"role,omitempty"` +} + +func (x *NamespaceData) Reset() { + *x = NamespaceData{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_auth_v3_auth_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NamespaceData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NamespaceData) ProtoMessage() {} + +func (x *NamespaceData) ProtoReflect() protoreflect.Message { + mi := &file_pkg_auth_v3_auth_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NamespaceData.ProtoReflect.Descriptor instead. +func (*NamespaceData) Descriptor() ([]byte, []int) { + return file_pkg_auth_v3_auth_proto_rawDescGZIP(), []int{2} +} + +func (x *NamespaceData) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *NamespaceData) GetNamespaceId() string { + if x != nil { + return x.NamespaceId + } + return "" +} + +func (x *NamespaceData) GetRole() string { + if x != nil { + return x.Role + } + return "" +} + +type ProjectRole struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + Role string `protobuf:"bytes,3,opt,name=role,proto3" json:"role,omitempty"` +} + +func (x *ProjectRole) Reset() { + *x = ProjectRole{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_auth_v3_auth_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProjectRole) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProjectRole) ProtoMessage() {} + +func (x *ProjectRole) ProtoReflect() protoreflect.Message { + mi := &file_pkg_auth_v3_auth_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProjectRole.ProtoReflect.Descriptor instead. +func (*ProjectRole) Descriptor() ([]byte, []int) { + return file_pkg_auth_v3_auth_proto_rawDescGZIP(), []int{3} +} + +func (x *ProjectRole) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *ProjectRole) GetRole() string { + if x != nil { + return x.Role + } + return "" +} + +type ProjectData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + All bool `protobuf:"varint,1,opt,name=all,proto3" json:"all,omitempty"` + List []*ProjectRole `protobuf:"bytes,2,rep,name=list,proto3" json:"list,omitempty"` +} + +func (x *ProjectData) Reset() { + *x = ProjectData{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_auth_v3_auth_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProjectData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProjectData) ProtoMessage() {} + +func (x *ProjectData) ProtoReflect() protoreflect.Message { + mi := &file_pkg_auth_v3_auth_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProjectData.ProtoReflect.Descriptor instead. +func (*ProjectData) Descriptor() ([]byte, []int) { + return file_pkg_auth_v3_auth_proto_rawDescGZIP(), []int{4} +} + +func (x *ProjectData) GetAll() bool { + if x != nil { + return x.All + } + return false +} + +func (x *ProjectData) GetList() []*ProjectRole { + if x != nil { + return x.List + } + return nil +} + +type SessionData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` + Organization string `protobuf:"bytes,2,opt,name=organization,proto3" json:"organization,omitempty"` + Partner string `protobuf:"bytes,3,opt,name=partner,proto3" json:"partner,omitempty"` + Role string `protobuf:"bytes,4,opt,name=role,proto3" json:"role,omitempty"` + Permissions []string `protobuf:"bytes,5,rep,name=permissions,proto3" json:"permissions,omitempty"` + PartnerDomain string `protobuf:"bytes,6,opt,name=partner_domain,json=partnerDomain,proto3" json:"partner_domain,omitempty"` + Username string `protobuf:"bytes,7,opt,name=username,proto3" json:"username,omitempty"` + IsSuperAdmin bool `protobuf:"varint,8,opt,name=is_super_admin,json=isSuperAdmin,proto3" json:"is_super_admin,omitempty"` + IsPartnerAdmin bool `protobuf:"varint,9,opt,name=is_partner_admin,json=isPartnerAdmin,proto3" json:"is_partner_admin,omitempty"` + IsSsoUser bool `protobuf:"varint,10,opt,name=is_sso_user,json=isSsoUser,proto3" json:"is_sso_user,omitempty"` + ResourceUrls map[string]*ResourceURLMethods `protobuf:"bytes,11,rep,name=resource_urls,json=resourceUrls,proto3" json:"resource_urls,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Ttl string `protobuf:"bytes,12,opt,name=ttl,proto3" json:"ttl,omitempty"` + Groups []string `protobuf:"bytes,13,rep,name=groups,proto3" json:"groups,omitempty"` + AuthType AuthType `protobuf:"varint,14,opt,name=auth_type,json=authType,proto3,enum=rafay.dev.auth.v3.AuthType" json:"auth_type,omitempty"` + Idp string `protobuf:"bytes,15,opt,name=idp,proto3" json:"idp,omitempty"` + IsOrgAdmin map[string]bool `protobuf:"bytes,16,rep,name=is_org_admin,json=isOrgAdmin,proto3" json:"is_org_admin,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + ClientType ClientType `protobuf:"varint,17,opt,name=client_type,json=clientType,proto3,enum=rafay.dev.auth.v3.ClientType" json:"client_type,omitempty"` + IsAllNsAccess map[string]bool `protobuf:"bytes,18,rep,name=is_all_ns_access,json=isAllNsAccess,proto3" json:"is_all_ns_access,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + Namespaces []*NamespaceData `protobuf:"bytes,19,rep,name=namespaces,proto3" json:"namespaces,omitempty"` + Project *ProjectData `protobuf:"bytes,20,opt,name=project,proto3" json:"project,omitempty"` + IsReadonlyOrgAdmin map[string]bool `protobuf:"bytes,21,rep,name=is_readonly_org_admin,json=isReadonlyOrgAdmin,proto3" json:"is_readonly_org_admin,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` +} + +func (x *SessionData) Reset() { + *x = SessionData{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_auth_v3_auth_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SessionData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SessionData) ProtoMessage() {} + +func (x *SessionData) ProtoReflect() protoreflect.Message { + mi := &file_pkg_auth_v3_auth_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SessionData.ProtoReflect.Descriptor instead. +func (*SessionData) Descriptor() ([]byte, []int) { + return file_pkg_auth_v3_auth_proto_rawDescGZIP(), []int{5} +} + +func (x *SessionData) GetAccount() string { + if x != nil { + return x.Account + } + return "" +} + +func (x *SessionData) GetOrganization() string { + if x != nil { + return x.Organization + } + return "" +} + +func (x *SessionData) GetPartner() string { + if x != nil { + return x.Partner + } + return "" +} + +func (x *SessionData) GetRole() string { + if x != nil { + return x.Role + } + return "" +} + +func (x *SessionData) GetPermissions() []string { + if x != nil { + return x.Permissions + } + return nil +} + +func (x *SessionData) GetPartnerDomain() string { + if x != nil { + return x.PartnerDomain + } + return "" +} + +func (x *SessionData) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *SessionData) GetIsSuperAdmin() bool { + if x != nil { + return x.IsSuperAdmin + } + return false +} + +func (x *SessionData) GetIsPartnerAdmin() bool { + if x != nil { + return x.IsPartnerAdmin + } + return false +} + +func (x *SessionData) GetIsSsoUser() bool { + if x != nil { + return x.IsSsoUser + } + return false +} + +func (x *SessionData) GetResourceUrls() map[string]*ResourceURLMethods { + if x != nil { + return x.ResourceUrls + } + return nil +} + +func (x *SessionData) GetTtl() string { + if x != nil { + return x.Ttl + } + return "" +} + +func (x *SessionData) GetGroups() []string { + if x != nil { + return x.Groups + } + return nil +} + +func (x *SessionData) GetAuthType() AuthType { + if x != nil { + return x.AuthType + } + return AuthType_AuthTypeNotSet +} + +func (x *SessionData) GetIdp() string { + if x != nil { + return x.Idp + } + return "" +} + +func (x *SessionData) GetIsOrgAdmin() map[string]bool { + if x != nil { + return x.IsOrgAdmin + } + return nil +} + +func (x *SessionData) GetClientType() ClientType { + if x != nil { + return x.ClientType + } + return ClientType_ClientTypeNotSet +} + +func (x *SessionData) GetIsAllNsAccess() map[string]bool { + if x != nil { + return x.IsAllNsAccess + } + return nil +} + +func (x *SessionData) GetNamespaces() []*NamespaceData { + if x != nil { + return x.Namespaces + } + return nil +} + +func (x *SessionData) GetProject() *ProjectData { + if x != nil { + return x.Project + } + return nil +} + +func (x *SessionData) GetIsReadonlyOrgAdmin() map[string]bool { + if x != nil { + return x.IsReadonlyOrgAdmin + } + return nil +} + +type GetSessionResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status SessionStatus `protobuf:"varint,1,opt,name=status,proto3,enum=rafay.dev.auth.v3.SessionStatus" json:"status,omitempty"` + Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"` + Data *SessionData `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *GetSessionResponse) Reset() { + *x = GetSessionResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_auth_v3_auth_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetSessionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetSessionResponse) ProtoMessage() {} + +func (x *GetSessionResponse) ProtoReflect() protoreflect.Message { + mi := &file_pkg_auth_v3_auth_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetSessionResponse.ProtoReflect.Descriptor instead. +func (*GetSessionResponse) Descriptor() ([]byte, []int) { + return file_pkg_auth_v3_auth_proto_rawDescGZIP(), []int{6} +} + +func (x *GetSessionResponse) GetStatus() SessionStatus { + if x != nil { + return x.Status + } + return SessionStatus_SessionNotFound +} + +func (x *GetSessionResponse) GetReason() string { + if x != nil { + return x.Reason + } + return "" +} + +func (x *GetSessionResponse) GetData() *SessionData { + if x != nil { + return x.Data + } + return nil +} + +type GetAPIKeyRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ApiKey string `protobuf:"bytes,1,opt,name=api_key,json=apiKey,proto3" json:"api_key,omitempty"` +} + +func (x *GetAPIKeyRequest) Reset() { + *x = GetAPIKeyRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_auth_v3_auth_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAPIKeyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAPIKeyRequest) ProtoMessage() {} + +func (x *GetAPIKeyRequest) ProtoReflect() protoreflect.Message { + mi := &file_pkg_auth_v3_auth_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAPIKeyRequest.ProtoReflect.Descriptor instead. +func (*GetAPIKeyRequest) Descriptor() ([]byte, []int) { + return file_pkg_auth_v3_auth_proto_rawDescGZIP(), []int{7} +} + +func (x *GetAPIKeyRequest) GetApiKey() string { + if x != nil { + return x.ApiKey + } + return "" +} + +type GetAPIKeyResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status APIKeyStatus `protobuf:"varint,1,opt,name=status,proto3,enum=rafay.dev.auth.v3.APIKeyStatus" json:"status,omitempty"` + Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"` + Secret string `protobuf:"bytes,3,opt,name=secret,proto3" json:"secret,omitempty"` + Data *SessionData `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *GetAPIKeyResponse) Reset() { + *x = GetAPIKeyResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_auth_v3_auth_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAPIKeyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAPIKeyResponse) ProtoMessage() {} + +func (x *GetAPIKeyResponse) ProtoReflect() protoreflect.Message { + mi := &file_pkg_auth_v3_auth_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAPIKeyResponse.ProtoReflect.Descriptor instead. +func (*GetAPIKeyResponse) Descriptor() ([]byte, []int) { + return file_pkg_auth_v3_auth_proto_rawDescGZIP(), []int{8} +} + +func (x *GetAPIKeyResponse) GetStatus() APIKeyStatus { + if x != nil { + return x.Status + } + return APIKeyStatus_APIKeyNotFound +} + +func (x *GetAPIKeyResponse) GetReason() string { + if x != nil { + return x.Reason + } + return "" +} + +func (x *GetAPIKeyResponse) GetSecret() string { + if x != nil { + return x.Secret + } + return "" +} + +func (x *GetAPIKeyResponse) GetData() *SessionData { + if x != nil { + return x.Data + } + return nil +} + +type IsRequestAllowedRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` + Method string `protobuf:"bytes,2,opt,name=method,proto3" json:"method,omitempty"` + Rsid string `protobuf:"bytes,3,opt,name=rsid,proto3" json:"rsid,omitempty"` + ApiKey string `protobuf:"bytes,4,opt,name=api_key,json=apiKey,proto3" json:"api_key,omitempty"` +} + +func (x *IsRequestAllowedRequest) Reset() { + *x = IsRequestAllowedRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_auth_v3_auth_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IsRequestAllowedRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IsRequestAllowedRequest) ProtoMessage() {} + +func (x *IsRequestAllowedRequest) ProtoReflect() protoreflect.Message { + mi := &file_pkg_auth_v3_auth_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IsRequestAllowedRequest.ProtoReflect.Descriptor instead. +func (*IsRequestAllowedRequest) Descriptor() ([]byte, []int) { + return file_pkg_auth_v3_auth_proto_rawDescGZIP(), []int{9} +} + +func (x *IsRequestAllowedRequest) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +func (x *IsRequestAllowedRequest) GetMethod() string { + if x != nil { + return x.Method + } + return "" +} + +func (x *IsRequestAllowedRequest) GetRsid() string { + if x != nil { + return x.Rsid + } + return "" +} + +func (x *IsRequestAllowedRequest) GetApiKey() string { + if x != nil { + return x.ApiKey + } + return "" +} + +type IsRequestAllowedResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status RequestStatus `protobuf:"varint,1,opt,name=status,proto3,enum=rafay.dev.auth.v3.RequestStatus" json:"status,omitempty"` + Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"` + SessionData *SessionData `protobuf:"bytes,3,opt,name=sessionData,proto3" json:"sessionData,omitempty"` +} + +func (x *IsRequestAllowedResponse) Reset() { + *x = IsRequestAllowedResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_auth_v3_auth_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IsRequestAllowedResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IsRequestAllowedResponse) ProtoMessage() {} + +func (x *IsRequestAllowedResponse) ProtoReflect() protoreflect.Message { + mi := &file_pkg_auth_v3_auth_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IsRequestAllowedResponse.ProtoReflect.Descriptor instead. +func (*IsRequestAllowedResponse) Descriptor() ([]byte, []int) { + return file_pkg_auth_v3_auth_proto_rawDescGZIP(), []int{10} +} + +func (x *IsRequestAllowedResponse) GetStatus() RequestStatus { + if x != nil { + return x.Status + } + return RequestStatus_RequestAllowed +} + +func (x *IsRequestAllowedResponse) GetReason() string { + if x != nil { + return x.Reason + } + return "" +} + +func (x *IsRequestAllowedResponse) GetSessionData() *SessionData { + if x != nil { + return x.SessionData + } + return nil +} + +type AuthErrorDetail struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ErrorCode string `protobuf:"bytes,1,opt,name=error_code,json=errorCode,proto3" json:"error_code,omitempty"` + Detail string `protobuf:"bytes,2,opt,name=detail,proto3" json:"detail,omitempty"` + Info string `protobuf:"bytes,3,opt,name=info,proto3" json:"info,omitempty"` +} + +func (x *AuthErrorDetail) Reset() { + *x = AuthErrorDetail{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_auth_v3_auth_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AuthErrorDetail) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AuthErrorDetail) ProtoMessage() {} + +func (x *AuthErrorDetail) ProtoReflect() protoreflect.Message { + mi := &file_pkg_auth_v3_auth_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AuthErrorDetail.ProtoReflect.Descriptor instead. +func (*AuthErrorDetail) Descriptor() ([]byte, []int) { + return file_pkg_auth_v3_auth_proto_rawDescGZIP(), []int{11} +} + +func (x *AuthErrorDetail) GetErrorCode() string { + if x != nil { + return x.ErrorCode + } + return "" +} + +func (x *AuthErrorDetail) GetDetail() string { + if x != nil { + return x.Detail + } + return "" +} + +func (x *AuthErrorDetail) GetInfo() string { + if x != nil { + return x.Info + } + return "" +} + +type AuthError struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StatusCode int32 `protobuf:"zigzag32,1,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"` + Details []*AuthErrorDetail `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` +} + +func (x *AuthError) Reset() { + *x = AuthError{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_auth_v3_auth_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AuthError) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AuthError) ProtoMessage() {} + +func (x *AuthError) ProtoReflect() protoreflect.Message { + mi := &file_pkg_auth_v3_auth_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AuthError.ProtoReflect.Descriptor instead. +func (*AuthError) Descriptor() ([]byte, []int) { + return file_pkg_auth_v3_auth_proto_rawDescGZIP(), []int{12} +} + +func (x *AuthError) GetStatusCode() int32 { + if x != nil { + return x.StatusCode + } + return 0 +} + +func (x *AuthError) GetDetails() []*AuthErrorDetail { + if x != nil { + return x.Details + } + return nil +} + +var File_pkg_auth_v3_auth_proto protoreflect.FileDescriptor + +var file_pkg_auth_v3_auth_proto_rawDesc = []byte{ + 0x0a, 0x16, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x33, 0x2f, 0x61, 0x75, + 0x74, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, + 0x64, 0x65, 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x33, 0x1a, 0x14, 0x67, 0x6f, 0x67, + 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0x32, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x2e, 0x0a, 0x12, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x55, 0x52, 0x4c, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, + 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, + 0x74, 0x68, 0x6f, 0x64, 0x73, 0x22, 0x65, 0x0a, 0x0d, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x22, 0x40, 0x0a, 0x0b, + 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, + 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x22, 0x59, + 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, + 0x03, 0x61, 0x6c, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x12, + 0x38, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, + 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, + 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x42, 0x04, 0xc8, + 0xde, 0x1f, 0x00, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0xa6, 0x0a, 0x0a, 0x0b, 0x53, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, + 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x72, 0x74, 0x6e, + 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, + 0x72, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x6d, + 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x61, 0x72, 0x74, 0x6e, + 0x65, 0x72, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0d, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x1a, + 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x69, 0x73, + 0x5f, 0x73, 0x75, 0x70, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0c, 0x69, 0x73, 0x53, 0x75, 0x70, 0x65, 0x72, 0x41, 0x64, 0x6d, 0x69, 0x6e, + 0x12, 0x28, 0x0a, 0x10, 0x69, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x5f, 0x61, + 0x64, 0x6d, 0x69, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x69, 0x73, 0x50, 0x61, + 0x72, 0x74, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x1e, 0x0a, 0x0b, 0x69, 0x73, + 0x5f, 0x73, 0x73, 0x6f, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x09, 0x69, 0x73, 0x53, 0x73, 0x6f, 0x55, 0x73, 0x65, 0x72, 0x12, 0x55, 0x0a, 0x0d, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x30, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, 0x75, + 0x74, 0x68, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, + 0x61, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x55, 0x72, 0x6c, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x55, 0x72, 0x6c, + 0x73, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x74, 0x6c, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x74, 0x74, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x18, 0x0d, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x38, 0x0a, 0x09, 0x61, + 0x75, 0x74, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, + 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, + 0x76, 0x33, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x61, 0x75, 0x74, + 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x70, 0x18, 0x0f, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x69, 0x64, 0x70, 0x12, 0x50, 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x6f, 0x72, + 0x67, 0x5f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, + 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, + 0x33, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x49, 0x73, + 0x4f, 0x72, 0x67, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x69, + 0x73, 0x4f, 0x72, 0x67, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x3e, 0x0a, 0x0b, 0x63, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, + 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, + 0x76, 0x33, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x63, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x5a, 0x0a, 0x10, 0x69, 0x73, 0x5f, + 0x61, 0x6c, 0x6c, 0x5f, 0x6e, 0x73, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x12, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, + 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, + 0x61, 0x74, 0x61, 0x2e, 0x49, 0x73, 0x41, 0x6c, 0x6c, 0x4e, 0x73, 0x41, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0d, 0x69, 0x73, 0x41, 0x6c, 0x6c, 0x4e, 0x73, 0x41, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x46, 0x0a, 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x73, 0x18, 0x13, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x72, 0x61, 0x66, 0x61, + 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x33, 0x2e, 0x4e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x42, 0x04, 0xc8, 0xde, 0x1f, + 0x00, 0x52, 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x12, 0x38, 0x0a, + 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, + 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, + 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x44, 0x61, 0x74, 0x61, 0x52, 0x07, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x69, 0x0a, 0x15, 0x69, 0x73, 0x5f, 0x72, 0x65, + 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x5f, 0x6f, 0x72, 0x67, 0x5f, 0x61, 0x64, 0x6d, 0x69, 0x6e, + 0x18, 0x15, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, + 0x65, 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x49, 0x73, 0x52, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, + 0x79, 0x4f, 0x72, 0x67, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x12, + 0x69, 0x73, 0x52, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x4f, 0x72, 0x67, 0x41, 0x64, 0x6d, + 0x69, 0x6e, 0x1a, 0x66, 0x0a, 0x11, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x55, 0x72, + 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x3b, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, + 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x55, 0x52, 0x4c, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3d, 0x0a, 0x0f, 0x49, 0x73, + 0x4f, 0x72, 0x67, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x40, 0x0a, 0x12, 0x49, 0x73, 0x41, + 0x6c, 0x6c, 0x4e, 0x73, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x45, 0x0a, 0x17, 0x49, + 0x73, 0x52, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x4f, 0x72, 0x67, 0x41, 0x64, 0x6d, 0x69, + 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x22, 0x9a, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x72, 0x61, 0x66, 0x61, + 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x72, 0x61, 0x66, 0x61, + 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, + 0x2b, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x61, 0x70, 0x69, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x22, 0xb0, 0x01, 0x0a, + 0x11, 0x47, 0x65, 0x74, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x37, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, + 0x75, 0x74, 0x68, 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x72, + 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, + 0x73, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x32, 0x0a, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x72, 0x61, 0x66, 0x61, + 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, + 0x70, 0x0a, 0x17, 0x49, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x6f, + 0x77, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, + 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x16, 0x0a, 0x06, + 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, + 0x74, 0x68, 0x6f, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x73, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x72, 0x73, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x61, 0x70, 0x69, 0x5f, + 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x70, 0x69, 0x4b, 0x65, + 0x79, 0x22, 0xae, 0x01, 0x0a, 0x18, 0x49, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x41, + 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, + 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, + 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, + 0x76, 0x33, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, + 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, + 0x12, 0x40, 0x0a, 0x0b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, + 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x61, + 0x74, 0x61, 0x22, 0x5c, 0x0a, 0x0f, 0x41, 0x75, 0x74, 0x68, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x44, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, + 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, + 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x12, 0x0a, 0x04, + 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, + 0x22, 0x6a, 0x0a, 0x09, 0x41, 0x75, 0x74, 0x68, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x1f, 0x0a, + 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x11, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x3c, + 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x22, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, + 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x44, 0x65, 0x74, + 0x61, 0x69, 0x6c, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2a, 0x42, 0x0a, 0x08, + 0x41, 0x75, 0x74, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x0e, 0x41, 0x75, 0x74, 0x68, + 0x54, 0x79, 0x70, 0x65, 0x4e, 0x6f, 0x74, 0x53, 0x65, 0x74, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, + 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x10, 0x01, 0x12, 0x0a, + 0x0a, 0x06, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x10, 0x02, 0x1a, 0x04, 0x88, 0xa3, 0x1e, 0x00, + 0x2a, 0x3e, 0x0a, 0x0a, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, + 0x0a, 0x10, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x4e, 0x6f, 0x74, 0x53, + 0x65, 0x74, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x42, 0x52, 0x4f, 0x57, 0x53, 0x45, 0x52, 0x10, + 0x01, 0x12, 0x07, 0x0a, 0x03, 0x43, 0x4c, 0x49, 0x10, 0x02, 0x1a, 0x04, 0x88, 0xa3, 0x1e, 0x00, + 0x2a, 0x3d, 0x0a, 0x0d, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x46, + 0x6f, 0x75, 0x6e, 0x64, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x10, 0x01, 0x1a, 0x04, 0x88, 0xa3, 0x1e, 0x00, 0x2a, + 0x3a, 0x0a, 0x0c, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x12, 0x0a, 0x0e, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, + 0x64, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x45, 0x78, 0x69, + 0x73, 0x74, 0x73, 0x10, 0x01, 0x1a, 0x04, 0x88, 0xa3, 0x1e, 0x00, 0x2a, 0x68, 0x0a, 0x0d, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x0e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x10, 0x00, + 0x12, 0x1b, 0x0a, 0x17, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4e, 0x6f, 0x74, 0x41, 0x75, + 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, 0x10, 0x01, 0x12, 0x20, 0x0a, + 0x1c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x72, + 0x55, 0x52, 0x4c, 0x4e, 0x6f, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x10, 0x02, 0x1a, + 0x04, 0x88, 0xa3, 0x1e, 0x00, 0x32, 0xa6, 0x02, 0x0a, 0x04, 0x41, 0x75, 0x74, 0x68, 0x12, 0x6b, + 0x0a, 0x10, 0x49, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x77, + 0x65, 0x64, 0x12, 0x2a, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, + 0x75, 0x74, 0x68, 0x2e, 0x76, 0x33, 0x2e, 0x49, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, + 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, + 0x76, 0x33, 0x2e, 0x49, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x6f, + 0x77, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x0a, 0x47, + 0x65, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x72, 0x61, 0x66, 0x61, + 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, + 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x25, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, + 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x41, 0x50, 0x49, + 0x4b, 0x65, 0x79, 0x12, 0x23, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, + 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x50, 0x49, 0x4b, 0x65, + 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, + 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, + 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xc8, + 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, + 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x33, 0x42, 0x09, 0x41, 0x75, 0x74, 0x68, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x52, 0x61, 0x66, 0x61, 0x79, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x73, 0x2f, 0x72, + 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x33, 0x3b, 0x61, 0x75, + 0x74, 0x68, 0x76, 0x33, 0xa2, 0x02, 0x03, 0x52, 0x44, 0x41, 0xaa, 0x02, 0x11, 0x52, 0x61, 0x66, + 0x61, 0x79, 0x2e, 0x44, 0x65, 0x76, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x2e, 0x56, 0x33, 0xca, 0x02, + 0x11, 0x52, 0x61, 0x66, 0x61, 0x79, 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x41, 0x75, 0x74, 0x68, 0x5c, + 0x56, 0x33, 0xe2, 0x02, 0x1d, 0x52, 0x61, 0x66, 0x61, 0x79, 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x41, + 0x75, 0x74, 0x68, 0x5c, 0x56, 0x33, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x14, 0x52, 0x61, 0x66, 0x61, 0x79, 0x3a, 0x3a, 0x44, 0x65, 0x76, 0x3a, + 0x3a, 0x41, 0x75, 0x74, 0x68, 0x3a, 0x3a, 0x56, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_pkg_auth_v3_auth_proto_rawDescOnce sync.Once + file_pkg_auth_v3_auth_proto_rawDescData = file_pkg_auth_v3_auth_proto_rawDesc +) + +func file_pkg_auth_v3_auth_proto_rawDescGZIP() []byte { + file_pkg_auth_v3_auth_proto_rawDescOnce.Do(func() { + file_pkg_auth_v3_auth_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_auth_v3_auth_proto_rawDescData) + }) + return file_pkg_auth_v3_auth_proto_rawDescData +} + +var file_pkg_auth_v3_auth_proto_enumTypes = make([]protoimpl.EnumInfo, 5) +var file_pkg_auth_v3_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 17) +var file_pkg_auth_v3_auth_proto_goTypes = []interface{}{ + (AuthType)(0), // 0: rafay.dev.auth.v3.AuthType + (ClientType)(0), // 1: rafay.dev.auth.v3.ClientType + (SessionStatus)(0), // 2: rafay.dev.auth.v3.SessionStatus + (APIKeyStatus)(0), // 3: rafay.dev.auth.v3.APIKeyStatus + (RequestStatus)(0), // 4: rafay.dev.auth.v3.RequestStatus + (*GetSessionRequest)(nil), // 5: rafay.dev.auth.v3.GetSessionRequest + (*ResourceURLMethods)(nil), // 6: rafay.dev.auth.v3.ResourceURLMethods + (*NamespaceData)(nil), // 7: rafay.dev.auth.v3.NamespaceData + (*ProjectRole)(nil), // 8: rafay.dev.auth.v3.ProjectRole + (*ProjectData)(nil), // 9: rafay.dev.auth.v3.ProjectData + (*SessionData)(nil), // 10: rafay.dev.auth.v3.SessionData + (*GetSessionResponse)(nil), // 11: rafay.dev.auth.v3.GetSessionResponse + (*GetAPIKeyRequest)(nil), // 12: rafay.dev.auth.v3.GetAPIKeyRequest + (*GetAPIKeyResponse)(nil), // 13: rafay.dev.auth.v3.GetAPIKeyResponse + (*IsRequestAllowedRequest)(nil), // 14: rafay.dev.auth.v3.IsRequestAllowedRequest + (*IsRequestAllowedResponse)(nil), // 15: rafay.dev.auth.v3.IsRequestAllowedResponse + (*AuthErrorDetail)(nil), // 16: rafay.dev.auth.v3.AuthErrorDetail + (*AuthError)(nil), // 17: rafay.dev.auth.v3.AuthError + nil, // 18: rafay.dev.auth.v3.SessionData.ResourceUrlsEntry + nil, // 19: rafay.dev.auth.v3.SessionData.IsOrgAdminEntry + nil, // 20: rafay.dev.auth.v3.SessionData.IsAllNsAccessEntry + nil, // 21: rafay.dev.auth.v3.SessionData.IsReadonlyOrgAdminEntry +} +var file_pkg_auth_v3_auth_proto_depIdxs = []int32{ + 8, // 0: rafay.dev.auth.v3.ProjectData.list:type_name -> rafay.dev.auth.v3.ProjectRole + 18, // 1: rafay.dev.auth.v3.SessionData.resource_urls:type_name -> rafay.dev.auth.v3.SessionData.ResourceUrlsEntry + 0, // 2: rafay.dev.auth.v3.SessionData.auth_type:type_name -> rafay.dev.auth.v3.AuthType + 19, // 3: rafay.dev.auth.v3.SessionData.is_org_admin:type_name -> rafay.dev.auth.v3.SessionData.IsOrgAdminEntry + 1, // 4: rafay.dev.auth.v3.SessionData.client_type:type_name -> rafay.dev.auth.v3.ClientType + 20, // 5: rafay.dev.auth.v3.SessionData.is_all_ns_access:type_name -> rafay.dev.auth.v3.SessionData.IsAllNsAccessEntry + 7, // 6: rafay.dev.auth.v3.SessionData.namespaces:type_name -> rafay.dev.auth.v3.NamespaceData + 9, // 7: rafay.dev.auth.v3.SessionData.project:type_name -> rafay.dev.auth.v3.ProjectData + 21, // 8: rafay.dev.auth.v3.SessionData.is_readonly_org_admin:type_name -> rafay.dev.auth.v3.SessionData.IsReadonlyOrgAdminEntry + 2, // 9: rafay.dev.auth.v3.GetSessionResponse.status:type_name -> rafay.dev.auth.v3.SessionStatus + 10, // 10: rafay.dev.auth.v3.GetSessionResponse.data:type_name -> rafay.dev.auth.v3.SessionData + 3, // 11: rafay.dev.auth.v3.GetAPIKeyResponse.status:type_name -> rafay.dev.auth.v3.APIKeyStatus + 10, // 12: rafay.dev.auth.v3.GetAPIKeyResponse.data:type_name -> rafay.dev.auth.v3.SessionData + 4, // 13: rafay.dev.auth.v3.IsRequestAllowedResponse.status:type_name -> rafay.dev.auth.v3.RequestStatus + 10, // 14: rafay.dev.auth.v3.IsRequestAllowedResponse.sessionData:type_name -> rafay.dev.auth.v3.SessionData + 16, // 15: rafay.dev.auth.v3.AuthError.details:type_name -> rafay.dev.auth.v3.AuthErrorDetail + 6, // 16: rafay.dev.auth.v3.SessionData.ResourceUrlsEntry.value:type_name -> rafay.dev.auth.v3.ResourceURLMethods + 14, // 17: rafay.dev.auth.v3.Auth.IsRequestAllowed:input_type -> rafay.dev.auth.v3.IsRequestAllowedRequest + 5, // 18: rafay.dev.auth.v3.Auth.GetSession:input_type -> rafay.dev.auth.v3.GetSessionRequest + 12, // 19: rafay.dev.auth.v3.Auth.GetAPIKey:input_type -> rafay.dev.auth.v3.GetAPIKeyRequest + 15, // 20: rafay.dev.auth.v3.Auth.IsRequestAllowed:output_type -> rafay.dev.auth.v3.IsRequestAllowedResponse + 11, // 21: rafay.dev.auth.v3.Auth.GetSession:output_type -> rafay.dev.auth.v3.GetSessionResponse + 13, // 22: rafay.dev.auth.v3.Auth.GetAPIKey:output_type -> rafay.dev.auth.v3.GetAPIKeyResponse + 20, // [20:23] is the sub-list for method output_type + 17, // [17:20] is the sub-list for method input_type + 17, // [17:17] is the sub-list for extension type_name + 17, // [17:17] is the sub-list for extension extendee + 0, // [0:17] is the sub-list for field type_name +} + +func init() { file_pkg_auth_v3_auth_proto_init() } +func file_pkg_auth_v3_auth_proto_init() { + if File_pkg_auth_v3_auth_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_pkg_auth_v3_auth_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetSessionRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_auth_v3_auth_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResourceURLMethods); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_auth_v3_auth_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NamespaceData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_auth_v3_auth_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProjectRole); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_auth_v3_auth_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProjectData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_auth_v3_auth_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SessionData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_auth_v3_auth_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetSessionResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_auth_v3_auth_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAPIKeyRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_auth_v3_auth_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAPIKeyResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_auth_v3_auth_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IsRequestAllowedRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_auth_v3_auth_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IsRequestAllowedResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_auth_v3_auth_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AuthErrorDetail); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_auth_v3_auth_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AuthError); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_pkg_auth_v3_auth_proto_rawDesc, + NumEnums: 5, + NumMessages: 17, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_pkg_auth_v3_auth_proto_goTypes, + DependencyIndexes: file_pkg_auth_v3_auth_proto_depIdxs, + EnumInfos: file_pkg_auth_v3_auth_proto_enumTypes, + MessageInfos: file_pkg_auth_v3_auth_proto_msgTypes, + }.Build() + File_pkg_auth_v3_auth_proto = out.File + file_pkg_auth_v3_auth_proto_rawDesc = nil + file_pkg_auth_v3_auth_proto_goTypes = nil + file_pkg_auth_v3_auth_proto_depIdxs = nil +} diff --git a/components/common/pkg/auth/v3/auth.proto b/components/common/pkg/auth/v3/auth.proto new file mode 100644 index 0000000..b9bf0fb --- /dev/null +++ b/components/common/pkg/auth/v3/auth.proto @@ -0,0 +1,140 @@ +syntax = "proto3"; +package rafay.dev.auth.v3; + +import "gogoproto/gogo.proto"; + +enum AuthType { + option (gogoproto.goproto_enum_prefix) = false; + AuthTypeNotSet = 0; + SessionLogin = 1; + APIKey = 2; +} + +enum ClientType { + option (gogoproto.goproto_enum_prefix) = false; + ClientTypeNotSet = 0; + BROWSER = 1; + CLI = 2; +} + + +message GetSessionRequest { + string session_id = 1; +} + +enum SessionStatus { + // disable enum prefix + option (gogoproto.goproto_enum_prefix) = false; + + SessionNotFound = 0; + SessionExists = 1; +} + +message ResourceURLMethods { + repeated string methods = 1; +} + +message NamespaceData { + string project_id = 1; + string namespace_id = 2; + string role = 3; +} + +message ProjectRole { + string project_id = 1; + string role = 3; +} + +message ProjectData { + bool all = 1; + repeated ProjectRole list = 2 [(gogoproto.nullable) = false]; +} + +message SessionData { + string account = 1; + string organization = 2; + string partner = 3; + string role = 4; + repeated string permissions = 5; + string partner_domain = 6; + string username = 7; + bool is_super_admin = 8; + bool is_partner_admin = 9; + bool is_sso_user = 10; + map resource_urls = 11; + string ttl = 12; + repeated string groups = 13; + AuthType auth_type = 14; + string idp = 15; + map is_org_admin = 16; + ClientType client_type = 17; + map is_all_ns_access = 18; + repeated NamespaceData namespaces = 19 [(gogoproto.nullable) = false]; + ProjectData project = 20; + map is_readonly_org_admin = 21; +} + +message GetSessionResponse { + SessionStatus status = 1; + string reason = 2; + SessionData data = 3; +} + +message GetAPIKeyRequest { + string api_key = 1; +} + +enum APIKeyStatus { + // disable enum prefix + option (gogoproto.goproto_enum_prefix) = false; + + APIKeyNotFound = 0; + APIKeyExists = 1; +} + +message GetAPIKeyResponse { + APIKeyStatus status = 1; + string reason = 2; + string secret = 3; + SessionData data = 4; +} + + +message IsRequestAllowedRequest { + string url = 1; + string method = 2; + string rsid = 3; + string api_key = 4; +} + +enum RequestStatus { + // disable enum prefix + option (gogoproto.goproto_enum_prefix) = false; + + RequestAllowed = 0; + RequestNotAuthenticated = 1; + RequestMethodOrURLNotAllowed = 2; +} + +message IsRequestAllowedResponse { + RequestStatus status = 1; + string reason = 2; + SessionData sessionData = 3; +} + +message AuthErrorDetail { + string error_code = 1; + string detail = 2; + string info = 3; +} + +message AuthError { + sint32 status_code = 1; + repeated AuthErrorDetail details = 2; +} + +service Auth { + rpc IsRequestAllowed(IsRequestAllowedRequest) returns (IsRequestAllowedResponse); + rpc GetSession(GetSessionRequest) returns (GetSessionResponse); + rpc GetAPIKey(GetAPIKeyRequest) returns (GetAPIKeyResponse); +} diff --git a/components/common/pkg/auth/v3/auth_grpc.pb.go b/components/common/pkg/auth/v3/auth_grpc.pb.go new file mode 100644 index 0000000..aff15f1 --- /dev/null +++ b/components/common/pkg/auth/v3/auth_grpc.pb.go @@ -0,0 +1,175 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc (unknown) +// source: pkg/auth/v3/auth.proto + +package authv3 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// AuthClient is the client API for Auth service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type AuthClient interface { + IsRequestAllowed(ctx context.Context, in *IsRequestAllowedRequest, opts ...grpc.CallOption) (*IsRequestAllowedResponse, error) + GetSession(ctx context.Context, in *GetSessionRequest, opts ...grpc.CallOption) (*GetSessionResponse, error) + GetAPIKey(ctx context.Context, in *GetAPIKeyRequest, opts ...grpc.CallOption) (*GetAPIKeyResponse, error) +} + +type authClient struct { + cc grpc.ClientConnInterface +} + +func NewAuthClient(cc grpc.ClientConnInterface) AuthClient { + return &authClient{cc} +} + +func (c *authClient) IsRequestAllowed(ctx context.Context, in *IsRequestAllowedRequest, opts ...grpc.CallOption) (*IsRequestAllowedResponse, error) { + out := new(IsRequestAllowedResponse) + err := c.cc.Invoke(ctx, "/rafay.dev.auth.v3.Auth/IsRequestAllowed", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *authClient) GetSession(ctx context.Context, in *GetSessionRequest, opts ...grpc.CallOption) (*GetSessionResponse, error) { + out := new(GetSessionResponse) + err := c.cc.Invoke(ctx, "/rafay.dev.auth.v3.Auth/GetSession", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *authClient) GetAPIKey(ctx context.Context, in *GetAPIKeyRequest, opts ...grpc.CallOption) (*GetAPIKeyResponse, error) { + out := new(GetAPIKeyResponse) + err := c.cc.Invoke(ctx, "/rafay.dev.auth.v3.Auth/GetAPIKey", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AuthServer is the server API for Auth service. +// All implementations should embed UnimplementedAuthServer +// for forward compatibility +type AuthServer interface { + IsRequestAllowed(context.Context, *IsRequestAllowedRequest) (*IsRequestAllowedResponse, error) + GetSession(context.Context, *GetSessionRequest) (*GetSessionResponse, error) + GetAPIKey(context.Context, *GetAPIKeyRequest) (*GetAPIKeyResponse, error) +} + +// UnimplementedAuthServer should be embedded to have forward compatible implementations. +type UnimplementedAuthServer struct { +} + +func (UnimplementedAuthServer) IsRequestAllowed(context.Context, *IsRequestAllowedRequest) (*IsRequestAllowedResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method IsRequestAllowed not implemented") +} +func (UnimplementedAuthServer) GetSession(context.Context, *GetSessionRequest) (*GetSessionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetSession not implemented") +} +func (UnimplementedAuthServer) GetAPIKey(context.Context, *GetAPIKeyRequest) (*GetAPIKeyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAPIKey not implemented") +} + +// UnsafeAuthServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to AuthServer will +// result in compilation errors. +type UnsafeAuthServer interface { + mustEmbedUnimplementedAuthServer() +} + +func RegisterAuthServer(s grpc.ServiceRegistrar, srv AuthServer) { + s.RegisterService(&Auth_ServiceDesc, srv) +} + +func _Auth_IsRequestAllowed_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IsRequestAllowedRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AuthServer).IsRequestAllowed(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/rafay.dev.auth.v3.Auth/IsRequestAllowed", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AuthServer).IsRequestAllowed(ctx, req.(*IsRequestAllowedRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Auth_GetSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetSessionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AuthServer).GetSession(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/rafay.dev.auth.v3.Auth/GetSession", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AuthServer).GetSession(ctx, req.(*GetSessionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Auth_GetAPIKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAPIKeyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AuthServer).GetAPIKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/rafay.dev.auth.v3.Auth/GetAPIKey", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AuthServer).GetAPIKey(ctx, req.(*GetAPIKeyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Auth_ServiceDesc is the grpc.ServiceDesc for Auth service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Auth_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "rafay.dev.auth.v3.Auth", + HandlerType: (*AuthServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "IsRequestAllowed", + Handler: _Auth_IsRequestAllowed_Handler, + }, + { + MethodName: "GetSession", + Handler: _Auth_GetSession_Handler, + }, + { + MethodName: "GetAPIKey", + Handler: _Auth_GetAPIKey_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "pkg/auth/v3/auth.proto", +} diff --git a/components/common/pkg/auth/v3/pool.go b/components/common/pkg/auth/v3/pool.go new file mode 100644 index 0000000..ba10246 --- /dev/null +++ b/components/common/pkg/auth/v3/pool.go @@ -0,0 +1,59 @@ +package authv3 + +import ( + "github.com/RafaySystems/rcloud-base/components/common/pkg/pool" + + "context" + + grpcpool "github.com/processout/grpc-go-pool" +) + +// AuthPoolClient is the interface for auth pool client +type AuthPoolClient interface { + Unhealthy() + Close() error + AuthClient +} + +type authPoolClient struct { + *grpcpool.ClientConn + *authClient +} + +var _ AuthPoolClient = (*authPoolClient)(nil) + +// AuthPool maintains pool of grpc connections to auth service +type AuthPool interface { + Close() + NewClient(ctx context.Context) (AuthPoolClient, error) +} + +var _ AuthPool = (*authPool)(nil) + +type authPool struct { + *pool.GRPCPool +} + +func (p *authPool) Close() { + if p.GRPCPool != nil { + p.GRPCPool.Close() + } +} + +func (p *authPool) NewClient(ctx context.Context) (AuthPoolClient, error) { + cc, err := p.GetConnection(ctx) + if err != nil { + return nil, err + } + return &authPoolClient{ + cc, + &authClient{cc.ClientConn}, + }, nil +} + +// NewAuthPool returns auth pool +func NewAuthPool(addr string, maxConn int) AuthPool { + return &authPool{ + GRPCPool: pool.NewGRPCPool(addr, maxConn, nil), + } +} diff --git a/components/common/pkg/gateway/annotator.go b/components/common/pkg/gateway/annotator.go new file mode 100644 index 0000000..1537f05 --- /dev/null +++ b/components/common/pkg/gateway/annotator.go @@ -0,0 +1,42 @@ +package gateway + +import ( + "context" + "net/http" + + "google.golang.org/grpc/metadata" +) + +// Rafay Gateway annotations +const ( + GatewayRequest = "rafay-gateway-request" + GatewayURL = "rafay-gateway-url" + GatewayRSID = "rafay-gateway-rsid" + GatewayAPIKey = "rafay-gateway-apikey" + GatewayMethod = "rafay-gateway-method" + rafaySessionCookie = "rsid" + rafayAPIKeyHeader = "X-RAFAY-API-KEYID" + UserAgent = "rafay-gateway-user-agent" + Host = "rafay-gateway-host" + RemoteAddr = "rafay-gateway-remote-addr" +) + +// rafayGatewayAnnotator adds rafay gateway specific annotations +var rafayGatewayAnnotator = func(ctx context.Context, r *http.Request) metadata.MD { + return metadata.New(map[string]string{ + GatewayRequest: "true", + GatewayURL: r.URL.EscapedPath(), + GatewayRSID: func() string { + sid, err := r.Cookie(rafaySessionCookie) + if err != nil { + return "" + } + return sid.Value + }(), + GatewayAPIKey: r.Header.Get(rafayAPIKeyHeader), + GatewayMethod: r.Method, + UserAgent: r.UserAgent(), + Host: r.Host, + RemoteAddr: r.RemoteAddr, + }) +} diff --git a/components/common/pkg/gateway/error.go b/components/common/pkg/gateway/error.go new file mode 100644 index 0000000..7c6f585 --- /dev/null +++ b/components/common/pkg/gateway/error.go @@ -0,0 +1,29 @@ +package gateway + +import ( + "context" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/segmentio/encoding/json" + "google.golang.org/grpc" +) + +type errorBody struct { + Err string `json:"error,omitempty"` +} + +// customErrorHandler implements custom grpc error handler +func customErrorHandler(ctx context.Context, _ *runtime.ServeMux, marshaler runtime.Marshaler, w http.ResponseWriter, _ *http.Request, err error) { + const fallback = `{"error": "failed to marshal error message"}` + + w.Header().Set("Content-type", marshaler.ContentType()) + w.WriteHeader(runtime.HTTPStatusFromCode(grpc.Code(err))) + jErr := json.NewEncoder(w).Encode(errorBody{ + Err: grpc.ErrorDesc(err), + }) + + if jErr != nil { + w.Write([]byte(fallback)) + } +} diff --git a/components/common/pkg/gateway/gateway.go b/components/common/pkg/gateway/gateway.go new file mode 100644 index 0000000..c2ea635 --- /dev/null +++ b/components/common/pkg/gateway/gateway.go @@ -0,0 +1,50 @@ +package gateway + +import ( + "context" + "errors" + "net/http" + + "google.golang.org/grpc" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" +) + +// ErrNoHandlers returned when not handlers are passed to gateway +var ErrNoHandlers = errors.New("no handlers defined") + +// HandlerFromEndpoint defines the function for registering grpc gateway handlers to grpc endpoint +type HandlerFromEndpoint func(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) + +// NewGateway returns new grpc gateway +func NewGateway(ctx context.Context, endpoint string, serveMuxOptions []runtime.ServeMuxOption, handlers ...HandlerFromEndpoint) (http.Handler, error) { + + rafayJSON := NewRafayJSON() + rafayYAML := NewRafayYAML() + httpBody := NewHTTPBodyMarshaler() + serveMuxOptions = append(serveMuxOptions, + runtime.WithMarshalerOption(runtime.MIMEWildcard, httpBody), + runtime.WithMarshalerOption(jsonContentType, rafayJSON), + runtime.WithMarshalerOption(yamlContentType, rafayYAML), + //runtime.WithProtoErrorHandler(customErrorHandler), + //runtime.WithIncomingHeaderMatcher(customHeaderMatcher), + runtime.WithMetadata(rafayGatewayAnnotator), + ) + + mux := runtime.NewServeMux(serveMuxOptions...) + + if len(handlers) < 1 { + return nil, ErrNoHandlers + } + + opts := []grpc.DialOption{grpc.WithInsecure()} + + for _, handler := range handlers { + err := handler(ctx, mux, endpoint, opts) + if err != nil { + return nil, err + } + } + + return mux, nil +} diff --git a/components/common/pkg/gateway/httpbody.go b/components/common/pkg/gateway/httpbody.go new file mode 100644 index 0000000..86df025 --- /dev/null +++ b/components/common/pkg/gateway/httpbody.go @@ -0,0 +1,44 @@ +package gateway + +import ( + common "github.com/RafaySystems/rcloud-base/components/common/proto/types/commonpb/v3" + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" +) + +// httpBodyMarshaler is a Marshaler which supports marshaling of a +// rafay.dev.common.types.v2.HttpBody message as the full response body if it is +// the actual message used as the response. If not, then this will +// simply fallback to the Marshaler specified as its default Marshaler. +type httpBodyMarshaler struct { + runtime.Marshaler +} + +// NewHTTPBodyMarshaler returns new http body marshaler +func NewHTTPBodyMarshaler() runtime.Marshaler { + return &httpBodyMarshaler{ + Marshaler: &rafayJSON{}, + } +} + +// ContentType implementation to keep backwards compatability with marshal interface +func (h *httpBodyMarshaler) ContentType(v interface{}) string { + return h.ContentTypeFromMessage(nil) +} + +// ContentTypeFromMessage in case v is a google.api.HttpBody message it returns +// its specified content type otherwise fall back to the default Marshaler. +func (h *httpBodyMarshaler) ContentTypeFromMessage(v interface{}) string { + if httpBody, ok := v.(*common.HttpBody); ok { + return httpBody.GetContentType() + } + return h.Marshaler.ContentType(v) +} + +// Marshal marshals "v" by returning the body bytes if v is a +// google.api.HttpBody message, otherwise it falls back to the default Marshaler. +func (h *httpBodyMarshaler) Marshal(v interface{}) ([]byte, error) { + if httpBody, ok := v.(*common.HttpBody); ok { + return httpBody.Data, nil + } + return h.Marshaler.Marshal(v) +} diff --git a/components/common/pkg/gateway/json.go b/components/common/pkg/gateway/json.go new file mode 100644 index 0000000..9c97097 --- /dev/null +++ b/components/common/pkg/gateway/json.go @@ -0,0 +1,49 @@ +package gateway + +import ( + "io" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/segmentio/encoding/json" +) + +const ( + jsonContentType string = "application/json" +) + +// rafayJSON is the rafay object to json marshaller +type rafayJSON struct { +} + +// NewRafayJSON returns new grpc gateway rafay json marshaller +func NewRafayJSON() runtime.Marshaler { + return &rafayJSON{} +} + +// Marshal marshals "v" into byte sequence. +func (m *rafayJSON) Marshal(v interface{}) ([]byte, error) { + + return json.Marshal(v) +} + +// Unmarshal unmarshals "data" into "v". +// "v" must be a pointer value. +func (m *rafayJSON) Unmarshal(b []byte, v interface{}) error { + return json.Unmarshal(b, v) +} + +// NewDecoder returns a Decoder which reads byte sequence from "r". +func (m *rafayJSON) NewDecoder(r io.Reader) runtime.Decoder { + return json.NewDecoder(r) +} + +// NewEncoder returns an Encoder which writes bytes sequence into "w". +func (m *rafayJSON) NewEncoder(w io.Writer) runtime.Encoder { + return json.NewEncoder(w) + +} + +// ContentType returns the Content-Type which this marshaler is responsible for. +func (m *rafayJSON) ContentType(v interface{}) string { + return jsonContentType +} diff --git a/components/common/pkg/gateway/json_test.go b/components/common/pkg/gateway/json_test.go new file mode 100644 index 0000000..e7bbe5e --- /dev/null +++ b/components/common/pkg/gateway/json_test.go @@ -0,0 +1,64 @@ +package gateway_test + +import ( + "bytes" + "testing" + "time" + + "github.com/RafaySystems/rcloud-base/components/common/pkg/gateway" + "github.com/RafaySystems/rcloud-base/components/common/pkg/gateway/testdata" +) + +func TestRafayJSONMarshaller(t *testing.T) { + m := gateway.NewRafayJSON() + + now := time.Now() + + t1 := testdata.TestYAML{ + Name: "test", + Time: &now, + Labels: map[string]string{"l1": "l2"}, + } + + yb, err := m.Marshal(&t1) + if err != nil { + t.Error(err) + return + } + + t.Log(string(yb)) + + var t2 testdata.TestYAML + + err = m.Unmarshal(yb, &t2) + if err != nil { + t.Error(err) + } + + t.Log(t2) + + bb1 := new(bytes.Buffer) + + bb1.Write(yb) + + dec := m.NewDecoder(bb1) + var t3 testdata.TestYAML + err = dec.Decode(&t3) + if err != nil { + t.Error(err) + return + } + t.Log(t2) + + bb2 := new(bytes.Buffer) + + enc := m.NewEncoder(bb2) + err = enc.Encode(&t1) + if err != nil { + t.Error(err) + return + } + + t.Log(bb2.String()) + +} diff --git a/components/common/pkg/gateway/testdata/gateway_test.go b/components/common/pkg/gateway/testdata/gateway_test.go new file mode 100644 index 0000000..374e807 --- /dev/null +++ b/components/common/pkg/gateway/testdata/gateway_test.go @@ -0,0 +1,100 @@ +package testdata + +import ( + "context" + "encoding/json" + "fmt" + "io/ioutil" + "net" + "net/http" + "testing" + + "github.com/RafaySystems/rcloud-base/components/common/pkg/gateway" + "github.com/RafaySystems/rcloud-base/components/common/pkg/grpc" + "github.com/grpc-ecosystem/grpc-gateway/runtime" +) + +type testServer struct { +} + +func (s *testServer) Get(ctx context.Context, o *TestObject) (*TestObject, error) { + fmt.Println(o) + return o, nil +} + +func runServer(stop <-chan struct{}) { + + go func() { + lr, err := net.Listen("tcp", ":9998") + if err != nil { + panic(err) + } + + s, err := grpc.NewServer() + if err != nil { + panic(err) + } + RegisterTestServer(s, &testServer{}) + + if err := s.Serve(lr); err != nil { + panic(err) + } + }() + + go func() { + mux := http.NewServeMux() + + gwHandler, err := gateway.NewGateway(context.TODO(), ":9998", make([]runtime.ServeMuxOption, 0), RegisterTestHandlerFromEndpoint) + + mux.Handle("/", gwHandler) + + hs := http.Server{ + Addr: ":9999", + Handler: mux, + } + + if err = hs.ListenAndServe(); err != nil { + panic(err) + } + }() + + <-stop + +} + +func TestGateway(t *testing.T) { + stop := make(chan struct{}) + + go runServer(stop) + + defer func() { + close(stop) + }() + + client := http.Client{} + resp, err := client.Get("http://localhost:9999/v2/test/project/rx8099/test/123") + if err != nil { + t.Error(err) + return + } + + b, err := ioutil.ReadAll(resp.Body) + if err != nil { + t.Error(err) + return + } + + var obj TestObject + + err = json.Unmarshal(b, &obj) + if err != nil { + t.Error(err) + return + } + + if obj.UrlScope != "project/rx8099" { + t.Error("expected project/rx8099, got", obj.UrlScope) + return + } + +} diff --git a/components/common/pkg/gateway/testdata/test.pb.go b/components/common/pkg/gateway/testdata/test.pb.go new file mode 100644 index 0000000..12b8c27 --- /dev/null +++ b/components/common/pkg/gateway/testdata/test.pb.go @@ -0,0 +1,464 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc (unknown) +// source: pkg/gateway/testdata/test.proto + +package testdata + +import ( + _ "github.com/gogo/protobuf/gogoproto" + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type TestYAML struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Time *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=time,proto3" json:"time,omitempty"` + Labels map[string]string `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *TestYAML) Reset() { + *x = TestYAML{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_gateway_testdata_test_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TestYAML) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TestYAML) ProtoMessage() {} + +func (x *TestYAML) ProtoReflect() protoreflect.Message { + mi := &file_pkg_gateway_testdata_test_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TestYAML.ProtoReflect.Descriptor instead. +func (*TestYAML) Descriptor() ([]byte, []int) { + return file_pkg_gateway_testdata_test_proto_rawDescGZIP(), []int{0} +} + +func (x *TestYAML) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *TestYAML) GetTime() *timestamppb.Timestamp { + if x != nil { + return x.Time + } + return nil +} + +func (x *TestYAML) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +type TestMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *TestMetadata) Reset() { + *x = TestMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_gateway_testdata_test_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TestMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TestMetadata) ProtoMessage() {} + +func (x *TestMetadata) ProtoReflect() protoreflect.Message { + mi := &file_pkg_gateway_testdata_test_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TestMetadata.ProtoReflect.Descriptor instead. +func (*TestMetadata) Descriptor() ([]byte, []int) { + return file_pkg_gateway_testdata_test_proto_rawDescGZIP(), []int{1} +} + +func (x *TestMetadata) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type TestObjectSpec struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *TestObjectSpec) Reset() { + *x = TestObjectSpec{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_gateway_testdata_test_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TestObjectSpec) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TestObjectSpec) ProtoMessage() {} + +func (x *TestObjectSpec) ProtoReflect() protoreflect.Message { + mi := &file_pkg_gateway_testdata_test_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TestObjectSpec.ProtoReflect.Descriptor instead. +func (*TestObjectSpec) Descriptor() ([]byte, []int) { + return file_pkg_gateway_testdata_test_proto_rawDescGZIP(), []int{2} +} + +type TestObjectStatus struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *TestObjectStatus) Reset() { + *x = TestObjectStatus{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_gateway_testdata_test_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TestObjectStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TestObjectStatus) ProtoMessage() {} + +func (x *TestObjectStatus) ProtoReflect() protoreflect.Message { + mi := &file_pkg_gateway_testdata_test_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TestObjectStatus.ProtoReflect.Descriptor instead. +func (*TestObjectStatus) Descriptor() ([]byte, []int) { + return file_pkg_gateway_testdata_test_proto_rawDescGZIP(), []int{3} +} + +type TestObject struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Metadata *TestMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + Spec *TestObjectSpec `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec,omitempty"` + Status *TestObjectStatus `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` +} + +func (x *TestObject) Reset() { + *x = TestObject{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_gateway_testdata_test_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TestObject) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TestObject) ProtoMessage() {} + +func (x *TestObject) ProtoReflect() protoreflect.Message { + mi := &file_pkg_gateway_testdata_test_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TestObject.ProtoReflect.Descriptor instead. +func (*TestObject) Descriptor() ([]byte, []int) { + return file_pkg_gateway_testdata_test_proto_rawDescGZIP(), []int{4} +} + +func (x *TestObject) GetMetadata() *TestMetadata { + if x != nil { + return x.Metadata + } + return nil +} + +func (x *TestObject) GetSpec() *TestObjectSpec { + if x != nil { + return x.Spec + } + return nil +} + +func (x *TestObject) GetStatus() *TestObjectStatus { + if x != nil { + return x.Status + } + return nil +} + +var File_pkg_gateway_testdata_test_proto protoreflect.FileDescriptor + +var file_pkg_gateway_testdata_test_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2f, 0x74, 0x65, + 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x08, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, + 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0xcc, 0x01, 0x0a, 0x08, 0x54, 0x65, 0x73, 0x74, 0x59, 0x41, 0x4d, 0x4c, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x39, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x09, 0x92, 0x41, 0x02, + 0x40, 0x01, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x06, + 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, + 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x59, 0x41, 0x4d, 0x4c, + 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, + 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, + 0x22, 0x0a, 0x0c, 0x54, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x22, 0x10, 0x0a, 0x0e, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x53, 0x70, 0x65, 0x63, 0x22, 0x12, 0x0a, 0x10, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xcb, 0x01, 0x0a, 0x0a, 0x54, 0x65, + 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x47, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x74, 0x65, 0x73, + 0x74, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x42, 0x13, 0xc8, 0xde, 0x1f, 0x00, 0xd0, 0xde, 0x1f, 0x01, 0xea, 0xde, 0x1f, 0x07, + 0x2c, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x12, 0x36, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x18, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0xd0, + 0xde, 0x1f, 0x01, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x3c, 0x0a, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x74, 0x65, 0x73, 0x74, + 0x64, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0xd0, 0xde, 0x1f, 0x01, 0x52, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x32, 0x70, 0x0a, 0x04, 0x54, 0x65, 0x73, 0x74, 0x12, + 0x68, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x14, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, + 0x61, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x1a, 0x14, 0x2e, 0x74, + 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x22, 0x35, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x12, 0x2d, 0x2f, 0x76, 0x33, 0x2f, + 0x74, 0x65, 0x73, 0x74, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6e, + 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x42, 0xae, 0x01, 0x0a, 0x0c, 0x63, 0x6f, + 0x6d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x42, 0x09, 0x54, 0x65, 0x73, 0x74, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x52, 0x61, 0x66, 0x61, 0x79, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x73, + 0x2f, 0x72, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2f, + 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, + 0x08, 0x54, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0xca, 0x02, 0x08, 0x54, 0x65, 0x73, 0x74, + 0x64, 0x61, 0x74, 0x61, 0xe2, 0x02, 0x14, 0x54, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x08, 0x54, 0x65, + 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0xc8, 0xe2, 0x1e, 0x01, 0xd0, 0xe2, 0x1e, 0x01, 0xe0, 0xe2, + 0x1e, 0x01, 0xc0, 0xe3, 0x1e, 0x01, 0xc8, 0xe3, 0x1e, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_pkg_gateway_testdata_test_proto_rawDescOnce sync.Once + file_pkg_gateway_testdata_test_proto_rawDescData = file_pkg_gateway_testdata_test_proto_rawDesc +) + +func file_pkg_gateway_testdata_test_proto_rawDescGZIP() []byte { + file_pkg_gateway_testdata_test_proto_rawDescOnce.Do(func() { + file_pkg_gateway_testdata_test_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_gateway_testdata_test_proto_rawDescData) + }) + return file_pkg_gateway_testdata_test_proto_rawDescData +} + +var file_pkg_gateway_testdata_test_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_pkg_gateway_testdata_test_proto_goTypes = []interface{}{ + (*TestYAML)(nil), // 0: testdata.TestYAML + (*TestMetadata)(nil), // 1: testdata.TestMetadata + (*TestObjectSpec)(nil), // 2: testdata.TestObjectSpec + (*TestObjectStatus)(nil), // 3: testdata.TestObjectStatus + (*TestObject)(nil), // 4: testdata.TestObject + nil, // 5: testdata.TestYAML.LabelsEntry + (*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp +} +var file_pkg_gateway_testdata_test_proto_depIdxs = []int32{ + 6, // 0: testdata.TestYAML.time:type_name -> google.protobuf.Timestamp + 5, // 1: testdata.TestYAML.labels:type_name -> testdata.TestYAML.LabelsEntry + 1, // 2: testdata.TestObject.metadata:type_name -> testdata.TestMetadata + 2, // 3: testdata.TestObject.spec:type_name -> testdata.TestObjectSpec + 3, // 4: testdata.TestObject.status:type_name -> testdata.TestObjectStatus + 4, // 5: testdata.Test.Get:input_type -> testdata.TestObject + 4, // 6: testdata.Test.Get:output_type -> testdata.TestObject + 6, // [6:7] is the sub-list for method output_type + 5, // [5:6] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_pkg_gateway_testdata_test_proto_init() } +func file_pkg_gateway_testdata_test_proto_init() { + if File_pkg_gateway_testdata_test_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_pkg_gateway_testdata_test_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TestYAML); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_gateway_testdata_test_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TestMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_gateway_testdata_test_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TestObjectSpec); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_gateway_testdata_test_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TestObjectStatus); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_gateway_testdata_test_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TestObject); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_pkg_gateway_testdata_test_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_pkg_gateway_testdata_test_proto_goTypes, + DependencyIndexes: file_pkg_gateway_testdata_test_proto_depIdxs, + MessageInfos: file_pkg_gateway_testdata_test_proto_msgTypes, + }.Build() + File_pkg_gateway_testdata_test_proto = out.File + file_pkg_gateway_testdata_test_proto_rawDesc = nil + file_pkg_gateway_testdata_test_proto_goTypes = nil + file_pkg_gateway_testdata_test_proto_depIdxs = nil +} diff --git a/components/common/pkg/gateway/testdata/test.pb.gw.go b/components/common/pkg/gateway/testdata/test.pb.gw.go new file mode 100644 index 0000000..2adf1bb --- /dev/null +++ b/components/common/pkg/gateway/testdata/test.pb.gw.go @@ -0,0 +1,223 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: pkg/gateway/testdata/test.proto + +/* +Package testdata is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package testdata + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +var ( + filter_Test_Get_0 = &utilities.DoubleArray{Encoding: map[string]int{"metadata": 0, "name": 1}, Base: []int{1, 3, 1, 0, 3, 0}, Check: []int{0, 1, 2, 3, 2, 5}} +) + +func request_Test_Get_0(ctx context.Context, marshaler runtime.Marshaler, client TestClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq TestObject + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.name") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.name", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.name", err) + } + + val, ok = pathParams["metadata.name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.name") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.name", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.name", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Test_Get_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Get(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Test_Get_0(ctx context.Context, marshaler runtime.Marshaler, server TestServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq TestObject + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["metadata.name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.name") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.name", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.name", err) + } + + val, ok = pathParams["metadata.name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "metadata.name") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "metadata.name", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "metadata.name", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Test_Get_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Get(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterTestHandlerServer registers the http handlers for service Test to "mux". +// UnaryRPC :call TestServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterTestHandlerFromEndpoint instead. +func RegisterTestHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TestServer) error { + + mux.Handle("GET", pattern_Test_Get_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/testdata.Test/Get", runtime.WithHTTPPathPattern("/v3/test/{metadata.name}/test/{metadata.name}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Test_Get_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Test_Get_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterTestHandlerFromEndpoint is same as RegisterTestHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterTestHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterTestHandler(ctx, mux, conn) +} + +// RegisterTestHandler registers the http handlers for service Test to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterTestHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterTestHandlerClient(ctx, mux, NewTestClient(conn)) +} + +// RegisterTestHandlerClient registers the http handlers for service Test +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TestClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TestClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "TestClient" to call the correct interceptors. +func RegisterTestHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TestClient) error { + + mux.Handle("GET", pattern_Test_Get_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/testdata.Test/Get", runtime.WithHTTPPathPattern("/v3/test/{metadata.name}/test/{metadata.name}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Test_Get_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Test_Get_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Test_Get_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v3", "test", "metadata.name"}, "")) +) + +var ( + forward_Test_Get_0 = runtime.ForwardResponseMessage +) diff --git a/components/common/pkg/gateway/testdata/test.proto b/components/common/pkg/gateway/testdata/test.proto new file mode 100644 index 0000000..2f8834a --- /dev/null +++ b/components/common/pkg/gateway/testdata/test.proto @@ -0,0 +1,58 @@ +syntax = "proto3"; + +package testdata; + +import "google/api/annotations.proto"; +import "gogoproto/gogo.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; +import "google/protobuf/timestamp.proto"; + +// Enable custom Marshal method. +option (gogoproto.marshaler_all) = true; +// Enable custom Unmarshal method. +option (gogoproto.unmarshaler_all) = true; +// Enable custom Size method (Required by Marshal and Unmarshal). +option (gogoproto.sizer_all) = true; +// Enable registration with golang/protobuf for the grpc-gateway. +option (gogoproto.goproto_registration) = true; +// Enable generation of XXX_MessageName methods for grpc-go/status. +option (gogoproto.messagename_all) = true; + +message TestYAML { + string name = 1; + google.protobuf.Timestamp time = 2 [ + (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + read_only : true + }, + (gogoproto.stdtime) = true + ]; + map labels = 3; +} + +message TestMetadata { + string name = 1; +} + +message TestObjectSpec {} + +message TestObjectStatus {} + +message TestObject { + TestMetadata metadata = 1 [ + (gogoproto.embed) = true, + (gogoproto.nullable) = false, + (gogoproto.jsontag) = ",inline" + ]; + TestObjectSpec spec = 2 + [ (gogoproto.nullable) = false, (gogoproto.embed) = true ]; + TestObjectStatus status = 3 + [ (gogoproto.nullable) = false, (gogoproto.embed) = true ]; +} + +service Test { + rpc Get(TestObject) returns (TestObject) { + option (google.api.http) = { + get : "/v3/test/{metadata.name}/test/{metadata.name}" + }; + } +} \ No newline at end of file diff --git a/components/common/pkg/gateway/testdata/test_grpc.pb.go b/components/common/pkg/gateway/testdata/test_grpc.pb.go new file mode 100644 index 0000000..6ab7474 --- /dev/null +++ b/components/common/pkg/gateway/testdata/test_grpc.pb.go @@ -0,0 +1,103 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc (unknown) +// source: pkg/gateway/testdata/test.proto + +package testdata + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// TestClient is the client API for Test service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type TestClient interface { + Get(ctx context.Context, in *TestObject, opts ...grpc.CallOption) (*TestObject, error) +} + +type testClient struct { + cc grpc.ClientConnInterface +} + +func NewTestClient(cc grpc.ClientConnInterface) TestClient { + return &testClient{cc} +} + +func (c *testClient) Get(ctx context.Context, in *TestObject, opts ...grpc.CallOption) (*TestObject, error) { + out := new(TestObject) + err := c.cc.Invoke(ctx, "/testdata.Test/Get", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// TestServer is the server API for Test service. +// All implementations should embed UnimplementedTestServer +// for forward compatibility +type TestServer interface { + Get(context.Context, *TestObject) (*TestObject, error) +} + +// UnimplementedTestServer should be embedded to have forward compatible implementations. +type UnimplementedTestServer struct { +} + +func (UnimplementedTestServer) Get(context.Context, *TestObject) (*TestObject, error) { + return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") +} + +// UnsafeTestServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to TestServer will +// result in compilation errors. +type UnsafeTestServer interface { + mustEmbedUnimplementedTestServer() +} + +func RegisterTestServer(s grpc.ServiceRegistrar, srv TestServer) { + s.RegisterService(&Test_ServiceDesc, srv) +} + +func _Test_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TestObject) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TestServer).Get(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/testdata.Test/Get", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TestServer).Get(ctx, req.(*TestObject)) + } + return interceptor(ctx, in, info, handler) +} + +// Test_ServiceDesc is the grpc.ServiceDesc for Test service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Test_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "testdata.Test", + HandlerType: (*TestServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Get", + Handler: _Test_Get_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "pkg/gateway/testdata/test.proto", +} diff --git a/components/common/pkg/gateway/yaml.go b/components/common/pkg/gateway/yaml.go new file mode 100644 index 0000000..c828249 --- /dev/null +++ b/components/common/pkg/gateway/yaml.go @@ -0,0 +1,78 @@ +package gateway + +import ( + "io" + "io/ioutil" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/segmentio/encoding/json" + "sigs.k8s.io/yaml" +) + +const ( + yamlContentType string = "application/yaml" +) + +// rafayJSON is the rafay object to YAML marshaller +type rafayYAML struct { +} + +// NewRafayYAML returns new grpc gateway yaml marshaller +func NewRafayYAML() runtime.Marshaler { + return &rafayYAML{} +} + +// Marshal marshals "v" into byte sequence. +func (m *rafayYAML) Marshal(v interface{}) ([]byte, error) { + b, err := json.Marshal(v) + if err != nil { + return nil, err + } + + yb, err := yaml.JSONToYAML(b) + if err != nil { + return nil, err + } + + return yb, nil +} + +// Unmarshal unmarshals "data" into "v". +// "v" must be a pointer value. +func (m *rafayYAML) Unmarshal(yb []byte, v interface{}) error { + jb, err := yaml.YAMLToJSON(yb) + if err != nil { + return err + } + err = json.Unmarshal(jb, v) + return err +} + +// NewDecoder returns a Decoder which reads byte sequence from "r". +func (m *rafayYAML) NewDecoder(r io.Reader) runtime.Decoder { + return runtime.DecoderFunc(func(v interface{}) error { + yb, err := ioutil.ReadAll(r) + if err != nil { + return err + } + return m.Unmarshal(yb, v) + }) +} + +// NewEncoder returns an Encoder which writes bytes sequence into "w". +func (m *rafayYAML) NewEncoder(w io.Writer) runtime.Encoder { + return runtime.EncoderFunc(func(v interface{}) error { + yb, err := m.Marshal(v) + if err != nil { + return err + } + _, err = w.Write(yb) + + return err + }) +} + +// ContentType returns the Content-Type which this marshaler is responsible for. +func (m *rafayYAML) ContentType(v interface{}) string { + return yamlContentType +} diff --git a/components/common/pkg/gateway/yaml_test.go b/components/common/pkg/gateway/yaml_test.go new file mode 100644 index 0000000..13d4fb1 --- /dev/null +++ b/components/common/pkg/gateway/yaml_test.go @@ -0,0 +1,64 @@ +package gateway_test + +import ( + "bytes" + "testing" + "time" + + "github.com/RafaySystems/rcloud-base/components/common/pkg/gateway" + "github.com/RafaySystems/rcloud-base/components/common/pkg/gateway/testdata" +) + +func TestYamlMarshaller(t *testing.T) { + m := gateway.NewRafayYAML() + + now := time.Now() + + t1 := testdata.TestYAML{ + Name: "test", + Time: &now, + Labels: map[string]string{"l1": "l2"}, + } + + yb, err := m.Marshal(&t1) + if err != nil { + t.Error(err) + return + } + + t.Log(string(yb)) + + var t2 testdata.TestYAML + + err = m.Unmarshal(yb, &t2) + if err != nil { + t.Error(err) + } + + t.Log(t2) + + bb1 := new(bytes.Buffer) + + bb1.Write(yb) + + dec := m.NewDecoder(bb1) + var t3 testdata.TestYAML + err = dec.Decode(&t3) + if err != nil { + t.Error(err) + return + } + t.Log(t2) + + bb2 := new(bytes.Buffer) + + enc := m.NewEncoder(bb2) + err = enc.Encode(&t1) + if err != nil { + t.Error(err) + return + } + + t.Log(bb2.String()) + +} diff --git a/components/common/pkg/grpc/client.go b/components/common/pkg/grpc/client.go new file mode 100644 index 0000000..b841365 --- /dev/null +++ b/components/common/pkg/grpc/client.go @@ -0,0 +1,89 @@ +package grpc + +import ( + "context" + "crypto/tls" + "crypto/x509" + "net" + "time" + + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/keepalive" +) + +var ( + clientDefaultOpts = []grpc.DialOption{ + grpc.WithBlock(), + grpc.WithKeepaliveParams(keepalive.ClientParameters{ + Time: time.Second * 30, + Timeout: time.Second * 30, + PermitWithoutStream: true, + }), + } +) + +// NewSecureClientConn returns new grpc client connection given server host, server port and transport credentials +func NewSecureClientConn(ctx context.Context, addr string, creds credentials.TransportCredentials, opts ...grpc.DialOption) (*grpc.ClientConn, error) { + nctx, cancel := context.WithTimeout(ctx, time.Second*30) + defer cancel() + + opts = append(opts, clientDefaultOpts...) + opts = append([]grpc.DialOption{grpc.WithTransportCredentials(creds)}, opts...) + + return grpc.DialContext(nctx, addr, opts...) +} + +// NewClientConn returns new grpc client connection given server host and server port +func NewClientConn(ctx context.Context, addr string, opts ...grpc.DialOption) (*grpc.ClientConn, error) { + nctx, cancel := context.WithTimeout(ctx, time.Second*30) + defer cancel() + + opts = append(opts, clientDefaultOpts...) + opts = append([]grpc.DialOption{grpc.WithInsecure()}, opts...) + + return grpc.DialContext(nctx, addr, opts...) +} + +func newClientTLSConfig(certPEM []byte, keyPEM []byte, caCertPEM []byte, addr string) (*tls.Config, error) { + cert, err := tls.X509KeyPair(certPEM, keyPEM) + if err != nil { + return nil, err + } + + var roots *x509.CertPool + if len(caCertPEM) > 0 { + roots = x509.NewCertPool() + if ok := roots.AppendCertsFromPEM(caCertPEM); !ok { + return nil, err + } + } + + host, _, err := net.SplitHostPort(addr) + if err != nil { + return nil, err + } + + return &tls.Config{ + ServerName: host, + Certificates: []tls.Certificate{cert}, + InsecureSkipVerify: roots == nil, + RootCAs: roots, + SessionTicketsDisabled: true, + MinVersion: tls.VersionTLS12, + CipherSuites: []uint16{ + tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, + tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256}, + PreferServerCipherSuites: true, + }, nil +} + +// NewClientTransportCredentials returns grpc client transport credentials +func NewClientTransportCredentials(cert, key, caCert []byte, addr string) (credentials.TransportCredentials, error) { + tlsConfig, err := newClientTLSConfig(cert, key, caCert, addr) + if err != nil { + return nil, err + } + + return credentials.NewTLS(tlsConfig), nil +} diff --git a/components/common/pkg/grpc/server.go b/components/common/pkg/grpc/server.go new file mode 100644 index 0000000..ed0e7c3 --- /dev/null +++ b/components/common/pkg/grpc/server.go @@ -0,0 +1,113 @@ +package grpc + +import ( + "context" + "crypto/tls" + "crypto/x509" + "errors" + "fmt" + "io/ioutil" + "strings" + "time" + + "google.golang.org/grpc/peer" + + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/keepalive" +) + +var ( + serverDefaultOpts = []grpc.ServerOption{ + grpc.KeepaliveParams(keepalive.ServerParameters{ + Time: time.Second * 30, // server initiated keep alive interval + Timeout: time.Second * 30, // server initiated keep alive timeout + }), + grpc.KeepaliveEnforcementPolicy(keepalive.EnforcementPolicy{ + MinTime: time.Minute, // server enforcement for client keep alive + PermitWithoutStream: true, // allow connection without any active ongoing streams + }), + } + + // ErrInvalidClient is returned when client cert is not present in peer context + ErrInvalidClient = errors.New("client has not presented certificate") +) + +// NewSecureServerWithPEM creates a secure gRPC service with give PEM encoded cert, key and ca +func NewSecureServerWithPEM(cert, key, ca []byte, opts ...grpc.ServerOption) (*grpc.Server, error) { + certificate, err := tls.X509KeyPair(cert, key) + if err != nil { + return nil, fmt.Errorf("invalid cert/key pair: %s", err) + } + certPool := x509.NewCertPool() + if ok := certPool.AppendCertsFromPEM(ca); !ok { + return nil, fmt.Errorf("failed to append ca cert") + } + creds := credentials.NewTLS(&tls.Config{ + ClientAuth: tls.RequireAndVerifyClientCert, + Certificates: []tls.Certificate{certificate}, + ClientCAs: certPool, + }) + opts = append(opts, serverDefaultOpts...) + opts = append([]grpc.ServerOption{grpc.Creds(creds)}, opts...) + + return grpc.NewServer(opts...), nil +} + +// NewSecureServer returns new grpc server given cert path, key path and ca path +func NewSecureServer(certPath, keyPath, caPath string, opts ...grpc.ServerOption) (*grpc.Server, error) { + certificate, err := tls.LoadX509KeyPair(certPath, keyPath) + if err != nil { + return nil, fmt.Errorf("unable to load cert/key : %s", err) + } + certPool := x509.NewCertPool() + ca, err := ioutil.ReadFile(caPath) + if err != nil { + return nil, fmt.Errorf("unable to read ca cert: %s", err) + } + if ok := certPool.AppendCertsFromPEM(ca); !ok { + return nil, fmt.Errorf("failed to append ca cert %s", "") + } + + creds := credentials.NewTLS(&tls.Config{ + ClientAuth: tls.RequireAndVerifyClientCert, + Certificates: []tls.Certificate{certificate}, + ClientCAs: certPool, + }) + + opts = append(opts, serverDefaultOpts...) + opts = append([]grpc.ServerOption{grpc.Creds(creds)}, opts...) + + return grpc.NewServer(opts...), nil +} + +// NewServer returns new unsecured grpc server +func NewServer(opts ...grpc.ServerOption) (*grpc.Server, error) { + opts = append(opts, serverDefaultOpts...) + return grpc.NewServer(opts...), nil +} + +// GetClientName returns client CommonName from client cert +func GetClientName(ctx context.Context) (string, error) { + if p, ok := peer.FromContext(ctx); ok { + tlsInfo := p.AuthInfo.(credentials.TLSInfo) + for _, c := range tlsInfo.State.PeerCertificates { + return c.Subject.CommonName, nil + } + } + return "", ErrInvalidClient + +} + +// GetClientOU returns client Organization Unit from client cert +func GetClientOU(ctx context.Context) (string, error) { + if p, ok := peer.FromContext(ctx); ok { + tlsInfo := p.AuthInfo.(credentials.TLSInfo) + for _, c := range tlsInfo.State.PeerCertificates { + if len(c.Subject.OrganizationalUnit) > 0 { + return strings.Join(c.Subject.OrganizationalUnit, "-"), nil + } + } + } + return "", ErrInvalidClient +} diff --git a/components/common/pkg/hashid/hashid.go b/components/common/pkg/hashid/hashid.go new file mode 100644 index 0000000..7f4b8aa --- /dev/null +++ b/components/common/pkg/hashid/hashid.go @@ -0,0 +1,39 @@ +package hashid + +import ( + "fmt" + + "github.com/speps/go-hashids" +) + +var hd *hashids.HashID + +func init() { + hd, _ = hashids.NewWithData(&hashids.HashIDData{ + Alphabet: "abcdefghijklmnopqrstuvwxyz1234567890", + Salt: "***REMOVED***", + MinLength: 7, + }) +} + +// IDFromString returns new RafayID for hash id string +func IDFromString(hashID string) (int64, error) { + ids, err := hd.DecodeInt64WithError(hashID) + if err != nil { + return -1, err + } + + if len(ids) < 1 { + return -1, fmt.Errorf("No IDs could be constructed from string %s", hashID) + } + return ids[0], nil +} + +// HashFromInt64 returns new RafayID for hash id string +func HashFromInt64(id int64) (string, error) { + stringHash, err := hd.EncodeInt64([]int64{id}) + if err != nil { + return "", err + } + return stringHash, nil +} diff --git a/components/common/pkg/hashid/test/hashid_test.go b/components/common/pkg/hashid/test/hashid_test.go new file mode 100644 index 0000000..17e9221 --- /dev/null +++ b/components/common/pkg/hashid/test/hashid_test.go @@ -0,0 +1,21 @@ +package hashid_test + +import ( + "fmt" + "testing" + + "github.com/RafaySystems/rcloud-base/components/common/pkg/hashid" +) + +func TestGetRSID(t *testing.T) { + s, e := hashid.HashFromInt64(1) + if e != nil || s != "rx28oml" { + t.Fatalf("failure") + } + s, e = hashid.HashFromInt64(140) + if e != nil || s != "pkvwv2n" { + t.Fatalf("failure") + } + i, _ := hashid.IDFromString("kgxw87m") + fmt.Printf("%d\n", i) +} diff --git a/components/common/pkg/log/v2/log.go b/components/common/pkg/log/v2/log.go new file mode 100644 index 0000000..67792b5 --- /dev/null +++ b/components/common/pkg/log/v2/log.go @@ -0,0 +1,98 @@ +package log + +import ( + "sync" + + "go.uber.org/zap" + "go.uber.org/zap/zapcore" +) + +// Level is the level of logging for logger +type level string + +// LogLevel constants +const ( + Debug level = "debug" + Info level = "info" + Warn level = "warn" + Error level = "error" +) + +func newConfig(l level) zap.Config { + var zl zapcore.Level + switch l { + case Debug: + zl = zap.DebugLevel + case Warn: + zl = zap.WarnLevel + case Info: + zl = zap.InfoLevel + case Error: + zl = zap.ErrorLevel + default: + zl = zap.InfoLevel + } + + return zap.Config{ + Level: zap.NewAtomicLevelAt(zl), + Encoding: "json", + EncoderConfig: zapcore.EncoderConfig{ + TimeKey: "ts", + LevelKey: "level", + NameKey: "logger", + MessageKey: "msg", + StacktraceKey: "stacktrace", + CallerKey: "caller", + LineEnding: zapcore.DefaultLineEnding, + EncodeLevel: zapcore.LowercaseLevelEncoder, + EncodeTime: zapcore.ISO8601TimeEncoder, + EncodeDuration: zapcore.SecondsDurationEncoder, + EncodeCaller: zapcore.ShortCallerEncoder, + }, + OutputPaths: []string{"stdout"}, + ErrorOutputPaths: []string{"stdout"}, + } +} + +// Logger is a wrapper around zap sugared logger +type Logger struct { + *zap.SugaredLogger +} + +// ChangeLevel changes the log level of logger +func (lg *Logger) ChangeLevel(lc <-chan string) { + for { + select { + case lvl := <-lc: + l := level(lvl) + cfg := newConfig(l) + zl, err := cfg.Build() + if err != nil { + panic(err) + } + + lg.SugaredLogger = zl.Sugar() + } + } +} + +var zl *Logger +var lo sync.Once + +// GetLogger return instance of logger +func GetLogger() *Logger { + if zl == nil { + lo.Do(func() { + cfg := newConfig(Info) + z, err := cfg.Build() + if err != nil { + panic(err) + } + zl = &Logger{ + SugaredLogger: z.Sugar(), + } + + }) + } + return zl +} diff --git a/components/common/pkg/log/v2/log_test.go b/components/common/pkg/log/v2/log_test.go new file mode 100644 index 0000000..85d5f4d --- /dev/null +++ b/components/common/pkg/log/v2/log_test.go @@ -0,0 +1,23 @@ +package log + +import ( + "testing" + "time" +) + +func TestLogger(t *testing.T) { + log := GetLogger() + + lc := make(chan string) + + go log.ChangeLevel(lc) + + log.Infow("test ingo", "key", "value") + log.Debugw("test debug", "key", "value") + log.Warn("changing to debug") + lc <- "debug" + time.Sleep(time.Second) + log.Infow("test ingo", "key", "value") + log.Debugw("test debug", "key", "value") + +} diff --git a/components/common/pkg/pool/pool.go b/components/common/pkg/pool/pool.go new file mode 100644 index 0000000..03744db --- /dev/null +++ b/components/common/pkg/pool/pool.go @@ -0,0 +1,109 @@ +package pool + +import ( + "context" + "sync" + "time" + + grpcpool "github.com/processout/grpc-go-pool" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/keepalive" +) + +// grpc pool constants +const ( + DefaultMaxPoolConn = 20 +) + +// GRPCPool holds all the shared state for GRPC pool +type GRPCPool struct { + capacity int + creds credentials.TransportCredentials + addr string + *grpcpool.Pool + m sync.Mutex +} + +// NewGRPCPool returns new auth pool +func NewGRPCPool(addr string, maxConnections int, creds credentials.TransportCredentials) *GRPCPool { + // as per https://rafaysystems.atlassian.net/browse/RC-9291 min number of connections for grpc + // across all services is set to 20; any service creating a connection pool size < 20 is now defaulted to 20 + if maxConnections < DefaultMaxPoolConn { + maxConnections = DefaultMaxPoolConn + } + return &GRPCPool{addr: addr, capacity: maxConnections, creds: creds} +} + +// GetConnection returns new connection from grpc pool +func (gp *GRPCPool) GetConnection(ctx context.Context) (*grpcpool.ClientConn, error) { + nCtx, cancel := context.WithTimeout(ctx, time.Second*10) + defer cancel() + + if gp.Pool == nil { + gp.m.Lock() + defer gp.m.Unlock() + + var pool *grpcpool.Pool + var err error + if gp.creds == nil { + pool, err = newPool(gp.addr, gp.capacity) + } else { + pool, err = newSecurePool(gp.addr, gp.capacity, gp.creds) + } + if err != nil { + return nil, err + } + + gp.Pool = pool + } + cc, err := gp.Pool.Get(nCtx) + if err != nil { + return nil, err + } + return cc, nil +} + +// newPool returns new grpc connection pool for given host port and capacity +func newPool(target string, capacity int) (*grpcpool.Pool, error) { + pool, err := grpcpool.New(func() (*grpc.ClientConn, error) { + ctx, cancel := context.WithTimeout(context.Background(), time.Second*30) + defer cancel() + cc, err := grpc.DialContext( + ctx, + target, + grpc.WithInsecure(), + grpc.WithBlock(), + grpc.WithKeepaliveParams(keepalive.ClientParameters{ + Time: time.Second * 30, + Timeout: time.Second * 30, + PermitWithoutStream: true, + }), + ) + return cc, err + }, 1, capacity, time.Second*60) + return pool, err +} + +// newSecurePool returns new grpc connection pool for given host port and credentials +func newSecurePool(target string, capacity int, creds credentials.TransportCredentials) (*grpcpool.Pool, error) { + pool, err := grpcpool.New(func() (*grpc.ClientConn, error) { + ctx, cancel := context.WithTimeout(context.Background(), time.Second*30) + defer cancel() + cc, err := grpc.DialContext( + ctx, + target, + grpc.WithTransportCredentials(creds), + grpc.WithBlock(), + grpc.WithKeepaliveParams(keepalive.ClientParameters{ + Time: time.Second * 30, + Timeout: time.Second * 30, + PermitWithoutStream: true, + }), + ) + + return cc, err + }, 1, capacity, time.Second*60) + return pool, err + +} diff --git a/components/common/proto/rpc/config/internal.go b/components/common/proto/rpc/config/internal.go new file mode 100644 index 0000000..b06129b --- /dev/null +++ b/components/common/proto/rpc/config/internal.go @@ -0,0 +1,54 @@ +package config + +import ( + "context" + + "github.com/RafaySystems/rcloud-base/components/common/pkg/pool" + grpcpool "github.com/processout/grpc-go-pool" +) + +// ConfigClient is the interface which exposes all the RPCs +// to internal service +type ConfigClient interface { + Unhealthy() + Close() error +} + +type configClient struct { + *grpcpool.ClientConn +} + +var _ ConfigClient = (*configClient)(nil) + +// ConfigPool maintains pool of grpc connections to config service +type ConfigPool interface { + Close() + NewClient(ctx context.Context) (ConfigClient, error) +} + +// NewConfigPool new config pool +func NewConfigPool(addr string, maxConn int) ConfigPool { + return &configPool{ + GRPCPool: pool.NewGRPCPool(addr, maxConn, nil), + } +} + +type configPool struct { + *pool.GRPCPool +} + +func (p *configPool) Close() { + if p.GRPCPool != nil { + p.GRPCPool.Close() + } +} + +func (p *configPool) NewClient(ctx context.Context) (ConfigClient, error) { + cc, err := p.GetConnection(ctx) + if err != nil { + return nil, err + } + return &configClient{ + cc, + }, nil +} diff --git a/components/common/proto/types/commonpb/v3/artifacts.pb.go b/components/common/proto/types/commonpb/v3/artifacts.pb.go new file mode 100644 index 0000000..f9131ec --- /dev/null +++ b/components/common/proto/types/commonpb/v3/artifacts.pb.go @@ -0,0 +1,1503 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc (unknown) +// source: proto/types/commonpb/v3/artifacts.proto + +package commonv3 + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type File struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *File) Reset() { + *x = File{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_types_commonpb_v3_artifacts_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *File) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*File) ProtoMessage() {} + +func (x *File) ProtoReflect() protoreflect.Message { + mi := &file_proto_types_commonpb_v3_artifacts_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use File.ProtoReflect.Descriptor instead. +func (*File) Descriptor() ([]byte, []int) { + return file_proto_types_commonpb_v3_artifacts_proto_rawDescGZIP(), []int{0} +} + +func (x *File) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *File) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +type UploadedYAMLArtifact struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Paths []*File `protobuf:"bytes,1,rep,name=paths,proto3" json:"paths,omitempty"` +} + +func (x *UploadedYAMLArtifact) Reset() { + *x = UploadedYAMLArtifact{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_types_commonpb_v3_artifacts_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UploadedYAMLArtifact) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UploadedYAMLArtifact) ProtoMessage() {} + +func (x *UploadedYAMLArtifact) ProtoReflect() protoreflect.Message { + mi := &file_proto_types_commonpb_v3_artifacts_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UploadedYAMLArtifact.ProtoReflect.Descriptor instead. +func (*UploadedYAMLArtifact) Descriptor() ([]byte, []int) { + return file_proto_types_commonpb_v3_artifacts_proto_rawDescGZIP(), []int{1} +} + +func (x *UploadedYAMLArtifact) GetPaths() []*File { + if x != nil { + return x.Paths + } + return nil +} + +type UploadedHelmArtifact struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ChartPath *File `protobuf:"bytes,1,opt,name=chartPath,proto3" json:"chartPath,omitempty"` + ValuesPaths []*File `protobuf:"bytes,2,rep,name=valuesPaths,proto3" json:"valuesPaths,omitempty"` +} + +func (x *UploadedHelmArtifact) Reset() { + *x = UploadedHelmArtifact{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_types_commonpb_v3_artifacts_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UploadedHelmArtifact) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UploadedHelmArtifact) ProtoMessage() {} + +func (x *UploadedHelmArtifact) ProtoReflect() protoreflect.Message { + mi := &file_proto_types_commonpb_v3_artifacts_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UploadedHelmArtifact.ProtoReflect.Descriptor instead. +func (*UploadedHelmArtifact) Descriptor() ([]byte, []int) { + return file_proto_types_commonpb_v3_artifacts_proto_rawDescGZIP(), []int{2} +} + +func (x *UploadedHelmArtifact) GetChartPath() *File { + if x != nil { + return x.ChartPath + } + return nil +} + +func (x *UploadedHelmArtifact) GetValuesPaths() []*File { + if x != nil { + return x.ValuesPaths + } + return nil +} + +type YAMLInGitRepo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Repository string `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` + Revision string `protobuf:"bytes,2,opt,name=revision,proto3" json:"revision,omitempty"` + Paths []*File `protobuf:"bytes,3,rep,name=paths,proto3" json:"paths,omitempty"` +} + +func (x *YAMLInGitRepo) Reset() { + *x = YAMLInGitRepo{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_types_commonpb_v3_artifacts_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *YAMLInGitRepo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*YAMLInGitRepo) ProtoMessage() {} + +func (x *YAMLInGitRepo) ProtoReflect() protoreflect.Message { + mi := &file_proto_types_commonpb_v3_artifacts_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use YAMLInGitRepo.ProtoReflect.Descriptor instead. +func (*YAMLInGitRepo) Descriptor() ([]byte, []int) { + return file_proto_types_commonpb_v3_artifacts_proto_rawDescGZIP(), []int{3} +} + +func (x *YAMLInGitRepo) GetRepository() string { + if x != nil { + return x.Repository + } + return "" +} + +func (x *YAMLInGitRepo) GetRevision() string { + if x != nil { + return x.Revision + } + return "" +} + +func (x *YAMLInGitRepo) GetPaths() []*File { + if x != nil { + return x.Paths + } + return nil +} + +type HelmInGitRepo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Repository string `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` + Revision string `protobuf:"bytes,2,opt,name=revision,proto3" json:"revision,omitempty"` + ChartPath *File `protobuf:"bytes,3,opt,name=chartPath,proto3" json:"chartPath,omitempty"` + ValuesPaths []*File `protobuf:"bytes,4,rep,name=valuesPaths,proto3" json:"valuesPaths,omitempty"` +} + +func (x *HelmInGitRepo) Reset() { + *x = HelmInGitRepo{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_types_commonpb_v3_artifacts_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HelmInGitRepo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HelmInGitRepo) ProtoMessage() {} + +func (x *HelmInGitRepo) ProtoReflect() protoreflect.Message { + mi := &file_proto_types_commonpb_v3_artifacts_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HelmInGitRepo.ProtoReflect.Descriptor instead. +func (*HelmInGitRepo) Descriptor() ([]byte, []int) { + return file_proto_types_commonpb_v3_artifacts_proto_rawDescGZIP(), []int{4} +} + +func (x *HelmInGitRepo) GetRepository() string { + if x != nil { + return x.Repository + } + return "" +} + +func (x *HelmInGitRepo) GetRevision() string { + if x != nil { + return x.Revision + } + return "" +} + +func (x *HelmInGitRepo) GetChartPath() *File { + if x != nil { + return x.ChartPath + } + return nil +} + +func (x *HelmInGitRepo) GetValuesPaths() []*File { + if x != nil { + return x.ValuesPaths + } + return nil +} + +type HelmInHelmRepo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Repository string `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` + ChartName string `protobuf:"bytes,2,opt,name=chartName,proto3" json:"chartName,omitempty"` + ChartVersion string `protobuf:"bytes,3,opt,name=chartVersion,proto3" json:"chartVersion,omitempty"` + ValuesPaths []*File `protobuf:"bytes,4,rep,name=valuesPaths,proto3" json:"valuesPaths,omitempty"` +} + +func (x *HelmInHelmRepo) Reset() { + *x = HelmInHelmRepo{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_types_commonpb_v3_artifacts_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HelmInHelmRepo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HelmInHelmRepo) ProtoMessage() {} + +func (x *HelmInHelmRepo) ProtoReflect() protoreflect.Message { + mi := &file_proto_types_commonpb_v3_artifacts_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HelmInHelmRepo.ProtoReflect.Descriptor instead. +func (*HelmInHelmRepo) Descriptor() ([]byte, []int) { + return file_proto_types_commonpb_v3_artifacts_proto_rawDescGZIP(), []int{5} +} + +func (x *HelmInHelmRepo) GetRepository() string { + if x != nil { + return x.Repository + } + return "" +} + +func (x *HelmInHelmRepo) GetChartName() string { + if x != nil { + return x.ChartName + } + return "" +} + +func (x *HelmInHelmRepo) GetChartVersion() string { + if x != nil { + return x.ChartVersion + } + return "" +} + +func (x *HelmInHelmRepo) GetValuesPaths() []*File { + if x != nil { + return x.ValuesPaths + } + return nil +} + +type ManagedAlertManager struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Configmap *File `protobuf:"bytes,1,opt,name=configmap,proto3" json:"configmap,omitempty"` + Secret *File `protobuf:"bytes,2,opt,name=secret,proto3" json:"secret,omitempty"` + Configuration *File `protobuf:"bytes,3,opt,name=configuration,proto3" json:"configuration,omitempty"` + Statefulset *File `protobuf:"bytes,4,opt,name=statefulset,proto3" json:"statefulset,omitempty"` +} + +func (x *ManagedAlertManager) Reset() { + *x = ManagedAlertManager{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_types_commonpb_v3_artifacts_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ManagedAlertManager) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ManagedAlertManager) ProtoMessage() {} + +func (x *ManagedAlertManager) ProtoReflect() protoreflect.Message { + mi := &file_proto_types_commonpb_v3_artifacts_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ManagedAlertManager.ProtoReflect.Descriptor instead. +func (*ManagedAlertManager) Descriptor() ([]byte, []int) { + return file_proto_types_commonpb_v3_artifacts_proto_rawDescGZIP(), []int{6} +} + +func (x *ManagedAlertManager) GetConfigmap() *File { + if x != nil { + return x.Configmap + } + return nil +} + +func (x *ManagedAlertManager) GetSecret() *File { + if x != nil { + return x.Secret + } + return nil +} + +func (x *ManagedAlertManager) GetConfiguration() *File { + if x != nil { + return x.Configuration + } + return nil +} + +func (x *ManagedAlertManager) GetStatefulset() *File { + if x != nil { + return x.Statefulset + } + return nil +} + +type ArtifactSpec struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + // Types that are assignable to Artifact: + // *ArtifactSpec_UploadedYAML + // *ArtifactSpec_UploadedHelm + // *ArtifactSpec_YamlInGitRepo + // *ArtifactSpec_HelmInGitRepo + // *ArtifactSpec_HelmInHelmRepo + // *ArtifactSpec_ManagedAlertManger + Artifact isArtifactSpec_Artifact `protobuf_oneof:"artifact"` + // Types that are assignable to Options: + // *ArtifactSpec_HelmOptions + // *ArtifactSpec_YamlOptions + Options isArtifactSpec_Options `protobuf_oneof:"options"` +} + +func (x *ArtifactSpec) Reset() { + *x = ArtifactSpec{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_types_commonpb_v3_artifacts_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ArtifactSpec) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ArtifactSpec) ProtoMessage() {} + +func (x *ArtifactSpec) ProtoReflect() protoreflect.Message { + mi := &file_proto_types_commonpb_v3_artifacts_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ArtifactSpec.ProtoReflect.Descriptor instead. +func (*ArtifactSpec) Descriptor() ([]byte, []int) { + return file_proto_types_commonpb_v3_artifacts_proto_rawDescGZIP(), []int{7} +} + +func (x *ArtifactSpec) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (m *ArtifactSpec) GetArtifact() isArtifactSpec_Artifact { + if m != nil { + return m.Artifact + } + return nil +} + +func (x *ArtifactSpec) GetUploadedYAML() *UploadedYAMLArtifact { + if x, ok := x.GetArtifact().(*ArtifactSpec_UploadedYAML); ok { + return x.UploadedYAML + } + return nil +} + +func (x *ArtifactSpec) GetUploadedHelm() *UploadedHelmArtifact { + if x, ok := x.GetArtifact().(*ArtifactSpec_UploadedHelm); ok { + return x.UploadedHelm + } + return nil +} + +func (x *ArtifactSpec) GetYamlInGitRepo() *YAMLInGitRepo { + if x, ok := x.GetArtifact().(*ArtifactSpec_YamlInGitRepo); ok { + return x.YamlInGitRepo + } + return nil +} + +func (x *ArtifactSpec) GetHelmInGitRepo() *HelmInGitRepo { + if x, ok := x.GetArtifact().(*ArtifactSpec_HelmInGitRepo); ok { + return x.HelmInGitRepo + } + return nil +} + +func (x *ArtifactSpec) GetHelmInHelmRepo() *HelmInHelmRepo { + if x, ok := x.GetArtifact().(*ArtifactSpec_HelmInHelmRepo); ok { + return x.HelmInHelmRepo + } + return nil +} + +func (x *ArtifactSpec) GetManagedAlertManger() *ManagedAlertManager { + if x, ok := x.GetArtifact().(*ArtifactSpec_ManagedAlertManger); ok { + return x.ManagedAlertManger + } + return nil +} + +func (m *ArtifactSpec) GetOptions() isArtifactSpec_Options { + if m != nil { + return m.Options + } + return nil +} + +func (x *ArtifactSpec) GetHelmOptions() *HelmOptions { + if x, ok := x.GetOptions().(*ArtifactSpec_HelmOptions); ok { + return x.HelmOptions + } + return nil +} + +func (x *ArtifactSpec) GetYamlOptions() *YAMLOptions { + if x, ok := x.GetOptions().(*ArtifactSpec_YamlOptions); ok { + return x.YamlOptions + } + return nil +} + +type isArtifactSpec_Artifact interface { + isArtifactSpec_Artifact() +} + +type ArtifactSpec_UploadedYAML struct { + UploadedYAML *UploadedYAMLArtifact `protobuf:"bytes,10,opt,name=uploadedYAML,proto3,oneof"` +} + +type ArtifactSpec_UploadedHelm struct { + UploadedHelm *UploadedHelmArtifact `protobuf:"bytes,11,opt,name=uploadedHelm,proto3,oneof"` +} + +type ArtifactSpec_YamlInGitRepo struct { + YamlInGitRepo *YAMLInGitRepo `protobuf:"bytes,12,opt,name=yamlInGitRepo,proto3,oneof"` +} + +type ArtifactSpec_HelmInGitRepo struct { + HelmInGitRepo *HelmInGitRepo `protobuf:"bytes,13,opt,name=helmInGitRepo,proto3,oneof"` +} + +type ArtifactSpec_HelmInHelmRepo struct { + HelmInHelmRepo *HelmInHelmRepo `protobuf:"bytes,14,opt,name=helmInHelmRepo,proto3,oneof"` +} + +type ArtifactSpec_ManagedAlertManger struct { + ManagedAlertManger *ManagedAlertManager `protobuf:"bytes,15,opt,name=managedAlertManger,proto3,oneof"` +} + +func (*ArtifactSpec_UploadedYAML) isArtifactSpec_Artifact() {} + +func (*ArtifactSpec_UploadedHelm) isArtifactSpec_Artifact() {} + +func (*ArtifactSpec_YamlInGitRepo) isArtifactSpec_Artifact() {} + +func (*ArtifactSpec_HelmInGitRepo) isArtifactSpec_Artifact() {} + +func (*ArtifactSpec_HelmInHelmRepo) isArtifactSpec_Artifact() {} + +func (*ArtifactSpec_ManagedAlertManger) isArtifactSpec_Artifact() {} + +type isArtifactSpec_Options interface { + isArtifactSpec_Options() +} + +type ArtifactSpec_HelmOptions struct { + HelmOptions *HelmOptions `protobuf:"bytes,30,opt,name=helmOptions,proto3,oneof"` +} + +type ArtifactSpec_YamlOptions struct { + YamlOptions *YAMLOptions `protobuf:"bytes,31,opt,name=yamlOptions,proto3,oneof"` +} + +func (*ArtifactSpec_HelmOptions) isArtifactSpec_Options() {} + +func (*ArtifactSpec_YamlOptions) isArtifactSpec_Options() {} + +// $title: Helm Options +// $description: options for deploying Helm artifacts +type HelmOptions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Atomic bool `protobuf:"varint,1,opt,name=atomic,proto3" json:"atomic,omitempty"` + Wait bool `protobuf:"varint,2,opt,name=wait,proto3" json:"wait,omitempty"` + Force bool `protobuf:"varint,3,opt,name=force,proto3" json:"force,omitempty"` + NoHooks bool `protobuf:"varint,4,opt,name=noHooks,proto3" json:"noHooks,omitempty"` + MaxHistory int32 `protobuf:"zigzag32,5,opt,name=maxHistory,proto3" json:"maxHistory,omitempty"` + RenderSubChartNotes bool `protobuf:"varint,6,opt,name=renderSubChartNotes,proto3" json:"renderSubChartNotes,omitempty"` + ResetValues bool `protobuf:"varint,7,opt,name=resetValues,proto3" json:"resetValues,omitempty"` + ReuseValues bool `protobuf:"varint,8,opt,name=reuseValues,proto3" json:"reuseValues,omitempty"` + SetString []string `protobuf:"bytes,9,rep,name=setString,proto3" json:"setString,omitempty"` + SkipCRDs bool `protobuf:"varint,10,opt,name=skipCRDs,proto3" json:"skipCRDs,omitempty"` + Timeout string `protobuf:"bytes,11,opt,name=timeout,proto3" json:"timeout,omitempty"` + CleanUpOnFail bool `protobuf:"varint,12,opt,name=cleanUpOnFail,proto3" json:"cleanUpOnFail,omitempty"` + Description string `protobuf:"bytes,13,opt,name=description,proto3" json:"description,omitempty"` + DisableOpenAPIValidation bool `protobuf:"varint,14,opt,name=disableOpenAPIValidation,proto3" json:"disableOpenAPIValidation,omitempty"` + KeepHistory bool `protobuf:"varint,15,opt,name=keepHistory,proto3" json:"keepHistory,omitempty"` +} + +func (x *HelmOptions) Reset() { + *x = HelmOptions{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_types_commonpb_v3_artifacts_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HelmOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HelmOptions) ProtoMessage() {} + +func (x *HelmOptions) ProtoReflect() protoreflect.Message { + mi := &file_proto_types_commonpb_v3_artifacts_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HelmOptions.ProtoReflect.Descriptor instead. +func (*HelmOptions) Descriptor() ([]byte, []int) { + return file_proto_types_commonpb_v3_artifacts_proto_rawDescGZIP(), []int{8} +} + +func (x *HelmOptions) GetAtomic() bool { + if x != nil { + return x.Atomic + } + return false +} + +func (x *HelmOptions) GetWait() bool { + if x != nil { + return x.Wait + } + return false +} + +func (x *HelmOptions) GetForce() bool { + if x != nil { + return x.Force + } + return false +} + +func (x *HelmOptions) GetNoHooks() bool { + if x != nil { + return x.NoHooks + } + return false +} + +func (x *HelmOptions) GetMaxHistory() int32 { + if x != nil { + return x.MaxHistory + } + return 0 +} + +func (x *HelmOptions) GetRenderSubChartNotes() bool { + if x != nil { + return x.RenderSubChartNotes + } + return false +} + +func (x *HelmOptions) GetResetValues() bool { + if x != nil { + return x.ResetValues + } + return false +} + +func (x *HelmOptions) GetReuseValues() bool { + if x != nil { + return x.ReuseValues + } + return false +} + +func (x *HelmOptions) GetSetString() []string { + if x != nil { + return x.SetString + } + return nil +} + +func (x *HelmOptions) GetSkipCRDs() bool { + if x != nil { + return x.SkipCRDs + } + return false +} + +func (x *HelmOptions) GetTimeout() string { + if x != nil { + return x.Timeout + } + return "" +} + +func (x *HelmOptions) GetCleanUpOnFail() bool { + if x != nil { + return x.CleanUpOnFail + } + return false +} + +func (x *HelmOptions) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *HelmOptions) GetDisableOpenAPIValidation() bool { + if x != nil { + return x.DisableOpenAPIValidation + } + return false +} + +func (x *HelmOptions) GetKeepHistory() bool { + if x != nil { + return x.KeepHistory + } + return false +} + +type YAMLOptions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Force bool `protobuf:"varint,1,opt,name=force,proto3" json:"force,omitempty"` + DisableOpenAPIValidation bool `protobuf:"varint,2,opt,name=disableOpenAPIValidation,proto3" json:"disableOpenAPIValidation,omitempty"` +} + +func (x *YAMLOptions) Reset() { + *x = YAMLOptions{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_types_commonpb_v3_artifacts_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *YAMLOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*YAMLOptions) ProtoMessage() {} + +func (x *YAMLOptions) ProtoReflect() protoreflect.Message { + mi := &file_proto_types_commonpb_v3_artifacts_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use YAMLOptions.ProtoReflect.Descriptor instead. +func (*YAMLOptions) Descriptor() ([]byte, []int) { + return file_proto_types_commonpb_v3_artifacts_proto_rawDescGZIP(), []int{9} +} + +func (x *YAMLOptions) GetForce() bool { + if x != nil { + return x.Force + } + return false +} + +func (x *YAMLOptions) GetDisableOpenAPIValidation() bool { + if x != nil { + return x.DisableOpenAPIValidation + } + return false +} + +var File_proto_types_commonpb_v3_artifacts_proto protoreflect.FileDescriptor + +var file_proto_types_commonpb_v3_artifacts_proto_rawDesc = []byte{ + 0x0a, 0x27, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2f, 0x76, 0x33, 0x2f, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, + 0x63, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x72, 0x61, 0x66, 0x61, 0x79, + 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2e, 0x76, 0x33, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, + 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa9, 0x02, 0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x3a, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x26, 0x92, 0x41, + 0x23, 0x2a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x32, 0x1b, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, + 0x65, 0x20, 0x70, 0x61, 0x74, 0x68, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x20, 0x61, 0x72, 0x74, 0x69, + 0x66, 0x61, 0x63, 0x74, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x4e, 0x0a, 0x04, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x3a, 0x92, 0x41, 0x37, 0x2a, 0x04, 0x44, + 0x61, 0x74, 0x61, 0x32, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, 0x65, + 0x20, 0x62, 0x61, 0x73, 0x65, 0x36, 0x34, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x20, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, + 0x66, 0x69, 0x6c, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x94, 0x01, 0x92, 0x41, 0x90, + 0x01, 0x0a, 0x5b, 0x2a, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x32, 0x4c, 0x66, 0x69, 0x6c, 0x65, 0x20, + 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x66, 0x69, + 0x6c, 0x65, 0x20, 0x28, 0x6f, 0x72, 0x20, 0x61, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x79, 0x29, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x46, 0x69, 0x6c, 0x65, 0x20, + 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x20, 0x62, 0x79, 0x20, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, + 0x76, 0x65, 0x20, 0x70, 0x61, 0x74, 0x68, 0xd2, 0x01, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x32, 0x31, + 0x7b, 0x22, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x73, 0x6f, 0x6d, 0x65, 0x2d, 0x6e, + 0x61, 0x6d, 0x65, 0x22, 0x2c, 0x22, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x3a, 0x20, + 0x22, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x22, + 0x7d, 0x22, 0x9b, 0x02, 0x0a, 0x14, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x59, 0x41, + 0x4d, 0x4c, 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x12, 0x78, 0x0a, 0x05, 0x70, 0x61, + 0x74, 0x68, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x72, 0x61, 0x66, 0x61, + 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x42, 0x41, 0x92, 0x41, 0x3e, 0x2a, + 0x05, 0x50, 0x61, 0x74, 0x68, 0x73, 0x32, 0x35, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, + 0x59, 0x41, 0x4d, 0x4c, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x20, 0x72, 0x65, 0x70, 0x72, 0x65, + 0x73, 0x65, 0x6e, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, + 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x20, 0x70, 0x61, 0x74, 0x68, 0x52, 0x05, 0x70, + 0x61, 0x74, 0x68, 0x73, 0x3a, 0x88, 0x01, 0x92, 0x41, 0x84, 0x01, 0x0a, 0x41, 0x2a, 0x16, 0x55, + 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x20, 0x59, 0x41, 0x4d, 0x4c, 0x20, 0x41, 0x72, 0x74, + 0x69, 0x66, 0x61, 0x63, 0x74, 0x32, 0x1f, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, + 0x73, 0x20, 0x61, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x59, 0x41, 0x4d, 0x4c, + 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0xd2, 0x01, 0x05, 0x70, 0x61, 0x74, 0x68, 0x73, 0x32, 0x3f, + 0x7b, 0x22, 0x70, 0x61, 0x74, 0x68, 0x73, 0x22, 0x3a, 0x20, 0x5b, 0x7b, 0x22, 0x6e, 0x61, 0x6d, + 0x65, 0x22, 0x3a, 0x20, 0x22, 0x66, 0x69, 0x6c, 0x65, 0x3a, 0x2f, 0x2f, 0x72, 0x65, 0x6c, 0x61, + 0x74, 0x69, 0x76, 0x65, 0x2f, 0x70, 0x61, 0x74, 0x68, 0x2f, 0x74, 0x6f, 0x2f, 0x73, 0x6f, 0x6d, + 0x65, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x79, 0x61, 0x6d, 0x6c, 0x22, 0x7d, 0x5d, 0x7d, 0x22, + 0xc4, 0x03, 0x0a, 0x14, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x48, 0x65, 0x6c, 0x6d, + 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x12, 0x7b, 0x0a, 0x09, 0x63, 0x68, 0x61, 0x72, + 0x74, 0x50, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x72, 0x61, + 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x42, 0x3c, 0x92, 0x41, + 0x39, 0x2a, 0x09, 0x43, 0x68, 0x61, 0x72, 0x74, 0x50, 0x61, 0x74, 0x68, 0x32, 0x2c, 0x72, 0x65, + 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x61, 0x20, 0x48, 0x65, 0x6c, 0x6d, 0x20, + 0x43, 0x68, 0x61, 0x72, 0x74, 0x20, 0x62, 0x79, 0x20, 0x69, 0x74, 0x73, 0x20, 0x72, 0x65, 0x6c, + 0x61, 0x74, 0x69, 0x76, 0x65, 0x20, 0x70, 0x61, 0x74, 0x68, 0x52, 0x09, 0x63, 0x68, 0x61, 0x72, + 0x74, 0x50, 0x61, 0x74, 0x68, 0x12, 0x84, 0x01, 0x0a, 0x0b, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, + 0x50, 0x61, 0x74, 0x68, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x72, 0x61, + 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x42, 0x41, 0x92, 0x41, + 0x3e, 0x2a, 0x0b, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x50, 0x61, 0x74, 0x68, 0x73, 0x32, 0x2f, + 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x61, 0x20, 0x48, 0x65, 0x6c, + 0x6d, 0x20, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x69, + 0x72, 0x20, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x20, 0x70, 0x61, 0x74, 0x68, 0x52, + 0x0b, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x50, 0x61, 0x74, 0x68, 0x73, 0x3a, 0xa7, 0x01, 0x92, + 0x41, 0xa3, 0x01, 0x0a, 0x5c, 0x2a, 0x16, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x20, + 0x48, 0x65, 0x6c, 0x6d, 0x20, 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x32, 0x36, 0x72, + 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x48, 0x65, 0x6c, + 0x6d, 0x20, 0x63, 0x68, 0x61, 0x72, 0x74, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x7a, 0x65, 0x72, 0x6f, + 0x20, 0x6f, 0x72, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x20, + 0x66, 0x69, 0x6c, 0x65, 0x73, 0xd2, 0x01, 0x09, 0x63, 0x68, 0x61, 0x72, 0x74, 0x50, 0x61, 0x74, + 0x68, 0x32, 0x43, 0x7b, 0x22, 0x63, 0x68, 0x61, 0x72, 0x74, 0x50, 0x61, 0x74, 0x68, 0x22, 0x3a, + 0x20, 0x5b, 0x7b, 0x22, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x66, 0x69, 0x6c, 0x65, + 0x3a, 0x2f, 0x2f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2f, 0x70, 0x61, 0x74, 0x68, + 0x2f, 0x74, 0x6f, 0x2f, 0x73, 0x6f, 0x6d, 0x65, 0x2f, 0x63, 0x68, 0x61, 0x72, 0x74, 0x2e, 0x74, + 0x67, 0x7a, 0x22, 0x7d, 0x5d, 0x7d, 0x22, 0xef, 0x03, 0x0a, 0x0d, 0x59, 0x41, 0x4d, 0x4c, 0x49, + 0x6e, 0x47, 0x69, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x12, 0x4b, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0x92, 0x41, + 0x28, 0x2a, 0x0a, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x32, 0x1a, 0x6e, + 0x61, 0x6d, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x69, 0x74, 0x20, 0x72, + 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x4e, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x32, 0x92, 0x41, 0x2f, 0x2a, 0x08, 0x52, 0x65, + 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x32, 0x23, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x20, 0x6f, + 0x72, 0x20, 0x74, 0x61, 0x67, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x69, 0x74, + 0x20, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x08, 0x72, 0x65, 0x76, + 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x6f, 0x0a, 0x05, 0x70, 0x61, 0x74, 0x68, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x33, + 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x42, 0x38, 0x92, 0x41, 0x35, 0x2a, 0x05, 0x50, 0x61, 0x74, 0x68, + 0x73, 0x32, 0x2c, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x20, 0x70, 0x61, 0x74, 0x68, + 0x73, 0x20, 0x74, 0x6f, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, + 0x20, 0x67, 0x69, 0x74, 0x20, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, + 0x05, 0x70, 0x61, 0x74, 0x68, 0x73, 0x3a, 0xcf, 0x01, 0x92, 0x41, 0xcb, 0x01, 0x0a, 0x60, 0x2a, + 0x19, 0x59, 0x41, 0x4d, 0x4c, 0x20, 0x49, 0x6e, 0x20, 0x47, 0x69, 0x74, 0x20, 0x52, 0x65, 0x70, + 0x6f, 0x20, 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x32, 0x23, 0x72, 0x65, 0x70, 0x72, + 0x65, 0x73, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x59, 0x41, 0x4d, 0x4c, 0x20, 0x66, 0x69, 0x6c, 0x65, + 0x73, 0x20, 0x69, 0x6e, 0x20, 0x61, 0x20, 0x47, 0x69, 0x74, 0x20, 0x72, 0x65, 0x70, 0x6f, 0xd2, + 0x01, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0xd2, 0x01, 0x08, 0x72, + 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0xd2, 0x01, 0x05, 0x70, 0x61, 0x74, 0x68, 0x73, 0x32, + 0x67, 0x7b, 0x22, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x22, 0x3a, 0x20, + 0x22, 0x73, 0x6f, 0x6d, 0x65, 0x2d, 0x72, 0x65, 0x70, 0x6f, 0x22, 0x2c, 0x22, 0x72, 0x65, 0x76, + 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x3a, 0x20, 0x22, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x22, + 0x2c, 0x22, 0x70, 0x61, 0x74, 0x68, 0x73, 0x22, 0x3a, 0x20, 0x5b, 0x7b, 0x22, 0x6e, 0x61, 0x6d, + 0x65, 0x22, 0x3a, 0x20, 0x22, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2f, 0x70, 0x61, + 0x74, 0x68, 0x2f, 0x74, 0x6f, 0x2f, 0x73, 0x6f, 0x6d, 0x65, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x2e, + 0x79, 0x61, 0x6d, 0x6c, 0x22, 0x7d, 0x5d, 0x7d, 0x22, 0x92, 0x05, 0x0a, 0x0d, 0x48, 0x65, 0x6c, + 0x6d, 0x49, 0x6e, 0x47, 0x69, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x12, 0x4b, 0x0a, 0x0a, 0x72, 0x65, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, + 0x92, 0x41, 0x28, 0x2a, 0x0a, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x32, + 0x1a, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x69, 0x74, + 0x20, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x0a, 0x72, 0x65, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x4e, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x32, 0x92, 0x41, 0x2f, 0x2a, 0x08, + 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x32, 0x23, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, + 0x20, 0x6f, 0x72, 0x20, 0x74, 0x61, 0x67, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, + 0x69, 0x74, 0x20, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x08, 0x72, + 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x81, 0x01, 0x0a, 0x09, 0x63, 0x68, 0x61, 0x72, + 0x74, 0x50, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x72, 0x61, + 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x42, 0x42, 0x92, 0x41, + 0x3f, 0x2a, 0x0a, 0x43, 0x68, 0x61, 0x72, 0x74, 0x20, 0x50, 0x61, 0x74, 0x68, 0x32, 0x31, 0x72, + 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x20, 0x70, 0x61, 0x74, 0x68, 0x20, 0x74, 0x6f, 0x20, + 0x63, 0x68, 0x61, 0x72, 0x74, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, + 0x65, 0x20, 0x67, 0x69, 0x74, 0x20, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, + 0x52, 0x09, 0x63, 0x68, 0x61, 0x72, 0x74, 0x50, 0x61, 0x74, 0x68, 0x12, 0x87, 0x01, 0x0a, 0x0b, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x50, 0x61, 0x74, 0x68, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1f, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x46, 0x69, + 0x6c, 0x65, 0x42, 0x44, 0x92, 0x41, 0x41, 0x2a, 0x0b, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x50, + 0x61, 0x74, 0x68, 0x73, 0x32, 0x32, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x20, 0x70, + 0x61, 0x74, 0x68, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x66, 0x69, + 0x6c, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x69, 0x74, 0x20, 0x72, 0x65, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x0b, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, + 0x50, 0x61, 0x74, 0x68, 0x73, 0x3a, 0xd5, 0x01, 0x92, 0x41, 0xd1, 0x01, 0x0a, 0x64, 0x2a, 0x19, + 0x48, 0x65, 0x6c, 0x6d, 0x20, 0x69, 0x6e, 0x20, 0x47, 0x69, 0x74, 0x20, 0x52, 0x65, 0x70, 0x6f, + 0x20, 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x32, 0x23, 0x72, 0x65, 0x70, 0x72, 0x65, + 0x73, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x48, 0x65, 0x6c, 0x6d, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, + 0x20, 0x69, 0x6e, 0x20, 0x61, 0x20, 0x47, 0x69, 0x74, 0x20, 0x72, 0x65, 0x70, 0x6f, 0xd2, 0x01, + 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0xd2, 0x01, 0x08, 0x72, 0x65, + 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0xd2, 0x01, 0x09, 0x63, 0x68, 0x61, 0x72, 0x74, 0x50, 0x61, + 0x74, 0x68, 0x32, 0x69, 0x7b, 0x22, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, + 0x22, 0x3a, 0x20, 0x22, 0x73, 0x6f, 0x6d, 0x65, 0x2d, 0x72, 0x65, 0x70, 0x6f, 0x22, 0x2c, 0x22, + 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x3a, 0x20, 0x22, 0x6d, 0x61, 0x73, 0x74, + 0x65, 0x72, 0x22, 0x2c, 0x22, 0x63, 0x68, 0x61, 0x72, 0x74, 0x50, 0x61, 0x74, 0x68, 0x22, 0x3a, + 0x20, 0x7b, 0x22, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x72, 0x65, 0x6c, 0x61, 0x74, + 0x69, 0x76, 0x65, 0x2f, 0x70, 0x61, 0x74, 0x68, 0x2f, 0x74, 0x6f, 0x2f, 0x73, 0x6f, 0x6d, 0x65, + 0x2f, 0x63, 0x68, 0x61, 0x72, 0x74, 0x2e, 0x74, 0x67, 0x7a, 0x22, 0x7d, 0x7d, 0x22, 0x9d, 0x04, + 0x0a, 0x0e, 0x48, 0x65, 0x6c, 0x6d, 0x49, 0x6e, 0x48, 0x65, 0x6c, 0x6d, 0x52, 0x65, 0x70, 0x6f, + 0x12, 0x4c, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x2c, 0x92, 0x41, 0x29, 0x2a, 0x0a, 0x52, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x6f, 0x72, 0x79, 0x32, 0x1b, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, + 0x68, 0x65, 0x20, 0x68, 0x65, 0x6c, 0x6d, 0x20, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, + 0x72, 0x79, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x40, + 0x0a, 0x09, 0x63, 0x68, 0x61, 0x72, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x22, 0x92, 0x41, 0x1f, 0x2a, 0x0a, 0x43, 0x68, 0x61, 0x72, 0x74, 0x20, 0x4e, 0x61, + 0x6d, 0x65, 0x32, 0x11, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, + 0x63, 0x68, 0x61, 0x72, 0x74, 0x52, 0x09, 0x63, 0x68, 0x61, 0x72, 0x74, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x4c, 0x0a, 0x0c, 0x63, 0x68, 0x61, 0x72, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x28, 0x92, 0x41, 0x25, 0x2a, 0x0d, 0x43, 0x68, 0x61, + 0x72, 0x74, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x32, 0x14, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x68, 0x61, 0x72, 0x74, + 0x52, 0x0c, 0x63, 0x68, 0x61, 0x72, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x74, + 0x0a, 0x0b, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x50, 0x61, 0x74, 0x68, 0x73, 0x18, 0x04, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x33, 0x2e, + 0x46, 0x69, 0x6c, 0x65, 0x42, 0x31, 0x92, 0x41, 0x2e, 0x2a, 0x0c, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x20, 0x50, 0x61, 0x74, 0x68, 0x73, 0x32, 0x1e, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, + 0x65, 0x20, 0x70, 0x61, 0x74, 0x68, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x0b, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x50, + 0x61, 0x74, 0x68, 0x73, 0x3a, 0xb6, 0x01, 0x92, 0x41, 0xb2, 0x01, 0x0a, 0x61, 0x2a, 0x11, 0x48, + 0x65, 0x6c, 0x6d, 0x20, 0x69, 0x6e, 0x20, 0x48, 0x65, 0x6c, 0x6d, 0x20, 0x52, 0x65, 0x70, 0x6f, + 0x32, 0x24, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x48, 0x65, 0x6c, + 0x6d, 0x20, 0x63, 0x68, 0x61, 0x72, 0x74, 0x20, 0x69, 0x6e, 0x20, 0x61, 0x20, 0x48, 0x65, 0x6c, + 0x6d, 0x20, 0x72, 0x65, 0x70, 0x6f, 0xd2, 0x01, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x6f, 0x72, 0x79, 0xd2, 0x01, 0x09, 0x63, 0x68, 0x61, 0x72, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0xd2, + 0x01, 0x0c, 0x63, 0x68, 0x61, 0x72, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x32, 0x4d, + 0x7b, 0x22, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x22, 0x3a, 0x20, 0x22, + 0x73, 0x6f, 0x6d, 0x65, 0x2d, 0x72, 0x65, 0x70, 0x6f, 0x22, 0x2c, 0x22, 0x63, 0x68, 0x61, 0x72, + 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x73, 0x6f, 0x6d, 0x65, 0x2d, 0x63, 0x68, + 0x61, 0x72, 0x74, 0x22, 0x2c, 0x22, 0x63, 0x68, 0x61, 0x72, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x22, 0x3a, 0x20, 0x22, 0x31, 0x2e, 0x32, 0x2e, 0x33, 0x22, 0x7d, 0x22, 0x83, 0x07, + 0x0a, 0x13, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x4d, 0x61, + 0x6e, 0x61, 0x67, 0x65, 0x72, 0x12, 0x7e, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, + 0x61, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, + 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x42, 0x3f, 0x92, 0x41, 0x3c, 0x2a, 0x0a, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x20, 0x4d, 0x61, 0x70, 0x32, 0x2e, 0x72, 0x65, 0x6c, 0x61, + 0x74, 0x69, 0x76, 0x65, 0x20, 0x70, 0x61, 0x74, 0x68, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6c, + 0x65, 0x72, 0x74, 0x20, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x20, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x6d, 0x61, 0x70, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x6d, 0x61, 0x70, 0x12, 0x71, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, + 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, + 0x33, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x42, 0x38, 0x92, 0x41, 0x35, 0x2a, 0x06, 0x53, 0x65, 0x63, + 0x72, 0x65, 0x74, 0x32, 0x2b, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x20, 0x70, 0x61, + 0x74, 0x68, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x20, 0x6d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x72, 0x20, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x20, 0x66, 0x69, 0x6c, 0x65, + 0x52, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x86, 0x01, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1f, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x46, 0x69, 0x6c, + 0x65, 0x42, 0x3f, 0x92, 0x41, 0x3c, 0x2a, 0x06, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x32, 0x32, + 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x20, 0x70, 0x61, 0x74, 0x68, 0x73, 0x20, 0x74, + 0x6f, 0x20, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x20, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x20, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x69, + 0x6c, 0x65, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x80, 0x01, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x65, 0x66, 0x75, 0x6c, 0x73, 0x65, + 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, + 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x76, 0x33, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x42, 0x3d, 0x92, 0x41, 0x3a, 0x2a, 0x06, 0x53, + 0x65, 0x63, 0x72, 0x65, 0x74, 0x32, 0x30, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x20, + 0x70, 0x61, 0x74, 0x68, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x20, 0x6d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x20, 0x73, 0x74, 0x61, 0x74, 0x65, 0x66, 0x75, 0x6c, 0x73, + 0x65, 0x74, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x65, 0x66, 0x75, + 0x6c, 0x73, 0x65, 0x74, 0x3a, 0xec, 0x02, 0x92, 0x41, 0xe8, 0x02, 0x0a, 0x6c, 0x2a, 0x15, 0x4d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x20, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x20, 0x4d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x72, 0x32, 0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x73, + 0x20, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x20, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x20, 0x6d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0xd2, 0x01, 0x09, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, + 0x61, 0x70, 0xd2, 0x01, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0xd2, 0x01, 0x0d, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xd2, 0x01, 0x0b, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x66, 0x75, 0x6c, 0x73, 0x65, 0x74, 0x32, 0xf7, 0x01, 0x7b, 0x22, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x61, 0x70, 0x22, 0x3a, 0x20, 0x7b, 0x22, 0x6e, 0x61, 0x6d, 0x65, + 0x22, 0x3a, 0x20, 0x22, 0x66, 0x69, 0x6c, 0x65, 0x3a, 0x2f, 0x2f, 0x70, 0x61, 0x74, 0x68, 0x2f, + 0x74, 0x6f, 0x2f, 0x73, 0x6f, 0x6d, 0x65, 0x2d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x6d, 0x61, + 0x70, 0x2e, 0x79, 0x61, 0x6d, 0x6c, 0x22, 0x7d, 0x2c, 0x22, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, + 0x22, 0x3a, 0x20, 0x7b, 0x22, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x66, 0x69, 0x6c, + 0x65, 0x3a, 0x2f, 0x2f, 0x70, 0x61, 0x74, 0x68, 0x2f, 0x74, 0x6f, 0x2f, 0x73, 0x6f, 0x6d, 0x65, + 0x2d, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x2e, 0x79, 0x61, 0x6d, 0x6c, 0x22, 0x7d, 0x2c, 0x22, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3a, 0x20, + 0x7b, 0x22, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x66, 0x69, 0x6c, 0x65, 0x3a, 0x2f, + 0x2f, 0x70, 0x61, 0x74, 0x68, 0x2f, 0x74, 0x6f, 0x2f, 0x73, 0x6f, 0x6d, 0x65, 0x2d, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x79, 0x61, 0x6d, 0x6c, + 0x22, 0x7d, 0x2c, 0x22, 0x73, 0x74, 0x61, 0x74, 0x65, 0x66, 0x75, 0x6c, 0x73, 0x65, 0x74, 0x22, + 0x3a, 0x20, 0x7b, 0x22, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x66, 0x69, 0x6c, 0x65, + 0x3a, 0x2f, 0x2f, 0x70, 0x61, 0x74, 0x68, 0x2f, 0x74, 0x6f, 0x2f, 0x73, 0x6f, 0x6d, 0x65, 0x2d, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x66, 0x75, 0x6c, 0x73, 0x65, 0x74, 0x2e, 0x79, 0x61, 0x6d, 0x6c, + 0x22, 0x7d, 0x7d, 0x22, 0xe1, 0x07, 0x0a, 0x0c, 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, + 0x53, 0x70, 0x65, 0x63, 0x12, 0x59, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x45, 0x92, 0x41, 0x42, 0x2a, 0x0d, 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, + 0x74, 0x20, 0x54, 0x79, 0x70, 0x65, 0x32, 0x14, 0x74, 0x79, 0x70, 0x65, 0x20, 0x6f, 0x66, 0x20, + 0x74, 0x68, 0x65, 0x20, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0xf2, 0x02, 0x04, 0x48, + 0x65, 0x6c, 0x6d, 0xf2, 0x02, 0x04, 0x59, 0x61, 0x6d, 0x6c, 0xf2, 0x02, 0x0c, 0x41, 0x6c, 0x65, + 0x72, 0x74, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, + 0x55, 0x0a, 0x0c, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x59, 0x41, 0x4d, 0x4c, 0x18, + 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, + 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, + 0x33, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x59, 0x41, 0x4d, 0x4c, 0x41, 0x72, + 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x48, 0x00, 0x52, 0x0c, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, + 0x65, 0x64, 0x59, 0x41, 0x4d, 0x4c, 0x12, 0x55, 0x0a, 0x0c, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, + 0x65, 0x64, 0x48, 0x65, 0x6c, 0x6d, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x72, + 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x65, + 0x64, 0x48, 0x65, 0x6c, 0x6d, 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x48, 0x00, 0x52, + 0x0c, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x48, 0x65, 0x6c, 0x6d, 0x12, 0x50, 0x0a, + 0x0d, 0x79, 0x61, 0x6d, 0x6c, 0x49, 0x6e, 0x47, 0x69, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x18, 0x0c, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x33, + 0x2e, 0x59, 0x41, 0x4d, 0x4c, 0x49, 0x6e, 0x47, 0x69, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x48, 0x00, + 0x52, 0x0d, 0x79, 0x61, 0x6d, 0x6c, 0x49, 0x6e, 0x47, 0x69, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x12, + 0x50, 0x0a, 0x0d, 0x68, 0x65, 0x6c, 0x6d, 0x49, 0x6e, 0x47, 0x69, 0x74, 0x52, 0x65, 0x70, 0x6f, + 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, + 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x76, 0x33, 0x2e, 0x48, 0x65, 0x6c, 0x6d, 0x49, 0x6e, 0x47, 0x69, 0x74, 0x52, 0x65, 0x70, 0x6f, + 0x48, 0x00, 0x52, 0x0d, 0x68, 0x65, 0x6c, 0x6d, 0x49, 0x6e, 0x47, 0x69, 0x74, 0x52, 0x65, 0x70, + 0x6f, 0x12, 0x53, 0x0a, 0x0e, 0x68, 0x65, 0x6c, 0x6d, 0x49, 0x6e, 0x48, 0x65, 0x6c, 0x6d, 0x52, + 0x65, 0x70, 0x6f, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x72, 0x61, 0x66, 0x61, + 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x65, 0x6c, 0x6d, 0x49, 0x6e, 0x48, 0x65, 0x6c, 0x6d, + 0x52, 0x65, 0x70, 0x6f, 0x48, 0x00, 0x52, 0x0e, 0x68, 0x65, 0x6c, 0x6d, 0x49, 0x6e, 0x48, 0x65, + 0x6c, 0x6d, 0x52, 0x65, 0x70, 0x6f, 0x12, 0x60, 0x0a, 0x12, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x64, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x4d, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x18, 0x0f, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x4d, 0x61, 0x6e, 0x61, 0x67, + 0x65, 0x72, 0x48, 0x00, 0x52, 0x12, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x41, 0x6c, 0x65, + 0x72, 0x74, 0x4d, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x12, 0x4a, 0x0a, 0x0b, 0x68, 0x65, 0x6c, 0x6d, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, + 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x65, 0x6c, 0x6d, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x48, 0x01, 0x52, 0x0b, 0x68, 0x65, 0x6c, 0x6d, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x4a, 0x0a, 0x0b, 0x79, 0x61, 0x6d, 0x6c, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x72, 0x61, 0x66, 0x61, + 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x59, 0x41, 0x4d, 0x4c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x48, 0x01, 0x52, 0x0b, 0x79, 0x61, 0x6d, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x3a, 0xbd, 0x01, 0x92, 0x41, 0xb9, 0x01, 0x0a, 0x2e, 0x2a, 0x0c, 0x41, 0x72, 0x74, 0x69, 0x66, + 0x61, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x32, 0x0c, 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, + 0x74, 0x53, 0x70, 0x65, 0x63, 0xd2, 0x01, 0x04, 0x74, 0x79, 0x70, 0x65, 0xd2, 0x01, 0x08, 0x61, + 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x32, 0x86, 0x01, 0x7b, 0x22, 0x74, 0x79, 0x70, 0x65, + 0x22, 0x3a, 0x20, 0x22, 0x48, 0x65, 0x6c, 0x6d, 0x22, 0x2c, 0x22, 0x61, 0x72, 0x74, 0x69, 0x66, + 0x61, 0x63, 0x74, 0x22, 0x3a, 0x20, 0x7b, 0x22, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, + 0x72, 0x79, 0x22, 0x3a, 0x20, 0x22, 0x73, 0x6f, 0x6d, 0x65, 0x2d, 0x72, 0x65, 0x70, 0x6f, 0x22, + 0x2c, 0x22, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x3a, 0x20, 0x22, 0x6d, 0x61, + 0x73, 0x74, 0x65, 0x72, 0x22, 0x2c, 0x22, 0x63, 0x68, 0x61, 0x72, 0x74, 0x50, 0x61, 0x74, 0x68, + 0x22, 0x3a, 0x20, 0x7b, 0x22, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x72, 0x65, 0x6c, + 0x61, 0x74, 0x69, 0x76, 0x65, 0x2f, 0x70, 0x61, 0x74, 0x68, 0x2f, 0x74, 0x6f, 0x2f, 0x73, 0x6f, + 0x6d, 0x65, 0x2f, 0x63, 0x68, 0x61, 0x72, 0x74, 0x2e, 0x74, 0x67, 0x7a, 0x22, 0x7d, 0x7d, 0x7d, + 0x42, 0x0a, 0x0a, 0x08, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x42, 0x09, 0x0a, 0x07, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xd0, 0x0b, 0x0a, 0x0b, 0x48, 0x65, 0x6c, 0x6d, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x4a, 0x0a, 0x06, 0x61, 0x74, 0x6f, 0x6d, 0x69, + 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x42, 0x32, 0x92, 0x41, 0x2f, 0x2a, 0x06, 0x41, 0x74, + 0x6f, 0x6d, 0x69, 0x63, 0x32, 0x25, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x20, 0x48, 0x65, 0x6c, + 0x6d, 0x20, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, + 0x61, 0x74, 0x6f, 0x6d, 0x69, 0x63, 0x20, 0x66, 0x6c, 0x61, 0x67, 0x52, 0x06, 0x61, 0x74, 0x6f, + 0x6d, 0x69, 0x63, 0x12, 0x42, 0x0a, 0x04, 0x77, 0x61, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x08, 0x42, 0x2e, 0x92, 0x41, 0x2b, 0x2a, 0x04, 0x57, 0x61, 0x69, 0x74, 0x32, 0x23, 0x64, 0x65, + 0x70, 0x6c, 0x6f, 0x79, 0x20, 0x48, 0x65, 0x6c, 0x6d, 0x20, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, + 0x63, 0x74, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x77, 0x61, 0x69, 0x74, 0x20, 0x66, 0x6c, 0x61, + 0x67, 0x52, 0x04, 0x77, 0x61, 0x69, 0x74, 0x12, 0x46, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x42, 0x30, 0x92, 0x41, 0x2d, 0x2a, 0x05, 0x46, 0x6f, 0x72, + 0x63, 0x65, 0x32, 0x24, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x20, 0x48, 0x65, 0x6c, 0x6d, 0x20, + 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x66, 0x6f, + 0x72, 0x63, 0x65, 0x20, 0x66, 0x6c, 0x61, 0x67, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x12, + 0x4b, 0x0a, 0x07, 0x6e, 0x6f, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, + 0x42, 0x31, 0x92, 0x41, 0x2e, 0x2a, 0x08, 0x4e, 0x6f, 0x20, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x32, + 0x22, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x20, 0x48, 0x65, 0x6c, 0x6d, 0x20, 0x61, 0x72, 0x74, + 0x69, 0x66, 0x61, 0x63, 0x74, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x20, 0x68, 0x6f, + 0x6f, 0x6b, 0x73, 0x52, 0x07, 0x6e, 0x6f, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x12, 0x4d, 0x0a, 0x0a, + 0x6d, 0x61, 0x78, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x11, + 0x42, 0x2d, 0x92, 0x41, 0x2a, 0x2a, 0x0b, 0x4d, 0x61, 0x78, 0x20, 0x48, 0x69, 0x73, 0x74, 0x6f, + 0x72, 0x79, 0x32, 0x1b, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x20, 0x48, 0x65, 0x6c, 0x6d, 0x20, 0x61, + 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x20, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, + 0x0a, 0x6d, 0x61, 0x78, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x65, 0x0a, 0x13, 0x72, + 0x65, 0x6e, 0x64, 0x65, 0x72, 0x53, 0x75, 0x62, 0x43, 0x68, 0x61, 0x72, 0x74, 0x4e, 0x6f, 0x74, + 0x65, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x42, 0x33, 0x92, 0x41, 0x30, 0x2a, 0x16, 0x52, + 0x65, 0x6e, 0x64, 0x65, 0x72, 0x20, 0x53, 0x75, 0x62, 0x20, 0x43, 0x68, 0x61, 0x72, 0x74, 0x20, + 0x4e, 0x6f, 0x74, 0x65, 0x73, 0x32, 0x16, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x20, 0x73, 0x75, + 0x62, 0x20, 0x63, 0x68, 0x61, 0x72, 0x74, 0x20, 0x6e, 0x6f, 0x74, 0x65, 0x73, 0x52, 0x13, 0x72, + 0x65, 0x6e, 0x64, 0x65, 0x72, 0x53, 0x75, 0x62, 0x43, 0x68, 0x61, 0x72, 0x74, 0x4e, 0x6f, 0x74, + 0x65, 0x73, 0x12, 0x4f, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x42, 0x2d, 0x92, 0x41, 0x2a, 0x2a, 0x0c, 0x52, 0x65, + 0x73, 0x65, 0x74, 0x20, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x32, 0x1a, 0x72, 0x65, 0x73, 0x65, + 0x74, 0x20, 0x65, 0x78, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x65, 0x6c, 0x6d, 0x20, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x52, 0x0b, 0x72, 0x65, 0x73, 0x65, 0x74, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x73, 0x12, 0x4a, 0x0a, 0x0b, 0x72, 0x65, 0x75, 0x73, 0x65, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x42, 0x28, 0x92, 0x41, 0x25, 0x2a, 0x0c, 0x52, + 0x65, 0x75, 0x73, 0x65, 0x20, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x32, 0x15, 0x72, 0x65, 0x75, + 0x73, 0x65, 0x20, 0x65, 0x78, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x52, 0x0b, 0x72, 0x65, 0x75, 0x73, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, + 0x53, 0x0a, 0x09, 0x73, 0x65, 0x74, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x09, 0x20, 0x03, + 0x28, 0x09, 0x42, 0x35, 0x92, 0x41, 0x32, 0x2a, 0x0a, 0x53, 0x65, 0x74, 0x20, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x32, 0x24, 0x70, 0x61, 0x73, 0x73, 0x20, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, + 0x20, 0x68, 0x65, 0x6c, 0x6d, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x20, 0x61, 0x73, 0x20, + 0x6b, 0x65, 0x79, 0x3d, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x09, 0x73, 0x65, 0x74, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x12, 0x3f, 0x0a, 0x08, 0x73, 0x6b, 0x69, 0x70, 0x43, 0x52, 0x44, 0x73, + 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x42, 0x23, 0x92, 0x41, 0x20, 0x2a, 0x09, 0x53, 0x6b, 0x69, + 0x70, 0x20, 0x43, 0x52, 0x44, 0x73, 0x32, 0x13, 0x73, 0x6b, 0x69, 0x70, 0x20, 0x64, 0x65, 0x70, + 0x6c, 0x6f, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x63, 0x72, 0x64, 0x73, 0x52, 0x08, 0x73, 0x6b, 0x69, + 0x70, 0x43, 0x52, 0x44, 0x73, 0x12, 0x5d, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, + 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x42, 0x43, 0x92, 0x41, 0x40, 0x2a, 0x07, 0x54, 0x69, 0x6d, + 0x65, 0x6f, 0x75, 0x74, 0x32, 0x35, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x20, 0x66, 0x6f, + 0x72, 0x20, 0x77, 0x61, 0x69, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, + 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x62, + 0x65, 0x63, 0x6f, 0x6d, 0x65, 0x20, 0x72, 0x65, 0x61, 0x64, 0x79, 0x52, 0x07, 0x74, 0x69, 0x6d, + 0x65, 0x6f, 0x75, 0x74, 0x12, 0x71, 0x0a, 0x0d, 0x63, 0x6c, 0x65, 0x61, 0x6e, 0x55, 0x70, 0x4f, + 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x42, 0x4b, 0x92, 0x41, 0x48, + 0x2a, 0x0f, 0x43, 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, 0x20, 0x6f, 0x6e, 0x20, 0x66, 0x61, 0x69, + 0x6c, 0x32, 0x35, 0x63, 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, 0x20, 0x64, 0x65, 0x70, 0x6c, 0x6f, + 0x79, 0x65, 0x64, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x20, 0x77, 0x68, + 0x65, 0x6e, 0x20, 0x63, 0x68, 0x61, 0x72, 0x74, 0x20, 0x66, 0x61, 0x69, 0x6c, 0x73, 0x20, 0x74, + 0x6f, 0x20, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x52, 0x0d, 0x63, 0x6c, 0x65, 0x61, 0x6e, 0x55, + 0x70, 0x4f, 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x12, 0x56, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x42, 0x34, 0x92, 0x41, + 0x31, 0x2a, 0x0b, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x22, + 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x20, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x6c, 0x65, 0x61, + 0x73, 0x65, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x91, 0x01, 0x0a, 0x18, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4f, 0x70, 0x65, 0x6e, 0x41, + 0x50, 0x49, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0e, 0x20, 0x01, + 0x28, 0x08, 0x42, 0x55, 0x92, 0x41, 0x52, 0x2a, 0x1a, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, + 0x20, 0x4f, 0x70, 0x65, 0x6e, 0x41, 0x50, 0x49, 0x20, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x32, 0x34, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x4f, 0x70, 0x65, + 0x6e, 0x41, 0x50, 0x49, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, + 0x77, 0x68, 0x69, 0x6c, 0x65, 0x20, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x69, 0x6e, 0x67, 0x20, + 0x74, 0x68, 0x65, 0x20, 0x63, 0x68, 0x61, 0x72, 0x74, 0x52, 0x18, 0x64, 0x69, 0x73, 0x61, 0x62, + 0x6c, 0x65, 0x4f, 0x70, 0x65, 0x6e, 0x41, 0x50, 0x49, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x5c, 0x0a, 0x0b, 0x6b, 0x65, 0x65, 0x70, 0x48, 0x69, 0x73, 0x74, 0x6f, + 0x72, 0x79, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x42, 0x3a, 0x92, 0x41, 0x37, 0x2a, 0x0c, 0x4b, + 0x65, 0x65, 0x70, 0x20, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x32, 0x27, 0x6b, 0x65, 0x65, + 0x70, 0x20, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x20, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, + 0x79, 0x20, 0x61, 0x66, 0x74, 0x65, 0x72, 0x20, 0x75, 0x6e, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, + 0x6c, 0x69, 0x6e, 0x67, 0x52, 0x0b, 0x6b, 0x65, 0x65, 0x70, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, + 0x79, 0x3a, 0x96, 0x01, 0x92, 0x41, 0x92, 0x01, 0x0a, 0x34, 0x2a, 0x0c, 0x48, 0x65, 0x6c, 0x6d, + 0x20, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x32, 0x24, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x69, 0x6e, 0x67, 0x20, + 0x48, 0x65, 0x6c, 0x6d, 0x20, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x73, 0x32, 0x5a, + 0x7b, 0x22, 0x61, 0x74, 0x6f, 0x6d, 0x69, 0x63, 0x22, 0x3a, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, + 0x2c, 0x22, 0x6e, 0x6f, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x22, 0x3a, 0x20, 0x74, 0x72, 0x75, 0x65, + 0x2c, 0x22, 0x73, 0x6b, 0x69, 0x70, 0x43, 0x52, 0x44, 0x73, 0x22, 0x3a, 0x20, 0x74, 0x72, 0x75, + 0x65, 0x2c, 0x22, 0x73, 0x65, 0x74, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x3a, 0x20, 0x5b, + 0x22, 0x6b, 0x65, 0x79, 0x31, 0x3d, 0x76, 0x61, 0x6c, 0x31, 0x22, 0x2c, 0x20, 0x22, 0x6b, 0x65, + 0x79, 0x32, 0x3d, 0x76, 0x61, 0x6c, 0x32, 0x22, 0x5d, 0x7d, 0x22, 0xd6, 0x02, 0x0a, 0x0b, 0x59, + 0x41, 0x4d, 0x4c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x46, 0x0a, 0x05, 0x66, 0x6f, + 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x42, 0x30, 0x92, 0x41, 0x2d, 0x2a, 0x05, + 0x46, 0x6f, 0x72, 0x63, 0x65, 0x32, 0x24, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x20, 0x59, 0x41, + 0x4d, 0x4c, 0x20, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x20, 0x77, 0x69, 0x74, 0x68, + 0x20, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x20, 0x66, 0x6c, 0x61, 0x67, 0x52, 0x05, 0x66, 0x6f, 0x72, + 0x63, 0x65, 0x12, 0x90, 0x01, 0x0a, 0x18, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4f, 0x70, + 0x65, 0x6e, 0x41, 0x50, 0x49, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x08, 0x42, 0x54, 0x92, 0x41, 0x51, 0x2a, 0x1a, 0x44, 0x69, 0x73, 0x61, + 0x62, 0x6c, 0x65, 0x20, 0x4f, 0x70, 0x65, 0x6e, 0x41, 0x50, 0x49, 0x20, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x33, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x20, + 0x4f, 0x70, 0x65, 0x6e, 0x41, 0x50, 0x49, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x20, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x20, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x69, + 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x59, 0x41, 0x4d, 0x4c, 0x52, 0x18, 0x64, 0x69, 0x73, + 0x61, 0x62, 0x6c, 0x65, 0x4f, 0x70, 0x65, 0x6e, 0x41, 0x50, 0x49, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x6c, 0x92, 0x41, 0x69, 0x0a, 0x34, 0x2a, 0x0c, 0x59, 0x41, + 0x4d, 0x4c, 0x20, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x32, 0x24, 0x6f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x69, 0x6e, + 0x67, 0x20, 0x59, 0x41, 0x4d, 0x4c, 0x20, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x73, + 0x32, 0x31, 0x7b, 0x22, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0x3a, 0x20, 0x66, 0x61, 0x6c, 0x73, + 0x65, 0x2c, 0x22, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4f, 0x70, 0x65, 0x6e, 0x41, 0x50, + 0x49, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3a, 0x20, 0x74, 0x72, + 0x75, 0x65, 0x7d, 0x42, 0x85, 0x02, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x61, 0x66, 0x61, + 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x76, 0x33, 0x42, 0x0e, 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x73, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x52, 0x61, 0x66, 0x61, 0x79, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x73, + 0x2f, 0x72, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2f, 0x76, 0x33, 0x3b, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x76, 0x33, 0xa2, 0x02, 0x04, 0x52, 0x44, 0x54, 0x43, 0xaa, 0x02, 0x19, 0x52, 0x61, + 0x66, 0x61, 0x79, 0x2e, 0x44, 0x65, 0x76, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x56, 0x33, 0xca, 0x02, 0x19, 0x52, 0x61, 0x66, 0x61, 0x79, 0x5c, + 0x44, 0x65, 0x76, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x5c, 0x56, 0x33, 0xe2, 0x02, 0x25, 0x52, 0x61, 0x66, 0x61, 0x79, 0x5c, 0x44, 0x65, 0x76, 0x5c, + 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5c, 0x56, 0x33, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1d, 0x52, 0x61, + 0x66, 0x61, 0x79, 0x3a, 0x3a, 0x44, 0x65, 0x76, 0x3a, 0x3a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x3a, + 0x3a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_proto_types_commonpb_v3_artifacts_proto_rawDescOnce sync.Once + file_proto_types_commonpb_v3_artifacts_proto_rawDescData = file_proto_types_commonpb_v3_artifacts_proto_rawDesc +) + +func file_proto_types_commonpb_v3_artifacts_proto_rawDescGZIP() []byte { + file_proto_types_commonpb_v3_artifacts_proto_rawDescOnce.Do(func() { + file_proto_types_commonpb_v3_artifacts_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_types_commonpb_v3_artifacts_proto_rawDescData) + }) + return file_proto_types_commonpb_v3_artifacts_proto_rawDescData +} + +var file_proto_types_commonpb_v3_artifacts_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_proto_types_commonpb_v3_artifacts_proto_goTypes = []interface{}{ + (*File)(nil), // 0: rafay.dev.types.common.v3.File + (*UploadedYAMLArtifact)(nil), // 1: rafay.dev.types.common.v3.UploadedYAMLArtifact + (*UploadedHelmArtifact)(nil), // 2: rafay.dev.types.common.v3.UploadedHelmArtifact + (*YAMLInGitRepo)(nil), // 3: rafay.dev.types.common.v3.YAMLInGitRepo + (*HelmInGitRepo)(nil), // 4: rafay.dev.types.common.v3.HelmInGitRepo + (*HelmInHelmRepo)(nil), // 5: rafay.dev.types.common.v3.HelmInHelmRepo + (*ManagedAlertManager)(nil), // 6: rafay.dev.types.common.v3.ManagedAlertManager + (*ArtifactSpec)(nil), // 7: rafay.dev.types.common.v3.ArtifactSpec + (*HelmOptions)(nil), // 8: rafay.dev.types.common.v3.HelmOptions + (*YAMLOptions)(nil), // 9: rafay.dev.types.common.v3.YAMLOptions +} +var file_proto_types_commonpb_v3_artifacts_proto_depIdxs = []int32{ + 0, // 0: rafay.dev.types.common.v3.UploadedYAMLArtifact.paths:type_name -> rafay.dev.types.common.v3.File + 0, // 1: rafay.dev.types.common.v3.UploadedHelmArtifact.chartPath:type_name -> rafay.dev.types.common.v3.File + 0, // 2: rafay.dev.types.common.v3.UploadedHelmArtifact.valuesPaths:type_name -> rafay.dev.types.common.v3.File + 0, // 3: rafay.dev.types.common.v3.YAMLInGitRepo.paths:type_name -> rafay.dev.types.common.v3.File + 0, // 4: rafay.dev.types.common.v3.HelmInGitRepo.chartPath:type_name -> rafay.dev.types.common.v3.File + 0, // 5: rafay.dev.types.common.v3.HelmInGitRepo.valuesPaths:type_name -> rafay.dev.types.common.v3.File + 0, // 6: rafay.dev.types.common.v3.HelmInHelmRepo.valuesPaths:type_name -> rafay.dev.types.common.v3.File + 0, // 7: rafay.dev.types.common.v3.ManagedAlertManager.configmap:type_name -> rafay.dev.types.common.v3.File + 0, // 8: rafay.dev.types.common.v3.ManagedAlertManager.secret:type_name -> rafay.dev.types.common.v3.File + 0, // 9: rafay.dev.types.common.v3.ManagedAlertManager.configuration:type_name -> rafay.dev.types.common.v3.File + 0, // 10: rafay.dev.types.common.v3.ManagedAlertManager.statefulset:type_name -> rafay.dev.types.common.v3.File + 1, // 11: rafay.dev.types.common.v3.ArtifactSpec.uploadedYAML:type_name -> rafay.dev.types.common.v3.UploadedYAMLArtifact + 2, // 12: rafay.dev.types.common.v3.ArtifactSpec.uploadedHelm:type_name -> rafay.dev.types.common.v3.UploadedHelmArtifact + 3, // 13: rafay.dev.types.common.v3.ArtifactSpec.yamlInGitRepo:type_name -> rafay.dev.types.common.v3.YAMLInGitRepo + 4, // 14: rafay.dev.types.common.v3.ArtifactSpec.helmInGitRepo:type_name -> rafay.dev.types.common.v3.HelmInGitRepo + 5, // 15: rafay.dev.types.common.v3.ArtifactSpec.helmInHelmRepo:type_name -> rafay.dev.types.common.v3.HelmInHelmRepo + 6, // 16: rafay.dev.types.common.v3.ArtifactSpec.managedAlertManger:type_name -> rafay.dev.types.common.v3.ManagedAlertManager + 8, // 17: rafay.dev.types.common.v3.ArtifactSpec.helmOptions:type_name -> rafay.dev.types.common.v3.HelmOptions + 9, // 18: rafay.dev.types.common.v3.ArtifactSpec.yamlOptions:type_name -> rafay.dev.types.common.v3.YAMLOptions + 19, // [19:19] is the sub-list for method output_type + 19, // [19:19] is the sub-list for method input_type + 19, // [19:19] is the sub-list for extension type_name + 19, // [19:19] is the sub-list for extension extendee + 0, // [0:19] is the sub-list for field type_name +} + +func init() { file_proto_types_commonpb_v3_artifacts_proto_init() } +func file_proto_types_commonpb_v3_artifacts_proto_init() { + if File_proto_types_commonpb_v3_artifacts_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_proto_types_commonpb_v3_artifacts_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*File); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_types_commonpb_v3_artifacts_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UploadedYAMLArtifact); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_types_commonpb_v3_artifacts_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UploadedHelmArtifact); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_types_commonpb_v3_artifacts_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*YAMLInGitRepo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_types_commonpb_v3_artifacts_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HelmInGitRepo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_types_commonpb_v3_artifacts_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HelmInHelmRepo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_types_commonpb_v3_artifacts_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ManagedAlertManager); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_types_commonpb_v3_artifacts_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ArtifactSpec); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_types_commonpb_v3_artifacts_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HelmOptions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_types_commonpb_v3_artifacts_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*YAMLOptions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_proto_types_commonpb_v3_artifacts_proto_msgTypes[7].OneofWrappers = []interface{}{ + (*ArtifactSpec_UploadedYAML)(nil), + (*ArtifactSpec_UploadedHelm)(nil), + (*ArtifactSpec_YamlInGitRepo)(nil), + (*ArtifactSpec_HelmInGitRepo)(nil), + (*ArtifactSpec_HelmInHelmRepo)(nil), + (*ArtifactSpec_ManagedAlertManger)(nil), + (*ArtifactSpec_HelmOptions)(nil), + (*ArtifactSpec_YamlOptions)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_proto_types_commonpb_v3_artifacts_proto_rawDesc, + NumEnums: 0, + NumMessages: 10, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_proto_types_commonpb_v3_artifacts_proto_goTypes, + DependencyIndexes: file_proto_types_commonpb_v3_artifacts_proto_depIdxs, + MessageInfos: file_proto_types_commonpb_v3_artifacts_proto_msgTypes, + }.Build() + File_proto_types_commonpb_v3_artifacts_proto = out.File + file_proto_types_commonpb_v3_artifacts_proto_rawDesc = nil + file_proto_types_commonpb_v3_artifacts_proto_goTypes = nil + file_proto_types_commonpb_v3_artifacts_proto_depIdxs = nil +} diff --git a/components/common/proto/types/commonpb/v3/artifacts.proto b/components/common/proto/types/commonpb/v3/artifacts.proto new file mode 100644 index 0000000..635d098 --- /dev/null +++ b/components/common/proto/types/commonpb/v3/artifacts.proto @@ -0,0 +1,379 @@ +syntax = "proto3"; + +package rafay.dev.types.common.v3; + +import "protoc-gen-openapiv2/options/annotations.proto"; +import "google/api/field_behavior.proto"; + +message File { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema : { + title : "File" + description : "file represents an file (or a directory) on the File " + "System by relative path" + required : [ "name" ] + } + example : "{" + "\"name\": \"some-name\"," + "\"project\": \"defaultproject\"" + "}" + }; + string name = 1 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Name", + description : "relative path of a artifact" + } ]; + bytes data = 2 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Data", + description : "data is the base64 encoded contents of the file" + } ]; +} + +message UploadedYAMLArtifact { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema : { + title : "Uploaded YAML Artifact" + description : "represents a list of YAML files" + required : [ "paths" ] + } + example : "{" + "\"paths\": [{" + "\"name\": \"file://relative/path/to/some/file.yaml\"" + "}]" + "}" + }; + repeated File paths = 1 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Paths", + description : "list of YAML files represented by their relative path" + } ]; +} + +message UploadedHelmArtifact { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema : { + title : "Uploaded Helm Artifact" + description : "represents an Helm chart and zero or more values files" + required : [ "chartPath" ] + } + example : "{" + "\"chartPath\": [{" + "\"name\": \"file://relative/path/to/some/chart.tgz\"" + "}]" + "}" + }; + File chartPath = 1 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "ChartPath", + description : "represents a Helm Chart by its relative path" + } ]; + repeated File valuesPaths = 2 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "ValuesPaths", + description : "represents a Helm Values by their relative path" + } ]; +} + +message YAMLInGitRepo { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema : { + title : "YAML In Git Repo Artifact" + description : "represents YAML files in a Git repo" + required : [ "repository", "revision", "paths" ] + } + example : "{" + "\"repository\": \"some-repo\"," + "\"revision\": \"master\"," + "\"paths\": [{" + "\"name\": \"relative/path/to/some/file.yaml\"" + "}]" + "}" + }; + string repository = 1 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Repository", + description : "name of the git repository" + } ]; + string revision = 2 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Revision", + description : "branch or tag in the git repository" + } ]; + repeated File paths = 3 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Paths", + description : "relative paths to file in the git repository" + } ]; +} + +message HelmInGitRepo { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema : { + title : "Helm in Git Repo Artifact" + description : "represents Helm files in a Git repo" + required : [ "repository", "revision", "chartPath" ] + } + example : "{" + "\"repository\": \"some-repo\"," + "\"revision\": \"master\"," + "\"chartPath\": {" + "\"name\": \"relative/path/to/some/chart.tgz\"" + "}" + "}" + }; + string repository = 1 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Repository", + description : "name of the git repository" + } ]; + string revision = 2 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Revision", + description : "branch or tag in the git repository" + } ]; + File chartPath = 3 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Chart Path", + description : "relative path to chart file in the git repository" + } ]; + repeated File valuesPaths = 4 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Value Paths", + description : "relative paths to value file in the git repository" + } ]; +} + +message HelmInHelmRepo { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema : { + title : "Helm in Helm Repo" + description : "represents Helm chart in a Helm repo" + required : [ "repository", "chartName", "chartVersion" ] + } + example : "{" + "\"repository\": \"some-repo\"," + "\"chartName\": \"some-chart\"," + "\"chartVersion\": \"1.2.3\"" + "}" + }; + string repository = 1 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Repository", + description : "name of the helm repository" + } ]; + string chartName = 2 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Chart Name", + description : "name of the chart" + } ]; + string chartVersion = 3 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Chart Version", + description : "version of the chart" + } ]; + repeated File valuesPaths = 4 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Values Paths", + description : "relative paths to values files" + } ]; +} + +message ManagedAlertManager { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema : { + title : "Managed Alert Manager" + description : "represents managed alert manager" + required : [ "configmap", "secret", "configuration", "statefulset" ] + } + example : "{" + "\"configmap\": {" + "\"name\": \"file://path/to/some-configmap.yaml\"" + "}," + "\"secret\": {" + "\"name\": \"file://path/to/some-secret.yaml\"" + "}," + "\"configuration\": {" + "\"name\": \"file://path/to/some-configuration.yaml\"" + "}," + "\"statefulset\": {" + "\"name\": \"file://path/to/some-statefulset.yaml\"" + "}" + "}" + }; + File configmap = 1 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Config Map", + description : "relative paths to alert manager configmap file" + } ]; + File secret = 2 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Secret", + description : "relative paths to alert manager secret file" + } ]; + File configuration = 3 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Secret", + description : "relative paths to alert manager configuration file" + } ]; + File statefulset = 4 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Secret", + description : "relative paths to alert manager statefulset file" + } ]; +} + +message ArtifactSpec { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema : { + title : "ArtifactSpec" + description : "ArtifactSpec" + required : [ "type", "artifact" ] + } + example : "{" + "\"type\": \"Helm\"," + "\"artifact\": {" + "\"repository\": \"some-repo\"," + "\"revision\": \"master\"," + "\"chartPath\": {" + "\"name\": \"relative/path/to/some/chart.tgz\"" + "}" + "}" + "}" + }; + string type = 1 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Artifact Type", + description : "type of the artifact" + enum : [ "Helm", "Yaml", "AlertManager" ] + } ]; + + oneof artifact { + UploadedYAMLArtifact uploadedYAML = 10; + UploadedHelmArtifact uploadedHelm = 11; + YAMLInGitRepo yamlInGitRepo = 12; + HelmInGitRepo helmInGitRepo = 13; + HelmInHelmRepo helmInHelmRepo = 14; + ManagedAlertManager managedAlertManger = 15; + } + oneof options { + HelmOptions helmOptions = 30; + YAMLOptions yamlOptions = 31; + } +} + +// $title: Helm Options +// $description: options for deploying Helm artifacts +message HelmOptions { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema : { + title : "Helm Options" + description : "options for deploying Helm artifacts" + } + example : "{" + "\"atomic\": false," + "\"noHooks\": true," + "\"skipCRDs\": true," + "\"setString\": [\"key1=val1\", \"key2=val2\"]" + "}" + }; + bool atomic = 1 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Atomic", + description : "deploy Helm artifact with atomic flag" + } ]; + bool wait = 2 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Wait", + description : "deploy Helm artifact with wait flag" + } ]; + bool force = 3 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Force", + description : "deploy Helm artifact with force flag" + } ]; + bool noHooks = 4 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "No Hooks", + description : "deploy Helm artifact without hooks" + } ]; + sint32 maxHistory = 5 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Max History", + description : "limit Helm artifact history" + } ]; + bool renderSubChartNotes = 6 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Render Sub Chart Notes", + description : "render sub chart notes" + } ]; + bool resetValues = 7 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Reset Values", + description : "reset existing helm values" + } ]; + bool reuseValues = 8 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Reuse Values", + description : "reuse existing values" + } ]; + repeated string setString = 9 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Set String", + description : "pass custom helm values as key=value" + } ]; + bool skipCRDs = 10 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Skip CRDs", + description : "skip deploying crds" + } ]; + string timeout = 11 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Timeout", + description : "timeout for waiting for the resources to become ready" + } ]; + bool cleanUpOnFail = 12 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Cleanup on fail", + description : "cleanup deployed resources when chart fails to deploy" + } ]; + string description = 13 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Description", + description : "custom description for the release" + } ]; + bool disableOpenAPIValidation = 14 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Disable OpenAPI Validation", + description : "disable OpenAPI validation while deploying the chart" + } ]; + bool keepHistory = 15 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Keep History", + description : "keep release history after uninstalling" + } ]; +} + +message YAMLOptions { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema : { + title : "YAML Options" + description : "options for deploying YAML artifacts" + } + example : "{" + "\"force\": false," + "\"disableOpenAPIValidation\": true" + "}" + }; + + bool force = 1 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Force", + description : "deploy YAML artifact with force flag" + } ]; + bool disableOpenAPIValidation = 2 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Disable OpenAPI Validation", + description : "disable OpenAPI validation while deploying the YAML" + } ]; +} diff --git a/components/common/proto/types/commonpb/v3/common.pb.go b/components/common/proto/types/commonpb/v3/common.pb.go new file mode 100644 index 0000000..24d1d3e --- /dev/null +++ b/components/common/proto/types/commonpb/v3/common.pb.go @@ -0,0 +1,1072 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc (unknown) +// source: proto/types/commonpb/v3/common.proto + +package commonv3 + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// $title: ConditionStatus +// $description: status of a condition for a resource +type ConditionStatus int32 + +const ( + ConditionStatus_StatusNotSet ConditionStatus = 0 + ConditionStatus_StatusSubmitted ConditionStatus = 1 + ConditionStatus_StatusOK ConditionStatus = 2 + ConditionStatus_StatusFailed ConditionStatus = 3 +) + +// Enum value maps for ConditionStatus. +var ( + ConditionStatus_name = map[int32]string{ + 0: "StatusNotSet", + 1: "StatusSubmitted", + 2: "StatusOK", + 3: "StatusFailed", + } + ConditionStatus_value = map[string]int32{ + "StatusNotSet": 0, + "StatusSubmitted": 1, + "StatusOK": 2, + "StatusFailed": 3, + } +) + +func (x ConditionStatus) Enum() *ConditionStatus { + p := new(ConditionStatus) + *p = x + return p +} + +func (x ConditionStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ConditionStatus) Descriptor() protoreflect.EnumDescriptor { + return file_proto_types_commonpb_v3_common_proto_enumTypes[0].Descriptor() +} + +func (ConditionStatus) Type() protoreflect.EnumType { + return &file_proto_types_commonpb_v3_common_proto_enumTypes[0] +} + +func (x ConditionStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ConditionStatus.Descriptor instead. +func (ConditionStatus) EnumDescriptor() ([]byte, []int) { + return file_proto_types_commonpb_v3_common_proto_rawDescGZIP(), []int{0} +} + +type Metadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + Labels map[string]string `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Annotations map[string]string `protobuf:"bytes,4,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Project string `protobuf:"bytes,5,opt,name=project,proto3" json:"project,omitempty"` + Organization string `protobuf:"bytes,6,opt,name=organization,proto3" json:"organization,omitempty"` + Partner string `protobuf:"bytes,7,opt,name=partner,proto3" json:"partner,omitempty"` + Id string `protobuf:"bytes,8,opt,name=id,proto3" json:"id,omitempty"` + ModifiedAt *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=modifiedAt,proto3" json:"modifiedAt,omitempty"` +} + +func (x *Metadata) Reset() { + *x = Metadata{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_types_commonpb_v3_common_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Metadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Metadata) ProtoMessage() {} + +func (x *Metadata) ProtoReflect() protoreflect.Message { + mi := &file_proto_types_commonpb_v3_common_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Metadata.ProtoReflect.Descriptor instead. +func (*Metadata) Descriptor() ([]byte, []int) { + return file_proto_types_commonpb_v3_common_proto_rawDescGZIP(), []int{0} +} + +func (x *Metadata) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Metadata) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Metadata) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +func (x *Metadata) GetAnnotations() map[string]string { + if x != nil { + return x.Annotations + } + return nil +} + +func (x *Metadata) GetProject() string { + if x != nil { + return x.Project + } + return "" +} + +func (x *Metadata) GetOrganization() string { + if x != nil { + return x.Organization + } + return "" +} + +func (x *Metadata) GetPartner() string { + if x != nil { + return x.Partner + } + return "" +} + +func (x *Metadata) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Metadata) GetModifiedAt() *timestamppb.Timestamp { + if x != nil { + return x.ModifiedAt + } + return nil +} + +type ProjectMeta struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *ProjectMeta) Reset() { + *x = ProjectMeta{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_types_commonpb_v3_common_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProjectMeta) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProjectMeta) ProtoMessage() {} + +func (x *ProjectMeta) ProtoReflect() protoreflect.Message { + mi := &file_proto_types_commonpb_v3_common_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProjectMeta.ProtoReflect.Descriptor instead. +func (*ProjectMeta) Descriptor() ([]byte, []int) { + return file_proto_types_commonpb_v3_common_proto_rawDescGZIP(), []int{1} +} + +func (x *ProjectMeta) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ProjectMeta) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type SharingSpec struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` + Projects []*ProjectMeta `protobuf:"bytes,2,rep,name=projects,proto3" json:"projects,omitempty"` +} + +func (x *SharingSpec) Reset() { + *x = SharingSpec{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_types_commonpb_v3_common_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SharingSpec) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SharingSpec) ProtoMessage() {} + +func (x *SharingSpec) ProtoReflect() protoreflect.Message { + mi := &file_proto_types_commonpb_v3_common_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SharingSpec.ProtoReflect.Descriptor instead. +func (*SharingSpec) Descriptor() ([]byte, []int) { + return file_proto_types_commonpb_v3_common_proto_rawDescGZIP(), []int{2} +} + +func (x *SharingSpec) GetEnabled() bool { + if x != nil { + return x.Enabled + } + return false +} + +func (x *SharingSpec) GetProjects() []*ProjectMeta { + if x != nil { + return x.Projects + } + return nil +} + +type DriftSpec struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` + Action string `protobuf:"bytes,2,opt,name=action,proto3" json:"action,omitempty"` +} + +func (x *DriftSpec) Reset() { + *x = DriftSpec{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_types_commonpb_v3_common_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DriftSpec) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DriftSpec) ProtoMessage() {} + +func (x *DriftSpec) ProtoReflect() protoreflect.Message { + mi := &file_proto_types_commonpb_v3_common_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DriftSpec.ProtoReflect.Descriptor instead. +func (*DriftSpec) Descriptor() ([]byte, []int) { + return file_proto_types_commonpb_v3_common_proto_rawDescGZIP(), []int{3} +} + +func (x *DriftSpec) GetEnabled() bool { + if x != nil { + return x.Enabled + } + return false +} + +func (x *DriftSpec) GetAction() string { + if x != nil { + return x.Action + } + return "" +} + +// $title: ListMetadata +// $description: metadata for a list of resources +// $required: enabled +type ListMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Count int64 `protobuf:"zigzag64,1,opt,name=count,proto3" json:"count,omitempty"` + Offset int64 `protobuf:"zigzag64,2,opt,name=offset,proto3" json:"offset,omitempty"` + Limt int64 `protobuf:"zigzag64,3,opt,name=limt,proto3" json:"limt,omitempty"` +} + +func (x *ListMetadata) Reset() { + *x = ListMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_types_commonpb_v3_common_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListMetadata) ProtoMessage() {} + +func (x *ListMetadata) ProtoReflect() protoreflect.Message { + mi := &file_proto_types_commonpb_v3_common_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListMetadata.ProtoReflect.Descriptor instead. +func (*ListMetadata) Descriptor() ([]byte, []int) { + return file_proto_types_commonpb_v3_common_proto_rawDescGZIP(), []int{4} +} + +func (x *ListMetadata) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +func (x *ListMetadata) GetOffset() int64 { + if x != nil { + return x.Offset + } + return 0 +} + +func (x *ListMetadata) GetLimt() int64 { + if x != nil { + return x.Limt + } + return 0 +} + +type PlacementLabel struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *PlacementLabel) Reset() { + *x = PlacementLabel{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_types_commonpb_v3_common_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlacementLabel) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlacementLabel) ProtoMessage() {} + +func (x *PlacementLabel) ProtoReflect() protoreflect.Message { + mi := &file_proto_types_commonpb_v3_common_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PlacementLabel.ProtoReflect.Descriptor instead. +func (*PlacementLabel) Descriptor() ([]byte, []int) { + return file_proto_types_commonpb_v3_common_proto_rawDescGZIP(), []int{5} +} + +func (x *PlacementLabel) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *PlacementLabel) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type PlacementSpec struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Labels []*PlacementLabel `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty"` + Selector string `protobuf:"bytes,2,opt,name=selector,proto3" json:"selector,omitempty"` +} + +func (x *PlacementSpec) Reset() { + *x = PlacementSpec{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_types_commonpb_v3_common_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlacementSpec) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlacementSpec) ProtoMessage() {} + +func (x *PlacementSpec) ProtoReflect() protoreflect.Message { + mi := &file_proto_types_commonpb_v3_common_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PlacementSpec.ProtoReflect.Descriptor instead. +func (*PlacementSpec) Descriptor() ([]byte, []int) { + return file_proto_types_commonpb_v3_common_proto_rawDescGZIP(), []int{6} +} + +func (x *PlacementSpec) GetLabels() []*PlacementLabel { + if x != nil { + return x.Labels + } + return nil +} + +func (x *PlacementSpec) GetSelector() string { + if x != nil { + return x.Selector + } + return "" +} + +type Status struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ConditionType string `protobuf:"bytes,1,opt,name=conditionType,proto3" json:"conditionType,omitempty"` + ConditionStatus ConditionStatus `protobuf:"varint,2,opt,name=conditionStatus,proto3,enum=rafay.dev.types.common.v3.ConditionStatus" json:"conditionStatus,omitempty"` + LastUpdated *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=lastUpdated,proto3" json:"lastUpdated,omitempty"` + Reason string `protobuf:"bytes,4,opt,name=reason,proto3" json:"reason,omitempty"` +} + +func (x *Status) Reset() { + *x = Status{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_types_commonpb_v3_common_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Status) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Status) ProtoMessage() {} + +func (x *Status) ProtoReflect() protoreflect.Message { + mi := &file_proto_types_commonpb_v3_common_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Status.ProtoReflect.Descriptor instead. +func (*Status) Descriptor() ([]byte, []int) { + return file_proto_types_commonpb_v3_common_proto_rawDescGZIP(), []int{7} +} + +func (x *Status) GetConditionType() string { + if x != nil { + return x.ConditionType + } + return "" +} + +func (x *Status) GetConditionStatus() ConditionStatus { + if x != nil { + return x.ConditionStatus + } + return ConditionStatus_StatusNotSet +} + +func (x *Status) GetLastUpdated() *timestamppb.Timestamp { + if x != nil { + return x.LastUpdated + } + return nil +} + +func (x *Status) GetReason() string { + if x != nil { + return x.Reason + } + return "" +} + +// HttpBody represents arbitrary HTTP Body. It should only be used for +// payload formats that can't be represented as JSON +type HttpBody struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The HTTP Content-Type header value specifying the content type of the body. + ContentType string `protobuf:"bytes,1,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"` + // The HTTP request/response body as raw binary. + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *HttpBody) Reset() { + *x = HttpBody{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_types_commonpb_v3_common_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HttpBody) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HttpBody) ProtoMessage() {} + +func (x *HttpBody) ProtoReflect() protoreflect.Message { + mi := &file_proto_types_commonpb_v3_common_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HttpBody.ProtoReflect.Descriptor instead. +func (*HttpBody) Descriptor() ([]byte, []int) { + return file_proto_types_commonpb_v3_common_proto_rawDescGZIP(), []int{8} +} + +func (x *HttpBody) GetContentType() string { + if x != nil { + return x.ContentType + } + return "" +} + +func (x *HttpBody) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +var File_proto_types_commonpb_v3_common_proto protoreflect.FileDescriptor + +var file_proto_types_commonpb_v3_common_proto_rawDesc = []byte{ + 0x0a, 0x24, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2f, 0x76, 0x33, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, + 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, + 0x33, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, + 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, + 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0xbb, 0x07, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x12, 0x33, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1f, + 0x92, 0x41, 0x1c, 0x2a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x32, 0x14, 0x6e, 0x61, 0x6d, 0x65, 0x20, + 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x4f, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2d, 0x92, 0x41, 0x2a, 0x2a, + 0x0b, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x1b, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, + 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x6c, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, + 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x4c, 0x61, 0x62, 0x65, + 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x23, 0x92, 0x41, 0x20, 0x2a, 0x06, 0x4c, 0x61, + 0x62, 0x6c, 0x65, 0x73, 0x32, 0x16, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x20, 0x6f, 0x66, 0x20, + 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x06, 0x6c, 0x61, + 0x62, 0x65, 0x6c, 0x73, 0x12, 0x85, 0x01, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x72, 0x61, 0x66, + 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, + 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x42, 0x2d, 0x92, 0x41, 0x2a, 0x2a, 0x0b, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x32, 0x1b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, + 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, + 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3f, 0x0a, 0x07, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0x92, + 0x41, 0x22, 0x2a, 0x07, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x32, 0x17, 0x50, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x61, 0x0a, + 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x3d, 0x92, 0x41, 0x3a, 0x2a, 0x0c, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, + 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x2a, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x74, 0x68, + 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x62, 0x65, 0x6c, 0x6f, 0x6e, + 0x67, 0x73, 0x52, 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x4d, 0x0a, 0x07, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x33, 0x92, 0x41, 0x30, 0x2a, 0x07, 0x50, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x32, + 0x25, 0x50, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x20, 0x74, 0x6f, 0x20, 0x77, 0x68, 0x69, 0x63, + 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x62, + 0x65, 0x6c, 0x6f, 0x6e, 0x67, 0x73, 0x52, 0x07, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x65, 0x72, 0x12, + 0x14, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, + 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x40, 0x0a, 0x0a, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, + 0x64, 0x41, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x0a, 0x6d, 0x6f, 0x64, + 0x69, 0x66, 0x69, 0x65, 0x64, 0x41, 0x74, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x1a, 0x3e, 0x0a, 0x10, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x3a, 0x6d, 0x92, 0x41, 0x6a, 0x0a, 0x35, 0x2a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x32, 0x18, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x20, 0x6f, 0x66, + 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0xd2, 0x01, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0xd2, 0x01, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x32, 0x31, + 0x7b, 0x22, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x73, 0x6f, 0x6d, 0x65, 0x2d, 0x6e, + 0x61, 0x6d, 0x65, 0x22, 0x2c, 0x22, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x3a, 0x20, + 0x22, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x22, + 0x7d, 0x22, 0xa7, 0x01, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x74, + 0x61, 0x12, 0x32, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x1e, 0x92, 0x41, 0x1b, 0x2a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x32, 0x13, 0x6e, 0x61, 0x6d, 0x65, + 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x02, 0x69, 0x64, 0x3a, 0x4e, 0x92, 0x41, 0x4b, + 0x0a, 0x2d, 0x2a, 0x0b, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x32, + 0x17, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, + 0x20, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0xd2, 0x01, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x32, + 0x1a, 0x7b, 0x22, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x64, 0x65, 0x66, 0x61, 0x75, + 0x6c, 0x74, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x7d, 0x22, 0xe7, 0x02, 0x0a, 0x0b, + 0x53, 0x68, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x70, 0x65, 0x63, 0x12, 0x5a, 0x0a, 0x07, 0x65, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x42, 0x40, 0x92, 0x41, + 0x3d, 0x2a, 0x07, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x32, 0x32, 0x66, 0x6c, 0x61, 0x67, + 0x20, 0x74, 0x6f, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x69, 0x66, 0x20, 0x73, + 0x68, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x69, 0x73, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x07, + 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x7e, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x72, 0x61, 0x66, 0x61, + 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x74, + 0x61, 0x42, 0x3a, 0x92, 0x41, 0x37, 0x2a, 0x08, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, + 0x32, 0x2b, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x73, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x20, 0x69, 0x73, 0x20, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x52, 0x08, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x3a, 0x7c, 0x92, 0x41, 0x79, 0x0a, 0x3d, 0x2a, 0x0b, + 0x53, 0x68, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x70, 0x65, 0x63, 0x32, 0x24, 0x73, 0x68, 0x61, + 0x72, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0xd2, 0x01, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x32, 0x38, 0x7b, 0x22, 0x65, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, 0x3a, 0x20, 0x74, 0x72, 0x75, 0x65, 0x2c, 0x22, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x22, 0x3a, 0x20, 0x5b, 0x7b, 0x22, 0x6e, 0x61, 0x6d, + 0x65, 0x22, 0x3a, 0x20, 0x22, 0x73, 0x6f, 0x6d, 0x65, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x22, 0x7d, 0x5d, 0x7d, 0x22, 0xd0, 0x02, 0x0a, 0x09, 0x44, 0x72, 0x69, 0x66, 0x74, 0x53, + 0x70, 0x65, 0x63, 0x12, 0x67, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x08, 0x42, 0x4d, 0x92, 0x41, 0x4a, 0x2a, 0x07, 0x45, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x64, 0x32, 0x3f, 0x66, 0x6c, 0x61, 0x67, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x70, 0x65, 0x63, + 0x69, 0x66, 0x79, 0x20, 0x69, 0x66, 0x20, 0x64, 0x72, 0x69, 0x66, 0x74, 0x20, 0x72, 0x65, 0x63, + 0x6f, 0x6e, 0x63, 0x69, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x65, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x67, 0x0a, 0x06, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x4f, 0x92, 0x41, + 0x4c, 0x2a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x32, 0x66, 0x6c, 0x61, 0x67, 0x20, + 0x74, 0x6f, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x69, 0x66, 0x20, 0x73, 0x68, + 0x61, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x69, 0x73, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, + 0x20, 0x66, 0x6f, 0x72, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0xf2, 0x02, 0x06, + 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0xf2, 0x02, 0x04, 0x44, 0x65, 0x6e, 0x79, 0x52, 0x06, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x71, 0x92, 0x41, 0x6e, 0x0a, 0x48, 0x2a, 0x09, 0x44, 0x72, + 0x69, 0x66, 0x74, 0x53, 0x70, 0x65, 0x63, 0x32, 0x31, 0x64, 0x72, 0x69, 0x66, 0x74, 0x20, 0x72, + 0x65, 0x63, 0x6f, 0x6e, 0x63, 0x69, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x73, 0x70, + 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x20, + 0x61, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0xd2, 0x01, 0x07, 0x65, 0x6e, 0x61, + 0x62, 0x6c, 0x65, 0x64, 0x32, 0x22, 0x7b, 0x22, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, + 0x3a, 0x20, 0x74, 0x72, 0x75, 0x65, 0x2c, 0x22, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3a, + 0x20, 0x22, 0x44, 0x65, 0x6e, 0x79, 0x22, 0x7d, 0x22, 0x50, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x12, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, + 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x12, 0x52, 0x06, + 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6d, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x12, 0x52, 0x04, 0x6c, 0x69, 0x6d, 0x74, 0x22, 0xfa, 0x01, 0x0a, 0x0e, 0x50, + 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x36, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x24, 0x92, 0x41, 0x21, 0x2a, + 0x03, 0x4b, 0x65, 0x79, 0x32, 0x1a, 0x4b, 0x65, 0x79, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, + 0x20, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x6c, 0x61, 0x62, 0x65, 0x6c, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x3e, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x28, 0x92, 0x41, 0x25, 0x2a, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x32, 0x1c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, + 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x70, 0x92, 0x41, 0x6d, 0x0a, 0x40, 0x2a, 0x0e, 0x50, 0x6c, + 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x32, 0x20, 0x6c, 0x61, + 0x62, 0x65, 0x6c, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0xd2, 0x01, + 0x03, 0x6b, 0x65, 0x79, 0xd2, 0x01, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x32, 0x29, 0x7b, 0x22, + 0x6b, 0x65, 0x79, 0x22, 0x3a, 0x20, 0x22, 0x73, 0x6f, 0x6d, 0x65, 0x2d, 0x6b, 0x65, 0x79, 0x22, + 0x2c, 0x22, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x73, 0x6f, 0x6d, 0x65, 0x2d, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x7d, 0x22, 0xbe, 0x02, 0x0a, 0x0d, 0x50, 0x6c, 0x61, 0x63, + 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x70, 0x65, 0x63, 0x12, 0x6c, 0x0a, 0x06, 0x6c, 0x61, 0x62, + 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x72, 0x61, 0x66, 0x61, + 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x4c, + 0x61, 0x62, 0x65, 0x6c, 0x42, 0x29, 0x92, 0x41, 0x26, 0x2a, 0x06, 0x4c, 0x61, 0x62, 0x65, 0x6c, + 0x73, 0x32, 0x1c, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x6c, 0x61, 0x62, 0x65, 0x6c, + 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x4a, 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2e, 0x92, 0x41, 0x2b, 0x2a, 0x08, + 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x32, 0x1f, 0x4b, 0x75, 0x62, 0x65, 0x72, 0x6e, + 0x65, 0x74, 0x65, 0x73, 0x20, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x20, 0x6c, 0x61, 0x62, 0x65, 0x6c, + 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x3a, 0x73, 0x92, 0x41, 0x70, 0x0a, 0x37, 0x2a, 0x0d, 0x50, 0x6c, 0x61, 0x63, + 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x70, 0x65, 0x63, 0x32, 0x26, 0x70, 0x6c, 0x61, 0x63, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x32, 0x35, 0x7b, 0x22, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x22, 0x3a, 0x20, 0x5b, 0x7b, + 0x22, 0x6b, 0x65, 0x79, 0x22, 0x3a, 0x20, 0x22, 0x73, 0x6f, 0x6d, 0x65, 0x2d, 0x6b, 0x65, 0x79, + 0x22, 0x7d, 0x2c, 0x7b, 0x22, 0x6b, 0x65, 0x79, 0x22, 0x3a, 0x20, 0x22, 0x73, 0x6f, 0x6d, 0x65, + 0x2d, 0x6b, 0x65, 0x79, 0x22, 0x7d, 0x5d, 0x7d, 0x22, 0x98, 0x04, 0x0a, 0x06, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x59, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x33, 0x92, 0x41, 0x30, 0x2a, + 0x0e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x54, 0x79, 0x70, 0x65, 0x32, + 0x1c, 0x74, 0x79, 0x70, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x40, 0x01, 0x52, + 0x0d, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0xc1, + 0x01, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, + 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x42, 0x6b, 0x92, 0x41, 0x68, 0x2a, 0x10, 0x43, 0x6f, 0x6e, 0x64, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x32, 0x17, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x40, 0x01, 0xf2, 0x02, 0x0c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4e, + 0x6f, 0x74, 0x53, 0x65, 0x74, 0xf2, 0x02, 0x0f, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x75, + 0x62, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0xf2, 0x02, 0x08, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x4f, 0x4b, 0xf2, 0x02, 0x0c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, + 0x64, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x7c, 0x0a, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x42, 0x3e, 0x92, 0x41, 0x3b, 0x2a, 0x0c, 0x4c, 0x61, 0x73, 0x74, 0x20, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x32, 0x29, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x65, + 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x20, 0x69, 0x73, 0x20, 0x6c, 0x61, 0x73, 0x74, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x64, 0x40, 0x01, 0x52, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, + 0x12, 0x4a, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x32, 0x92, 0x41, 0x2f, 0x2a, 0x06, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x32, 0x23, 0x72, + 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x61, 0x73, + 0x74, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x40, 0x01, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x3a, 0x25, 0x92, 0x41, + 0x22, 0x0a, 0x20, 0x2a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x32, 0x14, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x40, 0x01, 0x22, 0x41, 0x0a, 0x08, 0x48, 0x74, 0x74, 0x70, 0x42, 0x6f, 0x64, 0x79, 0x12, + 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x2a, 0x58, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x4e, 0x6f, 0x74, 0x53, 0x65, 0x74, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x10, 0x01, + 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4f, 0x4b, 0x10, 0x02, 0x12, 0x10, + 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x10, 0x03, + 0x42, 0x82, 0x02, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, + 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x76, 0x33, 0x42, 0x0b, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x52, 0x61, + 0x66, 0x61, 0x79, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x73, 0x2f, 0x72, 0x63, 0x6c, 0x6f, 0x75, + 0x64, 0x2d, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x70, 0x62, 0x2f, 0x76, 0x33, 0x3b, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x76, 0x33, 0xa2, 0x02, + 0x04, 0x52, 0x44, 0x54, 0x43, 0xaa, 0x02, 0x19, 0x52, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x44, 0x65, + 0x76, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x56, + 0x33, 0xca, 0x02, 0x19, 0x52, 0x61, 0x66, 0x61, 0x79, 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x54, 0x79, + 0x70, 0x65, 0x73, 0x5c, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5c, 0x56, 0x33, 0xe2, 0x02, 0x25, + 0x52, 0x61, 0x66, 0x61, 0x79, 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, + 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5c, 0x56, 0x33, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1d, 0x52, 0x61, 0x66, 0x61, 0x79, 0x3a, 0x3a, 0x44, + 0x65, 0x76, 0x3a, 0x3a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x3a, 0x3a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x3a, 0x3a, 0x56, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_proto_types_commonpb_v3_common_proto_rawDescOnce sync.Once + file_proto_types_commonpb_v3_common_proto_rawDescData = file_proto_types_commonpb_v3_common_proto_rawDesc +) + +func file_proto_types_commonpb_v3_common_proto_rawDescGZIP() []byte { + file_proto_types_commonpb_v3_common_proto_rawDescOnce.Do(func() { + file_proto_types_commonpb_v3_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_types_commonpb_v3_common_proto_rawDescData) + }) + return file_proto_types_commonpb_v3_common_proto_rawDescData +} + +var file_proto_types_commonpb_v3_common_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_proto_types_commonpb_v3_common_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_proto_types_commonpb_v3_common_proto_goTypes = []interface{}{ + (ConditionStatus)(0), // 0: rafay.dev.types.common.v3.ConditionStatus + (*Metadata)(nil), // 1: rafay.dev.types.common.v3.Metadata + (*ProjectMeta)(nil), // 2: rafay.dev.types.common.v3.ProjectMeta + (*SharingSpec)(nil), // 3: rafay.dev.types.common.v3.SharingSpec + (*DriftSpec)(nil), // 4: rafay.dev.types.common.v3.DriftSpec + (*ListMetadata)(nil), // 5: rafay.dev.types.common.v3.ListMetadata + (*PlacementLabel)(nil), // 6: rafay.dev.types.common.v3.PlacementLabel + (*PlacementSpec)(nil), // 7: rafay.dev.types.common.v3.PlacementSpec + (*Status)(nil), // 8: rafay.dev.types.common.v3.Status + (*HttpBody)(nil), // 9: rafay.dev.types.common.v3.HttpBody + nil, // 10: rafay.dev.types.common.v3.Metadata.LabelsEntry + nil, // 11: rafay.dev.types.common.v3.Metadata.AnnotationsEntry + (*timestamppb.Timestamp)(nil), // 12: google.protobuf.Timestamp +} +var file_proto_types_commonpb_v3_common_proto_depIdxs = []int32{ + 10, // 0: rafay.dev.types.common.v3.Metadata.labels:type_name -> rafay.dev.types.common.v3.Metadata.LabelsEntry + 11, // 1: rafay.dev.types.common.v3.Metadata.annotations:type_name -> rafay.dev.types.common.v3.Metadata.AnnotationsEntry + 12, // 2: rafay.dev.types.common.v3.Metadata.modifiedAt:type_name -> google.protobuf.Timestamp + 2, // 3: rafay.dev.types.common.v3.SharingSpec.projects:type_name -> rafay.dev.types.common.v3.ProjectMeta + 6, // 4: rafay.dev.types.common.v3.PlacementSpec.labels:type_name -> rafay.dev.types.common.v3.PlacementLabel + 0, // 5: rafay.dev.types.common.v3.Status.conditionStatus:type_name -> rafay.dev.types.common.v3.ConditionStatus + 12, // 6: rafay.dev.types.common.v3.Status.lastUpdated:type_name -> google.protobuf.Timestamp + 7, // [7:7] is the sub-list for method output_type + 7, // [7:7] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name +} + +func init() { file_proto_types_commonpb_v3_common_proto_init() } +func file_proto_types_commonpb_v3_common_proto_init() { + if File_proto_types_commonpb_v3_common_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_proto_types_commonpb_v3_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Metadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_types_commonpb_v3_common_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProjectMeta); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_types_commonpb_v3_common_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SharingSpec); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_types_commonpb_v3_common_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DriftSpec); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_types_commonpb_v3_common_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_types_commonpb_v3_common_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlacementLabel); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_types_commonpb_v3_common_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlacementSpec); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_types_commonpb_v3_common_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Status); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_types_commonpb_v3_common_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HttpBody); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_proto_types_commonpb_v3_common_proto_rawDesc, + NumEnums: 1, + NumMessages: 11, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_proto_types_commonpb_v3_common_proto_goTypes, + DependencyIndexes: file_proto_types_commonpb_v3_common_proto_depIdxs, + EnumInfos: file_proto_types_commonpb_v3_common_proto_enumTypes, + MessageInfos: file_proto_types_commonpb_v3_common_proto_msgTypes, + }.Build() + File_proto_types_commonpb_v3_common_proto = out.File + file_proto_types_commonpb_v3_common_proto_rawDesc = nil + file_proto_types_commonpb_v3_common_proto_goTypes = nil + file_proto_types_commonpb_v3_common_proto_depIdxs = nil +} diff --git a/components/common/proto/types/commonpb/v3/common.proto b/components/common/proto/types/commonpb/v3/common.proto new file mode 100644 index 0000000..94ffedc --- /dev/null +++ b/components/common/proto/types/commonpb/v3/common.proto @@ -0,0 +1,236 @@ +syntax = "proto3"; +package rafay.dev.types.common.v3; + +import "google/protobuf/timestamp.proto"; +import "google/api/field_behavior.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; + +message Metadata { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema : { + title : "Metadata" + description : "metadata of the resource" + required : [ "name", "project" ] + } + example : "{" + "\"name\": \"some-name\"," + "\"project\": \"defaultproject\"" + "}" + }; + string name = 1 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Name", + description : "name of the resource" + } ]; + string description = 2 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Description", + description : "description of the resource" + } ]; + map labels = 3 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Lables", + description : "labels of the resource" + } ]; + map annotations = 4 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Annotations", + description : "annotations of the resource" + } ]; + string project = 5 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Project", + description : "Project of the resource" + } ]; + string organization = 6 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Organization", + description : "Organization to which the resource belongs" + } ]; + string partner = 7 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Partner", + description : "Partner to which the resource belongs" + } ]; + string id = 8 [ (google.api.field_behavior) = OUTPUT_ONLY ]; + google.protobuf.Timestamp modifiedAt = 9 + [ (google.api.field_behavior) = OUTPUT_ONLY ]; +} + +message ProjectMeta { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema : { + title : "ProjectMeta" + description : "metadata of the project" + required : [ "name" ] + } + example : "{\"name\": \"defaultproject\"}" + }; + string name = 1 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Name", + description : "name of the project" + } ]; + string id = 2 [ (google.api.field_behavior) = OUTPUT_ONLY ]; +} + +message SharingSpec { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema : { + title : "SharingSpec" + description : "sharing specification for a resource" + required : [ "enabled" ] + } + example : "{" + "\"enabled\": true," + "\"projects\": [{\"name\": \"some-project\"}]" + "}" + }; + bool enabled = 1 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Enabled", + description : "flag to specify if sharing is enabled for resource" + } ]; + repeated ProjectMeta projects = 2 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Projects", + description : "list of projects this resource is shared to" + } ]; +} + +message DriftSpec { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema : { + title : "DriftSpec" + description : "drift reconcillation specification for a resource" + required : [ "enabled" ] + } + example : "{" + "\"enabled\": true," + "\"action\": \"Deny\"" + "}" + }; + bool enabled = 1 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Enabled", + description : "flag to specify if drift reconcillation is enabled for " + "resource" + } ]; + string action = 2 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Action", + description : "flag to specify if sharing is enabled for resource" + enum : [ "Notify", "Deny" ] + } ]; +} + +// $title: ListMetadata +// $description: metadata for a list of resources +// $required: enabled +message ListMetadata { + sint64 count = 1; + sint64 offset = 2; + sint64 limt = 3; +} + +message PlacementLabel { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema : { + title : "PlacementLabel" + description : "labels for placement of resource" + required : [ "key", "value" ] + } + example : "{" + "\"key\": \"some-key\"," + "\"value\": \"some-value\"" + "}" + }; + string key = 1 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Key", + description : "Key of the placement label" + } ]; + string value = 2 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Value", + description : "Value of the placement label" + } ]; + ; +} + +message PlacementSpec { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema : { + title : "PlacementSpec" + description : "placement specification for a resource" + required : [] + } + example : "{" + "\"labels\": [{\"key\": \"some-key\"},{\"key\": \"some-key\"}]" + "}" + }; + repeated PlacementLabel labels = 1 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Labels", + description : "list of labels for placement" + } ]; + string selector = 2 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Selector", + description : "Kubernetes style label selector" + } ]; +} + +// $title: ConditionStatus +// $description: status of a condition for a resource +enum ConditionStatus { + StatusNotSet = 0; + StatusSubmitted = 1; + StatusOK = 2; + StatusFailed = 3; +} + +message Status { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema : { + title : "Status", + description : "status of a resource", + read_only : true, + } + }; + string conditionType = 1 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Condition Type", + description : "type of the status condition", + read_only : true + } ]; + ConditionStatus conditionStatus = 2 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Condition Status", + description : "status of the condition", + read_only : true + enum: ["StatusNotSet", "StatusSubmitted", "StatusOK", "StatusFailed"] + } ]; + google.protobuf.Timestamp lastUpdated = 3 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Last Updated", + description : "when the condition status is last updated", + read_only : true + } ]; + string reason = 4 + [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + title : "Reason", + description : "reason of the last condition status", + read_only : true + } ]; +} + +// HttpBody represents arbitrary HTTP Body. It should only be used for +// payload formats that can't be represented as JSON +message HttpBody { + // The HTTP Content-Type header value specifying the content type of the body. + string content_type = 1; + + // The HTTP request/response body as raw binary. + bytes data = 2; +} \ No newline at end of file diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..196e342 --- /dev/null +++ b/go.mod @@ -0,0 +1,13 @@ +module github.com/RafaySystems/rcloud-base + +go 1.17 + +require github.com/uptrace/bun v1.0.20 + +require ( + github.com/jinzhu/inflection v1.0.0 // indirect + github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc // indirect + github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect + github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect + golang.org/x/sys v0.0.0-20211123173158-ef496fb156ab // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..620e00d --- /dev/null +++ b/go.sum @@ -0,0 +1,20 @@ +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= +github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc h1:9lRDQMhESg+zvGYmW5DyG0UqvY96Bu5QYsTLvCHdrgo= +github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc/go.mod h1:bciPuU6GHm1iF1pBvUfxfsH0Wmnc2VbpgvbI9ZWuIRs= +github.com/uptrace/bun v1.0.20 h1:/T4p9C9tEN75U3cFMBr5njlP+rBfs4An8BmlQQPbcfE= +github.com/uptrace/bun v1.0.20/go.mod h1:Uv7z0z+7dXnUS9P5hMF0hdiM/4M+xOUHQCrZpyDrpRc= +github.com/vmihailenco/msgpack/v5 v5.3.5 h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9znI5mJU= +github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= +github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= +github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= +golang.org/x/sys v0.0.0-20211123173158-ef496fb156ab h1:rfJ1bsoJQQIAoAxTxB7bme+vHrNkRw8CqfsYh9w54cw= +golang.org/x/sys v0.0.0-20211123173158-ef496fb156ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/persistence/migrations/admindb/000001_authsrv_partner.down.sql b/persistence/migrations/admindb/000001_authsrv_partner.down.sql new file mode 100644 index 0000000..7eed851 --- /dev/null +++ b/persistence/migrations/admindb/000001_authsrv_partner.down.sql @@ -0,0 +1,2 @@ +DROP TABLE IF EXISTS authsrv_partner; +DROP SEQUENCE IF EXISTS authsrv_partner_id_seq; \ No newline at end of file diff --git a/persistence/migrations/admindb/000001_authsrv_partner.up.sql b/persistence/migrations/admindb/000001_authsrv_partner.up.sql new file mode 100644 index 0000000..5bf5a78 --- /dev/null +++ b/persistence/migrations/admindb/000001_authsrv_partner.up.sql @@ -0,0 +1,33 @@ +CREATE TABLE IF NOT EXISTS authsrv_partner ( + id uuid NOT NULL default uuid_generate_v4(), + name character varying(256) NOT NULL, + description character varying(512) NOT NULL, + created_at timestamp with time zone NOT NULL, + modified_at timestamp with time zone NOT NULL, + trash boolean NOT NULL, + settings jsonb NOT NULL, + host character varying(256) NOT NULL, + domain character varying(256) NOT NULL, + tos_link character varying(256) NOT NULL, + logo_link character varying(256) NOT NULL, + notification_email character varying(254) NOT NULL, + parent_id uuid, + partner_helpdesk_email character varying(254) NOT NULL, + partner_product_name character varying(256) NOT NULL, + support_team_name character varying(256) NOT NULL, + ops_host character varying(256) NOT NULL, + fav_icon_link character varying(256) NOT NULL, + is_totp_enabled boolean NOT NULL, + is_synthetic_partner_enabled boolean NOT NULL +); + + +ALTER TABLE authsrv_partner OWNER TO admindbuser; + +ALTER TABLE ONLY authsrv_partner ADD CONSTRAINT authsrv_partner_pkey PRIMARY KEY (id); + +CREATE INDEX authsrv_partner_name_b6a8d21f ON authsrv_partner USING btree (name); + +CREATE INDEX authsrv_partner_name_b6a8d21f_like ON authsrv_partner USING btree (name varchar_pattern_ops); + +CREATE INDEX authsrv_partner_parent_id_5e0680af ON authsrv_partner USING btree (parent_id); diff --git a/persistence/migrations/admindb/000002_authsrv_organization.down.sql b/persistence/migrations/admindb/000002_authsrv_organization.down.sql new file mode 100644 index 0000000..d000cd9 --- /dev/null +++ b/persistence/migrations/admindb/000002_authsrv_organization.down.sql @@ -0,0 +1,2 @@ +DROP TABLE IF EXISTS authsrv_organization; +DROP SEQUENCE IF EXISTS authsrv_organization_id_seq; \ No newline at end of file diff --git a/persistence/migrations/admindb/000002_authsrv_organization.up.sql b/persistence/migrations/admindb/000002_authsrv_organization.up.sql new file mode 100644 index 0000000..07f6920 --- /dev/null +++ b/persistence/migrations/admindb/000002_authsrv_organization.up.sql @@ -0,0 +1,46 @@ +CREATE TABLE IF NOT EXISTS authsrv_organization ( + id uuid NOT NULL default uuid_generate_v4(), + name character varying(256) NOT NULL, + description character varying(512) NOT NULL, + created_at timestamp with time zone NOT NULL, + modified_at timestamp with time zone NOT NULL, + trash boolean NOT NULL, + settings jsonb NOT NULL, + billing_address text NOT NULL, + partner_id uuid NOT NULL, + active boolean NOT NULL, + approved boolean NOT NULL, + type character varying(64) NOT NULL, + address_line1 text NOT NULL, + address_line2 text NOT NULL, + city text NOT NULL, + country text NOT NULL, + phone text NOT NULL, + state text NOT NULL, + zipcode text NOT NULL, + deleted_name character varying(256), + is_private boolean, + is_totp_enabled boolean NOT NULL, + are_clusters_shared boolean NOT NULL, + psps_enabled boolean default TRUE, + custom_psps_enabled boolean, + default_blueprints_enabled boolean default TRUE, + referer character varying(30) +); + +ALTER TABLE authsrv_organization OWNER TO admindbuser; + +ALTER TABLE ONLY authsrv_organization + ADD CONSTRAINT authsrv_organization_name_partner_id_7d1113b9_uniq UNIQUE (name, partner_id); + +ALTER TABLE ONLY authsrv_organization ADD CONSTRAINT authsrv_organization_pkey PRIMARY KEY (id); + +CREATE INDEX authsrv_organization_name_23376e56 ON authsrv_organization USING btree (name); + +CREATE INDEX authsrv_organization_name_23376e56_like ON authsrv_organization USING btree (name varchar_pattern_ops); + +CREATE INDEX authsrv_organization_partner_id_7b55b579 ON authsrv_organization USING btree (partner_id); + +ALTER TABLE ONLY authsrv_organization + ADD CONSTRAINT authsrv_organization_partner_id_7b55b579_fk_authsrv_partner_id FOREIGN KEY (partner_id) + REFERENCES authsrv_partner(id) DEFERRABLE INITIALLY DEFERRED; \ No newline at end of file diff --git a/persistence/migrations/admindb/000003_authsrv_project.down.sql b/persistence/migrations/admindb/000003_authsrv_project.down.sql new file mode 100644 index 0000000..045c342 --- /dev/null +++ b/persistence/migrations/admindb/000003_authsrv_project.down.sql @@ -0,0 +1,2 @@ +DROP TABLE IF EXISTS authsrv_project; +DROP SEQUENCE IF EXISTS authsrv_project_id_seq; \ No newline at end of file diff --git a/persistence/migrations/admindb/000003_authsrv_project.up.sql b/persistence/migrations/admindb/000003_authsrv_project.up.sql new file mode 100644 index 0000000..d69e64b --- /dev/null +++ b/persistence/migrations/admindb/000003_authsrv_project.up.sql @@ -0,0 +1,31 @@ +CREATE TABLE IF NOT EXISTS authsrv_project ( + id uuid NOT NULL default uuid_generate_v4(), + name character varying(256) NOT NULL, + description character varying(512) NOT NULL, + created_at timestamp with time zone NOT NULL, + modified_at timestamp with time zone NOT NULL, + trash boolean NOT NULL, + organization_id uuid, + partner_id uuid, + "default" boolean NOT NULL +); + +ALTER TABLE authsrv_project OWNER TO admindbuser; + +ALTER TABLE ONLY authsrv_project ADD CONSTRAINT authsrv_project_pkey PRIMARY KEY (id); + +CREATE INDEX authsrv_project_name_1b8dd279 ON authsrv_project USING btree (name); + +CREATE INDEX authsrv_project_name_1b8dd279_like ON authsrv_project USING btree (name varchar_pattern_ops); + +CREATE INDEX authsrv_project_organization_id_77437387 ON authsrv_project USING btree (organization_id); + +CREATE INDEX authsrv_project_partner_id_3d505b76 ON authsrv_project USING btree (partner_id); + +ALTER TABLE ONLY authsrv_project + ADD CONSTRAINT authsrv_project_organization_id_77437387_fk_authsrv_o FOREIGN KEY (organization_id) + REFERENCES authsrv_organization(id) DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE ONLY authsrv_project + ADD CONSTRAINT authsrv_project_partner_id_3d505b76_fk_authsrv_partner_id FOREIGN KEY (partner_id) + REFERENCES authsrv_partner(id) DEFERRABLE INITIALLY DEFERRED; \ No newline at end of file diff --git a/persistence/migrations/admindb/000004_authsrv_account.down.sql b/persistence/migrations/admindb/000004_authsrv_account.down.sql new file mode 100644 index 0000000..3d3d45b --- /dev/null +++ b/persistence/migrations/admindb/000004_authsrv_account.down.sql @@ -0,0 +1,4 @@ +DROP TABLE IF EXISTS authsrv_account; +DROP SEQUENCE IF EXISTS authsrv_account_id_seq; +DROP TABLE IF EXISTS authsrv_ssoaccount; +DROP SEQUENCE IF EXISTS authsrv_ssoaccount_id_seq; \ No newline at end of file diff --git a/persistence/migrations/admindb/000004_authsrv_account.up.sql b/persistence/migrations/admindb/000004_authsrv_account.up.sql new file mode 100644 index 0000000..6772894 --- /dev/null +++ b/persistence/migrations/admindb/000004_authsrv_account.up.sql @@ -0,0 +1,78 @@ +CREATE TABLE IF NOT EXISTS authsrv_account ( + password character varying(128) NOT NULL, + last_login timestamp with time zone, + id uuid NOT NULL default uuid_generate_v4(), + name character varying(256) NOT NULL, + description character varying(512) NOT NULL, + created_at timestamp with time zone NOT NULL, + modified_at timestamp with time zone NOT NULL, + trash boolean NOT NULL, + username character varying(256) NOT NULL, + phone character varying(36) NOT NULL, + first_name character varying(64) NOT NULL, + last_name character varying(64) NOT NULL, + email_verified boolean NOT NULL, + phone_verified boolean NOT NULL, + email_verification_attempts integer NOT NULL, + require_change_password boolean NOT NULL, + deleted_username character varying(256), + totp_required boolean NOT NULL, + totp_secret character varying(64) NOT NULL, + totp_verified boolean NOT NULL, + organization_id uuid, + user_type character varying(256) default 'CONSOLE' +); + +ALTER TABLE authsrv_account OWNER TO admindbuser; + +ALTER TABLE ONLY authsrv_account ADD CONSTRAINT authsrv_account_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY authsrv_account ADD CONSTRAINT authsrv_account_username_key UNIQUE (username); + +CREATE INDEX authsrv_account_name_16ecead7 ON authsrv_account USING btree (name); + +CREATE INDEX authsrv_account_name_16ecead7_like ON authsrv_account USING btree (name varchar_pattern_ops); + +CREATE INDEX authsrv_account_organization_id_abc549fc ON authsrv_account USING btree (organization_id); + +CREATE INDEX authsrv_account_username_1db08261_like ON authsrv_account USING btree (username varchar_pattern_ops); + +ALTER TABLE ONLY authsrv_account + ADD CONSTRAINT authsrv_account_organization_id_abc549fc_fk_authsrv_o FOREIGN KEY (organization_id) + REFERENCES authsrv_organization(id) DEFERRABLE INITIALLY DEFERRED; + +CREATE TABLE IF NOT EXISTS authsrv_ssoaccount ( + password character varying(128) NOT NULL, + last_login timestamp with time zone, + id uuid NOT NULL default uuid_generate_v4(), + name character varying(256) NOT NULL, + organization_id uuid, + description character varying(512) NOT NULL, + created_at timestamp with time zone NOT NULL, + modified_at timestamp with time zone NOT NULL, + trash boolean NOT NULL, + username character varying(256) NOT NULL, + phone character varying(36) NOT NULL, + first_name character varying(64) NOT NULL, + last_name character varying(64) NOT NULL, + groups jsonb, + last_logout timestamp with time zone +); + +ALTER TABLE authsrv_ssoaccount OWNER TO admindbuser; + +ALTER TABLE ONLY authsrv_ssoaccount ADD CONSTRAINT authsrv_ssoaccount_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY authsrv_ssoaccount ADD CONSTRAINT authsrv_ssoaccount_username_key UNIQUE (username); + +CREATE INDEX authsrv_ssoaccount_name_4def83cc ON authsrv_ssoaccount USING btree (name); + +CREATE INDEX authsrv_ssoaccount_name_4def83cc_like ON authsrv_ssoaccount USING btree (name varchar_pattern_ops); + +CREATE INDEX authsrv_ssoaccount_organization_id_d2a979a5 ON authsrv_ssoaccount USING btree (organization_id); + +CREATE INDEX authsrv_ssoaccount_username_029374ce_like ON authsrv_ssoaccount USING btree (username varchar_pattern_ops); + +ALTER TABLE ONLY authsrv_ssoaccount + ADD CONSTRAINT authsrv_ssoaccount_organization_id_d2a979a5_fk_authsrv_o FOREIGN KEY (organization_id) + REFERENCES authsrv_organization(id) DEFERRABLE INITIALLY DEFERRED; \ No newline at end of file diff --git a/persistence/migrations/admindb/000005_authsrv_group.down.sql b/persistence/migrations/admindb/000005_authsrv_group.down.sql new file mode 100644 index 0000000..07e0bf1 --- /dev/null +++ b/persistence/migrations/admindb/000005_authsrv_group.down.sql @@ -0,0 +1,2 @@ +DROP TABLE IF EXISTS authsrv_group; +DROP SEQUENCE IF EXISTS authsrv_group_id_seq; \ No newline at end of file diff --git a/persistence/migrations/admindb/000005_authsrv_group.up.sql b/persistence/migrations/admindb/000005_authsrv_group.up.sql new file mode 100644 index 0000000..b61bad5 --- /dev/null +++ b/persistence/migrations/admindb/000005_authsrv_group.up.sql @@ -0,0 +1,31 @@ +CREATE TABLE IF NOT EXISTS authsrv_group ( + id uuid NOT NULL default uuid_generate_v4(), + name character varying(256) NOT NULL, + description character varying(512) NOT NULL, + created_at timestamp with time zone NOT NULL, + modified_at timestamp with time zone NOT NULL, + trash boolean NOT NULL, + organization_id uuid NOT NULL, + partner_id uuid NOT NULL, + type character varying(64) NOT NULL +); + +ALTER TABLE authsrv_group OWNER TO admindbuser; + +ALTER TABLE ONLY authsrv_group ADD CONSTRAINT authsrv_group_pkey PRIMARY KEY (id); + +CREATE INDEX authsrv_group_name_d90b4524 ON authsrv_group USING btree (name); + +CREATE INDEX authsrv_group_name_d90b4524_like ON authsrv_group USING btree (name varchar_pattern_ops); + +CREATE INDEX authsrv_group_organization_id_e070e826 ON authsrv_group USING btree (organization_id); + +CREATE INDEX authsrv_group_partner_id_1de9ab46 ON authsrv_group USING btree (partner_id); + +ALTER TABLE ONLY authsrv_group + ADD CONSTRAINT authsrv_group_organization_id_e070e826_fk_authsrv_o FOREIGN KEY (organization_id) + REFERENCES authsrv_organization(id) DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE ONLY authsrv_group + ADD CONSTRAINT authsrv_group_partner_id_1de9ab46_fk_authsrv_partner_id FOREIGN KEY (partner_id) + REFERENCES authsrv_partner(id) DEFERRABLE INITIALLY DEFERRED; \ No newline at end of file diff --git a/persistence/migrations/admindb/000006_authsrv_resource.down.sql b/persistence/migrations/admindb/000006_authsrv_resource.down.sql new file mode 100644 index 0000000..ac6fc80 --- /dev/null +++ b/persistence/migrations/admindb/000006_authsrv_resource.down.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS authsrv_resource; \ No newline at end of file diff --git a/persistence/migrations/admindb/000006_authsrv_resource.up.sql b/persistence/migrations/admindb/000006_authsrv_resource.up.sql new file mode 100644 index 0000000..2c8c573 --- /dev/null +++ b/persistence/migrations/admindb/000006_authsrv_resource.up.sql @@ -0,0 +1,13 @@ +CREATE TABLE IF NOT EXISTS authsrv_resource ( + name character varying(256) NOT NULL, + base_url character varying(256) NOT NULL, + resource_urls jsonb NOT NULL, + resource_action_urls jsonb NOT NULL, + trash boolean NOT NULL +); + +ALTER TABLE authsrv_resource OWNER TO admindbuser; + +ALTER TABLE ONLY authsrv_resource ADD CONSTRAINT authsrv_resource_pkey PRIMARY KEY (name); + +CREATE INDEX authsrv_resource_name_5a29761f_like ON authsrv_resource USING btree (name varchar_pattern_ops); \ No newline at end of file diff --git a/persistence/migrations/admindb/000007_authsrv_resourcerole.down.sql b/persistence/migrations/admindb/000007_authsrv_resourcerole.down.sql new file mode 100644 index 0000000..b80abfa --- /dev/null +++ b/persistence/migrations/admindb/000007_authsrv_resourcerole.down.sql @@ -0,0 +1,2 @@ +DROP TABLE IF EXISTS authsrv_resourcerole; +DROP SEQUENCE IF EXISTS authsrv_resourcerole_id_seq; \ No newline at end of file diff --git a/persistence/migrations/admindb/000007_authsrv_resourcerole.up.sql b/persistence/migrations/admindb/000007_authsrv_resourcerole.up.sql new file mode 100644 index 0000000..b746332 --- /dev/null +++ b/persistence/migrations/admindb/000007_authsrv_resourcerole.up.sql @@ -0,0 +1,32 @@ +CREATE TABLE IF NOT EXISTS authsrv_resourcerole ( + id uuid NOT NULL default uuid_generate_v4(), + name character varying(256) NOT NULL, + description character varying(512) NOT NULL, + created_at timestamp with time zone NOT NULL, + modified_at timestamp with time zone NOT NULL, + trash boolean NOT NULL, + is_global boolean NOT NULL, + scope character varying(256) NOT NULL, + organization_id uuid, + partner_id uuid +); + +ALTER TABLE authsrv_resourcerole OWNER TO admindbuser; + +ALTER TABLE ONLY authsrv_resourcerole ADD CONSTRAINT authsrv_resourcerole_pkey PRIMARY KEY (id); + +CREATE INDEX authsrv_resourcerole_name_a93b875a ON authsrv_resourcerole USING btree (name); + +CREATE INDEX authsrv_resourcerole_name_a93b875a_like ON authsrv_resourcerole USING btree (name varchar_pattern_ops); + +CREATE INDEX authsrv_resourcerole_organization_id_9a0a7e7e ON authsrv_resourcerole USING btree (organization_id); + +CREATE INDEX authsrv_resourcerole_partner_id_de49ca91 ON authsrv_resourcerole USING btree (partner_id); + +ALTER TABLE ONLY authsrv_resourcerole + ADD CONSTRAINT authsrv_resourcerole_organization_id_9a0a7e7e_fk_authsrv_o FOREIGN KEY (organization_id) + REFERENCES authsrv_organization(id) DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE ONLY authsrv_resourcerole + ADD CONSTRAINT authsrv_resourcerole_partner_id_de49ca91_fk_authsrv_partner_id FOREIGN KEY (partner_id) + REFERENCES authsrv_partner(id) DEFERRABLE INITIALLY DEFERRED; \ No newline at end of file diff --git a/persistence/migrations/admindb/000008_authsrv_resourcepermission.down.sql b/persistence/migrations/admindb/000008_authsrv_resourcepermission.down.sql new file mode 100644 index 0000000..60b7470 --- /dev/null +++ b/persistence/migrations/admindb/000008_authsrv_resourcepermission.down.sql @@ -0,0 +1,2 @@ +DROP TABLE IF EXISTS authsrv_resourcepermission; +DROP SEQUENCE IF EXISTS authsrv_resourcepermission_id_seq; \ No newline at end of file diff --git a/persistence/migrations/admindb/000008_authsrv_resourcepermission.up.sql b/persistence/migrations/admindb/000008_authsrv_resourcepermission.up.sql new file mode 100644 index 0000000..ba18c05 --- /dev/null +++ b/persistence/migrations/admindb/000008_authsrv_resourcepermission.up.sql @@ -0,0 +1,41 @@ +CREATE TABLE IF NOT EXISTS authsrv_resourcepermission ( + id uuid NOT NULL default uuid_generate_v4(), + name character varying(256) NOT NULL, + description character varying(512) NOT NULL, + created_at timestamp with time zone NOT NULL, + modified_at timestamp with time zone NOT NULL, + trash boolean NOT NULL, + resource_urls jsonb NOT NULL, + resource_action_urls jsonb NOT NULL, + organization_id uuid, + partner_id uuid, + resource_ref_id character varying(256) NOT NULL +); + +ALTER TABLE authsrv_resourcepermission OWNER TO admindbuser; + +ALTER TABLE ONLY authsrv_resourcepermission ADD CONSTRAINT authsrv_resourcepermission_pkey PRIMARY KEY (id); + +CREATE INDEX authsrv_resourcepermission_name_97f09d50 ON authsrv_resourcepermission USING btree (name); + +CREATE INDEX authsrv_resourcepermission_name_97f09d50_like ON authsrv_resourcepermission USING btree (name varchar_pattern_ops); + +CREATE INDEX authsrv_resourcepermission_organization_id_daf7465e ON authsrv_resourcepermission USING btree (organization_id); + +CREATE INDEX authsrv_resourcepermission_partner_id_f2ff9ad9 ON authsrv_resourcepermission USING btree (partner_id); + +CREATE INDEX authsrv_resourcepermission_resource_ref_id_a47f8b94 ON authsrv_resourcepermission USING btree (resource_ref_id); + +CREATE INDEX authsrv_resourcepermission_resource_ref_id_a47f8b94_like ON authsrv_resourcepermission USING btree (resource_ref_id varchar_pattern_ops); + +ALTER TABLE ONLY authsrv_resourcepermission + ADD CONSTRAINT authsrv_resourceperm_organization_id_daf7465e_fk_authsrv_o FOREIGN KEY (organization_id) + REFERENCES authsrv_organization(id) DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE ONLY authsrv_resourcepermission + ADD CONSTRAINT authsrv_resourceperm_partner_id_f2ff9ad9_fk_authsrv_p FOREIGN KEY (partner_id) + REFERENCES authsrv_partner(id) DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE ONLY authsrv_resourcepermission + ADD CONSTRAINT authsrv_resourceperm_resource_ref_id_a47f8b94_fk_authsrv_r FOREIGN KEY (resource_ref_id) + REFERENCES authsrv_resource(name) DEFERRABLE INITIALLY DEFERRED; \ No newline at end of file diff --git a/persistence/migrations/admindb/000009_authsrv_resourcerolepermission.down.sql b/persistence/migrations/admindb/000009_authsrv_resourcerolepermission.down.sql new file mode 100644 index 0000000..4895c52 --- /dev/null +++ b/persistence/migrations/admindb/000009_authsrv_resourcerolepermission.down.sql @@ -0,0 +1,2 @@ +DROP TABLE IF EXISTS authsrv_resourcerolepermission; +DROP SEQUENCE IF EXISTS authsrv_resourcerolepermission_id_seq; \ No newline at end of file diff --git a/persistence/migrations/admindb/000009_authsrv_resourcerolepermission.up.sql b/persistence/migrations/admindb/000009_authsrv_resourcerolepermission.up.sql new file mode 100644 index 0000000..5bd93ee --- /dev/null +++ b/persistence/migrations/admindb/000009_authsrv_resourcerolepermission.up.sql @@ -0,0 +1,30 @@ +CREATE TABLE IF NOT EXISTS authsrv_resourcerolepermission ( + id uuid NOT NULL default uuid_generate_v4(), + name character varying(256) NOT NULL, + description character varying(512) NOT NULL, + created_at timestamp with time zone NOT NULL, + modified_at timestamp with time zone NOT NULL, + trash boolean NOT NULL, + resource_permission_id uuid NOT NULL, + resource_role_id uuid NOT NULL +); + +ALTER TABLE authsrv_resourcerolepermission OWNER TO admindbuser; + +ALTER TABLE ONLY authsrv_resourcerolepermission ADD CONSTRAINT authsrv_resourcerolepermission_pkey PRIMARY KEY (id); + +CREATE INDEX authsrv_resourcerolepermission_name_a65794e7 ON authsrv_resourcerolepermission USING btree (name); + +CREATE INDEX authsrv_resourcerolepermission_name_a65794e7_like ON authsrv_resourcerolepermission USING btree (name varchar_pattern_ops); + +CREATE INDEX authsrv_resourcerolepermission_resource_permission_id_c076e909 ON authsrv_resourcerolepermission USING btree (resource_permission_id); + +CREATE INDEX authsrv_resourcerolepermission_resource_role_id_054f52d8 ON authsrv_resourcerolepermission USING btree (resource_role_id); + +ALTER TABLE ONLY authsrv_resourcerolepermission + ADD CONSTRAINT authsrv_resourcerole_resource_permission__c076e909_fk_authsrv_r FOREIGN KEY (resource_permission_id) + REFERENCES authsrv_resourcepermission(id) DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE ONLY authsrv_resourcerolepermission + ADD CONSTRAINT authsrv_resourcerole_resource_role_id_054f52d8_fk_authsrv_r FOREIGN KEY (resource_role_id) + REFERENCES authsrv_resourcerole(id) DEFERRABLE INITIALLY DEFERRED; \ No newline at end of file diff --git a/persistence/migrations/admindb/000010_authsrv_projectaccountresourcerole.down.sql b/persistence/migrations/admindb/000010_authsrv_projectaccountresourcerole.down.sql new file mode 100644 index 0000000..804caea --- /dev/null +++ b/persistence/migrations/admindb/000010_authsrv_projectaccountresourcerole.down.sql @@ -0,0 +1,2 @@ +DROP TABLE IF EXISTS authsrv_projectaccountresourcerole; +DROP SEQUENCE IF EXISTS authsrv_projectaccountresourcerole_id_seq; \ No newline at end of file diff --git a/persistence/migrations/admindb/000010_authsrv_projectaccountresourcerole.up.sql b/persistence/migrations/admindb/000010_authsrv_projectaccountresourcerole.up.sql new file mode 100644 index 0000000..fb5a1d7 --- /dev/null +++ b/persistence/migrations/admindb/000010_authsrv_projectaccountresourcerole.up.sql @@ -0,0 +1,53 @@ +CREATE TABLE IF NOT EXISTS authsrv_projectaccountresourcerole ( + id uuid NOT NULL default uuid_generate_v4(), + name character varying(256) NOT NULL, + description character varying(512) NOT NULL, + created_at timestamp with time zone NOT NULL, + modified_at timestamp with time zone NOT NULL, + trash boolean NOT NULL, + "default" boolean NOT NULL, + active boolean NOT NULL, + account_id uuid NOT NULL, + organization_id uuid, + partner_id uuid, + project_id uuid, + role_id uuid NOT NULL +); + +ALTER TABLE authsrv_projectaccountresourcerole OWNER TO admindbuser; + +ALTER TABLE ONLY authsrv_projectaccountresourcerole ADD CONSTRAINT authsrv_projectaccountresourcerole_pkey PRIMARY KEY (id); + +CREATE INDEX authsrv_projectaccountresourcerole_account_id_532ce8df ON authsrv_projectaccountresourcerole USING btree (account_id); + +CREATE INDEX authsrv_projectaccountresourcerole_name_c4c3d60f ON authsrv_projectaccountresourcerole USING btree (name); + +CREATE INDEX authsrv_projectaccountresourcerole_name_c4c3d60f_like ON authsrv_projectaccountresourcerole USING btree (name varchar_pattern_ops); + +CREATE INDEX authsrv_projectaccountresourcerole_organization_id_91c5602d ON authsrv_projectaccountresourcerole USING btree (organization_id); + +CREATE INDEX authsrv_projectaccountresourcerole_partner_id_81bde92c ON authsrv_projectaccountresourcerole USING btree (partner_id); + +CREATE INDEX authsrv_projectaccountresourcerole_project_id_f8a43852 ON authsrv_projectaccountresourcerole USING btree (project_id); + +CREATE INDEX authsrv_projectaccountresourcerole_role_id_a345b16f ON authsrv_projectaccountresourcerole USING btree (role_id); + +ALTER TABLE ONLY authsrv_projectaccountresourcerole + ADD CONSTRAINT authsrv_projectaccou_account_id_532ce8df_fk_authsrv_a FOREIGN KEY (account_id) + REFERENCES authsrv_account(id) DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE ONLY authsrv_projectaccountresourcerole + ADD CONSTRAINT authsrv_projectaccou_organization_id_91c5602d_fk_authsrv_o FOREIGN KEY (organization_id) + REFERENCES authsrv_organization(id) DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE ONLY authsrv_projectaccountresourcerole + ADD CONSTRAINT authsrv_projectaccou_partner_id_81bde92c_fk_authsrv_p FOREIGN KEY (partner_id) + REFERENCES authsrv_partner(id) DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE ONLY authsrv_projectaccountresourcerole + ADD CONSTRAINT authsrv_projectaccou_project_id_f8a43852_fk_authsrv_p FOREIGN KEY (project_id) + REFERENCES authsrv_project(id) DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE ONLY authsrv_projectaccountresourcerole + ADD CONSTRAINT authsrv_projectaccou_role_id_a345b16f_fk_authsrv_r FOREIGN KEY (role_id) + REFERENCES authsrv_resourcerole(id) DEFERRABLE INITIALLY DEFERRED; \ No newline at end of file diff --git a/persistence/migrations/admindb/000011_authsrv_projectaccountnamespacerole.down.sql b/persistence/migrations/admindb/000011_authsrv_projectaccountnamespacerole.down.sql new file mode 100644 index 0000000..749e005 --- /dev/null +++ b/persistence/migrations/admindb/000011_authsrv_projectaccountnamespacerole.down.sql @@ -0,0 +1,2 @@ +DROP TABLE IF EXISTS authsrv_projectaccountnamespacerole; +DROP SEQUENCE IF EXISTS authsrv_projectaccountnamespacerole_id_seq; \ No newline at end of file diff --git a/persistence/migrations/admindb/000011_authsrv_projectaccountnamespacerole.up.sql b/persistence/migrations/admindb/000011_authsrv_projectaccountnamespacerole.up.sql new file mode 100644 index 0000000..f095faf --- /dev/null +++ b/persistence/migrations/admindb/000011_authsrv_projectaccountnamespacerole.up.sql @@ -0,0 +1,53 @@ +CREATE TABLE IF NOT EXISTS authsrv_projectaccountnamespacerole ( + id uuid NOT NULL default uuid_generate_v4(), + name character varying(256) NOT NULL, + description character varying(512) NOT NULL, + created_at timestamp with time zone NOT NULL, + modified_at timestamp with time zone NOT NULL, + trash boolean NOT NULL, + namespace_id integer NOT NULL, + active boolean NOT NULL, + account_id uuid NOT NULL, + organization_id uuid, + partner_id uuid, + project_id uuid, + role_id uuid NOT NULL +); + +ALTER TABLE authsrv_projectaccountnamespacerole OWNER TO admindbuser; + +ALTER TABLE ONLY authsrv_projectaccountnamespacerole ADD CONSTRAINT authsrv_projectaccountnamespacerole_pkey PRIMARY KEY (id); + +CREATE INDEX authsrv_projectaccountnamespacerole_account_id_4fac0ac2 ON authsrv_projectaccountnamespacerole USING btree (account_id); + +CREATE INDEX authsrv_projectaccountnamespacerole_name_216353a4 ON authsrv_projectaccountnamespacerole USING btree (name); + +CREATE INDEX authsrv_projectaccountnamespacerole_name_216353a4_like ON authsrv_projectaccountnamespacerole USING btree (name varchar_pattern_ops); + +CREATE INDEX authsrv_projectaccountnamespacerole_organization_id_96c921c9 ON authsrv_projectaccountnamespacerole USING btree (organization_id); + +CREATE INDEX authsrv_projectaccountnamespacerole_partner_id_9bec6899 ON authsrv_projectaccountnamespacerole USING btree (partner_id); + +CREATE INDEX authsrv_projectaccountnamespacerole_project_id_66e567ed ON authsrv_projectaccountnamespacerole USING btree (project_id); + +CREATE INDEX authsrv_projectaccountnamespacerole_role_id_8a5411cc ON authsrv_projectaccountnamespacerole USING btree (role_id); + +ALTER TABLE ONLY authsrv_projectaccountnamespacerole + ADD CONSTRAINT authsrv_projectaccou_account_id_4fac0ac2_fk_authsrv_a FOREIGN KEY (account_id) + REFERENCES authsrv_account(id) DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE ONLY authsrv_projectaccountnamespacerole + ADD CONSTRAINT authsrv_projectaccou_organization_id_96c921c9_fk_authsrv_o FOREIGN KEY (organization_id) + REFERENCES authsrv_organization(id) DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE ONLY authsrv_projectaccountnamespacerole + ADD CONSTRAINT authsrv_projectaccou_partner_id_9bec6899_fk_authsrv_p FOREIGN KEY (partner_id) + REFERENCES authsrv_partner(id) DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE ONLY authsrv_projectaccountnamespacerole + ADD CONSTRAINT authsrv_projectaccou_project_id_66e567ed_fk_authsrv_p FOREIGN KEY (project_id) + REFERENCES authsrv_project(id) DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE ONLY authsrv_projectaccountnamespacerole + ADD CONSTRAINT authsrv_projectaccou_role_id_8a5411cc_fk_authsrv_r FOREIGN KEY (role_id) + REFERENCES authsrv_resourcerole(id) DEFERRABLE INITIALLY DEFERRED; \ No newline at end of file diff --git a/persistence/migrations/admindb/000012_authsrv_projectgroupnamespacerole.down.sql b/persistence/migrations/admindb/000012_authsrv_projectgroupnamespacerole.down.sql new file mode 100644 index 0000000..635bff4 --- /dev/null +++ b/persistence/migrations/admindb/000012_authsrv_projectgroupnamespacerole.down.sql @@ -0,0 +1,2 @@ +DROP TABLE IF EXISTS authsrv_projectgroupnamespacerole; +DROP SEQUENCE IF EXISTS authsrv_projectgroupnamespacerole_id_seq; \ No newline at end of file diff --git a/persistence/migrations/admindb/000012_authsrv_projectgroupnamespacerole.up.sql b/persistence/migrations/admindb/000012_authsrv_projectgroupnamespacerole.up.sql new file mode 100644 index 0000000..6c00134 --- /dev/null +++ b/persistence/migrations/admindb/000012_authsrv_projectgroupnamespacerole.up.sql @@ -0,0 +1,53 @@ +CREATE TABLE IF NOT EXISTS authsrv_projectgroupnamespacerole ( + id uuid NOT NULL default uuid_generate_v4(), + name character varying(256) NOT NULL, + description character varying(512) NOT NULL, + created_at timestamp with time zone NOT NULL, + modified_at timestamp with time zone NOT NULL, + trash boolean NOT NULL, + namespace_id integer NOT NULL, + active boolean NOT NULL, + group_id uuid NOT NULL, + organization_id uuid, + partner_id uuid, + project_id uuid, + role_id uuid NOT NULL +); + +ALTER TABLE authsrv_projectgroupnamespacerole OWNER TO admindbuser; + +ALTER TABLE ONLY authsrv_projectgroupnamespacerole ADD CONSTRAINT authsrv_projectgroupnamespacerole_pkey PRIMARY KEY (id); + +CREATE INDEX authsrv_projectgroupnamespacerole_group_id_15ba5c48 ON authsrv_projectgroupnamespacerole USING btree (group_id); + +CREATE INDEX authsrv_projectgroupnamespacerole_name_0d0cc737 ON authsrv_projectgroupnamespacerole USING btree (name); + +CREATE INDEX authsrv_projectgroupnamespacerole_name_0d0cc737_like ON authsrv_projectgroupnamespacerole USING btree (name varchar_pattern_ops); + +CREATE INDEX authsrv_projectgroupnamespacerole_organization_id_0b4626e3 ON authsrv_projectgroupnamespacerole USING btree (organization_id); + +CREATE INDEX authsrv_projectgroupnamespacerole_partner_id_698d3c06 ON authsrv_projectgroupnamespacerole USING btree (partner_id); + +CREATE INDEX authsrv_projectgroupnamespacerole_project_id_70668f98 ON authsrv_projectgroupnamespacerole USING btree (project_id); + +CREATE INDEX authsrv_projectgroupnamespacerole_role_id_75ee38a5 ON authsrv_projectgroupnamespacerole USING btree (role_id); + +ALTER TABLE ONLY authsrv_projectgroupnamespacerole + ADD CONSTRAINT authsrv_projectgroup_group_id_15ba5c48_fk_authsrv_g FOREIGN KEY (group_id) + REFERENCES authsrv_group(id) DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE ONLY authsrv_projectgroupnamespacerole + ADD CONSTRAINT authsrv_projectgroup_organization_id_0b4626e3_fk_authsrv_o FOREIGN KEY (organization_id) + REFERENCES authsrv_organization(id) DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE ONLY authsrv_projectgroupnamespacerole + ADD CONSTRAINT authsrv_projectgroup_partner_id_698d3c06_fk_authsrv_p FOREIGN KEY (partner_id) + REFERENCES authsrv_partner(id) DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE ONLY authsrv_projectgroupnamespacerole + ADD CONSTRAINT authsrv_projectgroup_project_id_70668f98_fk_authsrv_p FOREIGN KEY (project_id) + REFERENCES authsrv_project(id) DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE ONLY authsrv_projectgroupnamespacerole + ADD CONSTRAINT authsrv_projectgroup_role_id_75ee38a5_fk_authsrv_r FOREIGN KEY (role_id) + REFERENCES authsrv_resourcerole(id) DEFERRABLE INITIALLY DEFERRED; \ No newline at end of file diff --git a/persistence/migrations/admindb/000013_authsrv_projectgrouprole.down.sql b/persistence/migrations/admindb/000013_authsrv_projectgrouprole.down.sql new file mode 100644 index 0000000..b0ffc74 --- /dev/null +++ b/persistence/migrations/admindb/000013_authsrv_projectgrouprole.down.sql @@ -0,0 +1,2 @@ +DROP TABLE IF EXISTS authsrv_projectgrouprole; +DROP SEQUENCE IF EXISTS authsrv_projectgrouprole_id_seq; \ No newline at end of file diff --git a/persistence/migrations/admindb/000013_authsrv_projectgrouprole.up.sql b/persistence/migrations/admindb/000013_authsrv_projectgrouprole.up.sql new file mode 100644 index 0000000..72bc50a --- /dev/null +++ b/persistence/migrations/admindb/000013_authsrv_projectgrouprole.up.sql @@ -0,0 +1,53 @@ +CREATE TABLE IF NOT EXISTS authsrv_projectgrouprole ( + id uuid NOT NULL default uuid_generate_v4(), + name character varying(256) NOT NULL, + description character varying(512) NOT NULL, + created_at timestamp with time zone NOT NULL, + modified_at timestamp with time zone NOT NULL, + trash boolean NOT NULL, + "default" boolean NOT NULL, + active boolean NOT NULL, + group_id uuid NOT NULL, + organization_id uuid, + partner_id uuid, + project_id uuid, + role_id uuid NOT NULL +); + +ALTER TABLE authsrv_projectgrouprole OWNER TO admindbuser; + +ALTER TABLE ONLY authsrv_projectgrouprole ADD CONSTRAINT authsrv_projectgrouprole_pkey PRIMARY KEY (id); + +CREATE INDEX authsrv_projectgrouprole_group_id_bda11774 ON authsrv_projectgrouprole USING btree (group_id); + +CREATE INDEX authsrv_projectgrouprole_name_34417538 ON authsrv_projectgrouprole USING btree (name); + +CREATE INDEX authsrv_projectgrouprole_name_34417538_like ON authsrv_projectgrouprole USING btree (name varchar_pattern_ops); + +CREATE INDEX authsrv_projectgrouprole_organization_id_f149c4f0 ON authsrv_projectgrouprole USING btree (organization_id); + +CREATE INDEX authsrv_projectgrouprole_partner_id_72198047 ON authsrv_projectgrouprole USING btree (partner_id); + +CREATE INDEX authsrv_projectgrouprole_project_id_5c5917b5 ON authsrv_projectgrouprole USING btree (project_id); + +CREATE INDEX authsrv_projectgrouprole_role_id_d930456e ON authsrv_projectgrouprole USING btree (role_id); + +ALTER TABLE ONLY authsrv_projectgrouprole + ADD CONSTRAINT authsrv_projectgroup_organization_id_f149c4f0_fk_authsrv_o FOREIGN KEY (organization_id) + REFERENCES authsrv_organization(id) DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE ONLY authsrv_projectgrouprole + ADD CONSTRAINT authsrv_projectgroup_partner_id_72198047_fk_authsrv_p FOREIGN KEY (partner_id) + REFERENCES authsrv_partner(id) DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE ONLY authsrv_projectgrouprole + ADD CONSTRAINT authsrv_projectgroup_project_id_5c5917b5_fk_authsrv_p FOREIGN KEY (project_id) + REFERENCES authsrv_project(id) DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE ONLY authsrv_projectgrouprole + ADD CONSTRAINT authsrv_projectgroup_role_id_d930456e_fk_authsrv_r FOREIGN KEY (role_id) + REFERENCES authsrv_resourcerole(id) DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE ONLY authsrv_projectgrouprole + ADD CONSTRAINT authsrv_projectgrouprole_group_id_bda11774_fk_authsrv_group_id FOREIGN KEY (group_id) + REFERENCES authsrv_group(id) DEFERRABLE INITIALLY DEFERRED; \ No newline at end of file diff --git a/persistence/migrations/admindb/000014_authsrv_groupaccount.down.sql b/persistence/migrations/admindb/000014_authsrv_groupaccount.down.sql new file mode 100644 index 0000000..bc5a593 --- /dev/null +++ b/persistence/migrations/admindb/000014_authsrv_groupaccount.down.sql @@ -0,0 +1,2 @@ +DROP TABLE IF EXISTS authsrv_groupaccount; +DROP SEQUENCE IF EXISTS authsrv_groupaccount_id_seq; \ No newline at end of file diff --git a/persistence/migrations/admindb/000014_authsrv_groupaccount.up.sql b/persistence/migrations/admindb/000014_authsrv_groupaccount.up.sql new file mode 100644 index 0000000..a0a7fce --- /dev/null +++ b/persistence/migrations/admindb/000014_authsrv_groupaccount.up.sql @@ -0,0 +1,31 @@ +CREATE TABLE IF NOT EXISTS authsrv_groupaccount ( + id uuid NOT NULL default uuid_generate_v4(), + name character varying(256) NOT NULL, + description character varying(512) NOT NULL, + created_at timestamp with time zone NOT NULL, + modified_at timestamp with time zone NOT NULL, + trash boolean NOT NULL, + account_id uuid NOT NULL, + group_id uuid NOT NULL, + active boolean not null default true +); + +ALTER TABLE authsrv_groupaccount OWNER TO admindbuser; + +ALTER TABLE ONLY authsrv_groupaccount ADD CONSTRAINT authsrv_groupaccount_pkey PRIMARY KEY (id); + +CREATE INDEX authsrv_groupaccount_account_id_041e4e98 ON authsrv_groupaccount USING btree (account_id); + +CREATE INDEX authsrv_groupaccount_group_id_c67750ef ON authsrv_groupaccount USING btree (group_id); + +CREATE INDEX authsrv_groupaccount_name_d17de056 ON authsrv_groupaccount USING btree (name); + +CREATE INDEX authsrv_groupaccount_name_d17de056_like ON authsrv_groupaccount USING btree (name varchar_pattern_ops); + +ALTER TABLE ONLY authsrv_groupaccount + ADD CONSTRAINT authsrv_groupaccount_account_id_041e4e98_fk_authsrv_account_id FOREIGN KEY (account_id) + REFERENCES authsrv_account(id) DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE ONLY authsrv_groupaccount + ADD CONSTRAINT authsrv_groupaccount_group_id_c67750ef_fk_authsrv_group_id FOREIGN KEY (group_id) + REFERENCES authsrv_group(id) DEFERRABLE INITIALLY DEFERRED; \ No newline at end of file diff --git a/persistence/migrations/admindb/000015_authsrv_grouprole.down.sql b/persistence/migrations/admindb/000015_authsrv_grouprole.down.sql new file mode 100644 index 0000000..221b66f --- /dev/null +++ b/persistence/migrations/admindb/000015_authsrv_grouprole.down.sql @@ -0,0 +1,2 @@ +DROP TABLE IF EXISTS authsrv_grouprole; +DROP SEQUENCE IF EXISTS authsrv_grouprole_id_seq; \ No newline at end of file diff --git a/persistence/migrations/admindb/000015_authsrv_grouprole.up.sql b/persistence/migrations/admindb/000015_authsrv_grouprole.up.sql new file mode 100644 index 0000000..81ed682 --- /dev/null +++ b/persistence/migrations/admindb/000015_authsrv_grouprole.up.sql @@ -0,0 +1,46 @@ +CREATE TABLE IF NOT EXISTS authsrv_grouprole ( + id uuid NOT NULL default uuid_generate_v4(), + name character varying(256) NOT NULL, + description character varying(512) NOT NULL, + created_at timestamp with time zone NOT NULL, + modified_at timestamp with time zone NOT NULL, + trash boolean NOT NULL, + "default" boolean NOT NULL, + active boolean NOT NULL, + group_id uuid NOT NULL, + organization_id uuid, + partner_id uuid, + role_id uuid NOT NULL +); + +ALTER TABLE authsrv_grouprole OWNER TO admindbuser; + +ALTER TABLE ONLY authsrv_grouprole ADD CONSTRAINT authsrv_grouprole_pkey PRIMARY KEY (id); + +CREATE INDEX authsrv_grouprole_group_id_2f1402a5 ON authsrv_grouprole USING btree (group_id); + +CREATE INDEX authsrv_grouprole_name_3810bc7c ON authsrv_grouprole USING btree (name); + +CREATE INDEX authsrv_grouprole_name_3810bc7c_like ON authsrv_grouprole USING btree (name varchar_pattern_ops); + +CREATE INDEX authsrv_grouprole_organization_id_9e77495d ON authsrv_grouprole USING btree (organization_id); + +CREATE INDEX authsrv_grouprole_partner_id_f27b027a ON authsrv_grouprole USING btree (partner_id); + +CREATE INDEX authsrv_grouprole_role_id_786f31f9 ON authsrv_grouprole USING btree (role_id); + +ALTER TABLE ONLY authsrv_grouprole + ADD CONSTRAINT authsrv_grouprole_group_id_2f1402a5_fk_authsrv_group_id FOREIGN KEY (group_id) + REFERENCES authsrv_group(id) DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE ONLY authsrv_grouprole + ADD CONSTRAINT authsrv_grouprole_organization_id_9e77495d_fk_authsrv_o FOREIGN KEY (organization_id) + REFERENCES authsrv_organization(id) DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE ONLY authsrv_grouprole + ADD CONSTRAINT authsrv_grouprole_partner_id_f27b027a_fk_authsrv_partner_id FOREIGN KEY (partner_id) + REFERENCES authsrv_partner(id) DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE ONLY authsrv_grouprole + ADD CONSTRAINT authsrv_grouprole_role_id_786f31f9_fk_authsrv_resourcerole_id FOREIGN KEY (role_id) + REFERENCES authsrv_resourcerole(id) DEFERRABLE INITIALLY DEFERRED; \ No newline at end of file diff --git a/persistence/migrations/admindb/000016_authsrv_accountresourcerole.down.sql b/persistence/migrations/admindb/000016_authsrv_accountresourcerole.down.sql new file mode 100644 index 0000000..c345663 --- /dev/null +++ b/persistence/migrations/admindb/000016_authsrv_accountresourcerole.down.sql @@ -0,0 +1,2 @@ +DROP TABLE IF EXISTS authsrv_accountresourcerole; +DROP SEQUENCE IF EXISTS authsrv_accountresourcerole_id_seq; \ No newline at end of file diff --git a/persistence/migrations/admindb/000016_authsrv_accountresourcerole.up.sql b/persistence/migrations/admindb/000016_authsrv_accountresourcerole.up.sql new file mode 100644 index 0000000..a6764ad --- /dev/null +++ b/persistence/migrations/admindb/000016_authsrv_accountresourcerole.up.sql @@ -0,0 +1,46 @@ +CREATE TABLE IF NOT EXISTS authsrv_accountresourcerole ( + id uuid NOT NULL default uuid_generate_v4(), + name character varying(256) NOT NULL, + description character varying(512) NOT NULL, + created_at timestamp with time zone NOT NULL, + modified_at timestamp with time zone NOT NULL, + trash boolean NOT NULL, + "default" boolean NOT NULL, + active boolean NOT NULL, + account_id uuid NOT NULL, + organization_id uuid, + partner_id uuid, + role_id uuid NOT NULL +); + +ALTER TABLE authsrv_accountresourcerole OWNER TO admindbuser; + +ALTER TABLE ONLY authsrv_accountresourcerole ADD CONSTRAINT authsrv_accountresourcerole_pkey PRIMARY KEY (id); + +CREATE INDEX authsrv_accountresourcerole_account_id_229069ae ON authsrv_accountresourcerole USING btree (account_id); + +CREATE INDEX authsrv_accountresourcerole_name_e1f3d8a0 ON authsrv_accountresourcerole USING btree (name); + +CREATE INDEX authsrv_accountresourcerole_name_e1f3d8a0_like ON authsrv_accountresourcerole USING btree (name varchar_pattern_ops); + +CREATE INDEX authsrv_accountresourcerole_organization_id_22bb772c ON authsrv_accountresourcerole USING btree (organization_id); + +CREATE INDEX authsrv_accountresourcerole_partner_id_8e96aff4 ON authsrv_accountresourcerole USING btree (partner_id); + +CREATE INDEX authsrv_accountresourcerole_role_id_769ec143 ON authsrv_accountresourcerole USING btree (role_id); + +ALTER TABLE ONLY authsrv_accountresourcerole + ADD CONSTRAINT authsrv_accountresou_account_id_229069ae_fk_authsrv_a FOREIGN KEY (account_id) + REFERENCES authsrv_account(id) DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE ONLY authsrv_accountresourcerole + ADD CONSTRAINT authsrv_accountresou_organization_id_22bb772c_fk_authsrv_o FOREIGN KEY (organization_id) + REFERENCES authsrv_organization(id) DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE ONLY authsrv_accountresourcerole + ADD CONSTRAINT authsrv_accountresou_partner_id_8e96aff4_fk_authsrv_p FOREIGN KEY (partner_id) + REFERENCES authsrv_partner(id) DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE ONLY authsrv_accountresourcerole + ADD CONSTRAINT authsrv_accountresou_role_id_769ec143_fk_authsrv_r FOREIGN KEY (role_id) + REFERENCES authsrv_resourcerole(id) DEFERRABLE INITIALLY DEFERRED; \ No newline at end of file diff --git a/persistence/migrations/admindb/000017_authsrv_template.down.sql b/persistence/migrations/admindb/000017_authsrv_template.down.sql new file mode 100644 index 0000000..5b85c08 --- /dev/null +++ b/persistence/migrations/admindb/000017_authsrv_template.down.sql @@ -0,0 +1,2 @@ +DROP TABLE IF EXISTS authsrv_template; +DROP SEQUENCE IF EXISTS authsrv_template_id_seq; \ No newline at end of file diff --git a/persistence/migrations/admindb/000017_authsrv_template.up.sql b/persistence/migrations/admindb/000017_authsrv_template.up.sql new file mode 100644 index 0000000..b36483c --- /dev/null +++ b/persistence/migrations/admindb/000017_authsrv_template.up.sql @@ -0,0 +1,25 @@ +CREATE TABLE IF NOT EXISTS authsrv_template ( + id uuid NOT NULL default uuid_generate_v4(), + name character varying(256) NOT NULL, + description character varying(512) NOT NULL, + created_at timestamp with time zone NOT NULL, + modified_at timestamp with time zone NOT NULL, + trash boolean NOT NULL, + type character varying(64) NOT NULL, + source text NOT NULL, + partner_id uuid NOT NULL +); + +ALTER TABLE authsrv_template OWNER TO admindbuser; + +ALTER TABLE ONLY authsrv_template ADD CONSTRAINT authsrv_template_pkey PRIMARY KEY (id); + +CREATE INDEX authsrv_template_name_274ef2d3 ON authsrv_template USING btree (name); + +CREATE INDEX authsrv_template_name_274ef2d3_like ON authsrv_template USING btree (name varchar_pattern_ops); + +CREATE INDEX authsrv_template_partner_id_2fcb0ded ON authsrv_template USING btree (partner_id); + +ALTER TABLE ONLY authsrv_template + ADD CONSTRAINT authsrv_template_partner_id_2fcb0ded_fk_authsrv_partner_id FOREIGN KEY (partner_id) + REFERENCES authsrv_partner(id) DEFERRABLE INITIALLY DEFERRED; \ No newline at end of file diff --git a/persistence/migrations/clusterdb/000001_cluster_tokens.down.sql b/persistence/migrations/clusterdb/000001_cluster_tokens.down.sql new file mode 100644 index 0000000..b7d3c38 --- /dev/null +++ b/persistence/migrations/clusterdb/000001_cluster_tokens.down.sql @@ -0,0 +1,2 @@ +DROP TABLE IF EXISTS cluster_tokens; +DROP SEQUENCE IF EXISTS cluster_tokens_id_seq; \ No newline at end of file diff --git a/persistence/migrations/clusterdb/000001_cluster_tokens.up.sql b/persistence/migrations/clusterdb/000001_cluster_tokens.up.sql new file mode 100644 index 0000000..71421c9 --- /dev/null +++ b/persistence/migrations/clusterdb/000001_cluster_tokens.up.sql @@ -0,0 +1,36 @@ +CREATE TABLE IF NOT EXISTS cluster_tokens ( + -- database id fields + id bigserial NOT NULL, + name varchar NOT NULL, + organization_id integer not null default 0, + partner_id integer not null default 0, + project_id integer not null default 0, + -- rafay meta fields + display_name varchar NOT NULL, + created_at timestamp WITH time zone NOT NULL, + modified_at timestamp WITH time zone, + deleted_at timestamp with time zone, + labels jsonb NOT NULL DEFAULT '{}'::jsonb, + annotations jsonb NOT NULL DEFAULT '{}'::jsonb, + -- cluster token spec fields + token_type varchar NOT NULL, + -- cluster token status fields + state varchar NOT NULL +); + +ALTER TABLE cluster_tokens OWNER TO clusterdbuser; + +CREATE SEQUENCE IF NOT EXISTS cluster_tokens_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER TABLE cluster_tokens_id_seq OWNER TO clusterdbuser; + +ALTER SEQUENCE cluster_tokens_id_seq OWNED BY cluster_tokens.id; + +ALTER TABLE ONLY cluster_tokens ALTER COLUMN id SET DEFAULT nextval('cluster_tokens_id_seq'::regclass); + +ALTER TABLE ONLY cluster_tokens ADD CONSTRAINT cluster_tokens_pkey PRIMARY KEY (name); \ No newline at end of file diff --git a/persistence/migrations/clusterdb/000002_cluster_clusters.down.sql b/persistence/migrations/clusterdb/000002_cluster_clusters.down.sql new file mode 100644 index 0000000..accb67b --- /dev/null +++ b/persistence/migrations/clusterdb/000002_cluster_clusters.down.sql @@ -0,0 +1,2 @@ +DROP TABLE IF EXISTS cluster_clusters; +DROP SEQUENCE IF EXISTS cluster_clusters_id_seq; \ No newline at end of file diff --git a/persistence/migrations/clusterdb/000002_cluster_clusters.up.sql b/persistence/migrations/clusterdb/000002_cluster_clusters.up.sql new file mode 100644 index 0000000..0d14db5 --- /dev/null +++ b/persistence/migrations/clusterdb/000002_cluster_clusters.up.sql @@ -0,0 +1,51 @@ +CREATE TABLE IF NOT EXISTS cluster_clusters ( + id serial NOT NULL, + organization_id integer not null default 0, + partner_id integer not null default 0, + project_id integer not null default 0, + name varchar NOT NULL, + display_name varchar NOT NULL, + created_at timestamp WITH time zone NOT NULL, + modified_at timestamp WITH time zone, + deleted_at timestamp with time zone, + labels jsonb NOT NULL DEFAULT '{}'::jsonb, + annotations jsonb NOT NULL DEFAULT '{}'::jsonb, + blueprint_ref varchar NOT NULL default '', + override_selector varchar NOT NULL default '', + token varchar not null, + conditions jsonb NOT NULL default '[]'::jsonb, + published_blueprint varchar NOT NULL default '', + system_task_count integer NOT NULL DEFAULT 0, + custom_task_count integer NOT NULL DEFAULT 0, + auxiliary_task_count integer NOT NULL DEFAULT 0, + extra jsonb NOT NULL DEFAULT '{}'::jsonb, + share_mode VARCHAR DEFAULT 'CUSTOM', + proxy_config jsonb +); + +ALTER TABLE cluster_clusters OWNER TO clusterdbuser; + +CREATE SEQUENCE IF NOT EXISTS cluster_clusters_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER TABLE cluster_clusters_id_seq OWNER TO clusterdbuser; + +ALTER SEQUENCE cluster_clusters_id_seq OWNED BY cluster_clusters.id; + +ALTER TABLE ONLY cluster_clusters ALTER COLUMN id SET DEFAULT nextval('cluster_clusters_id_seq'::regclass); + +ALTER TABLE ONLY cluster_clusters ADD CONSTRAINT cluster_clusters_pkey PRIMARY KEY (id); + +CREATE INDEX cluster_clusters_name_organization_id_partner_id_key ON cluster_clusters USING btree (name, organization_id, partner_id); + +CREATE INDEX idx_cluster_blueprint ON cluster_clusters USING btree (blueprint_ref, published_blueprint); + +CREATE INDEX idx_clusters_labels ON cluster_clusters USING GIN (labels jsonb_path_ops); + +ALTER TABLE ONLY cluster_clusters + ADD CONSTRAINT cluster_clusters_token_fkey FOREIGN KEY (token) + REFERENCES cluster_tokens(name) DEFERRABLE INITIALLY DEFERRED; \ No newline at end of file diff --git a/persistence/migrations/clusterdb/000003_cluster_project_cluster.down.sql b/persistence/migrations/clusterdb/000003_cluster_project_cluster.down.sql new file mode 100644 index 0000000..22fa83d --- /dev/null +++ b/persistence/migrations/clusterdb/000003_cluster_project_cluster.down.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS cluster_project_cluster; \ No newline at end of file diff --git a/persistence/migrations/clusterdb/000003_cluster_project_cluster.up.sql b/persistence/migrations/clusterdb/000003_cluster_project_cluster.up.sql new file mode 100644 index 0000000..c08583e --- /dev/null +++ b/persistence/migrations/clusterdb/000003_cluster_project_cluster.up.sql @@ -0,0 +1,12 @@ +CREATE TABLE IF NOT EXISTS cluster_project_cluster ( + project_id integer NOT NULL, + cluster_id integer NOT NULL +); + +ALTER TABLE cluster_project_cluster OWNER TO clusterdbuser; + +CREATE INDEX cluster_project_cluster_project_id_cluster_id_key ON cluster_project_cluster USING btree (project_id, cluster_id); + +ALTER TABLE ONLY cluster_project_cluster + ADD CONSTRAINT cluster_project_cluster_cluster_id_fkey FOREIGN KEY (cluster_id) + REFERENCES cluster_clusters(id) DEFERRABLE INITIALLY DEFERRED; \ No newline at end of file diff --git a/persistence/migrations/clusterdb/000004_cluster_namespaces.down.sql b/persistence/migrations/clusterdb/000004_cluster_namespaces.down.sql new file mode 100644 index 0000000..126dc9d --- /dev/null +++ b/persistence/migrations/clusterdb/000004_cluster_namespaces.down.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS cluster_namespaces; \ No newline at end of file diff --git a/persistence/migrations/clusterdb/000004_cluster_namespaces.up.sql b/persistence/migrations/clusterdb/000004_cluster_namespaces.up.sql new file mode 100644 index 0000000..c83167c --- /dev/null +++ b/persistence/migrations/clusterdb/000004_cluster_namespaces.up.sql @@ -0,0 +1,18 @@ +CREATE TABLE IF NOT EXISTS cluster_namespaces ( + cluster_id integer NOT NULL, + name varchar NOT NULL, + hash varchar NOT NULL, + deleted_at timestamp WITH time zone, + type varchar not null, + namespace jsonb not null, + conditions jsonb not null default '[]'::jsonb, + status jsonb not null default '{}'::jsonb +); + +ALTER TABLE cluster_namespaces OWNER TO clusterdbuser; + +ALTER TABLE ONLY cluster_namespaces ADD CONSTRAINT cluster_namespaces_pkey PRIMARY KEY (cluster_id, name); + +ALTER TABLE ONLY cluster_namespaces + ADD CONSTRAINT cluster_project_cluster_cluster_id_fkey FOREIGN KEY (cluster_id) + REFERENCES cluster_clusters(id) DEFERRABLE INITIALLY DEFERRED; \ No newline at end of file diff --git a/persistence/migrations/clusterdb/000005_cluster_nodes.down.sql b/persistence/migrations/clusterdb/000005_cluster_nodes.down.sql new file mode 100644 index 0000000..3aa86bb --- /dev/null +++ b/persistence/migrations/clusterdb/000005_cluster_nodes.down.sql @@ -0,0 +1,2 @@ +DROP TABLE IF EXISTS cluster_nodes; +DROP SEQUENCE IF EXISTS cluster_nodes_id_seq; \ No newline at end of file diff --git a/persistence/migrations/clusterdb/000005_cluster_nodes.up.sql b/persistence/migrations/clusterdb/000005_cluster_nodes.up.sql new file mode 100644 index 0000000..5e49818 --- /dev/null +++ b/persistence/migrations/clusterdb/000005_cluster_nodes.up.sql @@ -0,0 +1,44 @@ +CREATE TABLE IF NOT EXISTS cluster_nodes ( + cluster_id integer NOT NULL, + organization_id integer not null default 0, + partner_id integer not null default 0, + project_id integer not null default 0, + name varchar NOT NULL, + display_name varchar NOT NULL, + created_at timestamp WITH time zone NOT NULL, + modified_at timestamp WITH time zone, + deleted_at timestamp with time zone, + labels jsonb NOT NULL DEFAULT '{}'::jsonb, + annotations jsonb NOT NULL DEFAULT '{}'::jsonb, + unschedulable bool NOT NULL DEFAULT FALSE, + taints jsonb NOT NULL DEFAULT '[]'::jsonb, + conditions jsonb NOT NULL DEFAULT '[]'::jsonb, + node_info jsonb NOT NULL DEFAULT '{}'::jsonb, + state varchar NOT NULL, + capacity jsonb NOT NULL DEFAULT '{}'::jsonb, + allocatable jsonb NOT NULL DEFAULT '{}'::jsonb, + allocated jsonb NOT NULL DEFAULT '{}'::jsonb, + ips jsonb NOT NULL DEFAULT '[]'::jsonb, + id bigserial +); + +ALTER TABLE cluster_nodes OWNER TO clusterdbuser; + +CREATE SEQUENCE IF NOT EXISTS cluster_nodes_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER TABLE cluster_nodes_id_seq OWNER TO clusterdbuser; + +ALTER SEQUENCE cluster_nodes_id_seq OWNED BY cluster_nodes.id; + +ALTER TABLE ONLY cluster_nodes ADD CONSTRAINT cluster_nodes_name_cluster_id_key PRIMARY KEY (name, cluster_id); + +CREATE INDEX idx_nodes_lables ON cluster_nodes USING GIN (labels jsonb_path_ops); + +ALTER TABLE ONLY cluster_nodes + ADD CONSTRAINT cluster_nodes_cluster_id_fkey FOREIGN KEY (cluster_id) + REFERENCES cluster_clusters(id) DEFERRABLE INITIALLY DEFERRED; \ No newline at end of file diff --git a/persistence/migrations/clusterdb/000006_cluster_placements.down.sql b/persistence/migrations/clusterdb/000006_cluster_placements.down.sql new file mode 100644 index 0000000..bca81bc --- /dev/null +++ b/persistence/migrations/clusterdb/000006_cluster_placements.down.sql @@ -0,0 +1,2 @@ +DROP TABLE IF EXISTS cluster_placements; +DROP SEQUENCE IF EXISTS cluster_placements_id_seq; \ No newline at end of file diff --git a/persistence/migrations/clusterdb/000006_cluster_placements.up.sql b/persistence/migrations/clusterdb/000006_cluster_placements.up.sql new file mode 100644 index 0000000..8a9fd78 --- /dev/null +++ b/persistence/migrations/clusterdb/000006_cluster_placements.up.sql @@ -0,0 +1,41 @@ +CREATE TABLE IF NOT EXISTS cluster_placements( + id serial NOT NULL, + organization_id integer not null default 0, + partner_id integer not null default 0, + project_id integer not null default 0, + name varchar NOT NULL, + display_name varchar NOT NULL, + created_at timestamp WITH time zone NOT NULL, + modified_at timestamp WITH time zone, + deleted_at timestamp with time zone, + labels jsonb NOT NULL DEFAULT '{}'::jsonb, + annotations jsonb NOT NULL DEFAULT '{}'::jsonb, + artifact_type varchar NOT NULL, + spec jsonb NOT NULL, + deployment_plan jsonb NOT NULL, + workload_id integer NOT NULL default 0, + revision integer NOT NULL default 0, + generation varchar NOT NULL default '', + last_reconciled_at timestamp WITH time zone NOT NULL, + conditions jsonb NOT NULL, + pipeline_meta jsonb +); + +ALTER TABLE cluster_placements OWNER TO clusterdbuser; + +CREATE SEQUENCE IF NOT EXISTS cluster_placements_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER TABLE cluster_placements_id_seq OWNER TO clusterdbuser; + +ALTER SEQUENCE cluster_placements_id_seq OWNED BY cluster_placements.id; + +ALTER TABLE ONLY cluster_placements ADD CONSTRAINT cluster_placements_pkey PRIMARY KEY (id); + +CREATE INDEX cluster_placements_name_organization_id_partner_id_project__key ON cluster_placements USING btree (name, organization_id, partner_id, project_id); + +CREATE INDEX idx_placement_lables ON cluster_placements USING GIN (labels jsonb_path_ops); \ No newline at end of file