mirror of
https://github.com/paralus/paralus.git
synced 2026-03-04 18:10:21 +00:00
Update proto files for usermgmt
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
module github.com/RafaySystems/rcloud-base/components/adminsrv
|
||||
|
||||
go 1.17
|
||||
go 1.16
|
||||
|
||||
require (
|
||||
github.com/RafaySystems/rcloud-base/components/common v0.0.0-unpublished
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
module github.com/RafaySystems/rcloud-base/components/usermgmt
|
||||
|
||||
go 1.16
|
||||
|
||||
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/grpc-ecosystem/grpc-gateway v1.16.0
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.2
|
||||
github.com/spf13/viper v1.10.1
|
||||
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa
|
||||
google.golang.org/grpc v1.43.0
|
||||
google.golang.org/protobuf v1.27.1
|
||||
sigs.k8s.io/controller-runtime v0.11.0
|
||||
)
|
||||
|
||||
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/
|
||||
// github.com/RafaySystems/rcloud-base/components/usermgmt v0.0.0-unpublished => ../usermgmt
|
||||
)
|
||||
|
||||
1104
components/usermgmt/go.sum
Normal file
1104
components/usermgmt/go.sum
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,2 +1,126 @@
|
||||
package usermgmt
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"sync"
|
||||
|
||||
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
|
||||
"github.com/spf13/viper"
|
||||
"sigs.k8s.io/controller-runtime/pkg/manager/signals"
|
||||
|
||||
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"
|
||||
pbrpcv3 "github.com/RafaySystems/rcloud-base/components/usermgmt/proto/rpc/v3"
|
||||
)
|
||||
|
||||
const (
|
||||
rpcPortEnv = "RPC_PORT"
|
||||
apiPortEnv = "API_PORT"
|
||||
debugPortEnv = "DEBUG_PORT"
|
||||
kratosAddrEnv = "KRATOS_ADDR"
|
||||
devEnv = "DEV"
|
||||
configAddrENV = "CONFIG_ADDR"
|
||||
)
|
||||
|
||||
var (
|
||||
rpcPort int
|
||||
apiPort int
|
||||
debugPort int
|
||||
rpcRelayPeeringPort int
|
||||
kratosAddr string
|
||||
dev bool
|
||||
// ps service.PartnerService
|
||||
_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(kratosAddr, "localhost:5443")
|
||||
viper.SetDefault(devEnv, true)
|
||||
viper.SetDefault(configAddrENV, "localhost:7000")
|
||||
|
||||
viper.BindEnv(rpcPortEnv)
|
||||
viper.BindEnv(apiPortEnv)
|
||||
viper.BindEnv(debugPortEnv)
|
||||
viper.BindEnv(kratosAddrEnv)
|
||||
viper.BindEnv(devEnv)
|
||||
viper.BindEnv(configAddrENV)
|
||||
|
||||
rpcPort = viper.GetInt(rpcPortEnv)
|
||||
apiPort = viper.GetInt(apiPortEnv)
|
||||
debugPort = viper.GetInt(debugPortEnv)
|
||||
kratosAddr = viper.GetString(kratosAddrEnv)
|
||||
dev = viper.GetBool(devEnv)
|
||||
configAddr = viper.GetString(configAddrENV)
|
||||
|
||||
rpcRelayPeeringPort = rpcPort + 1
|
||||
|
||||
_log.Infow("usrmgmt setup")
|
||||
|
||||
// ps = service.NewPartnerService(db)
|
||||
}
|
||||
|
||||
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,
|
||||
)
|
||||
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 main() {
|
||||
setup()
|
||||
run()
|
||||
}
|
||||
|
||||
@@ -1,129 +0,0 @@
|
||||
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}}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Add filtering with org as well
|
||||
message GetGroupsRequest {
|
||||
string project = 1
|
||||
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||
title : "Project",
|
||||
description : "Project of user to filter by"
|
||||
read_only : true
|
||||
} ];
|
||||
}
|
||||
message GetGroupRequest { string id = 1; }
|
||||
message DeleteGroupRequest { string id = 1; }
|
||||
message PutGroupRequest {
|
||||
string id = 1;
|
||||
rafay.dev.types.user.v3.Group group = 2;
|
||||
}
|
||||
message GetGroupsResponse { repeated rafay.dev.types.user.v3.Group group = 1; }
|
||||
message GroupResponse {
|
||||
string status = 1;
|
||||
string message = 2;
|
||||
}
|
||||
|
||||
service Group {
|
||||
rpc CreateGroup(rafay.dev.types.user.v3.Group)
|
||||
returns (rafay.dev.types.user.v3.Group) {
|
||||
option (google.api.http) = {
|
||||
post : "/auth/v3/groups"
|
||||
body : "*"
|
||||
};
|
||||
|
||||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||||
responses : {
|
||||
key : "201"
|
||||
value : {description : "Returned when group is created successfully."}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
rpc GetGroups(GetGroupsRequest) returns (GetGroupsResponse) {
|
||||
option (google.api.http) = {
|
||||
get : "/auth/v3/groups"
|
||||
};
|
||||
};
|
||||
|
||||
rpc GetGroup(GetGroupRequest) returns (rafay.dev.types.user.v3.Group) {
|
||||
option (google.api.http) = {
|
||||
get : "/auth/v3/group/{id}"
|
||||
};
|
||||
};
|
||||
|
||||
rpc UpdateGroup(PutGroupRequest) returns (GroupResponse) {
|
||||
option (google.api.http) = {
|
||||
put : "/auth/v3/group/{id}"
|
||||
body : "group"
|
||||
};
|
||||
};
|
||||
|
||||
rpc DeleteGroup(DeleteGroupRequest) returns (GroupResponse) {
|
||||
option (google.api.http) = {
|
||||
delete : "/auth/v3/group/{id}"
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
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}}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
message GetRolesRequest {}
|
||||
message GetRoleRequest { string id = 1; }
|
||||
message DeleteRoleRequest { string id = 1; }
|
||||
message PutRoleRequest {
|
||||
string id = 1;
|
||||
rafay.dev.types.user.v3.Role role = 2;
|
||||
}
|
||||
message GetRolesResponse { repeated rafay.dev.types.user.v3.Role role = 1; }
|
||||
message RoleResponse {
|
||||
string status = 1;
|
||||
string message = 2;
|
||||
}
|
||||
|
||||
service Role {
|
||||
rpc CreateRole(rafay.dev.types.user.v3.Role)
|
||||
returns (rafay.dev.types.user.v3.Role) {
|
||||
option (google.api.http) = {
|
||||
post : "/auth/v3/roles"
|
||||
body : "*"
|
||||
};
|
||||
|
||||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||||
responses : {
|
||||
key : "201"
|
||||
value : {description : "Returned when role is created successfully."}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
rpc GetRoles(GetRolesRequest) returns (GetRolesResponse) {
|
||||
option (google.api.http) = {
|
||||
get : "/auth/v3/roles"
|
||||
};
|
||||
};
|
||||
|
||||
rpc GetRole(GetRoleRequest) returns (rafay.dev.types.user.v3.Role) {
|
||||
option (google.api.http) = {
|
||||
get : "/auth/v3/role/{id}"
|
||||
};
|
||||
};
|
||||
|
||||
rpc UpdateRole(PutRoleRequest) returns (RoleResponse) {
|
||||
option (google.api.http) = {
|
||||
put : "/auth/v3/role/{id}"
|
||||
body : "role"
|
||||
};
|
||||
};
|
||||
|
||||
rpc DeleteRole(DeleteRoleRequest) returns (RoleResponse) {
|
||||
option (google.api.http) = {
|
||||
delete : "/auth/v3/role/{id}"
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
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}}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
message GetRolepermissionsRequest {}
|
||||
message GetRolepermissionRequest {
|
||||
string id = 1
|
||||
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||
title : "Id",
|
||||
description : "Id of the rolepermission resource"
|
||||
} ];
|
||||
}
|
||||
message GetRolepermissionsResponse {
|
||||
repeated rafay.dev.types.user.v3.RolePermission rolepermissions = 1
|
||||
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||
title : "RolePermissions",
|
||||
description : "List of the rolepermission resources"
|
||||
} ];
|
||||
|
||||
}
|
||||
|
||||
service Rolepermission {
|
||||
rpc GetRolepermissions(GetRolepermissionsRequest)
|
||||
returns (GetRolepermissionsResponse) {
|
||||
option (google.api.http) = {
|
||||
get : "/auth/v3/rolepermissions"
|
||||
};
|
||||
};
|
||||
|
||||
rpc GetRolepermission(GetRolepermissionRequest)
|
||||
returns (rafay.dev.types.user.v3.RolePermission) {
|
||||
option (google.api.http) = {
|
||||
get : "/auth/v3/rolepermission/{id}"
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,121 +0,0 @@
|
||||
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}}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Add option to filter by more org and group
|
||||
message GetUsersRequest { string project = 1; }
|
||||
message GetUserRequest { string userid = 1; }
|
||||
message DeleteUserRequest { string userid = 1; }
|
||||
message PutUserRequest {
|
||||
string userid = 1;
|
||||
rafay.dev.types.user.v3.User user = 2;
|
||||
}
|
||||
message GetUsersResponse { repeated rafay.dev.types.user.v3.User user = 1; }
|
||||
message UserResponse {
|
||||
string status = 1;
|
||||
string message = 2;
|
||||
}
|
||||
|
||||
service User {
|
||||
rpc CreateUser(rafay.dev.types.user.v3.User)
|
||||
returns (rafay.dev.types.user.v3.User) {
|
||||
option (google.api.http) = {
|
||||
post : "/auth/v3/users"
|
||||
body : "*"
|
||||
};
|
||||
|
||||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||||
responses : {
|
||||
key : "201"
|
||||
value : {description : "Returned when user is created successfully."}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
rpc GetUsers(GetUsersRequest) returns (GetUsersResponse) {
|
||||
option (google.api.http) = {
|
||||
get : "/auth/v3/users"
|
||||
};
|
||||
};
|
||||
|
||||
rpc GetUser(GetUserRequest) returns (rafay.dev.types.user.v3.User) {
|
||||
option (google.api.http) = {
|
||||
get : "/auth/v3/user/{userid}"
|
||||
};
|
||||
};
|
||||
|
||||
rpc UpdateUser(PutUserRequest) returns (UserResponse) {
|
||||
option (google.api.http) = {
|
||||
put : "/auth/v3/user/{userid}"
|
||||
body : "user"
|
||||
};
|
||||
};
|
||||
|
||||
rpc DeleteUser(DeleteUserRequest) returns (UserResponse) {
|
||||
option (google.api.http) = {
|
||||
delete : "/auth/v3/user/{userid}"
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,124 +0,0 @@
|
||||
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 : "Pipeline"
|
||||
} ];
|
||||
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 ProjectRole {
|
||||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
|
||||
json_schema : {
|
||||
title : "ProjectRole"
|
||||
description : "Project and role pairing for permission"
|
||||
}
|
||||
};
|
||||
rafay.dev.types.system.v3.Project project = 1
|
||||
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||
title : "Project"
|
||||
description : "Project"
|
||||
} ];
|
||||
rafay.dev.types.user.v3.Role role = 2
|
||||
[ (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 ProjectRole projectroles = 1
|
||||
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||
title : "ProjectRoles"
|
||||
description : "ProjectRole groups for permission"
|
||||
} ];
|
||||
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
|
||||
} ];
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
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"
|
||||
} ];
|
||||
}
|
||||
|
||||
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
|
||||
} ];
|
||||
}
|
||||
@@ -1,93 +0,0 @@
|
||||
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
|
||||
} ];
|
||||
}
|
||||
@@ -1,163 +0,0 @@
|
||||
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"
|
||||
} ];
|
||||
bool emailVerified = 11
|
||||
[ (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 = 12
|
||||
[ (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 = 13
|
||||
[ (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
|
||||
} ];
|
||||
}
|
||||
@@ -7,8 +7,8 @@
|
||||
package userv3
|
||||
|
||||
import (
|
||||
v3 "github.com/RafaySystems/rcloud-base/components/usermgmt/proto/types/commonpb/v3"
|
||||
v31 "github.com/RafaySystems/rcloud-base/components/usermgmt/proto/types/systempb/v3"
|
||||
v3 "github.com/RafaySystems/rcloud-base/components/common/proto/types/commonpb/v3"
|
||||
v31 "github.com/RafaySystems/rcloud-base/components/adminsrv/proto/types/systempb/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"
|
||||
@@ -7,7 +7,7 @@
|
||||
package userv3
|
||||
|
||||
import (
|
||||
v3 "github.com/RafaySystems/rcloud-base/components/usermgmt/proto/types/commonpb/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"
|
||||
@@ -7,7 +7,7 @@
|
||||
package userv3
|
||||
|
||||
import (
|
||||
v3 "github.com/RafaySystems/rcloud-base/components/usermgmt/proto/types/commonpb/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"
|
||||
@@ -7,8 +7,8 @@
|
||||
package userv3
|
||||
|
||||
import (
|
||||
v3 "github.com/RafaySystems/rcloud-base/components/usermgmt/proto/types/commonpb/v3"
|
||||
v31 "github.com/RafaySystems/rcloud-base/components/usermgmt/proto/types/systempb/v3"
|
||||
v3 "github.com/RafaySystems/rcloud-base/components/common/proto/types/commonpb/v3"
|
||||
v31 "github.com/RafaySystems/rcloud-base/components/adminsrv/proto/types/systempb/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"
|
||||
Reference in New Issue
Block a user