fix: add search params for user grants (#915)

This commit is contained in:
Fabi 2020-11-03 07:52:49 +01:00 committed by GitHub
parent e9c43d0473
commit b79661d66e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 1570 additions and 1477 deletions

View File

@ -89,6 +89,22 @@ func userGrantSearchKeyToModel(key management.UserGrantSearchKey) grant_model.Us
return grant_model.UserGrantSearchKeyRoleKey
case management.UserGrantSearchKey_USERGRANTSEARCHKEY_GRANT_ID:
return grant_model.UserGrantSearchKeyGrantID
case management.UserGrantSearchKey_USERGRANTSEARCHKEY_USER_NAME:
return grant_model.UserGrantSearchKeyUserName
case management.UserGrantSearchKey_USERGRANTSEARCHKEY_FIRST_NAME:
return grant_model.UserGrantSearchKeyFirstName
case management.UserGrantSearchKey_USERGRANTSEARCHKEY_LAST_NAME:
return grant_model.UserGrantSearchKeyLastName
case management.UserGrantSearchKey_USERGRANTSEARCHKEY_EMAIL:
return grant_model.UserGrantSearchKeyEmail
case management.UserGrantSearchKey_USERGRANTSEARCHKEY_ORG_NAME:
return grant_model.UserGrantSearchKeyOrgName
case management.UserGrantSearchKey_USERGRANTSEARCHKEY_ORG_DOMAIN:
return grant_model.UserGrantSearchKeyOrgDomain
case management.UserGrantSearchKey_USERGRANTSEARCHKEY_PROJECT_NAME:
return grant_model.UserGrantSearchKeyProjectName
case management.UserGrantSearchKey_USERGRANTSEARCHKEY_DISPLAY_NAME:
return grant_model.UserGrantSearchKeyDisplayName
default:
return grant_model.UserGrantSearchKeyUnspecified
}

View File

@ -49,6 +49,13 @@ const (
UserGrantSearchKeyOrgName
UserGrantSearchKeyRoleKey
UserGrantSearchKeyID
UserGrantSearchKeyUserName
UserGrantSearchKeyFirstName
UserGrantSearchKeyLastName
UserGrantSearchKeyEmail
UserGrantSearchKeyOrgDomain
UserGrantSearchKeyProjectName
UserGrantSearchKeyDisplayName
)
type UserGrantSearchQuery struct {

View File

@ -22,6 +22,13 @@ const (
UserGrantKeyState = "state"
UserGrantKeyOrgName = "org_name"
UserGrantKeyRole = "role_keys"
UserGrantKeyUserName = "user_name"
UserGrantKeyFirstName = "first_name"
UserGrantKeyLastName = "last_name"
UserGrantKeyEmail = "email"
UserGrantKeyOrgDomain = "org_primary_domain"
UserGrantKeyProjectName = "project_name"
UserGrantKeyDisplayName = "display_name"
)
type UserGrantView struct {

View File

@ -67,6 +67,20 @@ func (key UserGrantSearchKey) ToColumnName() string {
return UserGrantKeyRole
case grant_model.UserGrantSearchKeyID:
return UserGrantKeyID
case grant_model.UserGrantSearchKeyUserName:
return UserGrantKeyUserName
case grant_model.UserGrantSearchKeyFirstName:
return UserGrantKeyFirstName
case grant_model.UserGrantSearchKeyLastName:
return UserGrantKeyLastName
case grant_model.UserGrantSearchKeyEmail:
return UserGrantKeyEmail
case grant_model.UserGrantSearchKeyOrgDomain:
return UserGrantKeyOrgDomain
case grant_model.UserGrantSearchKeyProjectName:
return UserGrantKeyProjectName
case grant_model.UserGrantSearchKeyDisplayName:
return UserGrantKeyDisplayName
default:
return ""
}

File diff suppressed because it is too large Load Diff

View File

@ -2796,6 +2796,14 @@ enum UserGrantSearchKey {
USERGRANTSEARCHKEY_ORG_ID = 3;
USERGRANTSEARCHKEY_ROLE_KEY = 4;
USERGRANTSEARCHKEY_GRANT_ID = 5;
USERGRANTSEARCHKEY_USER_NAME = 6;
USERGRANTSEARCHKEY_FIRST_NAME = 7;
USERGRANTSEARCHKEY_LAST_NAME = 8;
USERGRANTSEARCHKEY_EMAIL = 9;
USERGRANTSEARCHKEY_ORG_NAME = 10;
USERGRANTSEARCHKEY_ORG_DOMAIN = 11;
USERGRANTSEARCHKEY_PROJECT_NAME = 12;
USERGRANTSEARCHKEY_DISPLAY_NAME = 13;
}
message UserMembershipSearchResponse {