Merge pull request #6 from RafaySystems/usermgmt-db

Initial setup for users/groups/roles
This commit is contained in:
nirav-rafay
2022-01-14 16:32:42 +05:30
committed by GitHub
68 changed files with 17428 additions and 44 deletions

View File

@@ -1,2 +1,47 @@
# rcloud-base
rcloud-base
## Setting up the database
### Create the initial db/user
Example for `admindb`:
``` sql
create database admindb;
create user admindbuser;
```
Now in the newly created db:
``` sql
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
grant execute on function uuid_generate_v4() to admindbuser;
```
*This will grant the necessary permission to the newly created user to run uuid_generate_v4()*
### Run application migrations
We use [`golang-migrate`](https://github.com/golang-migrate/migrate) to perform migrations.
#### Install [`golang-migrate`](https://github.com/golang-migrate/migrate)
``` shell
go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest
```
*`-tags 'postgres'` is important as otherwise it compiles without postgres support*
You can refer to the [guide](https://github.com/golang-migrate/migrate/tree/master/cmd/migrate) for full details.
#### Run migrations
Example for `admindb`:
``` shell
export POSTGRESQL_URL='postgres://<user>:<pass>@<host>:<port>/admindb?sslmode=disable'
migrate -path ./persistence/migrations/admindb -database "$POSTGRESQL_URL" up
```
See [cli-usage](https://github.com/golang-migrate/migrate#cli-usage) for more info.

View File

@@ -8,7 +8,7 @@ require (
github.com/google/uuid v1.3.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.2
github.com/spf13/viper v1.10.1
github.com/uptrace/bun v1.0.21
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
@@ -59,3 +59,5 @@ require (
mellium.im/sasl v0.2.1 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
replace github.com/RafaySystems/rcloud-base/components/common v0.0.0-unpublished => ../common/

View File

@@ -531,9 +531,8 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1
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/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM=
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 v1.0.21 h1:5ek4bnrEmZo6wvY/RHt1dJNXzOPOnrfJeZMoZfZt9Io=
github.com/uptrace/bun v1.0.21/go.mod h1:u+QsgCgjGFwshy3euGAN1CLEO9RMf42lga5jQ/ezYsc=
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=

View File

@@ -11,7 +11,7 @@ require (
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
github.com/uptrace/bun v1.0.21
github.com/uptrace/bun v1.0.20
go.uber.org/zap v1.19.1
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa
google.golang.org/grpc v1.43.0

View File

@@ -172,8 +172,8 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc
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.21 h1:5ek4bnrEmZo6wvY/RHt1dJNXzOPOnrfJeZMoZfZt9Io=
github.com/uptrace/bun v1.0.21/go.mod h1:u+QsgCgjGFwshy3euGAN1CLEO9RMf42lga5jQ/ezYsc=
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=

View File

@@ -0,0 +1,28 @@
# User management
This module is responsible for manging users/groups/roles as well as being a frontend for the casbin internal service.
All user/auth related requests go through here.
## Development
### Run kratos migrations
``` shele
export DSN='postgres://postgres@localhost:5432/admindb?sslmode=disable'
kratos -c kratos.yaml migrate sql -e --yes
```
### Start kratos
``` shell
cd components/usermgmt/_kratos
kratos serve -c kratos.yml
```
### Run usermgmt server
``` shell
cd components/usermgmt/_kratos
go run main.go
```

View File

@@ -0,0 +1,48 @@
{
"$id": "https://schemas.ory.sh/presets/kratos/quickstart/email-password/identity.schema.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Person",
"type": "object",
"properties": {
"traits": {
"type": "object",
"properties": {
"first_name": {
"title": "First name",
"type": "string",
"pattern": "^.*$"
},
"last_name": {
"title": "Last name",
"type": "string",
"pattern": "^.*$"
},
"email": {
"type": "string",
"format": "email",
"title": "E-Mail",
"minLength": 3,
"ory.sh/kratos": {
"credentials": {
"password": {
"identifier": true
}
},
"verification": {
"via": "email"
},
"recovery": {
"via": "email"
}
}
}
},
"required": [
"first_name",
"last_name",
"email"
],
"additionalProperties": false
}
}
}

View File

@@ -0,0 +1,79 @@
version: v0.7.1-alpha.1
dsn: postgres://admindbuser@localhost:5432/admindb?sslmode=disable
serve:
public:
base_url: http://127.0.0.1:4433/
cors:
enabled: true
admin:
base_url: http://127.0.0.1:4434/
selfservice:
default_browser_return_url: http://127.0.0.1:4455/
whitelisted_return_urls:
- http://127.0.0.1:4455
methods:
password:
enabled: true
flows:
error:
ui_url: http://127.0.0.1:4455/error
settings:
ui_url: http://127.0.0.1:4455/settings
privileged_session_max_age: 15m
recovery:
enabled: true
ui_url: http://127.0.0.1:4455/recovery
verification:
enabled: true
ui_url: http://127.0.0.1:4455/verify
after:
default_browser_return_url: http://127.0.0.1:4455/
logout:
after:
default_browser_return_url: http://127.0.0.1:4455/auth/login
login:
ui_url: http://127.0.0.1:4455/auth/login
lifespan: 10m
registration:
lifespan: 10m
ui_url: http://127.0.0.1:4455/auth/registration
after:
password:
hooks:
-
hook: session
log:
level: debug
format: text
leak_sensitive_values: true
secrets:
cookie:
- PLEASE-CHANGE-ME-I-AM-VERY-INSECURE
hashers:
argon2:
parallelism: 1
memory: 128MB
iterations: 2
salt_length: 16
key_length: 16
identity:
default_schema_url: file://identity.schema.json
courier:
smtp:
connection_uri: smtps://test:test@mailslurper:1025/?skip_ssl_verify=true&legacy_ssl=true

View File

@@ -0,0 +1,26 @@
version: v1
managed:
enabled: true
go_package_prefix:
default: github.com/RafaySystems/rcloud-base/components/usermgmt
except:
- buf.build/googleapis/googleapis
- buf.build/grpc-ecosystem/grpc-gateway
- buf.build/gogo/protobuf
override:
buf.build/nparikh/rafay-common: github.com/RafaySystems/rcloud-base/components/common
buf.build/nparikh/adminsrv: github.com/RafaySystems/rcloud-base/components/adminsrv
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

View File

@@ -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

View File

@@ -0,0 +1,12 @@
version: v1
name: buf.build/meain/usermgmt
deps:
# - buf.build/googleapis/googleapis
- buf.build/grpc-ecosystem/grpc-gateway
- buf.build/gogo/protobuf
breaking:
use:
- FILE
lint:
use:
- DEFAULT

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,735 @@
{
"swagger": "2.0",
"info": {
"title": "Rolepermission management Service",
"version": "2.0",
"contact": {
"name": "Rafay Dev"
}
},
"tags": [
{
"name": "Rolepermission"
}
],
"schemes": [
"https"
],
"consumes": [
"application/json",
"application/yaml"
],
"produces": [
"application/json",
"application/yaml"
],
"paths": {
"/auth/v3/rolepermission/{metadata.id}": {
"get": {
"operationId": "Rolepermission_GetRolepermission2",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v3RolePermission"
}
},
"403": {
"description": "Returned when the rolepermission 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 role permission resource",
"in": "query",
"required": false,
"type": "string",
"default": "usermgmt.k8smgmt.io/v3"
},
{
"name": "kind",
"description": "Kind. Kind of the role permission resource",
"in": "query",
"required": false,
"type": "string",
"default": "RolePermission"
},
{
"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.permissions",
"description": "Permissions. List of permisions for role",
"in": "query",
"required": false,
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "multi"
},
{
"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": [
"Rolepermission"
]
}
},
"/auth/v3/rolepermission/{metadata.name}": {
"get": {
"operationId": "Rolepermission_GetRolepermission",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v3RolePermission"
}
},
"403": {
"description": "Returned when the rolepermission 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 role permission resource",
"in": "query",
"required": false,
"type": "string",
"default": "usermgmt.k8smgmt.io/v3"
},
{
"name": "kind",
"description": "Kind. Kind of the role permission resource",
"in": "query",
"required": false,
"type": "string",
"default": "RolePermission"
},
{
"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.permissions",
"description": "Permissions. List of permisions for role",
"in": "query",
"required": false,
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "multi"
},
{
"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": [
"Rolepermission"
]
}
},
"/auth/v3/rolepermissions": {
"get": {
"operationId": "Rolepermission_GetRolepermissions",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v3RolePermissionList"
}
},
"403": {
"description": "Returned when the rolepermission 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": "apiVersion",
"description": "API Version. API Version of the role permission resource",
"in": "query",
"required": false,
"type": "string",
"default": "usermgmt.k8smgmt.io/v3"
},
{
"name": "kind",
"description": "Kind. Kind of the role permission resource",
"in": "query",
"required": false,
"type": "string",
"default": "RolePermission"
},
{
"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.id",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "metadata.modifiedAt",
"in": "query",
"required": false,
"type": "string",
"format": "date-time"
},
{
"name": "spec.permissions",
"description": "Permissions. List of permisions for role",
"in": "query",
"required": false,
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "multi"
},
{
"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": [
"Rolepermission"
]
}
}
},
"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"
]
},
"v3RolePermission": {
"type": "object",
"properties": {
"apiVersion": {
"type": "string",
"default": "usermgmt.k8smgmt.io/v3",
"description": "API Version of the role permission resource",
"title": "API Version"
},
"kind": {
"type": "string",
"default": "RolePermission",
"description": "Kind of the role permission resource",
"title": "Kind"
},
"metadata": {
"$ref": "#/definitions/v3Metadata",
"description": "Metadata of the role permission resource",
"title": "Metadata"
},
"spec": {
"$ref": "#/definitions/v3RolePermissionSpec",
"description": "Metadata of the role permission resource",
"title": "Metadata"
},
"status": {
"$ref": "#/definitions/commonv3Status",
"description": "Status of the resource",
"title": "Status",
"readOnly": true
}
},
"description": "Role Permission",
"title": "RolePermission",
"required": [
"apiVersion",
"kind",
"metadata",
"spec"
]
},
"v3RolePermissionList": {
"type": "object",
"properties": {
"apiVersion": {
"type": "string",
"description": "API Version of the role permission list resource",
"title": "API Version",
"readOnly": true
},
"kind": {
"type": "string",
"description": "Kind of the role permission list resource",
"title": "Kind",
"readOnly": true
},
"metadata": {
"$ref": "#/definitions/v3ListMetadata",
"description": "Metadata of the role permission list resource",
"title": "Metadata",
"readOnly": true
},
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/v3RolePermission"
},
"description": "List of the role permission resources",
"title": "Items",
"readOnly": true
}
},
"description": "RolePeList list",
"title": "RolePermissionList",
"readOnly": true
},
"v3RolePermissionSpec": {
"type": "object",
"properties": {
"permissions": {
"type": "array",
"items": {
"type": "string"
},
"description": "List of permisions for role",
"title": "Permissions"
}
},
"description": "RolePermisson specification",
"title": "RolePermission Specification"
}
},
"securityDefinitions": {
"ApiKeyAuth": {
"type": "apiKey",
"name": "X-RAFAY-API-KEYID",
"in": "header"
},
"BasicAuth": {
"type": "basic"
}
},
"security": [
{
"ApiKeyAuth": [],
"BasicAuth": []
}
]
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,43 @@
{
"swagger": "2.0",
"info": {
"title": "proto/types/userpb/v3/group.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": {}
}
}
}

View File

@@ -0,0 +1,43 @@
{
"swagger": "2.0",
"info": {
"title": "proto/types/userpb/v3/role.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": {}
}
}
}

View File

@@ -0,0 +1,43 @@
{
"swagger": "2.0",
"info": {
"title": "proto/types/userpb/v3/rolepermission.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": {}
}
}
}

View File

@@ -0,0 +1,43 @@
{
"swagger": "2.0",
"info": {
"title": "proto/types/userpb/v3/user.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": {}
}
}
}

View File

@@ -0,0 +1,67 @@
module github.com/RafaySystems/rcloud-base/components/usermgmt
go 1.17
require (
github.com/RafaySystems/rcloud-base/components/adminsrv v0.0.0-unpublished
github.com/RafaySystems/rcloud-base/components/common v0.0.0-unpublished
github.com/gogo/protobuf v1.3.2
github.com/google/uuid v1.3.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.2
github.com/ory/kratos-client-go v0.8.2-alpha.1
github.com/spf13/viper v1.10.1
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
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/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/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/jinzhu/inflection 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
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
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/crypto v0.0.0-20211215153901-e495a2d5b3d3 // indirect
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/appengine v1.6.7 // indirect
gopkg.in/ini.v1 v1.66.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
mellium.im/sasl v0.2.1 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
replace (
github.com/RafaySystems/rcloud-base/components/adminsrv v0.0.0-unpublished => ../adminsrv/
github.com/RafaySystems/rcloud-base/components/common v0.0.0-unpublished => ../common/
)

1126
components/usermgmt/go.sum Normal file

File diff suppressed because it is too large Load Diff

257
components/usermgmt/main.go Normal file
View File

@@ -0,0 +1,257 @@
package main
import (
"context"
"database/sql"
"fmt"
"net"
"net/http"
"sync"
"time"
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
kclient "github.com/ory/kratos-client-go"
"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"
"sigs.k8s.io/controller-runtime/pkg/manager/signals"
"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/RafaySystems/rcloud-base/components/usermgmt/pkg/server"
"github.com/RafaySystems/rcloud-base/components/usermgmt/pkg/service"
pbrpcv3 "github.com/RafaySystems/rcloud-base/components/usermgmt/proto/rpc/v3"
rpcv3 "github.com/RafaySystems/rcloud-base/components/usermgmt/proto/rpc/v3"
"google.golang.org/grpc"
_grpc "google.golang.org/grpc"
)
const (
rpcPortEnv = "RPC_PORT"
apiPortEnv = "API_PORT"
debugPortEnv = "DEBUG_PORT"
kratosSchemeEnv = "KRATOS_SCHEME"
kratosAddrEnv = "KRATOS_ADDR"
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
kratosScheme string
kratosAddr string
kc *kclient.APIClient
dbAddr string
dbName string
dbUser string
dbPassword string
db *bun.DB
us service.UserService
gs service.GroupService
rs service.RoleService
dev bool
_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(kratosSchemeEnv, "http")
viper.SetDefault(kratosAddrEnv, "localhost:4433")
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(kratosSchemeEnv)
viper.BindEnv(kratosAddrEnv)
viper.BindEnv(dbAddrEnv)
viper.BindEnv(dbNameEnv)
viper.BindEnv(dbPasswordEnv)
viper.BindEnv(dbPasswordEnv)
viper.BindEnv(devEnv)
viper.BindEnv(configAddrENV)
rpcPort = viper.GetInt(rpcPortEnv)
apiPort = viper.GetInt(apiPortEnv)
debugPort = viper.GetInt(debugPortEnv)
kratosScheme = viper.GetString(kratosSchemeEnv)
kratosAddr = viper.GetString(kratosAddrEnv)
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
kratosConfig := kclient.NewConfiguration()
kratosConfig.Servers[0].URL = kratosScheme + "://" + kratosAddr
kc = kclient.NewAPIClient(kratosConfig)
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"),
))
us = service.NewUserService(kc, db)
gs = service.NewGroupService(db)
rs = service.NewRoleService(db)
_log.Infow("usermgmt setup complete")
}
func run() {
ctx := signals.SetupSignalHandler()
var wg sync.WaitGroup
wg.Add(1)
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.RegisterUserHandlerFromEndpoint,
pbrpcv3.RegisterGroupHandlerFromEndpoint,
pbrpcv3.RegisterRoleHandlerFromEndpoint,
)
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 configPool.Close()
defer gs.Close()
defer rs.Close()
userServer := server.NewUserServer(us)
groupServer := server.NewGroupServer(gs)
roleServer := server.NewRoleServer(rs)
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")
}()
rpcv3.RegisterUserServer(s, userServer)
rpcv3.RegisterGroupServer(s, groupServer)
rpcv3.RegisterRoleServer(s, roleServer)
_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),
}
_log.Infow("starting debug server", "port", 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()
}

View File

@@ -0,0 +1,137 @@
:host = http://localhost:11000
:partner = 439fd1c6-e947-4dad-a9e9-ca1f50898f85
:org = 960bb196-76b2-430a-a72e-88d8362c07c3
:group = my-group
:role = my-role
:groupid = 99f4ea22-089c-4016-a1f9-e8b156d34cf5
:roleid = 3de58ba8-a42f-49bb-b8bd-052363123fdc
:userid = 8f35abd7-0c8c-4770-a2c7-430f79bb5eb7
:projectid = c61ec2fe-543c-4e10-a1b6-c53c43fb9ca4
## Users
# Create user
POST :host/auth/v3/partner/:partner/organization/:org/users
{"spec": {"username": "updatduser@notaprovider.com", "firstName": "John", "lastName": "Doe"}}
# Create user with roles
POST :host/auth/v3/partner/:partner/organization/:org/users
Content-Type: application/yaml
spec:
username: tany@notarvider.com
firstName: John
lastName: Doe
projectnamespaceroles:
- role: :roleid
namespace: 7
project: :projectid
- role: :roleid
namespace: 9
project: :projectid
# Create user with groups
POST :host/auth/v3/partner/:partner/organization/:org/users
Content-Type: application/yaml
spec:
username: aegy@notaprovider.com
firstName: John
lastName: Doe
groups:
- :groupid
# Get all users
GET :host/auth/v3/partner/:partner/organization/:org/users
# Get single user
GET :host/auth/v3/partner/:partner/organization/:org/user/:userid
# Update user info
PUT :host/auth/v3/partner/:partner/organization/:org/user/:userid
{"spec": {"username": "changedemail@notaprovider.com", "firstName": "John", "lastName": "Doe"}}
# Delete single user
DELETE :host/auth/v3/partner/:partner/organization/:org/user/:userid
## Groups
# Create group
POST :host/auth/v3/partner/:partner/organization/:org/groups
Content-Type: application/yaml
metadata:
name: :groupname
description: My first description
partner: :partner
organization: :org
spec:
type: simple
users:
- 8f35abd7-0c8c-4770-a2c7-430f79bb5eb7
projectnamespaceroles:
- role: :roleid
namespace: 7
project: :projectid
# Create group no namespace
POST :host/auth/v3/partner/:partner/organization/:org/groups
Content-Type: application/yaml
metadata:
name: :groupname
description: My first description
partner: :partner
organization: :org
spec:
type: simple
users:
- 8f35abd7-0c8c-4770-a2c7-430f79bb5eb7
projectnamespaceroles:
- role: :roleid
project: :projectid
# Create group no namespace and project
POST :host/auth/v3/partner/:partner/organization/:org/groups
Content-Type: application/yaml
metadata:
name: :groupname
description: My first description
partner: :partner
organization: :org
spec:
type: simple
users:
- 8f35abd7-0c8c-4770-a2c7-430f79bb5eb7
projectnamespaceroles:
- role: :roleid
# Get all groups
GET :host/auth/v3/partner/:partner/organization/:org/groups
# Get a group
GET :host/auth/v3/partner/:partner/organization/:org/group/:groupid
## Roles
# Create role
POST :host/auth/v3/partner/:partner/organization/:org/roles
Content-Type: application/yaml
metadata:
name: :role
description: My first role
partner: :partner
organization: :org
spec:
type: simple
# Get all roles
GET :host/auth/v3/partner/:partner/organization/:org/roles
# Get a role
GET :host/auth/v3/partner/:partner/organization/:org/role/:role

View File

@@ -0,0 +1,25 @@
package models
import (
"time"
"github.com/google/uuid"
"github.com/uptrace/bun"
)
type AccountResourcerole struct {
bun.BaseModel `bun:"table:authsrv_accountresourcerole,alias:accountresourcerole"`
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,default:false"`
Default bool `bun:"default,notnull"`
OrganizationId uuid.UUID `bun:"organization_id,type:uuid"`
PartnerId uuid.UUID `bun:"partner_id,type:uuid"`
RoleId uuid.UUID `bun:"role_id,type:uuid"`
AccountId uuid.UUID `bun:"account_id,type:uuid"`
Active bool `bun:"active,notnull"`
}

View File

@@ -0,0 +1,22 @@
package models
import (
"time"
"github.com/google/uuid"
"github.com/uptrace/bun"
)
type Group struct {
bun.BaseModel `bun:"table:authsrv_group,alias:group"`
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,default:false"`
OrganizationId uuid.UUID `bun:"organization_id,type:uuid"`
PartnerId uuid.UUID `bun:"partner_id,type:uuid"`
Type string `bun:"type,notnull"`
}

View File

@@ -0,0 +1,24 @@
package models
import (
"time"
"github.com/google/uuid"
"github.com/uptrace/bun"
)
type GroupAccount struct {
bun.BaseModel `bun:"table:authsrv_groupaccount,alias:groupaccount"`
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,default:false"`
// OrganizationId uuid.UUID `bun:"organization_id,type:uuid"`
// PartnerId uuid.UUID `bun:"partner_id,type:uuid"`
AccountId uuid.UUID `bun:"account_id,type:uuid"`
GroupId uuid.UUID `bun:"group_id,type:uuid"`
Active bool `bun:"active,notnull"`
}

View File

@@ -0,0 +1,25 @@
package models
import (
"time"
"github.com/google/uuid"
"github.com/uptrace/bun"
)
type GroupRole struct {
bun.BaseModel `bun:"table:authsrv_grouprole,alias:grouprole"`
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,default:false"`
Default bool `bun:"default,notnull"`
OrganizationId uuid.UUID `bun:"organization_id,type:uuid"`
PartnerId uuid.UUID `bun:"partner_id,type:uuid"`
RoleId uuid.UUID `bun:"role_id,type:uuid"`
GroupId uuid.UUID `bun:"group_id,type:uuid"`
Active bool `bun:"active,notnull"`
}

View File

@@ -0,0 +1,26 @@
package models
import (
"time"
"github.com/google/uuid"
"github.com/uptrace/bun"
)
type ProjectAccountNamespaceRole struct {
bun.BaseModel `bun:"table:authsrv_projectaccountnamespacerole,alias:projectaccountnamespacerole"`
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,default:false"`
OrganizationId uuid.UUID `bun:"organization_id,type:uuid"`
PartnerId uuid.UUID `bun:"partner_id,type:uuid"`
RoleId uuid.UUID `bun:"role_id,type:uuid"`
AccountId uuid.UUID `bun:"account_id,type:uuid"`
ProjectId uuid.UUID `bun:"project_id,type:uuid"`
NamesapceId int64 `bun:"namespace_id,type:uuid"`
Active bool `bun:"active,notnull"`
}

View File

@@ -0,0 +1,26 @@
package models
import (
"time"
"github.com/google/uuid"
"github.com/uptrace/bun"
)
type ProjectAccountResourcerole struct {
bun.BaseModel `bun:"table:authsrv_projectaccountrole,alias:projectaccountrole"`
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,default:false"`
Default bool `bun:"default,notnull"`
OrganizationId uuid.UUID `bun:"organization_id,type:uuid"`
PartnerId uuid.UUID `bun:"partner_id,type:uuid"`
RoleId uuid.UUID `bun:"role_id,type:uuid"`
AccountId uuid.UUID `bun:"account_id,type:uuid"`
ProjectId uuid.UUID `bun:"project_id,type:uuid"`
Active bool `bun:"active,notnull"`
}

View File

@@ -0,0 +1,26 @@
package models
import (
"time"
"github.com/google/uuid"
"github.com/uptrace/bun"
)
type ProjectGroupNamespaceRole struct {
bun.BaseModel `bun:"table:authsrv_projectgroupnamespacerole,alias:projectgroupnamespacerole"`
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,default:false"`
OrganizationId uuid.UUID `bun:"organization_id,type:uuid"`
PartnerId uuid.UUID `bun:"partner_id,type:uuid"`
RoleId uuid.UUID `bun:"role_id,type:uuid"`
GroupId uuid.UUID `bun:"group_id,type:uuid"`
ProjectId uuid.UUID `bun:"project_id,type:uuid"`
NamesapceId int64 `bun:"namespace_id,type:uuid"`
Active bool `bun:"active,notnull"`
}

View File

@@ -0,0 +1,26 @@
package models
import (
"time"
"github.com/google/uuid"
"github.com/uptrace/bun"
)
type ProjectGroupRole struct {
bun.BaseModel `bun:"table:authsrv_projectgrouprole,alias:projectgrouprole"`
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,default:false"`
Default bool `bun:"default,notnull"`
OrganizationId uuid.UUID `bun:"organization_id,type:uuid"`
PartnerId uuid.UUID `bun:"partner_id,type:uuid"`
RoleId uuid.UUID `bun:"role_id,type:uuid"`
GroupId uuid.UUID `bun:"group_id,type:uuid"`
ProjectId uuid.UUID `bun:"project_id,type:uuid"`
Active bool `bun:"active,notnull"`
}

View File

@@ -0,0 +1,23 @@
package models
import (
"time"
"github.com/google/uuid"
"github.com/uptrace/bun"
)
type Role struct {
bun.BaseModel `bun:"table:authsrv_resourcerole,alias:resourcerole"`
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,default:false"`
OrganizationId uuid.UUID `bun:"organization_id,type:uuid"`
PartnerId uuid.UUID `bun:"partner_id,type:uuid"`
IsGlobal bool `bun:"is_global,notnull"`
Scope string `bun:"scope,notnull"`
}

View File

@@ -0,0 +1,43 @@
package server
import (
"context"
"github.com/RafaySystems/rcloud-base/components/usermgmt/pkg/service"
rpcv3 "github.com/RafaySystems/rcloud-base/components/usermgmt/proto/rpc/v3"
userpbv3 "github.com/RafaySystems/rcloud-base/components/usermgmt/proto/types/userpb/v3"
)
type groupServer struct {
service.GroupService
}
// NewGroupServer returns new group server implementation
func NewGroupServer(ps service.GroupService) rpcv3.GroupServer {
return &groupServer{ps}
}
func (s *groupServer) CreateGroup(ctx context.Context, p *userpbv3.Group) (*userpbv3.Group, error) {
return s.Create(ctx, p)
}
func (s *groupServer) GetGroups(ctx context.Context, p *userpbv3.Group) (*userpbv3.GroupList, error) {
return s.List(ctx, p)
}
func (s *groupServer) GetGroup(ctx context.Context, p *userpbv3.Group) (*userpbv3.Group, error) {
group, err := s.GetByName(ctx, p.Metadata.Name)
if err != nil {
return s.GetByID(ctx, p.Metadata.Id)
}
return group, nil
}
func (s *groupServer) DeleteGroup(ctx context.Context, p *userpbv3.Group) (*userpbv3.Group, error) {
_, err := s.Delete(ctx, p)
return nil, err
}
func (s *groupServer) UpdateGroup(ctx context.Context, p *userpbv3.Group) (*userpbv3.Group, error) {
return s.Update(ctx, p)
}

View File

@@ -0,0 +1,43 @@
package server
import (
"context"
"github.com/RafaySystems/rcloud-base/components/usermgmt/pkg/service"
rpcv3 "github.com/RafaySystems/rcloud-base/components/usermgmt/proto/rpc/v3"
userpbv3 "github.com/RafaySystems/rcloud-base/components/usermgmt/proto/types/userpb/v3"
)
type roleServer struct {
service.RoleService
}
// NewRoleServer returns new role server implementation
func NewRoleServer(ps service.RoleService) rpcv3.RoleServer {
return &roleServer{ps}
}
func (s *roleServer) CreateRole(ctx context.Context, p *userpbv3.Role) (*userpbv3.Role, error) {
return s.Create(ctx, p)
}
func (s *roleServer) GetRoles(ctx context.Context, p *userpbv3.Role) (*userpbv3.RoleList, error) {
return s.List(ctx, p)
}
func (s *roleServer) GetRole(ctx context.Context, p *userpbv3.Role) (*userpbv3.Role, error) {
role, err := s.GetByName(ctx, p.Metadata.Name)
if err != nil {
return s.GetByID(ctx, p.Metadata.Id)
}
return role, nil
}
func (s *roleServer) DeleteRole(ctx context.Context, p *userpbv3.Role) (*userpbv3.Role, error) {
_, err := s.Delete(ctx, p)
return nil, err
}
func (s *roleServer) UpdateRole(ctx context.Context, p *userpbv3.Role) (*userpbv3.Role, error) {
return s.Update(ctx, p)
}

View File

@@ -0,0 +1,43 @@
package server
import (
"context"
"github.com/RafaySystems/rcloud-base/components/usermgmt/pkg/service"
rpcv3 "github.com/RafaySystems/rcloud-base/components/usermgmt/proto/rpc/v3"
userpbv3 "github.com/RafaySystems/rcloud-base/components/usermgmt/proto/types/userpb/v3"
)
type userServer struct {
service.UserService
}
// NewUserServer returns new user server implementation
func NewUserServer(ps service.UserService) rpcv3.UserServer {
return &userServer{ps}
}
func (s *userServer) CreateUser(ctx context.Context, p *userpbv3.User) (*userpbv3.User, error) {
return s.Create(ctx, p)
}
func (s *userServer) GetUsers(ctx context.Context, p *userpbv3.User) (*userpbv3.UserList, error) {
return s.List(ctx, p)
}
func (s *userServer) GetUser(ctx context.Context, p *userpbv3.User) (*userpbv3.User, error) {
// user, err := s.GetByName(ctx, p.Metadata.Name)
// if err != nil {
return s.GetByID(ctx, p.Metadata.Id)
// }
// return user, nil
}
func (s *userServer) DeleteUser(ctx context.Context, p *userpbv3.User) (*rpcv3.DeleteUserResponse, error) {
_, err := s.Delete(ctx, p)
return nil, err
}
func (s *userServer) UpdateUser(ctx context.Context, p *userpbv3.User) (*userpbv3.User, error) {
return s.Update(ctx, p)
}

View File

@@ -0,0 +1,515 @@
package service
import (
"context"
"fmt"
"time"
"github.com/RafaySystems/rcloud-base/components/common/pkg/persistence/provider/pg"
v3 "github.com/RafaySystems/rcloud-base/components/common/proto/types/commonpb/v3"
"github.com/RafaySystems/rcloud-base/components/usermgmt/pkg/internal/models"
userv3 "github.com/RafaySystems/rcloud-base/components/usermgmt/proto/types/userpb/v3"
"github.com/google/uuid"
bun "github.com/uptrace/bun"
"google.golang.org/protobuf/types/known/timestamppb"
)
const (
apiVersion = "system.k8smgmt.io/v3"
groupKind = "Group"
groupListKind = "GroupList"
)
// GroupService is the interface for group operations
type GroupService interface {
Close() error
// create group
Create(ctx context.Context, group *userv3.Group) (*userv3.Group, error)
// get group by id
GetByID(ctx context.Context, id string) (*userv3.Group, error)
// get group by name
GetByName(ctx context.Context, name string) (*userv3.Group, error)
// create or update group
Update(ctx context.Context, group *userv3.Group) (*userv3.Group, error)
// delete group
Delete(ctx context.Context, group *userv3.Group) (*userv3.Group, error)
// list groups
List(ctx context.Context, group *userv3.Group) (*userv3.GroupList, error)
}
// groupService implements GroupService
type groupService struct {
dao pg.EntityDAO
}
// NewGroupService return new group service
func NewGroupService(db *bun.DB) GroupService {
return &groupService{
dao: pg.NewEntityDAO(db),
}
}
// Map roles to groups
func (s *groupService) updateGroupRoleRelation(ctx context.Context, group *userv3.Group) (*userv3.Group, error) {
groupId, _ := uuid.Parse(group.GetMetadata().GetId())
partnerId, _ := uuid.Parse(group.GetMetadata().GetPartner())
organizationId, _ := uuid.Parse(group.GetMetadata().GetOrganization())
// TODO: also parse out namesapce
projectNamespaceRoles := group.GetSpec().GetProjectnamespaceroles()
// TODO: add transactions
var pgnrs []models.ProjectGroupNamespaceRole
var pgrs []models.ProjectGroupRole
var grs []models.GroupRole
for _, pnr := range projectNamespaceRoles {
project := pnr.Project
namespace := pnr.Namespace
roleId, err := uuid.Parse(pnr.GetRole())
if err != nil {
return group, err
}
switch {
case namespace != nil:
namespaceId := pnr.GetNamespace()
projectId, _ := uuid.Parse(pnr.GetProject())
pgnr := models.ProjectGroupNamespaceRole{
Name: group.GetMetadata().GetName(),
Description: group.GetMetadata().GetDescription(),
CreatedAt: time.Now(), // TODO: could drop this as it is default
ModifiedAt: time.Now(),
Trash: false,
RoleId: roleId,
PartnerId: partnerId,
OrganizationId: organizationId,
GroupId: groupId,
ProjectId: projectId,
NamesapceId: namespaceId,
Active: true,
}
pgnrs = append(pgnrs, pgnr)
case project != nil:
projectId, _ := uuid.Parse(pnr.GetProject())
pgr := models.ProjectGroupRole{
Name: group.GetMetadata().GetName(),
Description: group.GetMetadata().GetDescription(),
CreatedAt: time.Now(),
ModifiedAt: time.Now(),
Trash: false,
Default: true, // TODO: what is this for?
RoleId: roleId,
PartnerId: partnerId,
OrganizationId: organizationId,
GroupId: groupId,
ProjectId: projectId,
Active: true,
}
pgrs = append(pgrs, pgr)
default:
gr := models.GroupRole{
Name: group.GetMetadata().GetName(),
Description: group.GetMetadata().GetDescription(),
CreatedAt: time.Now(),
ModifiedAt: time.Now(),
Trash: false,
Default: true, // TODO: what is this for?
RoleId: roleId,
PartnerId: partnerId,
OrganizationId: organizationId,
GroupId: groupId,
Active: true,
}
grs = append(grs, gr)
}
}
if len(pgnrs) > 0 {
_, err := s.dao.Create(ctx, &pgnrs)
if err != nil {
return group, err
}
}
if len(pgrs) > 0 {
_, err := s.dao.Create(ctx, &pgrs)
if err != nil {
return group, err
}
}
if len(grs) > 0 {
_, err := s.dao.Create(ctx, &grs)
if err != nil {
return group, err
}
}
return group, nil
}
// Update the users(account) mapped to each group
func (s *groupService) updateGroupAccountRelation(ctx context.Context, group *userv3.Group) (*userv3.Group, error) {
// TODO: use a more efficient way to update the relations
// TODO: diff and delete the old relations
groupId, _ := uuid.Parse(group.GetMetadata().GetId())
// TODO: add transactions
var grpaccs []models.GroupAccount
for _, account := range group.GetSpec().GetUsers() {
accountId, err := uuid.Parse(account)
if err != nil {
return nil, err
}
grp := models.GroupAccount{
Name: group.GetMetadata().GetName(),
Description: group.GetMetadata().GetDescription(),
CreatedAt: time.Now(),
ModifiedAt: time.Now(),
Trash: false,
AccountId: accountId,
GroupId: groupId,
Active: true,
}
grpaccs = append(grpaccs, grp)
}
if len(grpaccs) == 0 {
return group, nil
}
_, err := s.dao.Create(ctx, &grpaccs)
if err != nil {
group.Status = &v3.Status{
ConditionType: "Create",
ConditionStatus: v3.ConditionStatus_StatusFailed,
LastUpdated: timestamppb.Now(),
}
return group, err
}
return group, nil
}
func (s *groupService) Create(ctx context.Context, group *userv3.Group) (*userv3.Group, error) {
partnerId, _ := uuid.Parse(group.GetMetadata().GetPartner())
organizationId, _ := uuid.Parse(group.GetMetadata().GetOrganization())
// TODO: find out the interaction if project key is present in the group metadata
// TODO: check if a group with the same 'name' already exists and fail if so
// TODO: we should be specifying names instead of ids for partner and org (at least in output)
// TODO: create vs apply difference like in kubectl??
//convert v3 spec to internal models
grp := models.Group{
Name: group.GetMetadata().GetName(),
Description: group.GetMetadata().GetDescription(),
CreatedAt: time.Now(),
ModifiedAt: time.Now(),
Trash: false,
OrganizationId: organizationId,
PartnerId: partnerId,
Type: group.GetSpec().GetType(),
}
entity, err := s.dao.Create(ctx, &grp)
if err != nil {
group.Status = &v3.Status{
ConditionType: "Create",
ConditionStatus: v3.ConditionStatus_StatusFailed,
LastUpdated: timestamppb.Now(),
}
return group, err
}
//update v3 spec
if createdGroup, ok := entity.(*models.Group); ok {
group.Metadata.Id = createdGroup.ID.String()
group.Spec = &userv3.GroupSpec{
Type: createdGroup.Type,
Users: group.Spec.Users, // TODO: is this the right thing to do?
Projectnamespaceroles: group.Spec.Projectnamespaceroles, // TODO: is this the right thing to do?
}
if group.Status == nil {
group.Status = &v3.Status{
ConditionType: "Create",
ConditionStatus: v3.ConditionStatus_StatusOK,
LastUpdated: timestamppb.Now(),
}
}
}
group, err = s.updateGroupAccountRelation(ctx, group)
if err != nil {
group.Status = &v3.Status{
ConditionType: "Create",
ConditionStatus: v3.ConditionStatus_StatusFailed,
LastUpdated: timestamppb.Now(),
}
return group, err
}
group, err = s.updateGroupRoleRelation(ctx, group)
if err != nil {
group.Status = &v3.Status{
ConditionType: "Create",
ConditionStatus: v3.ConditionStatus_StatusFailed,
LastUpdated: timestamppb.Now(),
}
return group, err
}
return group, nil
}
func (s *groupService) GetByID(ctx context.Context, id string) (*userv3.Group, error) {
group := &userv3.Group{
ApiVersion: apiVersion,
Kind: groupKind,
Metadata: &v3.Metadata{
Id: id,
},
}
uid, err := uuid.Parse(id)
if err != nil {
group.Status = &v3.Status{
ConditionType: "Describe",
ConditionStatus: v3.ConditionStatus_StatusFailed,
LastUpdated: timestamppb.Now(),
Reason: err.Error(),
}
return group, err
}
entity, err := s.dao.GetByID(ctx, uid, &models.Group{})
if err != nil {
group.Status = &v3.Status{
ConditionType: "Describe",
ConditionStatus: v3.ConditionStatus_StatusFailed,
LastUpdated: timestamppb.Now(),
Reason: err.Error(),
}
return group, err
}
if grp, ok := entity.(*models.Group); ok {
labels := make(map[string]string)
labels["organization"] = grp.OrganizationId.String()
group.Metadata = &v3.Metadata{
Name: grp.Name,
Description: grp.Description,
Id: grp.ID.String(),
Organization: grp.OrganizationId.String(),
Partner: grp.PartnerId.String(),
Labels: labels,
ModifiedAt: timestamppb.New(grp.ModifiedAt),
}
group.Spec = &userv3.GroupSpec{
Type: grp.Type,
}
group.Status = &v3.Status{
LastUpdated: timestamppb.Now(),
ConditionType: "Describe",
ConditionStatus: v3.ConditionStatus_StatusOK,
}
return group, nil
}
return group, nil
}
func (s *groupService) GetByName(ctx context.Context, name string) (*userv3.Group, error) {
group := &userv3.Group{
ApiVersion: apiVersion,
Kind: groupKind,
Metadata: &v3.Metadata{
Name: name,
},
}
entity, err := s.dao.GetByName(ctx, name, &models.Group{})
if err != nil {
group.Status = &v3.Status{
ConditionType: "Describe",
ConditionStatus: v3.ConditionStatus_StatusFailed,
LastUpdated: timestamppb.Now(),
Reason: err.Error(),
}
return group, err
}
if grp, ok := entity.(*models.Group); ok {
labels := make(map[string]string)
labels["organization"] = grp.OrganizationId.String()
group.Metadata = &v3.Metadata{
Name: grp.Name,
Description: grp.Description,
Id: grp.ID.String(),
Organization: grp.OrganizationId.String(),
Partner: grp.PartnerId.String(),
Labels: labels,
ModifiedAt: timestamppb.New(grp.ModifiedAt),
}
group.Spec = &userv3.GroupSpec{
Type: grp.Type,
}
group.Status = &v3.Status{
LastUpdated: timestamppb.Now(),
ConditionType: "Describe",
ConditionStatus: v3.ConditionStatus_StatusOK,
}
return group, nil
}
return group, nil
}
func (s *groupService) Update(ctx context.Context, group *userv3.Group) (*userv3.Group, error) {
// TODO: inform when unchanged
id, _ := uuid.Parse(group.Metadata.Id)
entity, err := s.dao.GetByID(ctx, id, &models.Group{})
if err != nil {
group.Status = &v3.Status{
ConditionType: "Update",
ConditionStatus: v3.ConditionStatus_StatusFailed,
LastUpdated: timestamppb.Now(),
Reason: err.Error(),
}
return group, err
}
if grp, ok := entity.(*models.Group); ok {
//update group details
grp.Name = group.Metadata.Name
grp.Description = group.Metadata.Description
grp.Type = group.Spec.Type
grp.ModifiedAt = time.Now()
_, err = s.dao.Update(ctx, id, grp)
if err != nil {
group.Status = &v3.Status{
ConditionType: "Update",
ConditionStatus: v3.ConditionStatus_StatusFailed,
LastUpdated: timestamppb.Now(),
Reason: err.Error(),
}
return group, err
}
//update spec and status
group.Spec = &userv3.GroupSpec{
Type: grp.Type,
}
group.Status = &v3.Status{
ConditionType: "Update",
ConditionStatus: v3.ConditionStatus_StatusOK,
LastUpdated: timestamppb.Now(),
}
}
return group, nil
}
func (s *groupService) Delete(ctx context.Context, group *userv3.Group) (*userv3.Group, error) {
id, err := uuid.Parse(group.Metadata.Id)
if err != nil {
group.Status = &v3.Status{
ConditionType: "Delete",
ConditionStatus: v3.ConditionStatus_StatusFailed,
LastUpdated: timestamppb.Now(),
Reason: err.Error(),
}
return group, err
}
entity, err := s.dao.GetByID(ctx, id, &models.Group{})
if err != nil {
group.Status = &v3.Status{
ConditionType: "Delete",
ConditionStatus: v3.ConditionStatus_StatusFailed,
LastUpdated: timestamppb.Now(),
Reason: err.Error(),
}
return group, err
}
if grp, ok := entity.(*models.Group); ok {
err = s.dao.Delete(ctx, id, grp)
if err != nil {
group.Status = &v3.Status{
ConditionType: "Delete",
ConditionStatus: v3.ConditionStatus_StatusFailed,
LastUpdated: timestamppb.Now(),
Reason: err.Error(),
}
return group, err
}
//update v3 spec
group.Metadata.Id = grp.ID.String()
group.Metadata.Name = grp.Name
group.Status = &v3.Status{
ConditionType: "Delete",
ConditionStatus: v3.ConditionStatus_StatusOK,
LastUpdated: timestamppb.Now(),
}
}
return group, nil
}
func (s *groupService) List(ctx context.Context, group *userv3.Group) (*userv3.GroupList, error) {
var groups []*userv3.Group
groupList := &userv3.GroupList{
ApiVersion: apiVersion,
Kind: groupListKind,
Metadata: &v3.ListMetadata{
Count: 0,
},
}
if len(group.Metadata.Organization) > 0 {
orgId, err := uuid.Parse(group.Metadata.Organization)
if err != nil {
return groupList, err
}
partId, err := uuid.Parse(group.Metadata.Partner)
if err != nil {
return groupList, err
}
var grps []models.Group
entities, err := s.dao.List(ctx, uuid.NullUUID{UUID: partId, Valid: true}, uuid.NullUUID{UUID: orgId, Valid: true}, &grps)
if err != nil {
return groupList, err
}
if grps, ok := entities.(*[]models.Group); ok {
for _, grp := range *grps {
labels := make(map[string]string)
labels["organization"] = grp.OrganizationId.String()
labels["partner"] = grp.PartnerId.String()
group.Metadata = &v3.Metadata{
Name: grp.Name,
Description: grp.Description,
Id: grp.ID.String(),
Organization: grp.OrganizationId.String(),
Partner: grp.PartnerId.String(),
Labels: labels,
ModifiedAt: timestamppb.New(grp.ModifiedAt),
}
group.Spec = &userv3.GroupSpec{
Type: grp.Type,
}
groups = append(groups, group)
}
//update the list metadata and items response
groupList.Metadata = &v3.ListMetadata{
Count: int64(len(groups)),
}
groupList.Items = groups
}
} else {
return groupList, fmt.Errorf("missing organization id in metadata")
}
return groupList, nil
}
func (s *groupService) Close() error {
return s.dao.Close()
}

View File

@@ -0,0 +1,365 @@
package service
import (
"context"
"fmt"
"time"
v3 "github.com/RafaySystems/rcloud-base/components/common/proto/types/commonpb/v3"
"github.com/RafaySystems/rcloud-base/components/usermgmt/pkg/internal/models"
"github.com/RafaySystems/rcloud-base/components/common/pkg/persistence/provider/pg"
userv3 "github.com/RafaySystems/rcloud-base/components/usermgmt/proto/types/userpb/v3"
"github.com/google/uuid"
bun "github.com/uptrace/bun"
"google.golang.org/protobuf/types/known/timestamppb"
)
const (
roleKind = "Role"
roleListKind = "RoleList"
)
// RoleService is the interface for role operations
type RoleService interface {
Close() error
// create role
Create(ctx context.Context, role *userv3.Role) (*userv3.Role, error)
// get role by id
GetByID(ctx context.Context, id string) (*userv3.Role, error)
// get role by name
GetByName(ctx context.Context, name string) (*userv3.Role, error)
// create or update role
Update(ctx context.Context, role *userv3.Role) (*userv3.Role, error)
// delete role
Delete(ctx context.Context, role *userv3.Role) (*userv3.Role, error)
// list roles
List(ctx context.Context, role *userv3.Role) (*userv3.RoleList, error)
}
// roleService implements RoleService
type roleService struct {
dao pg.EntityDAO
}
// NewRoleService return new role service
func NewRoleService(db *bun.DB) RoleService {
return &roleService{
dao: pg.NewEntityDAO(db),
}
}
// TODO: This right now just lets us create roles, we will have to make sure the mapping happens
func (s *roleService) Create(ctx context.Context, role *userv3.Role) (*userv3.Role, error) {
partnerId, _ := uuid.Parse(role.GetMetadata().GetPartner())
organizationId, _ := uuid.Parse(role.GetMetadata().GetOrganization())
// TODO: check if a role with the same 'name' already exists and fail if so
// TODO: we should be specifying names instead of ids for partner and org
// TODO: create vs apply difference like in kubectl??
//convert v3 spec to internal models
rle := models.Role{
Name: role.GetMetadata().GetName(),
Description: role.GetMetadata().GetDescription(),
CreatedAt: time.Now(),
ModifiedAt: time.Now(),
Trash: false,
OrganizationId: organizationId,
PartnerId: partnerId,
IsGlobal: role.GetSpec().GetIsGlobal(),
Scope: role.GetSpec().GetScope(),
}
entity, err := s.dao.Create(ctx, &rle)
if err != nil {
role.Status = &v3.Status{
ConditionType: "Create",
ConditionStatus: v3.ConditionStatus_StatusFailed,
LastUpdated: timestamppb.Now(),
}
return role, err
}
//update v3 spec
if createdRole, ok := entity.(*models.Role); ok {
role.Metadata.Id = createdRole.ID.String()
role.Spec = &userv3.RoleSpec{
IsGlobal: createdRole.IsGlobal,
Scope: createdRole.Scope,
}
if role.Status == nil {
role.Status = &v3.Status{
ConditionType: "Create",
ConditionStatus: v3.ConditionStatus_StatusOK,
LastUpdated: timestamppb.Now(),
}
}
}
return role, nil
}
func (s *roleService) GetByID(ctx context.Context, id string) (*userv3.Role, error) {
role := &userv3.Role{
ApiVersion: apiVersion,
Kind: roleKind,
Metadata: &v3.Metadata{
Id: id,
},
}
uid, err := uuid.Parse(id)
if err != nil {
role.Status = &v3.Status{
ConditionType: "Describe",
ConditionStatus: v3.ConditionStatus_StatusFailed,
LastUpdated: timestamppb.Now(),
Reason: err.Error(),
}
return role, err
}
entity, err := s.dao.GetByID(ctx, uid, &models.Role{})
if err != nil {
role.Status = &v3.Status{
ConditionType: "Describe",
ConditionStatus: v3.ConditionStatus_StatusFailed,
LastUpdated: timestamppb.Now(),
Reason: err.Error(),
}
return role, err
}
if rle, ok := entity.(*models.Role); ok {
labels := make(map[string]string)
labels["organization"] = rle.OrganizationId.String()
role.Metadata = &v3.Metadata{
Name: rle.Name,
Description: rle.Description,
Id: rle.ID.String(),
Organization: rle.OrganizationId.String(),
Partner: rle.PartnerId.String(),
Labels: labels,
ModifiedAt: timestamppb.New(rle.ModifiedAt),
}
role.Spec = &userv3.RoleSpec{
IsGlobal: rle.IsGlobal,
Scope: rle.Scope,
}
role.Status = &v3.Status{
LastUpdated: timestamppb.Now(),
ConditionType: "Describe",
ConditionStatus: v3.ConditionStatus_StatusOK,
}
return role, nil
}
return role, nil
}
func (s *roleService) GetByName(ctx context.Context, name string) (*userv3.Role, error) {
role := &userv3.Role{
ApiVersion: apiVersion,
Kind: roleKind,
Metadata: &v3.Metadata{
Name: name,
},
}
entity, err := s.dao.GetByName(ctx, name, &models.Role{})
if err != nil {
role.Status = &v3.Status{
ConditionType: "Describe",
ConditionStatus: v3.ConditionStatus_StatusFailed,
LastUpdated: timestamppb.Now(),
Reason: err.Error(),
}
return role, err
}
if rle, ok := entity.(*models.Role); ok {
labels := make(map[string]string)
labels["organization"] = rle.OrganizationId.String()
role.Metadata = &v3.Metadata{
Name: rle.Name,
Description: rle.Description,
Id: rle.ID.String(),
Organization: rle.OrganizationId.String(),
Partner: rle.PartnerId.String(),
Labels: labels,
ModifiedAt: timestamppb.New(rle.ModifiedAt),
}
role.Spec = &userv3.RoleSpec{
IsGlobal: rle.IsGlobal,
Scope: rle.Scope,
}
role.Status = &v3.Status{
LastUpdated: timestamppb.Now(),
ConditionType: "Describe",
ConditionStatus: v3.ConditionStatus_StatusOK,
}
return role, nil
}
return role, nil
}
func (s *roleService) Update(ctx context.Context, role *userv3.Role) (*userv3.Role, error) {
// TODO: inform when unchanged
id, _ := uuid.Parse(role.Metadata.Id)
entity, err := s.dao.GetByID(ctx, id, &models.Role{})
if err != nil {
role.Status = &v3.Status{
ConditionType: "Update",
ConditionStatus: v3.ConditionStatus_StatusFailed,
LastUpdated: timestamppb.Now(),
Reason: err.Error(),
}
return role, err
}
if rle, ok := entity.(*models.Role); ok {
//update role details
rle.Name = role.Metadata.Name
rle.Description = role.Metadata.Description
rle.IsGlobal = role.Spec.IsGlobal
rle.Scope = role.Spec.Scope
rle.ModifiedAt = time.Now()
_, err = s.dao.Update(ctx, id, rle)
if err != nil {
role.Status = &v3.Status{
ConditionType: "Update",
ConditionStatus: v3.ConditionStatus_StatusFailed,
LastUpdated: timestamppb.Now(),
Reason: err.Error(),
}
return role, err
}
//update spec and status
role.Spec = &userv3.RoleSpec{
IsGlobal: rle.IsGlobal,
Scope: rle.Scope,
}
role.Status = &v3.Status{
ConditionType: "Update",
ConditionStatus: v3.ConditionStatus_StatusOK,
LastUpdated: timestamppb.Now(),
}
}
return role, nil
}
func (s *roleService) Delete(ctx context.Context, role *userv3.Role) (*userv3.Role, error) {
id, err := uuid.Parse(role.Metadata.Id)
if err != nil {
role.Status = &v3.Status{
ConditionType: "Delete",
ConditionStatus: v3.ConditionStatus_StatusFailed,
LastUpdated: timestamppb.Now(),
Reason: err.Error(),
}
return role, err
}
entity, err := s.dao.GetByID(ctx, id, &models.Role{})
if err != nil {
role.Status = &v3.Status{
ConditionType: "Delete",
ConditionStatus: v3.ConditionStatus_StatusFailed,
LastUpdated: timestamppb.Now(),
Reason: err.Error(),
}
return role, err
}
if rle, ok := entity.(*models.Role); ok {
err = s.dao.Delete(ctx, id, rle)
if err != nil {
role.Status = &v3.Status{
ConditionType: "Delete",
ConditionStatus: v3.ConditionStatus_StatusFailed,
LastUpdated: timestamppb.Now(),
Reason: err.Error(),
}
return role, err
}
//update v3 spec
role.Metadata.Id = rle.ID.String()
role.Metadata.Name = rle.Name
role.Status = &v3.Status{
ConditionType: "Delete",
ConditionStatus: v3.ConditionStatus_StatusOK,
LastUpdated: timestamppb.Now(),
}
}
return role, nil
}
func (s *roleService) List(ctx context.Context, role *userv3.Role) (*userv3.RoleList, error) {
var roles []*userv3.Role
roleList := &userv3.RoleList{
ApiVersion: apiVersion,
Kind: roleListKind,
Metadata: &v3.ListMetadata{
Count: 0,
},
}
if len(role.Metadata.Organization) > 0 {
orgId, err := uuid.Parse(role.Metadata.Organization)
if err != nil {
return roleList, err
}
partId, err := uuid.Parse(role.Metadata.Partner)
if err != nil {
return roleList, err
}
var rles []models.Role
entities, err := s.dao.List(ctx, uuid.NullUUID{UUID: partId, Valid: true}, uuid.NullUUID{UUID: orgId, Valid: true}, &rles)
if err != nil {
return roleList, err
}
if rles, ok := entities.(*[]models.Role); ok {
for _, rle := range *rles {
labels := make(map[string]string)
labels["organization"] = rle.OrganizationId.String()
labels["partner"] = rle.PartnerId.String()
role.Metadata = &v3.Metadata{
Name: rle.Name,
Description: rle.Description,
Id: rle.ID.String(),
Organization: rle.OrganizationId.String(),
Partner: rle.PartnerId.String(),
Labels: labels,
ModifiedAt: timestamppb.New(rle.ModifiedAt),
}
role.Spec = &userv3.RoleSpec{
// IsGlobal: rle.IsGlobal,
Scope: rle.Scope,
}
roles = append(roles, role)
}
//update the list metadata and items response
roleList.Metadata = &v3.ListMetadata{
Count: int64(len(roles)),
}
roleList.Items = roles
}
} else {
return roleList, fmt.Errorf("missing organization id in metadata")
}
return roleList, nil
}
func (s *roleService) Close() error {
return s.dao.Close()
}

View File

@@ -0,0 +1,287 @@
package service
import (
"context"
"fmt"
"time"
"github.com/google/uuid"
kclient "github.com/ory/kratos-client-go"
bun "github.com/uptrace/bun"
"google.golang.org/protobuf/types/known/timestamppb"
"github.com/RafaySystems/rcloud-base/components/common/pkg/persistence/provider/pg"
v3 "github.com/RafaySystems/rcloud-base/components/common/proto/types/commonpb/v3"
"github.com/RafaySystems/rcloud-base/components/usermgmt/pkg/internal/models"
userrpcv3 "github.com/RafaySystems/rcloud-base/components/usermgmt/proto/rpc/v3"
userv3 "github.com/RafaySystems/rcloud-base/components/usermgmt/proto/types/userpb/v3"
)
const (
userKind = "User"
userListKind = "UserList"
)
// GroupService is the interface for group operations
type UserService interface {
// create user
Create(ctx context.Context, user *userv3.User) (*userv3.User, error)
// get user by id
GetByID(ctx context.Context, id string) (*userv3.User, error)
// // get user by name
// TODO: Implement GetByName
// GetByName(ctx context.Context, name string) (*userv3.User, error)
// create or update user
Update(ctx context.Context, user *userv3.User) (*userv3.User, error)
// delete user
Delete(ctx context.Context, user *userv3.User) (*userrpcv3.DeleteUserResponse, error)
// list users
List(ctx context.Context, user *userv3.User) (*userv3.UserList, error)
}
type userService struct {
kc *kclient.APIClient
dao pg.EntityDAO
}
func NewUserService(kc *kclient.APIClient, db *bun.DB) UserService {
return &userService{kc: kc, dao: pg.NewEntityDAO(db)}
}
// Convert from kratos.Identity to GVK format
func identityToUser(id *kclient.Identity) *userv3.User {
traits := id.GetTraits().(map[string]interface{})
return &userv3.User{
ApiVersion: "usermgmt.k8smgmt.io/v3",
Kind: "User",
Metadata: &v3.Metadata{
Id: id.Id,
},
Spec: &userv3.UserSpec{
Username: traits["email"].(string),
FirstName: traits["first_name"].(string),
LastName: traits["last_name"].(string),
},
}
}
// Map roles to accounts
func (s *userService) updateUserRoleRelation(ctx context.Context, user *userv3.User) (*userv3.User, error) {
accountId, _ := uuid.Parse(user.GetMetadata().GetId())
partnerId, _ := uuid.Parse(user.GetMetadata().GetPartner())
organizationId, _ := uuid.Parse(user.GetMetadata().GetOrganization())
projectNamespaceRoles := user.GetSpec().GetProjectnamespaceroles()
// TODO: add transactions
var panrs []models.ProjectAccountNamespaceRole
var pars []models.ProjectAccountResourcerole
var ars []models.AccountResourcerole
for _, pnr := range projectNamespaceRoles {
projectId, perr := uuid.Parse(pnr.GetProject())
namespaceId := pnr.GetNamespace()
roleId, err := uuid.Parse(pnr.GetRole())
if err != nil {
return user, err
}
switch {
case namespaceId != 0: // TODO: namespaceId can be zero?
panr := models.ProjectAccountNamespaceRole{
Name: user.GetMetadata().GetName(),
Description: user.GetMetadata().GetDescription(),
CreatedAt: time.Now(),
ModifiedAt: time.Now(),
Trash: false,
RoleId: roleId,
PartnerId: partnerId,
OrganizationId: organizationId,
AccountId: accountId,
ProjectId: projectId,
NamesapceId: namespaceId,
Active: true,
}
panrs = append(panrs, panr)
case perr == nil: // TODO: maybe a better check?
par := models.ProjectAccountResourcerole{
Name: user.GetMetadata().GetName(),
Description: user.GetMetadata().GetDescription(),
CreatedAt: time.Now(),
ModifiedAt: time.Now(),
Trash: false,
Default: true, // TODO: what is this for?
RoleId: roleId,
PartnerId: partnerId,
OrganizationId: organizationId,
AccountId: accountId,
ProjectId: projectId,
Active: true,
}
pars = append(pars, par)
default:
ar := models.AccountResourcerole{
Name: user.GetMetadata().GetName(),
Description: user.GetMetadata().GetDescription(),
CreatedAt: time.Now(),
ModifiedAt: time.Now(),
Trash: false,
Default: true, // TODO: what is this for?
RoleId: roleId,
PartnerId: partnerId,
OrganizationId: organizationId,
AccountId: accountId,
Active: true,
}
ars = append(ars, ar)
}
}
if len(panrs) > 0 {
_, err := s.dao.Create(ctx, &panrs)
if err != nil {
return user, err
}
}
if len(pars) > 0 {
_, err := s.dao.Create(ctx, &pars)
if err != nil {
return user, err
}
}
if len(ars) > 0 {
_, err := s.dao.Create(ctx, &ars)
if err != nil {
return user, err
}
}
return user, nil
}
// Update the users(account) mapped to each group
func (s *userService) updateGroupAccountRelation(ctx context.Context, user *userv3.User) (*userv3.User, error) {
// TODO: diff and delete the old relations
userId, _ := uuid.Parse(user.GetMetadata().GetId())
// TODO: add transactions
var grpaccs []models.GroupAccount
for _, group := range user.GetSpec().GetGroups() {
groupId, err := uuid.Parse(group)
if err != nil {
return nil, err
}
grp := models.GroupAccount{
Name: user.GetMetadata().GetName(), // TODO: what is name for relations?
Description: user.GetMetadata().GetDescription(), // TODO: now sure what this is either
CreatedAt: time.Now(),
ModifiedAt: time.Now(),
Trash: false,
AccountId: userId,
GroupId: groupId,
Active: true,
}
grpaccs = append(grpaccs, grp)
}
if len(grpaccs) == 0 {
return user, nil
}
_, err := s.dao.Create(ctx, &grpaccs)
if err != nil {
user.Status = &v3.Status{
ConditionType: "Create",
ConditionStatus: v3.ConditionStatus_StatusFailed,
LastUpdated: timestamppb.Now(),
}
return user, err
}
return user, nil
}
func (s *userService) Create(ctx context.Context, user *userv3.User) (*userv3.User, error) {
// TODO: restrict endpoint to admin
cib := kclient.NewAdminCreateIdentityBody("default", map[string]interface{}{"email": user.Spec.Username, "first_name": user.Spec.FirstName, "last_name": user.Spec.LastName})
ir, hr, err := s.kc.V0alpha2Api.AdminCreateIdentity(ctx).AdminCreateIdentityBody(*cib).Execute()
if err != nil {
fmt.Println(hr)
// TODO: forward exact error message from kratos (eg: json schema validation)
return nil, err
}
user.Metadata.Id = ir.Id
rlb := kclient.NewAdminCreateSelfServiceRecoveryLinkBody(ir.Id)
rl, _, err := s.kc.V0alpha2Api.AdminCreateSelfServiceRecoveryLink(ctx).AdminCreateSelfServiceRecoveryLinkBody(*rlb).Execute()
if err != nil {
return nil, err
}
user, err = s.updateUserRoleRelation(ctx, user)
if err != nil {
user.Status = &v3.Status{
ConditionType: "Create",
ConditionStatus: v3.ConditionStatus_StatusFailed,
LastUpdated: timestamppb.Now(),
}
return user, err
}
user, err = s.updateGroupAccountRelation(ctx, user)
if err != nil {
user.Status = &v3.Status{
ConditionType: "Create",
ConditionStatus: v3.ConditionStatus_StatusFailed,
LastUpdated: timestamppb.Now(),
}
return user, err
}
fmt.Println("Recovery link:", rl.RecoveryLink) // TODO: email the recovery link to the user
user.Metadata = &v3.Metadata{
Id: ir.Id,
}
user.Status = &v3.Status{
ConditionType: "StatusOK",
ConditionStatus: v3.ConditionStatus_StatusOK,
}
return user, nil
}
func (s *userService) List(ctx context.Context, _ *userv3.User) (*userv3.UserList, error) {
ir, _, err := s.kc.V0alpha2Api.AdminListIdentities(ctx).Execute()
if err != nil {
return nil, err
}
res := &userv3.UserList{}
for _, u := range ir {
res.Items = append(res.Items, identityToUser(&u))
}
return res, nil
}
func (s *userService) GetByID(ctx context.Context, id string) (*userv3.User, error) {
// TODO: should it be get by id or by email? Kratos can only fileter by id
ir, _, err := s.kc.V0alpha2Api.AdminGetIdentity(ctx, id).Execute()
if err != nil {
return nil, err
}
return identityToUser(ir), nil
}
func (s *userService) Update(ctx context.Context, user *userv3.User) (*userv3.User, error) {
uib := kclient.NewAdminUpdateIdentityBody("active", map[string]interface{}{"email": user.Spec.Username, "first_name": user.Spec.FirstName, "last_name": user.Spec.LastName})
_, hr, err := s.kc.V0alpha2Api.AdminUpdateIdentity(ctx, user.Metadata.Id).AdminUpdateIdentityBody(*uib).Execute()
if err != nil {
fmt.Println(hr)
// TODO: forward exact error message from kratos (eg: json schema validation)
return nil, err
}
user.Status = &v3.Status{
ConditionType: "StatusOK",
ConditionStatus: v3.ConditionStatus_StatusOK,
}
return user, nil
}
func (s *userService) Delete(ctx context.Context, user *userv3.User) (*userrpcv3.DeleteUserResponse, error) {
// TODO: should it be get by id or by email? Kratos can only filter by id
_, err := s.kc.V0alpha2Api.AdminDeleteIdentity(ctx, user.Metadata.Id).Execute()
if err != nil {
return nil, err
}
return &userrpcv3.DeleteUserResponse{}, nil
}

View File

@@ -0,0 +1,207 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.1
// protoc v3.19.1
// source: proto/rpc/v3/group.proto
package rpcv3
import (
v3 "github.com/RafaySystems/rcloud-base/components/usermgmt/proto/types/userpb/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_group_proto protoreflect.FileDescriptor
var file_proto_rpc_v3_group_proto_rawDesc = []byte{
0x0a, 0x18, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x33, 0x2f, 0x67,
0x72, 0x6f, 0x75, 0x70, 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, 0x21, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x75, 0x73,
0x65, 0x72, 0x70, 0x62, 0x2f, 0x76, 0x33, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x32, 0xa4, 0x0a, 0x0a, 0x05, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0xe4, 0x01,
0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1e, 0x2e,
0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e,
0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x1a, 0x1e, 0x2e,
0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e,
0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x22, 0x94, 0x01,
0x92, 0x41, 0x37, 0x4a, 0x35, 0x0a, 0x03, 0x32, 0x30, 0x31, 0x12, 0x2e, 0x0a, 0x2c, 0x52, 0x65,
0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x67, 0x72, 0x6f, 0x75,
0x70, 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, 0x54,
0x22, 0x4f, 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, 0x67, 0x72, 0x6f, 0x75, 0x70,
0x73, 0x3a, 0x01, 0x2a, 0x12, 0xa8, 0x01, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75,
0x70, 0x73, 0x12, 0x1e, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74,
0x79, 0x70, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x72, 0x6f,
0x75, 0x70, 0x1a, 0x22, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74,
0x79, 0x70, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x72, 0x6f,
0x75, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x57, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x51, 0x12, 0x4f,
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, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12,
0x94, 0x02, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1e, 0x2e, 0x72,
0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x75,
0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x1a, 0x1e, 0x2e, 0x72,
0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x75,
0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x22, 0xc7, 0x01, 0x82,
0xd3, 0xe4, 0x93, 0x02, 0xc0, 0x01, 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, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,
0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x5a, 0x5e, 0x12, 0x5c, 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, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61,
0x74, 0x61, 0x2e, 0x69, 0x64, 0x7d, 0x12, 0x9d, 0x02, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74,
0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1e, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64,
0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33,
0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x1a, 0x1e, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64,
0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33,
0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x22, 0xcd, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0xc6, 0x01,
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, 0x67, 0x72, 0x6f, 0x75, 0x70,
0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x7d,
0x3a, 0x01, 0x2a, 0x5a, 0x61, 0x1a, 0x5c, 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,
0x67, 0x72, 0x6f, 0x75, 0x70, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e,
0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0xd1, 0x02, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74,
0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1e, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64,
0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33,
0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x1a, 0x1e, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64,
0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33,
0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x22, 0x81, 0x02, 0x92, 0x41, 0x37, 0x4a, 0x35, 0x0a, 0x03,
0x32, 0x30, 0x34, 0x12, 0x2e, 0x0a, 0x2c, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20,
0x77, 0x68, 0x65, 0x6e, 0x20, 0x67, 0x72, 0x6f, 0x75, 0x70, 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, 0xc0, 0x01, 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, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61,
0x64, 0x61, 0x74, 0x61, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x5a, 0x5e, 0x2a, 0x5c, 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, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2f, 0x7b, 0x6d, 0x65,
0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x69, 0x64, 0x7d, 0x42, 0xcd, 0x04, 0x0a, 0x14, 0x63,
0x6f, 0x6d, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x70, 0x63,
0x2e, 0x76, 0x33, 0x42, 0x0a, 0x47, 0x72, 0x6f, 0x75, 0x70, 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, 0x75, 0x73, 0x65, 0x72, 0x6d, 0x67, 0x6d, 0x74, 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,
0xe4, 0x02, 0x12, 0x2c, 0x0a, 0x18, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x20, 0x6d, 0x61, 0x6e, 0x61,
0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x0b,
0x0a, 0x09, 0x52, 0x61, 0x66, 0x61, 0x79, 0x20, 0x44, 0x65, 0x76, 0x32, 0x03, 0x32, 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, 0x51, 0x0a, 0x03, 0x34,
0x30, 0x33, 0x12, 0x4a, 0x0a, 0x48, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x77,
0x68, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x72, 0x6f, 0x75, 0x70, 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_group_proto_goTypes = []interface{}{
(*v3.Group)(nil), // 0: rafay.dev.types.user.v3.Group
(*v3.GroupList)(nil), // 1: rafay.dev.types.user.v3.GroupList
}
var file_proto_rpc_v3_group_proto_depIdxs = []int32{
0, // 0: rafay.dev.rpc.v3.Group.CreateGroup:input_type -> rafay.dev.types.user.v3.Group
0, // 1: rafay.dev.rpc.v3.Group.GetGroups:input_type -> rafay.dev.types.user.v3.Group
0, // 2: rafay.dev.rpc.v3.Group.GetGroup:input_type -> rafay.dev.types.user.v3.Group
0, // 3: rafay.dev.rpc.v3.Group.UpdateGroup:input_type -> rafay.dev.types.user.v3.Group
0, // 4: rafay.dev.rpc.v3.Group.DeleteGroup:input_type -> rafay.dev.types.user.v3.Group
0, // 5: rafay.dev.rpc.v3.Group.CreateGroup:output_type -> rafay.dev.types.user.v3.Group
1, // 6: rafay.dev.rpc.v3.Group.GetGroups:output_type -> rafay.dev.types.user.v3.GroupList
0, // 7: rafay.dev.rpc.v3.Group.GetGroup:output_type -> rafay.dev.types.user.v3.Group
0, // 8: rafay.dev.rpc.v3.Group.UpdateGroup:output_type -> rafay.dev.types.user.v3.Group
0, // 9: rafay.dev.rpc.v3.Group.DeleteGroup:output_type -> rafay.dev.types.user.v3.Group
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_group_proto_init() }
func file_proto_rpc_v3_group_proto_init() {
if File_proto_rpc_v3_group_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_proto_rpc_v3_group_proto_rawDesc,
NumEnums: 0,
NumMessages: 0,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_proto_rpc_v3_group_proto_goTypes,
DependencyIndexes: file_proto_rpc_v3_group_proto_depIdxs,
}.Build()
File_proto_rpc_v3_group_proto = out.File
file_proto_rpc_v3_group_proto_rawDesc = nil
file_proto_rpc_v3_group_proto_goTypes = nil
file_proto_rpc_v3_group_proto_depIdxs = nil
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,127 @@
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/userpb/v3/group.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 : "Group management Service"
version : "2.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 group 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 Group {
rpc CreateGroup(rafay.dev.types.user.v3.Group)
returns (rafay.dev.types.user.v3.Group) {
option (google.api.http) = {
post : "/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/groups"
body : "*"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
responses : {
key : "201"
value : {description : "Returned when group is created successfully."}
}
};
};
rpc GetGroups(rafay.dev.types.user.v3.Group) returns (rafay.dev.types.user.v3.GroupList) {
option (google.api.http) = {
get : "/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/groups"
};
};
rpc GetGroup(rafay.dev.types.user.v3.Group) returns (rafay.dev.types.user.v3.Group) {
option (google.api.http) = {
get : "/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/group/{metadata.name}"
additional_bindings {
get : "/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/group/{metadata.id}"
}
};
};
rpc UpdateGroup(rafay.dev.types.user.v3.Group) returns (rafay.dev.types.user.v3.Group) {
option (google.api.http) = {
put : "/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/group/{metadata.name}"
body : "*"
additional_bindings {
put : "/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/group/{metadata.id}"
body : "*"
}
};
};
rpc DeleteGroup(rafay.dev.types.user.v3.Group) returns (rafay.dev.types.user.v3.Group) {
option (google.api.http) = {
delete : "/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/group/{metadata.name}"
additional_bindings {
delete : "/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/group/{metadata.id}"
}
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
responses : {
key : "204"
value : {
description : "Returned when group is deleted successfully."
}
}
};
};
}

View File

@@ -0,0 +1,248 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v3.19.1
// source: proto/rpc/v3/group.proto
package rpcv3
import (
context "context"
v3 "github.com/RafaySystems/rcloud-base/components/usermgmt/proto/types/userpb/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
// GroupClient is the client API for Group 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 GroupClient interface {
CreateGroup(ctx context.Context, in *v3.Group, opts ...grpc.CallOption) (*v3.Group, error)
GetGroups(ctx context.Context, in *v3.Group, opts ...grpc.CallOption) (*v3.GroupList, error)
GetGroup(ctx context.Context, in *v3.Group, opts ...grpc.CallOption) (*v3.Group, error)
UpdateGroup(ctx context.Context, in *v3.Group, opts ...grpc.CallOption) (*v3.Group, error)
DeleteGroup(ctx context.Context, in *v3.Group, opts ...grpc.CallOption) (*v3.Group, error)
}
type groupClient struct {
cc grpc.ClientConnInterface
}
func NewGroupClient(cc grpc.ClientConnInterface) GroupClient {
return &groupClient{cc}
}
func (c *groupClient) CreateGroup(ctx context.Context, in *v3.Group, opts ...grpc.CallOption) (*v3.Group, error) {
out := new(v3.Group)
err := c.cc.Invoke(ctx, "/rafay.dev.rpc.v3.Group/CreateGroup", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *groupClient) GetGroups(ctx context.Context, in *v3.Group, opts ...grpc.CallOption) (*v3.GroupList, error) {
out := new(v3.GroupList)
err := c.cc.Invoke(ctx, "/rafay.dev.rpc.v3.Group/GetGroups", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *groupClient) GetGroup(ctx context.Context, in *v3.Group, opts ...grpc.CallOption) (*v3.Group, error) {
out := new(v3.Group)
err := c.cc.Invoke(ctx, "/rafay.dev.rpc.v3.Group/GetGroup", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *groupClient) UpdateGroup(ctx context.Context, in *v3.Group, opts ...grpc.CallOption) (*v3.Group, error) {
out := new(v3.Group)
err := c.cc.Invoke(ctx, "/rafay.dev.rpc.v3.Group/UpdateGroup", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *groupClient) DeleteGroup(ctx context.Context, in *v3.Group, opts ...grpc.CallOption) (*v3.Group, error) {
out := new(v3.Group)
err := c.cc.Invoke(ctx, "/rafay.dev.rpc.v3.Group/DeleteGroup", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// GroupServer is the server API for Group service.
// All implementations should embed UnimplementedGroupServer
// for forward compatibility
type GroupServer interface {
CreateGroup(context.Context, *v3.Group) (*v3.Group, error)
GetGroups(context.Context, *v3.Group) (*v3.GroupList, error)
GetGroup(context.Context, *v3.Group) (*v3.Group, error)
UpdateGroup(context.Context, *v3.Group) (*v3.Group, error)
DeleteGroup(context.Context, *v3.Group) (*v3.Group, error)
}
// UnimplementedGroupServer should be embedded to have forward compatible implementations.
type UnimplementedGroupServer struct {
}
func (UnimplementedGroupServer) CreateGroup(context.Context, *v3.Group) (*v3.Group, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateGroup not implemented")
}
func (UnimplementedGroupServer) GetGroups(context.Context, *v3.Group) (*v3.GroupList, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetGroups not implemented")
}
func (UnimplementedGroupServer) GetGroup(context.Context, *v3.Group) (*v3.Group, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetGroup not implemented")
}
func (UnimplementedGroupServer) UpdateGroup(context.Context, *v3.Group) (*v3.Group, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateGroup not implemented")
}
func (UnimplementedGroupServer) DeleteGroup(context.Context, *v3.Group) (*v3.Group, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteGroup not implemented")
}
// UnsafeGroupServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to GroupServer will
// result in compilation errors.
type UnsafeGroupServer interface {
mustEmbedUnimplementedGroupServer()
}
func RegisterGroupServer(s grpc.ServiceRegistrar, srv GroupServer) {
s.RegisterService(&Group_ServiceDesc, srv)
}
func _Group_CreateGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v3.Group)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(GroupServer).CreateGroup(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/rafay.dev.rpc.v3.Group/CreateGroup",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(GroupServer).CreateGroup(ctx, req.(*v3.Group))
}
return interceptor(ctx, in, info, handler)
}
func _Group_GetGroups_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v3.Group)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(GroupServer).GetGroups(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/rafay.dev.rpc.v3.Group/GetGroups",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(GroupServer).GetGroups(ctx, req.(*v3.Group))
}
return interceptor(ctx, in, info, handler)
}
func _Group_GetGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v3.Group)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(GroupServer).GetGroup(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/rafay.dev.rpc.v3.Group/GetGroup",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(GroupServer).GetGroup(ctx, req.(*v3.Group))
}
return interceptor(ctx, in, info, handler)
}
func _Group_UpdateGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v3.Group)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(GroupServer).UpdateGroup(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/rafay.dev.rpc.v3.Group/UpdateGroup",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(GroupServer).UpdateGroup(ctx, req.(*v3.Group))
}
return interceptor(ctx, in, info, handler)
}
func _Group_DeleteGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v3.Group)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(GroupServer).DeleteGroup(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/rafay.dev.rpc.v3.Group/DeleteGroup",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(GroupServer).DeleteGroup(ctx, req.(*v3.Group))
}
return interceptor(ctx, in, info, handler)
}
// Group_ServiceDesc is the grpc.ServiceDesc for Group service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Group_ServiceDesc = grpc.ServiceDesc{
ServiceName: "rafay.dev.rpc.v3.Group",
HandlerType: (*GroupServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "CreateGroup",
Handler: _Group_CreateGroup_Handler,
},
{
MethodName: "GetGroups",
Handler: _Group_GetGroups_Handler,
},
{
MethodName: "GetGroup",
Handler: _Group_GetGroup_Handler,
},
{
MethodName: "UpdateGroup",
Handler: _Group_UpdateGroup_Handler,
},
{
MethodName: "DeleteGroup",
Handler: _Group_DeleteGroup_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "proto/rpc/v3/group.proto",
}

View File

@@ -0,0 +1,205 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.1
// protoc v3.19.1
// source: proto/rpc/v3/role.proto
package rpcv3
import (
v3 "github.com/RafaySystems/rcloud-base/components/usermgmt/proto/types/userpb/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_role_proto protoreflect.FileDescriptor
var file_proto_rpc_v3_role_proto_rawDesc = []byte{
0x0a, 0x17, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x33, 0x2f, 0x72,
0x6f, 0x6c, 0x65, 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,
0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x75, 0x73, 0x65,
0x72, 0x70, 0x62, 0x2f, 0x76, 0x33, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x32, 0x8a, 0x0a, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0xdf, 0x01, 0x0a, 0x0a, 0x43,
0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x1d, 0x2e, 0x72, 0x61, 0x66, 0x61,
0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72,
0x2e, 0x76, 0x33, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x1a, 0x1d, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79,
0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e,
0x76, 0x33, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x22, 0x92, 0x01, 0x92, 0x41, 0x36, 0x4a, 0x34, 0x0a,
0x03, 0x32, 0x30, 0x31, 0x12, 0x2d, 0x0a, 0x2b, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64,
0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x72, 0x6f, 0x6c, 0x65, 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, 0x53, 0x22, 0x4e, 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, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x3a, 0x01, 0x2a, 0x12, 0xa4, 0x01, 0x0a,
0x08, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x12, 0x1d, 0x2e, 0x72, 0x61, 0x66, 0x61,
0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72,
0x2e, 0x76, 0x33, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x1a, 0x21, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79,
0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e,
0x76, 0x33, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x56, 0x82, 0xd3, 0xe4,
0x93, 0x02, 0x50, 0x12, 0x4e, 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, 0x72, 0x6f,
0x6c, 0x65, 0x73, 0x12, 0x8f, 0x02, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x12,
0x1d, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65,
0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x1a, 0x1d,
0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73,
0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x22, 0xc5, 0x01,
0x82, 0xd3, 0xe4, 0x93, 0x02, 0xbe, 0x01, 0x12, 0x5d, 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, 0x72, 0x6f, 0x6c, 0x65, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,
0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x5a, 0x5d, 0x12, 0x5b, 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, 0x72, 0x6f, 0x6c, 0x65, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,
0x61, 0x2e, 0x69, 0x64, 0x7d, 0x12, 0x98, 0x02, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
0x52, 0x6f, 0x6c, 0x65, 0x12, 0x1d, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76,
0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x52,
0x6f, 0x6c, 0x65, 0x1a, 0x1d, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e,
0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x6f,
0x6c, 0x65, 0x22, 0xcb, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0xc4, 0x01, 0x1a, 0x5d, 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, 0x72, 0x6f, 0x6c, 0x65, 0x2f, 0x7b, 0x6d, 0x65, 0x74,
0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x3a, 0x01, 0x2a, 0x5a, 0x60,
0x1a, 0x5b, 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, 0x72, 0x6f, 0x6c, 0x65, 0x2f,
0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a,
0x12, 0xcb, 0x02, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x12,
0x1d, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65,
0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x1a, 0x1d,
0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73,
0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x22, 0xfe, 0x01,
0x92, 0x41, 0x36, 0x4a, 0x34, 0x0a, 0x03, 0x32, 0x30, 0x34, 0x12, 0x2d, 0x0a, 0x2b, 0x52, 0x65,
0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x72, 0x6f, 0x6c, 0x65,
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, 0xbe, 0x01,
0x2a, 0x5d, 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, 0x72, 0x6f, 0x6c, 0x65, 0x2f,
0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x5a,
0x5d, 0x2a, 0x5b, 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, 0x72, 0x6f, 0x6c, 0x65,
0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x69, 0x64, 0x7d, 0x42, 0xca,
0x04, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76,
0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x33, 0x42, 0x09, 0x52, 0x6f, 0x6c, 0x65, 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, 0x75, 0x73, 0x65, 0x72, 0x6d, 0x67, 0x6d, 0x74, 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, 0xe2, 0x02, 0x12, 0x2b, 0x0a, 0x17, 0x52, 0x6f, 0x6c, 0x65, 0x20, 0x6d, 0x61,
0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
0x22, 0x0b, 0x0a, 0x09, 0x52, 0x61, 0x66, 0x61, 0x79, 0x20, 0x44, 0x65, 0x76, 0x32, 0x03, 0x32,
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, 0x72, 0x6f, 0x6c, 0x65, 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_role_proto_goTypes = []interface{}{
(*v3.Role)(nil), // 0: rafay.dev.types.user.v3.Role
(*v3.RoleList)(nil), // 1: rafay.dev.types.user.v3.RoleList
}
var file_proto_rpc_v3_role_proto_depIdxs = []int32{
0, // 0: rafay.dev.rpc.v3.Role.CreateRole:input_type -> rafay.dev.types.user.v3.Role
0, // 1: rafay.dev.rpc.v3.Role.GetRoles:input_type -> rafay.dev.types.user.v3.Role
0, // 2: rafay.dev.rpc.v3.Role.GetRole:input_type -> rafay.dev.types.user.v3.Role
0, // 3: rafay.dev.rpc.v3.Role.UpdateRole:input_type -> rafay.dev.types.user.v3.Role
0, // 4: rafay.dev.rpc.v3.Role.DeleteRole:input_type -> rafay.dev.types.user.v3.Role
0, // 5: rafay.dev.rpc.v3.Role.CreateRole:output_type -> rafay.dev.types.user.v3.Role
1, // 6: rafay.dev.rpc.v3.Role.GetRoles:output_type -> rafay.dev.types.user.v3.RoleList
0, // 7: rafay.dev.rpc.v3.Role.GetRole:output_type -> rafay.dev.types.user.v3.Role
0, // 8: rafay.dev.rpc.v3.Role.UpdateRole:output_type -> rafay.dev.types.user.v3.Role
0, // 9: rafay.dev.rpc.v3.Role.DeleteRole:output_type -> rafay.dev.types.user.v3.Role
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_role_proto_init() }
func file_proto_rpc_v3_role_proto_init() {
if File_proto_rpc_v3_role_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_proto_rpc_v3_role_proto_rawDesc,
NumEnums: 0,
NumMessages: 0,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_proto_rpc_v3_role_proto_goTypes,
DependencyIndexes: file_proto_rpc_v3_role_proto_depIdxs,
}.Build()
File_proto_rpc_v3_role_proto = out.File
file_proto_rpc_v3_role_proto_rawDesc = nil
file_proto_rpc_v3_role_proto_goTypes = nil
file_proto_rpc_v3_role_proto_depIdxs = nil
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,126 @@
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/userpb/v3/role.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 : "Role management Service"
version : "2.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 role 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 Role {
rpc CreateRole(rafay.dev.types.user.v3.Role)
returns (rafay.dev.types.user.v3.Role) {
option (google.api.http) = {
post : "/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/roles"
body : "*"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
responses : {
key : "201"
value : {description : "Returned when role is created successfully."}
}
};
};
rpc GetRoles(rafay.dev.types.user.v3.Role) returns (rafay.dev.types.user.v3.RoleList) {
option (google.api.http) = {
get : "/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/roles"
};
};
rpc GetRole(rafay.dev.types.user.v3.Role) returns (rafay.dev.types.user.v3.Role) {
option (google.api.http) = {
get : "/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/role/{metadata.name}"
additional_bindings {
get : "/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/role/{metadata.id}"
}
};
};
rpc UpdateRole(rafay.dev.types.user.v3.Role) returns (rafay.dev.types.user.v3.Role) {
option (google.api.http) = {
put : "/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/role/{metadata.name}"
body : "*"
additional_bindings {
put : "/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/role/{metadata.id}"
body : "*"
}
};
};
rpc DeleteRole(rafay.dev.types.user.v3.Role) returns (rafay.dev.types.user.v3.Role) {
option (google.api.http) = {
delete : "/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/role/{metadata.name}"
additional_bindings {
delete : "/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/role/{metadata.id}"
}
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
responses : {
key : "204"
value : {
description : "Returned when role is deleted successfully."
}
}
};
};
}

View File

@@ -0,0 +1,248 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v3.19.1
// source: proto/rpc/v3/role.proto
package rpcv3
import (
context "context"
v3 "github.com/RafaySystems/rcloud-base/components/usermgmt/proto/types/userpb/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
// RoleClient is the client API for Role 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 RoleClient interface {
CreateRole(ctx context.Context, in *v3.Role, opts ...grpc.CallOption) (*v3.Role, error)
GetRoles(ctx context.Context, in *v3.Role, opts ...grpc.CallOption) (*v3.RoleList, error)
GetRole(ctx context.Context, in *v3.Role, opts ...grpc.CallOption) (*v3.Role, error)
UpdateRole(ctx context.Context, in *v3.Role, opts ...grpc.CallOption) (*v3.Role, error)
DeleteRole(ctx context.Context, in *v3.Role, opts ...grpc.CallOption) (*v3.Role, error)
}
type roleClient struct {
cc grpc.ClientConnInterface
}
func NewRoleClient(cc grpc.ClientConnInterface) RoleClient {
return &roleClient{cc}
}
func (c *roleClient) CreateRole(ctx context.Context, in *v3.Role, opts ...grpc.CallOption) (*v3.Role, error) {
out := new(v3.Role)
err := c.cc.Invoke(ctx, "/rafay.dev.rpc.v3.Role/CreateRole", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *roleClient) GetRoles(ctx context.Context, in *v3.Role, opts ...grpc.CallOption) (*v3.RoleList, error) {
out := new(v3.RoleList)
err := c.cc.Invoke(ctx, "/rafay.dev.rpc.v3.Role/GetRoles", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *roleClient) GetRole(ctx context.Context, in *v3.Role, opts ...grpc.CallOption) (*v3.Role, error) {
out := new(v3.Role)
err := c.cc.Invoke(ctx, "/rafay.dev.rpc.v3.Role/GetRole", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *roleClient) UpdateRole(ctx context.Context, in *v3.Role, opts ...grpc.CallOption) (*v3.Role, error) {
out := new(v3.Role)
err := c.cc.Invoke(ctx, "/rafay.dev.rpc.v3.Role/UpdateRole", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *roleClient) DeleteRole(ctx context.Context, in *v3.Role, opts ...grpc.CallOption) (*v3.Role, error) {
out := new(v3.Role)
err := c.cc.Invoke(ctx, "/rafay.dev.rpc.v3.Role/DeleteRole", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// RoleServer is the server API for Role service.
// All implementations should embed UnimplementedRoleServer
// for forward compatibility
type RoleServer interface {
CreateRole(context.Context, *v3.Role) (*v3.Role, error)
GetRoles(context.Context, *v3.Role) (*v3.RoleList, error)
GetRole(context.Context, *v3.Role) (*v3.Role, error)
UpdateRole(context.Context, *v3.Role) (*v3.Role, error)
DeleteRole(context.Context, *v3.Role) (*v3.Role, error)
}
// UnimplementedRoleServer should be embedded to have forward compatible implementations.
type UnimplementedRoleServer struct {
}
func (UnimplementedRoleServer) CreateRole(context.Context, *v3.Role) (*v3.Role, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateRole not implemented")
}
func (UnimplementedRoleServer) GetRoles(context.Context, *v3.Role) (*v3.RoleList, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetRoles not implemented")
}
func (UnimplementedRoleServer) GetRole(context.Context, *v3.Role) (*v3.Role, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetRole not implemented")
}
func (UnimplementedRoleServer) UpdateRole(context.Context, *v3.Role) (*v3.Role, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateRole not implemented")
}
func (UnimplementedRoleServer) DeleteRole(context.Context, *v3.Role) (*v3.Role, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteRole not implemented")
}
// UnsafeRoleServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to RoleServer will
// result in compilation errors.
type UnsafeRoleServer interface {
mustEmbedUnimplementedRoleServer()
}
func RegisterRoleServer(s grpc.ServiceRegistrar, srv RoleServer) {
s.RegisterService(&Role_ServiceDesc, srv)
}
func _Role_CreateRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v3.Role)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RoleServer).CreateRole(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/rafay.dev.rpc.v3.Role/CreateRole",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RoleServer).CreateRole(ctx, req.(*v3.Role))
}
return interceptor(ctx, in, info, handler)
}
func _Role_GetRoles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v3.Role)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RoleServer).GetRoles(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/rafay.dev.rpc.v3.Role/GetRoles",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RoleServer).GetRoles(ctx, req.(*v3.Role))
}
return interceptor(ctx, in, info, handler)
}
func _Role_GetRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v3.Role)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RoleServer).GetRole(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/rafay.dev.rpc.v3.Role/GetRole",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RoleServer).GetRole(ctx, req.(*v3.Role))
}
return interceptor(ctx, in, info, handler)
}
func _Role_UpdateRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v3.Role)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RoleServer).UpdateRole(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/rafay.dev.rpc.v3.Role/UpdateRole",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RoleServer).UpdateRole(ctx, req.(*v3.Role))
}
return interceptor(ctx, in, info, handler)
}
func _Role_DeleteRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v3.Role)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RoleServer).DeleteRole(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/rafay.dev.rpc.v3.Role/DeleteRole",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RoleServer).DeleteRole(ctx, req.(*v3.Role))
}
return interceptor(ctx, in, info, handler)
}
// Role_ServiceDesc is the grpc.ServiceDesc for Role service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Role_ServiceDesc = grpc.ServiceDesc{
ServiceName: "rafay.dev.rpc.v3.Role",
HandlerType: (*RoleServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "CreateRole",
Handler: _Role_CreateRole_Handler,
},
{
MethodName: "GetRoles",
Handler: _Role_GetRoles_Handler,
},
{
MethodName: "GetRole",
Handler: _Role_GetRole_Handler,
},
{
MethodName: "UpdateRole",
Handler: _Role_UpdateRole_Handler,
},
{
MethodName: "DeleteRole",
Handler: _Role_DeleteRole_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "proto/rpc/v3/role.proto",
}

View File

@@ -0,0 +1,143 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.1
// protoc v3.19.1
// source: proto/rpc/v3/rolepermission.proto
package rpcv3
import (
v3 "github.com/RafaySystems/rcloud-base/components/usermgmt/proto/types/userpb/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_rolepermission_proto protoreflect.FileDescriptor
var file_proto_rpc_v3_rolepermission_proto_rawDesc = []byte{
0x0a, 0x21, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x33, 0x2f, 0x72,
0x6f, 0x6c, 0x65, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 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, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2f, 0x76, 0x33,
0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xe1, 0x02, 0x0a, 0x0e, 0x52, 0x6f, 0x6c, 0x65, 0x70, 0x65,
0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x8c, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74,
0x52, 0x6f, 0x6c, 0x65, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12,
0x27, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65,
0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x50, 0x65,
0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0x2b, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79,
0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e,
0x76, 0x33, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f,
0x6e, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x12, 0x18, 0x2f,
0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x33, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x70, 0x65, 0x72, 0x6d,
0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0xbf, 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x52,
0x6f, 0x6c, 0x65, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x2e,
0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e,
0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x50, 0x65, 0x72, 0x6d,
0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0x27, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64,
0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33,
0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x22,
0x58, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x52, 0x12, 0x27, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76,
0x33, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e,
0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x7d,
0x5a, 0x27, 0x12, 0x25, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x33, 0x2f, 0x72, 0x6f, 0x6c,
0x65, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x7b, 0x6d, 0x65, 0x74,
0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x69, 0x64, 0x7d, 0x42, 0xe8, 0x04, 0x0a, 0x14, 0x63, 0x6f,
0x6d, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x70, 0x63, 0x2e,
0x76, 0x33, 0x42, 0x13, 0x52, 0x6f, 0x6c, 0x65, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 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, 0x75, 0x73, 0x65, 0x72, 0x6d, 0x67,
0x6d, 0x74, 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, 0xf6, 0x02, 0x12, 0x35, 0x0a, 0x21, 0x52, 0x6f,
0x6c, 0x65, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6d, 0x61, 0x6e,
0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22,
0x0b, 0x0a, 0x09, 0x52, 0x61, 0x66, 0x61, 0x79, 0x20, 0x44, 0x65, 0x76, 0x32, 0x03, 0x32, 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, 0x5a, 0x0a, 0x03,
0x34, 0x30, 0x33, 0x12, 0x53, 0x0a, 0x51, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20,
0x77, 0x68, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x6f, 0x6c, 0x65, 0x70, 0x65, 0x72,
0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 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_rolepermission_proto_goTypes = []interface{}{
(*v3.RolePermission)(nil), // 0: rafay.dev.types.user.v3.RolePermission
(*v3.RolePermissionList)(nil), // 1: rafay.dev.types.user.v3.RolePermissionList
}
var file_proto_rpc_v3_rolepermission_proto_depIdxs = []int32{
0, // 0: rafay.dev.rpc.v3.Rolepermission.GetRolepermissions:input_type -> rafay.dev.types.user.v3.RolePermission
0, // 1: rafay.dev.rpc.v3.Rolepermission.GetRolepermission:input_type -> rafay.dev.types.user.v3.RolePermission
1, // 2: rafay.dev.rpc.v3.Rolepermission.GetRolepermissions:output_type -> rafay.dev.types.user.v3.RolePermissionList
0, // 3: rafay.dev.rpc.v3.Rolepermission.GetRolepermission:output_type -> rafay.dev.types.user.v3.RolePermission
2, // [2:4] is the sub-list for method output_type
0, // [0:2] 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_rolepermission_proto_init() }
func file_proto_rpc_v3_rolepermission_proto_init() {
if File_proto_rpc_v3_rolepermission_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_proto_rpc_v3_rolepermission_proto_rawDesc,
NumEnums: 0,
NumMessages: 0,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_proto_rpc_v3_rolepermission_proto_goTypes,
DependencyIndexes: file_proto_rpc_v3_rolepermission_proto_depIdxs,
}.Build()
File_proto_rpc_v3_rolepermission_proto = out.File
file_proto_rpc_v3_rolepermission_proto_rawDesc = nil
file_proto_rpc_v3_rolepermission_proto_goTypes = nil
file_proto_rpc_v3_rolepermission_proto_depIdxs = nil
}

View File

@@ -0,0 +1,404 @@
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: proto/rpc/v3/rolepermission.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/usermgmt/proto/types/userpb/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
var (
filter_Rolepermission_GetRolepermissions_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
func request_Rolepermission_GetRolepermissions_0(ctx context.Context, marshaler runtime.Marshaler, client RolepermissionClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq userv3.RolePermission
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Rolepermission_GetRolepermissions_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.GetRolepermissions(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Rolepermission_GetRolepermissions_0(ctx context.Context, marshaler runtime.Marshaler, server RolepermissionServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq userv3.RolePermission
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Rolepermission_GetRolepermissions_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.GetRolepermissions(ctx, &protoReq)
return msg, metadata, err
}
var (
filter_Rolepermission_GetRolepermission_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_Rolepermission_GetRolepermission_0(ctx context.Context, marshaler runtime.Marshaler, client RolepermissionClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq userv3.RolePermission
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_Rolepermission_GetRolepermission_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.GetRolepermission(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Rolepermission_GetRolepermission_0(ctx context.Context, marshaler runtime.Marshaler, server RolepermissionServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq userv3.RolePermission
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_Rolepermission_GetRolepermission_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.GetRolepermission(ctx, &protoReq)
return msg, metadata, err
}
var (
filter_Rolepermission_GetRolepermission_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_Rolepermission_GetRolepermission_1(ctx context.Context, marshaler runtime.Marshaler, client RolepermissionClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq userv3.RolePermission
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_Rolepermission_GetRolepermission_1); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.GetRolepermission(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Rolepermission_GetRolepermission_1(ctx context.Context, marshaler runtime.Marshaler, server RolepermissionServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq userv3.RolePermission
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_Rolepermission_GetRolepermission_1); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.GetRolepermission(ctx, &protoReq)
return msg, metadata, err
}
// RegisterRolepermissionHandlerServer registers the http handlers for service Rolepermission to "mux".
// UnaryRPC :call RolepermissionServer 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 RegisterRolepermissionHandlerFromEndpoint instead.
func RegisterRolepermissionHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RolepermissionServer) error {
mux.Handle("GET", pattern_Rolepermission_GetRolepermissions_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.Rolepermission/GetRolepermissions", runtime.WithHTTPPathPattern("/auth/v3/rolepermissions"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Rolepermission_GetRolepermissions_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_Rolepermission_GetRolepermissions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_Rolepermission_GetRolepermission_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.Rolepermission/GetRolepermission", runtime.WithHTTPPathPattern("/auth/v3/rolepermission/{metadata.name}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Rolepermission_GetRolepermission_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_Rolepermission_GetRolepermission_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_Rolepermission_GetRolepermission_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.Rolepermission/GetRolepermission", runtime.WithHTTPPathPattern("/auth/v3/rolepermission/{metadata.id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Rolepermission_GetRolepermission_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_Rolepermission_GetRolepermission_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
// RegisterRolepermissionHandlerFromEndpoint is same as RegisterRolepermissionHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterRolepermissionHandlerFromEndpoint(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 RegisterRolepermissionHandler(ctx, mux, conn)
}
// RegisterRolepermissionHandler registers the http handlers for service Rolepermission to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterRolepermissionHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
return RegisterRolepermissionHandlerClient(ctx, mux, NewRolepermissionClient(conn))
}
// RegisterRolepermissionHandlerClient registers the http handlers for service Rolepermission
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "RolepermissionClient".
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "RolepermissionClient"
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
// "RolepermissionClient" to call the correct interceptors.
func RegisterRolepermissionHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RolepermissionClient) error {
mux.Handle("GET", pattern_Rolepermission_GetRolepermissions_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.Rolepermission/GetRolepermissions", runtime.WithHTTPPathPattern("/auth/v3/rolepermissions"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Rolepermission_GetRolepermissions_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Rolepermission_GetRolepermissions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_Rolepermission_GetRolepermission_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.Rolepermission/GetRolepermission", runtime.WithHTTPPathPattern("/auth/v3/rolepermission/{metadata.name}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Rolepermission_GetRolepermission_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Rolepermission_GetRolepermission_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_Rolepermission_GetRolepermission_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.Rolepermission/GetRolepermission", runtime.WithHTTPPathPattern("/auth/v3/rolepermission/{metadata.id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Rolepermission_GetRolepermission_1(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Rolepermission_GetRolepermission_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_Rolepermission_GetRolepermissions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"auth", "v3", "rolepermissions"}, ""))
pattern_Rolepermission_GetRolepermission_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"auth", "v3", "rolepermission", "metadata.name"}, ""))
pattern_Rolepermission_GetRolepermission_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"auth", "v3", "rolepermission", "metadata.id"}, ""))
)
var (
forward_Rolepermission_GetRolepermissions_0 = runtime.ForwardResponseMessage
forward_Rolepermission_GetRolepermission_0 = runtime.ForwardResponseMessage
forward_Rolepermission_GetRolepermission_1 = runtime.ForwardResponseMessage
)

View File

@@ -0,0 +1,85 @@
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/userpb/v3/rolepermission.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 : "Rolepermission management Service"
version : "2.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 rolepermission 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 Rolepermission {
rpc GetRolepermissions(rafay.dev.types.user.v3.RolePermission)
returns (rafay.dev.types.user.v3.RolePermissionList) {
option (google.api.http) = {
get : "/auth/v3/rolepermissions"
};
};
rpc GetRolepermission(rafay.dev.types.user.v3.RolePermission)
returns (rafay.dev.types.user.v3.RolePermission) {
option (google.api.http) = {
get : "/auth/v3/rolepermission/{metadata.name}"
additional_bindings {
get : "/auth/v3/rolepermission/{metadata.id}"
}
};
};
}

View File

@@ -0,0 +1,140 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v3.19.1
// source: proto/rpc/v3/rolepermission.proto
package rpcv3
import (
context "context"
v3 "github.com/RafaySystems/rcloud-base/components/usermgmt/proto/types/userpb/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
// RolepermissionClient is the client API for Rolepermission 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 RolepermissionClient interface {
GetRolepermissions(ctx context.Context, in *v3.RolePermission, opts ...grpc.CallOption) (*v3.RolePermissionList, error)
GetRolepermission(ctx context.Context, in *v3.RolePermission, opts ...grpc.CallOption) (*v3.RolePermission, error)
}
type rolepermissionClient struct {
cc grpc.ClientConnInterface
}
func NewRolepermissionClient(cc grpc.ClientConnInterface) RolepermissionClient {
return &rolepermissionClient{cc}
}
func (c *rolepermissionClient) GetRolepermissions(ctx context.Context, in *v3.RolePermission, opts ...grpc.CallOption) (*v3.RolePermissionList, error) {
out := new(v3.RolePermissionList)
err := c.cc.Invoke(ctx, "/rafay.dev.rpc.v3.Rolepermission/GetRolepermissions", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *rolepermissionClient) GetRolepermission(ctx context.Context, in *v3.RolePermission, opts ...grpc.CallOption) (*v3.RolePermission, error) {
out := new(v3.RolePermission)
err := c.cc.Invoke(ctx, "/rafay.dev.rpc.v3.Rolepermission/GetRolepermission", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// RolepermissionServer is the server API for Rolepermission service.
// All implementations should embed UnimplementedRolepermissionServer
// for forward compatibility
type RolepermissionServer interface {
GetRolepermissions(context.Context, *v3.RolePermission) (*v3.RolePermissionList, error)
GetRolepermission(context.Context, *v3.RolePermission) (*v3.RolePermission, error)
}
// UnimplementedRolepermissionServer should be embedded to have forward compatible implementations.
type UnimplementedRolepermissionServer struct {
}
func (UnimplementedRolepermissionServer) GetRolepermissions(context.Context, *v3.RolePermission) (*v3.RolePermissionList, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetRolepermissions not implemented")
}
func (UnimplementedRolepermissionServer) GetRolepermission(context.Context, *v3.RolePermission) (*v3.RolePermission, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetRolepermission not implemented")
}
// UnsafeRolepermissionServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to RolepermissionServer will
// result in compilation errors.
type UnsafeRolepermissionServer interface {
mustEmbedUnimplementedRolepermissionServer()
}
func RegisterRolepermissionServer(s grpc.ServiceRegistrar, srv RolepermissionServer) {
s.RegisterService(&Rolepermission_ServiceDesc, srv)
}
func _Rolepermission_GetRolepermissions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v3.RolePermission)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RolepermissionServer).GetRolepermissions(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/rafay.dev.rpc.v3.Rolepermission/GetRolepermissions",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RolepermissionServer).GetRolepermissions(ctx, req.(*v3.RolePermission))
}
return interceptor(ctx, in, info, handler)
}
func _Rolepermission_GetRolepermission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v3.RolePermission)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RolepermissionServer).GetRolepermission(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/rafay.dev.rpc.v3.Rolepermission/GetRolepermission",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RolepermissionServer).GetRolepermission(ctx, req.(*v3.RolePermission))
}
return interceptor(ctx, in, info, handler)
}
// Rolepermission_ServiceDesc is the grpc.ServiceDesc for Rolepermission service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Rolepermission_ServiceDesc = grpc.ServiceDesc{
ServiceName: "rafay.dev.rpc.v3.Rolepermission",
HandlerType: (*RolepermissionServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetRolepermissions",
Handler: _Rolepermission_GetRolepermissions_Handler,
},
{
MethodName: "GetRolepermission",
Handler: _Rolepermission_GetRolepermission_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "proto/rpc/v3/rolepermission.proto",
}

View File

@@ -0,0 +1,274 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.1
// protoc v3.19.1
// source: proto/rpc/v3/user.proto
package rpcv3
import (
v3 "github.com/RafaySystems/rcloud-base/components/usermgmt/proto/types/userpb/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"
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 DeleteUserResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *DeleteUserResponse) Reset() {
*x = DeleteUserResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_rpc_v3_user_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DeleteUserResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DeleteUserResponse) ProtoMessage() {}
func (x *DeleteUserResponse) ProtoReflect() protoreflect.Message {
mi := &file_proto_rpc_v3_user_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 DeleteUserResponse.ProtoReflect.Descriptor instead.
func (*DeleteUserResponse) Descriptor() ([]byte, []int) {
return file_proto_rpc_v3_user_proto_rawDescGZIP(), []int{0}
}
var File_proto_rpc_v3_user_proto protoreflect.FileDescriptor
var file_proto_rpc_v3_user_proto_rawDesc = []byte{
0x0a, 0x17, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x33, 0x2f, 0x75,
0x73, 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,
0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x75, 0x73, 0x65,
0x72, 0x70, 0x62, 0x2f, 0x76, 0x33, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x22, 0x14, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x91, 0x0a, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72,
0x12, 0xdf, 0x01, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12,
0x1d, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65,
0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x1a, 0x1d,
0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73,
0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x92, 0x01,
0x92, 0x41, 0x36, 0x4a, 0x34, 0x0a, 0x03, 0x32, 0x30, 0x31, 0x12, 0x2d, 0x0a, 0x2b, 0x52, 0x65,
0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x75, 0x73, 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, 0x53, 0x22,
0x4e, 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, 0x75, 0x73, 0x65, 0x72, 0x73, 0x3a,
0x01, 0x2a, 0x12, 0xa4, 0x01, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12,
0x1d, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65,
0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x1a, 0x21,
0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73,
0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73,
0x74, 0x22, 0x56, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x50, 0x12, 0x4e, 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, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x8f, 0x02, 0x0a, 0x07, 0x47, 0x65,
0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1d, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65,
0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e,
0x55, 0x73, 0x65, 0x72, 0x1a, 0x1d, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76,
0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x55,
0x73, 0x65, 0x72, 0x22, 0xc5, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0xbe, 0x01, 0x12, 0x5d, 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, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x7b, 0x6d, 0x65,
0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x5a, 0x5d, 0x12, 0x5b,
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, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x7b, 0x6d,
0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x69, 0x64, 0x7d, 0x12, 0x98, 0x02, 0x0a, 0x0a,
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1d, 0x2e, 0x72, 0x61, 0x66,
0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65,
0x72, 0x2e, 0x76, 0x33, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x1a, 0x1d, 0x2e, 0x72, 0x61, 0x66, 0x61,
0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72,
0x2e, 0x76, 0x33, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0xcb, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02,
0xc4, 0x01, 0x1a, 0x5d, 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, 0x75, 0x73, 0x65,
0x72, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6e, 0x61, 0x6d, 0x65,
0x7d, 0x3a, 0x01, 0x2a, 0x5a, 0x60, 0x1a, 0x5b, 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, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x7b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e,
0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0xd2, 0x02, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74,
0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1d, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65,
0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e,
0x55, 0x73, 0x65, 0x72, 0x1a, 0x24, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76,
0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x33, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73,
0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xfe, 0x01, 0x92, 0x41, 0x36,
0x4a, 0x34, 0x0a, 0x03, 0x32, 0x30, 0x34, 0x12, 0x2d, 0x0a, 0x2b, 0x52, 0x65, 0x74, 0x75, 0x72,
0x6e, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x75, 0x73, 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, 0xbe, 0x01, 0x2a, 0x5d, 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, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x7b, 0x6d, 0x65,
0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x5a, 0x5d, 0x2a, 0x5b,
0x2f, 0x61, 0x75, 0x74, 0x68, 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, 0x76, 0x33, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x7b, 0x6d,
0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x69, 0x64, 0x7d, 0x42, 0xca, 0x04, 0x0a, 0x14,
0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x70,
0x63, 0x2e, 0x76, 0x33, 0x42, 0x09, 0x55, 0x73, 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, 0x75, 0x73, 0x65, 0x72, 0x6d, 0x67, 0x6d, 0x74, 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,
0xe2, 0x02, 0x12, 0x2b, 0x0a, 0x17, 0x55, 0x73, 0x65, 0x72, 0x20, 0x6d, 0x61, 0x6e, 0x61, 0x67,
0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x0b, 0x0a,
0x09, 0x52, 0x61, 0x66, 0x61, 0x79, 0x20, 0x44, 0x65, 0x76, 0x32, 0x03, 0x32, 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_user_proto_rawDescOnce sync.Once
file_proto_rpc_v3_user_proto_rawDescData = file_proto_rpc_v3_user_proto_rawDesc
)
func file_proto_rpc_v3_user_proto_rawDescGZIP() []byte {
file_proto_rpc_v3_user_proto_rawDescOnce.Do(func() {
file_proto_rpc_v3_user_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_rpc_v3_user_proto_rawDescData)
})
return file_proto_rpc_v3_user_proto_rawDescData
}
var file_proto_rpc_v3_user_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_proto_rpc_v3_user_proto_goTypes = []interface{}{
(*DeleteUserResponse)(nil), // 0: rafay.dev.rpc.v3.DeleteUserResponse
(*v3.User)(nil), // 1: rafay.dev.types.user.v3.User
(*v3.UserList)(nil), // 2: rafay.dev.types.user.v3.UserList
}
var file_proto_rpc_v3_user_proto_depIdxs = []int32{
1, // 0: rafay.dev.rpc.v3.User.CreateUser:input_type -> rafay.dev.types.user.v3.User
1, // 1: rafay.dev.rpc.v3.User.GetUsers:input_type -> rafay.dev.types.user.v3.User
1, // 2: rafay.dev.rpc.v3.User.GetUser:input_type -> rafay.dev.types.user.v3.User
1, // 3: rafay.dev.rpc.v3.User.UpdateUser:input_type -> rafay.dev.types.user.v3.User
1, // 4: rafay.dev.rpc.v3.User.DeleteUser:input_type -> rafay.dev.types.user.v3.User
1, // 5: rafay.dev.rpc.v3.User.CreateUser:output_type -> rafay.dev.types.user.v3.User
2, // 6: rafay.dev.rpc.v3.User.GetUsers:output_type -> rafay.dev.types.user.v3.UserList
1, // 7: rafay.dev.rpc.v3.User.GetUser:output_type -> rafay.dev.types.user.v3.User
1, // 8: rafay.dev.rpc.v3.User.UpdateUser:output_type -> rafay.dev.types.user.v3.User
0, // 9: rafay.dev.rpc.v3.User.DeleteUser:output_type -> rafay.dev.rpc.v3.DeleteUserResponse
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_user_proto_init() }
func file_proto_rpc_v3_user_proto_init() {
if File_proto_rpc_v3_user_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_proto_rpc_v3_user_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DeleteUserResponse); 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_rpc_v3_user_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_proto_rpc_v3_user_proto_goTypes,
DependencyIndexes: file_proto_rpc_v3_user_proto_depIdxs,
MessageInfos: file_proto_rpc_v3_user_proto_msgTypes,
}.Build()
File_proto_rpc_v3_user_proto = out.File
file_proto_rpc_v3_user_proto_rawDesc = nil
file_proto_rpc_v3_user_proto_goTypes = nil
file_proto_rpc_v3_user_proto_depIdxs = nil
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,128 @@
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/userpb/v3/user.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 : "User management Service"
version : "2.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}}
}
}
};
message DeleteUserResponse {}
service User {
rpc CreateUser(rafay.dev.types.user.v3.User)
returns (rafay.dev.types.user.v3.User) {
option (google.api.http) = {
post : "/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/users"
body : "*"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
responses : {
key : "201"
value : {description : "Returned when user is created successfully."}
}
};
};
rpc GetUsers(rafay.dev.types.user.v3.User) returns (rafay.dev.types.user.v3.UserList) {
option (google.api.http) = {
get : "/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/users"
};
};
rpc GetUser(rafay.dev.types.user.v3.User) returns (rafay.dev.types.user.v3.User) {
option (google.api.http) = {
get : "/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/user/{metadata.name}"
additional_bindings {
get : "/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/user/{metadata.id}"
}
};
};
rpc UpdateUser(rafay.dev.types.user.v3.User) returns (rafay.dev.types.user.v3.User) {
option (google.api.http) = {
put : "/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/user/{metadata.name}"
body : "*"
additional_bindings {
put : "/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/user/{metadata.id}"
body : "*"
}
};
};
rpc DeleteUser(rafay.dev.types.user.v3.User) returns (DeleteUserResponse) {
option (google.api.http) = {
delete : "/auth/v3/partner/{metadata.partner}/organization/{metadata.organization}/user/{metadata.name}"
additional_bindings {
delete : "/auth/partner/{metadata.partner}/organization/{metadata.organization}/v3/user/{metadata.id}"
}
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
responses : {
key : "204"
value : {
description : "Returned when user is deleted successfully."
}
}
};
};
}

View File

@@ -0,0 +1,248 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v3.19.1
// source: proto/rpc/v3/user.proto
package rpcv3
import (
context "context"
v3 "github.com/RafaySystems/rcloud-base/components/usermgmt/proto/types/userpb/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
// UserClient is the client API for User 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 UserClient interface {
CreateUser(ctx context.Context, in *v3.User, opts ...grpc.CallOption) (*v3.User, error)
GetUsers(ctx context.Context, in *v3.User, opts ...grpc.CallOption) (*v3.UserList, error)
GetUser(ctx context.Context, in *v3.User, opts ...grpc.CallOption) (*v3.User, error)
UpdateUser(ctx context.Context, in *v3.User, opts ...grpc.CallOption) (*v3.User, error)
DeleteUser(ctx context.Context, in *v3.User, opts ...grpc.CallOption) (*DeleteUserResponse, error)
}
type userClient struct {
cc grpc.ClientConnInterface
}
func NewUserClient(cc grpc.ClientConnInterface) UserClient {
return &userClient{cc}
}
func (c *userClient) CreateUser(ctx context.Context, in *v3.User, opts ...grpc.CallOption) (*v3.User, error) {
out := new(v3.User)
err := c.cc.Invoke(ctx, "/rafay.dev.rpc.v3.User/CreateUser", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userClient) GetUsers(ctx context.Context, in *v3.User, opts ...grpc.CallOption) (*v3.UserList, error) {
out := new(v3.UserList)
err := c.cc.Invoke(ctx, "/rafay.dev.rpc.v3.User/GetUsers", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userClient) GetUser(ctx context.Context, in *v3.User, opts ...grpc.CallOption) (*v3.User, error) {
out := new(v3.User)
err := c.cc.Invoke(ctx, "/rafay.dev.rpc.v3.User/GetUser", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userClient) UpdateUser(ctx context.Context, in *v3.User, opts ...grpc.CallOption) (*v3.User, error) {
out := new(v3.User)
err := c.cc.Invoke(ctx, "/rafay.dev.rpc.v3.User/UpdateUser", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userClient) DeleteUser(ctx context.Context, in *v3.User, opts ...grpc.CallOption) (*DeleteUserResponse, error) {
out := new(DeleteUserResponse)
err := c.cc.Invoke(ctx, "/rafay.dev.rpc.v3.User/DeleteUser", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// UserServer is the server API for User service.
// All implementations should embed UnimplementedUserServer
// for forward compatibility
type UserServer interface {
CreateUser(context.Context, *v3.User) (*v3.User, error)
GetUsers(context.Context, *v3.User) (*v3.UserList, error)
GetUser(context.Context, *v3.User) (*v3.User, error)
UpdateUser(context.Context, *v3.User) (*v3.User, error)
DeleteUser(context.Context, *v3.User) (*DeleteUserResponse, error)
}
// UnimplementedUserServer should be embedded to have forward compatible implementations.
type UnimplementedUserServer struct {
}
func (UnimplementedUserServer) CreateUser(context.Context, *v3.User) (*v3.User, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateUser not implemented")
}
func (UnimplementedUserServer) GetUsers(context.Context, *v3.User) (*v3.UserList, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetUsers not implemented")
}
func (UnimplementedUserServer) GetUser(context.Context, *v3.User) (*v3.User, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetUser not implemented")
}
func (UnimplementedUserServer) UpdateUser(context.Context, *v3.User) (*v3.User, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateUser not implemented")
}
func (UnimplementedUserServer) DeleteUser(context.Context, *v3.User) (*DeleteUserResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteUser not implemented")
}
// UnsafeUserServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to UserServer will
// result in compilation errors.
type UnsafeUserServer interface {
mustEmbedUnimplementedUserServer()
}
func RegisterUserServer(s grpc.ServiceRegistrar, srv UserServer) {
s.RegisterService(&User_ServiceDesc, srv)
}
func _User_CreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v3.User)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServer).CreateUser(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/rafay.dev.rpc.v3.User/CreateUser",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServer).CreateUser(ctx, req.(*v3.User))
}
return interceptor(ctx, in, info, handler)
}
func _User_GetUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v3.User)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServer).GetUsers(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/rafay.dev.rpc.v3.User/GetUsers",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServer).GetUsers(ctx, req.(*v3.User))
}
return interceptor(ctx, in, info, handler)
}
func _User_GetUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v3.User)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServer).GetUser(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/rafay.dev.rpc.v3.User/GetUser",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServer).GetUser(ctx, req.(*v3.User))
}
return interceptor(ctx, in, info, handler)
}
func _User_UpdateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v3.User)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServer).UpdateUser(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/rafay.dev.rpc.v3.User/UpdateUser",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServer).UpdateUser(ctx, req.(*v3.User))
}
return interceptor(ctx, in, info, handler)
}
func _User_DeleteUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v3.User)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServer).DeleteUser(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/rafay.dev.rpc.v3.User/DeleteUser",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServer).DeleteUser(ctx, req.(*v3.User))
}
return interceptor(ctx, in, info, handler)
}
// User_ServiceDesc is the grpc.ServiceDesc for User service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var User_ServiceDesc = grpc.ServiceDesc{
ServiceName: "rafay.dev.rpc.v3.User",
HandlerType: (*UserServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "CreateUser",
Handler: _User_CreateUser_Handler,
},
{
MethodName: "GetUsers",
Handler: _User_GetUsers_Handler,
},
{
MethodName: "GetUser",
Handler: _User_GetUser_Handler,
},
{
MethodName: "UpdateUser",
Handler: _User_UpdateUser_Handler,
},
{
MethodName: "DeleteUser",
Handler: _User_DeleteUser_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "proto/rpc/v3/user.proto",
}

View File

@@ -0,0 +1,550 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.1
// protoc v3.19.1
// source: proto/types/userpb/v3/group.proto
package userv3
import (
_ "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/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 Group 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 *GroupSpec `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 *Group) Reset() {
*x = Group{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_types_userpb_v3_group_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Group) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Group) ProtoMessage() {}
func (x *Group) ProtoReflect() protoreflect.Message {
mi := &file_proto_types_userpb_v3_group_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 Group.ProtoReflect.Descriptor instead.
func (*Group) Descriptor() ([]byte, []int) {
return file_proto_types_userpb_v3_group_proto_rawDescGZIP(), []int{0}
}
func (x *Group) GetApiVersion() string {
if x != nil {
return x.ApiVersion
}
return ""
}
func (x *Group) GetKind() string {
if x != nil {
return x.Kind
}
return ""
}
func (x *Group) GetMetadata() *v3.Metadata {
if x != nil {
return x.Metadata
}
return nil
}
func (x *Group) GetSpec() *GroupSpec {
if x != nil {
return x.Spec
}
return nil
}
func (x *Group) GetStatus() *v3.Status {
if x != nil {
return x.Status
}
return nil
}
type ProjectNamespaceRole struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Project *string `protobuf:"bytes,1,opt,name=project,proto3,oneof" json:"project,omitempty"`
Namespace *int64 `protobuf:"varint,2,opt,name=namespace,proto3,oneof" json:"namespace,omitempty"`
Role string `protobuf:"bytes,3,opt,name=role,proto3" json:"role,omitempty"`
}
func (x *ProjectNamespaceRole) Reset() {
*x = ProjectNamespaceRole{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_types_userpb_v3_group_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ProjectNamespaceRole) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ProjectNamespaceRole) ProtoMessage() {}
func (x *ProjectNamespaceRole) ProtoReflect() protoreflect.Message {
mi := &file_proto_types_userpb_v3_group_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 ProjectNamespaceRole.ProtoReflect.Descriptor instead.
func (*ProjectNamespaceRole) Descriptor() ([]byte, []int) {
return file_proto_types_userpb_v3_group_proto_rawDescGZIP(), []int{1}
}
func (x *ProjectNamespaceRole) GetProject() string {
if x != nil && x.Project != nil {
return *x.Project
}
return ""
}
func (x *ProjectNamespaceRole) GetNamespace() int64 {
if x != nil && x.Namespace != nil {
return *x.Namespace
}
return 0
}
func (x *ProjectNamespaceRole) GetRole() string {
if x != nil {
return x.Role
}
return ""
}
type GroupSpec struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Projectnamespaceroles []*ProjectNamespaceRole `protobuf:"bytes,1,rep,name=projectnamespaceroles,proto3" json:"projectnamespaceroles,omitempty"`
Users []string `protobuf:"bytes,2,rep,name=users,proto3" json:"users,omitempty"`
Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`
}
func (x *GroupSpec) Reset() {
*x = GroupSpec{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_types_userpb_v3_group_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GroupSpec) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GroupSpec) ProtoMessage() {}
func (x *GroupSpec) ProtoReflect() protoreflect.Message {
mi := &file_proto_types_userpb_v3_group_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 GroupSpec.ProtoReflect.Descriptor instead.
func (*GroupSpec) Descriptor() ([]byte, []int) {
return file_proto_types_userpb_v3_group_proto_rawDescGZIP(), []int{2}
}
func (x *GroupSpec) GetProjectnamespaceroles() []*ProjectNamespaceRole {
if x != nil {
return x.Projectnamespaceroles
}
return nil
}
func (x *GroupSpec) GetUsers() []string {
if x != nil {
return x.Users
}
return nil
}
func (x *GroupSpec) GetType() string {
if x != nil {
return x.Type
}
return ""
}
type GroupList 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 []*Group `protobuf:"bytes,4,rep,name=items,proto3" json:"items,omitempty"`
}
func (x *GroupList) Reset() {
*x = GroupList{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_types_userpb_v3_group_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GroupList) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GroupList) ProtoMessage() {}
func (x *GroupList) ProtoReflect() protoreflect.Message {
mi := &file_proto_types_userpb_v3_group_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 GroupList.ProtoReflect.Descriptor instead.
func (*GroupList) Descriptor() ([]byte, []int) {
return file_proto_types_userpb_v3_group_proto_rawDescGZIP(), []int{3}
}
func (x *GroupList) GetApiVersion() string {
if x != nil {
return x.ApiVersion
}
return ""
}
func (x *GroupList) GetKind() string {
if x != nil {
return x.Kind
}
return ""
}
func (x *GroupList) GetMetadata() *v3.ListMetadata {
if x != nil {
return x.Metadata
}
return nil
}
func (x *GroupList) GetItems() []*Group {
if x != nil {
return x.Items
}
return nil
}
var File_proto_types_userpb_v3_group_proto protoreflect.FileDescriptor
var file_proto_types_userpb_v3_group_proto_rawDesc = []byte{
0x0a, 0x21, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x75, 0x73,
0x65, 0x72, 0x70, 0x62, 0x2f, 0x76, 0x33, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x12, 0x17, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74,
0x79, 0x70, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 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, 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, 0x1a, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2f, 0x76, 0x33,
0x2f, 0x72, 0x6f, 0x6c, 0x65, 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, 0xaa, 0x04, 0x0a, 0x05,
0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x6b, 0x0a, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73,
0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x4b, 0x92, 0x41, 0x48, 0x2a, 0x0b,
0x41, 0x50, 0x49, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x32, 0x21, 0x41, 0x50, 0x49,
0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20,
0x67, 0x72, 0x6f, 0x75, 0x70, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3a, 0x16,
0x75, 0x73, 0x65, 0x72, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x6b, 0x38, 0x73, 0x6d, 0x67, 0x6d, 0x74,
0x2e, 0x69, 0x6f, 0x2f, 0x76, 0x33, 0x52, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69,
0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x42, 0x2c, 0x92, 0x41, 0x29, 0x2a, 0x04, 0x4b, 0x69, 0x6e, 0x64, 0x32, 0x1a, 0x4b, 0x69, 0x6e,
0x64, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x20, 0x72,
0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3a, 0x05, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x04,
0x6b, 0x69, 0x6e, 0x64, 0x12, 0x6e, 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, 0x2d, 0x92, 0x41, 0x2a,
0x2a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x32, 0x1e, 0x4d, 0x65, 0x74, 0x61,
0x64, 0x61, 0x74, 0x61, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x72, 0x6f, 0x75,
0x70, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61,
0x64, 0x61, 0x74, 0x61, 0x12, 0x65, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x04, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x22, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74,
0x79, 0x70, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x72, 0x6f,
0x75, 0x70, 0x53, 0x70, 0x65, 0x63, 0x42, 0x2d, 0x92, 0x41, 0x2a, 0x2a, 0x08, 0x4d, 0x65, 0x74,
0x61, 0x64, 0x61, 0x74, 0x61, 0x32, 0x1e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x20,
0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x72, 0x6f, 0x75, 0x70, 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, 0x39, 0x92,
0x41, 0x36, 0x0a, 0x34, 0x2a, 0x05, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x32, 0x05, 0x47, 0x72, 0x6f,
0x75, 0x70, 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, 0x9a, 0x02, 0x0a, 0x14, 0x50, 0x72, 0x6f,
0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x6f, 0x6c,
0x65, 0x12, 0x34, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x42, 0x15, 0x92, 0x41, 0x12, 0x2a, 0x07, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,
0x32, 0x07, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x00, 0x52, 0x07, 0x70, 0x72, 0x6f,
0x6a, 0x65, 0x63, 0x74, 0x88, 0x01, 0x01, 0x12, 0x3c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73,
0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x19, 0x92, 0x41, 0x16, 0x2a,
0x09, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x32, 0x09, 0x4e, 0x61, 0x6d, 0x65,
0x73, 0x70, 0x61, 0x63, 0x65, 0x48, 0x01, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61,
0x63, 0x65, 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x03, 0x20,
0x01, 0x28, 0x09, 0x42, 0x0f, 0x92, 0x41, 0x0c, 0x2a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x32, 0x04,
0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x3a, 0x4f, 0x92, 0x41, 0x4c, 0x0a,
0x4a, 0x2a, 0x14, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70,
0x61, 0x63, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x32, 0x32, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,
0x2c, 0x20, 0x72, 0x6f, 0x6c, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73,
0x70, 0x61, 0x63, 0x65, 0x20, 0x70, 0x61, 0x69, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x66, 0x6f, 0x72,
0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x0a, 0x0a, 0x08, 0x5f,
0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x6e, 0x61, 0x6d, 0x65,
0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0xd8, 0x02, 0x0a, 0x09, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x53,
0x70, 0x65, 0x63, 0x12, 0xb0, 0x01, 0x0a, 0x15, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x6e,
0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e,
0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x72,
0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x6f,
0x6c, 0x65, 0x42, 0x4b, 0x92, 0x41, 0x48, 0x2a, 0x15, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,
0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x32, 0x2f,
0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61,
0x63, 0x65, 0x2c, 0x20, 0x72, 0x6f, 0x6c, 0x65, 0x20, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x52,
0x15, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63,
0x65, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18,
0x02, 0x20, 0x03, 0x28, 0x09, 0x42, 0x23, 0x92, 0x41, 0x20, 0x2a, 0x05, 0x55, 0x73, 0x65, 0x72,
0x73, 0x32, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x75, 0x73, 0x65, 0x72, 0x73,
0x20, 0x66, 0x6f, 0x72, 0x20, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72,
0x73, 0x12, 0x2c, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42,
0x18, 0x92, 0x41, 0x15, 0x2a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x32, 0x0d, 0x54, 0x79, 0x70, 0x65,
0x20, 0x6f, 0x66, 0x20, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x3a,
0x2f, 0x92, 0x41, 0x2c, 0x0a, 0x2a, 0x2a, 0x13, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x20, 0x53, 0x70,
0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x13, 0x47, 0x72, 0x6f,
0x75, 0x70, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x22, 0xa5, 0x03, 0x0a, 0x09, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x5a,
0x0a, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x42, 0x3a, 0x92, 0x41, 0x37, 0x2a, 0x0b, 0x41, 0x50, 0x49, 0x20, 0x56, 0x65, 0x72,
0x73, 0x69, 0x6f, 0x6e, 0x32, 0x26, 0x41, 0x50, 0x49, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f,
0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x20, 0x6c,
0x69, 0x73, 0x74, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x40, 0x01, 0x52, 0x0a,
0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x04, 0x6b, 0x69,
0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2c, 0x92, 0x41, 0x29, 0x2a, 0x04, 0x4b,
0x69, 0x6e, 0x64, 0x32, 0x1f, 0x4b, 0x69, 0x6e, 0x64, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65,
0x20, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x72, 0x65, 0x73, 0x6f,
0x75, 0x72, 0x63, 0x65, 0x40, 0x01, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x79, 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, 0x34, 0x92, 0x41, 0x31, 0x2a, 0x08, 0x4d, 0x65,
0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x32, 0x23, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,
0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x72, 0x6f, 0x75, 0x70, 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, 0x5f, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73,
0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64,
0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33,
0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x29, 0x92, 0x41, 0x26, 0x2a, 0x05, 0x49, 0x74, 0x65,
0x6d, 0x73, 0x32, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20,
0x67, 0x72, 0x6f, 0x75, 0x70, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x40,
0x01, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x3a, 0x1e, 0x92, 0x41, 0x1b, 0x0a, 0x19, 0x2a,
0x09, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x32, 0x0a, 0x47, 0x72, 0x6f, 0x75,
0x70, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x40, 0x01, 0x42, 0x80, 0x02, 0x0a, 0x1b, 0x63, 0x6f, 0x6d,
0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73,
0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x42, 0x0a, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x50,
0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x54, 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, 0x75, 0x73, 0x65, 0x72, 0x6d, 0x67, 0x6d, 0x74, 0x2f,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x75, 0x73, 0x65, 0x72,
0x70, 0x62, 0x2f, 0x76, 0x33, 0x3b, 0x75, 0x73, 0x65, 0x72, 0x76, 0x33, 0xa2, 0x02, 0x04, 0x52,
0x44, 0x54, 0x55, 0xaa, 0x02, 0x17, 0x52, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x44, 0x65, 0x76, 0x2e,
0x54, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x2e, 0x56, 0x33, 0xca, 0x02, 0x17,
0x52, 0x61, 0x66, 0x61, 0x79, 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c,
0x55, 0x73, 0x65, 0x72, 0x5c, 0x56, 0x33, 0xe2, 0x02, 0x23, 0x52, 0x61, 0x66, 0x61, 0x79, 0x5c,
0x44, 0x65, 0x76, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x55, 0x73, 0x65, 0x72, 0x5c, 0x56,
0x33, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1b,
0x52, 0x61, 0x66, 0x61, 0x79, 0x3a, 0x3a, 0x44, 0x65, 0x76, 0x3a, 0x3a, 0x54, 0x79, 0x70, 0x65,
0x73, 0x3a, 0x3a, 0x55, 0x73, 0x65, 0x72, 0x3a, 0x3a, 0x56, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
}
var (
file_proto_types_userpb_v3_group_proto_rawDescOnce sync.Once
file_proto_types_userpb_v3_group_proto_rawDescData = file_proto_types_userpb_v3_group_proto_rawDesc
)
func file_proto_types_userpb_v3_group_proto_rawDescGZIP() []byte {
file_proto_types_userpb_v3_group_proto_rawDescOnce.Do(func() {
file_proto_types_userpb_v3_group_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_types_userpb_v3_group_proto_rawDescData)
})
return file_proto_types_userpb_v3_group_proto_rawDescData
}
var file_proto_types_userpb_v3_group_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_proto_types_userpb_v3_group_proto_goTypes = []interface{}{
(*Group)(nil), // 0: rafay.dev.types.user.v3.Group
(*ProjectNamespaceRole)(nil), // 1: rafay.dev.types.user.v3.ProjectNamespaceRole
(*GroupSpec)(nil), // 2: rafay.dev.types.user.v3.GroupSpec
(*GroupList)(nil), // 3: rafay.dev.types.user.v3.GroupList
(*v3.Metadata)(nil), // 4: rafay.dev.types.common.v3.Metadata
(*v3.Status)(nil), // 5: rafay.dev.types.common.v3.Status
(*v3.ListMetadata)(nil), // 6: rafay.dev.types.common.v3.ListMetadata
}
var file_proto_types_userpb_v3_group_proto_depIdxs = []int32{
4, // 0: rafay.dev.types.user.v3.Group.metadata:type_name -> rafay.dev.types.common.v3.Metadata
2, // 1: rafay.dev.types.user.v3.Group.spec:type_name -> rafay.dev.types.user.v3.GroupSpec
5, // 2: rafay.dev.types.user.v3.Group.status:type_name -> rafay.dev.types.common.v3.Status
1, // 3: rafay.dev.types.user.v3.GroupSpec.projectnamespaceroles:type_name -> rafay.dev.types.user.v3.ProjectNamespaceRole
6, // 4: rafay.dev.types.user.v3.GroupList.metadata:type_name -> rafay.dev.types.common.v3.ListMetadata
0, // 5: rafay.dev.types.user.v3.GroupList.items:type_name -> rafay.dev.types.user.v3.Group
6, // [6:6] is the sub-list for method output_type
6, // [6:6] is the sub-list for method input_type
6, // [6:6] is the sub-list for extension type_name
6, // [6:6] is the sub-list for extension extendee
0, // [0:6] is the sub-list for field type_name
}
func init() { file_proto_types_userpb_v3_group_proto_init() }
func file_proto_types_userpb_v3_group_proto_init() {
if File_proto_types_userpb_v3_group_proto != nil {
return
}
file_proto_types_userpb_v3_role_proto_init()
if !protoimpl.UnsafeEnabled {
file_proto_types_userpb_v3_group_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Group); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_types_userpb_v3_group_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ProjectNamespaceRole); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_types_userpb_v3_group_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GroupSpec); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_types_userpb_v3_group_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GroupList); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
file_proto_types_userpb_v3_group_proto_msgTypes[1].OneofWrappers = []interface{}{}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_proto_types_userpb_v3_group_proto_rawDesc,
NumEnums: 0,
NumMessages: 4,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_proto_types_userpb_v3_group_proto_goTypes,
DependencyIndexes: file_proto_types_userpb_v3_group_proto_depIdxs,
MessageInfos: file_proto_types_userpb_v3_group_proto_msgTypes,
}.Build()
File_proto_types_userpb_v3_group_proto = out.File
file_proto_types_userpb_v3_group_proto_rawDesc = nil
file_proto_types_userpb_v3_group_proto_goTypes = nil
file_proto_types_userpb_v3_group_proto_depIdxs = nil
}

View File

@@ -0,0 +1,129 @@
syntax = "proto3";
package rafay.dev.types.user.v3;
import "proto/types/commonpb/v3/common.proto";
import "proto/types/systempb/v3/project.proto";
import "proto/types/userpb/v3/role.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
// import "google/api/field_behavior.proto";
message Group {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
json_schema : {
title : "Group"
description : "Group"
required : [ "apiVersion", "kind", "metadata", "spec" ]
}
};
string apiVersion = 1
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "API Version",
description : "API Version of the group resource"
default : "usermgmt.k8smgmt.io/v3"
} ];
string kind = 2
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "Kind",
description : "Kind of the group resource"
default : "Group"
} ];
rafay.dev.types.common.v3.Metadata metadata = 3
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "Metadata",
description : "Metadata of the group resource"
} ];
GroupSpec spec = 4
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "Metadata",
description : "Metadata of the group 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 ProjectNamespaceRole {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
json_schema : {
title : "ProjectNamespaceRole"
description : "Project, role and namespace pairing for permission"
}
};
optional string project = 1
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "Project"
description : "Project"
} ];
optional int64 namespace = 2
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "Namespace"
description : "Namespace"
} ];
string role = 3
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "Role"
description : "Role"
} ];
}
message GroupSpec {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
json_schema : {
title : "Group Specification"
description : "Group specification"
}
};
repeated ProjectNamespaceRole projectnamespaceroles = 1
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "ProjectNamespaceRoles"
description : "Project, namespace, role associations for group"
} ];
repeated string users = 2
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "Users"
description : "List of users for group"
} ];
string type = 3
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "Type"
description : "Type of group"
} ];
}
message GroupList {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
json_schema : {
title : "GroupList"
description : "Group list"
read_only : true
}
};
string apiVersion = 1
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "API Version",
description : "API Version of the group list resource"
read_only : true
} ];
string kind = 2
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "Kind",
description : "Kind of the group list resource"
read_only : true
} ];
rafay.dev.types.common.v3.ListMetadata metadata = 3
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "Metadata",
description : "Metadata of the group list resource"
read_only : true
} ];
repeated Group items = 4
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "Items",
description : "List of the group resources"
read_only : true
} ];
}

View File

@@ -0,0 +1,449 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.1
// protoc v3.19.1
// source: proto/types/userpb/v3/role.proto
package userv3
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 Role 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 *RoleSpec `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 *Role) Reset() {
*x = Role{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_types_userpb_v3_role_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Role) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Role) ProtoMessage() {}
func (x *Role) ProtoReflect() protoreflect.Message {
mi := &file_proto_types_userpb_v3_role_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 Role.ProtoReflect.Descriptor instead.
func (*Role) Descriptor() ([]byte, []int) {
return file_proto_types_userpb_v3_role_proto_rawDescGZIP(), []int{0}
}
func (x *Role) GetApiVersion() string {
if x != nil {
return x.ApiVersion
}
return ""
}
func (x *Role) GetKind() string {
if x != nil {
return x.Kind
}
return ""
}
func (x *Role) GetMetadata() *v3.Metadata {
if x != nil {
return x.Metadata
}
return nil
}
func (x *Role) GetSpec() *RoleSpec {
if x != nil {
return x.Spec
}
return nil
}
func (x *Role) GetStatus() *v3.Status {
if x != nil {
return x.Status
}
return nil
}
type RoleSpec struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Rolepermissions []*RolePermission `protobuf:"bytes,1,rep,name=rolepermissions,proto3" json:"rolepermissions,omitempty"`
IsGlobal bool `protobuf:"varint,2,opt,name=isGlobal,proto3" json:"isGlobal,omitempty"`
Scope string `protobuf:"bytes,3,opt,name=scope,proto3" json:"scope,omitempty"`
}
func (x *RoleSpec) Reset() {
*x = RoleSpec{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_types_userpb_v3_role_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RoleSpec) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RoleSpec) ProtoMessage() {}
func (x *RoleSpec) ProtoReflect() protoreflect.Message {
mi := &file_proto_types_userpb_v3_role_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 RoleSpec.ProtoReflect.Descriptor instead.
func (*RoleSpec) Descriptor() ([]byte, []int) {
return file_proto_types_userpb_v3_role_proto_rawDescGZIP(), []int{1}
}
func (x *RoleSpec) GetRolepermissions() []*RolePermission {
if x != nil {
return x.Rolepermissions
}
return nil
}
func (x *RoleSpec) GetIsGlobal() bool {
if x != nil {
return x.IsGlobal
}
return false
}
func (x *RoleSpec) GetScope() string {
if x != nil {
return x.Scope
}
return ""
}
type RoleList 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 []*Role `protobuf:"bytes,4,rep,name=items,proto3" json:"items,omitempty"`
}
func (x *RoleList) Reset() {
*x = RoleList{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_types_userpb_v3_role_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RoleList) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RoleList) ProtoMessage() {}
func (x *RoleList) ProtoReflect() protoreflect.Message {
mi := &file_proto_types_userpb_v3_role_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 RoleList.ProtoReflect.Descriptor instead.
func (*RoleList) Descriptor() ([]byte, []int) {
return file_proto_types_userpb_v3_role_proto_rawDescGZIP(), []int{2}
}
func (x *RoleList) GetApiVersion() string {
if x != nil {
return x.ApiVersion
}
return ""
}
func (x *RoleList) GetKind() string {
if x != nil {
return x.Kind
}
return ""
}
func (x *RoleList) GetMetadata() *v3.ListMetadata {
if x != nil {
return x.Metadata
}
return nil
}
func (x *RoleList) GetItems() []*Role {
if x != nil {
return x.Items
}
return nil
}
var File_proto_types_userpb_v3_role_proto protoreflect.FileDescriptor
var file_proto_types_userpb_v3_role_proto_rawDesc = []byte{
0x0a, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x75, 0x73,
0x65, 0x72, 0x70, 0x62, 0x2f, 0x76, 0x33, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x12, 0x17, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79,
0x70, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 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, 0x2a, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x75,
0x73, 0x65, 0x72, 0x70, 0x62, 0x2f, 0x76, 0x33, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x70, 0x65, 0x72,
0x6d, 0x69, 0x73, 0x73, 0x69, 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, 0x99, 0x04,
0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 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, 0x52, 0x6f, 0x6c, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3a, 0x16,
0x75, 0x73, 0x65, 0x72, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x6b, 0x38, 0x73, 0x6d, 0x67, 0x6d, 0x74,
0x2e, 0x69, 0x6f, 0x2f, 0x76, 0x33, 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, 0x19, 0x4b, 0x69, 0x6e,
0x64, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x6f, 0x6c, 0x65, 0x20, 0x72, 0x65,
0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x6b, 0x69,
0x6e, 0x64, 0x12, 0x6d, 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, 0x2c, 0x92, 0x41, 0x29, 0x2a, 0x08,
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, 0x72, 0x6f, 0x6c, 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,
0x21, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65,
0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x53, 0x70,
0x65, 0x63, 0x42, 0x24, 0x92, 0x41, 0x21, 0x2a, 0x04, 0x53, 0x70, 0x65, 0x63, 0x32, 0x19, 0x53,
0x70, 0x65, 0x63, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x6f, 0x6c, 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, 0x37, 0x92, 0x41, 0x34, 0x0a, 0x32, 0x2a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x32, 0x04, 0x52,
0x6f, 0x6c, 0x65, 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, 0xbe, 0x02, 0x0a, 0x08, 0x52, 0x6f,
0x6c, 0x65, 0x53, 0x70, 0x65, 0x63, 0x12, 0x81, 0x01, 0x0a, 0x0f, 0x72, 0x6f, 0x6c, 0x65, 0x70,
0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x27, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70,
0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x50,
0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x2e, 0x92, 0x41, 0x2b, 0x2a, 0x0f,
0x52, 0x6f, 0x6c, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x32,
0x18, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x66, 0x6f, 0x72,
0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x6f, 0x6c, 0x65, 0x52, 0x0f, 0x72, 0x6f, 0x6c, 0x65, 0x70,
0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x4b, 0x0a, 0x08, 0x69, 0x73,
0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x42, 0x2f, 0x92, 0x41,
0x2c, 0x2a, 0x08, 0x49, 0x73, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x32, 0x20, 0x53, 0x70, 0x65,
0x63, 0x69, 0x66, 0x79, 0x20, 0x69, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20,
0x61, 0x20, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x20, 0x72, 0x6f, 0x6c, 0x65, 0x52, 0x08, 0x69,
0x73, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x12, 0x32, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65,
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1c, 0x92, 0x41, 0x19, 0x2a, 0x05, 0x53, 0x63, 0x6f,
0x70, 0x65, 0x32, 0x10, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65,
0x20, 0x72, 0x6f, 0x6c, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x3a, 0x2d, 0x92, 0x41, 0x2a,
0x0a, 0x28, 0x2a, 0x12, 0x52, 0x6f, 0x6c, 0x65, 0x20, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69,
0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x12, 0x52, 0x6f, 0x6c, 0x65, 0x20, 0x73, 0x70, 0x65,
0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x99, 0x03, 0x0a, 0x08, 0x52,
0x6f, 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x59, 0x0a, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65,
0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x39, 0x92, 0x41, 0x36,
0x2a, 0x0b, 0x41, 0x50, 0x49, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x32, 0x25, 0x41,
0x50, 0x49, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68,
0x65, 0x20, 0x72, 0x6f, 0x6c, 0x65, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x72, 0x65, 0x73, 0x6f,
0x75, 0x72, 0x63, 0x65, 0x40, 0x01, 0x52, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69,
0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x42, 0x2b, 0x92, 0x41, 0x28, 0x2a, 0x04, 0x4b, 0x69, 0x6e, 0x64, 0x32, 0x1e, 0x4b, 0x69, 0x6e,
0x64, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x6f, 0x6c, 0x65, 0x20, 0x6c, 0x69,
0x73, 0x74, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x40, 0x01, 0x52, 0x04, 0x6b,
0x69, 0x6e, 0x64, 0x12, 0x78, 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, 0x33,
0x92, 0x41, 0x30, 0x2a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x32, 0x22, 0x4d,
0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72,
0x6f, 0x6c, 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, 0x59, 0x0a,
0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x72,
0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x75,
0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x42, 0x24, 0x92, 0x41, 0x21,
0x2a, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x32, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66,
0x20, 0x72, 0x6f, 0x6c, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x40,
0x01, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x3a, 0x1c, 0x92, 0x41, 0x19, 0x0a, 0x17, 0x2a,
0x08, 0x52, 0x6f, 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x32, 0x09, 0x52, 0x6f, 0x6c, 0x65, 0x20,
0x6c, 0x69, 0x73, 0x74, 0x40, 0x01, 0x42, 0xff, 0x01, 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x2e, 0x72,
0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x75,
0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x42, 0x09, 0x52, 0x6f, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74,
0x6f, 0x50, 0x01, 0x5a, 0x54, 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, 0x75, 0x73, 0x65, 0x72, 0x6d, 0x67, 0x6d, 0x74, 0x2f, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2f,
0x76, 0x33, 0x3b, 0x75, 0x73, 0x65, 0x72, 0x76, 0x33, 0xa2, 0x02, 0x04, 0x52, 0x44, 0x54, 0x55,
0xaa, 0x02, 0x17, 0x52, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x44, 0x65, 0x76, 0x2e, 0x54, 0x79, 0x70,
0x65, 0x73, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x2e, 0x56, 0x33, 0xca, 0x02, 0x17, 0x52, 0x61, 0x66,
0x61, 0x79, 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x55, 0x73, 0x65,
0x72, 0x5c, 0x56, 0x33, 0xe2, 0x02, 0x23, 0x52, 0x61, 0x66, 0x61, 0x79, 0x5c, 0x44, 0x65, 0x76,
0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x55, 0x73, 0x65, 0x72, 0x5c, 0x56, 0x33, 0x5c, 0x47,
0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1b, 0x52, 0x61, 0x66,
0x61, 0x79, 0x3a, 0x3a, 0x44, 0x65, 0x76, 0x3a, 0x3a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x3a, 0x3a,
0x55, 0x73, 0x65, 0x72, 0x3a, 0x3a, 0x56, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_proto_types_userpb_v3_role_proto_rawDescOnce sync.Once
file_proto_types_userpb_v3_role_proto_rawDescData = file_proto_types_userpb_v3_role_proto_rawDesc
)
func file_proto_types_userpb_v3_role_proto_rawDescGZIP() []byte {
file_proto_types_userpb_v3_role_proto_rawDescOnce.Do(func() {
file_proto_types_userpb_v3_role_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_types_userpb_v3_role_proto_rawDescData)
})
return file_proto_types_userpb_v3_role_proto_rawDescData
}
var file_proto_types_userpb_v3_role_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_proto_types_userpb_v3_role_proto_goTypes = []interface{}{
(*Role)(nil), // 0: rafay.dev.types.user.v3.Role
(*RoleSpec)(nil), // 1: rafay.dev.types.user.v3.RoleSpec
(*RoleList)(nil), // 2: rafay.dev.types.user.v3.RoleList
(*v3.Metadata)(nil), // 3: rafay.dev.types.common.v3.Metadata
(*v3.Status)(nil), // 4: rafay.dev.types.common.v3.Status
(*RolePermission)(nil), // 5: rafay.dev.types.user.v3.RolePermission
(*v3.ListMetadata)(nil), // 6: rafay.dev.types.common.v3.ListMetadata
}
var file_proto_types_userpb_v3_role_proto_depIdxs = []int32{
3, // 0: rafay.dev.types.user.v3.Role.metadata:type_name -> rafay.dev.types.common.v3.Metadata
1, // 1: rafay.dev.types.user.v3.Role.spec:type_name -> rafay.dev.types.user.v3.RoleSpec
4, // 2: rafay.dev.types.user.v3.Role.status:type_name -> rafay.dev.types.common.v3.Status
5, // 3: rafay.dev.types.user.v3.RoleSpec.rolepermissions:type_name -> rafay.dev.types.user.v3.RolePermission
6, // 4: rafay.dev.types.user.v3.RoleList.metadata:type_name -> rafay.dev.types.common.v3.ListMetadata
0, // 5: rafay.dev.types.user.v3.RoleList.items:type_name -> rafay.dev.types.user.v3.Role
6, // [6:6] is the sub-list for method output_type
6, // [6:6] is the sub-list for method input_type
6, // [6:6] is the sub-list for extension type_name
6, // [6:6] is the sub-list for extension extendee
0, // [0:6] is the sub-list for field type_name
}
func init() { file_proto_types_userpb_v3_role_proto_init() }
func file_proto_types_userpb_v3_role_proto_init() {
if File_proto_types_userpb_v3_role_proto != nil {
return
}
file_proto_types_userpb_v3_rolepermission_proto_init()
if !protoimpl.UnsafeEnabled {
file_proto_types_userpb_v3_role_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Role); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_types_userpb_v3_role_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RoleSpec); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_types_userpb_v3_role_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RoleList); 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_userpb_v3_role_proto_rawDesc,
NumEnums: 0,
NumMessages: 3,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_proto_types_userpb_v3_role_proto_goTypes,
DependencyIndexes: file_proto_types_userpb_v3_role_proto_depIdxs,
MessageInfos: file_proto_types_userpb_v3_role_proto_msgTypes,
}.Build()
File_proto_types_userpb_v3_role_proto = out.File
file_proto_types_userpb_v3_role_proto_rawDesc = nil
file_proto_types_userpb_v3_role_proto_goTypes = nil
file_proto_types_userpb_v3_role_proto_depIdxs = nil
}

View File

@@ -0,0 +1,104 @@
syntax = "proto3";
package rafay.dev.types.user.v3;
import "proto/types/commonpb/v3/common.proto";
import "proto/types/userpb/v3/rolepermission.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
// import "google/api/field_behavior.proto";
message Role {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
json_schema : {
title : "Role"
description : "Role"
required : [ "apiVersion", "kind", "metadata", "spec" ]
}
};
string apiVersion = 1
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "API Version",
description : "API Version of the Role resource"
default : "usermgmt.k8smgmt.io/v3"
} ];
string kind = 2
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "Kind",
description : "Kind of the role resource"
default : "Role"
} ];
rafay.dev.types.common.v3.Metadata metadata = 3
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "Metadata",
description : "Metadata of the role resource"
} ];
RoleSpec spec = 4
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "Spec",
description : "Spec of the role 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 RoleSpec {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
json_schema : {
title : "Role Specification"
description : "Role specification"
}
};
repeated rafay.dev.types.user.v3.RolePermission rolepermissions = 1
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "RolePermissions"
description : "Permissions for the role"
} ];
bool isGlobal = 2
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "IsGlobal"
description : "Specify if this is a global role"
} ];
string scope = 3
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "Scope"
description : "Scope of the rol"
} ];
}
message RoleList {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
json_schema : {
title : "RoleList"
description : "Role list"
read_only : true
}
};
string apiVersion = 1
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "API Version",
description : "API Version of the role list resource"
read_only : true
} ];
string kind = 2
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "Kind",
description : "Kind of the role list resource"
read_only : true
} ];
rafay.dev.types.common.v3.ListMetadata metadata = 3
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "Metadata",
description : "Metadata of the role list resource"
read_only : true
} ];
repeated Role items = 4
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "Items",
description : "List of role resources"
read_only : true
} ];
}

View File

@@ -0,0 +1,431 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.1
// protoc v3.19.1
// source: proto/types/userpb/v3/rolepermission.proto
package userv3
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 RolePermission 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 *RolePermissionSpec `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 *RolePermission) Reset() {
*x = RolePermission{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_types_userpb_v3_rolepermission_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RolePermission) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RolePermission) ProtoMessage() {}
func (x *RolePermission) ProtoReflect() protoreflect.Message {
mi := &file_proto_types_userpb_v3_rolepermission_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 RolePermission.ProtoReflect.Descriptor instead.
func (*RolePermission) Descriptor() ([]byte, []int) {
return file_proto_types_userpb_v3_rolepermission_proto_rawDescGZIP(), []int{0}
}
func (x *RolePermission) GetApiVersion() string {
if x != nil {
return x.ApiVersion
}
return ""
}
func (x *RolePermission) GetKind() string {
if x != nil {
return x.Kind
}
return ""
}
func (x *RolePermission) GetMetadata() *v3.Metadata {
if x != nil {
return x.Metadata
}
return nil
}
func (x *RolePermission) GetSpec() *RolePermissionSpec {
if x != nil {
return x.Spec
}
return nil
}
func (x *RolePermission) GetStatus() *v3.Status {
if x != nil {
return x.Status
}
return nil
}
type RolePermissionSpec struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Permissions []string `protobuf:"bytes,1,rep,name=permissions,proto3" json:"permissions,omitempty"`
}
func (x *RolePermissionSpec) Reset() {
*x = RolePermissionSpec{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_types_userpb_v3_rolepermission_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RolePermissionSpec) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RolePermissionSpec) ProtoMessage() {}
func (x *RolePermissionSpec) ProtoReflect() protoreflect.Message {
mi := &file_proto_types_userpb_v3_rolepermission_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 RolePermissionSpec.ProtoReflect.Descriptor instead.
func (*RolePermissionSpec) Descriptor() ([]byte, []int) {
return file_proto_types_userpb_v3_rolepermission_proto_rawDescGZIP(), []int{1}
}
func (x *RolePermissionSpec) GetPermissions() []string {
if x != nil {
return x.Permissions
}
return nil
}
type RolePermissionList 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 []*RolePermission `protobuf:"bytes,4,rep,name=items,proto3" json:"items,omitempty"`
}
func (x *RolePermissionList) Reset() {
*x = RolePermissionList{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_types_userpb_v3_rolepermission_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RolePermissionList) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RolePermissionList) ProtoMessage() {}
func (x *RolePermissionList) ProtoReflect() protoreflect.Message {
mi := &file_proto_types_userpb_v3_rolepermission_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 RolePermissionList.ProtoReflect.Descriptor instead.
func (*RolePermissionList) Descriptor() ([]byte, []int) {
return file_proto_types_userpb_v3_rolepermission_proto_rawDescGZIP(), []int{2}
}
func (x *RolePermissionList) GetApiVersion() string {
if x != nil {
return x.ApiVersion
}
return ""
}
func (x *RolePermissionList) GetKind() string {
if x != nil {
return x.Kind
}
return ""
}
func (x *RolePermissionList) GetMetadata() *v3.ListMetadata {
if x != nil {
return x.Metadata
}
return nil
}
func (x *RolePermissionList) GetItems() []*RolePermission {
if x != nil {
return x.Items
}
return nil
}
var File_proto_types_userpb_v3_rolepermission_proto protoreflect.FileDescriptor
var file_proto_types_userpb_v3_rolepermission_proto_rawDesc = []byte{
0x0a, 0x2a, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x75, 0x73,
0x65, 0x72, 0x70, 0x62, 0x2f, 0x76, 0x33, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x70, 0x65, 0x72, 0x6d,
0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x17, 0x72, 0x61,
0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x75, 0x73,
0x65, 0x72, 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, 0x80, 0x05, 0x0a, 0x0e,
0x52, 0x6f, 0x6c, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x75,
0x0a, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x42, 0x55, 0x92, 0x41, 0x52, 0x2a, 0x0b, 0x41, 0x50, 0x49, 0x20, 0x56, 0x65, 0x72,
0x73, 0x69, 0x6f, 0x6e, 0x32, 0x2b, 0x41, 0x50, 0x49, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f,
0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x6f, 0x6c, 0x65, 0x20, 0x70, 0x65,
0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
0x65, 0x3a, 0x16, 0x75, 0x73, 0x65, 0x72, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x6b, 0x38, 0x73, 0x6d,
0x67, 0x6d, 0x74, 0x2e, 0x69, 0x6f, 0x2f, 0x76, 0x33, 0x52, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65,
0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x53, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x42, 0x3f, 0x92, 0x41, 0x3c, 0x2a, 0x04, 0x4b, 0x69, 0x6e, 0x64, 0x32, 0x24,
0x4b, 0x69, 0x6e, 0x64, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x6f, 0x6c, 0x65,
0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x72, 0x65, 0x73, 0x6f,
0x75, 0x72, 0x63, 0x65, 0x3a, 0x0e, 0x52, 0x6f, 0x6c, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73,
0x73, 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x78, 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, 0x37, 0x92, 0x41, 0x34, 0x2a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,
0x32, 0x28, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68,
0x65, 0x20, 0x72, 0x6f, 0x6c, 0x65, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f,
0x6e, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61,
0x64, 0x61, 0x74, 0x61, 0x12, 0x78, 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, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x6f, 0x6c,
0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x70, 0x65, 0x63, 0x42,
0x37, 0x92, 0x41, 0x34, 0x2a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x32, 0x28,
0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20,
0x72, 0x6f, 0x6c, 0x65, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 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, 0x4c, 0x92, 0x41, 0x49, 0x0a, 0x47, 0x2a, 0x0e, 0x52, 0x6f, 0x6c, 0x65, 0x50, 0x65, 0x72,
0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x32, 0x0f, 0x52, 0x6f, 0x6c, 0x65, 0x20, 0x50, 0x65,
0x72, 0x6d, 0x69, 0x73, 0x73, 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, 0xa7,
0x01, 0x0a, 0x12, 0x52, 0x6f, 0x6c, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f,
0x6e, 0x53, 0x70, 0x65, 0x63, 0x12, 0x4f, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73,
0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x42, 0x2d, 0x92, 0x41, 0x2a, 0x2a,
0x0b, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x32, 0x1b, 0x4c, 0x69,
0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73,
0x20, 0x66, 0x6f, 0x72, 0x20, 0x72, 0x6f, 0x6c, 0x65, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69,
0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x40, 0x92, 0x41, 0x3d, 0x0a, 0x3b, 0x2a, 0x1c, 0x52,
0x6f, 0x6c, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x53, 0x70,
0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x1b, 0x52, 0x6f, 0x6c,
0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x6f, 0x6e, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69,
0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xee, 0x03, 0x0a, 0x12, 0x52, 0x6f, 0x6c,
0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x12,
0x64, 0x0a, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x42, 0x44, 0x92, 0x41, 0x41, 0x2a, 0x0b, 0x41, 0x50, 0x49, 0x20, 0x56, 0x65,
0x72, 0x73, 0x69, 0x6f, 0x6e, 0x32, 0x30, 0x41, 0x50, 0x49, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69,
0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x6f, 0x6c, 0x65, 0x20, 0x70,
0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x72,
0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x40, 0x01, 0x52, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65,
0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x4a, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x42, 0x36, 0x92, 0x41, 0x33, 0x2a, 0x04, 0x4b, 0x69, 0x6e, 0x64, 0x32, 0x29,
0x4b, 0x69, 0x6e, 0x64, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x6f, 0x6c, 0x65,
0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x69, 0x73, 0x74,
0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x40, 0x01, 0x52, 0x04, 0x6b, 0x69, 0x6e,
0x64, 0x12, 0x83, 0x01, 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, 0x3e, 0x92,
0x41, 0x3b, 0x2a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x32, 0x2d, 0x4d, 0x65,
0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x6f,
0x6c, 0x65, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 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, 0x72, 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, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33,
0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42,
0x33, 0x92, 0x41, 0x30, 0x2a, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x32, 0x25, 0x4c, 0x69, 0x73,
0x74, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x6f, 0x6c, 0x65, 0x20, 0x70, 0x65,
0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
0x65, 0x73, 0x40, 0x01, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x3a, 0x2c, 0x92, 0x41, 0x29,
0x0a, 0x27, 0x2a, 0x12, 0x52, 0x6f, 0x6c, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69,
0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x32, 0x0f, 0x52, 0x6f, 0x6c, 0x65, 0x50, 0x65, 0x4c, 0x69,
0x73, 0x74, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x40, 0x01, 0x42, 0x89, 0x02, 0x0a, 0x1b, 0x63, 0x6f,
0x6d, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65,
0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x42, 0x13, 0x52, 0x6f, 0x6c, 0x65, 0x70,
0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01,
0x5a, 0x54, 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, 0x75, 0x73, 0x65, 0x72, 0x6d, 0x67, 0x6d, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f,
0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2f, 0x76, 0x33, 0x3b,
0x75, 0x73, 0x65, 0x72, 0x76, 0x33, 0xa2, 0x02, 0x04, 0x52, 0x44, 0x54, 0x55, 0xaa, 0x02, 0x17,
0x52, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x44, 0x65, 0x76, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x2e,
0x55, 0x73, 0x65, 0x72, 0x2e, 0x56, 0x33, 0xca, 0x02, 0x17, 0x52, 0x61, 0x66, 0x61, 0x79, 0x5c,
0x44, 0x65, 0x76, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x55, 0x73, 0x65, 0x72, 0x5c, 0x56,
0x33, 0xe2, 0x02, 0x23, 0x52, 0x61, 0x66, 0x61, 0x79, 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x54, 0x79,
0x70, 0x65, 0x73, 0x5c, 0x55, 0x73, 0x65, 0x72, 0x5c, 0x56, 0x33, 0x5c, 0x47, 0x50, 0x42, 0x4d,
0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1b, 0x52, 0x61, 0x66, 0x61, 0x79, 0x3a,
0x3a, 0x44, 0x65, 0x76, 0x3a, 0x3a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x3a, 0x3a, 0x55, 0x73, 0x65,
0x72, 0x3a, 0x3a, 0x56, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_proto_types_userpb_v3_rolepermission_proto_rawDescOnce sync.Once
file_proto_types_userpb_v3_rolepermission_proto_rawDescData = file_proto_types_userpb_v3_rolepermission_proto_rawDesc
)
func file_proto_types_userpb_v3_rolepermission_proto_rawDescGZIP() []byte {
file_proto_types_userpb_v3_rolepermission_proto_rawDescOnce.Do(func() {
file_proto_types_userpb_v3_rolepermission_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_types_userpb_v3_rolepermission_proto_rawDescData)
})
return file_proto_types_userpb_v3_rolepermission_proto_rawDescData
}
var file_proto_types_userpb_v3_rolepermission_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_proto_types_userpb_v3_rolepermission_proto_goTypes = []interface{}{
(*RolePermission)(nil), // 0: rafay.dev.types.user.v3.RolePermission
(*RolePermissionSpec)(nil), // 1: rafay.dev.types.user.v3.RolePermissionSpec
(*RolePermissionList)(nil), // 2: rafay.dev.types.user.v3.RolePermissionList
(*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_userpb_v3_rolepermission_proto_depIdxs = []int32{
3, // 0: rafay.dev.types.user.v3.RolePermission.metadata:type_name -> rafay.dev.types.common.v3.Metadata
1, // 1: rafay.dev.types.user.v3.RolePermission.spec:type_name -> rafay.dev.types.user.v3.RolePermissionSpec
4, // 2: rafay.dev.types.user.v3.RolePermission.status:type_name -> rafay.dev.types.common.v3.Status
5, // 3: rafay.dev.types.user.v3.RolePermissionList.metadata:type_name -> rafay.dev.types.common.v3.ListMetadata
0, // 4: rafay.dev.types.user.v3.RolePermissionList.items:type_name -> rafay.dev.types.user.v3.RolePermission
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_userpb_v3_rolepermission_proto_init() }
func file_proto_types_userpb_v3_rolepermission_proto_init() {
if File_proto_types_userpb_v3_rolepermission_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_proto_types_userpb_v3_rolepermission_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RolePermission); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_types_userpb_v3_rolepermission_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RolePermissionSpec); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_types_userpb_v3_rolepermission_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RolePermissionList); 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_userpb_v3_rolepermission_proto_rawDesc,
NumEnums: 0,
NumMessages: 3,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_proto_types_userpb_v3_rolepermission_proto_goTypes,
DependencyIndexes: file_proto_types_userpb_v3_rolepermission_proto_depIdxs,
MessageInfos: file_proto_types_userpb_v3_rolepermission_proto_msgTypes,
}.Build()
File_proto_types_userpb_v3_rolepermission_proto = out.File
file_proto_types_userpb_v3_rolepermission_proto_rawDesc = nil
file_proto_types_userpb_v3_rolepermission_proto_goTypes = nil
file_proto_types_userpb_v3_rolepermission_proto_depIdxs = nil
}

View File

@@ -0,0 +1,93 @@
syntax = "proto3";
package rafay.dev.types.user.v3;
import "proto/types/commonpb/v3/common.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
// import "google/api/field_behavior.proto";
message RolePermission {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
json_schema : {
title : "RolePermission"
description : "Role Permission"
required : [ "apiVersion", "kind", "metadata", "spec" ]
}
};
string apiVersion = 1
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "API Version",
description : "API Version of the role permission resource"
default : "usermgmt.k8smgmt.io/v3"
} ];
string kind = 2
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "Kind",
description : "Kind of the role permission resource"
default : "RolePermission"
} ];
rafay.dev.types.common.v3.Metadata metadata = 3
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "Metadata",
description : "Metadata of the role permission resource"
} ];
RolePermissionSpec spec = 4
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "Metadata",
description : "Metadata of the role permission 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 RolePermissionSpec {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
json_schema : {
title : "RolePermission Specification"
description : "RolePermisson specification"
}
};
repeated string permissions = 1
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "Permissions"
description : "List of permisions for role"
} ];
}
message RolePermissionList {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
json_schema : {
title : "RolePermissionList"
description : "RolePeList list"
read_only : true
}
};
string apiVersion = 1
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "API Version",
description : "API Version of the role permission list resource"
read_only : true
} ];
string kind = 2
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "Kind",
description : "Kind of the role permission list resource"
read_only : true
} ];
rafay.dev.types.common.v3.ListMetadata metadata = 3
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "Metadata",
description : "Metadata of the role permission list resource"
read_only : true
} ];
repeated RolePermission items = 4
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "Items",
description : "List of the role permission resources"
read_only : true
} ];
}

View File

@@ -0,0 +1,583 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.1
// protoc v3.19.1
// source: proto/types/userpb/v3/user.proto
package userv3
import (
_ "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/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 User 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 *UserSpec `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 *User) Reset() {
*x = User{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_types_userpb_v3_user_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *User) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*User) ProtoMessage() {}
func (x *User) ProtoReflect() protoreflect.Message {
mi := &file_proto_types_userpb_v3_user_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 User.ProtoReflect.Descriptor instead.
func (*User) Descriptor() ([]byte, []int) {
return file_proto_types_userpb_v3_user_proto_rawDescGZIP(), []int{0}
}
func (x *User) GetApiVersion() string {
if x != nil {
return x.ApiVersion
}
return ""
}
func (x *User) GetKind() string {
if x != nil {
return x.Kind
}
return ""
}
func (x *User) GetMetadata() *v3.Metadata {
if x != nil {
return x.Metadata
}
return nil
}
func (x *User) GetSpec() *UserSpec {
if x != nil {
return x.Spec
}
return nil
}
func (x *User) GetStatus() *v3.Status {
if x != nil {
return x.Status
}
return nil
}
type UserSpec struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
FirstName string `protobuf:"bytes,1,opt,name=firstName,proto3" json:"firstName,omitempty"`
LastName string `protobuf:"bytes,2,opt,name=lastName,proto3" json:"lastName,omitempty"`
Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"`
Phone string `protobuf:"bytes,4,opt,name=phone,proto3" json:"phone,omitempty"`
Password string `protobuf:"bytes,5,opt,name=password,proto3" json:"password,omitempty"`
// string totpRequired = 6
// [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
// title : "TotpRequired"
// description : "Flag to specify if TOTP is required"
// } ];
// string totpSecret = 7
// [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
// title : "TotpSecret"
// description : "Secret for TOTP"
// } ];
// repeated rafay.dev.types.user.v3.Role roles = 8
// [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
// title : "Roles"
// description : "Roles of the user"
// } ];
// repeated rafay.dev.types.user.v3.Group groups = 9
// [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
// title : "Group"
// description : "Groups of the user"
// } ];
// repeated rafay.dev.types.system.v3.Project projects = 10
// [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
// title : "Projects"
// description : "Projects of the user"
// } ];
Groups []string `protobuf:"bytes,6,rep,name=groups,proto3" json:"groups,omitempty"`
Projectnamespaceroles []*ProjectNamespaceRole `protobuf:"bytes,7,rep,name=projectnamespaceroles,proto3" json:"projectnamespaceroles,omitempty"`
EmailVerified bool `protobuf:"varint,8,opt,name=emailVerified,proto3" json:"emailVerified,omitempty"`
PhoneVerified bool `protobuf:"varint,9,opt,name=phoneVerified,proto3" json:"phoneVerified,omitempty"`
TotpVerified bool `protobuf:"varint,10,opt,name=totpVerified,proto3" json:"totpVerified,omitempty"`
}
func (x *UserSpec) Reset() {
*x = UserSpec{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_types_userpb_v3_user_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UserSpec) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UserSpec) ProtoMessage() {}
func (x *UserSpec) ProtoReflect() protoreflect.Message {
mi := &file_proto_types_userpb_v3_user_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 UserSpec.ProtoReflect.Descriptor instead.
func (*UserSpec) Descriptor() ([]byte, []int) {
return file_proto_types_userpb_v3_user_proto_rawDescGZIP(), []int{1}
}
func (x *UserSpec) GetFirstName() string {
if x != nil {
return x.FirstName
}
return ""
}
func (x *UserSpec) GetLastName() string {
if x != nil {
return x.LastName
}
return ""
}
func (x *UserSpec) GetUsername() string {
if x != nil {
return x.Username
}
return ""
}
func (x *UserSpec) GetPhone() string {
if x != nil {
return x.Phone
}
return ""
}
func (x *UserSpec) GetPassword() string {
if x != nil {
return x.Password
}
return ""
}
func (x *UserSpec) GetGroups() []string {
if x != nil {
return x.Groups
}
return nil
}
func (x *UserSpec) GetProjectnamespaceroles() []*ProjectNamespaceRole {
if x != nil {
return x.Projectnamespaceroles
}
return nil
}
func (x *UserSpec) GetEmailVerified() bool {
if x != nil {
return x.EmailVerified
}
return false
}
func (x *UserSpec) GetPhoneVerified() bool {
if x != nil {
return x.PhoneVerified
}
return false
}
func (x *UserSpec) GetTotpVerified() bool {
if x != nil {
return x.TotpVerified
}
return false
}
type UserList 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 []*User `protobuf:"bytes,4,rep,name=items,proto3" json:"items,omitempty"`
}
func (x *UserList) Reset() {
*x = UserList{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_types_userpb_v3_user_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UserList) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UserList) ProtoMessage() {}
func (x *UserList) ProtoReflect() protoreflect.Message {
mi := &file_proto_types_userpb_v3_user_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 UserList.ProtoReflect.Descriptor instead.
func (*UserList) Descriptor() ([]byte, []int) {
return file_proto_types_userpb_v3_user_proto_rawDescGZIP(), []int{2}
}
func (x *UserList) GetApiVersion() string {
if x != nil {
return x.ApiVersion
}
return ""
}
func (x *UserList) GetKind() string {
if x != nil {
return x.Kind
}
return ""
}
func (x *UserList) GetMetadata() *v3.ListMetadata {
if x != nil {
return x.Metadata
}
return nil
}
func (x *UserList) GetItems() []*User {
if x != nil {
return x.Items
}
return nil
}
var File_proto_types_userpb_v3_user_proto protoreflect.FileDescriptor
var file_proto_types_userpb_v3_user_proto_rawDesc = []byte{
0x0a, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x75, 0x73,
0x65, 0x72, 0x70, 0x62, 0x2f, 0x76, 0x33, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x12, 0x17, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79,
0x70, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 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, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x75,
0x73, 0x65, 0x72, 0x70, 0x62, 0x2f, 0x76, 0x33, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x1a, 0x2a, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73,
0x2f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2f, 0x76, 0x33, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x70,
0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
0x21, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x75, 0x73, 0x65,
0x72, 0x70, 0x62, 0x2f, 0x76, 0x33, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 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, 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, 0x99, 0x04, 0x0a, 0x04, 0x55, 0x73,
0x65, 0x72, 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, 0x75, 0x73, 0x65,
0x72, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3a, 0x16, 0x75, 0x73, 0x65, 0x72,
0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x6b, 0x38, 0x73, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x69, 0x6f, 0x2f,
0x76, 0x33, 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, 0x19, 0x4b, 0x69, 0x6e, 0x64, 0x20, 0x6f, 0x66,
0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x73, 0x65, 0x72, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72,
0x63, 0x65, 0x3a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x6d,
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, 0x2c, 0x92, 0x41, 0x29, 0x2a, 0x08, 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, 0x75, 0x73, 0x65, 0x72, 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, 0x21, 0x2e, 0x72, 0x61,
0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x75, 0x73,
0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x70, 0x65, 0x63, 0x42, 0x24,
0x92, 0x41, 0x21, 0x2a, 0x04, 0x53, 0x70, 0x65, 0x63, 0x32, 0x19, 0x53, 0x70, 0x65, 0x63, 0x20,
0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x73, 0x65, 0x72, 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, 0x37, 0x92, 0x41,
0x34, 0x0a, 0x32, 0x2a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x32, 0x04, 0x55, 0x73, 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, 0x22, 0xc0, 0x07, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x53, 0x70,
0x65, 0x63, 0x12, 0x44, 0x0a, 0x09, 0x66, 0x69, 0x72, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x26, 0x92, 0x41, 0x23, 0x2a, 0x09, 0x46, 0x69, 0x72, 0x73,
0x74, 0x4e, 0x61, 0x6d, 0x65, 0x32, 0x16, 0x46, 0x69, 0x72, 0x73, 0x74, 0x20, 0x6e, 0x61, 0x6d,
0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x73, 0x65, 0x72, 0x52, 0x09, 0x66,
0x69, 0x72, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x40, 0x0a, 0x08, 0x6c, 0x61, 0x73, 0x74,
0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x24, 0x92, 0x41, 0x21, 0x2a,
0x08, 0x4c, 0x61, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x32, 0x15, 0x4c, 0x61, 0x73, 0x74, 0x20,
0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x73, 0x65, 0x72,
0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x3f, 0x0a, 0x08, 0x75, 0x73,
0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x23, 0x92, 0x41,
0x20, 0x2a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x32, 0x14, 0x55, 0x73, 0x65,
0x72, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x73, 0x65,
0x72, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3a, 0x0a, 0x05, 0x70,
0x68, 0x6f, 0x6e, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x24, 0x92, 0x41, 0x21, 0x2a,
0x05, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x32, 0x18, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x20, 0x6e, 0x75,
0x6d, 0x62, 0x65, 0x72, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x73, 0x65, 0x72,
0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x3f, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77,
0x6f, 0x72, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x23, 0x92, 0x41, 0x20, 0x2a, 0x08,
0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x32, 0x14, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f,
0x72, 0x64, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x73, 0x65, 0x72, 0x52, 0x08,
0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x3e, 0x0a, 0x06, 0x67, 0x72, 0x6f, 0x75,
0x70, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x42, 0x26, 0x92, 0x41, 0x23, 0x2a, 0x05, 0x47,
0x72, 0x6f, 0x75, 0x70, 0x32, 0x1a, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x20, 0x74, 0x68, 0x65,
0x20, 0x75, 0x73, 0x65, 0x72, 0x20, 0x62, 0x65, 0x6c, 0x6f, 0x6e, 0x67, 0x73, 0x20, 0x74, 0x6f,
0x52, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0xaf, 0x01, 0x0a, 0x15, 0x70, 0x72, 0x6f,
0x6a, 0x65, 0x63, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x72, 0x6f, 0x6c,
0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79,
0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e,
0x76, 0x33, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70,
0x61, 0x63, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x42, 0x4a, 0x92, 0x41, 0x47, 0x2a, 0x15, 0x50, 0x72,
0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x6f,
0x6c, 0x65, 0x73, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x20, 0x6e, 0x61,
0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2c, 0x20, 0x72, 0x6f, 0x6c, 0x65, 0x20, 0x61, 0x73,
0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x75,
0x73, 0x65, 0x72, 0x52, 0x15, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x6e, 0x61, 0x6d, 0x65,
0x73, 0x70, 0x61, 0x63, 0x65, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x12, 0x6e, 0x0a, 0x0d, 0x65, 0x6d,
0x61, 0x69, 0x6c, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28,
0x08, 0x42, 0x48, 0x92, 0x41, 0x45, 0x2a, 0x0d, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x56, 0x65, 0x72,
0x69, 0x66, 0x69, 0x65, 0x64, 0x32, 0x32, 0x46, 0x6c, 0x61, 0x67, 0x20, 0x74, 0x6f, 0x20, 0x73,
0x68, 0x6f, 0x77, 0x20, 0x69, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c,
0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x73, 0x65, 0x72, 0x20, 0x77, 0x61, 0x73,
0x20, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x40, 0x01, 0x52, 0x0d, 0x65, 0x6d, 0x61,
0x69, 0x6c, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x12, 0x71, 0x0a, 0x0d, 0x70, 0x68,
0x6f, 0x6e, 0x65, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28,
0x08, 0x42, 0x4b, 0x92, 0x41, 0x48, 0x2a, 0x0d, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x56, 0x65, 0x72,
0x69, 0x66, 0x69, 0x65, 0x64, 0x32, 0x35, 0x46, 0x6c, 0x61, 0x67, 0x20, 0x74, 0x6f, 0x20, 0x73,
0x68, 0x6f, 0x77, 0x20, 0x69, 0x66, 0x20, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x20, 0x6e, 0x75, 0x6d,
0x62, 0x65, 0x72, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x73, 0x65, 0x72, 0x20,
0x77, 0x61, 0x73, 0x20, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x40, 0x01, 0x52, 0x0d,
0x70, 0x68, 0x6f, 0x6e, 0x65, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x12, 0x6a, 0x0a,
0x0c, 0x74, 0x6f, 0x74, 0x70, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x18, 0x0a, 0x20,
0x01, 0x28, 0x08, 0x42, 0x46, 0x92, 0x41, 0x43, 0x2a, 0x0c, 0x54, 0x6f, 0x74, 0x70, 0x56, 0x65,
0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x32, 0x31, 0x46, 0x6c, 0x61, 0x67, 0x20, 0x74, 0x6f, 0x20,
0x73, 0x68, 0x6f, 0x77, 0x20, 0x69, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x54, 0x4f, 0x54, 0x50,
0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x73, 0x65, 0x72, 0x20, 0x77, 0x61, 0x73,
0x20, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x40, 0x01, 0x52, 0x0c, 0x74, 0x6f, 0x74,
0x70, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x3a, 0x2d, 0x92, 0x41, 0x2a, 0x0a, 0x28,
0x2a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x20, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x32, 0x12, 0x55, 0x73, 0x65, 0x72, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69,
0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xbf, 0x03, 0x0a, 0x08, 0x55, 0x73, 0x65,
0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x71, 0x0a, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73,
0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x51, 0x92, 0x41, 0x4e, 0x2a, 0x0b,
0x41, 0x50, 0x49, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x32, 0x25, 0x41, 0x50, 0x49,
0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20,
0x75, 0x73, 0x65, 0x72, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72,
0x63, 0x65, 0x3a, 0x16, 0x75, 0x73, 0x65, 0x72, 0x6d, 0x67, 0x6d, 0x74, 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, 0x49, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x35, 0x92, 0x41, 0x32, 0x2a, 0x04, 0x4b, 0x69, 0x6e,
0x64, 0x32, 0x1e, 0x4b, 0x69, 0x6e, 0x64, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75,
0x73, 0x65, 0x72, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
0x65, 0x3a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x40, 0x01, 0x52, 0x04, 0x6b,
0x69, 0x6e, 0x64, 0x12, 0x78, 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, 0x33,
0x92, 0x41, 0x30, 0x2a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x32, 0x22, 0x4d,
0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75,
0x73, 0x65, 0x72, 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, 0x1d, 0x2e, 0x72,
0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x75,
0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x42, 0x28, 0x92, 0x41, 0x25,
0x2a, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x32, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66,
0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x73, 0x65, 0x72, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72,
0x63, 0x65, 0x73, 0x40, 0x01, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x3a, 0x1c, 0x92, 0x41,
0x19, 0x0a, 0x17, 0x2a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x32, 0x09, 0x55,
0x73, 0x65, 0x72, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x40, 0x01, 0x42, 0xff, 0x01, 0x0a, 0x1b, 0x63,
0x6f, 0x6d, 0x2e, 0x72, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x79, 0x70,
0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x42, 0x09, 0x55, 0x73, 0x65, 0x72,
0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x54, 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, 0x75, 0x73, 0x65, 0x72, 0x6d, 0x67, 0x6d, 0x74,
0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x75, 0x73, 0x65,
0x72, 0x70, 0x62, 0x2f, 0x76, 0x33, 0x3b, 0x75, 0x73, 0x65, 0x72, 0x76, 0x33, 0xa2, 0x02, 0x04,
0x52, 0x44, 0x54, 0x55, 0xaa, 0x02, 0x17, 0x52, 0x61, 0x66, 0x61, 0x79, 0x2e, 0x44, 0x65, 0x76,
0x2e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x2e, 0x56, 0x33, 0xca, 0x02,
0x17, 0x52, 0x61, 0x66, 0x61, 0x79, 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73,
0x5c, 0x55, 0x73, 0x65, 0x72, 0x5c, 0x56, 0x33, 0xe2, 0x02, 0x23, 0x52, 0x61, 0x66, 0x61, 0x79,
0x5c, 0x44, 0x65, 0x76, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x55, 0x73, 0x65, 0x72, 0x5c,
0x56, 0x33, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02,
0x1b, 0x52, 0x61, 0x66, 0x61, 0x79, 0x3a, 0x3a, 0x44, 0x65, 0x76, 0x3a, 0x3a, 0x54, 0x79, 0x70,
0x65, 0x73, 0x3a, 0x3a, 0x55, 0x73, 0x65, 0x72, 0x3a, 0x3a, 0x56, 0x33, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
}
var (
file_proto_types_userpb_v3_user_proto_rawDescOnce sync.Once
file_proto_types_userpb_v3_user_proto_rawDescData = file_proto_types_userpb_v3_user_proto_rawDesc
)
func file_proto_types_userpb_v3_user_proto_rawDescGZIP() []byte {
file_proto_types_userpb_v3_user_proto_rawDescOnce.Do(func() {
file_proto_types_userpb_v3_user_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_types_userpb_v3_user_proto_rawDescData)
})
return file_proto_types_userpb_v3_user_proto_rawDescData
}
var file_proto_types_userpb_v3_user_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_proto_types_userpb_v3_user_proto_goTypes = []interface{}{
(*User)(nil), // 0: rafay.dev.types.user.v3.User
(*UserSpec)(nil), // 1: rafay.dev.types.user.v3.UserSpec
(*UserList)(nil), // 2: rafay.dev.types.user.v3.UserList
(*v3.Metadata)(nil), // 3: rafay.dev.types.common.v3.Metadata
(*v3.Status)(nil), // 4: rafay.dev.types.common.v3.Status
(*ProjectNamespaceRole)(nil), // 5: rafay.dev.types.user.v3.ProjectNamespaceRole
(*v3.ListMetadata)(nil), // 6: rafay.dev.types.common.v3.ListMetadata
}
var file_proto_types_userpb_v3_user_proto_depIdxs = []int32{
3, // 0: rafay.dev.types.user.v3.User.metadata:type_name -> rafay.dev.types.common.v3.Metadata
1, // 1: rafay.dev.types.user.v3.User.spec:type_name -> rafay.dev.types.user.v3.UserSpec
4, // 2: rafay.dev.types.user.v3.User.status:type_name -> rafay.dev.types.common.v3.Status
5, // 3: rafay.dev.types.user.v3.UserSpec.projectnamespaceroles:type_name -> rafay.dev.types.user.v3.ProjectNamespaceRole
6, // 4: rafay.dev.types.user.v3.UserList.metadata:type_name -> rafay.dev.types.common.v3.ListMetadata
0, // 5: rafay.dev.types.user.v3.UserList.items:type_name -> rafay.dev.types.user.v3.User
6, // [6:6] is the sub-list for method output_type
6, // [6:6] is the sub-list for method input_type
6, // [6:6] is the sub-list for extension type_name
6, // [6:6] is the sub-list for extension extendee
0, // [0:6] is the sub-list for field type_name
}
func init() { file_proto_types_userpb_v3_user_proto_init() }
func file_proto_types_userpb_v3_user_proto_init() {
if File_proto_types_userpb_v3_user_proto != nil {
return
}
file_proto_types_userpb_v3_role_proto_init()
file_proto_types_userpb_v3_rolepermission_proto_init()
file_proto_types_userpb_v3_group_proto_init()
if !protoimpl.UnsafeEnabled {
file_proto_types_userpb_v3_user_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*User); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_types_userpb_v3_user_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UserSpec); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_types_userpb_v3_user_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UserList); 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_userpb_v3_user_proto_rawDesc,
NumEnums: 0,
NumMessages: 3,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_proto_types_userpb_v3_user_proto_goTypes,
DependencyIndexes: file_proto_types_userpb_v3_user_proto_depIdxs,
MessageInfos: file_proto_types_userpb_v3_user_proto_msgTypes,
}.Build()
File_proto_types_userpb_v3_user_proto = out.File
file_proto_types_userpb_v3_user_proto_rawDesc = nil
file_proto_types_userpb_v3_user_proto_goTypes = nil
file_proto_types_userpb_v3_user_proto_depIdxs = nil
}

View File

@@ -0,0 +1,173 @@
syntax = "proto3";
package rafay.dev.types.user.v3;
import "proto/types/commonpb/v3/common.proto";
import "proto/types/userpb/v3/role.proto";
import "proto/types/userpb/v3/rolepermission.proto";
import "proto/types/userpb/v3/group.proto";
import "proto/types/systempb/v3/project.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
// import "google/api/field_behavior.proto";
message User {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
json_schema : {
title : "User"
description : "User"
required : [ "apiVersion", "kind", "metadata", "spec" ]
}
};
string apiVersion = 1
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "API Version",
description : "API Version of the user resource"
default : "usermgmt.k8smgmt.io/v3"
} ];
string kind = 2
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "Kind",
description : "Kind of the user resource"
default : "User"
} ];
rafay.dev.types.common.v3.Metadata metadata = 3
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "Metadata",
description : "Metadata of the user resource"
} ];
UserSpec spec = 4
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "Spec",
description : "Spec of the user 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 UserSpec {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
json_schema : {
title : "User Specification"
description : "User specification"
}
};
string firstName = 1
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "FirstName"
description : "First name of the user"
} ];
string lastName = 2
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "LastName"
description : "Last name of the user"
} ];
string username = 3
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "Username"
description : "Username of the user"
} ];
string phone = 4
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "Phone"
description : "Phone number of the user"
} ];
string password = 5
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "Password"
description : "Password of the user"
} ];
// string totpRequired = 6
// [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
// title : "TotpRequired"
// description : "Flag to specify if TOTP is required"
// } ];
// string totpSecret = 7
// [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
// title : "TotpSecret"
// description : "Secret for TOTP"
// } ];
// repeated rafay.dev.types.user.v3.Role roles = 8
// [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
// title : "Roles"
// description : "Roles of the user"
// } ];
// repeated rafay.dev.types.user.v3.Group groups = 9
// [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
// title : "Group"
// description : "Groups of the user"
// } ];
// repeated rafay.dev.types.system.v3.Project projects = 10
// [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
// title : "Projects"
// description : "Projects of the user"
// } ];
repeated string groups = 6
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "Group"
description : "Groups the user belongs to"
} ];
repeated rafay.dev.types.user.v3.ProjectNamespaceRole projectnamespaceroles = 7
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "ProjectNamespaceRoles"
description : "Project, namespace, role associations for user"
} ];
bool emailVerified = 8
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "EmailVerified"
description : "Flag to show if the email of the user was verified"
read_only : true
} ];
bool phoneVerified = 9
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "PhoneVerified"
description : "Flag to show if phone number of the user was verified"
read_only : true
} ];
bool totpVerified = 10
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "TotpVerified"
description : "Flag to show if the TOTP of the user was verified"
read_only : true
} ];
}
message UserList {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
json_schema : {
title : "UserList"
description : "User list"
read_only : true
}
};
string apiVersion = 1
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "API Version",
description : "API Version of the user list resource"
default : "usermgmt.k8smgmt.io/v3"
read_only : true
} ];
string kind = 2
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "Kind",
description : "Kind of the user list resource"
default : "UserList"
read_only : true
} ];
rafay.dev.types.common.v3.ListMetadata metadata = 3
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "Metadata",
description : "Metadata of the user list resource"
read_only : true
} ];
repeated User items = 4
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "Items",
description : "List of the user resources"
read_only : true
} ];
}

10
go.mod
View File

@@ -1,13 +1,3 @@
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
)

20
go.sum
View File

@@ -1,20 +0,0 @@
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=

View File

@@ -34,7 +34,7 @@ CREATE INDEX authsrv_projectaccountresourcerole_role_id_a345b16f ON authsrv_proj
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;
REFERENCES identities(id) DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE ONLY authsrv_projectaccountresourcerole
ADD CONSTRAINT authsrv_projectaccou_organization_id_91c5602d_fk_authsrv_o FOREIGN KEY (organization_id)
@@ -50,4 +50,4 @@ ALTER TABLE ONLY authsrv_projectaccountresourcerole
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;
REFERENCES authsrv_resourcerole(id) DEFERRABLE INITIALLY DEFERRED;

View File

@@ -34,7 +34,7 @@ CREATE INDEX authsrv_projectaccountnamespacerole_role_id_8a5411cc ON authsrv_pro
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;
REFERENCES identities(id) DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE ONLY authsrv_projectaccountnamespacerole
ADD CONSTRAINT authsrv_projectaccou_organization_id_96c921c9_fk_authsrv_o FOREIGN KEY (organization_id)
@@ -50,4 +50,4 @@ ALTER TABLE ONLY authsrv_projectaccountnamespacerole
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;
REFERENCES authsrv_resourcerole(id) DEFERRABLE INITIALLY DEFERRED;

View File

@@ -24,8 +24,8 @@ CREATE INDEX authsrv_groupaccount_name_d17de056_like ON authsrv_groupaccount USI
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;
REFERENCES identities(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;
REFERENCES authsrv_group(id) DEFERRABLE INITIALLY DEFERRED;

View File

@@ -31,7 +31,7 @@ CREATE INDEX authsrv_accountresourcerole_role_id_769ec143 ON authsrv_accountreso
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;
REFERENCES identities(id) DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE ONLY authsrv_accountresourcerole
ADD CONSTRAINT authsrv_accountresou_organization_id_22bb772c_fk_authsrv_o FOREIGN KEY (organization_id)
@@ -43,4 +43,4 @@ ALTER TABLE ONLY authsrv_accountresourcerole
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;
REFERENCES authsrv_resourcerole(id) DEFERRABLE INITIALLY DEFERRED;