mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-02 20:32:19 +00:00
feat: project view (#90)
* init for views (spooler, handler) * init for views (spooler, handler) * start view in management * granted project * implement granted project view * search granted projects * fix search column * update all projects on project change * search roles * filter org * project members * project grant members * fix tests * application view * project grant search * mock * test appendevents * test appendevents * Update internal/view/query.go Co-authored-by: Livio Amstutz <[email protected]> * Update internal/eventstore/spooler/spooler.go Co-authored-by: Livio Amstutz <[email protected]> * Update internal/view/query.go Co-authored-by: Livio Amstutz <[email protected]> * merge request changes * Update internal/project/repository/view/model/application.go Co-authored-by: Livio Amstutz <[email protected]> * merge request changes * Project view sql (#92) * sql and configs * error handling * sql start in eventstore * on error handling, config * read user on members * Update internal/project/repository/view/application_view.go Co-authored-by: Silvan <[email protected]> * Update internal/project/repository/view/model/application.go Co-authored-by: Silvan <[email protected]> * Update internal/project/repository/view/model/application.go Co-authored-by: Silvan <[email protected]> * Update internal/project/repository/view/model/application.go Co-authored-by: Silvan <[email protected]> * Update internal/project/repository/view/model/application.go Co-authored-by: Silvan <[email protected]> * Update internal/project/repository/view/model/application.go Co-authored-by: Silvan <[email protected]> * Update internal/project/repository/view/model/application_query.go Co-authored-by: Silvan <[email protected]> * Update pkg/management/api/grpc/project_grant_converter.go Co-authored-by: Silvan <[email protected]> * Update pkg/management/api/grpc/project_grant_member_converter.go Co-authored-by: Silvan <[email protected]> * Update pkg/management/api/grpc/project_grant_member_converter.go Co-authored-by: Silvan <[email protected]> * Update pkg/management/api/grpc/project_member_converter.go Co-authored-by: Silvan <[email protected]> * Update pkg/management/api/grpc/project_member_converter.go Co-authored-by: Silvan <[email protected]> * Update internal/project/repository/view/model/granted_project.go Co-authored-by: Silvan <[email protected]> * return caos errors * Update internal/project/repository/view/model/granted_project_query.go Co-authored-by: Silvan <[email protected]> * Update internal/project/repository/view/model/project_grant_member.go Co-authored-by: Silvan <[email protected]> * Update internal/project/repository/view/model/project_grant_member_query.go Co-authored-by: Silvan <[email protected]> * Update internal/project/repository/view/model/project_member.go Co-authored-by: Silvan <[email protected]> * Update internal/project/repository/view/model/project_member_query.go Co-authored-by: Silvan <[email protected]> * Update internal/project/repository/view/model/project_role.go Co-authored-by: Silvan <[email protected]> * Update internal/project/repository/view/model/project_role_query.go Co-authored-by: Silvan <[email protected]> * Update pkg/management/api/grpc/application_converter.go Co-authored-by: Silvan <[email protected]> * Update pkg/management/api/grpc/application_converter.go Co-authored-by: Silvan <[email protected]> * Update pkg/management/api/grpc/project_converter.go Co-authored-by: Silvan <[email protected]> * Update pkg/management/api/grpc/project_converter.go Co-authored-by: Silvan <[email protected]> * Update pkg/management/api/grpc/project_converter.go Co-authored-by: Silvan <[email protected]> * Update pkg/management/api/grpc/project_converter.go Co-authored-by: Silvan <[email protected]> * converter fix Co-authored-by: Livio Amstutz <[email protected]> Co-authored-by: Silvan <[email protected]>
This commit is contained in:
co-authored by
Livio Amstutz
Silvan
parent
49d86fdabb
commit
6e105f662e
@@ -7,7 +7,11 @@ import (
|
||||
)
|
||||
|
||||
func (s *Server) SearchApplications(ctx context.Context, in *ApplicationSearchRequest) (*ApplicationSearchResponse, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-yW23f", "Not implemented")
|
||||
response, err := s.project.SearchApplications(ctx, applicationSearchRequestsToModel(in))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return applicationSearchResponseFromModel(response), nil
|
||||
}
|
||||
|
||||
func (s *Server) ApplicationByID(ctx context.Context, in *ApplicationID) (*Application, error) {
|
||||
|
||||
@@ -47,6 +47,18 @@ func oidcConfigFromModel(config *proj_model.OIDCConfig) *OIDCConfig {
|
||||
}
|
||||
}
|
||||
|
||||
func oidcConfigFromApplicationViewModel(app *proj_model.ApplicationView) *OIDCConfig {
|
||||
return &OIDCConfig{
|
||||
RedirectUris: app.OIDCRedirectUris,
|
||||
ResponseTypes: oidcResponseTypesFromModel(app.OIDCResponseTypes),
|
||||
GrantTypes: oidcGrantTypesFromModel(app.OIDCGrantTypes),
|
||||
ApplicationType: oidcApplicationTypeFromModel(app.OIDCApplicationType),
|
||||
ClientId: app.OIDCClientID,
|
||||
AuthMethodType: oidcAuthMethodTypeFromModel(app.OIDCAuthMethodType),
|
||||
PostLogoutRedirectUris: app.OIDCPostLogoutRedirectUris,
|
||||
}
|
||||
}
|
||||
|
||||
func oidcAppCreateToModel(app *OIDCApplicationCreate) *proj_model.Application {
|
||||
return &proj_model.Application{
|
||||
ObjectRoot: models.ObjectRoot{
|
||||
@@ -90,6 +102,79 @@ func oidcConfigUpdateToModel(app *OIDCConfigUpdate) *proj_model.OIDCConfig {
|
||||
}
|
||||
}
|
||||
|
||||
func applicationSearchRequestsToModel(request *ApplicationSearchRequest) *proj_model.ApplicationSearchRequest {
|
||||
return &proj_model.ApplicationSearchRequest{
|
||||
Offset: request.Offset,
|
||||
Limit: request.Limit,
|
||||
Queries: applicationSearchQueriesToModel(request.Queries),
|
||||
}
|
||||
}
|
||||
|
||||
func applicationSearchQueriesToModel(queries []*ApplicationSearchQuery) []*proj_model.ApplicationSearchQuery {
|
||||
converted := make([]*proj_model.ApplicationSearchQuery, len(queries))
|
||||
for i, q := range queries {
|
||||
converted[i] = applicationSearchQueryToModel(q)
|
||||
}
|
||||
return converted
|
||||
}
|
||||
|
||||
func applicationSearchQueryToModel(query *ApplicationSearchQuery) *proj_model.ApplicationSearchQuery {
|
||||
return &proj_model.ApplicationSearchQuery{
|
||||
Key: applicationSearchKeyToModel(query.Key),
|
||||
Method: searchMethodToModel(query.Method),
|
||||
Value: query.Value,
|
||||
}
|
||||
}
|
||||
|
||||
func applicationSearchKeyToModel(key ApplicationSearchKey) proj_model.ApplicationSearchKey {
|
||||
switch key {
|
||||
case ApplicationSearchKey_APPLICATIONSEARCHKEY_APP_NAME:
|
||||
return proj_model.APPLICATIONSEARCHKEY_NAME
|
||||
default:
|
||||
return proj_model.APPLICATIONSEARCHKEY_UNSPECIFIED
|
||||
}
|
||||
}
|
||||
|
||||
func applicationSearchResponseFromModel(response *proj_model.ApplicationSearchResponse) *ApplicationSearchResponse {
|
||||
return &ApplicationSearchResponse{
|
||||
Offset: response.Offset,
|
||||
Limit: response.Limit,
|
||||
TotalResult: response.TotalResult,
|
||||
Result: applicationViewsFromModel(response.Result),
|
||||
}
|
||||
}
|
||||
|
||||
func applicationViewsFromModel(apps []*proj_model.ApplicationView) []*ApplicationView {
|
||||
converted := make([]*ApplicationView, len(apps))
|
||||
for i, app := range apps {
|
||||
converted[i] = applicationViewFromModel(app)
|
||||
}
|
||||
return converted
|
||||
}
|
||||
|
||||
func applicationViewFromModel(application *proj_model.ApplicationView) *ApplicationView {
|
||||
creationDate, err := ptypes.TimestampProto(application.CreationDate)
|
||||
logging.Log("GRPC-lo9sw").OnError(err).Debug("unable to parse timestamp")
|
||||
|
||||
changeDate, err := ptypes.TimestampProto(application.ChangeDate)
|
||||
logging.Log("GRPC-8uwsd").OnError(err).Debug("unable to parse timestamp")
|
||||
|
||||
converted := &ApplicationView{
|
||||
Id: application.ID,
|
||||
State: appStateFromModel(application.State),
|
||||
CreationDate: creationDate,
|
||||
ChangeDate: changeDate,
|
||||
Name: application.Name,
|
||||
Sequence: application.Sequence,
|
||||
}
|
||||
if application.IsOIDC {
|
||||
converted.AppConfig = &ApplicationView_OidcConfig{
|
||||
OidcConfig: oidcConfigFromApplicationViewModel(application),
|
||||
}
|
||||
}
|
||||
return converted
|
||||
}
|
||||
|
||||
func appStateFromModel(state proj_model.AppState) AppState {
|
||||
switch state {
|
||||
case proj_model.APPSTATE_ACTIVE:
|
||||
|
||||
@@ -255,7 +255,7 @@ var ManagementService_AuthMethods = utils_auth.MethodMapping{
|
||||
CheckParam: "",
|
||||
},
|
||||
|
||||
"/caos.zitadel.management.api.v1.ManagementService/SearchProjects": utils_auth.Option{
|
||||
"/caos.zitadel.management.api.v1.ManagementService/SearchGrantedProjects": utils_auth.Option{
|
||||
Permission: "project.read",
|
||||
CheckParam: "",
|
||||
},
|
||||
|
||||
+3579
-2856
File diff suppressed because it is too large
Load Diff
@@ -1434,8 +1434,8 @@ func request_ManagementService_SearchOrgMembers_0(ctx context.Context, marshaler
|
||||
|
||||
}
|
||||
|
||||
func request_ManagementService_SearchProjects_0(ctx context.Context, marshaler runtime.Marshaler, client ManagementServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ProjectSearchRequest
|
||||
func request_ManagementService_SearchGrantedProjects_0(ctx context.Context, marshaler runtime.Marshaler, client ManagementServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GrantedProjectSearchRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
@@ -1446,7 +1446,7 @@ func request_ManagementService_SearchProjects_0(ctx context.Context, marshaler r
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.SearchProjects(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
msg, err := client.SearchGrantedProjects(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
@@ -1601,7 +1601,7 @@ func request_ManagementService_ReactivateProject_0(ctx context.Context, marshale
|
||||
}
|
||||
|
||||
func request_ManagementService_GetGrantedProjectGrantByID_0(ctx context.Context, marshaler runtime.Marshaler, client ManagementServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GrantedGrantID
|
||||
var protoReq ProjectGrantID
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
@@ -1611,6 +1611,17 @@ func request_ManagementService_GetGrantedProjectGrantByID_0(ctx context.Context,
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["project_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_id")
|
||||
}
|
||||
|
||||
protoReq.ProjectId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
|
||||
@@ -4754,7 +4765,7 @@ func RegisterManagementServiceHandlerClient(ctx context.Context, mux *runtime.Se
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_ManagementService_SearchProjects_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
mux.Handle("POST", pattern_ManagementService_SearchGrantedProjects_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)
|
||||
@@ -4763,14 +4774,14 @@ func RegisterManagementServiceHandlerClient(ctx context.Context, mux *runtime.Se
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_ManagementService_SearchProjects_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
resp, md, err := request_ManagementService_SearchGrantedProjects_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_ManagementService_SearchProjects_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
forward_ManagementService_SearchGrantedProjects_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
@@ -6000,7 +6011,7 @@ var (
|
||||
|
||||
pattern_ManagementService_SearchOrgMembers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 2, 2, 2, 3}, []string{"orgs", "org_id", "members", "_search"}, ""))
|
||||
|
||||
pattern_ManagementService_SearchProjects_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"projects", "_search"}, ""))
|
||||
pattern_ManagementService_SearchGrantedProjects_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"grantedprojects", "_search"}, ""))
|
||||
|
||||
pattern_ManagementService_ProjectByID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"projects", "id"}, ""))
|
||||
|
||||
@@ -6012,7 +6023,7 @@ var (
|
||||
|
||||
pattern_ManagementService_ReactivateProject_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 2, 2}, []string{"projects", "id", "_reactivate"}, ""))
|
||||
|
||||
pattern_ManagementService_GetGrantedProjectGrantByID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"grants", "id"}, ""))
|
||||
pattern_ManagementService_GetGrantedProjectGrantByID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"grantedprojects", "project_id", "grants", "id"}, ""))
|
||||
|
||||
pattern_ManagementService_GetProjectMemberRoles_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"projects", "members", "roles"}, ""))
|
||||
|
||||
@@ -6218,7 +6229,7 @@ var (
|
||||
|
||||
forward_ManagementService_SearchOrgMembers_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_ManagementService_SearchProjects_0 = runtime.ForwardResponseMessage
|
||||
forward_ManagementService_SearchGrantedProjects_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_ManagementService_ProjectByID_0 = runtime.ForwardResponseMessage
|
||||
|
||||
|
||||
@@ -132,7 +132,34 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"/grants/{id}": {
|
||||
"/grantedprojects/_search": {
|
||||
"post": {
|
||||
"summary": "PROJECTS",
|
||||
"operationId": "SearchGrantedProjects",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "A successful response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/v1GrantedProjectSearchResponse"
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/v1GrantedProjectSearchRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"ManagementService"
|
||||
]
|
||||
}
|
||||
},
|
||||
"/grantedprojects/{project_id}/grants/{id}": {
|
||||
"get": {
|
||||
"summary": "GRANTED_PROJECT_GRANTS",
|
||||
"operationId": "GetGrantedProjectGrantByID",
|
||||
@@ -145,6 +172,12 @@
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "project_id",
|
||||
"in": "path",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
@@ -996,33 +1029,6 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"/projects/_search": {
|
||||
"post": {
|
||||
"summary": "PROJECTS",
|
||||
"operationId": "SearchProjects",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "A successful response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/v1ProjectSearchResponse"
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/v1ProjectSearchRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"ManagementService"
|
||||
]
|
||||
}
|
||||
},
|
||||
"/projects/grants/members/roles": {
|
||||
"get": {
|
||||
"summary": "PROJECT_GRANT_MEMBER",
|
||||
@@ -3538,7 +3544,7 @@
|
||||
"result": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/v1Application"
|
||||
"$ref": "#/definitions/v1ApplicationView"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3557,6 +3563,35 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1ApplicationView": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"state": {
|
||||
"$ref": "#/definitions/v1AppState"
|
||||
},
|
||||
"creation_date": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"change_date": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"oidc_config": {
|
||||
"$ref": "#/definitions/v1OIDCConfig"
|
||||
},
|
||||
"sequence": {
|
||||
"type": "string",
|
||||
"format": "uint64"
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1AuthGrant": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -3784,6 +3819,114 @@
|
||||
],
|
||||
"default": "GENDER_UNSPECIFIED"
|
||||
},
|
||||
"v1GrantedProject": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"state": {
|
||||
"$ref": "#/definitions/v1ProjectState"
|
||||
},
|
||||
"change_date": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"creation_date": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"type": {
|
||||
"$ref": "#/definitions/v1ProjectType"
|
||||
},
|
||||
"resource_owner": {
|
||||
"type": "string"
|
||||
},
|
||||
"org_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"org_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"org_domain": {
|
||||
"type": "string"
|
||||
},
|
||||
"grant_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"sequence": {
|
||||
"type": "string",
|
||||
"format": "uint64"
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1GrantedProjectSearchKey": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"PROJECTSEARCHKEY_UNSPECIFIED",
|
||||
"PROJECTSEARCHKEY_PROJECT_NAME"
|
||||
],
|
||||
"default": "PROJECTSEARCHKEY_UNSPECIFIED"
|
||||
},
|
||||
"v1GrantedProjectSearchQuery": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"key": {
|
||||
"$ref": "#/definitions/v1GrantedProjectSearchKey"
|
||||
},
|
||||
"method": {
|
||||
"$ref": "#/definitions/v1SearchMethod"
|
||||
},
|
||||
"value": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1GrantedProjectSearchRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"offset": {
|
||||
"type": "string",
|
||||
"format": "uint64"
|
||||
},
|
||||
"limit": {
|
||||
"type": "string",
|
||||
"format": "uint64"
|
||||
},
|
||||
"queries": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/v1GrantedProjectSearchQuery"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1GrantedProjectSearchResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"offset": {
|
||||
"type": "string",
|
||||
"format": "uint64"
|
||||
},
|
||||
"limit": {
|
||||
"type": "string",
|
||||
"format": "uint64"
|
||||
},
|
||||
"total_result": {
|
||||
"type": "string",
|
||||
"format": "uint64"
|
||||
},
|
||||
"result": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/v1GrantedProject"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1MFAState": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
@@ -4441,24 +4584,6 @@
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"type": {
|
||||
"$ref": "#/definitions/v1ProjectType"
|
||||
},
|
||||
"resource_owner": {
|
||||
"type": "string"
|
||||
},
|
||||
"org_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"org_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"org_domain": {
|
||||
"type": "string"
|
||||
},
|
||||
"grant_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"sequence": {
|
||||
"type": "string",
|
||||
"format": "uint64"
|
||||
@@ -4485,12 +4610,6 @@
|
||||
"granted_org_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"granted_org_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"granted_org_domain": {
|
||||
"type": "string"
|
||||
},
|
||||
"role_keys": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
@@ -4508,9 +4627,6 @@
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"project_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"sequence": {
|
||||
"type": "string",
|
||||
"format": "uint64"
|
||||
@@ -4551,18 +4667,6 @@
|
||||
"user_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"user_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"email": {
|
||||
"type": "string"
|
||||
},
|
||||
"first_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"last_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"roles": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
@@ -4641,7 +4745,8 @@
|
||||
"PROJECTGRANTMEMBERSEARCHKEY_FIRST_NAME",
|
||||
"PROJECTGRANTMEMBERSEARCHKEY_LAST_NAME",
|
||||
"PROJECTGRANTMEMBERSEARCHKEY_EMAIL",
|
||||
"PROJECTGRANTMEMBERSEARCHKEY_USER_ID"
|
||||
"PROJECTGRANTMEMBERSEARCHKEY_USER_ID",
|
||||
"PROJECTGRANTMEMBERSEARCHKEY_USER_NAME"
|
||||
],
|
||||
"default": "PROJECTGRANTMEMBERSEARCHKEY_UNSPECIFIED"
|
||||
},
|
||||
@@ -4702,11 +4807,49 @@
|
||||
"result": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/v1ProjectGrantMember"
|
||||
"$ref": "#/definitions/v1ProjectGrantMemberView"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1ProjectGrantMemberView": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"user_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"user_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"email": {
|
||||
"type": "string"
|
||||
},
|
||||
"first_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"last_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"roles": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"change_date": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"creation_date": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"sequence": {
|
||||
"type": "string",
|
||||
"format": "uint64"
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1ProjectGrantSearchRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -4741,7 +4884,7 @@
|
||||
"result": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/v1ProjectGrant"
|
||||
"$ref": "#/definitions/v1ProjectGrantView"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4851,6 +4994,50 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1ProjectGrantView": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"project_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"granted_org_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"granted_org_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"granted_org_domain": {
|
||||
"type": "string"
|
||||
},
|
||||
"role_keys": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"state": {
|
||||
"$ref": "#/definitions/v1ProjectGrantState"
|
||||
},
|
||||
"creation_date": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"change_date": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"project_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"sequence": {
|
||||
"type": "string",
|
||||
"format": "uint64"
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1ProjectID": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -4865,18 +5052,6 @@
|
||||
"user_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"user_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"email": {
|
||||
"type": "string"
|
||||
},
|
||||
"first_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"last_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"roles": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
@@ -4949,7 +5124,8 @@
|
||||
"PROJECTMEMBERSEARCHKEY_FIRST_NAME",
|
||||
"PROJECTMEMBERSEARCHKEY_LAST_NAME",
|
||||
"PROJECTMEMBERSEARCHKEY_EMAIL",
|
||||
"PROJECTMEMBERSEARCHKEY_USER_ID"
|
||||
"PROJECTMEMBERSEARCHKEY_USER_ID",
|
||||
"PROJECTMEMBERSEARCHKEY_USER_NAME"
|
||||
],
|
||||
"default": "PROJECTMEMBERSEARCHKEY_UNSPECIFIED"
|
||||
},
|
||||
@@ -5007,11 +5183,49 @@
|
||||
"result": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/v1ProjectMember"
|
||||
"$ref": "#/definitions/v1ProjectMemberView"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1ProjectMemberView": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"user_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"user_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"email": {
|
||||
"type": "string"
|
||||
},
|
||||
"first_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"last_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"roles": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"change_date": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"creation_date": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"sequence": {
|
||||
"type": "string",
|
||||
"format": "uint64"
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1ProjectRole": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -5138,72 +5352,33 @@
|
||||
"result": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/v1ProjectRole"
|
||||
"$ref": "#/definitions/v1ProjectRoleView"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1ProjectSearchKey": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"PROJECTSEARCHKEY_UNSPECIFIED",
|
||||
"PROJECTSEARCHKEY_PROJECT_NAME"
|
||||
],
|
||||
"default": "PROJECTSEARCHKEY_UNSPECIFIED"
|
||||
},
|
||||
"v1ProjectSearchQuery": {
|
||||
"v1ProjectRoleView": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"key": {
|
||||
"$ref": "#/definitions/v1ProjectSearchKey"
|
||||
},
|
||||
"method": {
|
||||
"$ref": "#/definitions/v1SearchMethod"
|
||||
},
|
||||
"value": {
|
||||
"project_id": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1ProjectSearchRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"offset": {
|
||||
},
|
||||
"key": {
|
||||
"type": "string"
|
||||
},
|
||||
"display_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"creation_date": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"group": {
|
||||
"type": "string"
|
||||
},
|
||||
"sequence": {
|
||||
"type": "string",
|
||||
"format": "uint64"
|
||||
},
|
||||
"limit": {
|
||||
"type": "string",
|
||||
"format": "uint64"
|
||||
},
|
||||
"queries": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/v1ProjectSearchQuery"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1ProjectSearchResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"offset": {
|
||||
"type": "string",
|
||||
"format": "uint64"
|
||||
},
|
||||
"limit": {
|
||||
"type": "string",
|
||||
"format": "uint64"
|
||||
},
|
||||
"total_result": {
|
||||
"type": "string",
|
||||
"format": "uint64"
|
||||
},
|
||||
"result": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/v1Project"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -5219,11 +5394,11 @@
|
||||
"v1ProjectType": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"PROJECTTYPE_UNKNOWN",
|
||||
"PROJECTTYPE_SELF",
|
||||
"PROJECTTYPE_UNSPECIFIED",
|
||||
"PROJECTTYPE_OWNED",
|
||||
"PROJECTTYPE_GRANTED"
|
||||
],
|
||||
"default": "PROJECTTYPE_UNKNOWN"
|
||||
"default": "PROJECTTYPE_UNSPECIFIED"
|
||||
},
|
||||
"v1ProjectUpdateRequest": {
|
||||
"type": "object",
|
||||
@@ -5297,7 +5472,10 @@
|
||||
"enum": [
|
||||
"SEARCHMETHOD_EQUALS",
|
||||
"SEARCHMETHOD_STARTS_WITH",
|
||||
"SEARCHMETHOD_CONTAINS"
|
||||
"SEARCHMETHOD_CONTAINS",
|
||||
"SEARCHMETHOD_EQUALS_IGNORE_CASE",
|
||||
"SEARCHMETHOD_STARTS_WITH_IGNORE_CASE",
|
||||
"SEARCHMETHOD_CONTAINS_IGNORE_CASE"
|
||||
],
|
||||
"default": "SEARCHMETHOD_EQUALS"
|
||||
},
|
||||
|
||||
@@ -718,7 +718,7 @@ func (mr *MockManagementServiceClientMockRecorder) DeleteUser(arg0, arg1 interfa
|
||||
}
|
||||
|
||||
// GetGrantedProjectGrantByID mocks base method
|
||||
func (m *MockManagementServiceClient) GetGrantedProjectGrantByID(arg0 context.Context, arg1 *grpc.GrantedGrantID, arg2 ...grpc0.CallOption) (*grpc.ProjectGrant, error) {
|
||||
func (m *MockManagementServiceClient) GetGrantedProjectGrantByID(arg0 context.Context, arg1 *grpc.ProjectGrantID, arg2 ...grpc0.CallOption) (*grpc.ProjectGrant, error) {
|
||||
m.ctrl.T.Helper()
|
||||
varargs := []interface{}{arg0, arg1}
|
||||
for _, a := range arg2 {
|
||||
@@ -1637,6 +1637,26 @@ func (mr *MockManagementServiceClientMockRecorder) SearchAuthGrant(arg0, arg1 in
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SearchAuthGrant", reflect.TypeOf((*MockManagementServiceClient)(nil).SearchAuthGrant), varargs...)
|
||||
}
|
||||
|
||||
// SearchGrantedProjects mocks base method
|
||||
func (m *MockManagementServiceClient) SearchGrantedProjects(arg0 context.Context, arg1 *grpc.GrantedProjectSearchRequest, arg2 ...grpc0.CallOption) (*grpc.GrantedProjectSearchResponse, error) {
|
||||
m.ctrl.T.Helper()
|
||||
varargs := []interface{}{arg0, arg1}
|
||||
for _, a := range arg2 {
|
||||
varargs = append(varargs, a)
|
||||
}
|
||||
ret := m.ctrl.Call(m, "SearchGrantedProjects", varargs...)
|
||||
ret0, _ := ret[0].(*grpc.GrantedProjectSearchResponse)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// SearchGrantedProjects indicates an expected call of SearchGrantedProjects
|
||||
func (mr *MockManagementServiceClientMockRecorder) SearchGrantedProjects(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
varargs := append([]interface{}{arg0, arg1}, arg2...)
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SearchGrantedProjects", reflect.TypeOf((*MockManagementServiceClient)(nil).SearchGrantedProjects), varargs...)
|
||||
}
|
||||
|
||||
// SearchOrgMembers mocks base method
|
||||
func (m *MockManagementServiceClient) SearchOrgMembers(arg0 context.Context, arg1 *grpc.OrgMemberSearchRequest, arg2 ...grpc0.CallOption) (*grpc.OrgMemberSearchResponse, error) {
|
||||
m.ctrl.T.Helper()
|
||||
@@ -1777,26 +1797,6 @@ func (mr *MockManagementServiceClientMockRecorder) SearchProjectUserGrants(arg0,
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SearchProjectUserGrants", reflect.TypeOf((*MockManagementServiceClient)(nil).SearchProjectUserGrants), varargs...)
|
||||
}
|
||||
|
||||
// SearchProjects mocks base method
|
||||
func (m *MockManagementServiceClient) SearchProjects(arg0 context.Context, arg1 *grpc.ProjectSearchRequest, arg2 ...grpc0.CallOption) (*grpc.ProjectSearchResponse, error) {
|
||||
m.ctrl.T.Helper()
|
||||
varargs := []interface{}{arg0, arg1}
|
||||
for _, a := range arg2 {
|
||||
varargs = append(varargs, a)
|
||||
}
|
||||
ret := m.ctrl.Call(m, "SearchProjects", varargs...)
|
||||
ret0, _ := ret[0].(*grpc.ProjectSearchResponse)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// SearchProjects indicates an expected call of SearchProjects
|
||||
func (mr *MockManagementServiceClientMockRecorder) SearchProjects(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
varargs := append([]interface{}{arg0, arg1}, arg2...)
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SearchProjects", reflect.TypeOf((*MockManagementServiceClient)(nil).SearchProjects), varargs...)
|
||||
}
|
||||
|
||||
// SearchUserGrants mocks base method
|
||||
func (m *MockManagementServiceClient) SearchUserGrants(arg0 context.Context, arg1 *grpc.UserGrantSearchRequest, arg2 ...grpc0.CallOption) (*grpc.UserGrantSearchResponse, error) {
|
||||
m.ctrl.T.Helper()
|
||||
|
||||
@@ -35,8 +35,14 @@ func (s *Server) ReactivateProject(ctx context.Context, in *ProjectID) (*Project
|
||||
return projectFromModel(project), nil
|
||||
}
|
||||
|
||||
func (s *Server) SearchProjects(ctx context.Context, in *ProjectSearchRequest) (*ProjectSearchResponse, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-2sFvd", "Not implemented")
|
||||
func (s *Server) SearchGrantedProjects(ctx context.Context, in *GrantedProjectSearchRequest) (*GrantedProjectSearchResponse, error) {
|
||||
request := grantedProjectSearchRequestsToModel(in)
|
||||
request.AppendMyOrgQuery(ctx)
|
||||
response, err := s.project.SearchGrantedProjects(ctx, request)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return grantedProjectSearchResponseFromModel(response), nil
|
||||
}
|
||||
|
||||
func (s *Server) ProjectByID(ctx context.Context, id *ProjectID) (*Project, error) {
|
||||
@@ -47,8 +53,12 @@ func (s *Server) ProjectByID(ctx context.Context, id *ProjectID) (*Project, erro
|
||||
return projectFromModel(project), nil
|
||||
}
|
||||
|
||||
func (s *Server) GetGrantedProjectGrantByID(ctx context.Context, request *GrantedGrantID) (*ProjectGrant, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-974vd", "Not implemented")
|
||||
func (s *Server) GetGrantedProjectGrantByID(ctx context.Context, in *ProjectGrantID) (*ProjectGrant, error) {
|
||||
project, err := s.project.ProjectGrantByID(ctx, in.ProjectId, in.Id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return projectGrantFromModel(project), nil
|
||||
}
|
||||
|
||||
func (s *Server) AddProjectRole(ctx context.Context, in *ProjectRoleAdd) (*ProjectRole, error) {
|
||||
@@ -72,7 +82,13 @@ func (s *Server) RemoveProjectRole(ctx context.Context, in *ProjectRoleRemove) (
|
||||
}
|
||||
|
||||
func (s *Server) SearchProjectRoles(ctx context.Context, in *ProjectRoleSearchRequest) (*ProjectRoleSearchResponse, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-plV56", "Not implemented")
|
||||
request := projectRoleSearchRequestsToModel(in)
|
||||
request.AppendMyOrgQuery(ctx)
|
||||
response, err := s.project.SearchProjectRoles(ctx, request)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return projectRoleSearchResponseFromModel(response), nil
|
||||
}
|
||||
|
||||
func (s *Server) ProjectChanges(ctx context.Context, changesRequest *ChangeRequest) (*Changes, error) {
|
||||
|
||||
@@ -24,6 +24,76 @@ func projectFromModel(project *proj_model.Project) *Project {
|
||||
}
|
||||
}
|
||||
|
||||
func grantedProjectSearchResponseFromModel(response *proj_model.GrantedProjectSearchResponse) *GrantedProjectSearchResponse {
|
||||
return &GrantedProjectSearchResponse{
|
||||
Offset: response.Offset,
|
||||
Limit: response.Limit,
|
||||
TotalResult: response.TotalResult,
|
||||
Result: grantedProjectsFromModel(response.Result),
|
||||
}
|
||||
}
|
||||
|
||||
func grantedProjectsFromModel(projects []*proj_model.GrantedProjectView) []*GrantedProject {
|
||||
converted := make([]*GrantedProject, len(projects))
|
||||
for i, project := range projects {
|
||||
converted[i] = grantedProjectFromModel(project)
|
||||
}
|
||||
return converted
|
||||
}
|
||||
|
||||
func grantedProjectFromModel(project *proj_model.GrantedProjectView) *GrantedProject {
|
||||
creationDate, err := ptypes.TimestampProto(project.CreationDate)
|
||||
logging.Log("GRPC-dlso3").OnError(err).Debug("unable to parse timestamp")
|
||||
|
||||
changeDate, err := ptypes.TimestampProto(project.ChangeDate)
|
||||
logging.Log("GRPC-sope3").OnError(err).Debug("unable to parse timestamp")
|
||||
|
||||
return &GrantedProject{
|
||||
Id: project.ProjectID,
|
||||
State: projectStateFromModel(project.State),
|
||||
CreationDate: creationDate,
|
||||
ChangeDate: changeDate,
|
||||
Name: project.Name,
|
||||
Sequence: project.Sequence,
|
||||
ResourceOwner: project.ResourceOwner,
|
||||
OrgId: project.OrgID,
|
||||
OrgName: project.OrgName,
|
||||
OrgDomain: project.OrgDomain,
|
||||
GrantId: project.GrantID,
|
||||
}
|
||||
}
|
||||
|
||||
func projectRoleSearchResponseFromModel(response *proj_model.ProjectRoleSearchResponse) *ProjectRoleSearchResponse {
|
||||
return &ProjectRoleSearchResponse{
|
||||
Offset: response.Offset,
|
||||
Limit: response.Limit,
|
||||
TotalResult: response.TotalResult,
|
||||
Result: projectRoleViewsFromModel(response.Result),
|
||||
}
|
||||
}
|
||||
|
||||
func projectRoleViewsFromModel(roles []*proj_model.ProjectRoleView) []*ProjectRoleView {
|
||||
converted := make([]*ProjectRoleView, len(roles))
|
||||
for i, role := range roles {
|
||||
converted[i] = projectRoleViewFromModel(role)
|
||||
}
|
||||
return converted
|
||||
}
|
||||
|
||||
func projectRoleViewFromModel(role *proj_model.ProjectRoleView) *ProjectRoleView {
|
||||
creationDate, err := ptypes.TimestampProto(role.CreationDate)
|
||||
logging.Log("GRPC-dlso3").OnError(err).Debug("unable to parse timestamp")
|
||||
|
||||
return &ProjectRoleView{
|
||||
ProjectId: role.ProjectID,
|
||||
CreationDate: creationDate,
|
||||
Key: role.Key,
|
||||
Group: role.Group,
|
||||
DisplayName: role.DisplayName,
|
||||
Sequence: role.Sequence,
|
||||
}
|
||||
}
|
||||
|
||||
func projectStateFromModel(state proj_model.ProjectState) ProjectState {
|
||||
switch state {
|
||||
case proj_model.PROJECTSTATE_ACTIVE:
|
||||
@@ -35,6 +105,17 @@ func projectStateFromModel(state proj_model.ProjectState) ProjectState {
|
||||
}
|
||||
}
|
||||
|
||||
func projectTypeFromModel(projecttype proj_model.ProjectType) ProjectType {
|
||||
switch projecttype {
|
||||
case proj_model.PROJECTTYPE_OWNED:
|
||||
return ProjectType_PROJECTTYPE_OWNED
|
||||
case proj_model.PROJECTTYPE_GRANTED:
|
||||
return ProjectType_PROJECTTYPE_GRANTED
|
||||
default:
|
||||
return ProjectType_PROJECTTYPE_UNSPECIFIED
|
||||
}
|
||||
}
|
||||
|
||||
func projectUpdateToModel(project *ProjectUpdateRequest) *proj_model.Project {
|
||||
return &proj_model.Project{
|
||||
ObjectRoot: models.ObjectRoot{
|
||||
@@ -82,3 +163,71 @@ func projectRoleChangeToModel(role *ProjectRoleChange) *proj_model.ProjectRole {
|
||||
Group: role.Group,
|
||||
}
|
||||
}
|
||||
|
||||
func grantedProjectSearchRequestsToModel(project *GrantedProjectSearchRequest) *proj_model.GrantedProjectSearchRequest {
|
||||
return &proj_model.GrantedProjectSearchRequest{
|
||||
Offset: project.Offset,
|
||||
Limit: project.Limit,
|
||||
Queries: grantedProjectSearchQueriesToModel(project.Queries),
|
||||
}
|
||||
}
|
||||
|
||||
func grantedProjectSearchQueriesToModel(queries []*GrantedProjectSearchQuery) []*proj_model.GrantedProjectSearchQuery {
|
||||
converted := make([]*proj_model.GrantedProjectSearchQuery, len(queries))
|
||||
for i, q := range queries {
|
||||
converted[i] = grantedProjectSearchQueryToModel(q)
|
||||
}
|
||||
return converted
|
||||
}
|
||||
|
||||
func grantedProjectSearchQueryToModel(query *GrantedProjectSearchQuery) *proj_model.GrantedProjectSearchQuery {
|
||||
return &proj_model.GrantedProjectSearchQuery{
|
||||
Key: projectSearchKeyToModel(query.Key),
|
||||
Method: searchMethodToModel(query.Method),
|
||||
Value: query.Value,
|
||||
}
|
||||
}
|
||||
|
||||
func projectSearchKeyToModel(key GrantedProjectSearchKey) proj_model.GrantedProjectSearchKey {
|
||||
switch key {
|
||||
case GrantedProjectSearchKey_PROJECTSEARCHKEY_PROJECT_NAME:
|
||||
return proj_model.GRANTEDPROJECTSEARCHKEY_NAME
|
||||
default:
|
||||
return proj_model.GRANTEDPROJECTSEARCHKEY_UNSPECIFIED
|
||||
}
|
||||
}
|
||||
|
||||
func projectRoleSearchRequestsToModel(role *ProjectRoleSearchRequest) *proj_model.ProjectRoleSearchRequest {
|
||||
return &proj_model.ProjectRoleSearchRequest{
|
||||
Offset: role.Offset,
|
||||
Limit: role.Limit,
|
||||
Queries: projectRoleSearchQueriesToModel(role.Queries),
|
||||
}
|
||||
}
|
||||
|
||||
func projectRoleSearchQueriesToModel(queries []*ProjectRoleSearchQuery) []*proj_model.ProjectRoleSearchQuery {
|
||||
converted := make([]*proj_model.ProjectRoleSearchQuery, len(queries))
|
||||
for i, q := range queries {
|
||||
converted[i] = projectRoleSearchQueryToModel(q)
|
||||
}
|
||||
return converted
|
||||
}
|
||||
|
||||
func projectRoleSearchQueryToModel(query *ProjectRoleSearchQuery) *proj_model.ProjectRoleSearchQuery {
|
||||
return &proj_model.ProjectRoleSearchQuery{
|
||||
Key: projectRoleSearchKeyToModel(query.Key),
|
||||
Method: searchMethodToModel(query.Method),
|
||||
Value: query.Value,
|
||||
}
|
||||
}
|
||||
|
||||
func projectRoleSearchKeyToModel(key ProjectRoleSearchKey) proj_model.ProjectRoleSearchKey {
|
||||
switch key {
|
||||
case ProjectRoleSearchKey_PROJECTROLESEARCHKEY_KEY:
|
||||
return proj_model.PROJECTROLESEARCHKEY_KEY
|
||||
case ProjectRoleSearchKey_PROJECTROLESEARCHKEY_DISPLAY_NAME:
|
||||
return proj_model.PROJECTROLESEARCHKEY_DISPLAY_NAME
|
||||
default:
|
||||
return proj_model.PROJECTROLESEARCHKEY_UNSPECIFIED
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,14 @@ func (s *Server) GetProjectGrantMemberRoles(ctx context.Context, _ *empty.Empty)
|
||||
}
|
||||
|
||||
func (s *Server) SearchProjectGrants(ctx context.Context, in *ProjectGrantSearchRequest) (*ProjectGrantSearchResponse, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-po9fs", "Not implemented")
|
||||
request := projectGrantSearchRequestsToModel(in)
|
||||
request.AppendMyResourceOwnerQuery(ctx)
|
||||
request.AppendNotMyOrgQuery(ctx)
|
||||
response, err := s.project.SearchGrantedProjects(ctx, request)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return projectGrantSearchResponseFromModel(response), nil
|
||||
}
|
||||
|
||||
func (s *Server) ProjectGrantByID(ctx context.Context, in *ProjectGrantID) (*ProjectGrant, error) {
|
||||
|
||||
@@ -3,6 +3,7 @@ package grpc
|
||||
import (
|
||||
"github.com/caos/logging"
|
||||
"github.com/caos/zitadel/internal/eventstore/models"
|
||||
"github.com/caos/zitadel/internal/model"
|
||||
proj_model "github.com/caos/zitadel/internal/project/model"
|
||||
"github.com/golang/protobuf/ptypes"
|
||||
)
|
||||
@@ -45,6 +46,61 @@ func projectGrantUpdateToModel(grant *ProjectGrantUpdate) *proj_model.ProjectGra
|
||||
}
|
||||
}
|
||||
|
||||
func projectGrantSearchRequestsToModel(request *ProjectGrantSearchRequest) *proj_model.GrantedProjectSearchRequest {
|
||||
return &proj_model.GrantedProjectSearchRequest{
|
||||
Offset: request.Offset,
|
||||
Limit: request.Limit,
|
||||
Queries: projectGrantSearchQueriesToModel(request.ProjectId),
|
||||
}
|
||||
}
|
||||
|
||||
func projectGrantSearchQueriesToModel(projectId string) []*proj_model.GrantedProjectSearchQuery {
|
||||
converted := make([]*proj_model.GrantedProjectSearchQuery, 0)
|
||||
return append(converted, &proj_model.GrantedProjectSearchQuery{
|
||||
Key: proj_model.GRANTEDPROJECTSEARCHKEY_PROJECTID,
|
||||
Method: model.SEARCHMETHOD_EQUALS,
|
||||
Value: projectId,
|
||||
})
|
||||
}
|
||||
|
||||
func projectGrantSearchResponseFromModel(response *proj_model.GrantedProjectSearchResponse) *ProjectGrantSearchResponse {
|
||||
return &ProjectGrantSearchResponse{
|
||||
Offset: response.Offset,
|
||||
Limit: response.Limit,
|
||||
TotalResult: response.TotalResult,
|
||||
Result: projectGrantsFromGrantedProjectModel(response.Result),
|
||||
}
|
||||
}
|
||||
|
||||
func projectGrantsFromGrantedProjectModel(projects []*proj_model.GrantedProjectView) []*ProjectGrantView {
|
||||
converted := make([]*ProjectGrantView, len(projects))
|
||||
for i, project := range projects {
|
||||
converted[i] = projectGrantFromGrantedProjectModel(project)
|
||||
}
|
||||
return converted
|
||||
}
|
||||
|
||||
func projectGrantFromGrantedProjectModel(project *proj_model.GrantedProjectView) *ProjectGrantView {
|
||||
creationDate, err := ptypes.TimestampProto(project.CreationDate)
|
||||
logging.Log("GRPC-dlso3").OnError(err).Debug("unable to parse timestamp")
|
||||
|
||||
changeDate, err := ptypes.TimestampProto(project.ChangeDate)
|
||||
logging.Log("GRPC-sope3").OnError(err).Debug("unable to parse timestamp")
|
||||
|
||||
return &ProjectGrantView{
|
||||
ProjectId: project.ProjectID,
|
||||
State: projectGrantStateFromProjectStateModel(project.State),
|
||||
CreationDate: creationDate,
|
||||
ChangeDate: changeDate,
|
||||
ProjectName: project.Name,
|
||||
Sequence: project.Sequence,
|
||||
GrantedOrgId: project.OrgID,
|
||||
GrantedOrgName: project.OrgName,
|
||||
GrantedOrgDomain: project.OrgDomain,
|
||||
Id: project.GrantID,
|
||||
}
|
||||
}
|
||||
|
||||
func projectGrantStateFromModel(state proj_model.ProjectGrantState) ProjectGrantState {
|
||||
switch state {
|
||||
case proj_model.PROJECTGRANTSTATE_ACTIVE:
|
||||
@@ -55,3 +111,14 @@ func projectGrantStateFromModel(state proj_model.ProjectGrantState) ProjectGrant
|
||||
return ProjectGrantState_PROJECTGRANTSTATE_UNSPECIFIED
|
||||
}
|
||||
}
|
||||
|
||||
func projectGrantStateFromProjectStateModel(state proj_model.ProjectState) ProjectGrantState {
|
||||
switch state {
|
||||
case proj_model.PROJECTSTATE_ACTIVE:
|
||||
return ProjectGrantState_PROJECTGRANTSTATE_ACTIVE
|
||||
case proj_model.PROJECTSTATE_INACTIVE:
|
||||
return ProjectGrantState_PROJECTGRANTSTATE_INACTIVE
|
||||
default:
|
||||
return ProjectGrantState_PROJECTGRANTSTATE_UNSPECIFIED
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,12 +2,15 @@ package grpc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/caos/zitadel/internal/errors"
|
||||
"github.com/golang/protobuf/ptypes/empty"
|
||||
)
|
||||
|
||||
func (s *Server) SearchProjectGrantMembers(ctx context.Context, request *ProjectGrantMemberSearchRequest) (*ProjectGrantMemberSearchResponse, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-pldE4", "Not implemented")
|
||||
func (s *Server) SearchProjectGrantMembers(ctx context.Context, in *ProjectGrantMemberSearchRequest) (*ProjectGrantMemberSearchResponse, error) {
|
||||
response, err := s.project.SearchProjectGrantMembers(ctx, projectGrantMemberSearchRequestsToModel(in))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return projectGrantMemberSearchResponseFromModel(response), nil
|
||||
}
|
||||
|
||||
func (s *Server) AddProjectGrantMember(ctx context.Context, in *ProjectGrantMemberAdd) (*ProjectGrantMember, error) {
|
||||
|
||||
@@ -44,3 +44,79 @@ func projectGrantMemberChangeToModel(member *ProjectGrantMemberChange) *proj_mod
|
||||
Roles: member.Roles,
|
||||
}
|
||||
}
|
||||
|
||||
func projectGrantMemberSearchRequestsToModel(role *ProjectGrantMemberSearchRequest) *proj_model.ProjectGrantMemberSearchRequest {
|
||||
return &proj_model.ProjectGrantMemberSearchRequest{
|
||||
Offset: role.Offset,
|
||||
Limit: role.Limit,
|
||||
Queries: projectGrantMemberSearchQueriesToModel(role.Queries),
|
||||
}
|
||||
}
|
||||
|
||||
func projectGrantMemberSearchQueriesToModel(queries []*ProjectGrantMemberSearchQuery) []*proj_model.ProjectGrantMemberSearchQuery {
|
||||
converted := make([]*proj_model.ProjectGrantMemberSearchQuery, len(queries))
|
||||
for i, q := range queries {
|
||||
converted[i] = projectGrantMemberSearchQueryToModel(q)
|
||||
}
|
||||
return converted
|
||||
}
|
||||
|
||||
func projectGrantMemberSearchQueryToModel(query *ProjectGrantMemberSearchQuery) *proj_model.ProjectGrantMemberSearchQuery {
|
||||
return &proj_model.ProjectGrantMemberSearchQuery{
|
||||
Key: projectGrantMemberSearchKeyToModel(query.Key),
|
||||
Method: searchMethodToModel(query.Method),
|
||||
Value: query.Value,
|
||||
}
|
||||
}
|
||||
|
||||
func projectGrantMemberSearchKeyToModel(key ProjectGrantMemberSearchKey) proj_model.ProjectGrantMemberSearchKey {
|
||||
switch key {
|
||||
case ProjectGrantMemberSearchKey_PROJECTGRANTMEMBERSEARCHKEY_EMAIL:
|
||||
return proj_model.PROJECTGRANTMEMBERSEARCHKEY_EMAIL
|
||||
case ProjectGrantMemberSearchKey_PROJECTGRANTMEMBERSEARCHKEY_FIRST_NAME:
|
||||
return proj_model.PROJECTGRANTMEMBERSEARCHKEY_FIRST_NAME
|
||||
case ProjectGrantMemberSearchKey_PROJECTGRANTMEMBERSEARCHKEY_LAST_NAME:
|
||||
return proj_model.PROJECTGRANTMEMBERSEARCHKEY_LAST_NAME
|
||||
case ProjectGrantMemberSearchKey_PROJECTGRANTMEMBERSEARCHKEY_USER_NAME:
|
||||
return proj_model.PROJECTGRANTMEMBERSEARCHKEY_USER_NAME
|
||||
default:
|
||||
return proj_model.PROJECTGRANTMEMBERSEARCHKEY_UNSPECIFIED
|
||||
}
|
||||
}
|
||||
|
||||
func projectGrantMemberSearchResponseFromModel(response *proj_model.ProjectGrantMemberSearchResponse) *ProjectGrantMemberSearchResponse {
|
||||
return &ProjectGrantMemberSearchResponse{
|
||||
Offset: response.Offset,
|
||||
Limit: response.Limit,
|
||||
TotalResult: response.TotalResult,
|
||||
Result: projectGrantMemberViewsFromModel(response.Result),
|
||||
}
|
||||
}
|
||||
|
||||
func projectGrantMemberViewsFromModel(roles []*proj_model.ProjectGrantMemberView) []*ProjectGrantMemberView {
|
||||
converted := make([]*ProjectGrantMemberView, len(roles))
|
||||
for i, role := range roles {
|
||||
converted[i] = projectGrantMemberViewFromModel(role)
|
||||
}
|
||||
return converted
|
||||
}
|
||||
|
||||
func projectGrantMemberViewFromModel(member *proj_model.ProjectGrantMemberView) *ProjectGrantMemberView {
|
||||
creationDate, err := ptypes.TimestampProto(member.CreationDate)
|
||||
logging.Log("GRPC-los93").OnError(err).Debug("unable to parse timestamp")
|
||||
|
||||
changeDate, err := ptypes.TimestampProto(member.ChangeDate)
|
||||
logging.Log("GRPC-ski4e").OnError(err).Debug("unable to parse timestamp")
|
||||
|
||||
return &ProjectGrantMemberView{
|
||||
UserId: member.UserID,
|
||||
UserName: member.UserName,
|
||||
Email: member.Email,
|
||||
FirstName: member.FirstName,
|
||||
LastName: member.LastName,
|
||||
Roles: member.Roles,
|
||||
CreationDate: creationDate,
|
||||
ChangeDate: changeDate,
|
||||
Sequence: member.Sequence,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,8 +10,12 @@ func (s *Server) GetProjectMemberRoles(ctx context.Context, _ *empty.Empty) (*Pr
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-qw34d", "Not implemented")
|
||||
}
|
||||
|
||||
func (s *Server) SearchProjectMembers(ctx context.Context, request *ProjectMemberSearchRequest) (*ProjectMemberSearchResponse, error) {
|
||||
return nil, errors.ThrowUnimplemented(nil, "GRPC-PLr84", "Not implemented")
|
||||
func (s *Server) SearchProjectMembers(ctx context.Context, in *ProjectMemberSearchRequest) (*ProjectMemberSearchResponse, error) {
|
||||
response, err := s.project.SearchProjectMembers(ctx, projectMemberSearchRequestsToModel(in))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return projectMemberSearchResponseFromModel(response), nil
|
||||
}
|
||||
|
||||
func (s *Server) AddProjectMember(ctx context.Context, in *ProjectMemberAdd) (*ProjectMember, error) {
|
||||
|
||||
@@ -42,3 +42,79 @@ func projectMemberChangeToModel(member *ProjectMemberChange) *proj_model.Project
|
||||
Roles: member.Roles,
|
||||
}
|
||||
}
|
||||
|
||||
func projectMemberSearchRequestsToModel(role *ProjectMemberSearchRequest) *proj_model.ProjectMemberSearchRequest {
|
||||
return &proj_model.ProjectMemberSearchRequest{
|
||||
Offset: role.Offset,
|
||||
Limit: role.Limit,
|
||||
Queries: projectMemberSearchQueriesToModel(role.Queries),
|
||||
}
|
||||
}
|
||||
|
||||
func projectMemberSearchQueriesToModel(queries []*ProjectMemberSearchQuery) []*proj_model.ProjectMemberSearchQuery {
|
||||
converted := make([]*proj_model.ProjectMemberSearchQuery, len(queries))
|
||||
for i, q := range queries {
|
||||
converted[i] = projectMemberSearchQueryToModel(q)
|
||||
}
|
||||
return converted
|
||||
}
|
||||
|
||||
func projectMemberSearchQueryToModel(query *ProjectMemberSearchQuery) *proj_model.ProjectMemberSearchQuery {
|
||||
return &proj_model.ProjectMemberSearchQuery{
|
||||
Key: projectMemberSearchKeyToModel(query.Key),
|
||||
Method: searchMethodToModel(query.Method),
|
||||
Value: query.Value,
|
||||
}
|
||||
}
|
||||
|
||||
func projectMemberSearchKeyToModel(key ProjectMemberSearchKey) proj_model.ProjectMemberSearchKey {
|
||||
switch key {
|
||||
case ProjectMemberSearchKey_PROJECTMEMBERSEARCHKEY_EMAIL:
|
||||
return proj_model.PROJECTMEMBERSEARCHKEY_EMAIL
|
||||
case ProjectMemberSearchKey_PROJECTMEMBERSEARCHKEY_FIRST_NAME:
|
||||
return proj_model.PROJECTMEMBERSEARCHKEY_FIRST_NAME
|
||||
case ProjectMemberSearchKey_PROJECTMEMBERSEARCHKEY_LAST_NAME:
|
||||
return proj_model.PROJECTMEMBERSEARCHKEY_LAST_NAME
|
||||
case ProjectMemberSearchKey_PROJECTMEMBERSEARCHKEY_USER_NAME:
|
||||
return proj_model.PROJECTMEMBERSEARCHKEY_USER_NAME
|
||||
default:
|
||||
return proj_model.PROJECTMEMBERSEARCHKEY_UNSPECIFIED
|
||||
}
|
||||
}
|
||||
|
||||
func projectMemberSearchResponseFromModel(response *proj_model.ProjectMemberSearchResponse) *ProjectMemberSearchResponse {
|
||||
return &ProjectMemberSearchResponse{
|
||||
Offset: response.Offset,
|
||||
Limit: response.Limit,
|
||||
TotalResult: response.TotalResult,
|
||||
Result: projectMemberViewsFromModel(response.Result),
|
||||
}
|
||||
}
|
||||
|
||||
func projectMemberViewsFromModel(members []*proj_model.ProjectMemberView) []*ProjectMemberView {
|
||||
converted := make([]*ProjectMemberView, len(members))
|
||||
for i, member := range members {
|
||||
converted[i] = projectMemberViewFromModel(member)
|
||||
}
|
||||
return converted
|
||||
}
|
||||
|
||||
func projectMemberViewFromModel(member *proj_model.ProjectMemberView) *ProjectMemberView {
|
||||
creationDate, err := ptypes.TimestampProto(member.CreationDate)
|
||||
logging.Log("GRPC-sl9cs").OnError(err).Debug("unable to parse timestamp")
|
||||
|
||||
changeDate, err := ptypes.TimestampProto(member.ChangeDate)
|
||||
logging.Log("GRPC-8iw2d").OnError(err).Debug("unable to parse timestamp")
|
||||
|
||||
return &ProjectMemberView{
|
||||
UserId: member.UserID,
|
||||
UserName: member.UserName,
|
||||
Email: member.Email,
|
||||
FirstName: member.FirstName,
|
||||
LastName: member.LastName,
|
||||
Roles: member.Roles,
|
||||
CreationDate: creationDate,
|
||||
ChangeDate: changeDate,
|
||||
Sequence: member.Sequence,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package grpc
|
||||
|
||||
import "github.com/caos/zitadel/internal/model"
|
||||
|
||||
func searchMethodToModel(method SearchMethod) model.SearchMethod {
|
||||
switch method {
|
||||
case SearchMethod_SEARCHMETHOD_EQUALS:
|
||||
return model.SEARCHMETHOD_EQUALS
|
||||
case SearchMethod_SEARCHMETHOD_CONTAINS:
|
||||
return model.SEARCHMETHOD_CONTAINS
|
||||
case SearchMethod_SEARCHMETHOD_STARTS_WITH:
|
||||
return model.SEARCHMETHOD_STARTS_WITH
|
||||
case SearchMethod_SEARCHMETHOD_EQUALS_IGNORE_CASE:
|
||||
return model.SEARCHMETHOD_EQUALS_IGNORE_CASE
|
||||
case SearchMethod_SEARCHMETHOD_CONTAINS_IGNORE_CASE:
|
||||
return model.SEARCHMETHOD_CONTAINS_IGNORE_CASE
|
||||
case SearchMethod_SEARCHMETHOD_STARTS_WITH_IGNORE_CASE:
|
||||
return model.SEARCHMETHOD_STARTS_WITH_IGNORE_CASE
|
||||
default:
|
||||
return model.SEARCHMETHOD_EQUALS
|
||||
}
|
||||
}
|
||||
@@ -571,9 +571,9 @@ service ManagementService {
|
||||
}
|
||||
|
||||
//PROJECTS
|
||||
rpc SearchProjects(ProjectSearchRequest) returns (ProjectSearchResponse) {
|
||||
rpc SearchGrantedProjects(GrantedProjectSearchRequest) returns (GrantedProjectSearchResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/projects/_search"
|
||||
post: "/grantedprojects/_search"
|
||||
body: "*"
|
||||
};
|
||||
|
||||
@@ -641,9 +641,9 @@ service ManagementService {
|
||||
}
|
||||
|
||||
//GRANTED_PROJECT_GRANTS
|
||||
rpc GetGrantedProjectGrantByID(GrantedGrantID) returns (ProjectGrant) {
|
||||
rpc GetGrantedProjectGrantByID(ProjectGrantID) returns (ProjectGrant) {
|
||||
option (google.api.http) = {
|
||||
get: "/grants/{id}"
|
||||
get: "/grantedprojects/{project_id}/grants/{id}"
|
||||
};
|
||||
|
||||
option (caos.zitadel.utils.v1.auth_option) = {
|
||||
@@ -1366,9 +1366,11 @@ enum SearchMethod {
|
||||
SEARCHMETHOD_EQUALS = 0;
|
||||
SEARCHMETHOD_STARTS_WITH = 1;
|
||||
SEARCHMETHOD_CONTAINS = 2;
|
||||
SEARCHMETHOD_EQUALS_IGNORE_CASE = 3;
|
||||
SEARCHMETHOD_STARTS_WITH_IGNORE_CASE = 4;
|
||||
SEARCHMETHOD_CONTAINS_IGNORE_CASE = 5;
|
||||
}
|
||||
|
||||
|
||||
message UserProfile {
|
||||
string id = 1;
|
||||
string first_name = 2;
|
||||
@@ -1693,13 +1695,7 @@ message Project {
|
||||
ProjectState state = 3;
|
||||
google.protobuf.Timestamp change_date = 4;
|
||||
google.protobuf.Timestamp creation_date = 5;
|
||||
ProjectType type = 6;
|
||||
string resource_owner = 7;
|
||||
string org_id = 8;
|
||||
string org_name = 9;
|
||||
string org_domain = 10;
|
||||
string grant_id = 11;
|
||||
uint64 sequence = 12;
|
||||
uint64 sequence = 6;
|
||||
}
|
||||
|
||||
enum ProjectState {
|
||||
@@ -1709,31 +1705,46 @@ enum ProjectState {
|
||||
}
|
||||
|
||||
enum ProjectType {
|
||||
PROJECTTYPE_UNKNOWN = 0;
|
||||
PROJECTTYPE_SELF = 1;
|
||||
PROJECTTYPE_UNSPECIFIED = 0;
|
||||
PROJECTTYPE_OWNED = 1;
|
||||
PROJECTTYPE_GRANTED = 2;
|
||||
}
|
||||
|
||||
message ProjectSearchResponse {
|
||||
message GrantedProjectSearchResponse {
|
||||
uint64 offset = 1;
|
||||
uint64 limit = 2;
|
||||
uint64 total_result = 3;
|
||||
repeated Project result = 4;
|
||||
repeated GrantedProject result = 4;
|
||||
}
|
||||
|
||||
message ProjectSearchRequest {
|
||||
message GrantedProject {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
ProjectState state = 3;
|
||||
google.protobuf.Timestamp change_date = 4;
|
||||
google.protobuf.Timestamp creation_date = 5;
|
||||
ProjectType type = 6;
|
||||
string resource_owner = 7;
|
||||
string org_id = 8;
|
||||
string org_name = 9;
|
||||
string org_domain = 10;
|
||||
string grant_id = 11;
|
||||
uint64 sequence = 12;
|
||||
}
|
||||
|
||||
message GrantedProjectSearchRequest {
|
||||
uint64 offset = 1;
|
||||
uint64 limit = 2;
|
||||
repeated ProjectSearchQuery queries = 3;
|
||||
repeated GrantedProjectSearchQuery queries = 3;
|
||||
}
|
||||
|
||||
message ProjectSearchQuery {
|
||||
ProjectSearchKey key = 1 [(validate.rules).enum = {not_in: [0]}];
|
||||
message GrantedProjectSearchQuery {
|
||||
GrantedProjectSearchKey key = 1 [(validate.rules).enum = {not_in: [0]}];
|
||||
SearchMethod method = 2;
|
||||
string value = 3;
|
||||
}
|
||||
|
||||
enum ProjectSearchKey {
|
||||
enum GrantedProjectSearchKey {
|
||||
PROJECTSEARCHKEY_UNSPECIFIED = 0;
|
||||
PROJECTSEARCHKEY_PROJECT_NAME = 1;
|
||||
}
|
||||
@@ -1744,14 +1755,10 @@ message ProjectMemberRoles {
|
||||
|
||||
message ProjectMember {
|
||||
string user_id = 1;
|
||||
string user_name = 2;
|
||||
string email = 3;
|
||||
string first_name = 4;
|
||||
string last_name = 5;
|
||||
repeated string roles = 6;
|
||||
google.protobuf.Timestamp change_date = 7;
|
||||
google.protobuf.Timestamp creation_date = 8;
|
||||
uint64 sequence = 10;
|
||||
repeated string roles = 2;
|
||||
google.protobuf.Timestamp change_date = 3;
|
||||
google.protobuf.Timestamp creation_date = 4;
|
||||
uint64 sequence = 5;
|
||||
}
|
||||
|
||||
message ProjectMemberAdd {
|
||||
@@ -1795,6 +1802,15 @@ message ProjectRole {
|
||||
uint64 sequence = 7;
|
||||
}
|
||||
|
||||
message ProjectRoleView {
|
||||
string project_id = 1;
|
||||
string key = 2;
|
||||
string display_name = 3;
|
||||
google.protobuf.Timestamp creation_date = 4;
|
||||
string group = 6;
|
||||
uint64 sequence = 7;
|
||||
}
|
||||
|
||||
message ProjectRoleRemove {
|
||||
string id = 1;
|
||||
string key = 2;
|
||||
@@ -1804,7 +1820,7 @@ message ProjectRoleSearchResponse {
|
||||
uint64 offset = 1;
|
||||
uint64 limit = 2;
|
||||
uint64 total_result = 3;
|
||||
repeated ProjectRole result = 4;
|
||||
repeated ProjectRoleView result = 4;
|
||||
}
|
||||
|
||||
message ProjectRoleSearchRequest {
|
||||
@@ -1826,11 +1842,23 @@ enum ProjectRoleSearchKey {
|
||||
PROJECTROLESEARCHKEY_DISPLAY_NAME = 2;
|
||||
}
|
||||
|
||||
message ProjectMemberView {
|
||||
string user_id = 1;
|
||||
string user_name = 2;
|
||||
string email = 3;
|
||||
string first_name = 4;
|
||||
string last_name = 5;
|
||||
repeated string roles = 6;
|
||||
google.protobuf.Timestamp change_date = 7;
|
||||
google.protobuf.Timestamp creation_date = 8;
|
||||
uint64 sequence = 10;
|
||||
}
|
||||
|
||||
message ProjectMemberSearchResponse {
|
||||
uint64 offset = 1;
|
||||
uint64 limit = 2;
|
||||
uint64 total_result = 3;
|
||||
repeated ProjectMember result = 4;
|
||||
repeated ProjectMemberView result = 4;
|
||||
}
|
||||
|
||||
message ProjectMemberSearchRequest {
|
||||
@@ -1852,6 +1880,7 @@ enum ProjectMemberSearchKey {
|
||||
PROJECTMEMBERSEARCHKEY_LAST_NAME = 2;
|
||||
PROJECTMEMBERSEARCHKEY_EMAIL = 3;
|
||||
PROJECTMEMBERSEARCHKEY_USER_ID = 4;
|
||||
PROJECTMEMBERSEARCHKEY_USER_NAME = 5;
|
||||
}
|
||||
|
||||
enum AppState {
|
||||
@@ -1878,7 +1907,6 @@ message ApplicationUpdate {
|
||||
string name = 5 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
}
|
||||
|
||||
|
||||
message OIDCConfig {
|
||||
repeated string redirect_uris = 1;
|
||||
repeated OIDCResponseType response_types = 2;
|
||||
@@ -1940,11 +1968,23 @@ message ClientSecret {
|
||||
string client_secret = 1;
|
||||
}
|
||||
|
||||
message ApplicationView {
|
||||
string id = 1;
|
||||
AppState state = 2;
|
||||
google.protobuf.Timestamp creation_date = 3;
|
||||
google.protobuf.Timestamp change_date = 4;
|
||||
string name = 5;
|
||||
oneof app_config {
|
||||
OIDCConfig oidc_config = 8;
|
||||
}
|
||||
uint64 sequence = 9;
|
||||
}
|
||||
|
||||
message ApplicationSearchResponse {
|
||||
uint64 offset = 1;
|
||||
uint64 limit = 2;
|
||||
uint64 total_result = 3;
|
||||
repeated Application result = 4;
|
||||
repeated ApplicationView result = 4;
|
||||
}
|
||||
|
||||
message ApplicationSearchRequest {
|
||||
@@ -1969,14 +2009,11 @@ message ProjectGrant {
|
||||
string id = 1;
|
||||
string project_id = 2;
|
||||
string granted_org_id = 3;
|
||||
string granted_org_name = 4;
|
||||
string granted_org_domain = 5;
|
||||
repeated string role_keys = 6;
|
||||
ProjectGrantState state = 7;
|
||||
google.protobuf.Timestamp creation_date = 8;
|
||||
google.protobuf.Timestamp change_date = 9;
|
||||
string project_name = 10;
|
||||
uint64 sequence = 11;
|
||||
repeated string role_keys = 4;
|
||||
ProjectGrantState state = 5;
|
||||
google.protobuf.Timestamp creation_date = 6;
|
||||
google.protobuf.Timestamp change_date = 7;
|
||||
uint64 sequence = 9;
|
||||
}
|
||||
|
||||
message ProjectGrantCreate {
|
||||
@@ -1996,21 +2033,31 @@ message ProjectGrantID {
|
||||
string id = 2;
|
||||
}
|
||||
|
||||
message GrantedGrantID {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
enum ProjectGrantState {
|
||||
PROJECTGRANTSTATE_UNSPECIFIED = 0;
|
||||
PROJECTGRANTSTATE_ACTIVE = 1;
|
||||
PROJECTGRANTSTATE_INACTIVE = 2;
|
||||
}
|
||||
|
||||
message ProjectGrantView {
|
||||
string id = 1;
|
||||
string project_id = 2;
|
||||
string granted_org_id = 3;
|
||||
string granted_org_name = 4;
|
||||
string granted_org_domain = 5;
|
||||
repeated string role_keys = 6;
|
||||
ProjectGrantState state = 7;
|
||||
google.protobuf.Timestamp creation_date = 8;
|
||||
google.protobuf.Timestamp change_date = 9;
|
||||
string project_name = 10;
|
||||
uint64 sequence = 11;
|
||||
}
|
||||
|
||||
message ProjectGrantSearchResponse {
|
||||
uint64 offset = 1;
|
||||
uint64 limit = 2;
|
||||
uint64 total_result = 3;
|
||||
repeated ProjectGrant result = 4;
|
||||
repeated ProjectGrantView result = 4;
|
||||
}
|
||||
|
||||
message ProjectGrantSearchRequest {
|
||||
@@ -2025,14 +2072,10 @@ message ProjectGrantMemberRoles {
|
||||
|
||||
message ProjectGrantMember {
|
||||
string user_id = 1;
|
||||
string user_name = 2;
|
||||
string email = 3;
|
||||
string first_name = 4;
|
||||
string last_name = 5;
|
||||
repeated string roles = 6;
|
||||
google.protobuf.Timestamp change_date = 7;
|
||||
google.protobuf.Timestamp creation_date = 8;
|
||||
uint64 sequence = 9;
|
||||
repeated string roles = 2;
|
||||
google.protobuf.Timestamp change_date = 3;
|
||||
google.protobuf.Timestamp creation_date = 4;
|
||||
uint64 sequence = 5;
|
||||
}
|
||||
|
||||
message ProjectGrantMemberAdd {
|
||||
@@ -2055,11 +2098,23 @@ message ProjectGrantMemberRemove {
|
||||
string user_id = 3;
|
||||
}
|
||||
|
||||
message ProjectGrantMemberView {
|
||||
string user_id = 1;
|
||||
string user_name = 2;
|
||||
string email = 3;
|
||||
string first_name = 4;
|
||||
string last_name = 5;
|
||||
repeated string roles = 6;
|
||||
google.protobuf.Timestamp change_date = 7;
|
||||
google.protobuf.Timestamp creation_date = 8;
|
||||
uint64 sequence = 9;
|
||||
}
|
||||
|
||||
message ProjectGrantMemberSearchResponse {
|
||||
uint64 offset = 1;
|
||||
uint64 limit = 2;
|
||||
uint64 total_result = 3;
|
||||
repeated ProjectGrantMember result = 4;
|
||||
repeated ProjectGrantMemberView result = 4;
|
||||
}
|
||||
|
||||
message ProjectGrantMemberSearchRequest {
|
||||
@@ -2082,6 +2137,7 @@ enum ProjectGrantMemberSearchKey {
|
||||
PROJECTGRANTMEMBERSEARCHKEY_LAST_NAME = 2;
|
||||
PROJECTGRANTMEMBERSEARCHKEY_EMAIL = 3;
|
||||
PROJECTGRANTMEMBERSEARCHKEY_USER_ID = 4;
|
||||
PROJECTGRANTMEMBERSEARCHKEY_USER_NAME = 5;
|
||||
}
|
||||
|
||||
message UserGrant {
|
||||
|
||||
Reference in New Issue
Block a user