mirror of
https://github.com/paralus/paralus.git
synced 2026-03-05 02:20:18 +00:00
Add types for user management proto files
This commit is contained in:
23
components/usermgmt/buf.gen.yaml
Normal file
23
components/usermgmt/buf.gen.yaml
Normal file
@@ -0,0 +1,23 @@
|
||||
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
|
||||
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
|
||||
24
components/usermgmt/buf.lock
Normal file
24
components/usermgmt/buf.lock
Normal 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
|
||||
12
components/usermgmt/buf.yaml
Normal file
12
components/usermgmt/buf.yaml
Normal 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
|
||||
3
components/usermgmt/go.mod
Normal file
3
components/usermgmt/go.mod
Normal file
@@ -0,0 +1,3 @@
|
||||
module github.com/RafaySystems/rcloud-base/components/usermgmt
|
||||
|
||||
go 1.16
|
||||
2
components/usermgmt/main.go
Normal file
2
components/usermgmt/main.go
Normal file
@@ -0,0 +1,2 @@
|
||||
package usermgmt
|
||||
|
||||
35
components/usermgmt/proto/types/userpb/v3/group.proto
Normal file
35
components/usermgmt/proto/types/userpb/v3/group.proto
Normal file
@@ -0,0 +1,35 @@
|
||||
syntax = "proto3";
|
||||
package rafay.dev.types.user.v3;
|
||||
|
||||
import "proto/types/commonpb/v3/common.proto";
|
||||
import "proto/types/systempb/v3/project.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; // usermgmt.k8smgmt.io/v3
|
||||
string kind = 2; // default : "Group"
|
||||
rafay.dev.types.common.v3.Metadata metadata = 3;
|
||||
GroupSpec spec = 4;
|
||||
rafay.dev.types.common.v3.Status status = 5;
|
||||
}
|
||||
|
||||
message GroupSpec {
|
||||
repeated rafay.dev.types.system.v3.Project projects = 1;
|
||||
repeated string users = 2;
|
||||
string type = 3;
|
||||
}
|
||||
|
||||
message GroupList {
|
||||
string apiVersion = 1;
|
||||
string kind = 2;
|
||||
rafay.dev.types.common.v3.ListMetadata metadata = 3;
|
||||
repeated Group items = 4;
|
||||
}
|
||||
32
components/usermgmt/proto/types/userpb/v3/role.proto
Normal file
32
components/usermgmt/proto/types/userpb/v3/role.proto
Normal file
@@ -0,0 +1,32 @@
|
||||
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; // default : "usermgmt.k8smgmt.io/v3"
|
||||
string kind = 2; // default : "Role"
|
||||
rafay.dev.types.common.v3.Metadata metadata = 3;
|
||||
RoleSpec spec = 4;
|
||||
rafay.dev.types.common.v3.Status status = 5;
|
||||
}
|
||||
|
||||
message RoleSpec { repeated rafay.dev.types.user.v3.RolePermission rolepermissions = 1; }
|
||||
|
||||
message RoleList {
|
||||
string apiVersion = 1;
|
||||
string kind = 2;
|
||||
rafay.dev.types.common.v3.ListMetadata metadata = 3;
|
||||
repeated Role items = 4;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
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; // default : "usermgmt.k8smgmt.io/v3"
|
||||
string kind = 2; // default : "RolePermission"
|
||||
rafay.dev.types.common.v3.Metadata metadata = 3;
|
||||
RolePermissionSpec spec = 4;
|
||||
rafay.dev.types.common.v3.Status status = 5;
|
||||
}
|
||||
|
||||
message RolePermissionSpec { repeated string permissions = 1; }
|
||||
|
||||
message RolePermissionList {
|
||||
string apiVersion = 1;
|
||||
string kind = 2;
|
||||
rafay.dev.types.common.v3.ListMetadata metadata = 3;
|
||||
repeated RolePermission items = 4;
|
||||
}
|
||||
49
components/usermgmt/proto/types/userpb/v3/user.proto
Normal file
49
components/usermgmt/proto/types/userpb/v3/user.proto
Normal file
@@ -0,0 +1,49 @@
|
||||
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; // default : "usermgmt.k8smgmt.io/v3"
|
||||
string kind = 2; // default : "User"
|
||||
rafay.dev.types.common.v3.Metadata metadata = 3;
|
||||
UserSpec spec = 4;
|
||||
rafay.dev.types.common.v3.Status status = 5;
|
||||
}
|
||||
|
||||
message UserSpec {
|
||||
string firstName = 1;
|
||||
string lastName = 2;
|
||||
string username = 3;
|
||||
string phone = 4;
|
||||
string password = 5;
|
||||
string totpRequired = 6;
|
||||
string totpSecret = 7;
|
||||
repeated rafay.dev.types.user.v3.Role roles = 8;
|
||||
repeated rafay.dev.types.user.v3.Group group = 9;
|
||||
repeated rafay.dev.types.system.v3.Project project = 10;
|
||||
bool emailVerified = 11;
|
||||
bool phoneVerified = 12;
|
||||
bool totpVerified = 13;
|
||||
}
|
||||
|
||||
message UserList {
|
||||
string apiVersion = 1;
|
||||
string kind = 2;
|
||||
rafay.dev.types.common.v3.ListMetadata metadata = 3;
|
||||
repeated User items = 4;
|
||||
}
|
||||
11
components/usermgmt/readme
Normal file
11
components/usermgmt/readme
Normal file
@@ -0,0 +1,11 @@
|
||||
User management for rcloud
|
||||
|
||||
Dependencies:
|
||||
- ory/kratos
|
||||
|
||||
Components:
|
||||
- Glue between frontend and kratos
|
||||
- Auth validation for use in other modules
|
||||
|
||||
TBD:
|
||||
- Will casbin be integrated in same module or separate api call? (Probably separate api call)
|
||||
Reference in New Issue
Block a user