From 7557e4e0ea92d8c2ac1a05b77479aae869e21ee4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Pablo=20Villaf=C3=A1=C3=B1ez?= Date: Wed, 12 Jan 2022 15:10:15 +0100 Subject: [PATCH] Migrate proto files for settings and adjusts paths --- accounts/pkg/service/v0/accounts.go | 4 +- .../service/v0/accounts_permission_test.go | 47 +- accounts/pkg/service/v0/option.go | 6 +- accounts/pkg/service/v0/permissions.go | 51 +- accounts/pkg/service/v0/service.go | 6 +- accounts/ui/client/settings/index.js | 134 +- graph/pkg/service/v0/drives.go | 22 +- ocis-pkg/roles/cache.go | 19 +- ocis-pkg/roles/cache_test.go | 13 +- ocis-pkg/roles/manager.go | 14 +- ocis-pkg/roles/option.go | 6 +- ocs/pkg/server/http/svc_test.go | 23 +- ocs/pkg/service/v0/option.go | 6 +- ocs/pkg/service/v0/service.go | 6 +- proxy/pkg/command/server.go | 4 +- proxy/pkg/config/defaultconfig.go | 2 +- proxy/pkg/middleware/options.go | 7 +- proxy/pkg/user/backend/accounts.go | 8 +- proxy/pkg/user/backend/accounts_test.go | 15 +- proxy/pkg/user/backend/backend.go | 6 +- proxy/pkg/user/backend/cs3.go | 10 +- settings/pkg/proto/v0/settings.mock.go | 186 - settings/pkg/proto/v0/settings.pb.go | 3901 ----------------- settings/pkg/proto/v0/settings.pb.micro.go | 668 --- .../pkg/proto/v0/settings.pb.micro_test.go | 1643 ------- settings/pkg/proto/v0/settings.pb.web.go | 1905 -------- settings/pkg/proto/v0/settings.swagger.json | 1114 ----- settings/pkg/server/grpc/server.go | 10 +- settings/pkg/server/http/server.go | 10 +- settings/pkg/service/v0/permissions.go | 22 +- settings/pkg/service/v0/service.go | 79 +- settings/pkg/service/v0/settings.go | 255 +- settings/pkg/service/v0/validator.go | 41 +- settings/pkg/settings/settings.go | 30 +- settings/pkg/store/filesystem/assignments.go | 12 +- .../pkg/store/filesystem/assignments_test.go | 38 +- settings/pkg/store/filesystem/bundles.go | 32 +- settings/pkg/store/filesystem/bundles_test.go | 72 +- settings/pkg/store/filesystem/permissions.go | 20 +- settings/pkg/store/filesystem/values.go | 24 +- settings/pkg/store/filesystem/values_test.go | 20 +- settings/pkg/util/resource_helper.go | 6 +- settings/pkg/util/resource_helper_test.go | 54 +- settings/proto/v0/settings.proto | 416 -- settings/ui/client/settings/index.js | 154 +- 45 files changed, 650 insertions(+), 10471 deletions(-) delete mode 100644 settings/pkg/proto/v0/settings.mock.go delete mode 100644 settings/pkg/proto/v0/settings.pb.go delete mode 100644 settings/pkg/proto/v0/settings.pb.micro.go delete mode 100644 settings/pkg/proto/v0/settings.pb.micro_test.go delete mode 100644 settings/pkg/proto/v0/settings.pb.web.go delete mode 100644 settings/pkg/proto/v0/settings.swagger.json delete mode 100644 settings/proto/v0/settings.proto diff --git a/accounts/pkg/service/v0/accounts.go b/accounts/pkg/service/v0/accounts.go index 21bcb7e0c..0052a96ac 100644 --- a/accounts/pkg/service/v0/accounts.go +++ b/accounts/pkg/service/v0/accounts.go @@ -28,7 +28,7 @@ import ( "github.com/owncloud/ocis/ocis-pkg/middleware" "github.com/owncloud/ocis/ocis-pkg/roles" "github.com/owncloud/ocis/ocis-pkg/sync" - settings "github.com/owncloud/ocis/settings/pkg/proto/v0" + settingssvc "github.com/owncloud/ocis/protogen/gen/ocis/services/settings/v1" settings_svc "github.com/owncloud/ocis/settings/pkg/service/v0" "github.com/rs/zerolog" merrors "go-micro.dev/v4/errors" @@ -455,7 +455,7 @@ func (s Service) CreateAccount(ctx context.Context, in *accountssvc.CreateAccoun if s.RoleService == nil { return merrors.InternalServerError(s.id, "could not assign role to account: roleService not configured") } - if _, err = s.RoleService.AssignRoleToUser(ctx, &settings.AssignRoleToUserRequest{ + if _, err = s.RoleService.AssignRoleToUser(ctx, &settingssvc.AssignRoleToUserRequest{ AccountUuid: out.Id, RoleId: settings_svc.BundleUUIDRoleUser, }); err != nil { diff --git a/accounts/pkg/service/v0/accounts_permission_test.go b/accounts/pkg/service/v0/accounts_permission_test.go index 2de0edc4a..f98579c23 100644 --- a/accounts/pkg/service/v0/accounts_permission_test.go +++ b/accounts/pkg/service/v0/accounts_permission_test.go @@ -17,7 +17,8 @@ import ( olog "github.com/owncloud/ocis/ocis-pkg/log" "github.com/owncloud/ocis/ocis-pkg/middleware" "github.com/owncloud/ocis/ocis-pkg/roles" - settings "github.com/owncloud/ocis/settings/pkg/proto/v0" + settingsmsg "github.com/owncloud/ocis/protogen/gen/ocis/messages/settings/v1" + settingssvc "github.com/owncloud/ocis/protogen/gen/ocis/services/settings/v1" ssvc "github.com/owncloud/ocis/settings/pkg/service/v0" "github.com/stretchr/testify/assert" "go-micro.dev/v4/client" @@ -28,7 +29,7 @@ import ( const dataPath = "/tmp/ocis-accounts-tests" var ( - roleServiceMock settings.RoleService + roleServiceMock settingssvc.RoleService s *Service ) @@ -315,15 +316,15 @@ func buildTestCtx(t *testing.T, roleIDs []string) context.Context { return ctx } -func buildRoleServiceMock() settings.RoleService { - defaultRoles := map[string]*settings.Bundle{ +func buildRoleServiceMock() settingssvc.RoleService { + defaultRoles := map[string]*settingsmsg.Bundle{ ssvc.BundleUUIDRoleAdmin: { Id: ssvc.BundleUUIDRoleAdmin, - Type: settings.Bundle_TYPE_ROLE, - Resource: &settings.Resource{ - Type: settings.Resource_TYPE_SYSTEM, + Type: settingsmsg.Bundle_TYPE_ROLE, + Resource: &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_SYSTEM, }, - Settings: []*settings.Setting{ + Settings: []*settingsmsg.Setting{ { Id: AccountManagementPermissionID, }, @@ -331,37 +332,37 @@ func buildRoleServiceMock() settings.RoleService { }, ssvc.BundleUUIDRoleUser: { Id: ssvc.BundleUUIDRoleUser, - Type: settings.Bundle_TYPE_ROLE, - Resource: &settings.Resource{ - Type: settings.Resource_TYPE_SYSTEM, + Type: settingsmsg.Bundle_TYPE_ROLE, + Resource: &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_SYSTEM, }, - Settings: []*settings.Setting{}, + Settings: []*settingsmsg.Setting{}, }, ssvc.BundleUUIDRoleGuest: { Id: ssvc.BundleUUIDRoleGuest, - Type: settings.Bundle_TYPE_ROLE, - Resource: &settings.Resource{ - Type: settings.Resource_TYPE_SYSTEM, + Type: settingsmsg.Bundle_TYPE_ROLE, + Resource: &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_SYSTEM, }, - Settings: []*settings.Setting{}, + Settings: []*settingsmsg.Setting{}, }, } - return settings.MockRoleService{ - ListRolesFunc: func(ctx context.Context, req *settings.ListBundlesRequest, opts ...client.CallOption) (res *settings.ListBundlesResponse, err error) { - payload := make([]*settings.Bundle, 0) + return settingssvc.MockRoleService{ + ListRolesFunc: func(ctx context.Context, req *settingssvc.ListBundlesRequest, opts ...client.CallOption) (res *settingssvc.ListBundlesResponse, err error) { + payload := make([]*settingsmsg.Bundle, 0) for _, roleID := range req.BundleIds { if defaultRoles[roleID] != nil { payload = append(payload, defaultRoles[roleID]) } } - return &settings.ListBundlesResponse{ + return &settingssvc.ListBundlesResponse{ Bundles: payload, }, nil }, - AssignRoleToUserFunc: func(ctx context.Context, req *settings.AssignRoleToUserRequest, opts ...client.CallOption) (res *settings.AssignRoleToUserResponse, err error) { + AssignRoleToUserFunc: func(ctx context.Context, req *settingssvc.AssignRoleToUserRequest, opts ...client.CallOption) (res *settingssvc.AssignRoleToUserResponse, err error) { // mock can be empty. function is called during service start. actual role assignments not needed for the tests. - return &settings.AssignRoleToUserResponse{ - Assignment: &settings.UserRoleAssignment{}, + return &settingssvc.AssignRoleToUserResponse{ + Assignment: &settingsmsg.UserRoleAssignment{}, }, nil }, } diff --git a/accounts/pkg/service/v0/option.go b/accounts/pkg/service/v0/option.go index 387ff7b35..e80fa2e3a 100644 --- a/accounts/pkg/service/v0/option.go +++ b/accounts/pkg/service/v0/option.go @@ -4,7 +4,7 @@ import ( "github.com/owncloud/ocis/accounts/pkg/config" "github.com/owncloud/ocis/ocis-pkg/log" "github.com/owncloud/ocis/ocis-pkg/roles" - settings "github.com/owncloud/ocis/settings/pkg/proto/v0" + settingssvc "github.com/owncloud/ocis/protogen/gen/ocis/services/settings/v1" ) // Option defines a single option function. @@ -14,7 +14,7 @@ type Option func(o *Options) type Options struct { Logger log.Logger Config *config.Config - RoleService settings.RoleService + RoleService settingssvc.RoleService RoleManager *roles.Manager } @@ -43,7 +43,7 @@ func Config(val *config.Config) Option { } // RoleService provides a function to set the RoleService option. -func RoleService(val settings.RoleService) Option { +func RoleService(val settingssvc.RoleService) Option { return func(o *Options) { o.RoleService = val } diff --git a/accounts/pkg/service/v0/permissions.go b/accounts/pkg/service/v0/permissions.go index 177bb5faa..08c628dfb 100644 --- a/accounts/pkg/service/v0/permissions.go +++ b/accounts/pkg/service/v0/permissions.go @@ -6,7 +6,8 @@ import ( "github.com/owncloud/ocis/ocis-pkg/service/grpc" olog "github.com/owncloud/ocis/ocis-pkg/log" - settings "github.com/owncloud/ocis/settings/pkg/proto/v0" + settingsmsg "github.com/owncloud/ocis/protogen/gen/ocis/messages/settings/v1" + settingssvc "github.com/owncloud/ocis/protogen/gen/ocis/services/settings/v1" ssvc "github.com/owncloud/ocis/settings/pkg/service/v0" ) @@ -27,7 +28,7 @@ const ( // RegisterPermissions registers permissions for account management and group management with the settings service. func RegisterPermissions(l *olog.Logger) { - service := settings.NewBundleService("com.owncloud.api.settings", grpc.DefaultClient) + service := settingssvc.NewBundleService("com.owncloud.api.settings", grpc.DefaultClient) permissionRequests := generateAccountManagementPermissionsRequests() for i := range permissionRequests { @@ -41,61 +42,61 @@ func RegisterPermissions(l *olog.Logger) { } } -func generateAccountManagementPermissionsRequests() []settings.AddSettingToBundleRequest { - return []settings.AddSettingToBundleRequest{ +func generateAccountManagementPermissionsRequests() []settingssvc.AddSettingToBundleRequest { + return []settingssvc.AddSettingToBundleRequest{ { BundleId: ssvc.BundleUUIDRoleAdmin, - Setting: &settings.Setting{ + Setting: &settingsmsg.Setting{ Id: AccountManagementPermissionID, Name: AccountManagementPermissionName, DisplayName: "Account Management", Description: "This permission gives full access to everything that is related to account management.", - Resource: &settings.Resource{ - Type: settings.Resource_TYPE_USER, + Resource: &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_USER, Id: "all", }, - Value: &settings.Setting_PermissionValue{ - PermissionValue: &settings.Permission{ - Operation: settings.Permission_OPERATION_READWRITE, - Constraint: settings.Permission_CONSTRAINT_ALL, + Value: &settingsmsg.Setting_PermissionValue{ + PermissionValue: &settingsmsg.Permission{ + Operation: settingsmsg.Permission_OPERATION_READWRITE, + Constraint: settingsmsg.Permission_CONSTRAINT_ALL, }, }, }, }, { BundleId: ssvc.BundleUUIDRoleAdmin, - Setting: &settings.Setting{ + Setting: &settingsmsg.Setting{ Id: GroupManagementPermissionID, Name: GroupManagementPermissionName, DisplayName: "Group Management", Description: "This permission gives full access to everything that is related to group management.", - Resource: &settings.Resource{ - Type: settings.Resource_TYPE_GROUP, + Resource: &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_GROUP, Id: "all", }, - Value: &settings.Setting_PermissionValue{ - PermissionValue: &settings.Permission{ - Operation: settings.Permission_OPERATION_READWRITE, - Constraint: settings.Permission_CONSTRAINT_ALL, + Value: &settingsmsg.Setting_PermissionValue{ + PermissionValue: &settingsmsg.Permission{ + Operation: settingsmsg.Permission_OPERATION_READWRITE, + Constraint: settingsmsg.Permission_CONSTRAINT_ALL, }, }, }, }, { BundleId: ssvc.BundleUUIDRoleUser, - Setting: &settings.Setting{ + Setting: &settingsmsg.Setting{ Id: SelfManagementPermissionID, Name: SelfManagementPermissionName, DisplayName: "Self Management", Description: "This permission gives access to self management.", - Resource: &settings.Resource{ - Type: settings.Resource_TYPE_USER, + Resource: &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_USER, Id: "me", }, - Value: &settings.Setting_PermissionValue{ - PermissionValue: &settings.Permission{ - Operation: settings.Permission_OPERATION_READWRITE, - Constraint: settings.Permission_CONSTRAINT_OWN, + Value: &settingsmsg.Setting_PermissionValue{ + PermissionValue: &settingsmsg.Permission{ + Operation: settingsmsg.Permission_OPERATION_READWRITE, + Constraint: settingsmsg.Permission_CONSTRAINT_OWN, }, }, }, diff --git a/accounts/pkg/service/v0/service.go b/accounts/pkg/service/v0/service.go index d3beef895..f5f707b70 100644 --- a/accounts/pkg/service/v0/service.go +++ b/accounts/pkg/service/v0/service.go @@ -22,7 +22,7 @@ import ( "github.com/owncloud/ocis/ocis-pkg/log" oreg "github.com/owncloud/ocis/ocis-pkg/registry" "github.com/owncloud/ocis/ocis-pkg/roles" - settings "github.com/owncloud/ocis/settings/pkg/proto/v0" + settingssvc "github.com/owncloud/ocis/protogen/gen/ocis/services/settings/v1" ) // userDefaultGID is the default integer representing the "users" group. @@ -36,7 +36,7 @@ func New(opts ...Option) (s *Service, err error) { roleService := options.RoleService if roleService == nil { - roleService = settings.NewRoleService("com.owncloud.api.settings", grpc.DefaultClient) + roleService = settingssvc.NewRoleService("com.owncloud.api.settings", grpc.DefaultClient) } roleManager := options.RoleManager if roleManager == nil { @@ -447,7 +447,7 @@ type Service struct { log log.Logger Config *config.Config index *indexer.Indexer - RoleService settings.RoleService + RoleService settingssvc.RoleService RoleManager *roles.Manager repo storage.Repo } diff --git a/accounts/ui/client/settings/index.js b/accounts/ui/client/settings/index.js index 9c2fd5647..69dce246e 100644 --- a/accounts/ui/client/settings/index.js +++ b/accounts/ui/client/settings/index.js @@ -25,20 +25,20 @@ export const request = (method, url, body, queryParameters, form, config) => { } } /*========================================================== - * + * ==========================================================*/ /** - * + * * request: RoleService_AssignRoleToUser * url: RoleService_AssignRoleToUserURL * method: RoleService_AssignRoleToUser_TYPE * raw_url: RoleService_AssignRoleToUser_RAW_URL - * @param body - + * @param body - */ export const RoleService_AssignRoleToUser = function(parameters = {}) { const domain = parameters.$domain ? parameters.$domain : getDomain() const config = parameters.$config - let path = '/api/v0/settings/assignments-add' + let path = '/api/v1/settings/assignments-add' let body let queryParameters = {} let form = {} @@ -56,7 +56,7 @@ export const RoleService_AssignRoleToUser = function(parameters = {}) { return request('post', domain + path, body, queryParameters, form, config) } export const RoleService_AssignRoleToUser_RAW_URL = function() { - return '/api/v0/settings/assignments-add' + return '/api/v1/settings/assignments-add' } export const RoleService_AssignRoleToUser_TYPE = function() { return 'post' @@ -64,7 +64,7 @@ export const RoleService_AssignRoleToUser_TYPE = function() { export const RoleService_AssignRoleToUserURL = function(parameters = {}) { let queryParameters = {} const domain = parameters.$domain ? parameters.$domain : getDomain() - let path = '/api/v0/settings/assignments-add' + let path = '/api/v1/settings/assignments-add' if (parameters.$queryParameters) { Object.keys(parameters.$queryParameters).forEach(function(parameterName) { queryParameters[parameterName] = parameters.$queryParameters[parameterName] @@ -74,17 +74,17 @@ export const RoleService_AssignRoleToUserURL = function(parameters = {}) { return domain + path + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(queryParameters[key])).join('&')) : '') } /** - * + * * request: RoleService_ListRoleAssignments * url: RoleService_ListRoleAssignmentsURL * method: RoleService_ListRoleAssignments_TYPE * raw_url: RoleService_ListRoleAssignments_RAW_URL - * @param body - + * @param body - */ export const RoleService_ListRoleAssignments = function(parameters = {}) { const domain = parameters.$domain ? parameters.$domain : getDomain() const config = parameters.$config - let path = '/api/v0/settings/assignments-list' + let path = '/api/v1/settings/assignments-list' let body let queryParameters = {} let form = {} @@ -102,7 +102,7 @@ export const RoleService_ListRoleAssignments = function(parameters = {}) { return request('post', domain + path, body, queryParameters, form, config) } export const RoleService_ListRoleAssignments_RAW_URL = function() { - return '/api/v0/settings/assignments-list' + return '/api/v1/settings/assignments-list' } export const RoleService_ListRoleAssignments_TYPE = function() { return 'post' @@ -110,7 +110,7 @@ export const RoleService_ListRoleAssignments_TYPE = function() { export const RoleService_ListRoleAssignmentsURL = function(parameters = {}) { let queryParameters = {} const domain = parameters.$domain ? parameters.$domain : getDomain() - let path = '/api/v0/settings/assignments-list' + let path = '/api/v1/settings/assignments-list' if (parameters.$queryParameters) { Object.keys(parameters.$queryParameters).forEach(function(parameterName) { queryParameters[parameterName] = parameters.$queryParameters[parameterName] @@ -120,17 +120,17 @@ export const RoleService_ListRoleAssignmentsURL = function(parameters = {}) { return domain + path + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(queryParameters[key])).join('&')) : '') } /** - * + * * request: RoleService_RemoveRoleFromUser * url: RoleService_RemoveRoleFromUserURL * method: RoleService_RemoveRoleFromUser_TYPE * raw_url: RoleService_RemoveRoleFromUser_RAW_URL - * @param body - + * @param body - */ export const RoleService_RemoveRoleFromUser = function(parameters = {}) { const domain = parameters.$domain ? parameters.$domain : getDomain() const config = parameters.$config - let path = '/api/v0/settings/assignments-remove' + let path = '/api/v1/settings/assignments-remove' let body let queryParameters = {} let form = {} @@ -148,7 +148,7 @@ export const RoleService_RemoveRoleFromUser = function(parameters = {}) { return request('post', domain + path, body, queryParameters, form, config) } export const RoleService_RemoveRoleFromUser_RAW_URL = function() { - return '/api/v0/settings/assignments-remove' + return '/api/v1/settings/assignments-remove' } export const RoleService_RemoveRoleFromUser_TYPE = function() { return 'post' @@ -156,7 +156,7 @@ export const RoleService_RemoveRoleFromUser_TYPE = function() { export const RoleService_RemoveRoleFromUserURL = function(parameters = {}) { let queryParameters = {} const domain = parameters.$domain ? parameters.$domain : getDomain() - let path = '/api/v0/settings/assignments-remove' + let path = '/api/v1/settings/assignments-remove' if (parameters.$queryParameters) { Object.keys(parameters.$queryParameters).forEach(function(parameterName) { queryParameters[parameterName] = parameters.$queryParameters[parameterName] @@ -166,17 +166,17 @@ export const RoleService_RemoveRoleFromUserURL = function(parameters = {}) { return domain + path + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(queryParameters[key])).join('&')) : '') } /** - * + * * request: BundleService_GetBundle * url: BundleService_GetBundleURL * method: BundleService_GetBundle_TYPE * raw_url: BundleService_GetBundle_RAW_URL - * @param body - + * @param body - */ export const BundleService_GetBundle = function(parameters = {}) { const domain = parameters.$domain ? parameters.$domain : getDomain() const config = parameters.$config - let path = '/api/v0/settings/bundle-get' + let path = '/api/v1/settings/bundle-get' let body let queryParameters = {} let form = {} @@ -194,7 +194,7 @@ export const BundleService_GetBundle = function(parameters = {}) { return request('post', domain + path, body, queryParameters, form, config) } export const BundleService_GetBundle_RAW_URL = function() { - return '/api/v0/settings/bundle-get' + return '/api/v1/settings/bundle-get' } export const BundleService_GetBundle_TYPE = function() { return 'post' @@ -202,7 +202,7 @@ export const BundleService_GetBundle_TYPE = function() { export const BundleService_GetBundleURL = function(parameters = {}) { let queryParameters = {} const domain = parameters.$domain ? parameters.$domain : getDomain() - let path = '/api/v0/settings/bundle-get' + let path = '/api/v1/settings/bundle-get' if (parameters.$queryParameters) { Object.keys(parameters.$queryParameters).forEach(function(parameterName) { queryParameters[parameterName] = parameters.$queryParameters[parameterName] @@ -212,17 +212,17 @@ export const BundleService_GetBundleURL = function(parameters = {}) { return domain + path + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(queryParameters[key])).join('&')) : '') } /** - * + * * request: BundleService_SaveBundle * url: BundleService_SaveBundleURL * method: BundleService_SaveBundle_TYPE * raw_url: BundleService_SaveBundle_RAW_URL - * @param body - + * @param body - */ export const BundleService_SaveBundle = function(parameters = {}) { const domain = parameters.$domain ? parameters.$domain : getDomain() const config = parameters.$config - let path = '/api/v0/settings/bundle-save' + let path = '/api/v1/settings/bundle-save' let body let queryParameters = {} let form = {} @@ -240,7 +240,7 @@ export const BundleService_SaveBundle = function(parameters = {}) { return request('post', domain + path, body, queryParameters, form, config) } export const BundleService_SaveBundle_RAW_URL = function() { - return '/api/v0/settings/bundle-save' + return '/api/v1/settings/bundle-save' } export const BundleService_SaveBundle_TYPE = function() { return 'post' @@ -248,7 +248,7 @@ export const BundleService_SaveBundle_TYPE = function() { export const BundleService_SaveBundleURL = function(parameters = {}) { let queryParameters = {} const domain = parameters.$domain ? parameters.$domain : getDomain() - let path = '/api/v0/settings/bundle-save' + let path = '/api/v1/settings/bundle-save' if (parameters.$queryParameters) { Object.keys(parameters.$queryParameters).forEach(function(parameterName) { queryParameters[parameterName] = parameters.$queryParameters[parameterName] @@ -258,17 +258,17 @@ export const BundleService_SaveBundleURL = function(parameters = {}) { return domain + path + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(queryParameters[key])).join('&')) : '') } /** - * + * * request: BundleService_AddSettingToBundle * url: BundleService_AddSettingToBundleURL * method: BundleService_AddSettingToBundle_TYPE * raw_url: BundleService_AddSettingToBundle_RAW_URL - * @param body - + * @param body - */ export const BundleService_AddSettingToBundle = function(parameters = {}) { const domain = parameters.$domain ? parameters.$domain : getDomain() const config = parameters.$config - let path = '/api/v0/settings/bundles-add-setting' + let path = '/api/v1/settings/bundles-add-setting' let body let queryParameters = {} let form = {} @@ -286,7 +286,7 @@ export const BundleService_AddSettingToBundle = function(parameters = {}) { return request('post', domain + path, body, queryParameters, form, config) } export const BundleService_AddSettingToBundle_RAW_URL = function() { - return '/api/v0/settings/bundles-add-setting' + return '/api/v1/settings/bundles-add-setting' } export const BundleService_AddSettingToBundle_TYPE = function() { return 'post' @@ -294,7 +294,7 @@ export const BundleService_AddSettingToBundle_TYPE = function() { export const BundleService_AddSettingToBundleURL = function(parameters = {}) { let queryParameters = {} const domain = parameters.$domain ? parameters.$domain : getDomain() - let path = '/api/v0/settings/bundles-add-setting' + let path = '/api/v1/settings/bundles-add-setting' if (parameters.$queryParameters) { Object.keys(parameters.$queryParameters).forEach(function(parameterName) { queryParameters[parameterName] = parameters.$queryParameters[parameterName] @@ -304,17 +304,17 @@ export const BundleService_AddSettingToBundleURL = function(parameters = {}) { return domain + path + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(queryParameters[key])).join('&')) : '') } /** - * + * * request: BundleService_ListBundles * url: BundleService_ListBundlesURL * method: BundleService_ListBundles_TYPE * raw_url: BundleService_ListBundles_RAW_URL - * @param body - + * @param body - */ export const BundleService_ListBundles = function(parameters = {}) { const domain = parameters.$domain ? parameters.$domain : getDomain() const config = parameters.$config - let path = '/api/v0/settings/bundles-list' + let path = '/api/v1/settings/bundles-list' let body let queryParameters = {} let form = {} @@ -332,7 +332,7 @@ export const BundleService_ListBundles = function(parameters = {}) { return request('post', domain + path, body, queryParameters, form, config) } export const BundleService_ListBundles_RAW_URL = function() { - return '/api/v0/settings/bundles-list' + return '/api/v1/settings/bundles-list' } export const BundleService_ListBundles_TYPE = function() { return 'post' @@ -340,7 +340,7 @@ export const BundleService_ListBundles_TYPE = function() { export const BundleService_ListBundlesURL = function(parameters = {}) { let queryParameters = {} const domain = parameters.$domain ? parameters.$domain : getDomain() - let path = '/api/v0/settings/bundles-list' + let path = '/api/v1/settings/bundles-list' if (parameters.$queryParameters) { Object.keys(parameters.$queryParameters).forEach(function(parameterName) { queryParameters[parameterName] = parameters.$queryParameters[parameterName] @@ -350,17 +350,17 @@ export const BundleService_ListBundlesURL = function(parameters = {}) { return domain + path + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(queryParameters[key])).join('&')) : '') } /** - * + * * request: BundleService_RemoveSettingFromBundle * url: BundleService_RemoveSettingFromBundleURL * method: BundleService_RemoveSettingFromBundle_TYPE * raw_url: BundleService_RemoveSettingFromBundle_RAW_URL - * @param body - + * @param body - */ export const BundleService_RemoveSettingFromBundle = function(parameters = {}) { const domain = parameters.$domain ? parameters.$domain : getDomain() const config = parameters.$config - let path = '/api/v0/settings/bundles-remove-setting' + let path = '/api/v1/settings/bundles-remove-setting' let body let queryParameters = {} let form = {} @@ -378,7 +378,7 @@ export const BundleService_RemoveSettingFromBundle = function(parameters = {}) { return request('post', domain + path, body, queryParameters, form, config) } export const BundleService_RemoveSettingFromBundle_RAW_URL = function() { - return '/api/v0/settings/bundles-remove-setting' + return '/api/v1/settings/bundles-remove-setting' } export const BundleService_RemoveSettingFromBundle_TYPE = function() { return 'post' @@ -386,7 +386,7 @@ export const BundleService_RemoveSettingFromBundle_TYPE = function() { export const BundleService_RemoveSettingFromBundleURL = function(parameters = {}) { let queryParameters = {} const domain = parameters.$domain ? parameters.$domain : getDomain() - let path = '/api/v0/settings/bundles-remove-setting' + let path = '/api/v1/settings/bundles-remove-setting' if (parameters.$queryParameters) { Object.keys(parameters.$queryParameters).forEach(function(parameterName) { queryParameters[parameterName] = parameters.$queryParameters[parameterName] @@ -396,17 +396,17 @@ export const BundleService_RemoveSettingFromBundleURL = function(parameters = {} return domain + path + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(queryParameters[key])).join('&')) : '') } /** - * + * * request: RoleService_ListRoles * url: RoleService_ListRolesURL * method: RoleService_ListRoles_TYPE * raw_url: RoleService_ListRoles_RAW_URL - * @param body - + * @param body - */ export const RoleService_ListRoles = function(parameters = {}) { const domain = parameters.$domain ? parameters.$domain : getDomain() const config = parameters.$config - let path = '/api/v0/settings/roles-list' + let path = '/api/v1/settings/roles-list' let body let queryParameters = {} let form = {} @@ -424,7 +424,7 @@ export const RoleService_ListRoles = function(parameters = {}) { return request('post', domain + path, body, queryParameters, form, config) } export const RoleService_ListRoles_RAW_URL = function() { - return '/api/v0/settings/roles-list' + return '/api/v1/settings/roles-list' } export const RoleService_ListRoles_TYPE = function() { return 'post' @@ -432,7 +432,7 @@ export const RoleService_ListRoles_TYPE = function() { export const RoleService_ListRolesURL = function(parameters = {}) { let queryParameters = {} const domain = parameters.$domain ? parameters.$domain : getDomain() - let path = '/api/v0/settings/roles-list' + let path = '/api/v1/settings/roles-list' if (parameters.$queryParameters) { Object.keys(parameters.$queryParameters).forEach(function(parameterName) { queryParameters[parameterName] = parameters.$queryParameters[parameterName] @@ -442,17 +442,17 @@ export const RoleService_ListRolesURL = function(parameters = {}) { return domain + path + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(queryParameters[key])).join('&')) : '') } /** - * + * * request: ValueService_GetValue * url: ValueService_GetValueURL * method: ValueService_GetValue_TYPE * raw_url: ValueService_GetValue_RAW_URL - * @param body - + * @param body - */ export const ValueService_GetValue = function(parameters = {}) { const domain = parameters.$domain ? parameters.$domain : getDomain() const config = parameters.$config - let path = '/api/v0/settings/values-get' + let path = '/api/v1/settings/values-get' let body let queryParameters = {} let form = {} @@ -470,7 +470,7 @@ export const ValueService_GetValue = function(parameters = {}) { return request('post', domain + path, body, queryParameters, form, config) } export const ValueService_GetValue_RAW_URL = function() { - return '/api/v0/settings/values-get' + return '/api/v1/settings/values-get' } export const ValueService_GetValue_TYPE = function() { return 'post' @@ -478,7 +478,7 @@ export const ValueService_GetValue_TYPE = function() { export const ValueService_GetValueURL = function(parameters = {}) { let queryParameters = {} const domain = parameters.$domain ? parameters.$domain : getDomain() - let path = '/api/v0/settings/values-get' + let path = '/api/v1/settings/values-get' if (parameters.$queryParameters) { Object.keys(parameters.$queryParameters).forEach(function(parameterName) { queryParameters[parameterName] = parameters.$queryParameters[parameterName] @@ -488,17 +488,17 @@ export const ValueService_GetValueURL = function(parameters = {}) { return domain + path + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(queryParameters[key])).join('&')) : '') } /** - * + * * request: ValueService_GetValueByUniqueIdentifiers * url: ValueService_GetValueByUniqueIdentifiersURL * method: ValueService_GetValueByUniqueIdentifiers_TYPE * raw_url: ValueService_GetValueByUniqueIdentifiers_RAW_URL - * @param body - + * @param body - */ export const ValueService_GetValueByUniqueIdentifiers = function(parameters = {}) { const domain = parameters.$domain ? parameters.$domain : getDomain() const config = parameters.$config - let path = '/api/v0/settings/values-get-by-unique-identifiers' + let path = '/api/v1/settings/values-get-by-unique-identifiers' let body let queryParameters = {} let form = {} @@ -516,7 +516,7 @@ export const ValueService_GetValueByUniqueIdentifiers = function(parameters = {} return request('post', domain + path, body, queryParameters, form, config) } export const ValueService_GetValueByUniqueIdentifiers_RAW_URL = function() { - return '/api/v0/settings/values-get-by-unique-identifiers' + return '/api/v1/settings/values-get-by-unique-identifiers' } export const ValueService_GetValueByUniqueIdentifiers_TYPE = function() { return 'post' @@ -524,7 +524,7 @@ export const ValueService_GetValueByUniqueIdentifiers_TYPE = function() { export const ValueService_GetValueByUniqueIdentifiersURL = function(parameters = {}) { let queryParameters = {} const domain = parameters.$domain ? parameters.$domain : getDomain() - let path = '/api/v0/settings/values-get-by-unique-identifiers' + let path = '/api/v1/settings/values-get-by-unique-identifiers' if (parameters.$queryParameters) { Object.keys(parameters.$queryParameters).forEach(function(parameterName) { queryParameters[parameterName] = parameters.$queryParameters[parameterName] @@ -534,17 +534,17 @@ export const ValueService_GetValueByUniqueIdentifiersURL = function(parameters = return domain + path + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(queryParameters[key])).join('&')) : '') } /** - * + * * request: ValueService_ListValues * url: ValueService_ListValuesURL * method: ValueService_ListValues_TYPE * raw_url: ValueService_ListValues_RAW_URL - * @param body - + * @param body - */ export const ValueService_ListValues = function(parameters = {}) { const domain = parameters.$domain ? parameters.$domain : getDomain() const config = parameters.$config - let path = '/api/v0/settings/values-list' + let path = '/api/v1/settings/values-list' let body let queryParameters = {} let form = {} @@ -562,7 +562,7 @@ export const ValueService_ListValues = function(parameters = {}) { return request('post', domain + path, body, queryParameters, form, config) } export const ValueService_ListValues_RAW_URL = function() { - return '/api/v0/settings/values-list' + return '/api/v1/settings/values-list' } export const ValueService_ListValues_TYPE = function() { return 'post' @@ -570,7 +570,7 @@ export const ValueService_ListValues_TYPE = function() { export const ValueService_ListValuesURL = function(parameters = {}) { let queryParameters = {} const domain = parameters.$domain ? parameters.$domain : getDomain() - let path = '/api/v0/settings/values-list' + let path = '/api/v1/settings/values-list' if (parameters.$queryParameters) { Object.keys(parameters.$queryParameters).forEach(function(parameterName) { queryParameters[parameterName] = parameters.$queryParameters[parameterName] @@ -580,17 +580,17 @@ export const ValueService_ListValuesURL = function(parameters = {}) { return domain + path + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(queryParameters[key])).join('&')) : '') } /** - * + * * request: ValueService_SaveValue * url: ValueService_SaveValueURL * method: ValueService_SaveValue_TYPE * raw_url: ValueService_SaveValue_RAW_URL - * @param body - + * @param body - */ export const ValueService_SaveValue = function(parameters = {}) { const domain = parameters.$domain ? parameters.$domain : getDomain() const config = parameters.$config - let path = '/api/v0/settings/values-save' + let path = '/api/v1/settings/values-save' let body let queryParameters = {} let form = {} @@ -608,7 +608,7 @@ export const ValueService_SaveValue = function(parameters = {}) { return request('post', domain + path, body, queryParameters, form, config) } export const ValueService_SaveValue_RAW_URL = function() { - return '/api/v0/settings/values-save' + return '/api/v1/settings/values-save' } export const ValueService_SaveValue_TYPE = function() { return 'post' @@ -616,7 +616,7 @@ export const ValueService_SaveValue_TYPE = function() { export const ValueService_SaveValueURL = function(parameters = {}) { let queryParameters = {} const domain = parameters.$domain ? parameters.$domain : getDomain() - let path = '/api/v0/settings/values-save' + let path = '/api/v1/settings/values-save' if (parameters.$queryParameters) { Object.keys(parameters.$queryParameters).forEach(function(parameterName) { queryParameters[parameterName] = parameters.$queryParameters[parameterName] @@ -624,4 +624,4 @@ export const ValueService_SaveValueURL = function(parameters = {}) { } let keys = Object.keys(queryParameters) return domain + path + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(queryParameters[key])).join('&')) : '') -} \ No newline at end of file +} diff --git a/graph/pkg/service/v0/drives.go b/graph/pkg/service/v0/drives.go index 58933a6ea..bdec0507d 100644 --- a/graph/pkg/service/v0/drives.go +++ b/graph/pkg/service/v0/drives.go @@ -26,8 +26,8 @@ import ( "github.com/owncloud/ocis/graph/pkg/service/v0/errorcode" "github.com/owncloud/ocis/graph/pkg/service/v0/net" "github.com/owncloud/ocis/ocis-pkg/service/grpc" - sproto "github.com/owncloud/ocis/settings/pkg/proto/v0" - settingsSvc "github.com/owncloud/ocis/settings/pkg/service/v0" + settingssvc "github.com/owncloud/ocis/protogen/gen/ocis/services/settings/v1" + settingsServiceExt "github.com/owncloud/ocis/settings/pkg/service/v0" "gopkg.in/yaml.v2" merrors "go-micro.dev/v4/errors" @@ -155,10 +155,10 @@ func (g Graph) CreateDrive(w http.ResponseWriter, r *http.Request) { return } - s := sproto.NewPermissionService("com.owncloud.api.settings", grpc.DefaultClient) + s := settingssvc.NewPermissionService("com.owncloud.api.settings", grpc.DefaultClient) - _, err := s.GetPermissionByID(r.Context(), &sproto.GetPermissionByIDRequest{ - PermissionId: settingsSvc.CreateSpacePermissionID, + _, err := s.GetPermissionByID(r.Context(), &settingssvc.GetPermissionByIDRequest{ + PermissionId: settingsServiceExt.CreateSpacePermissionID, }) if err != nil { // if the permission is not existing for the user in context we can assume we don't have it. Return 401. @@ -379,15 +379,15 @@ func (g Graph) ListStorageSpacesWithFilters(ctx context.Context, filters []*stor client := g.GetGatewayClient() permissions := make(map[string]struct{}, 1) - s := sproto.NewPermissionService("com.owncloud.api.settings", grpc.DefaultClient) + s := settingssvc.NewPermissionService("com.owncloud.api.settings", grpc.DefaultClient) - _, err := s.GetPermissionByID(ctx, &sproto.GetPermissionByIDRequest{ - PermissionId: settingsSvc.ListAllSpacesPermissionID, + _, err := s.GetPermissionByID(ctx, &settingssvc.GetPermissionByIDRequest{ + PermissionId: settingsServiceExt.ListAllSpacesPermissionID, }) // No error means the user has the permission if err == nil { - permissions[settingsSvc.ListAllSpacesPermissionName] = struct{}{} + permissions[settingsServiceExt.ListAllSpacesPermissionName] = struct{}{} } value, err := json.Marshal(permissions) if err != nil { @@ -683,8 +683,8 @@ func getQuota(quota *libregraph.Quota, defaultQuota string) *storageprovider.Quo } func canSetSpaceQuota(ctx context.Context, user *userv1beta1.User) (bool, error) { - settingsService := sproto.NewPermissionService("com.owncloud.api.settings", grpc.DefaultClient) - _, err := settingsService.GetPermissionByID(ctx, &sproto.GetPermissionByIDRequest{PermissionId: settingsSvc.SetSpaceQuotaPermissionID}) + settingsService := settingssvc.NewPermissionService("com.owncloud.api.settings", grpc.DefaultClient) + _, err := settingsService.GetPermissionByID(ctx, &settingssvc.GetPermissionByIDRequest{PermissionId: settingsServiceExt.SetSpaceQuotaPermissionID}) if err != nil { merror := merrors.FromError(err) if merror.Status == http.StatusText(http.StatusNotFound) { diff --git a/ocis-pkg/roles/cache.go b/ocis-pkg/roles/cache.go index e5cb1d9cc..8b94c8dd1 100644 --- a/ocis-pkg/roles/cache.go +++ b/ocis-pkg/roles/cache.go @@ -2,34 +2,35 @@ package roles import ( "time" + "github.com/owncloud/ocis/ocis-pkg/sync" - settings "github.com/owncloud/ocis/settings/pkg/proto/v0" + settingsmsg "github.com/owncloud/ocis/protogen/gen/ocis/messages/settings/v1" ) // cache is a cache implementation for roles, keyed by roleIDs. type cache struct { - sc sync.Cache - ttl time.Duration + sc sync.Cache + ttl time.Duration } // newCache returns a new instance of Cache. func newCache(capacity int, ttl time.Duration) cache { return cache{ - ttl: ttl, - sc: sync.NewCache(capacity), + ttl: ttl, + sc: sync.NewCache(capacity), } } // get gets a role-bundle by a given `roleID`. -func (c *cache) get(roleID string) *settings.Bundle { +func (c *cache) get(roleID string) *settingsmsg.Bundle { if ce := c.sc.Load(roleID); ce != nil { - return ce.V.(*settings.Bundle) + return ce.V.(*settingsmsg.Bundle) } return nil } // set sets a roleID / role-bundle. -func (c *cache) set(roleID string, value *settings.Bundle) { +func (c *cache) set(roleID string, value *settingsmsg.Bundle) { c.sc.Store(roleID, value, time.Now().Add(c.ttl)) -} \ No newline at end of file +} diff --git a/ocis-pkg/roles/cache_test.go b/ocis-pkg/roles/cache_test.go index bca681801..7300e5a59 100644 --- a/ocis-pkg/roles/cache_test.go +++ b/ocis-pkg/roles/cache_test.go @@ -1,12 +1,13 @@ package roles import ( - settings "github.com/owncloud/ocis/settings/pkg/proto/v0" - "github.com/stretchr/testify/assert" "strconv" "sync" "testing" "time" + + settingsmsg "github.com/owncloud/ocis/protogen/gen/ocis/messages/settings/v1" + "github.com/stretchr/testify/assert" ) func cacheRunner(size int, ttl time.Duration) (*cache, func(f func(v string))) { @@ -29,10 +30,10 @@ func cacheRunner(size int, ttl time.Duration) (*cache, func(f func(v string))) { func BenchmarkCache(b *testing.B) { b.ReportAllocs() size := 1024 - c, cr := cacheRunner(size, 100 * time.Millisecond) + c, cr := cacheRunner(size, 100*time.Millisecond) - cr(func(v string) { c.set(v, &settings.Bundle{})}) - cr(func(v string) { c.get(v)}) + cr(func(v string) { c.set(v, &settingsmsg.Bundle{}) }) + cr(func(v string) { c.get(v) }) } func TestCache(t *testing.T) { @@ -41,7 +42,7 @@ func TestCache(t *testing.T) { c, cr := cacheRunner(size, ttl) cr(func(v string) { - c.set(v, &settings.Bundle{Id: v}) + c.set(v, &settingsmsg.Bundle{Id: v}) }) assert.Equal(t, "50", c.get("50").Id, "it returns the right bundle") diff --git a/ocis-pkg/roles/manager.go b/ocis-pkg/roles/manager.go index 040310d9f..afe8cc116 100644 --- a/ocis-pkg/roles/manager.go +++ b/ocis-pkg/roles/manager.go @@ -4,14 +4,15 @@ import ( "context" "github.com/owncloud/ocis/ocis-pkg/log" - settings "github.com/owncloud/ocis/settings/pkg/proto/v0" + settingsmsg "github.com/owncloud/ocis/protogen/gen/ocis/messages/settings/v1" + settingssvc "github.com/owncloud/ocis/protogen/gen/ocis/services/settings/v1" ) // Manager manages a cache of roles by fetching unknown roles from the settings.RoleService. type Manager struct { logger log.Logger cache cache - roleService settings.RoleService + roleService settingssvc.RoleService } // NewManager returns a new instance of Manager. @@ -25,9 +26,9 @@ func NewManager(o ...Option) Manager { } // List returns all roles that match the given roleIDs. -func (m *Manager) List(ctx context.Context, roleIDs []string) []*settings.Bundle { +func (m *Manager) List(ctx context.Context, roleIDs []string) []*settingsmsg.Bundle { // get from cache - result := make([]*settings.Bundle, 0) + result := make([]*settingsmsg.Bundle, 0) lookup := make([]string, 0) for _, roleID := range roleIDs { if hit := m.cache.get(roleID); hit == nil { @@ -39,7 +40,7 @@ func (m *Manager) List(ctx context.Context, roleIDs []string) []*settings.Bundle // if there are roles missing, fetch them from the RoleService if len(lookup) > 0 { - request := &settings.ListBundlesRequest{ + request := &settingssvc.ListBundlesRequest{ BundleIds: lookup, } res, err := m.roleService.ListRoles(ctx, request) @@ -56,7 +57,7 @@ func (m *Manager) List(ctx context.Context, roleIDs []string) []*settings.Bundle } // FindPermissionByID searches for a permission-setting by the permissionID, but limited to the given roleIDs -func (m *Manager) FindPermissionByID(ctx context.Context, roleIDs []string, permissionID string) *settings.Setting { +func (m *Manager) FindPermissionByID(ctx context.Context, roleIDs []string, permissionID string) *settingsmsg.Setting { for _, role := range m.List(ctx, roleIDs) { for _, setting := range role.Settings { if setting.Id == permissionID { @@ -66,4 +67,3 @@ func (m *Manager) FindPermissionByID(ctx context.Context, roleIDs []string, perm } return nil } - diff --git a/ocis-pkg/roles/option.go b/ocis-pkg/roles/option.go index 13e939953..5f3460cd1 100644 --- a/ocis-pkg/roles/option.go +++ b/ocis-pkg/roles/option.go @@ -4,7 +4,7 @@ import ( "time" "github.com/owncloud/ocis/ocis-pkg/log" - settings "github.com/owncloud/ocis/settings/pkg/proto/v0" + settingssvc "github.com/owncloud/ocis/protogen/gen/ocis/services/settings/v1" ) // Options are all the possible options. @@ -12,7 +12,7 @@ type Options struct { size int ttl time.Duration logger log.Logger - roleService settings.RoleService + roleService settingssvc.RoleService } // Option mutates option @@ -40,7 +40,7 @@ func Logger(logger log.Logger) Option { } // RoleService provides endpoints for fetching roles. -func RoleService(rs settings.RoleService) Option { +func RoleService(rs settingssvc.RoleService) Option { return func(o *Options) { o.roleService = rs } diff --git a/ocs/pkg/server/http/svc_test.go b/ocs/pkg/server/http/svc_test.go index b01095589..ae6a2d5db 100644 --- a/ocs/pkg/server/http/svc_test.go +++ b/ocs/pkg/server/http/svc_test.go @@ -28,7 +28,8 @@ import ( "github.com/owncloud/ocis/ocis-pkg/service/grpc" "github.com/owncloud/ocis/ocs/pkg/config" svc "github.com/owncloud/ocis/ocs/pkg/service/v0" - settings "github.com/owncloud/ocis/settings/pkg/proto/v0" + settingsmsg "github.com/owncloud/ocis/protogen/gen/ocis/messages/settings/v1" + settingssvc "github.com/owncloud/ocis/protogen/gen/ocis/services/settings/v1" ssvc "github.com/owncloud/ocis/settings/pkg/service/v0" "github.com/stretchr/testify/assert" "go-micro.dev/v4/client" @@ -512,23 +513,23 @@ func deleteGroup(t *testing.T, id string) (*empty.Empty, error) { return res, err } -func buildRoleServiceMock() settings.RoleService { - return settings.MockRoleService{ - AssignRoleToUserFunc: func(ctx context.Context, req *settings.AssignRoleToUserRequest, opts ...client.CallOption) (res *settings.AssignRoleToUserResponse, err error) { +func buildRoleServiceMock() settingssvc.RoleService { + return settingssvc.MockRoleService{ + AssignRoleToUserFunc: func(ctx context.Context, req *settingssvc.AssignRoleToUserRequest, opts ...client.CallOption) (res *settingssvc.AssignRoleToUserResponse, err error) { mockedRoleAssignment[req.AccountUuid] = req.RoleId - return &settings.AssignRoleToUserResponse{ - Assignment: &settings.UserRoleAssignment{ + return &settingssvc.AssignRoleToUserResponse{ + Assignment: &settingssvc.UserRoleAssignment{ AccountUuid: req.AccountUuid, RoleId: req.RoleId, }, }, nil }, - ListRolesFunc: func(ctx context.Context, req *settings.ListBundlesRequest, opts ...client.CallOption) (*settings.ListBundlesResponse, error) { - return &settings.ListBundlesResponse{ - Bundles: []*settings.Bundle{ + ListRolesFunc: func(ctx context.Context, req *settingssvc.ListBundlesRequest, opts ...client.CallOption) (*settingssvc.ListBundlesResponse, error) { + return &settingssvc.ListBundlesResponse{ + Bundles: []*settingsmsg.Bundle{ { Id: ssvc.BundleUUIDRoleAdmin, - Settings: []*settings.Setting{ + Settings: []*settingsmsg.Setting{ { Id: accountsSvc.AccountManagementPermissionID, }, @@ -536,7 +537,7 @@ func buildRoleServiceMock() settings.RoleService { }, { Id: ssvc.BundleUUIDRoleUser, - Settings: []*settings.Setting{ + Settings: []*settingsmsg.Setting{ { Id: accountsSvc.SelfManagementPermissionID, }, diff --git a/ocs/pkg/service/v0/option.go b/ocs/pkg/service/v0/option.go index 4de1623f2..c0d97710c 100644 --- a/ocs/pkg/service/v0/option.go +++ b/ocs/pkg/service/v0/option.go @@ -6,7 +6,7 @@ import ( "github.com/owncloud/ocis/ocis-pkg/log" "github.com/owncloud/ocis/ocis-pkg/roles" "github.com/owncloud/ocis/ocs/pkg/config" - settings "github.com/owncloud/ocis/settings/pkg/proto/v0" + settingssvc "github.com/owncloud/ocis/protogen/gen/ocis/services/settings/v1" ) // Option defines a single option function. @@ -17,7 +17,7 @@ type Options struct { Logger log.Logger Config *config.Config Middleware []func(http.Handler) http.Handler - RoleService settings.RoleService + RoleService settingssvc.RoleService RoleManager *roles.Manager } @@ -54,7 +54,7 @@ func Middleware(val ...func(http.Handler) http.Handler) Option { } // RoleService provides a function to set the RoleService option. -func RoleService(val settings.RoleService) Option { +func RoleService(val settingssvc.RoleService) Option { return func(o *Options) { o.RoleService = val } diff --git a/ocs/pkg/service/v0/service.go b/ocs/pkg/service/v0/service.go index 5a20171da..368c1f38e 100644 --- a/ocs/pkg/service/v0/service.go +++ b/ocs/pkg/service/v0/service.go @@ -21,8 +21,8 @@ import ( ocsm "github.com/owncloud/ocis/ocs/pkg/middleware" "github.com/owncloud/ocis/ocs/pkg/service/v0/data" "github.com/owncloud/ocis/ocs/pkg/service/v0/response" + settingssvc "github.com/owncloud/ocis/protogen/gen/ocis/services/settings/v1" "github.com/owncloud/ocis/proxy/pkg/user/backend" - settings "github.com/owncloud/ocis/settings/pkg/proto/v0" ) // Service defines the extension handlers. @@ -40,7 +40,7 @@ func NewService(opts ...Option) Service { roleService := options.RoleService if roleService == nil { - roleService = settings.NewRoleService("com.owncloud.api.settings", grpc.DefaultClient) + roleService = settingssvc.NewRoleService("com.owncloud.api.settings", grpc.DefaultClient) } roleManager := options.RoleManager if roleManager == nil { @@ -144,7 +144,7 @@ func NewService(opts ...Option) Service { type Ocs struct { config *config.Config logger log.Logger - RoleService settings.RoleService + RoleService settingssvc.RoleService RoleManager *roles.Manager mux *chi.Mux } diff --git a/proxy/pkg/command/server.go b/proxy/pkg/command/server.go index 7ed603614..fae2570ba 100644 --- a/proxy/pkg/command/server.go +++ b/proxy/pkg/command/server.go @@ -18,6 +18,7 @@ import ( pkgmiddleware "github.com/owncloud/ocis/ocis-pkg/middleware" "github.com/owncloud/ocis/ocis-pkg/service/grpc" "github.com/owncloud/ocis/ocis-pkg/version" + settingssvc "github.com/owncloud/ocis/protogen/gen/ocis/services/settings/v1" "github.com/owncloud/ocis/proxy/pkg/config" "github.com/owncloud/ocis/proxy/pkg/config/parser" "github.com/owncloud/ocis/proxy/pkg/cs3" @@ -29,7 +30,6 @@ import ( proxyHTTP "github.com/owncloud/ocis/proxy/pkg/server/http" "github.com/owncloud/ocis/proxy/pkg/tracing" "github.com/owncloud/ocis/proxy/pkg/user/backend" - settings "github.com/owncloud/ocis/settings/pkg/proto/v0" storepb "github.com/owncloud/ocis/store/pkg/proto/v0" "github.com/urfave/cli/v2" "golang.org/x/oauth2" @@ -126,7 +126,7 @@ func Server(cfg *config.Config) *cli.Command { } func loadMiddlewares(ctx context.Context, logger log.Logger, cfg *config.Config) alice.Chain { - rolesClient := settings.NewRoleService("com.owncloud.api.settings", grpc.DefaultClient) + rolesClient := settingssvc.NewRoleService("com.owncloud.api.settings", grpc.DefaultClient) revaClient, err := cs3.GetGatewayServiceClient(cfg.Reva.Address) var userProvider backend.UserBackend switch cfg.AccountBackend { diff --git a/proxy/pkg/config/defaultconfig.go b/proxy/pkg/config/defaultconfig.go index a5b1611e3..546a9a8be 100644 --- a/proxy/pkg/config/defaultconfig.go +++ b/proxy/pkg/config/defaultconfig.go @@ -141,7 +141,7 @@ func DefaultPolicies() []Policy { Backend: "http://localhost:9181", }, { - Endpoint: "/api/v0/settings", + Endpoint: "/api/v1/settings", Backend: "http://localhost:9190", }, { diff --git a/proxy/pkg/middleware/options.go b/proxy/pkg/middleware/options.go index 0ef5f86d8..bf3135403 100644 --- a/proxy/pkg/middleware/options.go +++ b/proxy/pkg/middleware/options.go @@ -6,9 +6,8 @@ import ( "github.com/owncloud/ocis/proxy/pkg/user/backend" - settings "github.com/owncloud/ocis/settings/pkg/proto/v0" - accountssvc "github.com/owncloud/ocis/protogen/gen/ocis/services/accounts/v1" + settingssvc "github.com/owncloud/ocis/protogen/gen/ocis/services/settings/v1" gateway "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1" "github.com/owncloud/ocis/ocis-pkg/log" @@ -34,7 +33,7 @@ type Options struct { // UP UserProvider backend.UserBackend // SettingsRoleService for the roles API in settings - SettingsRoleService settings.RoleService + SettingsRoleService settingssvc.RoleService // OIDCProviderFunc to lazily initialize an oidc provider, must be set for the oidc_auth middleware OIDCProviderFunc func() (OIDCProvider, error) // OIDCIss is the oidcAuth-issuer @@ -108,7 +107,7 @@ func AccountsClient(ac accountssvc.AccountsService) Option { } // SettingsRoleService provides a function to set the role service option. -func SettingsRoleService(rc settings.RoleService) Option { +func SettingsRoleService(rc settingssvc.RoleService) Option { return func(o *Options) { o.SettingsRoleService = rc } diff --git a/proxy/pkg/user/backend/accounts.go b/proxy/pkg/user/backend/accounts.go index 7142364ef..f5d19fc56 100644 --- a/proxy/pkg/user/backend/accounts.go +++ b/proxy/pkg/user/backend/accounts.go @@ -15,11 +15,11 @@ import ( "github.com/cs3org/reva/pkg/token" "github.com/owncloud/ocis/ocis-pkg/log" "github.com/owncloud/ocis/ocis-pkg/oidc" - settings "github.com/owncloud/ocis/settings/pkg/proto/v0" + settingssvc "github.com/owncloud/ocis/protogen/gen/ocis/services/settings/v1" ) // NewAccountsServiceUserBackend creates a user-provider which fetches users from the ocis accounts-service -func NewAccountsServiceUserBackend(ac accountssvc.AccountsService, rs settings.RoleService, oidcISS string, tokenManager token.Manager, logger log.Logger) UserBackend { +func NewAccountsServiceUserBackend(ac accountssvc.AccountsService, rs settingssvc.RoleService, oidcISS string, tokenManager token.Manager, logger log.Logger) UserBackend { return &accountsServiceBackend{ accountsClient: ac, settingsRoleService: rs, @@ -31,7 +31,7 @@ func NewAccountsServiceUserBackend(ac accountssvc.AccountsService, rs settings.R type accountsServiceBackend struct { accountsClient accountssvc.AccountsService - settingsRoleService settings.RoleService + settingsRoleService settingssvc.RoleService OIDCIss string logger log.Logger tokenManager token.Manager @@ -228,7 +228,7 @@ func expandGroups(account *accountsmsg.Account) []string { } // injectRoles adds roles from the roles-service to the user-struct by mutating an existing struct -func injectRoles(ctx context.Context, u *cs3.User, ss settings.RoleService) error { +func injectRoles(ctx context.Context, u *cs3.User, ss settingssvc.RoleService) error { roleIDs, err := loadRolesIDs(ctx, u.Id.OpaqueId, ss) if err != nil { return err diff --git a/proxy/pkg/user/backend/accounts_test.go b/proxy/pkg/user/backend/accounts_test.go index ed2a33b66..b54d070bf 100644 --- a/proxy/pkg/user/backend/accounts_test.go +++ b/proxy/pkg/user/backend/accounts_test.go @@ -9,7 +9,8 @@ import ( accounts "github.com/owncloud/ocis/accounts/pkg/proto/v0" "github.com/owncloud/ocis/ocis-pkg/log" "github.com/owncloud/ocis/ocis-pkg/oidc" - settings "github.com/owncloud/ocis/settings/pkg/proto/v0" + settingsmsg "github.com/owncloud/ocis/protogen/gen/ocis/messages/settings/v1" + settingssvc "github.com/owncloud/ocis/protogen/gen/ocis/services/settings/v1" "github.com/rs/zerolog" "github.com/stretchr/testify/assert" "go-micro.dev/v4/client" @@ -32,7 +33,7 @@ var mockAccResp = []*accounts.Account{ }, } -var expectedRoles = []*settings.UserRoleAssignment{ +var expectedRoles = []*settingsmsg.UserRoleAssignment{ {Id: "abc", AccountUuid: "1234", RoleId: "a"}, {Id: "def", AccountUuid: "1234", RoleId: "b"}, } @@ -150,7 +151,7 @@ func assertUserMatchesAccount(t *testing.T, exp *accounts.Account, act *userv1be assert.Equal(t, int64(2), act.GidNumber) } -func newAccountsBackend(mockAccounts []*accounts.Account, mockRoles []*settings.UserRoleAssignment) UserBackend { +func newAccountsBackend(mockAccounts []*accounts.Account, mockRoles []*settingsmsg.UserRoleAssignment) UserBackend { accSvc, roleSvc := getAccountService(mockAccounts, nil), getRoleService(mockRoles, nil) tokenManager, _ := jwt.New(map[string]interface{}{ "secret": "change-me", @@ -174,10 +175,10 @@ func getAccountService(expectedResponse []*accounts.Account, err error) *account } } -func getRoleService(expectedResponse []*settings.UserRoleAssignment, err error) *settings.MockRoleService { - return &settings.MockRoleService{ - ListRoleAssignmentsFunc: func(ctx context.Context, req *settings.ListRoleAssignmentsRequest, opts ...client.CallOption) (*settings.ListRoleAssignmentsResponse, error) { - return &settings.ListRoleAssignmentsResponse{Assignments: expectedResponse}, err +func getRoleService(expectedResponse []*settingsmsg.UserRoleAssignment, err error) *settingssvc.MockRoleService { + return &settingssvc.MockRoleService{ + ListRoleAssignmentsFunc: func(ctx context.Context, req *settingssvc.ListRoleAssignmentsRequest, opts ...client.CallOption) (*settingssvc.ListRoleAssignmentsResponse, error) { + return &settingssvc.ListRoleAssignmentsResponse{Assignments: expectedResponse}, err }, } diff --git a/proxy/pkg/user/backend/backend.go b/proxy/pkg/user/backend/backend.go index ab3fb3c06..cc6cf8353 100644 --- a/proxy/pkg/user/backend/backend.go +++ b/proxy/pkg/user/backend/backend.go @@ -8,7 +8,7 @@ import ( gateway "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1" cs3 "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1" types "github.com/cs3org/go-cs3apis/cs3/types/v1beta1" - settings "github.com/owncloud/ocis/settings/pkg/proto/v0" + settingssvc "github.com/owncloud/ocis/protogen/gen/ocis/services/settings/v1" "google.golang.org/grpc" ) @@ -35,8 +35,8 @@ type RevaAuthenticator interface { } // loadRolesIDs returns the role-ids assigned to an user -func loadRolesIDs(ctx context.Context, opaqueUserID string, rs settings.RoleService) ([]string, error) { - req := &settings.ListRoleAssignmentsRequest{AccountUuid: opaqueUserID} +func loadRolesIDs(ctx context.Context, opaqueUserID string, rs settingssvc.RoleService) ([]string, error) { + req := &settingssvc.ListRoleAssignmentsRequest{AccountUuid: opaqueUserID} assignmentResponse, err := rs.ListRoleAssignments(ctx, req) if err != nil { diff --git a/proxy/pkg/user/backend/cs3.go b/proxy/pkg/user/backend/cs3.go index 4623c7d5c..43f532a9d 100644 --- a/proxy/pkg/user/backend/cs3.go +++ b/proxy/pkg/user/backend/cs3.go @@ -9,19 +9,19 @@ import ( rpcv1beta1 "github.com/cs3org/go-cs3apis/cs3/rpc/v1beta1" types "github.com/cs3org/go-cs3apis/cs3/types/v1beta1" "github.com/owncloud/ocis/ocis-pkg/log" - settings "github.com/owncloud/ocis/settings/pkg/proto/v0" - settingsSvc "github.com/owncloud/ocis/settings/pkg/service/v0" + settingssvc "github.com/owncloud/ocis/protogen/gen/ocis/services/settings/v1" + settingsService "github.com/owncloud/ocis/settings/pkg/service/v0" ) type cs3backend struct { - settingsRoleService settings.RoleService + settingsRoleService settingssvc.RoleService authProvider RevaAuthenticator machineAuthAPIKey string logger log.Logger } // NewCS3UserBackend creates a user-provider which fetches users from a CS3 UserBackend -func NewCS3UserBackend(rs settings.RoleService, ap RevaAuthenticator, machineAuthAPIKey string, logger log.Logger) UserBackend { +func NewCS3UserBackend(rs settingssvc.RoleService, ap RevaAuthenticator, machineAuthAPIKey string, logger log.Logger) UserBackend { return &cs3backend{ settingsRoleService: rs, authProvider: ap, @@ -62,7 +62,7 @@ func (c *cs3backend) GetUserByClaims(ctx context.Context, claim, value string, w } if len(roleIDs) == 0 { - roleIDs = append(roleIDs, settingsSvc.BundleUUIDRoleUser, settingsSvc.SelfManagementPermissionID) + roleIDs = append(roleIDs, settingsService.BundleUUIDRoleUser, settingsService.SelfManagementPermissionID) // if roles are empty, assume we haven't seen the user before and assign a default user role. At least until // proper roles are provided. See https://github.com/owncloud/ocis/issues/1825 for more context. //return user, nil diff --git a/settings/pkg/proto/v0/settings.mock.go b/settings/pkg/proto/v0/settings.mock.go deleted file mode 100644 index 060ded41d..000000000 --- a/settings/pkg/proto/v0/settings.mock.go +++ /dev/null @@ -1,186 +0,0 @@ -package proto - -import ( - "context" - - "go-micro.dev/v4/client" - "google.golang.org/protobuf/types/known/emptypb" -) - -// MockBundleService can be used to write tests against the bundle service. -/* -To create a mock overwrite the functions of an instance like this: - -```go -func mockBundleSvc(returnErr bool) proto.BundleService { - if returnErr { - return &proto.MockBundleService{ - ListBundlesFunc: func(ctx context.Context, in *proto.ListBundlesRequest, opts ...client.CallOption) (out *proto.ListBundlesResponse, err error) { - return nil, fmt.Errorf("error returned by mockBundleSvc LIST") - }, - } - } - - return &proto.MockBundleService{ - ListBundlesFunc: func(ctx context.Context, in *proto.ListBundlesRequest, opts ...client.CallOption) (out *proto.ListBundlesResponse, err error) { - return &proto.ListBundlesResponse{ - Bundles: []*proto.Bundle{ - { - Id: "hello-there", - }, - }, - }, nil - }, - } -} -``` -*/ -type MockBundleService struct { - ListBundlesFunc func(ctx context.Context, req *ListBundlesRequest, opts ...client.CallOption) (*ListBundlesResponse, error) - GetBundleFunc func(ctx context.Context, req *GetBundleRequest, opts ...client.CallOption) (*GetBundleResponse, error) - SaveBundleFunc func(ctx context.Context, req *SaveBundleRequest, opts ...client.CallOption) (*SaveBundleResponse, error) - AddSettingToBundleFunc func(ctx context.Context, req *AddSettingToBundleRequest, opts ...client.CallOption) (*AddSettingToBundleResponse, error) - RemoveSettingFromBundleFunc func(ctx context.Context, req *RemoveSettingFromBundleRequest, opts ...client.CallOption) (*emptypb.Empty, error) -} - -// ListBundles will panic if the function has been called, but not mocked -func (m MockBundleService) ListBundles(ctx context.Context, req *ListBundlesRequest, opts ...client.CallOption) (*ListBundlesResponse, error) { - if m.ListBundlesFunc != nil { - return m.ListBundlesFunc(ctx, req, opts...) - } - panic("ListBundlesFunc was called in test but not mocked") -} - -// GetBundle will panic if the function has been called, but not mocked -func (m MockBundleService) GetBundle(ctx context.Context, req *GetBundleRequest, opts ...client.CallOption) (*GetBundleResponse, error) { - if m.GetBundleFunc != nil { - return m.GetBundleFunc(ctx, req, opts...) - } - panic("GetBundleFunc was called in test but not mocked") -} - -// SaveBundle will panic if the function has been called, but not mocked -func (m MockBundleService) SaveBundle(ctx context.Context, req *SaveBundleRequest, opts ...client.CallOption) (*SaveBundleResponse, error) { - if m.SaveBundleFunc != nil { - return m.SaveBundleFunc(ctx, req, opts...) - } - panic("SaveBundleFunc was called in test but not mocked") -} - -// AddSettingToBundle will panic if the function has been called, but not mocked -func (m MockBundleService) AddSettingToBundle(ctx context.Context, req *AddSettingToBundleRequest, opts ...client.CallOption) (*AddSettingToBundleResponse, error) { - if m.AddSettingToBundleFunc != nil { - return m.AddSettingToBundleFunc(ctx, req, opts...) - } - panic("AddSettingToBundleFunc was called in test but not mocked") -} - -// RemoveSettingFromBundle will panic if the function has been called, but not mocked -func (m MockBundleService) RemoveSettingFromBundle(ctx context.Context, req *RemoveSettingFromBundleRequest, opts ...client.CallOption) (*emptypb.Empty, error) { - if m.RemoveSettingFromBundleFunc != nil { - return m.RemoveSettingFromBundleFunc(ctx, req, opts...) - } - panic("RemoveSettingFromBundleFunc was called in test but not mocked") -} - -// MockValueService can be used to write tests against the value service. -type MockValueService struct { - ListValuesFunc func(ctx context.Context, req *ListValuesRequest, opts ...client.CallOption) (*ListValuesResponse, error) - GetValueFunc func(ctx context.Context, req *GetValueRequest, opts ...client.CallOption) (*GetValueResponse, error) - GetValueByUniqueIdentifiersFunc func(ctx context.Context, req *GetValueByUniqueIdentifiersRequest, opts ...client.CallOption) (*GetValueResponse, error) - SaveValueFunc func(ctx context.Context, req *SaveValueRequest, opts ...client.CallOption) (*SaveValueResponse, error) -} - -// ListValues will panic if the function has been called, but not mocked -func (m MockValueService) ListValues(ctx context.Context, req *ListValuesRequest, opts ...client.CallOption) (*ListValuesResponse, error) { - if m.ListValuesFunc != nil { - return m.ListValuesFunc(ctx, req, opts...) - } - panic("ListValuesFunc was called in test but not mocked") -} - -// GetValue will panic if the function has been called, but not mocked -func (m MockValueService) GetValue(ctx context.Context, req *GetValueRequest, opts ...client.CallOption) (*GetValueResponse, error) { - if m.GetValueFunc != nil { - return m.GetValueFunc(ctx, req, opts...) - } - panic("GetValueFunc was called in test but not mocked") -} - -// GetValueByUniqueIdentifiers will panic if the function has been called, but not mocked -func (m MockValueService) GetValueByUniqueIdentifiers(ctx context.Context, req *GetValueByUniqueIdentifiersRequest, opts ...client.CallOption) (*GetValueResponse, error) { - if m.GetValueByUniqueIdentifiersFunc != nil { - return m.GetValueByUniqueIdentifiersFunc(ctx, req, opts...) - } - panic("GetValueByUniqueIdentifiersFunc was called in test but not mocked") -} - -// SaveValue will panic if the function has been called, but not mocked -func (m MockValueService) SaveValue(ctx context.Context, req *SaveValueRequest, opts ...client.CallOption) (*SaveValueResponse, error) { - if m.SaveValueFunc != nil { - return m.SaveValueFunc(ctx, req, opts...) - } - panic("SaveValueFunc was called in test but not mocked") -} - -// MockRoleService will panic if the function has been called, but not mocked -type MockRoleService struct { - ListRolesFunc func(ctx context.Context, req *ListBundlesRequest, opts ...client.CallOption) (*ListBundlesResponse, error) - ListRoleAssignmentsFunc func(ctx context.Context, req *ListRoleAssignmentsRequest, opts ...client.CallOption) (*ListRoleAssignmentsResponse, error) - AssignRoleToUserFunc func(ctx context.Context, req *AssignRoleToUserRequest, opts ...client.CallOption) (*AssignRoleToUserResponse, error) - RemoveRoleFromUserFunc func(ctx context.Context, req *RemoveRoleFromUserRequest, opts ...client.CallOption) (*emptypb.Empty, error) -} - -// ListRoles will panic if the function has been called, but not mocked -func (m MockRoleService) ListRoles(ctx context.Context, req *ListBundlesRequest, opts ...client.CallOption) (*ListBundlesResponse, error) { - if m.ListRolesFunc != nil { - return m.ListRolesFunc(ctx, req, opts...) - } - panic("ListRolesFunc was called in test but not mocked") -} - -// ListRoleAssignments will panic if the function has been called, but not mocked -func (m MockRoleService) ListRoleAssignments(ctx context.Context, req *ListRoleAssignmentsRequest, opts ...client.CallOption) (*ListRoleAssignmentsResponse, error) { - if m.ListRoleAssignmentsFunc != nil { - return m.ListRoleAssignmentsFunc(ctx, req, opts...) - } - panic("ListRoleAssignmentsFunc was called in test but not mocked") -} - -// AssignRoleToUser will panic if the function has been called, but not mocked -func (m MockRoleService) AssignRoleToUser(ctx context.Context, req *AssignRoleToUserRequest, opts ...client.CallOption) (*AssignRoleToUserResponse, error) { - if m.AssignRoleToUserFunc != nil { - return m.AssignRoleToUserFunc(ctx, req, opts...) - } - panic("AssignRoleToUserFunc was called in test but not mocked") -} - -// RemoveRoleFromUser will panic if the function has been called, but not mocked -func (m MockRoleService) RemoveRoleFromUser(ctx context.Context, req *RemoveRoleFromUserRequest, opts ...client.CallOption) (*emptypb.Empty, error) { - if m.RemoveRoleFromUserFunc != nil { - return m.RemoveRoleFromUserFunc(ctx, req, opts...) - } - panic("RemoveRoleFromUserFunc was called in test but not mocked") -} - -// MockPermissionService will panic if the function has been called, but not mocked -type MockPermissionService struct { - ListPermissionsByResourceFunc func(ctx context.Context, req *ListPermissionsByResourceRequest, opts ...client.CallOption) (*ListPermissionsByResourceResponse, error) - GetPermissionByIDFunc func(ctx context.Context, req *GetPermissionByIDRequest, opts ...client.CallOption) (*GetPermissionByIDResponse, error) -} - -// ListPermissionsByResource will panic if the function has been called, but not mocked -func (m MockPermissionService) ListPermissionsByResource(ctx context.Context, req *ListPermissionsByResourceRequest, opts ...client.CallOption) (*ListPermissionsByResourceResponse, error) { - if m.ListPermissionsByResourceFunc != nil { - return m.ListPermissionsByResourceFunc(ctx, req, opts...) - } - panic("ListPermissionsByResourceFunc was called in test but not mocked") -} - -// GetPermissionByID will panic if the function has been called, but not mocked -func (m MockPermissionService) GetPermissionByID(ctx context.Context, req *GetPermissionByIDRequest, opts ...client.CallOption) (*GetPermissionByIDResponse, error) { - if m.GetPermissionByIDFunc != nil { - return m.GetPermissionByIDFunc(ctx, req, opts...) - } - panic("GetPermissionByIDFunc was called in test but not mocked") -} diff --git a/settings/pkg/proto/v0/settings.pb.go b/settings/pkg/proto/v0/settings.pb.go deleted file mode 100644 index 66f93c7fc..000000000 --- a/settings/pkg/proto/v0/settings.pb.go +++ /dev/null @@ -1,3901 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.1 -// protoc v3.17.3 -// source: proto/v0/settings.proto - -package proto - -import ( - _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" - _ "google.golang.org/genproto/googleapis/api/annotations" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - emptypb "google.golang.org/protobuf/types/known/emptypb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Resource_Type int32 - -const ( - Resource_TYPE_UNKNOWN Resource_Type = 0 - Resource_TYPE_SYSTEM Resource_Type = 1 - Resource_TYPE_FILE Resource_Type = 2 - Resource_TYPE_SHARE Resource_Type = 3 - Resource_TYPE_SETTING Resource_Type = 4 - Resource_TYPE_BUNDLE Resource_Type = 5 - Resource_TYPE_USER Resource_Type = 6 - Resource_TYPE_GROUP Resource_Type = 7 -) - -// Enum value maps for Resource_Type. -var ( - Resource_Type_name = map[int32]string{ - 0: "TYPE_UNKNOWN", - 1: "TYPE_SYSTEM", - 2: "TYPE_FILE", - 3: "TYPE_SHARE", - 4: "TYPE_SETTING", - 5: "TYPE_BUNDLE", - 6: "TYPE_USER", - 7: "TYPE_GROUP", - } - Resource_Type_value = map[string]int32{ - "TYPE_UNKNOWN": 0, - "TYPE_SYSTEM": 1, - "TYPE_FILE": 2, - "TYPE_SHARE": 3, - "TYPE_SETTING": 4, - "TYPE_BUNDLE": 5, - "TYPE_USER": 6, - "TYPE_GROUP": 7, - } -) - -func (x Resource_Type) Enum() *Resource_Type { - p := new(Resource_Type) - *p = x - return p -} - -func (x Resource_Type) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Resource_Type) Descriptor() protoreflect.EnumDescriptor { - return file_proto_v0_settings_proto_enumTypes[0].Descriptor() -} - -func (Resource_Type) Type() protoreflect.EnumType { - return &file_proto_v0_settings_proto_enumTypes[0] -} - -func (x Resource_Type) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Resource_Type.Descriptor instead. -func (Resource_Type) EnumDescriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{28, 0} -} - -type Bundle_Type int32 - -const ( - Bundle_TYPE_UNKNOWN Bundle_Type = 0 - Bundle_TYPE_DEFAULT Bundle_Type = 1 - Bundle_TYPE_ROLE Bundle_Type = 2 -) - -// Enum value maps for Bundle_Type. -var ( - Bundle_Type_name = map[int32]string{ - 0: "TYPE_UNKNOWN", - 1: "TYPE_DEFAULT", - 2: "TYPE_ROLE", - } - Bundle_Type_value = map[string]int32{ - "TYPE_UNKNOWN": 0, - "TYPE_DEFAULT": 1, - "TYPE_ROLE": 2, - } -) - -func (x Bundle_Type) Enum() *Bundle_Type { - p := new(Bundle_Type) - *p = x - return p -} - -func (x Bundle_Type) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Bundle_Type) Descriptor() protoreflect.EnumDescriptor { - return file_proto_v0_settings_proto_enumTypes[1].Descriptor() -} - -func (Bundle_Type) Type() protoreflect.EnumType { - return &file_proto_v0_settings_proto_enumTypes[1] -} - -func (x Bundle_Type) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Bundle_Type.Descriptor instead. -func (Bundle_Type) EnumDescriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{29, 0} -} - -type Permission_Operation int32 - -const ( - Permission_OPERATION_UNKNOWN Permission_Operation = 0 - Permission_OPERATION_CREATE Permission_Operation = 1 - Permission_OPERATION_READ Permission_Operation = 2 - Permission_OPERATION_UPDATE Permission_Operation = 3 - Permission_OPERATION_DELETE Permission_Operation = 4 - Permission_OPERATION_WRITE Permission_Operation = 5 // WRITE is a combination of CREATE and UPDATE - Permission_OPERATION_READWRITE Permission_Operation = 6 // READWRITE is a combination of READ and WRITE -) - -// Enum value maps for Permission_Operation. -var ( - Permission_Operation_name = map[int32]string{ - 0: "OPERATION_UNKNOWN", - 1: "OPERATION_CREATE", - 2: "OPERATION_READ", - 3: "OPERATION_UPDATE", - 4: "OPERATION_DELETE", - 5: "OPERATION_WRITE", - 6: "OPERATION_READWRITE", - } - Permission_Operation_value = map[string]int32{ - "OPERATION_UNKNOWN": 0, - "OPERATION_CREATE": 1, - "OPERATION_READ": 2, - "OPERATION_UPDATE": 3, - "OPERATION_DELETE": 4, - "OPERATION_WRITE": 5, - "OPERATION_READWRITE": 6, - } -) - -func (x Permission_Operation) Enum() *Permission_Operation { - p := new(Permission_Operation) - *p = x - return p -} - -func (x Permission_Operation) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Permission_Operation) Descriptor() protoreflect.EnumDescriptor { - return file_proto_v0_settings_proto_enumTypes[2].Descriptor() -} - -func (Permission_Operation) Type() protoreflect.EnumType { - return &file_proto_v0_settings_proto_enumTypes[2] -} - -func (x Permission_Operation) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Permission_Operation.Descriptor instead. -func (Permission_Operation) EnumDescriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{37, 0} -} - -type Permission_Constraint int32 - -const ( - Permission_CONSTRAINT_UNKNOWN Permission_Constraint = 0 - Permission_CONSTRAINT_OWN Permission_Constraint = 1 - Permission_CONSTRAINT_SHARED Permission_Constraint = 2 - Permission_CONSTRAINT_ALL Permission_Constraint = 3 -) - -// Enum value maps for Permission_Constraint. -var ( - Permission_Constraint_name = map[int32]string{ - 0: "CONSTRAINT_UNKNOWN", - 1: "CONSTRAINT_OWN", - 2: "CONSTRAINT_SHARED", - 3: "CONSTRAINT_ALL", - } - Permission_Constraint_value = map[string]int32{ - "CONSTRAINT_UNKNOWN": 0, - "CONSTRAINT_OWN": 1, - "CONSTRAINT_SHARED": 2, - "CONSTRAINT_ALL": 3, - } -) - -func (x Permission_Constraint) Enum() *Permission_Constraint { - p := new(Permission_Constraint) - *p = x - return p -} - -func (x Permission_Constraint) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Permission_Constraint) Descriptor() protoreflect.EnumDescriptor { - return file_proto_v0_settings_proto_enumTypes[3].Descriptor() -} - -func (Permission_Constraint) Type() protoreflect.EnumType { - return &file_proto_v0_settings_proto_enumTypes[3] -} - -func (x Permission_Constraint) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Permission_Constraint.Descriptor instead. -func (Permission_Constraint) EnumDescriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{37, 1} -} - -// --- -// requests and responses for settings bundles -// --- -type SaveBundleRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Bundle *Bundle `protobuf:"bytes,1,opt,name=bundle,proto3" json:"bundle,omitempty"` -} - -func (x *SaveBundleRequest) Reset() { - *x = SaveBundleRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SaveBundleRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SaveBundleRequest) ProtoMessage() {} - -func (x *SaveBundleRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SaveBundleRequest.ProtoReflect.Descriptor instead. -func (*SaveBundleRequest) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{0} -} - -func (x *SaveBundleRequest) GetBundle() *Bundle { - if x != nil { - return x.Bundle - } - return nil -} - -type SaveBundleResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Bundle *Bundle `protobuf:"bytes,1,opt,name=bundle,proto3" json:"bundle,omitempty"` -} - -func (x *SaveBundleResponse) Reset() { - *x = SaveBundleResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SaveBundleResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SaveBundleResponse) ProtoMessage() {} - -func (x *SaveBundleResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SaveBundleResponse.ProtoReflect.Descriptor instead. -func (*SaveBundleResponse) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{1} -} - -func (x *SaveBundleResponse) GetBundle() *Bundle { - if x != nil { - return x.Bundle - } - return nil -} - -type GetBundleRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - BundleId string `protobuf:"bytes,1,opt,name=bundle_id,json=bundleId,proto3" json:"bundle_id,omitempty"` -} - -func (x *GetBundleRequest) Reset() { - *x = GetBundleRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetBundleRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetBundleRequest) ProtoMessage() {} - -func (x *GetBundleRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetBundleRequest.ProtoReflect.Descriptor instead. -func (*GetBundleRequest) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{2} -} - -func (x *GetBundleRequest) GetBundleId() string { - if x != nil { - return x.BundleId - } - return "" -} - -type GetBundleResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Bundle *Bundle `protobuf:"bytes,1,opt,name=bundle,proto3" json:"bundle,omitempty"` -} - -func (x *GetBundleResponse) Reset() { - *x = GetBundleResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetBundleResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetBundleResponse) ProtoMessage() {} - -func (x *GetBundleResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetBundleResponse.ProtoReflect.Descriptor instead. -func (*GetBundleResponse) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{3} -} - -func (x *GetBundleResponse) GetBundle() *Bundle { - if x != nil { - return x.Bundle - } - return nil -} - -type ListBundlesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - BundleIds []string `protobuf:"bytes,1,rep,name=bundle_ids,json=bundleIds,proto3" json:"bundle_ids,omitempty"` -} - -func (x *ListBundlesRequest) Reset() { - *x = ListBundlesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListBundlesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListBundlesRequest) ProtoMessage() {} - -func (x *ListBundlesRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListBundlesRequest.ProtoReflect.Descriptor instead. -func (*ListBundlesRequest) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{4} -} - -func (x *ListBundlesRequest) GetBundleIds() []string { - if x != nil { - return x.BundleIds - } - return nil -} - -type ListBundlesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Bundles []*Bundle `protobuf:"bytes,1,rep,name=bundles,proto3" json:"bundles,omitempty"` -} - -func (x *ListBundlesResponse) Reset() { - *x = ListBundlesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListBundlesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListBundlesResponse) ProtoMessage() {} - -func (x *ListBundlesResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListBundlesResponse.ProtoReflect.Descriptor instead. -func (*ListBundlesResponse) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{5} -} - -func (x *ListBundlesResponse) GetBundles() []*Bundle { - if x != nil { - return x.Bundles - } - return nil -} - -type AddSettingToBundleRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - BundleId string `protobuf:"bytes,1,opt,name=bundle_id,json=bundleId,proto3" json:"bundle_id,omitempty"` - Setting *Setting `protobuf:"bytes,2,opt,name=setting,proto3" json:"setting,omitempty"` -} - -func (x *AddSettingToBundleRequest) Reset() { - *x = AddSettingToBundleRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AddSettingToBundleRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddSettingToBundleRequest) ProtoMessage() {} - -func (x *AddSettingToBundleRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AddSettingToBundleRequest.ProtoReflect.Descriptor instead. -func (*AddSettingToBundleRequest) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{6} -} - -func (x *AddSettingToBundleRequest) GetBundleId() string { - if x != nil { - return x.BundleId - } - return "" -} - -func (x *AddSettingToBundleRequest) GetSetting() *Setting { - if x != nil { - return x.Setting - } - return nil -} - -type AddSettingToBundleResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Setting *Setting `protobuf:"bytes,1,opt,name=setting,proto3" json:"setting,omitempty"` -} - -func (x *AddSettingToBundleResponse) Reset() { - *x = AddSettingToBundleResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AddSettingToBundleResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddSettingToBundleResponse) ProtoMessage() {} - -func (x *AddSettingToBundleResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AddSettingToBundleResponse.ProtoReflect.Descriptor instead. -func (*AddSettingToBundleResponse) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{7} -} - -func (x *AddSettingToBundleResponse) GetSetting() *Setting { - if x != nil { - return x.Setting - } - return nil -} - -type RemoveSettingFromBundleRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - BundleId string `protobuf:"bytes,1,opt,name=bundle_id,json=bundleId,proto3" json:"bundle_id,omitempty"` - SettingId string `protobuf:"bytes,2,opt,name=setting_id,json=settingId,proto3" json:"setting_id,omitempty"` -} - -func (x *RemoveSettingFromBundleRequest) Reset() { - *x = RemoveSettingFromBundleRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RemoveSettingFromBundleRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveSettingFromBundleRequest) ProtoMessage() {} - -func (x *RemoveSettingFromBundleRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RemoveSettingFromBundleRequest.ProtoReflect.Descriptor instead. -func (*RemoveSettingFromBundleRequest) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{8} -} - -func (x *RemoveSettingFromBundleRequest) GetBundleId() string { - if x != nil { - return x.BundleId - } - return "" -} - -func (x *RemoveSettingFromBundleRequest) GetSettingId() string { - if x != nil { - return x.SettingId - } - return "" -} - -type SaveValueRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Value *Value `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *SaveValueRequest) Reset() { - *x = SaveValueRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SaveValueRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SaveValueRequest) ProtoMessage() {} - -func (x *SaveValueRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SaveValueRequest.ProtoReflect.Descriptor instead. -func (*SaveValueRequest) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{9} -} - -func (x *SaveValueRequest) GetValue() *Value { - if x != nil { - return x.Value - } - return nil -} - -type SaveValueResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Value *ValueWithIdentifier `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *SaveValueResponse) Reset() { - *x = SaveValueResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SaveValueResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SaveValueResponse) ProtoMessage() {} - -func (x *SaveValueResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SaveValueResponse.ProtoReflect.Descriptor instead. -func (*SaveValueResponse) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{10} -} - -func (x *SaveValueResponse) GetValue() *ValueWithIdentifier { - if x != nil { - return x.Value - } - return nil -} - -type GetValueRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *GetValueRequest) Reset() { - *x = GetValueRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetValueRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetValueRequest) ProtoMessage() {} - -func (x *GetValueRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetValueRequest.ProtoReflect.Descriptor instead. -func (*GetValueRequest) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{11} -} - -func (x *GetValueRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -type GetValueResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Value *ValueWithIdentifier `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *GetValueResponse) Reset() { - *x = GetValueResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetValueResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetValueResponse) ProtoMessage() {} - -func (x *GetValueResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetValueResponse.ProtoReflect.Descriptor instead. -func (*GetValueResponse) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{12} -} - -func (x *GetValueResponse) GetValue() *ValueWithIdentifier { - if x != nil { - return x.Value - } - return nil -} - -type ListValuesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - BundleId string `protobuf:"bytes,1,opt,name=bundle_id,json=bundleId,proto3" json:"bundle_id,omitempty"` - AccountUuid string `protobuf:"bytes,2,opt,name=account_uuid,json=accountUuid,proto3" json:"account_uuid,omitempty"` -} - -func (x *ListValuesRequest) Reset() { - *x = ListValuesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListValuesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListValuesRequest) ProtoMessage() {} - -func (x *ListValuesRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListValuesRequest.ProtoReflect.Descriptor instead. -func (*ListValuesRequest) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{13} -} - -func (x *ListValuesRequest) GetBundleId() string { - if x != nil { - return x.BundleId - } - return "" -} - -func (x *ListValuesRequest) GetAccountUuid() string { - if x != nil { - return x.AccountUuid - } - return "" -} - -type ListValuesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Values []*ValueWithIdentifier `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` -} - -func (x *ListValuesResponse) Reset() { - *x = ListValuesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListValuesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListValuesResponse) ProtoMessage() {} - -func (x *ListValuesResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListValuesResponse.ProtoReflect.Descriptor instead. -func (*ListValuesResponse) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{14} -} - -func (x *ListValuesResponse) GetValues() []*ValueWithIdentifier { - if x != nil { - return x.Values - } - return nil -} - -type GetValueByUniqueIdentifiersRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AccountUuid string `protobuf:"bytes,1,opt,name=account_uuid,json=accountUuid,proto3" json:"account_uuid,omitempty"` - SettingId string `protobuf:"bytes,2,opt,name=setting_id,json=settingId,proto3" json:"setting_id,omitempty"` -} - -func (x *GetValueByUniqueIdentifiersRequest) Reset() { - *x = GetValueByUniqueIdentifiersRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetValueByUniqueIdentifiersRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetValueByUniqueIdentifiersRequest) ProtoMessage() {} - -func (x *GetValueByUniqueIdentifiersRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetValueByUniqueIdentifiersRequest.ProtoReflect.Descriptor instead. -func (*GetValueByUniqueIdentifiersRequest) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{15} -} - -func (x *GetValueByUniqueIdentifiersRequest) GetAccountUuid() string { - if x != nil { - return x.AccountUuid - } - return "" -} - -func (x *GetValueByUniqueIdentifiersRequest) GetSettingId() string { - if x != nil { - return x.SettingId - } - return "" -} - -type ValueWithIdentifier struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Identifier *Identifier `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"` - Value *Value `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *ValueWithIdentifier) Reset() { - *x = ValueWithIdentifier{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ValueWithIdentifier) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ValueWithIdentifier) ProtoMessage() {} - -func (x *ValueWithIdentifier) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ValueWithIdentifier.ProtoReflect.Descriptor instead. -func (*ValueWithIdentifier) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{16} -} - -func (x *ValueWithIdentifier) GetIdentifier() *Identifier { - if x != nil { - return x.Identifier - } - return nil -} - -func (x *ValueWithIdentifier) GetValue() *Value { - if x != nil { - return x.Value - } - return nil -} - -type Identifier struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Extension string `protobuf:"bytes,1,opt,name=extension,proto3" json:"extension,omitempty"` - Bundle string `protobuf:"bytes,2,opt,name=bundle,proto3" json:"bundle,omitempty"` - Setting string `protobuf:"bytes,3,opt,name=setting,proto3" json:"setting,omitempty"` -} - -func (x *Identifier) Reset() { - *x = Identifier{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Identifier) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Identifier) ProtoMessage() {} - -func (x *Identifier) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[17] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Identifier.ProtoReflect.Descriptor instead. -func (*Identifier) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{17} -} - -func (x *Identifier) GetExtension() string { - if x != nil { - return x.Extension - } - return "" -} - -func (x *Identifier) GetBundle() string { - if x != nil { - return x.Bundle - } - return "" -} - -func (x *Identifier) GetSetting() string { - if x != nil { - return x.Setting - } - return "" -} - -type ListRoleAssignmentsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AccountUuid string `protobuf:"bytes,1,opt,name=account_uuid,json=accountUuid,proto3" json:"account_uuid,omitempty"` -} - -func (x *ListRoleAssignmentsRequest) Reset() { - *x = ListRoleAssignmentsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListRoleAssignmentsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRoleAssignmentsRequest) ProtoMessage() {} - -func (x *ListRoleAssignmentsRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[18] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListRoleAssignmentsRequest.ProtoReflect.Descriptor instead. -func (*ListRoleAssignmentsRequest) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{18} -} - -func (x *ListRoleAssignmentsRequest) GetAccountUuid() string { - if x != nil { - return x.AccountUuid - } - return "" -} - -type ListRoleAssignmentsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Assignments []*UserRoleAssignment `protobuf:"bytes,1,rep,name=assignments,proto3" json:"assignments,omitempty"` -} - -func (x *ListRoleAssignmentsResponse) Reset() { - *x = ListRoleAssignmentsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListRoleAssignmentsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRoleAssignmentsResponse) ProtoMessage() {} - -func (x *ListRoleAssignmentsResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[19] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListRoleAssignmentsResponse.ProtoReflect.Descriptor instead. -func (*ListRoleAssignmentsResponse) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{19} -} - -func (x *ListRoleAssignmentsResponse) GetAssignments() []*UserRoleAssignment { - if x != nil { - return x.Assignments - } - return nil -} - -type AssignRoleToUserRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AccountUuid string `protobuf:"bytes,1,opt,name=account_uuid,json=accountUuid,proto3" json:"account_uuid,omitempty"` - // the role_id is a bundle_id internally - RoleId string `protobuf:"bytes,2,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` -} - -func (x *AssignRoleToUserRequest) Reset() { - *x = AssignRoleToUserRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AssignRoleToUserRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AssignRoleToUserRequest) ProtoMessage() {} - -func (x *AssignRoleToUserRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[20] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AssignRoleToUserRequest.ProtoReflect.Descriptor instead. -func (*AssignRoleToUserRequest) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{20} -} - -func (x *AssignRoleToUserRequest) GetAccountUuid() string { - if x != nil { - return x.AccountUuid - } - return "" -} - -func (x *AssignRoleToUserRequest) GetRoleId() string { - if x != nil { - return x.RoleId - } - return "" -} - -type AssignRoleToUserResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Assignment *UserRoleAssignment `protobuf:"bytes,1,opt,name=assignment,proto3" json:"assignment,omitempty"` -} - -func (x *AssignRoleToUserResponse) Reset() { - *x = AssignRoleToUserResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AssignRoleToUserResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AssignRoleToUserResponse) ProtoMessage() {} - -func (x *AssignRoleToUserResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[21] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AssignRoleToUserResponse.ProtoReflect.Descriptor instead. -func (*AssignRoleToUserResponse) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{21} -} - -func (x *AssignRoleToUserResponse) GetAssignment() *UserRoleAssignment { - if x != nil { - return x.Assignment - } - return nil -} - -type RemoveRoleFromUserRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *RemoveRoleFromUserRequest) Reset() { - *x = RemoveRoleFromUserRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RemoveRoleFromUserRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveRoleFromUserRequest) ProtoMessage() {} - -func (x *RemoveRoleFromUserRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[22] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RemoveRoleFromUserRequest.ProtoReflect.Descriptor instead. -func (*RemoveRoleFromUserRequest) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{22} -} - -func (x *RemoveRoleFromUserRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -type UserRoleAssignment struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // id is generated upon saving the assignment - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - AccountUuid string `protobuf:"bytes,2,opt,name=account_uuid,json=accountUuid,proto3" json:"account_uuid,omitempty"` - // the role_id is a bundle_id internally - RoleId string `protobuf:"bytes,3,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` -} - -func (x *UserRoleAssignment) Reset() { - *x = UserRoleAssignment{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserRoleAssignment) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserRoleAssignment) ProtoMessage() {} - -func (x *UserRoleAssignment) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[23] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserRoleAssignment.ProtoReflect.Descriptor instead. -func (*UserRoleAssignment) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{23} -} - -func (x *UserRoleAssignment) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *UserRoleAssignment) GetAccountUuid() string { - if x != nil { - return x.AccountUuid - } - return "" -} - -func (x *UserRoleAssignment) GetRoleId() string { - if x != nil { - return x.RoleId - } - return "" -} - -type ListPermissionsByResourceRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Resource *Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` -} - -func (x *ListPermissionsByResourceRequest) Reset() { - *x = ListPermissionsByResourceRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListPermissionsByResourceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListPermissionsByResourceRequest) ProtoMessage() {} - -func (x *ListPermissionsByResourceRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[24] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListPermissionsByResourceRequest.ProtoReflect.Descriptor instead. -func (*ListPermissionsByResourceRequest) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{24} -} - -func (x *ListPermissionsByResourceRequest) GetResource() *Resource { - if x != nil { - return x.Resource - } - return nil -} - -type ListPermissionsByResourceResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Permissions []*Permission `protobuf:"bytes,1,rep,name=permissions,proto3" json:"permissions,omitempty"` -} - -func (x *ListPermissionsByResourceResponse) Reset() { - *x = ListPermissionsByResourceResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListPermissionsByResourceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListPermissionsByResourceResponse) ProtoMessage() {} - -func (x *ListPermissionsByResourceResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[25] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListPermissionsByResourceResponse.ProtoReflect.Descriptor instead. -func (*ListPermissionsByResourceResponse) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{25} -} - -func (x *ListPermissionsByResourceResponse) GetPermissions() []*Permission { - if x != nil { - return x.Permissions - } - return nil -} - -type GetPermissionByIDRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - PermissionId string `protobuf:"bytes,1,opt,name=permission_id,json=permissionId,proto3" json:"permission_id,omitempty"` -} - -func (x *GetPermissionByIDRequest) Reset() { - *x = GetPermissionByIDRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetPermissionByIDRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetPermissionByIDRequest) ProtoMessage() {} - -func (x *GetPermissionByIDRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[26] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetPermissionByIDRequest.ProtoReflect.Descriptor instead. -func (*GetPermissionByIDRequest) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{26} -} - -func (x *GetPermissionByIDRequest) GetPermissionId() string { - if x != nil { - return x.PermissionId - } - return "" -} - -type GetPermissionByIDResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Permission *Permission `protobuf:"bytes,1,opt,name=permission,proto3" json:"permission,omitempty"` -} - -func (x *GetPermissionByIDResponse) Reset() { - *x = GetPermissionByIDResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetPermissionByIDResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetPermissionByIDResponse) ProtoMessage() {} - -func (x *GetPermissionByIDResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[27] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetPermissionByIDResponse.ProtoReflect.Descriptor instead. -func (*GetPermissionByIDResponse) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{27} -} - -func (x *GetPermissionByIDResponse) GetPermission() *Permission { - if x != nil { - return x.Permission - } - return nil -} - -type Resource struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Type Resource_Type `protobuf:"varint,1,opt,name=type,proto3,enum=com.owncloud.ocis.settings.v0.Resource_Type" json:"type,omitempty"` - Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *Resource) Reset() { - *x = Resource{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Resource) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Resource) ProtoMessage() {} - -func (x *Resource) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[28] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Resource.ProtoReflect.Descriptor instead. -func (*Resource) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{28} -} - -func (x *Resource) GetType() Resource_Type { - if x != nil { - return x.Type - } - return Resource_TYPE_UNKNOWN -} - -func (x *Resource) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -type Bundle struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Type Bundle_Type `protobuf:"varint,3,opt,name=type,proto3,enum=com.owncloud.ocis.settings.v0.Bundle_Type" json:"type,omitempty"` - Extension string `protobuf:"bytes,4,opt,name=extension,proto3" json:"extension,omitempty"` - DisplayName string `protobuf:"bytes,5,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` - Settings []*Setting `protobuf:"bytes,6,rep,name=settings,proto3" json:"settings,omitempty"` - Resource *Resource `protobuf:"bytes,7,opt,name=resource,proto3" json:"resource,omitempty"` -} - -func (x *Bundle) Reset() { - *x = Bundle{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[29] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Bundle) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Bundle) ProtoMessage() {} - -func (x *Bundle) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[29] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Bundle.ProtoReflect.Descriptor instead. -func (*Bundle) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{29} -} - -func (x *Bundle) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *Bundle) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Bundle) GetType() Bundle_Type { - if x != nil { - return x.Type - } - return Bundle_TYPE_UNKNOWN -} - -func (x *Bundle) GetExtension() string { - if x != nil { - return x.Extension - } - return "" -} - -func (x *Bundle) GetDisplayName() string { - if x != nil { - return x.DisplayName - } - return "" -} - -func (x *Bundle) GetSettings() []*Setting { - if x != nil { - return x.Settings - } - return nil -} - -func (x *Bundle) GetResource() *Resource { - if x != nil { - return x.Resource - } - return nil -} - -type Setting struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - DisplayName string `protobuf:"bytes,3,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` - Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` - // Types that are assignable to Value: - // *Setting_IntValue - // *Setting_StringValue - // *Setting_BoolValue - // *Setting_SingleChoiceValue - // *Setting_MultiChoiceValue - // *Setting_PermissionValue - Value isSetting_Value `protobuf_oneof:"value"` - Resource *Resource `protobuf:"bytes,11,opt,name=resource,proto3" json:"resource,omitempty"` -} - -func (x *Setting) Reset() { - *x = Setting{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[30] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Setting) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Setting) ProtoMessage() {} - -func (x *Setting) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[30] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Setting.ProtoReflect.Descriptor instead. -func (*Setting) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{30} -} - -func (x *Setting) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *Setting) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Setting) GetDisplayName() string { - if x != nil { - return x.DisplayName - } - return "" -} - -func (x *Setting) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (m *Setting) GetValue() isSetting_Value { - if m != nil { - return m.Value - } - return nil -} - -func (x *Setting) GetIntValue() *Int { - if x, ok := x.GetValue().(*Setting_IntValue); ok { - return x.IntValue - } - return nil -} - -func (x *Setting) GetStringValue() *String { - if x, ok := x.GetValue().(*Setting_StringValue); ok { - return x.StringValue - } - return nil -} - -func (x *Setting) GetBoolValue() *Bool { - if x, ok := x.GetValue().(*Setting_BoolValue); ok { - return x.BoolValue - } - return nil -} - -func (x *Setting) GetSingleChoiceValue() *SingleChoiceList { - if x, ok := x.GetValue().(*Setting_SingleChoiceValue); ok { - return x.SingleChoiceValue - } - return nil -} - -func (x *Setting) GetMultiChoiceValue() *MultiChoiceList { - if x, ok := x.GetValue().(*Setting_MultiChoiceValue); ok { - return x.MultiChoiceValue - } - return nil -} - -func (x *Setting) GetPermissionValue() *Permission { - if x, ok := x.GetValue().(*Setting_PermissionValue); ok { - return x.PermissionValue - } - return nil -} - -func (x *Setting) GetResource() *Resource { - if x != nil { - return x.Resource - } - return nil -} - -type isSetting_Value interface { - isSetting_Value() -} - -type Setting_IntValue struct { - IntValue *Int `protobuf:"bytes,5,opt,name=int_value,json=intValue,proto3,oneof"` -} - -type Setting_StringValue struct { - StringValue *String `protobuf:"bytes,6,opt,name=string_value,json=stringValue,proto3,oneof"` -} - -type Setting_BoolValue struct { - BoolValue *Bool `protobuf:"bytes,7,opt,name=bool_value,json=boolValue,proto3,oneof"` -} - -type Setting_SingleChoiceValue struct { - SingleChoiceValue *SingleChoiceList `protobuf:"bytes,8,opt,name=single_choice_value,json=singleChoiceValue,proto3,oneof"` -} - -type Setting_MultiChoiceValue struct { - MultiChoiceValue *MultiChoiceList `protobuf:"bytes,9,opt,name=multi_choice_value,json=multiChoiceValue,proto3,oneof"` -} - -type Setting_PermissionValue struct { - PermissionValue *Permission `protobuf:"bytes,10,opt,name=permission_value,json=permissionValue,proto3,oneof"` -} - -func (*Setting_IntValue) isSetting_Value() {} - -func (*Setting_StringValue) isSetting_Value() {} - -func (*Setting_BoolValue) isSetting_Value() {} - -func (*Setting_SingleChoiceValue) isSetting_Value() {} - -func (*Setting_MultiChoiceValue) isSetting_Value() {} - -func (*Setting_PermissionValue) isSetting_Value() {} - -type Int struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Default int64 `protobuf:"varint,1,opt,name=default,proto3" json:"default,omitempty"` - Min int64 `protobuf:"varint,2,opt,name=min,proto3" json:"min,omitempty"` - Max int64 `protobuf:"varint,3,opt,name=max,proto3" json:"max,omitempty"` - Step int64 `protobuf:"varint,4,opt,name=step,proto3" json:"step,omitempty"` - Placeholder string `protobuf:"bytes,5,opt,name=placeholder,proto3" json:"placeholder,omitempty"` -} - -func (x *Int) Reset() { - *x = Int{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[31] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Int) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Int) ProtoMessage() {} - -func (x *Int) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[31] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Int.ProtoReflect.Descriptor instead. -func (*Int) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{31} -} - -func (x *Int) GetDefault() int64 { - if x != nil { - return x.Default - } - return 0 -} - -func (x *Int) GetMin() int64 { - if x != nil { - return x.Min - } - return 0 -} - -func (x *Int) GetMax() int64 { - if x != nil { - return x.Max - } - return 0 -} - -func (x *Int) GetStep() int64 { - if x != nil { - return x.Step - } - return 0 -} - -func (x *Int) GetPlaceholder() string { - if x != nil { - return x.Placeholder - } - return "" -} - -type String struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Default string `protobuf:"bytes,1,opt,name=default,proto3" json:"default,omitempty"` - Required bool `protobuf:"varint,2,opt,name=required,proto3" json:"required,omitempty"` - MinLength int32 `protobuf:"varint,3,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"` - MaxLength int32 `protobuf:"varint,4,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` - Placeholder string `protobuf:"bytes,5,opt,name=placeholder,proto3" json:"placeholder,omitempty"` -} - -func (x *String) Reset() { - *x = String{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[32] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *String) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*String) ProtoMessage() {} - -func (x *String) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[32] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use String.ProtoReflect.Descriptor instead. -func (*String) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{32} -} - -func (x *String) GetDefault() string { - if x != nil { - return x.Default - } - return "" -} - -func (x *String) GetRequired() bool { - if x != nil { - return x.Required - } - return false -} - -func (x *String) GetMinLength() int32 { - if x != nil { - return x.MinLength - } - return 0 -} - -func (x *String) GetMaxLength() int32 { - if x != nil { - return x.MaxLength - } - return 0 -} - -func (x *String) GetPlaceholder() string { - if x != nil { - return x.Placeholder - } - return "" -} - -type Bool struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Default bool `protobuf:"varint,1,opt,name=default,proto3" json:"default,omitempty"` - Label string `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"` -} - -func (x *Bool) Reset() { - *x = Bool{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[33] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Bool) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Bool) ProtoMessage() {} - -func (x *Bool) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[33] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Bool.ProtoReflect.Descriptor instead. -func (*Bool) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{33} -} - -func (x *Bool) GetDefault() bool { - if x != nil { - return x.Default - } - return false -} - -func (x *Bool) GetLabel() string { - if x != nil { - return x.Label - } - return "" -} - -type SingleChoiceList struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Options []*ListOption `protobuf:"bytes,1,rep,name=options,proto3" json:"options,omitempty"` -} - -func (x *SingleChoiceList) Reset() { - *x = SingleChoiceList{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[34] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SingleChoiceList) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SingleChoiceList) ProtoMessage() {} - -func (x *SingleChoiceList) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[34] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SingleChoiceList.ProtoReflect.Descriptor instead. -func (*SingleChoiceList) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{34} -} - -func (x *SingleChoiceList) GetOptions() []*ListOption { - if x != nil { - return x.Options - } - return nil -} - -type MultiChoiceList struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Options []*ListOption `protobuf:"bytes,1,rep,name=options,proto3" json:"options,omitempty"` -} - -func (x *MultiChoiceList) Reset() { - *x = MultiChoiceList{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[35] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MultiChoiceList) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MultiChoiceList) ProtoMessage() {} - -func (x *MultiChoiceList) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[35] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MultiChoiceList.ProtoReflect.Descriptor instead. -func (*MultiChoiceList) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{35} -} - -func (x *MultiChoiceList) GetOptions() []*ListOption { - if x != nil { - return x.Options - } - return nil -} - -type ListOption struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Value *ListOptionValue `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` - Default bool `protobuf:"varint,2,opt,name=default,proto3" json:"default,omitempty"` - DisplayValue string `protobuf:"bytes,3,opt,name=display_value,json=displayValue,proto3" json:"display_value,omitempty"` -} - -func (x *ListOption) Reset() { - *x = ListOption{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[36] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListOption) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListOption) ProtoMessage() {} - -func (x *ListOption) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[36] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListOption.ProtoReflect.Descriptor instead. -func (*ListOption) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{36} -} - -func (x *ListOption) GetValue() *ListOptionValue { - if x != nil { - return x.Value - } - return nil -} - -func (x *ListOption) GetDefault() bool { - if x != nil { - return x.Default - } - return false -} - -func (x *ListOption) GetDisplayValue() string { - if x != nil { - return x.DisplayValue - } - return "" -} - -type Permission struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Operation Permission_Operation `protobuf:"varint,1,opt,name=operation,proto3,enum=com.owncloud.ocis.settings.v0.Permission_Operation" json:"operation,omitempty"` - Constraint Permission_Constraint `protobuf:"varint,2,opt,name=constraint,proto3,enum=com.owncloud.ocis.settings.v0.Permission_Constraint" json:"constraint,omitempty"` -} - -func (x *Permission) Reset() { - *x = Permission{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[37] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Permission) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Permission) ProtoMessage() {} - -func (x *Permission) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[37] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Permission.ProtoReflect.Descriptor instead. -func (*Permission) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{37} -} - -func (x *Permission) GetOperation() Permission_Operation { - if x != nil { - return x.Operation - } - return Permission_OPERATION_UNKNOWN -} - -func (x *Permission) GetConstraint() Permission_Constraint { - if x != nil { - return x.Constraint - } - return Permission_CONSTRAINT_UNKNOWN -} - -type Value struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // id is the id of the Value. It is generated on saving it. - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - BundleId string `protobuf:"bytes,2,opt,name=bundle_id,json=bundleId,proto3" json:"bundle_id,omitempty"` - // setting_id is the id of the setting from within its bundle. - SettingId string `protobuf:"bytes,3,opt,name=setting_id,json=settingId,proto3" json:"setting_id,omitempty"` - AccountUuid string `protobuf:"bytes,4,opt,name=account_uuid,json=accountUuid,proto3" json:"account_uuid,omitempty"` - Resource *Resource `protobuf:"bytes,5,opt,name=resource,proto3" json:"resource,omitempty"` - // Types that are assignable to Value: - // *Value_BoolValue - // *Value_IntValue - // *Value_StringValue - // *Value_ListValue - Value isValue_Value `protobuf_oneof:"value"` -} - -func (x *Value) Reset() { - *x = Value{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[38] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Value) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Value) ProtoMessage() {} - -func (x *Value) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[38] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Value.ProtoReflect.Descriptor instead. -func (*Value) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{38} -} - -func (x *Value) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *Value) GetBundleId() string { - if x != nil { - return x.BundleId - } - return "" -} - -func (x *Value) GetSettingId() string { - if x != nil { - return x.SettingId - } - return "" -} - -func (x *Value) GetAccountUuid() string { - if x != nil { - return x.AccountUuid - } - return "" -} - -func (x *Value) GetResource() *Resource { - if x != nil { - return x.Resource - } - return nil -} - -func (m *Value) GetValue() isValue_Value { - if m != nil { - return m.Value - } - return nil -} - -func (x *Value) GetBoolValue() bool { - if x, ok := x.GetValue().(*Value_BoolValue); ok { - return x.BoolValue - } - return false -} - -func (x *Value) GetIntValue() int64 { - if x, ok := x.GetValue().(*Value_IntValue); ok { - return x.IntValue - } - return 0 -} - -func (x *Value) GetStringValue() string { - if x, ok := x.GetValue().(*Value_StringValue); ok { - return x.StringValue - } - return "" -} - -func (x *Value) GetListValue() *ListValue { - if x, ok := x.GetValue().(*Value_ListValue); ok { - return x.ListValue - } - return nil -} - -type isValue_Value interface { - isValue_Value() -} - -type Value_BoolValue struct { - BoolValue bool `protobuf:"varint,6,opt,name=bool_value,json=boolValue,proto3,oneof"` -} - -type Value_IntValue struct { - IntValue int64 `protobuf:"varint,7,opt,name=int_value,json=intValue,proto3,oneof"` -} - -type Value_StringValue struct { - StringValue string `protobuf:"bytes,8,opt,name=string_value,json=stringValue,proto3,oneof"` -} - -type Value_ListValue struct { - ListValue *ListValue `protobuf:"bytes,9,opt,name=list_value,json=listValue,proto3,oneof"` -} - -func (*Value_BoolValue) isValue_Value() {} - -func (*Value_IntValue) isValue_Value() {} - -func (*Value_StringValue) isValue_Value() {} - -func (*Value_ListValue) isValue_Value() {} - -type ListValue struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Values []*ListOptionValue `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` -} - -func (x *ListValue) Reset() { - *x = ListValue{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[39] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListValue) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListValue) ProtoMessage() {} - -func (x *ListValue) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[39] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListValue.ProtoReflect.Descriptor instead. -func (*ListValue) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{39} -} - -func (x *ListValue) GetValues() []*ListOptionValue { - if x != nil { - return x.Values - } - return nil -} - -type ListOptionValue struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Option: - // *ListOptionValue_StringValue - // *ListOptionValue_IntValue - Option isListOptionValue_Option `protobuf_oneof:"option"` -} - -func (x *ListOptionValue) Reset() { - *x = ListOptionValue{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v0_settings_proto_msgTypes[40] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListOptionValue) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListOptionValue) ProtoMessage() {} - -func (x *ListOptionValue) ProtoReflect() protoreflect.Message { - mi := &file_proto_v0_settings_proto_msgTypes[40] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListOptionValue.ProtoReflect.Descriptor instead. -func (*ListOptionValue) Descriptor() ([]byte, []int) { - return file_proto_v0_settings_proto_rawDescGZIP(), []int{40} -} - -func (m *ListOptionValue) GetOption() isListOptionValue_Option { - if m != nil { - return m.Option - } - return nil -} - -func (x *ListOptionValue) GetStringValue() string { - if x, ok := x.GetOption().(*ListOptionValue_StringValue); ok { - return x.StringValue - } - return "" -} - -func (x *ListOptionValue) GetIntValue() int64 { - if x, ok := x.GetOption().(*ListOptionValue_IntValue); ok { - return x.IntValue - } - return 0 -} - -type isListOptionValue_Option interface { - isListOptionValue_Option() -} - -type ListOptionValue_StringValue struct { - StringValue string `protobuf:"bytes,1,opt,name=string_value,json=stringValue,proto3,oneof"` -} - -type ListOptionValue_IntValue struct { - IntValue int64 `protobuf:"varint,2,opt,name=int_value,json=intValue,proto3,oneof"` -} - -func (*ListOptionValue_StringValue) isListOptionValue_Option() {} - -func (*ListOptionValue_IntValue) isListOptionValue_Option() {} - -var File_proto_v0_settings_proto protoreflect.FileDescriptor - -var file_proto_v0_settings_proto_rawDesc = []byte{ - 0x0a, 0x17, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x30, 0x2f, 0x73, 0x65, 0x74, 0x74, 0x69, - 0x6e, 0x67, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, - 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, - 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0x52, 0x0a, 0x11, 0x53, 0x61, 0x76, 0x65, 0x42, 0x75, 0x6e, 0x64, 0x6c, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x06, 0x62, 0x75, 0x6e, 0x64, - 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, - 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, - 0x06, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x53, 0x0a, 0x12, 0x53, 0x61, 0x76, 0x65, 0x42, - 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, - 0x06, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, - 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, - 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x42, 0x75, - 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x06, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x2f, 0x0a, 0x10, - 0x47, 0x65, 0x74, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x49, 0x64, 0x22, 0x52, 0x0a, - 0x11, 0x47, 0x65, 0x74, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x06, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, - 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, - 0x76, 0x30, 0x2e, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x06, 0x62, 0x75, 0x6e, 0x64, 0x6c, - 0x65, 0x22, 0x33, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x75, 0x6e, 0x64, 0x6c, - 0x65, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x62, 0x75, 0x6e, - 0x64, 0x6c, 0x65, 0x49, 0x64, 0x73, 0x22, 0x56, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x75, - 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, - 0x07, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, - 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, - 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x42, - 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x07, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x22, 0x7a, - 0x0a, 0x19, 0x41, 0x64, 0x64, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x42, 0x75, - 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x62, - 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x40, 0x0a, 0x07, 0x73, 0x65, 0x74, 0x74, - 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, - 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, - 0x67, 0x52, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x22, 0x5e, 0x0a, 0x1a, 0x41, 0x64, - 0x64, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x07, 0x73, 0x65, 0x74, 0x74, - 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, - 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, - 0x67, 0x52, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x22, 0x5c, 0x0a, 0x1e, 0x52, 0x65, - 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x46, 0x72, 0x6f, 0x6d, 0x42, - 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, - 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x22, 0x4e, 0x0a, 0x10, 0x53, 0x61, 0x76, 0x65, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3a, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, - 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, - 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x5d, 0x0a, 0x11, 0x53, 0x61, 0x76, 0x65, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x63, - 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, - 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x57, 0x69, 0x74, 0x68, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x21, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x5c, 0x0a, 0x10, 0x47, 0x65, - 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, - 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, - 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x57, 0x69, 0x74, 0x68, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, - 0x72, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x53, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, - 0x09, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x75, 0x69, 0x64, 0x22, 0x60, 0x0a, - 0x12, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, - 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, - 0x2e, 0x76, 0x30, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x57, 0x69, 0x74, 0x68, 0x49, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, - 0x66, 0x0a, 0x22, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x79, 0x55, 0x6e, 0x69, - 0x71, 0x75, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x75, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x74, 0x74, - 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x22, 0x9c, 0x01, 0x0a, 0x13, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x57, 0x69, 0x74, 0x68, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, - 0x49, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, - 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, - 0x2e, 0x76, 0x30, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x0a, - 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x3a, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, - 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x5c, 0x0a, 0x0a, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x66, 0x69, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, - 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x22, 0x3f, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x6f, 0x6c, 0x65, - 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x75, 0x75, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x55, 0x75, 0x69, 0x64, 0x22, 0x72, 0x0a, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x6f, 0x6c, - 0x65, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x0b, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, - 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x6f, - 0x6c, 0x65, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0b, 0x61, 0x73, - 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x55, 0x0a, 0x17, 0x41, 0x73, 0x73, - 0x69, 0x67, 0x6e, 0x52, 0x6f, 0x6c, 0x65, 0x54, 0x6f, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, - 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x55, 0x75, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x65, 0x5f, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6c, 0x65, 0x49, 0x64, - 0x22, 0x6d, 0x0a, 0x18, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x52, 0x6f, 0x6c, 0x65, 0x54, 0x6f, - 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x0a, - 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x31, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, - 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, - 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, - 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x22, - 0x2b, 0x0a, 0x19, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x46, 0x72, 0x6f, - 0x6d, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x60, 0x0a, 0x12, - 0x55, 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, - 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, - 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x75, 0x75, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x55, 0x75, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x22, 0x67, - 0x0a, 0x20, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x42, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x43, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, - 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, - 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x70, 0x0a, 0x21, 0x4c, 0x69, 0x73, 0x74, 0x50, - 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x79, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x0b, - 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, - 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, - 0x30, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x70, 0x65, - 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x3f, 0x0a, 0x18, 0x47, 0x65, 0x74, - 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x65, - 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x66, 0x0a, 0x19, 0x47, 0x65, - 0x74, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x79, 0x49, 0x44, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x0a, 0x70, 0x65, 0x72, 0x6d, 0x69, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, - 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, - 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x50, 0x65, 0x72, 0x6d, - 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x22, 0xe9, 0x01, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, - 0x40, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2c, 0x2e, - 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, - 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, - 0x64, 0x22, 0x8a, 0x01, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x59, - 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, - 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x59, 0x53, 0x54, 0x45, 0x4d, 0x10, 0x01, 0x12, 0x0d, 0x0a, - 0x09, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x4c, 0x45, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, - 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x48, 0x41, 0x52, 0x45, 0x10, 0x03, 0x12, 0x10, 0x0a, 0x0c, - 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, 0x4e, 0x47, 0x10, 0x04, 0x12, 0x0f, - 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x55, 0x4e, 0x44, 0x4c, 0x45, 0x10, 0x05, 0x12, - 0x0d, 0x0a, 0x09, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x10, 0x06, 0x12, 0x0e, - 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x10, 0x07, 0x22, 0xf1, - 0x02, 0x0a, 0x06, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3e, 0x0a, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, 0x63, 0x6f, - 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, - 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x42, 0x75, 0x6e, 0x64, - 0x6c, 0x65, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, - 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x64, - 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x42, - 0x0a, 0x08, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, - 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, - 0x2e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x08, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, - 0x67, 0x73, 0x12, 0x43, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, - 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, - 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x39, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x10, 0x0a, 0x0c, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, - 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, - 0x54, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x52, 0x4f, 0x4c, 0x45, - 0x10, 0x02, 0x22, 0xb0, 0x05, 0x0a, 0x07, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, - 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x41, 0x0a, 0x09, 0x69, 0x6e, 0x74, 0x5f, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x6d, - 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x49, 0x6e, 0x74, 0x48, 0x00, - 0x52, 0x08, 0x69, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x4a, 0x0a, 0x0c, 0x73, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x25, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, - 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, - 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x44, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x6d, - 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x48, - 0x00, 0x52, 0x09, 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x61, 0x0a, 0x13, - 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x5f, 0x63, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x5f, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, - 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, - 0x43, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x00, 0x52, 0x11, 0x73, 0x69, - 0x6e, 0x67, 0x6c, 0x65, 0x43, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, - 0x5e, 0x0a, 0x12, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x5f, 0x63, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x5f, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x63, 0x6f, - 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, - 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x4d, 0x75, 0x6c, 0x74, - 0x69, 0x43, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x00, 0x52, 0x10, 0x6d, - 0x75, 0x6c, 0x74, 0x69, 0x43, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, - 0x56, 0x0a, 0x10, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, - 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0f, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x43, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, - 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x07, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x79, 0x0a, 0x03, 0x49, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, - 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x64, - 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x69, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x03, 0x6d, 0x69, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x61, 0x78, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6d, 0x61, 0x78, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x74, - 0x65, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x74, 0x65, 0x70, 0x12, 0x20, - 0x0a, 0x0b, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x68, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x68, 0x6f, 0x6c, 0x64, 0x65, 0x72, - 0x22, 0x9e, 0x01, 0x0a, 0x06, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x64, - 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, - 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, - 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x69, 0x6e, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6d, 0x69, 0x6e, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, - 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x78, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, - 0x20, 0x0a, 0x0b, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x68, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x68, 0x6f, 0x6c, 0x64, 0x65, - 0x72, 0x22, 0x36, 0x0a, 0x04, 0x42, 0x6f, 0x6f, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x66, - 0x61, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, - 0x75, 0x6c, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x22, 0x57, 0x0a, 0x10, 0x53, 0x69, 0x6e, - 0x67, 0x6c, 0x65, 0x43, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x43, 0x0a, - 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, - 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, - 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x22, 0x56, 0x0a, 0x0f, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x43, 0x68, 0x6f, 0x69, 0x63, - 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x43, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, - 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, - 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x91, 0x01, 0x0a, 0x0a, 0x4c, - 0x69, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x44, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, - 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, - 0x18, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x69, 0x73, - 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xc3, - 0x03, 0x0a, 0x0a, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x51, 0x0a, - 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x33, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, - 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, - 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x4f, 0x70, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x54, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x34, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, - 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, - 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, - 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x73, - 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x22, 0xa6, 0x01, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x15, 0x0a, 0x11, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, - 0x4e, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x4f, - 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x10, - 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, - 0x45, 0x41, 0x44, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, - 0x4f, 0x4e, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x10, 0x03, 0x12, 0x14, 0x0a, 0x10, 0x4f, - 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x10, - 0x04, 0x12, 0x13, 0x0a, 0x0f, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x57, - 0x52, 0x49, 0x54, 0x45, 0x10, 0x05, 0x12, 0x17, 0x0a, 0x13, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, - 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x41, 0x44, 0x57, 0x52, 0x49, 0x54, 0x45, 0x10, 0x06, 0x22, - 0x63, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x12, 0x16, 0x0a, - 0x12, 0x43, 0x4f, 0x4e, 0x53, 0x54, 0x52, 0x41, 0x49, 0x4e, 0x54, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, - 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x43, 0x4f, 0x4e, 0x53, 0x54, 0x52, 0x41, - 0x49, 0x4e, 0x54, 0x5f, 0x4f, 0x57, 0x4e, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4e, - 0x53, 0x54, 0x52, 0x41, 0x49, 0x4e, 0x54, 0x5f, 0x53, 0x48, 0x41, 0x52, 0x45, 0x44, 0x10, 0x02, - 0x12, 0x12, 0x0a, 0x0e, 0x43, 0x4f, 0x4e, 0x53, 0x54, 0x52, 0x41, 0x49, 0x4e, 0x54, 0x5f, 0x41, - 0x4c, 0x4c, 0x10, 0x03, 0x22, 0xf4, 0x02, 0x0a, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, - 0x0a, 0x09, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x73, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x75, 0x69, 0x64, 0x12, 0x43, 0x0a, - 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x27, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, - 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x09, 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x12, 0x1d, 0x0a, 0x09, 0x69, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x49, 0x0a, 0x0a, 0x6c, 0x69, 0x73, 0x74, 0x5f, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x6f, - 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, - 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x09, 0x6c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x53, 0x0a, 0x09, 0x4c, - 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x46, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, - 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, - 0x22, 0x5f, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1d, 0x0a, 0x09, 0x69, 0x6e, 0x74, 0x5f, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x08, 0x69, - 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x08, 0x0a, 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x32, 0xca, 0x06, 0x0a, 0x0d, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x12, 0x9a, 0x01, 0x0a, 0x0a, 0x53, 0x61, 0x76, 0x65, 0x42, 0x75, 0x6e, 0x64, - 0x6c, 0x65, 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, - 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, - 0x76, 0x30, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, - 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, - 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x22, - 0x1c, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x30, 0x2f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, - 0x73, 0x2f, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x2d, 0x73, 0x61, 0x76, 0x65, 0x3a, 0x01, 0x2a, - 0x12, 0x96, 0x01, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x2f, - 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, - 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x47, - 0x65, 0x74, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x30, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, - 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, - 0x47, 0x65, 0x74, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x22, 0x1b, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x76, 0x30, 0x2f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x62, 0x75, 0x6e, 0x64, - 0x6c, 0x65, 0x2d, 0x67, 0x65, 0x74, 0x3a, 0x01, 0x2a, 0x12, 0x9e, 0x01, 0x0a, 0x0b, 0x4c, 0x69, - 0x73, 0x74, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x12, 0x31, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, - 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x75, - 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x63, - 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, - 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x22, 0x1d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, - 0x30, 0x2f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x62, 0x75, 0x6e, 0x64, 0x6c, - 0x65, 0x73, 0x2d, 0x6c, 0x69, 0x73, 0x74, 0x3a, 0x01, 0x2a, 0x12, 0xba, 0x01, 0x0a, 0x12, 0x41, - 0x64, 0x64, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x42, 0x75, 0x6e, 0x64, 0x6c, - 0x65, 0x12, 0x38, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, - 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, - 0x30, 0x2e, 0x41, 0x64, 0x64, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x42, 0x75, - 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x63, 0x6f, - 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, - 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x41, 0x64, 0x64, 0x53, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x22, 0x24, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x30, 0x2f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, - 0x2f, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x2d, 0x61, 0x64, 0x64, 0x2d, 0x73, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x3a, 0x01, 0x2a, 0x12, 0xa4, 0x01, 0x0a, 0x17, 0x52, 0x65, 0x6d, 0x6f, - 0x76, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x46, 0x72, 0x6f, 0x6d, 0x42, 0x75, 0x6e, - 0x64, 0x6c, 0x65, 0x12, 0x3d, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, - 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, - 0x2e, 0x76, 0x30, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, - 0x67, 0x46, 0x72, 0x6f, 0x6d, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x32, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x2c, 0x22, 0x27, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x30, 0x2f, 0x73, 0x65, 0x74, 0x74, - 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x2d, 0x72, 0x65, 0x6d, - 0x6f, 0x76, 0x65, 0x2d, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x3a, 0x01, 0x2a, 0x32, 0xad, - 0x05, 0x0a, 0x0c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, - 0x97, 0x01, 0x0a, 0x09, 0x53, 0x61, 0x76, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x2f, 0x2e, - 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, - 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x53, 0x61, - 0x76, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, - 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, - 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x53, - 0x61, 0x76, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x22, 0x1c, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, - 0x30, 0x2f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x73, 0x2d, 0x73, 0x61, 0x76, 0x65, 0x3a, 0x01, 0x2a, 0x12, 0x93, 0x01, 0x0a, 0x08, 0x47, 0x65, - 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, - 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, - 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, - 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, - 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x22, - 0x1b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x30, 0x2f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, - 0x73, 0x2f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x2d, 0x67, 0x65, 0x74, 0x3a, 0x01, 0x2a, 0x12, - 0x9a, 0x01, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x30, - 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, - 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x31, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, - 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x22, 0x1c, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x76, 0x30, 0x2f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x73, 0x2d, 0x6c, 0x69, 0x73, 0x74, 0x3a, 0x01, 0x2a, 0x12, 0xcf, 0x01, 0x0a, - 0x1b, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x79, 0x55, 0x6e, 0x69, 0x71, 0x75, - 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x73, 0x12, 0x41, 0x2e, 0x63, - 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, - 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x47, 0x65, 0x74, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x79, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x2f, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, - 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, - 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x3c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x36, 0x22, 0x31, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, - 0x30, 0x2f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x73, 0x2d, 0x67, 0x65, 0x74, 0x2d, 0x62, 0x79, 0x2d, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x2d, - 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x73, 0x3a, 0x01, 0x2a, 0x32, 0xb3, - 0x05, 0x0a, 0x0b, 0x52, 0x6f, 0x6c, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x9a, - 0x01, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x12, 0x31, 0x2e, 0x63, - 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, - 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x32, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, - 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x22, 0x1b, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x76, 0x30, 0x2f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x72, 0x6f, - 0x6c, 0x65, 0x73, 0x2d, 0x6c, 0x69, 0x73, 0x74, 0x3a, 0x01, 0x2a, 0x12, 0xba, 0x01, 0x0a, 0x13, - 0x4c, 0x69, 0x73, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x12, 0x39, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, - 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, - 0x2e, 0x76, 0x30, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x41, 0x73, 0x73, 0x69, - 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3a, - 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, - 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x26, 0x22, 0x21, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x30, 0x2f, 0x73, 0x65, 0x74, 0x74, - 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x2d, 0x6c, 0x69, 0x73, 0x74, 0x3a, 0x01, 0x2a, 0x12, 0xb0, 0x01, 0x0a, 0x10, 0x41, 0x73, 0x73, - 0x69, 0x67, 0x6e, 0x52, 0x6f, 0x6c, 0x65, 0x54, 0x6f, 0x55, 0x73, 0x65, 0x72, 0x12, 0x36, 0x2e, - 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, - 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x41, 0x73, - 0x73, 0x69, 0x67, 0x6e, 0x52, 0x6f, 0x6c, 0x65, 0x54, 0x6f, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, - 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, - 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x52, 0x6f, 0x6c, 0x65, - 0x54, 0x6f, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2b, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x22, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x30, 0x2f, - 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, - 0x65, 0x6e, 0x74, 0x73, 0x2d, 0x61, 0x64, 0x64, 0x3a, 0x01, 0x2a, 0x12, 0x96, 0x01, 0x0a, 0x12, - 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x55, 0x73, - 0x65, 0x72, 0x12, 0x38, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, - 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, - 0x76, 0x30, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x46, 0x72, 0x6f, - 0x6d, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x22, 0x23, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x76, 0x30, 0x2f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x61, - 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2d, 0x72, 0x65, 0x6d, 0x6f, 0x76, - 0x65, 0x3a, 0x01, 0x2a, 0x32, 0xaa, 0x03, 0x0a, 0x11, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xd8, 0x01, 0x0a, 0x19, 0x4c, - 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x79, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x3f, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, - 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, - 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, - 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, - 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x32, 0x22, 0x2d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x30, 0x2f, 0x73, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x2d, 0x6c, 0x69, 0x73, 0x74, 0x2d, 0x62, 0x79, 0x2d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x3a, 0x01, 0x2a, 0x12, 0xb9, 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, - 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x79, 0x49, 0x44, 0x12, 0x37, 0x2e, 0x63, 0x6f, - 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, - 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x47, 0x65, 0x74, 0x50, - 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x77, 0x6e, 0x63, 0x6c, - 0x6f, 0x75, 0x64, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, - 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x22, 0x26, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x30, 0x2f, - 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x73, 0x2d, 0x67, 0x65, 0x74, 0x2d, 0x62, 0x79, 0x2d, 0x69, 0x64, 0x3a, 0x01, - 0x2a, 0x42, 0xda, 0x02, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x6f, 0x63, 0x69, 0x73, 0x2f, 0x73, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2f, 0x76, 0x30, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x92, 0x41, 0xa0, 0x02, 0x12, 0xb6, - 0x01, 0x0a, 0x20, 0x6f, 0x77, 0x6e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x20, 0x49, 0x6e, 0x66, 0x69, - 0x6e, 0x69, 0x74, 0x65, 0x20, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x20, 0x73, 0x65, 0x74, 0x74, 0x69, - 0x6e, 0x67, 0x73, 0x22, 0x47, 0x0a, 0x0d, 0x6f, 0x77, 0x6e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x20, - 0x47, 0x6d, 0x62, 0x48, 0x12, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, - 0x64, 0x2f, 0x6f, 0x63, 0x69, 0x73, 0x1a, 0x14, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x40, - 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6d, 0x2a, 0x42, 0x0a, 0x0a, - 0x41, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2d, 0x32, 0x2e, 0x30, 0x12, 0x34, 0x68, 0x74, 0x74, 0x70, - 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, - 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x6f, 0x63, 0x69, 0x73, 0x2f, 0x62, 0x6c, 0x6f, - 0x62, 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x2f, 0x4c, 0x49, 0x43, 0x45, 0x4e, 0x53, 0x45, - 0x32, 0x05, 0x31, 0x2e, 0x30, 0x2e, 0x30, 0x2a, 0x02, 0x01, 0x02, 0x32, 0x10, 0x61, 0x70, 0x70, - 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x10, 0x61, - 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x72, - 0x3d, 0x0a, 0x10, 0x44, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x72, 0x20, 0x4d, 0x61, 0x6e, - 0x75, 0x61, 0x6c, 0x12, 0x29, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x6f, 0x77, 0x6e, - 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x65, 0x76, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, - 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_proto_v0_settings_proto_rawDescOnce sync.Once - file_proto_v0_settings_proto_rawDescData = file_proto_v0_settings_proto_rawDesc -) - -func file_proto_v0_settings_proto_rawDescGZIP() []byte { - file_proto_v0_settings_proto_rawDescOnce.Do(func() { - file_proto_v0_settings_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_v0_settings_proto_rawDescData) - }) - return file_proto_v0_settings_proto_rawDescData -} - -var file_proto_v0_settings_proto_enumTypes = make([]protoimpl.EnumInfo, 4) -var file_proto_v0_settings_proto_msgTypes = make([]protoimpl.MessageInfo, 41) -var file_proto_v0_settings_proto_goTypes = []interface{}{ - (Resource_Type)(0), // 0: com.owncloud.ocis.settings.v0.Resource.Type - (Bundle_Type)(0), // 1: com.owncloud.ocis.settings.v0.Bundle.Type - (Permission_Operation)(0), // 2: com.owncloud.ocis.settings.v0.Permission.Operation - (Permission_Constraint)(0), // 3: com.owncloud.ocis.settings.v0.Permission.Constraint - (*SaveBundleRequest)(nil), // 4: com.owncloud.ocis.settings.v0.SaveBundleRequest - (*SaveBundleResponse)(nil), // 5: com.owncloud.ocis.settings.v0.SaveBundleResponse - (*GetBundleRequest)(nil), // 6: com.owncloud.ocis.settings.v0.GetBundleRequest - (*GetBundleResponse)(nil), // 7: com.owncloud.ocis.settings.v0.GetBundleResponse - (*ListBundlesRequest)(nil), // 8: com.owncloud.ocis.settings.v0.ListBundlesRequest - (*ListBundlesResponse)(nil), // 9: com.owncloud.ocis.settings.v0.ListBundlesResponse - (*AddSettingToBundleRequest)(nil), // 10: com.owncloud.ocis.settings.v0.AddSettingToBundleRequest - (*AddSettingToBundleResponse)(nil), // 11: com.owncloud.ocis.settings.v0.AddSettingToBundleResponse - (*RemoveSettingFromBundleRequest)(nil), // 12: com.owncloud.ocis.settings.v0.RemoveSettingFromBundleRequest - (*SaveValueRequest)(nil), // 13: com.owncloud.ocis.settings.v0.SaveValueRequest - (*SaveValueResponse)(nil), // 14: com.owncloud.ocis.settings.v0.SaveValueResponse - (*GetValueRequest)(nil), // 15: com.owncloud.ocis.settings.v0.GetValueRequest - (*GetValueResponse)(nil), // 16: com.owncloud.ocis.settings.v0.GetValueResponse - (*ListValuesRequest)(nil), // 17: com.owncloud.ocis.settings.v0.ListValuesRequest - (*ListValuesResponse)(nil), // 18: com.owncloud.ocis.settings.v0.ListValuesResponse - (*GetValueByUniqueIdentifiersRequest)(nil), // 19: com.owncloud.ocis.settings.v0.GetValueByUniqueIdentifiersRequest - (*ValueWithIdentifier)(nil), // 20: com.owncloud.ocis.settings.v0.ValueWithIdentifier - (*Identifier)(nil), // 21: com.owncloud.ocis.settings.v0.Identifier - (*ListRoleAssignmentsRequest)(nil), // 22: com.owncloud.ocis.settings.v0.ListRoleAssignmentsRequest - (*ListRoleAssignmentsResponse)(nil), // 23: com.owncloud.ocis.settings.v0.ListRoleAssignmentsResponse - (*AssignRoleToUserRequest)(nil), // 24: com.owncloud.ocis.settings.v0.AssignRoleToUserRequest - (*AssignRoleToUserResponse)(nil), // 25: com.owncloud.ocis.settings.v0.AssignRoleToUserResponse - (*RemoveRoleFromUserRequest)(nil), // 26: com.owncloud.ocis.settings.v0.RemoveRoleFromUserRequest - (*UserRoleAssignment)(nil), // 27: com.owncloud.ocis.settings.v0.UserRoleAssignment - (*ListPermissionsByResourceRequest)(nil), // 28: com.owncloud.ocis.settings.v0.ListPermissionsByResourceRequest - (*ListPermissionsByResourceResponse)(nil), // 29: com.owncloud.ocis.settings.v0.ListPermissionsByResourceResponse - (*GetPermissionByIDRequest)(nil), // 30: com.owncloud.ocis.settings.v0.GetPermissionByIDRequest - (*GetPermissionByIDResponse)(nil), // 31: com.owncloud.ocis.settings.v0.GetPermissionByIDResponse - (*Resource)(nil), // 32: com.owncloud.ocis.settings.v0.Resource - (*Bundle)(nil), // 33: com.owncloud.ocis.settings.v0.Bundle - (*Setting)(nil), // 34: com.owncloud.ocis.settings.v0.Setting - (*Int)(nil), // 35: com.owncloud.ocis.settings.v0.Int - (*String)(nil), // 36: com.owncloud.ocis.settings.v0.String - (*Bool)(nil), // 37: com.owncloud.ocis.settings.v0.Bool - (*SingleChoiceList)(nil), // 38: com.owncloud.ocis.settings.v0.SingleChoiceList - (*MultiChoiceList)(nil), // 39: com.owncloud.ocis.settings.v0.MultiChoiceList - (*ListOption)(nil), // 40: com.owncloud.ocis.settings.v0.ListOption - (*Permission)(nil), // 41: com.owncloud.ocis.settings.v0.Permission - (*Value)(nil), // 42: com.owncloud.ocis.settings.v0.Value - (*ListValue)(nil), // 43: com.owncloud.ocis.settings.v0.ListValue - (*ListOptionValue)(nil), // 44: com.owncloud.ocis.settings.v0.ListOptionValue - (*emptypb.Empty)(nil), // 45: google.protobuf.Empty -} -var file_proto_v0_settings_proto_depIdxs = []int32{ - 33, // 0: com.owncloud.ocis.settings.v0.SaveBundleRequest.bundle:type_name -> com.owncloud.ocis.settings.v0.Bundle - 33, // 1: com.owncloud.ocis.settings.v0.SaveBundleResponse.bundle:type_name -> com.owncloud.ocis.settings.v0.Bundle - 33, // 2: com.owncloud.ocis.settings.v0.GetBundleResponse.bundle:type_name -> com.owncloud.ocis.settings.v0.Bundle - 33, // 3: com.owncloud.ocis.settings.v0.ListBundlesResponse.bundles:type_name -> com.owncloud.ocis.settings.v0.Bundle - 34, // 4: com.owncloud.ocis.settings.v0.AddSettingToBundleRequest.setting:type_name -> com.owncloud.ocis.settings.v0.Setting - 34, // 5: com.owncloud.ocis.settings.v0.AddSettingToBundleResponse.setting:type_name -> com.owncloud.ocis.settings.v0.Setting - 42, // 6: com.owncloud.ocis.settings.v0.SaveValueRequest.value:type_name -> com.owncloud.ocis.settings.v0.Value - 20, // 7: com.owncloud.ocis.settings.v0.SaveValueResponse.value:type_name -> com.owncloud.ocis.settings.v0.ValueWithIdentifier - 20, // 8: com.owncloud.ocis.settings.v0.GetValueResponse.value:type_name -> com.owncloud.ocis.settings.v0.ValueWithIdentifier - 20, // 9: com.owncloud.ocis.settings.v0.ListValuesResponse.values:type_name -> com.owncloud.ocis.settings.v0.ValueWithIdentifier - 21, // 10: com.owncloud.ocis.settings.v0.ValueWithIdentifier.identifier:type_name -> com.owncloud.ocis.settings.v0.Identifier - 42, // 11: com.owncloud.ocis.settings.v0.ValueWithIdentifier.value:type_name -> com.owncloud.ocis.settings.v0.Value - 27, // 12: com.owncloud.ocis.settings.v0.ListRoleAssignmentsResponse.assignments:type_name -> com.owncloud.ocis.settings.v0.UserRoleAssignment - 27, // 13: com.owncloud.ocis.settings.v0.AssignRoleToUserResponse.assignment:type_name -> com.owncloud.ocis.settings.v0.UserRoleAssignment - 32, // 14: com.owncloud.ocis.settings.v0.ListPermissionsByResourceRequest.resource:type_name -> com.owncloud.ocis.settings.v0.Resource - 41, // 15: com.owncloud.ocis.settings.v0.ListPermissionsByResourceResponse.permissions:type_name -> com.owncloud.ocis.settings.v0.Permission - 41, // 16: com.owncloud.ocis.settings.v0.GetPermissionByIDResponse.permission:type_name -> com.owncloud.ocis.settings.v0.Permission - 0, // 17: com.owncloud.ocis.settings.v0.Resource.type:type_name -> com.owncloud.ocis.settings.v0.Resource.Type - 1, // 18: com.owncloud.ocis.settings.v0.Bundle.type:type_name -> com.owncloud.ocis.settings.v0.Bundle.Type - 34, // 19: com.owncloud.ocis.settings.v0.Bundle.settings:type_name -> com.owncloud.ocis.settings.v0.Setting - 32, // 20: com.owncloud.ocis.settings.v0.Bundle.resource:type_name -> com.owncloud.ocis.settings.v0.Resource - 35, // 21: com.owncloud.ocis.settings.v0.Setting.int_value:type_name -> com.owncloud.ocis.settings.v0.Int - 36, // 22: com.owncloud.ocis.settings.v0.Setting.string_value:type_name -> com.owncloud.ocis.settings.v0.String - 37, // 23: com.owncloud.ocis.settings.v0.Setting.bool_value:type_name -> com.owncloud.ocis.settings.v0.Bool - 38, // 24: com.owncloud.ocis.settings.v0.Setting.single_choice_value:type_name -> com.owncloud.ocis.settings.v0.SingleChoiceList - 39, // 25: com.owncloud.ocis.settings.v0.Setting.multi_choice_value:type_name -> com.owncloud.ocis.settings.v0.MultiChoiceList - 41, // 26: com.owncloud.ocis.settings.v0.Setting.permission_value:type_name -> com.owncloud.ocis.settings.v0.Permission - 32, // 27: com.owncloud.ocis.settings.v0.Setting.resource:type_name -> com.owncloud.ocis.settings.v0.Resource - 40, // 28: com.owncloud.ocis.settings.v0.SingleChoiceList.options:type_name -> com.owncloud.ocis.settings.v0.ListOption - 40, // 29: com.owncloud.ocis.settings.v0.MultiChoiceList.options:type_name -> com.owncloud.ocis.settings.v0.ListOption - 44, // 30: com.owncloud.ocis.settings.v0.ListOption.value:type_name -> com.owncloud.ocis.settings.v0.ListOptionValue - 2, // 31: com.owncloud.ocis.settings.v0.Permission.operation:type_name -> com.owncloud.ocis.settings.v0.Permission.Operation - 3, // 32: com.owncloud.ocis.settings.v0.Permission.constraint:type_name -> com.owncloud.ocis.settings.v0.Permission.Constraint - 32, // 33: com.owncloud.ocis.settings.v0.Value.resource:type_name -> com.owncloud.ocis.settings.v0.Resource - 43, // 34: com.owncloud.ocis.settings.v0.Value.list_value:type_name -> com.owncloud.ocis.settings.v0.ListValue - 44, // 35: com.owncloud.ocis.settings.v0.ListValue.values:type_name -> com.owncloud.ocis.settings.v0.ListOptionValue - 4, // 36: com.owncloud.ocis.settings.v0.BundleService.SaveBundle:input_type -> com.owncloud.ocis.settings.v0.SaveBundleRequest - 6, // 37: com.owncloud.ocis.settings.v0.BundleService.GetBundle:input_type -> com.owncloud.ocis.settings.v0.GetBundleRequest - 8, // 38: com.owncloud.ocis.settings.v0.BundleService.ListBundles:input_type -> com.owncloud.ocis.settings.v0.ListBundlesRequest - 10, // 39: com.owncloud.ocis.settings.v0.BundleService.AddSettingToBundle:input_type -> com.owncloud.ocis.settings.v0.AddSettingToBundleRequest - 12, // 40: com.owncloud.ocis.settings.v0.BundleService.RemoveSettingFromBundle:input_type -> com.owncloud.ocis.settings.v0.RemoveSettingFromBundleRequest - 13, // 41: com.owncloud.ocis.settings.v0.ValueService.SaveValue:input_type -> com.owncloud.ocis.settings.v0.SaveValueRequest - 15, // 42: com.owncloud.ocis.settings.v0.ValueService.GetValue:input_type -> com.owncloud.ocis.settings.v0.GetValueRequest - 17, // 43: com.owncloud.ocis.settings.v0.ValueService.ListValues:input_type -> com.owncloud.ocis.settings.v0.ListValuesRequest - 19, // 44: com.owncloud.ocis.settings.v0.ValueService.GetValueByUniqueIdentifiers:input_type -> com.owncloud.ocis.settings.v0.GetValueByUniqueIdentifiersRequest - 8, // 45: com.owncloud.ocis.settings.v0.RoleService.ListRoles:input_type -> com.owncloud.ocis.settings.v0.ListBundlesRequest - 22, // 46: com.owncloud.ocis.settings.v0.RoleService.ListRoleAssignments:input_type -> com.owncloud.ocis.settings.v0.ListRoleAssignmentsRequest - 24, // 47: com.owncloud.ocis.settings.v0.RoleService.AssignRoleToUser:input_type -> com.owncloud.ocis.settings.v0.AssignRoleToUserRequest - 26, // 48: com.owncloud.ocis.settings.v0.RoleService.RemoveRoleFromUser:input_type -> com.owncloud.ocis.settings.v0.RemoveRoleFromUserRequest - 28, // 49: com.owncloud.ocis.settings.v0.PermissionService.ListPermissionsByResource:input_type -> com.owncloud.ocis.settings.v0.ListPermissionsByResourceRequest - 30, // 50: com.owncloud.ocis.settings.v0.PermissionService.GetPermissionByID:input_type -> com.owncloud.ocis.settings.v0.GetPermissionByIDRequest - 5, // 51: com.owncloud.ocis.settings.v0.BundleService.SaveBundle:output_type -> com.owncloud.ocis.settings.v0.SaveBundleResponse - 7, // 52: com.owncloud.ocis.settings.v0.BundleService.GetBundle:output_type -> com.owncloud.ocis.settings.v0.GetBundleResponse - 9, // 53: com.owncloud.ocis.settings.v0.BundleService.ListBundles:output_type -> com.owncloud.ocis.settings.v0.ListBundlesResponse - 11, // 54: com.owncloud.ocis.settings.v0.BundleService.AddSettingToBundle:output_type -> com.owncloud.ocis.settings.v0.AddSettingToBundleResponse - 45, // 55: com.owncloud.ocis.settings.v0.BundleService.RemoveSettingFromBundle:output_type -> google.protobuf.Empty - 14, // 56: com.owncloud.ocis.settings.v0.ValueService.SaveValue:output_type -> com.owncloud.ocis.settings.v0.SaveValueResponse - 16, // 57: com.owncloud.ocis.settings.v0.ValueService.GetValue:output_type -> com.owncloud.ocis.settings.v0.GetValueResponse - 18, // 58: com.owncloud.ocis.settings.v0.ValueService.ListValues:output_type -> com.owncloud.ocis.settings.v0.ListValuesResponse - 16, // 59: com.owncloud.ocis.settings.v0.ValueService.GetValueByUniqueIdentifiers:output_type -> com.owncloud.ocis.settings.v0.GetValueResponse - 9, // 60: com.owncloud.ocis.settings.v0.RoleService.ListRoles:output_type -> com.owncloud.ocis.settings.v0.ListBundlesResponse - 23, // 61: com.owncloud.ocis.settings.v0.RoleService.ListRoleAssignments:output_type -> com.owncloud.ocis.settings.v0.ListRoleAssignmentsResponse - 25, // 62: com.owncloud.ocis.settings.v0.RoleService.AssignRoleToUser:output_type -> com.owncloud.ocis.settings.v0.AssignRoleToUserResponse - 45, // 63: com.owncloud.ocis.settings.v0.RoleService.RemoveRoleFromUser:output_type -> google.protobuf.Empty - 29, // 64: com.owncloud.ocis.settings.v0.PermissionService.ListPermissionsByResource:output_type -> com.owncloud.ocis.settings.v0.ListPermissionsByResourceResponse - 31, // 65: com.owncloud.ocis.settings.v0.PermissionService.GetPermissionByID:output_type -> com.owncloud.ocis.settings.v0.GetPermissionByIDResponse - 51, // [51:66] is the sub-list for method output_type - 36, // [36:51] is the sub-list for method input_type - 36, // [36:36] is the sub-list for extension type_name - 36, // [36:36] is the sub-list for extension extendee - 0, // [0:36] is the sub-list for field type_name -} - -func init() { file_proto_v0_settings_proto_init() } -func file_proto_v0_settings_proto_init() { - if File_proto_v0_settings_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_proto_v0_settings_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SaveBundleRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SaveBundleResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetBundleRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetBundleResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListBundlesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListBundlesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddSettingToBundleRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddSettingToBundleResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoveSettingFromBundleRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SaveValueRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SaveValueResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetValueRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetValueResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListValuesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListValuesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetValueByUniqueIdentifiersRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ValueWithIdentifier); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Identifier); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListRoleAssignmentsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListRoleAssignmentsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AssignRoleToUserRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AssignRoleToUserResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoveRoleFromUserRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserRoleAssignment); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListPermissionsByResourceRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListPermissionsByResourceResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetPermissionByIDRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetPermissionByIDResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Resource); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Bundle); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Setting); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Int); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*String); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Bool); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SingleChoiceList); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MultiChoiceList); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListOption); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Permission); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Value); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListValue); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v0_settings_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListOptionValue); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_proto_v0_settings_proto_msgTypes[30].OneofWrappers = []interface{}{ - (*Setting_IntValue)(nil), - (*Setting_StringValue)(nil), - (*Setting_BoolValue)(nil), - (*Setting_SingleChoiceValue)(nil), - (*Setting_MultiChoiceValue)(nil), - (*Setting_PermissionValue)(nil), - } - file_proto_v0_settings_proto_msgTypes[38].OneofWrappers = []interface{}{ - (*Value_BoolValue)(nil), - (*Value_IntValue)(nil), - (*Value_StringValue)(nil), - (*Value_ListValue)(nil), - } - file_proto_v0_settings_proto_msgTypes[40].OneofWrappers = []interface{}{ - (*ListOptionValue_StringValue)(nil), - (*ListOptionValue_IntValue)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_proto_v0_settings_proto_rawDesc, - NumEnums: 4, - NumMessages: 41, - NumExtensions: 0, - NumServices: 4, - }, - GoTypes: file_proto_v0_settings_proto_goTypes, - DependencyIndexes: file_proto_v0_settings_proto_depIdxs, - EnumInfos: file_proto_v0_settings_proto_enumTypes, - MessageInfos: file_proto_v0_settings_proto_msgTypes, - }.Build() - File_proto_v0_settings_proto = out.File - file_proto_v0_settings_proto_rawDesc = nil - file_proto_v0_settings_proto_goTypes = nil - file_proto_v0_settings_proto_depIdxs = nil -} diff --git a/settings/pkg/proto/v0/settings.pb.micro.go b/settings/pkg/proto/v0/settings.pb.micro.go deleted file mode 100644 index b8fbc79a1..000000000 --- a/settings/pkg/proto/v0/settings.pb.micro.go +++ /dev/null @@ -1,668 +0,0 @@ -// Code generated by protoc-gen-micro. DO NOT EDIT. -// source: proto/v0/settings.proto - -package proto - -import ( - fmt "fmt" - _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" - _ "google.golang.org/genproto/googleapis/api/annotations" - proto "google.golang.org/protobuf/proto" - emptypb "google.golang.org/protobuf/types/known/emptypb" - math "math" -) - -import ( - context "context" - api "go-micro.dev/v4/api" - client "go-micro.dev/v4/client" - server "go-micro.dev/v4/server" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// Reference imports to suppress errors if they are not otherwise used. -var _ api.Endpoint -var _ context.Context -var _ client.Option -var _ server.Option - -// Api Endpoints for BundleService service - -func NewBundleServiceEndpoints() []*api.Endpoint { - return []*api.Endpoint{ - { - Name: "BundleService.SaveBundle", - Path: []string{"/api/v0/settings/bundle-save"}, - Method: []string{"POST"}, - Body: "*", - Handler: "rpc", - }, - { - Name: "BundleService.GetBundle", - Path: []string{"/api/v0/settings/bundle-get"}, - Method: []string{"POST"}, - Body: "*", - Handler: "rpc", - }, - { - Name: "BundleService.ListBundles", - Path: []string{"/api/v0/settings/bundles-list"}, - Method: []string{"POST"}, - Body: "*", - Handler: "rpc", - }, - { - Name: "BundleService.AddSettingToBundle", - Path: []string{"/api/v0/settings/bundles-add-setting"}, - Method: []string{"POST"}, - Body: "*", - Handler: "rpc", - }, - { - Name: "BundleService.RemoveSettingFromBundle", - Path: []string{"/api/v0/settings/bundles-remove-setting"}, - Method: []string{"POST"}, - Body: "*", - Handler: "rpc", - }, - } -} - -// Client API for BundleService service - -type BundleService interface { - SaveBundle(ctx context.Context, in *SaveBundleRequest, opts ...client.CallOption) (*SaveBundleResponse, error) - GetBundle(ctx context.Context, in *GetBundleRequest, opts ...client.CallOption) (*GetBundleResponse, error) - ListBundles(ctx context.Context, in *ListBundlesRequest, opts ...client.CallOption) (*ListBundlesResponse, error) - AddSettingToBundle(ctx context.Context, in *AddSettingToBundleRequest, opts ...client.CallOption) (*AddSettingToBundleResponse, error) - RemoveSettingFromBundle(ctx context.Context, in *RemoveSettingFromBundleRequest, opts ...client.CallOption) (*emptypb.Empty, error) -} - -type bundleService struct { - c client.Client - name string -} - -func NewBundleService(name string, c client.Client) BundleService { - return &bundleService{ - c: c, - name: name, - } -} - -func (c *bundleService) SaveBundle(ctx context.Context, in *SaveBundleRequest, opts ...client.CallOption) (*SaveBundleResponse, error) { - req := c.c.NewRequest(c.name, "BundleService.SaveBundle", in) - out := new(SaveBundleResponse) - err := c.c.Call(ctx, req, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *bundleService) GetBundle(ctx context.Context, in *GetBundleRequest, opts ...client.CallOption) (*GetBundleResponse, error) { - req := c.c.NewRequest(c.name, "BundleService.GetBundle", in) - out := new(GetBundleResponse) - err := c.c.Call(ctx, req, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *bundleService) ListBundles(ctx context.Context, in *ListBundlesRequest, opts ...client.CallOption) (*ListBundlesResponse, error) { - req := c.c.NewRequest(c.name, "BundleService.ListBundles", in) - out := new(ListBundlesResponse) - err := c.c.Call(ctx, req, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *bundleService) AddSettingToBundle(ctx context.Context, in *AddSettingToBundleRequest, opts ...client.CallOption) (*AddSettingToBundleResponse, error) { - req := c.c.NewRequest(c.name, "BundleService.AddSettingToBundle", in) - out := new(AddSettingToBundleResponse) - err := c.c.Call(ctx, req, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *bundleService) RemoveSettingFromBundle(ctx context.Context, in *RemoveSettingFromBundleRequest, opts ...client.CallOption) (*emptypb.Empty, error) { - req := c.c.NewRequest(c.name, "BundleService.RemoveSettingFromBundle", in) - out := new(emptypb.Empty) - err := c.c.Call(ctx, req, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for BundleService service - -type BundleServiceHandler interface { - SaveBundle(context.Context, *SaveBundleRequest, *SaveBundleResponse) error - GetBundle(context.Context, *GetBundleRequest, *GetBundleResponse) error - ListBundles(context.Context, *ListBundlesRequest, *ListBundlesResponse) error - AddSettingToBundle(context.Context, *AddSettingToBundleRequest, *AddSettingToBundleResponse) error - RemoveSettingFromBundle(context.Context, *RemoveSettingFromBundleRequest, *emptypb.Empty) error -} - -func RegisterBundleServiceHandler(s server.Server, hdlr BundleServiceHandler, opts ...server.HandlerOption) error { - type bundleService interface { - SaveBundle(ctx context.Context, in *SaveBundleRequest, out *SaveBundleResponse) error - GetBundle(ctx context.Context, in *GetBundleRequest, out *GetBundleResponse) error - ListBundles(ctx context.Context, in *ListBundlesRequest, out *ListBundlesResponse) error - AddSettingToBundle(ctx context.Context, in *AddSettingToBundleRequest, out *AddSettingToBundleResponse) error - RemoveSettingFromBundle(ctx context.Context, in *RemoveSettingFromBundleRequest, out *emptypb.Empty) error - } - type BundleService struct { - bundleService - } - h := &bundleServiceHandler{hdlr} - opts = append(opts, api.WithEndpoint(&api.Endpoint{ - Name: "BundleService.SaveBundle", - Path: []string{"/api/v0/settings/bundle-save"}, - Method: []string{"POST"}, - Body: "*", - Handler: "rpc", - })) - opts = append(opts, api.WithEndpoint(&api.Endpoint{ - Name: "BundleService.GetBundle", - Path: []string{"/api/v0/settings/bundle-get"}, - Method: []string{"POST"}, - Body: "*", - Handler: "rpc", - })) - opts = append(opts, api.WithEndpoint(&api.Endpoint{ - Name: "BundleService.ListBundles", - Path: []string{"/api/v0/settings/bundles-list"}, - Method: []string{"POST"}, - Body: "*", - Handler: "rpc", - })) - opts = append(opts, api.WithEndpoint(&api.Endpoint{ - Name: "BundleService.AddSettingToBundle", - Path: []string{"/api/v0/settings/bundles-add-setting"}, - Method: []string{"POST"}, - Body: "*", - Handler: "rpc", - })) - opts = append(opts, api.WithEndpoint(&api.Endpoint{ - Name: "BundleService.RemoveSettingFromBundle", - Path: []string{"/api/v0/settings/bundles-remove-setting"}, - Method: []string{"POST"}, - Body: "*", - Handler: "rpc", - })) - return s.Handle(s.NewHandler(&BundleService{h}, opts...)) -} - -type bundleServiceHandler struct { - BundleServiceHandler -} - -func (h *bundleServiceHandler) SaveBundle(ctx context.Context, in *SaveBundleRequest, out *SaveBundleResponse) error { - return h.BundleServiceHandler.SaveBundle(ctx, in, out) -} - -func (h *bundleServiceHandler) GetBundle(ctx context.Context, in *GetBundleRequest, out *GetBundleResponse) error { - return h.BundleServiceHandler.GetBundle(ctx, in, out) -} - -func (h *bundleServiceHandler) ListBundles(ctx context.Context, in *ListBundlesRequest, out *ListBundlesResponse) error { - return h.BundleServiceHandler.ListBundles(ctx, in, out) -} - -func (h *bundleServiceHandler) AddSettingToBundle(ctx context.Context, in *AddSettingToBundleRequest, out *AddSettingToBundleResponse) error { - return h.BundleServiceHandler.AddSettingToBundle(ctx, in, out) -} - -func (h *bundleServiceHandler) RemoveSettingFromBundle(ctx context.Context, in *RemoveSettingFromBundleRequest, out *emptypb.Empty) error { - return h.BundleServiceHandler.RemoveSettingFromBundle(ctx, in, out) -} - -// Api Endpoints for ValueService service - -func NewValueServiceEndpoints() []*api.Endpoint { - return []*api.Endpoint{ - { - Name: "ValueService.SaveValue", - Path: []string{"/api/v0/settings/values-save"}, - Method: []string{"POST"}, - Body: "*", - Handler: "rpc", - }, - { - Name: "ValueService.GetValue", - Path: []string{"/api/v0/settings/values-get"}, - Method: []string{"POST"}, - Body: "*", - Handler: "rpc", - }, - { - Name: "ValueService.ListValues", - Path: []string{"/api/v0/settings/values-list"}, - Method: []string{"POST"}, - Body: "*", - Handler: "rpc", - }, - { - Name: "ValueService.GetValueByUniqueIdentifiers", - Path: []string{"/api/v0/settings/values-get-by-unique-identifiers"}, - Method: []string{"POST"}, - Body: "*", - Handler: "rpc", - }, - } -} - -// Client API for ValueService service - -type ValueService interface { - SaveValue(ctx context.Context, in *SaveValueRequest, opts ...client.CallOption) (*SaveValueResponse, error) - GetValue(ctx context.Context, in *GetValueRequest, opts ...client.CallOption) (*GetValueResponse, error) - ListValues(ctx context.Context, in *ListValuesRequest, opts ...client.CallOption) (*ListValuesResponse, error) - GetValueByUniqueIdentifiers(ctx context.Context, in *GetValueByUniqueIdentifiersRequest, opts ...client.CallOption) (*GetValueResponse, error) -} - -type valueService struct { - c client.Client - name string -} - -func NewValueService(name string, c client.Client) ValueService { - return &valueService{ - c: c, - name: name, - } -} - -func (c *valueService) SaveValue(ctx context.Context, in *SaveValueRequest, opts ...client.CallOption) (*SaveValueResponse, error) { - req := c.c.NewRequest(c.name, "ValueService.SaveValue", in) - out := new(SaveValueResponse) - err := c.c.Call(ctx, req, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *valueService) GetValue(ctx context.Context, in *GetValueRequest, opts ...client.CallOption) (*GetValueResponse, error) { - req := c.c.NewRequest(c.name, "ValueService.GetValue", in) - out := new(GetValueResponse) - err := c.c.Call(ctx, req, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *valueService) ListValues(ctx context.Context, in *ListValuesRequest, opts ...client.CallOption) (*ListValuesResponse, error) { - req := c.c.NewRequest(c.name, "ValueService.ListValues", in) - out := new(ListValuesResponse) - err := c.c.Call(ctx, req, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *valueService) GetValueByUniqueIdentifiers(ctx context.Context, in *GetValueByUniqueIdentifiersRequest, opts ...client.CallOption) (*GetValueResponse, error) { - req := c.c.NewRequest(c.name, "ValueService.GetValueByUniqueIdentifiers", in) - out := new(GetValueResponse) - err := c.c.Call(ctx, req, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for ValueService service - -type ValueServiceHandler interface { - SaveValue(context.Context, *SaveValueRequest, *SaveValueResponse) error - GetValue(context.Context, *GetValueRequest, *GetValueResponse) error - ListValues(context.Context, *ListValuesRequest, *ListValuesResponse) error - GetValueByUniqueIdentifiers(context.Context, *GetValueByUniqueIdentifiersRequest, *GetValueResponse) error -} - -func RegisterValueServiceHandler(s server.Server, hdlr ValueServiceHandler, opts ...server.HandlerOption) error { - type valueService interface { - SaveValue(ctx context.Context, in *SaveValueRequest, out *SaveValueResponse) error - GetValue(ctx context.Context, in *GetValueRequest, out *GetValueResponse) error - ListValues(ctx context.Context, in *ListValuesRequest, out *ListValuesResponse) error - GetValueByUniqueIdentifiers(ctx context.Context, in *GetValueByUniqueIdentifiersRequest, out *GetValueResponse) error - } - type ValueService struct { - valueService - } - h := &valueServiceHandler{hdlr} - opts = append(opts, api.WithEndpoint(&api.Endpoint{ - Name: "ValueService.SaveValue", - Path: []string{"/api/v0/settings/values-save"}, - Method: []string{"POST"}, - Body: "*", - Handler: "rpc", - })) - opts = append(opts, api.WithEndpoint(&api.Endpoint{ - Name: "ValueService.GetValue", - Path: []string{"/api/v0/settings/values-get"}, - Method: []string{"POST"}, - Body: "*", - Handler: "rpc", - })) - opts = append(opts, api.WithEndpoint(&api.Endpoint{ - Name: "ValueService.ListValues", - Path: []string{"/api/v0/settings/values-list"}, - Method: []string{"POST"}, - Body: "*", - Handler: "rpc", - })) - opts = append(opts, api.WithEndpoint(&api.Endpoint{ - Name: "ValueService.GetValueByUniqueIdentifiers", - Path: []string{"/api/v0/settings/values-get-by-unique-identifiers"}, - Method: []string{"POST"}, - Body: "*", - Handler: "rpc", - })) - return s.Handle(s.NewHandler(&ValueService{h}, opts...)) -} - -type valueServiceHandler struct { - ValueServiceHandler -} - -func (h *valueServiceHandler) SaveValue(ctx context.Context, in *SaveValueRequest, out *SaveValueResponse) error { - return h.ValueServiceHandler.SaveValue(ctx, in, out) -} - -func (h *valueServiceHandler) GetValue(ctx context.Context, in *GetValueRequest, out *GetValueResponse) error { - return h.ValueServiceHandler.GetValue(ctx, in, out) -} - -func (h *valueServiceHandler) ListValues(ctx context.Context, in *ListValuesRequest, out *ListValuesResponse) error { - return h.ValueServiceHandler.ListValues(ctx, in, out) -} - -func (h *valueServiceHandler) GetValueByUniqueIdentifiers(ctx context.Context, in *GetValueByUniqueIdentifiersRequest, out *GetValueResponse) error { - return h.ValueServiceHandler.GetValueByUniqueIdentifiers(ctx, in, out) -} - -// Api Endpoints for RoleService service - -func NewRoleServiceEndpoints() []*api.Endpoint { - return []*api.Endpoint{ - { - Name: "RoleService.ListRoles", - Path: []string{"/api/v0/settings/roles-list"}, - Method: []string{"POST"}, - Body: "*", - Handler: "rpc", - }, - { - Name: "RoleService.ListRoleAssignments", - Path: []string{"/api/v0/settings/assignments-list"}, - Method: []string{"POST"}, - Body: "*", - Handler: "rpc", - }, - { - Name: "RoleService.AssignRoleToUser", - Path: []string{"/api/v0/settings/assignments-add"}, - Method: []string{"POST"}, - Body: "*", - Handler: "rpc", - }, - { - Name: "RoleService.RemoveRoleFromUser", - Path: []string{"/api/v0/settings/assignments-remove"}, - Method: []string{"POST"}, - Body: "*", - Handler: "rpc", - }, - } -} - -// Client API for RoleService service - -type RoleService interface { - ListRoles(ctx context.Context, in *ListBundlesRequest, opts ...client.CallOption) (*ListBundlesResponse, error) - ListRoleAssignments(ctx context.Context, in *ListRoleAssignmentsRequest, opts ...client.CallOption) (*ListRoleAssignmentsResponse, error) - AssignRoleToUser(ctx context.Context, in *AssignRoleToUserRequest, opts ...client.CallOption) (*AssignRoleToUserResponse, error) - RemoveRoleFromUser(ctx context.Context, in *RemoveRoleFromUserRequest, opts ...client.CallOption) (*emptypb.Empty, error) -} - -type roleService struct { - c client.Client - name string -} - -func NewRoleService(name string, c client.Client) RoleService { - return &roleService{ - c: c, - name: name, - } -} - -func (c *roleService) ListRoles(ctx context.Context, in *ListBundlesRequest, opts ...client.CallOption) (*ListBundlesResponse, error) { - req := c.c.NewRequest(c.name, "RoleService.ListRoles", in) - out := new(ListBundlesResponse) - err := c.c.Call(ctx, req, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *roleService) ListRoleAssignments(ctx context.Context, in *ListRoleAssignmentsRequest, opts ...client.CallOption) (*ListRoleAssignmentsResponse, error) { - req := c.c.NewRequest(c.name, "RoleService.ListRoleAssignments", in) - out := new(ListRoleAssignmentsResponse) - err := c.c.Call(ctx, req, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *roleService) AssignRoleToUser(ctx context.Context, in *AssignRoleToUserRequest, opts ...client.CallOption) (*AssignRoleToUserResponse, error) { - req := c.c.NewRequest(c.name, "RoleService.AssignRoleToUser", in) - out := new(AssignRoleToUserResponse) - err := c.c.Call(ctx, req, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *roleService) RemoveRoleFromUser(ctx context.Context, in *RemoveRoleFromUserRequest, opts ...client.CallOption) (*emptypb.Empty, error) { - req := c.c.NewRequest(c.name, "RoleService.RemoveRoleFromUser", in) - out := new(emptypb.Empty) - err := c.c.Call(ctx, req, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for RoleService service - -type RoleServiceHandler interface { - ListRoles(context.Context, *ListBundlesRequest, *ListBundlesResponse) error - ListRoleAssignments(context.Context, *ListRoleAssignmentsRequest, *ListRoleAssignmentsResponse) error - AssignRoleToUser(context.Context, *AssignRoleToUserRequest, *AssignRoleToUserResponse) error - RemoveRoleFromUser(context.Context, *RemoveRoleFromUserRequest, *emptypb.Empty) error -} - -func RegisterRoleServiceHandler(s server.Server, hdlr RoleServiceHandler, opts ...server.HandlerOption) error { - type roleService interface { - ListRoles(ctx context.Context, in *ListBundlesRequest, out *ListBundlesResponse) error - ListRoleAssignments(ctx context.Context, in *ListRoleAssignmentsRequest, out *ListRoleAssignmentsResponse) error - AssignRoleToUser(ctx context.Context, in *AssignRoleToUserRequest, out *AssignRoleToUserResponse) error - RemoveRoleFromUser(ctx context.Context, in *RemoveRoleFromUserRequest, out *emptypb.Empty) error - } - type RoleService struct { - roleService - } - h := &roleServiceHandler{hdlr} - opts = append(opts, api.WithEndpoint(&api.Endpoint{ - Name: "RoleService.ListRoles", - Path: []string{"/api/v0/settings/roles-list"}, - Method: []string{"POST"}, - Body: "*", - Handler: "rpc", - })) - opts = append(opts, api.WithEndpoint(&api.Endpoint{ - Name: "RoleService.ListRoleAssignments", - Path: []string{"/api/v0/settings/assignments-list"}, - Method: []string{"POST"}, - Body: "*", - Handler: "rpc", - })) - opts = append(opts, api.WithEndpoint(&api.Endpoint{ - Name: "RoleService.AssignRoleToUser", - Path: []string{"/api/v0/settings/assignments-add"}, - Method: []string{"POST"}, - Body: "*", - Handler: "rpc", - })) - opts = append(opts, api.WithEndpoint(&api.Endpoint{ - Name: "RoleService.RemoveRoleFromUser", - Path: []string{"/api/v0/settings/assignments-remove"}, - Method: []string{"POST"}, - Body: "*", - Handler: "rpc", - })) - return s.Handle(s.NewHandler(&RoleService{h}, opts...)) -} - -type roleServiceHandler struct { - RoleServiceHandler -} - -func (h *roleServiceHandler) ListRoles(ctx context.Context, in *ListBundlesRequest, out *ListBundlesResponse) error { - return h.RoleServiceHandler.ListRoles(ctx, in, out) -} - -func (h *roleServiceHandler) ListRoleAssignments(ctx context.Context, in *ListRoleAssignmentsRequest, out *ListRoleAssignmentsResponse) error { - return h.RoleServiceHandler.ListRoleAssignments(ctx, in, out) -} - -func (h *roleServiceHandler) AssignRoleToUser(ctx context.Context, in *AssignRoleToUserRequest, out *AssignRoleToUserResponse) error { - return h.RoleServiceHandler.AssignRoleToUser(ctx, in, out) -} - -func (h *roleServiceHandler) RemoveRoleFromUser(ctx context.Context, in *RemoveRoleFromUserRequest, out *emptypb.Empty) error { - return h.RoleServiceHandler.RemoveRoleFromUser(ctx, in, out) -} - -// Api Endpoints for PermissionService service - -func NewPermissionServiceEndpoints() []*api.Endpoint { - return []*api.Endpoint{ - { - Name: "PermissionService.ListPermissionsByResource", - Path: []string{"/api/v0/settings/permissions-list-by-resource"}, - Method: []string{"POST"}, - Body: "*", - Handler: "rpc", - }, - { - Name: "PermissionService.GetPermissionByID", - Path: []string{"/api/v0/settings/permissions-get-by-id"}, - Method: []string{"POST"}, - Body: "*", - Handler: "rpc", - }, - } -} - -// Client API for PermissionService service - -type PermissionService interface { - ListPermissionsByResource(ctx context.Context, in *ListPermissionsByResourceRequest, opts ...client.CallOption) (*ListPermissionsByResourceResponse, error) - GetPermissionByID(ctx context.Context, in *GetPermissionByIDRequest, opts ...client.CallOption) (*GetPermissionByIDResponse, error) -} - -type permissionService struct { - c client.Client - name string -} - -func NewPermissionService(name string, c client.Client) PermissionService { - return &permissionService{ - c: c, - name: name, - } -} - -func (c *permissionService) ListPermissionsByResource(ctx context.Context, in *ListPermissionsByResourceRequest, opts ...client.CallOption) (*ListPermissionsByResourceResponse, error) { - req := c.c.NewRequest(c.name, "PermissionService.ListPermissionsByResource", in) - out := new(ListPermissionsByResourceResponse) - err := c.c.Call(ctx, req, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *permissionService) GetPermissionByID(ctx context.Context, in *GetPermissionByIDRequest, opts ...client.CallOption) (*GetPermissionByIDResponse, error) { - req := c.c.NewRequest(c.name, "PermissionService.GetPermissionByID", in) - out := new(GetPermissionByIDResponse) - err := c.c.Call(ctx, req, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for PermissionService service - -type PermissionServiceHandler interface { - ListPermissionsByResource(context.Context, *ListPermissionsByResourceRequest, *ListPermissionsByResourceResponse) error - GetPermissionByID(context.Context, *GetPermissionByIDRequest, *GetPermissionByIDResponse) error -} - -func RegisterPermissionServiceHandler(s server.Server, hdlr PermissionServiceHandler, opts ...server.HandlerOption) error { - type permissionService interface { - ListPermissionsByResource(ctx context.Context, in *ListPermissionsByResourceRequest, out *ListPermissionsByResourceResponse) error - GetPermissionByID(ctx context.Context, in *GetPermissionByIDRequest, out *GetPermissionByIDResponse) error - } - type PermissionService struct { - permissionService - } - h := &permissionServiceHandler{hdlr} - opts = append(opts, api.WithEndpoint(&api.Endpoint{ - Name: "PermissionService.ListPermissionsByResource", - Path: []string{"/api/v0/settings/permissions-list-by-resource"}, - Method: []string{"POST"}, - Body: "*", - Handler: "rpc", - })) - opts = append(opts, api.WithEndpoint(&api.Endpoint{ - Name: "PermissionService.GetPermissionByID", - Path: []string{"/api/v0/settings/permissions-get-by-id"}, - Method: []string{"POST"}, - Body: "*", - Handler: "rpc", - })) - return s.Handle(s.NewHandler(&PermissionService{h}, opts...)) -} - -type permissionServiceHandler struct { - PermissionServiceHandler -} - -func (h *permissionServiceHandler) ListPermissionsByResource(ctx context.Context, in *ListPermissionsByResourceRequest, out *ListPermissionsByResourceResponse) error { - return h.PermissionServiceHandler.ListPermissionsByResource(ctx, in, out) -} - -func (h *permissionServiceHandler) GetPermissionByID(ctx context.Context, in *GetPermissionByIDRequest, out *GetPermissionByIDResponse) error { - return h.PermissionServiceHandler.GetPermissionByID(ctx, in, out) -} diff --git a/settings/pkg/proto/v0/settings.pb.micro_test.go b/settings/pkg/proto/v0/settings.pb.micro_test.go deleted file mode 100644 index ec15d60a7..000000000 --- a/settings/pkg/proto/v0/settings.pb.micro_test.go +++ /dev/null @@ -1,1643 +0,0 @@ -package proto_test - -import ( - "context" - "encoding/json" - "fmt" - "log" - "net/http" - "os" - "testing" - - ocislog "github.com/owncloud/ocis/ocis-pkg/log" - "github.com/owncloud/ocis/ocis-pkg/middleware" - "github.com/owncloud/ocis/ocis-pkg/service/grpc" - "github.com/owncloud/ocis/settings/pkg/config" - "github.com/owncloud/ocis/settings/pkg/proto/v0" - svc "github.com/owncloud/ocis/settings/pkg/service/v0" - store "github.com/owncloud/ocis/settings/pkg/store/filesystem" - "github.com/stretchr/testify/assert" - merrors "go-micro.dev/v4/errors" - "go-micro.dev/v4/metadata" -) - -var ( - service grpc.Service - handler svc.Service - bundleService proto.BundleService - valueService proto.ValueService - roleService proto.RoleService - permissionService proto.PermissionService - - testAccountID = "e8a7f56b-10ce-4f67-b67f-eca40aa0ef26" - - settingsStub = []*proto.Setting{ - { - Id: "336c4db1-5062-4931-990f-d88e6b02cb02", - DisplayName: "dummy setting", - Name: "dummy-setting", - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_USER, - }, - Value: &proto.Setting_IntValue{ - IntValue: &proto.Int{ - Default: 42, - }, - }, - Description: "dummy setting", - }, - } - - //optionsForListStub for choice list settings - optionsForListStub = []*proto.ListOption{ - { - Value: &proto.ListOptionValue{ - Option: &proto.ListOptionValue_StringValue{StringValue: "list option string value"}, - }, - Default: true, - DisplayValue: "a string value", - }, - { - Value: &proto.ListOptionValue{ - Option: &proto.ListOptionValue_IntValue{IntValue: 123}, - }, - Default: true, - DisplayValue: "a int value", - }, - } - - //MultiChoiceList - multipleChoiceSettingStub = proto.MultiChoiceList{ - Options: optionsForListStub, - } - - //SingleChoiceList - singleChoiceSettingStub = proto.SingleChoiceList{ - Options: optionsForListStub, - } - - complexSettingsStub = []*proto.Setting{ - { - Name: "int", - Id: "4e00633d-5373-4df4-9299-1c9ed9c3ebed", - DisplayName: "an integer value", - Description: "with some description", - Value: &proto.Setting_IntValue{ - IntValue: &proto.Int{ - Default: 1, - Min: 1, - Max: 124, - Step: 1, - Placeholder: "Int value", - }, - }, - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_USER, - }, - }, - { - Name: "string", - Id: "f792acb4-9f09-4fa8-92d3-4a0d0a6ca721", - DisplayName: "a string value", - Description: "with some description", - Value: &proto.Setting_StringValue{ - StringValue: &proto.String{ - Default: "thedefaultvalue", - Required: false, - MinLength: 2, - MaxLength: 255, - Placeholder: "a string value", - }, - }, - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_USER, - }, - }, - { - Name: "bool", - Id: "6ef9268c-f0bd-48a7-a0a0-3ba3ee42b5cc", - DisplayName: "a bool value", - Description: "with some description", - Value: &proto.Setting_BoolValue{ - BoolValue: &proto.Bool{ - Default: false, - Label: "bool setting", - }, - }, - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_USER, - }, - }, - { - Name: "multipleChoice", - Id: "905da88c-3be0-42c2-a8b2-e6bcd9976b2d", - DisplayName: "a multiple choice setting", - Description: "with some description", - Value: &proto.Setting_MultiChoiceValue{ - MultiChoiceValue: &multipleChoiceSettingStub, - }, - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_USER, - }, - }, - { - Name: "singleChoice", - Id: "5bf4de47-57cc-4705-a456-4fcf39673994", - DisplayName: "a single choice setting", - Description: "with some description", - Value: &proto.Setting_SingleChoiceValue{ - SingleChoiceValue: &singleChoiceSettingStub, - }, - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_USER, - }, - }, - } - - bundleStub = proto.Bundle{ - Name: "test", - Id: "b1b8c9d0-fb3c-4e12-b868-5a8508218d2e", - DisplayName: "bundleDisplayName", - Extension: "testExtension", - Type: proto.Bundle_TYPE_DEFAULT, - Settings: complexSettingsStub, - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_SYSTEM, - }, - } -) - -const dataPath = "/tmp/grpc-tests-ocis-settings" - -func init() { - service = grpc.NewService( - grpc.Namespace("com.owncloud.api"), - grpc.Name("settings"), - grpc.Address("localhost:9992"), - ) - - cfg := config.DefaultConfig() - cfg.DataPath = dataPath - handler = svc.NewService(cfg, ocislog.NewLogger(ocislog.Color(true), ocislog.Pretty(true))) - err := proto.RegisterBundleServiceHandler(service.Server(), handler) - if err != nil { - log.Fatalf("could not register BundleServiceHandler: %v", err) - } - err = proto.RegisterValueServiceHandler(service.Server(), handler) - if err != nil { - log.Fatalf("could not register ValueServiceHandler: %v", err) - } - err = proto.RegisterRoleServiceHandler(service.Server(), handler) - if err != nil { - log.Fatalf("could not register RoleServiceHandler: %v", err) - } - err = proto.RegisterPermissionServiceHandler(service.Server(), handler) - if err != nil { - log.Fatalf("could not register PermissionServiceHandler: %v", err) - } - - if err = service.Server().Start(); err != nil { - log.Fatalf("could not start server: %v", err) - } - - client := service.Client() - bundleService = proto.NewBundleService("com.owncloud.api.settings", client) - valueService = proto.NewValueService("com.owncloud.api.settings", client) - roleService = proto.NewRoleService("com.owncloud.api.settings", client) - permissionService = proto.NewPermissionService("com.owncloud.api.settings", client) -} - -func setup() func() { - handler.RegisterDefaultRoles() - return func() { - if err := os.RemoveAll(dataPath); err != nil { - log.Printf("could not delete data root: %s", dataPath) - } else { - log.Println("data root deleted") - } - } -} - -/** -testing that saving a settings bundle and retrieving it again works correctly -using various setting bundle properties -*/ -func TestBundleInputValidation(t *testing.T) { - var scenarios = []struct { - name string - bundleName string - displayName string - extensionName string - expectedError error - }{ - { - "ASCII", - "bundle-name", - "simple-bundle-key", - "simple-extension-name", - nil, - }, - { - "UTF validation on bundle name", - "सिम्प्ले-bundle-name", - "सिम्प्ले-display-name", - "सिम्प्ले-extension-name", - merrors.New("ocis-settings", "extension: must be in a valid format; name: must be in a valid format.", http.StatusBadRequest), - }, - { - "UTF validation on display name", - "सिम्प्ले-bundle-name", - "सिम्प्ले-display-name", - "simple-extension-name", - merrors.New("ocis-settings", "name: must be in a valid format.", http.StatusBadRequest), - }, - { - "extension name with ../ in the name", - "bundle-name", - "simple-display-name", - "../folder-a-level-higher-up", - merrors.New("ocis-settings", "extension: must be in a valid format.", http.StatusBadRequest), - }, - { - "extension name with \\ in the name", - "bundle-name", - "simple-display-name", - "\\", - merrors.New("ocis-settings", "extension: must be in a valid format.", http.StatusBadRequest), - }, - { - "spaces are disallowed in bundle names", - "bundle name", - "simple display name", - "simple extension name", - merrors.New("ocis-settings", "extension: must be in a valid format; name: must be in a valid format.", http.StatusBadRequest), - }, - { - "spaces are allowed in display names", - "bundle-name", - "simple display name", - "simple-extension-name", - nil, - }, - { - "extension missing", - "bundle-name", - "simple-display-name", - "", - merrors.New("ocis-settings", "extension: cannot be blank.", http.StatusBadRequest), - }, - { - "display name missing", - "bundleName", - "", - "simple-extension-name", - merrors.New("ocis-settings", "display_name: cannot be blank.", http.StatusBadRequest), - }, - } - for _, scenario := range scenarios { - t.Run(scenario.name, func(t *testing.T) { - teardown := setup() - defer teardown() - - ctx := metadata.Set(context.Background(), middleware.AccountID, testAccountID) - ctx = metadata.Set(ctx, middleware.RoleIDs, getRoleIDAsJSON(svc.BundleUUIDRoleAdmin)) - - bundle := proto.Bundle{ - Name: scenario.bundleName, - Extension: scenario.extensionName, - DisplayName: scenario.displayName, - Type: proto.Bundle_TYPE_DEFAULT, - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_SYSTEM, - }, - Settings: settingsStub, - } - createRequest := proto.SaveBundleRequest{ - Bundle: &bundle, - } - - cresponse, err := bundleService.SaveBundle(ctx, &createRequest) - if err != nil || scenario.expectedError != nil { - t.Log(err) - assert.Equal(t, scenario.expectedError, err) - } else { - assert.Equal(t, scenario.extensionName, cresponse.Bundle.Extension) - assert.Equal(t, scenario.displayName, cresponse.Bundle.DisplayName) - - // we want to test input validation, so just allow the request permission-wise - setFullReadWriteOnBundleForAdmin(ctx, t, cresponse.Bundle.Id) - - getRequest := proto.GetBundleRequest{BundleId: cresponse.Bundle.Id} - getResponse, err := bundleService.GetBundle(ctx, &getRequest) - assert.NoError(t, err) - if err == nil { - assert.Equal(t, scenario.displayName, getResponse.Bundle.DisplayName) - } - } - }) - } -} - -func TestSaveBundleWithoutSettings(t *testing.T) { - teardown := setup() - defer teardown() - - ctx := metadata.Set(context.Background(), middleware.AccountID, testAccountID) - ctx = metadata.Set(ctx, middleware.RoleIDs, getRoleIDAsJSON(svc.BundleUUIDRoleAdmin)) - - createRequest := proto.SaveBundleRequest{ - Bundle: &proto.Bundle{ - DisplayName: "Alice's Bundle", - }, - } - response, err := bundleService.SaveBundle(ctx, &createRequest) - assert.Error(t, err) - assert.Nil(t, response) - assert.Equal(t, merrors.New("ocis-settings", "extension: cannot be blank; name: cannot be blank; settings: cannot be blank.", http.StatusBadRequest), err) -} - -func TestGetBundleOfABundleSavedWithoutPermissions(t *testing.T) { - teardown := setup() - defer teardown() - - ctx := metadata.Set(context.Background(), middleware.AccountID, testAccountID) - ctx = metadata.Set(ctx, middleware.RoleIDs, getRoleIDAsJSON(svc.BundleUUIDRoleAdmin)) - - saveRequest := proto.SaveBundleRequest{ - Bundle: &bundleStub, - } - saveResponse, err := bundleService.SaveBundle(ctx, &saveRequest) - assert.NoError(t, err) - assert.Equal(t, bundleStub.Id, saveResponse.Bundle.Id) - - getRequest := proto.GetBundleRequest{BundleId: bundleStub.Id} - getResponse, err := bundleService.GetBundle(ctx, &getRequest) - assert.Empty(t, getResponse) - - assert.Equal(t, merrors.New("ocis-settings", "could not read bundle: b1b8c9d0-fb3c-4e12-b868-5a8508218d2e", http.StatusNotFound), err) -} - -func TestGetBundleHavingFullPermissionsOnAnotherRole(t *testing.T) { - teardown := setup() - defer teardown() - - ctx := metadata.Set(context.Background(), middleware.AccountID, testAccountID) - ctx = metadata.Set(ctx, middleware.RoleIDs, getRoleIDAsJSON(svc.BundleUUIDRoleAdmin)) - - saveRequest := proto.SaveBundleRequest{ - Bundle: &bundleStub, - } - saveResponse, err := bundleService.SaveBundle(ctx, &saveRequest) - assert.NoError(t, err) - assert.Equal(t, bundleStub.Id, saveResponse.Bundle.Id) - - setFullReadWriteOnBundleForAdmin(ctx, t, bundleStub.Id) - - ctx = metadata.Set(ctx, middleware.RoleIDs, getRoleIDAsJSON(svc.BundleUUIDRoleUser)) - getRequest := proto.GetBundleRequest{BundleId: bundleStub.Id} - getResponse, err := bundleService.GetBundle(ctx, &getRequest) - assert.Empty(t, getResponse) - - assert.Equal(t, merrors.New("ocis-settings", "could not read bundle: b1b8c9d0-fb3c-4e12-b868-5a8508218d2e", http.StatusNotFound), err) -} - -/** -testing that setting getting and listing a settings bundle works correctly with a set of setting definitions -*/ -func TestSaveAndGetBundle(t *testing.T) { - teardown := setup() - defer teardown() - - ctx := metadata.Set(context.Background(), middleware.AccountID, testAccountID) - ctx = metadata.Set(ctx, middleware.RoleIDs, getRoleIDAsJSON(svc.BundleUUIDRoleAdmin)) - - saveRequest := proto.SaveBundleRequest{ - Bundle: &bundleStub, - } - - // assert that SaveBundle returns the same bundle as we have sent - saveResponse, err := bundleService.SaveBundle(ctx, &saveRequest) - assert.NoError(t, err) - receivedBundle, _ := json.Marshal(saveResponse.Bundle.Settings) - expectedBundle, _ := json.Marshal(&bundleStub.Settings) - assert.Equal(t, receivedBundle, expectedBundle) - - // set full permissions for getting the created bundle - setFullReadWriteOnBundleForAdmin(ctx, t, saveResponse.Bundle.Id) - - //assert that GetBundle returns the same bundle as saved - getRequest := proto.GetBundleRequest{BundleId: saveResponse.Bundle.Id} - getResponse, err := bundleService.GetBundle(ctx, &getRequest) - assert.NoError(t, err) - if err == nil { - receivedBundle, _ = json.Marshal(getResponse.Bundle.Settings) - assert.Equal(t, expectedBundle, receivedBundle) - } -} - -/** -testing that saving a value works and can be retrieved again -*/ -func TestSaveGetIntValue(t *testing.T) { - tests := []struct { - name string - value proto.Value_IntValue - }{ - { - name: "simple int", - value: proto.Value_IntValue{IntValue: 43}, - }, - { - name: "negative", - value: proto.Value_IntValue{IntValue: -42}, - // no validation for SaveValue https://github.com/owncloud/ocis/issues/1445 - }, - { - name: "less than Min", - value: proto.Value_IntValue{IntValue: 0}, - // no validation for SaveValue https://github.com/owncloud/ocis/issues/1445 - }, - { - name: "more than Max", - value: proto.Value_IntValue{IntValue: 128}, - // no validation for SaveValue https://github.com/owncloud/ocis/issues/1445 - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - teardown := setup() - defer teardown() - - ctx := metadata.Set(context.Background(), middleware.AccountID, testAccountID) - ctx = metadata.Set(ctx, middleware.RoleIDs, getRoleIDAsJSON(svc.BundleUUIDRoleAdmin)) - - saveResponse, err := bundleService.SaveBundle(ctx, &proto.SaveBundleRequest{ - Bundle: &bundleStub, - }) - assert.NoError(t, err) - - saveValueResponse, err := valueService.SaveValue(ctx, &proto.SaveValueRequest{ - Value: &proto.Value{ - BundleId: saveResponse.Bundle.Id, - SettingId: "4e00633d-5373-4df4-9299-1c9ed9c3ebed", //setting id of the int setting - AccountUuid: "047d31b0-219a-47a4-8ee5-c5fa3802a3c2", - Value: &tt.value, - Resource: &proto.Resource{ - Type: 0, - Id: ".", - }, - }, - }) - assert.NoError(t, err) - assert.Equal(t, tt.value.IntValue, saveValueResponse.Value.Value.GetIntValue()) - - getValueResponse, err := valueService.GetValue( - ctx, &proto.GetValueRequest{Id: saveValueResponse.Value.Value.Id}, - ) - assert.NoError(t, err) - assert.Equal(t, tt.value.IntValue, getValueResponse.Value.Value.GetIntValue()) - }) - } -} - -/** -try to save a wrong type of the value -no validation for SaveValue https://github.com/owncloud/ocis/issues/1445 -*/ -func TestSaveGetIntValueIntoString(t *testing.T) { - teardown := setup() - defer teardown() - - ctx := metadata.Set(context.Background(), middleware.AccountID, testAccountID) - ctx = metadata.Set(ctx, middleware.RoleIDs, getRoleIDAsJSON(svc.BundleUUIDRoleAdmin)) - - saveResponse, err := bundleService.SaveBundle(ctx, &proto.SaveBundleRequest{ - Bundle: &bundleStub, - }) - assert.NoError(t, err) - - saveValueResponse, err := valueService.SaveValue(ctx, &proto.SaveValueRequest{ - Value: &proto.Value{ - BundleId: saveResponse.Bundle.Id, - SettingId: "f792acb4-9f09-4fa8-92d3-4a0d0a6ca721", //setting id of the string setting - AccountUuid: "047d31b0-219a-47a4-8ee5-c5fa3802a3c2", - Value: &proto.Value_StringValue{StringValue: "forty two"}, - Resource: &proto.Resource{ - Type: 0, - Id: ".", - }, - }, - }) - assert.NoError(t, err) - assert.Equal(t, "forty two", saveValueResponse.Value.Value.GetStringValue()) - - getValueResponse, err := valueService.GetValue( - ctx, &proto.GetValueRequest{Id: saveValueResponse.Value.Value.Id}, - ) - assert.NoError(t, err) - assert.Equal(t, "forty two", getValueResponse.Value.Value.GetStringValue()) -} - -// no plausibility check in settings of bundle https://github.com/owncloud/ocis/issues/1455 -func TestSaveBundleWithInvalidSettings(t *testing.T) { - var tests = []proto.Setting{ - { - Name: "intValue", - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_USER, - }, - Description: "intValue default is out of range", - Value: &proto.Setting_IntValue{ - IntValue: &proto.Int{ - Default: 30, - Min: 10, - Max: 20, - }, - }, - }, - { - Name: "intValue", - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_USER, - }, - Description: "intValue min gt max", - Value: &proto.Setting_IntValue{ - IntValue: &proto.Int{ - Default: 100, - Min: 100, - Max: 20, - }, - }, - }, - { - Name: "intValue", - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_USER, - }, - Description: "intValue step gt max-min", - Value: &proto.Setting_IntValue{ - IntValue: &proto.Int{ - Min: 10, - Max: 20, - Step: 100, - }, - }, - }, - { - Name: "intValue", - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_USER, - }, - Description: "intValue step eq 0", - Value: &proto.Setting_IntValue{ - IntValue: &proto.Int{ - Min: 10, - Max: 20, - Step: 0, - }, - }, - }, - { - Name: "intValue", - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_USER, - }, - Description: "intValue step lt 0", - Value: &proto.Setting_IntValue{ - IntValue: &proto.Int{ - Min: 10, - Max: 20, - Step: -10, - }, - }, - }, - { - Name: "stringValue", - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_USER, - }, - Description: "stringValue MinLength gt MaxLength", - Value: &proto.Setting_StringValue{ - StringValue: &proto.String{ - MinLength: 255, - MaxLength: 1, - }, - }, - }, - { - Name: "stringValue", - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_USER, - }, - Description: "stringValue MaxLength eq 0", - Value: &proto.Setting_StringValue{ - StringValue: &proto.String{ - MaxLength: 0, - }, - }, - }, - { - Name: "stringValue", - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_USER, - }, - Description: "stringValue MinLength lt 0", - Value: &proto.Setting_StringValue{ - StringValue: &proto.String{ - MinLength: -1, - }, - }, - }, - { - Name: "stringValue", - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_USER, - }, - Description: "stringValue MaxLength lt 0", - Value: &proto.Setting_StringValue{ - StringValue: &proto.String{ - MaxLength: -1, - }, - }, - }, - { - Name: "multiChoiceValue", - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_USER, - }, - Description: "multiChoice multiple options are default", - Value: &proto.Setting_MultiChoiceValue{ - MultiChoiceValue: &proto.MultiChoiceList{ - Options: []*proto.ListOption{ - { - Value: &proto.ListOptionValue{ - Option: &proto.ListOptionValue_IntValue{IntValue: 1}, - }, - Default: true, - }, - { - Value: &proto.ListOptionValue{ - Option: &proto.ListOptionValue_IntValue{IntValue: 2}, - }, - Default: true, - }, - }, - }, - }, - }, - { - Name: "singleChoiceValue", - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_USER, - }, - Description: "singleChoice multiple options are default", - Value: &proto.Setting_SingleChoiceValue{ - SingleChoiceValue: &proto.SingleChoiceList{ - Options: []*proto.ListOption{ - { - Value: &proto.ListOptionValue{ - Option: &proto.ListOptionValue_IntValue{IntValue: 1}, - }, - Default: true, - }, - { - Value: &proto.ListOptionValue{ - Option: &proto.ListOptionValue_IntValue{IntValue: 2}, - }, - Default: true, - }, - }, - }, - }, - }, - } - - for index := range tests { - t.Run(tests[index].Name, func(t *testing.T) { - teardown := setup() - defer teardown() - - ctx := metadata.Set(context.Background(), middleware.AccountID, testAccountID) - ctx = metadata.Set(ctx, middleware.RoleIDs, getRoleIDAsJSON(svc.BundleUUIDRoleAdmin)) - - var settings []*proto.Setting - - settings = append(settings, &tests[index]) - bundle := proto.Bundle{ - Name: "bundle", - Extension: "bundleExtension", - DisplayName: "bundledisplayname", - Type: proto.Bundle_TYPE_DEFAULT, - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_SYSTEM, - }, - Settings: settings, - } - saveRequest := proto.SaveBundleRequest{ - Bundle: &bundle, - } - - //assert that SaveBundle returns the same bundle as we have sent there - saveResponse, err := bundleService.SaveBundle(ctx, &saveRequest) - assert.NoError(t, err) - receivedBundle, _ := json.Marshal(saveResponse.Bundle.Settings) - expectedBundle, _ := json.Marshal(&bundle.Settings) - assert.Equal(t, expectedBundle, receivedBundle) - }) - } -} - -func TestGetBundleNoSideEffectsOnDisk(t *testing.T) { - teardown := setup() - defer teardown() - - ctx := metadata.Set(context.Background(), middleware.AccountID, testAccountID) - ctx = metadata.Set(ctx, middleware.RoleIDs, getRoleIDAsJSON(svc.BundleUUIDRoleAdmin)) - - getRequest := proto.GetBundleRequest{BundleId: "non-existing-bundle"} - - _, _ = bundleService.GetBundle(ctx, &getRequest) - assert.NoDirExists(t, store.Name+"/bundles/non-existing-bundle") - assert.NoFileExists(t, store.Name+"/bundles/non-existing-bundle/not-existing-bundle.json") -} - -// TODO non-deterministic. Fix. -func TestCreateRoleAndAssign(t *testing.T) { - teardown := setup() - defer teardown() - - ctx := metadata.Set(context.Background(), middleware.AccountID, testAccountID) - ctx = metadata.Set(ctx, middleware.RoleIDs, getRoleIDAsJSON(svc.BundleUUIDRoleAdmin)) - - res, err := bundleService.SaveBundle(ctx, &proto.SaveBundleRequest{ - Bundle: &proto.Bundle{ - Type: proto.Bundle_TYPE_ROLE, - DisplayName: "test role - update", - Name: "TEST_ROLE", - Extension: "ocis-settings", - Settings: []*proto.Setting{ - { - Name: "settingName", - Resource: &proto.Resource{ - Id: settingsStub[0].Id, - Type: proto.Resource_TYPE_SETTING, - }, - Value: &proto.Setting_PermissionValue{ - PermissionValue: &proto.Permission{ - Operation: proto.Permission_OPERATION_UPDATE, - Constraint: proto.Permission_CONSTRAINT_OWN, - }, - }, - }, - }, - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_SYSTEM, - }, - }, - }) - if err == nil { - _, err = roleService.AssignRoleToUser(ctx, &proto.AssignRoleToUserRequest{ - AccountUuid: "4c510ada-c86b-4815-8820-42cdf82c3d51", - RoleId: res.Bundle.Id, - }) - if err != nil { - fmt.Println(err) - } - assert.NoError(t, err) - } -} - -// // TODO this tests are non-deterministic at least on my machine. Find a way to make them deterministic. -// func TestListBundlesOnAuthorizedUser(t *testing.T) { -// client := service.Client() -// client2 := service.Client() -// cl := proto.NewBundleService("com.owncloud.api.settings", client) -// rc := proto.NewRoleService("com.owncloud.api.settings", client2) - -// _, err := cl.SaveBundle(context.Background(), &proto.SaveBundleRequest{ -// Bundle: &proto.Bundle{ -// DisplayName: "Alice's Bundle", -// Name: "bundle1", -// Extension: "extension1", -// Resource: &proto.Resource{ -// Type: proto.Resource_TYPE_BUNDLE, -// }, -// Type: proto.Bundle_TYPE_DEFAULT, -// Settings: settingsStub, -// }, -// }) -// assert.NoError(t, err) - -// res, err := cl.SaveBundle(context.Background(), &proto.SaveBundleRequest{ -// Bundle: &proto.Bundle{ -// // Id: "f36db5e6-a03c-40df-8413-711c67e40b47", // bug: providing the ID ignores its value for the filename. -// Type: proto.Bundle_TYPE_ROLE, -// DisplayName: "test role - update", -// Name: "TEST_ROLE", -// Extension: "ocis-settings", -// Settings: []*proto.Setting{ -// { -// Name: "settingName", -// Resource: &proto.Resource{ -// Id: settingsStub[0].Id, -// Type: proto.Resource_TYPE_SETTING, -// }, -// Value: &proto.Setting_PermissionValue{ -// &proto.Permission{ -// Operation: proto.PermissionSetting_OPERATION_UPDATE, -// Constraint: proto.PermissionSetting_CONSTRAINT_OWN, -// }, -// }, -// }, -// }, -// Resource: &proto.Resource{ -// Type: proto.Resource_TYPE_SYSTEM, -// }, -// }, -// }) -// assert.NoError(t, err) - -// _, err = rc.AssignRoleToUser(context.Background(), &proto.AssignRoleToUserRequest{ -// AccountUuid: "4c510ada-c86b-4815-8820-42cdf82c3d51", -// RoleId: res.Bundle.Id, -// }) -// assert.NoError(t, err) - -// time.Sleep(200 * time.Millisecond) -// listRequest := proto.ListSettingsBundlesRequest{AccountUuid: "4c510ada-c86b-4815-8820-42cdf82c3d51"} - -// response, err := cl.ListSettingsBundles(context.Background(), &listRequest) -// assert.NoError(t, err) -// assert.Equal(t, 1, len(response.Bundles)) -// assert.Equal(t, response.Bundles[0].Name, "bundle1") -// - -func TestListRolesAfterSavingBundle(t *testing.T) { - type expectedBundle struct { - displayName string - name string - } - - tests := []struct { - name string - bundles []*proto.Bundle - expectedBundles []expectedBundle - }{ - {"don't add bundle", - []*proto.Bundle{}, - []expectedBundle{ - {displayName: "Guest", name: "guest"}, - {displayName: "Admin", name: "admin"}, - {displayName: "User", name: "user"}, - }, - }, - {name: "one bundle", - bundles: []*proto.Bundle{{ - Type: proto.Bundle_TYPE_ROLE, - DisplayName: "test role - update", - Name: "TEST_ROLE", - Extension: "ocis-settings", - Settings: []*proto.Setting{ - { - Name: "settingName", - Resource: &proto.Resource{ - Id: settingsStub[0].Id, - Type: proto.Resource_TYPE_SETTING, - }, - Value: &proto.Setting_PermissionValue{ - PermissionValue: &proto.Permission{ - Operation: proto.Permission_OPERATION_UPDATE, - Constraint: proto.Permission_CONSTRAINT_OWN, - }, - }, - }, - }, - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_SYSTEM, - }, - }}, - expectedBundles: []expectedBundle{ - {displayName: "test role - update", name: "TEST_ROLE"}, - {displayName: "Guest", name: "guest"}, - {displayName: "Admin", name: "admin"}, - {displayName: "User", name: "user"}, - }, - }, - {name: "two added bundles", - bundles: []*proto.Bundle{{ - Type: proto.Bundle_TYPE_ROLE, - DisplayName: "test role - update", - Name: "TEST_ROLE", - Extension: "ocis-settings", - Settings: []*proto.Setting{ - { - Name: "settingName", - Resource: &proto.Resource{ - Id: settingsStub[0].Id, - Type: proto.Resource_TYPE_SETTING, - }, - Value: &proto.Setting_PermissionValue{ - PermissionValue: &proto.Permission{ - Operation: proto.Permission_OPERATION_UPDATE, - Constraint: proto.Permission_CONSTRAINT_OWN, - }, - }, - }, - }, - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_SYSTEM, - }, - }, - { - Type: proto.Bundle_TYPE_ROLE, - DisplayName: "an other role", - Name: "AnOtherROLE", - Extension: "ocis-settings", - Settings: []*proto.Setting{ - { - Name: "settingName", - Resource: &proto.Resource{ - Id: settingsStub[0].Id, - Type: proto.Resource_TYPE_SETTING, - }, - Value: &proto.Setting_PermissionValue{ - PermissionValue: &proto.Permission{ - Operation: proto.Permission_OPERATION_UPDATE, - Constraint: proto.Permission_CONSTRAINT_OWN, - }, - }, - }, - }, - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_SYSTEM, - }, - }}, - expectedBundles: []expectedBundle{ - {displayName: "test role - update", name: "TEST_ROLE"}, - {displayName: "an other role", name: "AnOtherROLE"}, - {displayName: "Guest", name: "guest"}, - {displayName: "Admin", name: "admin"}, - {displayName: "User", name: "user"}, - }, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - teardown := setup() - defer teardown() - - ctx := metadata.Set(context.Background(), middleware.AccountID, testAccountID) - ctx = metadata.Set(ctx, middleware.RoleIDs, getRoleIDAsJSON(svc.BundleUUIDRoleAdmin)) - - for _, bundle := range tt.bundles { - _, err := bundleService.SaveBundle(ctx, &proto.SaveBundleRequest{ - Bundle: bundle, - }) - assert.NoError(t, err) - } - rolesRes, err := roleService.ListRoles(ctx, &proto.ListBundlesRequest{}) - assert.NoError(t, err) - - for _, bundle := range rolesRes.Bundles { - assert.Contains(t, tt.expectedBundles, expectedBundle{ - displayName: bundle.DisplayName, - name: bundle.Name, - }) - } - }) - } -} - -func TestListFilteredBundle(t *testing.T) { - type expectedBundle struct { - displayName string - name string - } - - type permission struct { - permission proto.Permission_Operation - roleUUID string - } - - type bundleForTest struct { - bundle *proto.Bundle - permission permission - } - - tests := []struct { - name string - bundles []bundleForTest - expectedBundles []expectedBundle - }{ - { - name: "multiple bundles, all have READ(WRITE) permission", - bundles: []bundleForTest{ - { - bundle: &proto.Bundle{ - Name: "test", - Id: "b1b8c9d0-fb3c-4e12-b868-5a8508218d2e", - DisplayName: "bundleDisplayName", - Extension: "testExtension", - Type: proto.Bundle_TYPE_DEFAULT, - Settings: complexSettingsStub, - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_SYSTEM, - }, - }, - permission: permission{ - permission: proto.Permission_OPERATION_READWRITE, - roleUUID: svc.BundleUUIDRoleAdmin, - }, - }, - { - bundle: &proto.Bundle{ - Name: "one-more", - Id: "3b9f230a-fc9e-4605-89ee-a21e24728c64", - DisplayName: "an other bundle", - Extension: "testExtension", - Type: proto.Bundle_TYPE_DEFAULT, - Settings: complexSettingsStub, - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_SYSTEM, - }, - }, - permission: permission{ - permission: proto.Permission_OPERATION_READ, - roleUUID: svc.BundleUUIDRoleAdmin, - }, - }, - }, - expectedBundles: []expectedBundle{ - {displayName: "bundleDisplayName", name: "test"}, - {displayName: "an other bundle", name: "one-more"}, - }, - }, - { - name: "multiple bundles, only one with READ permission", - bundles: []bundleForTest{ - { - bundle: &proto.Bundle{ - Name: "Permission_OPERATION_WRITE", - Id: "12fe2b67-4a08-4f17-9cb6-924da943da0e", - DisplayName: "Permission_OPERATION_WRITE", - Extension: "testExtension", - Type: proto.Bundle_TYPE_DEFAULT, - Settings: complexSettingsStub, - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_SYSTEM, - }, - }, - permission: permission{ - permission: proto.Permission_OPERATION_WRITE, - roleUUID: svc.BundleUUIDRoleAdmin, - }, - }, - { - bundle: &proto.Bundle{ - Name: "Permission_OPERATION_DELETE", - Id: "1a0b65b0-fdbf-4738-b41e-41d36a01376e", - DisplayName: "Permission_OPERATION_DELETE", - Extension: "testExtension", - Type: proto.Bundle_TYPE_DEFAULT, - Settings: complexSettingsStub, - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_SYSTEM, - }, - }, - permission: permission{ - permission: proto.Permission_OPERATION_DELETE, - roleUUID: svc.BundleUUIDRoleAdmin, - }, - }, - { - bundle: &proto.Bundle{ - Name: "Permission_OPERATION_UPDATE", - Id: "511fe78e-89c9-4237-a01e-6af5457a135e", - DisplayName: "Permission_OPERATION_UPDATE", - Extension: "testExtension", - Type: proto.Bundle_TYPE_DEFAULT, - Settings: complexSettingsStub, - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_SYSTEM, - }, - }, - permission: permission{ - permission: proto.Permission_OPERATION_UPDATE, - roleUUID: svc.BundleUUIDRoleAdmin, - }, - }, - { - bundle: &proto.Bundle{ - Name: "Permission_OPERATION_CREATE", - Id: "aa42fb12-57aa-40c0-b458-3a91f398deba", - DisplayName: "Permission_OPERATION_CREATE", - Extension: "testExtension", - Type: proto.Bundle_TYPE_DEFAULT, - Settings: complexSettingsStub, - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_SYSTEM, - }, - }, - permission: permission{ - permission: proto.Permission_OPERATION_CREATE, - roleUUID: svc.BundleUUIDRoleAdmin, - }, - }, - { - bundle: &proto.Bundle{ - Name: "Permission_OPERATION_UNKNOWN", - Id: "eabb2a18-09e2-4b06-aa62-987e8dc5e908", - DisplayName: "Permission_OPERATION_UNKNOWN", - Extension: "testExtension", - Type: proto.Bundle_TYPE_DEFAULT, - Settings: complexSettingsStub, - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_SYSTEM, - }, - }, - permission: permission{ - permission: proto.Permission_OPERATION_UNKNOWN, - roleUUID: svc.BundleUUIDRoleAdmin, - }, - }, - { - bundle: &proto.Bundle{ - Name: "Permission_OPERATION_READ", - Id: "3b9f230a-fc9e-4605-89ee-a21e24728c64", - DisplayName: "Permission_OPERATION_READ", - Extension: "testExtension", - Type: proto.Bundle_TYPE_DEFAULT, - Settings: complexSettingsStub, - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_SYSTEM, - }, - }, - permission: permission{ - permission: proto.Permission_OPERATION_READ, - roleUUID: svc.BundleUUIDRoleAdmin, - }, - }, - }, - expectedBundles: []expectedBundle{ - {displayName: "Permission_OPERATION_READ", name: "Permission_OPERATION_READ"}, - }, - }, - { - name: "multiple bundles, all have READ permission, but only one matching role", - bundles: []bundleForTest{ - { - bundle: &proto.Bundle{ - Name: "matching-role", - Id: "b1b8c9d0-fb3c-4e12-b868-5a8508218d2e", - DisplayName: "bundleDisplayName", - Extension: "testExtension", - Type: proto.Bundle_TYPE_DEFAULT, - Settings: complexSettingsStub, - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_SYSTEM, - }, - }, - permission: permission{ - permission: proto.Permission_OPERATION_READWRITE, - roleUUID: svc.BundleUUIDRoleAdmin, - }, - }, - { - bundle: &proto.Bundle{ - Name: "NOT-matching-role", - Id: "3b9f230a-fc9e-4605-89ee-a21e24728c64", - DisplayName: "an other bundle", - Extension: "testExtension", - Type: proto.Bundle_TYPE_DEFAULT, - Settings: complexSettingsStub, - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_SYSTEM, - }, - }, - permission: permission{ - permission: proto.Permission_OPERATION_READ, - roleUUID: svc.BundleUUIDRoleGuest, - }, - }, - { - bundle: &proto.Bundle{ - Name: "NOT-matching-role2", - Id: "714a5917-627c-40ac-8dc7-5fdac013e4b7", - DisplayName: "an other bundle", - Extension: "testExtension", - Type: proto.Bundle_TYPE_DEFAULT, - Settings: complexSettingsStub, - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_SYSTEM, - }, - }, - permission: permission{ - permission: proto.Permission_OPERATION_READ, - roleUUID: svc.BundleUUIDRoleUser, - }, - }, - }, - expectedBundles: []expectedBundle{ - {displayName: "bundleDisplayName", name: "matching-role"}, - }, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - teardown := setup() - defer teardown() - - ctx := metadata.Set(context.Background(), middleware.AccountID, testAccountID) - ctx = metadata.Set(ctx, middleware.RoleIDs, getRoleIDAsJSON(svc.BundleUUIDRoleAdmin)) - - for _, testBundle := range tt.bundles { - _, err := bundleService.SaveBundle(ctx, &proto.SaveBundleRequest{ - Bundle: testBundle.bundle, - }) - assert.NoError(t, err) - - setPermissionOnBundleOrSetting( - ctx, t, testBundle.bundle.Id, proto.Resource_TYPE_BUNDLE, - testBundle.permission.permission, testBundle.permission.roleUUID, - ) - } - - listRes, err := bundleService.ListBundles(ctx, &proto.ListBundlesRequest{}) - assert.NoError(t, err) - - // we don't want to deep-assert the values returned only add checks on name and displayName - // this will suffice. - listResAsExpectedBundle := make([]expectedBundle, 0) - for i := range listRes.Bundles { - listResAsExpectedBundle = append(listResAsExpectedBundle, expectedBundle{ - displayName: listRes.Bundles[i].DisplayName, - name: listRes.Bundles[i].Name, - }) - } - - for _, bundle := range tt.expectedBundles { - assert.Contains(t, listResAsExpectedBundle, bundle) - } - }) - } -} - -func TestListGetBundleSettingMixedPermission(t *testing.T) { - type expectedSetting struct { - displayName string - name string - } - - type permission struct { - permission proto.Permission_Operation - roleUUID string - } - - type settingsForTest struct { - setting *proto.Setting - permission permission - } - - tests := []struct { - name string - settings []settingsForTest - expectedSettings []expectedSetting - }{ - { - name: "all settings have R/RW permissions", - settings: []settingsForTest{ - { - setting: &proto.Setting{ - Id: "b86fdb0a-801f-4749-ab84-5c99e90dbd6d", - DisplayName: "RW setting", - Name: "RW-setting", - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_USER, - }, - Value: &proto.Setting_IntValue{ - IntValue: &proto.Int{ - Default: 42, - }, - }, - Description: "RW setting", - }, - permission: permission{ - permission: proto.Permission_OPERATION_READWRITE, - roleUUID: svc.BundleUUIDRoleAdmin, - }, - }, - { - setting: &proto.Setting{ - Id: "cb1bbe58-27e7-461b-91b1-a9c85c488789", - DisplayName: "RO setting", - Name: "RO-setting", - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_USER, - }, - Value: &proto.Setting_IntValue{ - IntValue: &proto.Int{ - Default: 42, - }, - }, - Description: "RO setting", - }, - permission: permission{ - permission: proto.Permission_OPERATION_READWRITE, - roleUUID: svc.BundleUUIDRoleAdmin, - }, - }, - }, - expectedSettings: []expectedSetting{ - {displayName: "RW setting", name: "RW-setting"}, - {displayName: "RO setting", name: "RO-setting"}, - }, - }, - { - name: "all settings have R/RW permissions but only one the matching user", - settings: []settingsForTest{ - { - setting: &proto.Setting{ - Id: "b86fdb0a-801f-4749-ab84-5c99e90dbd6d", - DisplayName: "matching user", - Name: "matching-user", - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_USER, - }, - Value: &proto.Setting_IntValue{ - IntValue: &proto.Int{ - Default: 42, - }, - }, - Description: "matching user", - }, - permission: permission{ - permission: proto.Permission_OPERATION_READWRITE, - roleUUID: svc.BundleUUIDRoleAdmin, - }, - }, - { - setting: &proto.Setting{ - Id: "cb1bbe58-27e7-461b-91b1-a9c85c488789", - DisplayName: "NOT matching user", - Name: "NOT-matching-user", - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_USER, - }, - Value: &proto.Setting_IntValue{ - IntValue: &proto.Int{ - Default: 42, - }, - }, - Description: "NOT matching user", - }, - permission: permission{ - permission: proto.Permission_OPERATION_READWRITE, - roleUUID: svc.BundleUUIDRoleGuest, - }, - }, - }, - expectedSettings: []expectedSetting{ - {displayName: "matching user", name: "matching-user"}, - }, - }, - { - name: "only one settings has READ permissions", - settings: []settingsForTest{ - { - setting: &proto.Setting{ - Id: "b86fdb0a-801f-4749-ab84-5c99e90dbd6d", - DisplayName: "WRITE setting", - Name: "WRITE-setting", - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_USER, - }, - Value: &proto.Setting_IntValue{ - IntValue: &proto.Int{ - Default: 42, - }, - }, - Description: "WRITE setting", - }, - permission: permission{ - permission: proto.Permission_OPERATION_WRITE, - roleUUID: svc.BundleUUIDRoleAdmin, - }, - }, - { - setting: &proto.Setting{ - Id: "6163c6bf-79f2-43f7-b0ba-1493534bfc10", - DisplayName: "UNKNOWN setting", - Name: "UNKNOWN-setting", - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_USER, - }, - Value: &proto.Setting_IntValue{ - IntValue: &proto.Int{ - Default: 42, - }, - }, - Description: "UNKNOWN setting", - }, - permission: permission{ - permission: proto.Permission_OPERATION_UNKNOWN, - roleUUID: svc.BundleUUIDRoleAdmin, - }, - }, - { - setting: &proto.Setting{ - Id: "79eda727-9fa1-459f-aaff-f73ed5693419", - DisplayName: "CREATE setting", - Name: "CREATE-setting", - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_USER, - }, - Value: &proto.Setting_IntValue{ - IntValue: &proto.Int{ - Default: 42, - }, - }, - Description: "CREATE setting", - }, - permission: permission{ - permission: proto.Permission_OPERATION_CREATE, - roleUUID: svc.BundleUUIDRoleAdmin, - }, - }, - { - setting: &proto.Setting{ - Id: "2be7ca51-89fb-4968-b9d2-0ac43197adff", - DisplayName: "UPDATE setting", - Name: "UPDATE-setting", - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_USER, - }, - Value: &proto.Setting_IntValue{ - IntValue: &proto.Int{ - Default: 42, - }, - }, - Description: "UPDATE setting", - }, - permission: permission{ - permission: proto.Permission_OPERATION_UPDATE, - roleUUID: svc.BundleUUIDRoleAdmin, - }, - }, - { - setting: &proto.Setting{ - Id: "f1a0005e-e570-4bd8-a18c-b4afaaa8d7d9", - DisplayName: "DELETE setting", - Name: "DELETE-setting", - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_USER, - }, - Value: &proto.Setting_IntValue{ - IntValue: &proto.Int{ - Default: 42, - }, - }, - Description: "DELETE setting", - }, - permission: permission{ - permission: proto.Permission_OPERATION_DELETE, - roleUUID: svc.BundleUUIDRoleAdmin, - }, - }, - { - setting: &proto.Setting{ - Id: "cb1bbe58-27e7-461b-91b1-a9c85c488789", - DisplayName: "RO setting", - Name: "RO-setting", - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_USER, - }, - Value: &proto.Setting_IntValue{ - IntValue: &proto.Int{ - Default: 42, - }, - }, - Description: "RO setting", - }, - permission: permission{ - permission: proto.Permission_OPERATION_READWRITE, - roleUUID: svc.BundleUUIDRoleAdmin, - }, - }, - }, - expectedSettings: []expectedSetting{ - {displayName: "RO setting", name: "RO-setting"}, - }, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - teardown := setup() - defer teardown() - - ctx := metadata.Set(context.Background(), middleware.AccountID, testAccountID) - ctx = metadata.Set(ctx, middleware.RoleIDs, getRoleIDAsJSON(svc.BundleUUIDRoleAdmin)) - - // create bundle with the defined settings - var settings []*proto.Setting - - for _, testSetting := range tt.settings { - settings = append(settings, testSetting.setting) - } - - bundle := proto.Bundle{ - Name: "test", - Id: "b1b8c9d0-fb3c-4e12-b868-5a8508218d2e", - DisplayName: "bundleDisplayName", - Extension: "testExtension", - Type: proto.Bundle_TYPE_DEFAULT, - Settings: settings, - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_SYSTEM, - }, - } - - _, err := bundleService.SaveBundle(ctx, &proto.SaveBundleRequest{ - Bundle: &bundle, - }) - assert.NoError(t, err) - - // set permissions for each setting - for _, testSetting := range tt.settings { - setPermissionOnBundleOrSetting( - ctx, t, testSetting.setting.Id, proto.Resource_TYPE_SETTING, - testSetting.permission.permission, testSetting.permission.roleUUID, - ) - } - - listRes, err := bundleService.ListBundles(ctx, &proto.ListBundlesRequest{}) - assert.NoError(t, err) - - listedSettings := make([]expectedSetting, 0) - for i := range listRes.Bundles { - for _, setting := range listRes.Bundles[i].Settings { - listedSettings = append(listedSettings, expectedSetting{ - displayName: setting.DisplayName, - name: setting.Name, - }) - } - } - - for i := range tt.expectedSettings { - assert.Contains(t, listedSettings, tt.expectedSettings[i]) - } - - getRes, err := bundleService.GetBundle(ctx, &proto.GetBundleRequest{BundleId: bundle.Id}) - assert.NoError(t, err) - - for _, setting := range getRes.Bundle.Settings { - assert.Contains(t, tt.expectedSettings, expectedSetting{ - displayName: setting.DisplayName, - name: setting.Name, - }) - } - }) - } -} - -func setFullReadWriteOnBundleForAdmin(ctx context.Context, t *testing.T, bundleID string) { - setPermissionOnBundleOrSetting( - ctx, t, bundleID, proto.Resource_TYPE_BUNDLE, proto.Permission_OPERATION_READWRITE, svc.BundleUUIDRoleAdmin, - ) -} - -func setPermissionOnBundleOrSetting( - ctx context.Context, - t *testing.T, - bundleID string, - resourceType proto.Resource_Type, - permission proto.Permission_Operation, - roleUUID string, -) { - permissionRequest := proto.AddSettingToBundleRequest{ - BundleId: roleUUID, - Setting: &proto.Setting{ - Name: "test-bundle-permission-readwrite", - Resource: &proto.Resource{ - Type: resourceType, - Id: bundleID, - }, - Value: &proto.Setting_PermissionValue{ - PermissionValue: &proto.Permission{ - Operation: permission, - Constraint: proto.Permission_CONSTRAINT_OWN, - }, - }, - }, - } - addPermissionResponse, err := bundleService.AddSettingToBundle(ctx, &permissionRequest) - assert.NoError(t, err) - if err == nil { - assert.NotEmpty(t, addPermissionResponse.Setting) - } -} - -func getRoleIDAsJSON(roleID string) string { - roleIDsJSON, _ := json.Marshal([]string{roleID}) - return string(roleIDsJSON) -} diff --git a/settings/pkg/proto/v0/settings.pb.web.go b/settings/pkg/proto/v0/settings.pb.web.go deleted file mode 100644 index 17995d9ab..000000000 --- a/settings/pkg/proto/v0/settings.pb.web.go +++ /dev/null @@ -1,1905 +0,0 @@ -// Code generated by protoc-gen-microweb. DO NOT EDIT. -// source: proto.proto - -package proto - -import ( - "bytes" - "encoding/json" - "net/http" - - "github.com/go-chi/chi/v5" - "github.com/go-chi/render" - "github.com/golang/protobuf/jsonpb" - - ptypesempty "github.com/golang/protobuf/ptypes/empty" -) - -type webBundleServiceHandler struct { - r chi.Router - h BundleServiceHandler -} - -func (h *webBundleServiceHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { - h.r.ServeHTTP(w, r) -} - -func (h *webBundleServiceHandler) SaveBundle(w http.ResponseWriter, r *http.Request) { - req := &SaveBundleRequest{} - resp := &SaveBundleResponse{} - - if err := json.NewDecoder(r.Body).Decode(&req); err != nil { - http.Error(w, err.Error(), http.StatusPreconditionFailed) - return - } - - if err := h.h.SaveBundle( - r.Context(), - req, - resp, - ); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - - render.Status(r, http.StatusCreated) - render.JSON(w, r, resp) -} - -func (h *webBundleServiceHandler) GetBundle(w http.ResponseWriter, r *http.Request) { - req := &GetBundleRequest{} - resp := &GetBundleResponse{} - - if err := json.NewDecoder(r.Body).Decode(&req); err != nil { - http.Error(w, err.Error(), http.StatusPreconditionFailed) - return - } - - if err := h.h.GetBundle( - r.Context(), - req, - resp, - ); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - - render.Status(r, http.StatusCreated) - render.JSON(w, r, resp) -} - -func (h *webBundleServiceHandler) ListBundles(w http.ResponseWriter, r *http.Request) { - req := &ListBundlesRequest{} - resp := &ListBundlesResponse{} - - if err := json.NewDecoder(r.Body).Decode(&req); err != nil { - http.Error(w, err.Error(), http.StatusPreconditionFailed) - return - } - - if err := h.h.ListBundles( - r.Context(), - req, - resp, - ); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - - render.Status(r, http.StatusCreated) - render.JSON(w, r, resp) -} - -func (h *webBundleServiceHandler) AddSettingToBundle(w http.ResponseWriter, r *http.Request) { - req := &AddSettingToBundleRequest{} - resp := &AddSettingToBundleResponse{} - - if err := json.NewDecoder(r.Body).Decode(&req); err != nil { - http.Error(w, err.Error(), http.StatusPreconditionFailed) - return - } - - if err := h.h.AddSettingToBundle( - r.Context(), - req, - resp, - ); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - - render.Status(r, http.StatusCreated) - render.JSON(w, r, resp) -} - -func (h *webBundleServiceHandler) RemoveSettingFromBundle(w http.ResponseWriter, r *http.Request) { - req := &RemoveSettingFromBundleRequest{} - resp := &ptypesempty.Empty{} - - if err := json.NewDecoder(r.Body).Decode(&req); err != nil { - http.Error(w, err.Error(), http.StatusPreconditionFailed) - return - } - - if err := h.h.RemoveSettingFromBundle( - r.Context(), - req, - resp, - ); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - - render.Status(r, http.StatusNoContent) - render.NoContent(w, r) -} - -func RegisterBundleServiceWeb(r chi.Router, i BundleServiceHandler, middlewares ...func(http.Handler) http.Handler) { - handler := &webBundleServiceHandler{ - r: r, - h: i, - } - - r.MethodFunc("POST", "/api/v0/settings/bundle-save", handler.SaveBundle) - r.MethodFunc("POST", "/api/v0/settings/bundle-get", handler.GetBundle) - r.MethodFunc("POST", "/api/v0/settings/bundles-list", handler.ListBundles) - r.MethodFunc("POST", "/api/v0/settings/bundles-add-setting", handler.AddSettingToBundle) - r.MethodFunc("POST", "/api/v0/settings/bundles-remove-setting", handler.RemoveSettingFromBundle) -} - -type webValueServiceHandler struct { - r chi.Router - h ValueServiceHandler -} - -func (h *webValueServiceHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { - h.r.ServeHTTP(w, r) -} - -func (h *webValueServiceHandler) SaveValue(w http.ResponseWriter, r *http.Request) { - req := &SaveValueRequest{} - resp := &SaveValueResponse{} - - if err := json.NewDecoder(r.Body).Decode(&req); err != nil { - http.Error(w, err.Error(), http.StatusPreconditionFailed) - return - } - - if err := h.h.SaveValue( - r.Context(), - req, - resp, - ); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - - render.Status(r, http.StatusCreated) - render.JSON(w, r, resp) -} - -func (h *webValueServiceHandler) GetValue(w http.ResponseWriter, r *http.Request) { - req := &GetValueRequest{} - resp := &GetValueResponse{} - - if err := json.NewDecoder(r.Body).Decode(&req); err != nil { - http.Error(w, err.Error(), http.StatusPreconditionFailed) - return - } - - if err := h.h.GetValue( - r.Context(), - req, - resp, - ); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - - render.Status(r, http.StatusCreated) - render.JSON(w, r, resp) -} - -func (h *webValueServiceHandler) ListValues(w http.ResponseWriter, r *http.Request) { - req := &ListValuesRequest{} - resp := &ListValuesResponse{} - - if err := json.NewDecoder(r.Body).Decode(&req); err != nil { - http.Error(w, err.Error(), http.StatusPreconditionFailed) - return - } - - if err := h.h.ListValues( - r.Context(), - req, - resp, - ); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - - render.Status(r, http.StatusCreated) - render.JSON(w, r, resp) -} - -func (h *webValueServiceHandler) GetValueByUniqueIdentifiers(w http.ResponseWriter, r *http.Request) { - req := &GetValueByUniqueIdentifiersRequest{} - resp := &GetValueResponse{} - - if err := json.NewDecoder(r.Body).Decode(&req); err != nil { - http.Error(w, err.Error(), http.StatusPreconditionFailed) - return - } - - if err := h.h.GetValueByUniqueIdentifiers( - r.Context(), - req, - resp, - ); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - - render.Status(r, http.StatusCreated) - render.JSON(w, r, resp) -} - -func RegisterValueServiceWeb(r chi.Router, i ValueServiceHandler, middlewares ...func(http.Handler) http.Handler) { - handler := &webValueServiceHandler{ - r: r, - h: i, - } - - r.MethodFunc("POST", "/api/v0/settings/values-save", handler.SaveValue) - r.MethodFunc("POST", "/api/v0/settings/values-get", handler.GetValue) - r.MethodFunc("POST", "/api/v0/settings/values-list", handler.ListValues) - r.MethodFunc("POST", "/api/v0/settings/values-get-by-unique-identifiers", handler.GetValueByUniqueIdentifiers) -} - -type webRoleServiceHandler struct { - r chi.Router - h RoleServiceHandler -} - -func (h *webRoleServiceHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { - h.r.ServeHTTP(w, r) -} - -func (h *webRoleServiceHandler) ListRoles(w http.ResponseWriter, r *http.Request) { - req := &ListBundlesRequest{} - resp := &ListBundlesResponse{} - - if err := json.NewDecoder(r.Body).Decode(&req); err != nil { - http.Error(w, err.Error(), http.StatusPreconditionFailed) - return - } - - if err := h.h.ListRoles( - r.Context(), - req, - resp, - ); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - - render.Status(r, http.StatusCreated) - render.JSON(w, r, resp) -} - -func (h *webRoleServiceHandler) ListRoleAssignments(w http.ResponseWriter, r *http.Request) { - req := &ListRoleAssignmentsRequest{} - resp := &ListRoleAssignmentsResponse{} - - if err := json.NewDecoder(r.Body).Decode(&req); err != nil { - http.Error(w, err.Error(), http.StatusPreconditionFailed) - return - } - - if err := h.h.ListRoleAssignments( - r.Context(), - req, - resp, - ); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - - render.Status(r, http.StatusCreated) - render.JSON(w, r, resp) -} - -func (h *webRoleServiceHandler) AssignRoleToUser(w http.ResponseWriter, r *http.Request) { - req := &AssignRoleToUserRequest{} - resp := &AssignRoleToUserResponse{} - - if err := json.NewDecoder(r.Body).Decode(&req); err != nil { - http.Error(w, err.Error(), http.StatusPreconditionFailed) - return - } - - if err := h.h.AssignRoleToUser( - r.Context(), - req, - resp, - ); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - - render.Status(r, http.StatusCreated) - render.JSON(w, r, resp) -} - -func (h *webRoleServiceHandler) RemoveRoleFromUser(w http.ResponseWriter, r *http.Request) { - req := &RemoveRoleFromUserRequest{} - resp := &ptypesempty.Empty{} - - if err := json.NewDecoder(r.Body).Decode(&req); err != nil { - http.Error(w, err.Error(), http.StatusPreconditionFailed) - return - } - - if err := h.h.RemoveRoleFromUser( - r.Context(), - req, - resp, - ); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - - render.Status(r, http.StatusNoContent) - render.NoContent(w, r) -} - -func RegisterRoleServiceWeb(r chi.Router, i RoleServiceHandler, middlewares ...func(http.Handler) http.Handler) { - handler := &webRoleServiceHandler{ - r: r, - h: i, - } - - r.MethodFunc("POST", "/api/v0/settings/roles-list", handler.ListRoles) - r.MethodFunc("POST", "/api/v0/settings/assignments-list", handler.ListRoleAssignments) - r.MethodFunc("POST", "/api/v0/settings/assignments-add", handler.AssignRoleToUser) - r.MethodFunc("POST", "/api/v0/settings/assignments-remove", handler.RemoveRoleFromUser) -} - -type webPermissionServiceHandler struct { - r chi.Router - h PermissionServiceHandler -} - -func (h *webPermissionServiceHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { - h.r.ServeHTTP(w, r) -} - -func (h *webPermissionServiceHandler) ListPermissionsByResource(w http.ResponseWriter, r *http.Request) { - req := &ListPermissionsByResourceRequest{} - resp := &ListPermissionsByResourceResponse{} - - if err := json.NewDecoder(r.Body).Decode(&req); err != nil { - http.Error(w, err.Error(), http.StatusPreconditionFailed) - return - } - - if err := h.h.ListPermissionsByResource( - r.Context(), - req, - resp, - ); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - - render.Status(r, http.StatusCreated) - render.JSON(w, r, resp) -} - -func (h *webPermissionServiceHandler) GetPermissionByID(w http.ResponseWriter, r *http.Request) { - req := &GetPermissionByIDRequest{} - resp := &GetPermissionByIDResponse{} - - if err := json.NewDecoder(r.Body).Decode(&req); err != nil { - http.Error(w, err.Error(), http.StatusPreconditionFailed) - return - } - - if err := h.h.GetPermissionByID( - r.Context(), - req, - resp, - ); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - - render.Status(r, http.StatusCreated) - render.JSON(w, r, resp) -} - -func RegisterPermissionServiceWeb(r chi.Router, i PermissionServiceHandler, middlewares ...func(http.Handler) http.Handler) { - handler := &webPermissionServiceHandler{ - r: r, - h: i, - } - - r.MethodFunc("POST", "/api/v0/settings/permissions-list-by-resource", handler.ListPermissionsByResource) - r.MethodFunc("POST", "/api/v0/settings/permissions-get-by-id", handler.GetPermissionByID) -} - -// SaveBundleRequestJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of SaveBundleRequest. This struct is safe to replace or modify but -// should not be done so concurrently. -var SaveBundleRequestJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *SaveBundleRequest) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := SaveBundleRequestJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*SaveBundleRequest)(nil) - -// SaveBundleRequestJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of SaveBundleRequest. This struct is safe to replace or modify but -// should not be done so concurrently. -var SaveBundleRequestJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *SaveBundleRequest) UnmarshalJSON(b []byte) error { - return SaveBundleRequestJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*SaveBundleRequest)(nil) - -// SaveBundleResponseJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of SaveBundleResponse. This struct is safe to replace or modify but -// should not be done so concurrently. -var SaveBundleResponseJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *SaveBundleResponse) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := SaveBundleResponseJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*SaveBundleResponse)(nil) - -// SaveBundleResponseJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of SaveBundleResponse. This struct is safe to replace or modify but -// should not be done so concurrently. -var SaveBundleResponseJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *SaveBundleResponse) UnmarshalJSON(b []byte) error { - return SaveBundleResponseJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*SaveBundleResponse)(nil) - -// GetBundleRequestJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of GetBundleRequest. This struct is safe to replace or modify but -// should not be done so concurrently. -var GetBundleRequestJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *GetBundleRequest) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := GetBundleRequestJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*GetBundleRequest)(nil) - -// GetBundleRequestJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of GetBundleRequest. This struct is safe to replace or modify but -// should not be done so concurrently. -var GetBundleRequestJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *GetBundleRequest) UnmarshalJSON(b []byte) error { - return GetBundleRequestJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*GetBundleRequest)(nil) - -// GetBundleResponseJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of GetBundleResponse. This struct is safe to replace or modify but -// should not be done so concurrently. -var GetBundleResponseJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *GetBundleResponse) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := GetBundleResponseJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*GetBundleResponse)(nil) - -// GetBundleResponseJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of GetBundleResponse. This struct is safe to replace or modify but -// should not be done so concurrently. -var GetBundleResponseJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *GetBundleResponse) UnmarshalJSON(b []byte) error { - return GetBundleResponseJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*GetBundleResponse)(nil) - -// ListBundlesRequestJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of ListBundlesRequest. This struct is safe to replace or modify but -// should not be done so concurrently. -var ListBundlesRequestJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *ListBundlesRequest) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := ListBundlesRequestJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*ListBundlesRequest)(nil) - -// ListBundlesRequestJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of ListBundlesRequest. This struct is safe to replace or modify but -// should not be done so concurrently. -var ListBundlesRequestJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *ListBundlesRequest) UnmarshalJSON(b []byte) error { - return ListBundlesRequestJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*ListBundlesRequest)(nil) - -// ListBundlesResponseJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of ListBundlesResponse. This struct is safe to replace or modify but -// should not be done so concurrently. -var ListBundlesResponseJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *ListBundlesResponse) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := ListBundlesResponseJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*ListBundlesResponse)(nil) - -// ListBundlesResponseJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of ListBundlesResponse. This struct is safe to replace or modify but -// should not be done so concurrently. -var ListBundlesResponseJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *ListBundlesResponse) UnmarshalJSON(b []byte) error { - return ListBundlesResponseJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*ListBundlesResponse)(nil) - -// AddSettingToBundleRequestJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of AddSettingToBundleRequest. This struct is safe to replace or modify but -// should not be done so concurrently. -var AddSettingToBundleRequestJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *AddSettingToBundleRequest) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := AddSettingToBundleRequestJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*AddSettingToBundleRequest)(nil) - -// AddSettingToBundleRequestJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of AddSettingToBundleRequest. This struct is safe to replace or modify but -// should not be done so concurrently. -var AddSettingToBundleRequestJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *AddSettingToBundleRequest) UnmarshalJSON(b []byte) error { - return AddSettingToBundleRequestJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*AddSettingToBundleRequest)(nil) - -// AddSettingToBundleResponseJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of AddSettingToBundleResponse. This struct is safe to replace or modify but -// should not be done so concurrently. -var AddSettingToBundleResponseJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *AddSettingToBundleResponse) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := AddSettingToBundleResponseJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*AddSettingToBundleResponse)(nil) - -// AddSettingToBundleResponseJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of AddSettingToBundleResponse. This struct is safe to replace or modify but -// should not be done so concurrently. -var AddSettingToBundleResponseJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *AddSettingToBundleResponse) UnmarshalJSON(b []byte) error { - return AddSettingToBundleResponseJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*AddSettingToBundleResponse)(nil) - -// RemoveSettingFromBundleRequestJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of RemoveSettingFromBundleRequest. This struct is safe to replace or modify but -// should not be done so concurrently. -var RemoveSettingFromBundleRequestJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *RemoveSettingFromBundleRequest) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := RemoveSettingFromBundleRequestJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*RemoveSettingFromBundleRequest)(nil) - -// RemoveSettingFromBundleRequestJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of RemoveSettingFromBundleRequest. This struct is safe to replace or modify but -// should not be done so concurrently. -var RemoveSettingFromBundleRequestJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *RemoveSettingFromBundleRequest) UnmarshalJSON(b []byte) error { - return RemoveSettingFromBundleRequestJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*RemoveSettingFromBundleRequest)(nil) - -// SaveValueRequestJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of SaveValueRequest. This struct is safe to replace or modify but -// should not be done so concurrently. -var SaveValueRequestJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *SaveValueRequest) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := SaveValueRequestJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*SaveValueRequest)(nil) - -// SaveValueRequestJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of SaveValueRequest. This struct is safe to replace or modify but -// should not be done so concurrently. -var SaveValueRequestJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *SaveValueRequest) UnmarshalJSON(b []byte) error { - return SaveValueRequestJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*SaveValueRequest)(nil) - -// SaveValueResponseJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of SaveValueResponse. This struct is safe to replace or modify but -// should not be done so concurrently. -var SaveValueResponseJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *SaveValueResponse) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := SaveValueResponseJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*SaveValueResponse)(nil) - -// SaveValueResponseJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of SaveValueResponse. This struct is safe to replace or modify but -// should not be done so concurrently. -var SaveValueResponseJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *SaveValueResponse) UnmarshalJSON(b []byte) error { - return SaveValueResponseJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*SaveValueResponse)(nil) - -// GetValueRequestJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of GetValueRequest. This struct is safe to replace or modify but -// should not be done so concurrently. -var GetValueRequestJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *GetValueRequest) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := GetValueRequestJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*GetValueRequest)(nil) - -// GetValueRequestJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of GetValueRequest. This struct is safe to replace or modify but -// should not be done so concurrently. -var GetValueRequestJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *GetValueRequest) UnmarshalJSON(b []byte) error { - return GetValueRequestJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*GetValueRequest)(nil) - -// GetValueResponseJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of GetValueResponse. This struct is safe to replace or modify but -// should not be done so concurrently. -var GetValueResponseJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *GetValueResponse) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := GetValueResponseJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*GetValueResponse)(nil) - -// GetValueResponseJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of GetValueResponse. This struct is safe to replace or modify but -// should not be done so concurrently. -var GetValueResponseJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *GetValueResponse) UnmarshalJSON(b []byte) error { - return GetValueResponseJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*GetValueResponse)(nil) - -// ListValuesRequestJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of ListValuesRequest. This struct is safe to replace or modify but -// should not be done so concurrently. -var ListValuesRequestJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *ListValuesRequest) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := ListValuesRequestJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*ListValuesRequest)(nil) - -// ListValuesRequestJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of ListValuesRequest. This struct is safe to replace or modify but -// should not be done so concurrently. -var ListValuesRequestJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *ListValuesRequest) UnmarshalJSON(b []byte) error { - return ListValuesRequestJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*ListValuesRequest)(nil) - -// ListValuesResponseJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of ListValuesResponse. This struct is safe to replace or modify but -// should not be done so concurrently. -var ListValuesResponseJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *ListValuesResponse) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := ListValuesResponseJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*ListValuesResponse)(nil) - -// ListValuesResponseJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of ListValuesResponse. This struct is safe to replace or modify but -// should not be done so concurrently. -var ListValuesResponseJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *ListValuesResponse) UnmarshalJSON(b []byte) error { - return ListValuesResponseJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*ListValuesResponse)(nil) - -// GetValueByUniqueIdentifiersRequestJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of GetValueByUniqueIdentifiersRequest. This struct is safe to replace or modify but -// should not be done so concurrently. -var GetValueByUniqueIdentifiersRequestJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *GetValueByUniqueIdentifiersRequest) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := GetValueByUniqueIdentifiersRequestJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*GetValueByUniqueIdentifiersRequest)(nil) - -// GetValueByUniqueIdentifiersRequestJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of GetValueByUniqueIdentifiersRequest. This struct is safe to replace or modify but -// should not be done so concurrently. -var GetValueByUniqueIdentifiersRequestJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *GetValueByUniqueIdentifiersRequest) UnmarshalJSON(b []byte) error { - return GetValueByUniqueIdentifiersRequestJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*GetValueByUniqueIdentifiersRequest)(nil) - -// ValueWithIdentifierJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of ValueWithIdentifier. This struct is safe to replace or modify but -// should not be done so concurrently. -var ValueWithIdentifierJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *ValueWithIdentifier) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := ValueWithIdentifierJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*ValueWithIdentifier)(nil) - -// ValueWithIdentifierJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of ValueWithIdentifier. This struct is safe to replace or modify but -// should not be done so concurrently. -var ValueWithIdentifierJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *ValueWithIdentifier) UnmarshalJSON(b []byte) error { - return ValueWithIdentifierJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*ValueWithIdentifier)(nil) - -// IdentifierJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of Identifier. This struct is safe to replace or modify but -// should not be done so concurrently. -var IdentifierJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *Identifier) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := IdentifierJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*Identifier)(nil) - -// IdentifierJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of Identifier. This struct is safe to replace or modify but -// should not be done so concurrently. -var IdentifierJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *Identifier) UnmarshalJSON(b []byte) error { - return IdentifierJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*Identifier)(nil) - -// ListRoleAssignmentsRequestJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of ListRoleAssignmentsRequest. This struct is safe to replace or modify but -// should not be done so concurrently. -var ListRoleAssignmentsRequestJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *ListRoleAssignmentsRequest) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := ListRoleAssignmentsRequestJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*ListRoleAssignmentsRequest)(nil) - -// ListRoleAssignmentsRequestJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of ListRoleAssignmentsRequest. This struct is safe to replace or modify but -// should not be done so concurrently. -var ListRoleAssignmentsRequestJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *ListRoleAssignmentsRequest) UnmarshalJSON(b []byte) error { - return ListRoleAssignmentsRequestJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*ListRoleAssignmentsRequest)(nil) - -// ListRoleAssignmentsResponseJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of ListRoleAssignmentsResponse. This struct is safe to replace or modify but -// should not be done so concurrently. -var ListRoleAssignmentsResponseJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *ListRoleAssignmentsResponse) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := ListRoleAssignmentsResponseJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*ListRoleAssignmentsResponse)(nil) - -// ListRoleAssignmentsResponseJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of ListRoleAssignmentsResponse. This struct is safe to replace or modify but -// should not be done so concurrently. -var ListRoleAssignmentsResponseJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *ListRoleAssignmentsResponse) UnmarshalJSON(b []byte) error { - return ListRoleAssignmentsResponseJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*ListRoleAssignmentsResponse)(nil) - -// AssignRoleToUserRequestJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of AssignRoleToUserRequest. This struct is safe to replace or modify but -// should not be done so concurrently. -var AssignRoleToUserRequestJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *AssignRoleToUserRequest) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := AssignRoleToUserRequestJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*AssignRoleToUserRequest)(nil) - -// AssignRoleToUserRequestJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of AssignRoleToUserRequest. This struct is safe to replace or modify but -// should not be done so concurrently. -var AssignRoleToUserRequestJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *AssignRoleToUserRequest) UnmarshalJSON(b []byte) error { - return AssignRoleToUserRequestJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*AssignRoleToUserRequest)(nil) - -// AssignRoleToUserResponseJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of AssignRoleToUserResponse. This struct is safe to replace or modify but -// should not be done so concurrently. -var AssignRoleToUserResponseJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *AssignRoleToUserResponse) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := AssignRoleToUserResponseJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*AssignRoleToUserResponse)(nil) - -// AssignRoleToUserResponseJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of AssignRoleToUserResponse. This struct is safe to replace or modify but -// should not be done so concurrently. -var AssignRoleToUserResponseJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *AssignRoleToUserResponse) UnmarshalJSON(b []byte) error { - return AssignRoleToUserResponseJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*AssignRoleToUserResponse)(nil) - -// RemoveRoleFromUserRequestJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of RemoveRoleFromUserRequest. This struct is safe to replace or modify but -// should not be done so concurrently. -var RemoveRoleFromUserRequestJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *RemoveRoleFromUserRequest) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := RemoveRoleFromUserRequestJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*RemoveRoleFromUserRequest)(nil) - -// RemoveRoleFromUserRequestJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of RemoveRoleFromUserRequest. This struct is safe to replace or modify but -// should not be done so concurrently. -var RemoveRoleFromUserRequestJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *RemoveRoleFromUserRequest) UnmarshalJSON(b []byte) error { - return RemoveRoleFromUserRequestJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*RemoveRoleFromUserRequest)(nil) - -// UserRoleAssignmentJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of UserRoleAssignment. This struct is safe to replace or modify but -// should not be done so concurrently. -var UserRoleAssignmentJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *UserRoleAssignment) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := UserRoleAssignmentJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*UserRoleAssignment)(nil) - -// UserRoleAssignmentJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of UserRoleAssignment. This struct is safe to replace or modify but -// should not be done so concurrently. -var UserRoleAssignmentJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *UserRoleAssignment) UnmarshalJSON(b []byte) error { - return UserRoleAssignmentJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*UserRoleAssignment)(nil) - -// ListPermissionsByResourceRequestJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of ListPermissionsByResourceRequest. This struct is safe to replace or modify but -// should not be done so concurrently. -var ListPermissionsByResourceRequestJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *ListPermissionsByResourceRequest) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := ListPermissionsByResourceRequestJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*ListPermissionsByResourceRequest)(nil) - -// ListPermissionsByResourceRequestJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of ListPermissionsByResourceRequest. This struct is safe to replace or modify but -// should not be done so concurrently. -var ListPermissionsByResourceRequestJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *ListPermissionsByResourceRequest) UnmarshalJSON(b []byte) error { - return ListPermissionsByResourceRequestJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*ListPermissionsByResourceRequest)(nil) - -// ListPermissionsByResourceResponseJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of ListPermissionsByResourceResponse. This struct is safe to replace or modify but -// should not be done so concurrently. -var ListPermissionsByResourceResponseJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *ListPermissionsByResourceResponse) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := ListPermissionsByResourceResponseJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*ListPermissionsByResourceResponse)(nil) - -// ListPermissionsByResourceResponseJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of ListPermissionsByResourceResponse. This struct is safe to replace or modify but -// should not be done so concurrently. -var ListPermissionsByResourceResponseJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *ListPermissionsByResourceResponse) UnmarshalJSON(b []byte) error { - return ListPermissionsByResourceResponseJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*ListPermissionsByResourceResponse)(nil) - -// GetPermissionByIDRequestJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of GetPermissionByIDRequest. This struct is safe to replace or modify but -// should not be done so concurrently. -var GetPermissionByIDRequestJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *GetPermissionByIDRequest) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := GetPermissionByIDRequestJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*GetPermissionByIDRequest)(nil) - -// GetPermissionByIDRequestJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of GetPermissionByIDRequest. This struct is safe to replace or modify but -// should not be done so concurrently. -var GetPermissionByIDRequestJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *GetPermissionByIDRequest) UnmarshalJSON(b []byte) error { - return GetPermissionByIDRequestJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*GetPermissionByIDRequest)(nil) - -// GetPermissionByIDResponseJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of GetPermissionByIDResponse. This struct is safe to replace or modify but -// should not be done so concurrently. -var GetPermissionByIDResponseJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *GetPermissionByIDResponse) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := GetPermissionByIDResponseJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*GetPermissionByIDResponse)(nil) - -// GetPermissionByIDResponseJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of GetPermissionByIDResponse. This struct is safe to replace or modify but -// should not be done so concurrently. -var GetPermissionByIDResponseJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *GetPermissionByIDResponse) UnmarshalJSON(b []byte) error { - return GetPermissionByIDResponseJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*GetPermissionByIDResponse)(nil) - -// ResourceJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of Resource. This struct is safe to replace or modify but -// should not be done so concurrently. -var ResourceJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *Resource) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := ResourceJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*Resource)(nil) - -// ResourceJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of Resource. This struct is safe to replace or modify but -// should not be done so concurrently. -var ResourceJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *Resource) UnmarshalJSON(b []byte) error { - return ResourceJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*Resource)(nil) - -// BundleJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of Bundle. This struct is safe to replace or modify but -// should not be done so concurrently. -var BundleJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *Bundle) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := BundleJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*Bundle)(nil) - -// BundleJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of Bundle. This struct is safe to replace or modify but -// should not be done so concurrently. -var BundleJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *Bundle) UnmarshalJSON(b []byte) error { - return BundleJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*Bundle)(nil) - -// SettingJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of Setting. This struct is safe to replace or modify but -// should not be done so concurrently. -var SettingJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *Setting) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := SettingJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*Setting)(nil) - -// SettingJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of Setting. This struct is safe to replace or modify but -// should not be done so concurrently. -var SettingJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *Setting) UnmarshalJSON(b []byte) error { - return SettingJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*Setting)(nil) - -// IntJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of Int. This struct is safe to replace or modify but -// should not be done so concurrently. -var IntJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *Int) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := IntJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*Int)(nil) - -// IntJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of Int. This struct is safe to replace or modify but -// should not be done so concurrently. -var IntJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *Int) UnmarshalJSON(b []byte) error { - return IntJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*Int)(nil) - -// StringJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of String. This struct is safe to replace or modify but -// should not be done so concurrently. -var StringJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *String) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := StringJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*String)(nil) - -// StringJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of String. This struct is safe to replace or modify but -// should not be done so concurrently. -var StringJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *String) UnmarshalJSON(b []byte) error { - return StringJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*String)(nil) - -// BoolJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of Bool. This struct is safe to replace or modify but -// should not be done so concurrently. -var BoolJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *Bool) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := BoolJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*Bool)(nil) - -// BoolJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of Bool. This struct is safe to replace or modify but -// should not be done so concurrently. -var BoolJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *Bool) UnmarshalJSON(b []byte) error { - return BoolJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*Bool)(nil) - -// SingleChoiceListJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of SingleChoiceList. This struct is safe to replace or modify but -// should not be done so concurrently. -var SingleChoiceListJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *SingleChoiceList) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := SingleChoiceListJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*SingleChoiceList)(nil) - -// SingleChoiceListJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of SingleChoiceList. This struct is safe to replace or modify but -// should not be done so concurrently. -var SingleChoiceListJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *SingleChoiceList) UnmarshalJSON(b []byte) error { - return SingleChoiceListJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*SingleChoiceList)(nil) - -// MultiChoiceListJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of MultiChoiceList. This struct is safe to replace or modify but -// should not be done so concurrently. -var MultiChoiceListJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *MultiChoiceList) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := MultiChoiceListJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*MultiChoiceList)(nil) - -// MultiChoiceListJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of MultiChoiceList. This struct is safe to replace or modify but -// should not be done so concurrently. -var MultiChoiceListJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *MultiChoiceList) UnmarshalJSON(b []byte) error { - return MultiChoiceListJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*MultiChoiceList)(nil) - -// ListOptionJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of ListOption. This struct is safe to replace or modify but -// should not be done so concurrently. -var ListOptionJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *ListOption) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := ListOptionJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*ListOption)(nil) - -// ListOptionJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of ListOption. This struct is safe to replace or modify but -// should not be done so concurrently. -var ListOptionJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *ListOption) UnmarshalJSON(b []byte) error { - return ListOptionJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*ListOption)(nil) - -// PermissionJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of Permission. This struct is safe to replace or modify but -// should not be done so concurrently. -var PermissionJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *Permission) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := PermissionJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*Permission)(nil) - -// PermissionJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of Permission. This struct is safe to replace or modify but -// should not be done so concurrently. -var PermissionJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *Permission) UnmarshalJSON(b []byte) error { - return PermissionJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*Permission)(nil) - -// ValueJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of Value. This struct is safe to replace or modify but -// should not be done so concurrently. -var ValueJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *Value) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := ValueJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*Value)(nil) - -// ValueJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of Value. This struct is safe to replace or modify but -// should not be done so concurrently. -var ValueJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *Value) UnmarshalJSON(b []byte) error { - return ValueJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*Value)(nil) - -// ListValueJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of ListValue. This struct is safe to replace or modify but -// should not be done so concurrently. -var ListValueJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *ListValue) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := ListValueJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*ListValue)(nil) - -// ListValueJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of ListValue. This struct is safe to replace or modify but -// should not be done so concurrently. -var ListValueJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *ListValue) UnmarshalJSON(b []byte) error { - return ListValueJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*ListValue)(nil) - -// ListOptionValueJSONMarshaler describes the default jsonpb.Marshaler used by all -// instances of ListOptionValue. This struct is safe to replace or modify but -// should not be done so concurrently. -var ListOptionValueJSONMarshaler = new(jsonpb.Marshaler) - -// MarshalJSON satisfies the encoding/json Marshaler interface. This method -// uses the more correct jsonpb package to correctly marshal the message. -func (m *ListOptionValue) MarshalJSON() ([]byte, error) { - if m == nil { - return json.Marshal(nil) - } - - buf := &bytes.Buffer{} - - if err := ListOptionValueJSONMarshaler.Marshal(buf, m); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -var _ json.Marshaler = (*ListOptionValue)(nil) - -// ListOptionValueJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all -// instances of ListOptionValue. This struct is safe to replace or modify but -// should not be done so concurrently. -var ListOptionValueJSONUnmarshaler = new(jsonpb.Unmarshaler) - -// UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method -// uses the more correct jsonpb package to correctly unmarshal the message. -func (m *ListOptionValue) UnmarshalJSON(b []byte) error { - return ListOptionValueJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) -} - -var _ json.Unmarshaler = (*ListOptionValue)(nil) diff --git a/settings/pkg/proto/v0/settings.swagger.json b/settings/pkg/proto/v0/settings.swagger.json deleted file mode 100644 index 4d2db4d52..000000000 --- a/settings/pkg/proto/v0/settings.swagger.json +++ /dev/null @@ -1,1114 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "ownCloud Infinite Scale settings", - "version": "1.0.0", - "contact": { - "name": "ownCloud GmbH", - "url": "https://github.com/owncloud/ocis", - "email": "support@owncloud.com" - }, - "license": { - "name": "Apache-2.0", - "url": "https://github.com/owncloud/ocis/blob/master/LICENSE" - } - }, - "tags": [ - { - "name": "BundleService" - }, - { - "name": "ValueService" - }, - { - "name": "RoleService" - }, - { - "name": "PermissionService" - } - ], - "schemes": [ - "http", - "https" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/api/v0/settings/assignments-add": { - "post": { - "operationId": "RoleService_AssignRoleToUser", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v0AssignRoleToUserResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v0AssignRoleToUserRequest" - } - } - ], - "tags": [ - "RoleService" - ] - } - }, - "/api/v0/settings/assignments-list": { - "post": { - "operationId": "RoleService_ListRoleAssignments", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v0ListRoleAssignmentsResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v0ListRoleAssignmentsRequest" - } - } - ], - "tags": [ - "RoleService" - ] - } - }, - "/api/v0/settings/assignments-remove": { - "post": { - "operationId": "RoleService_RemoveRoleFromUser", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "properties": {} - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v0RemoveRoleFromUserRequest" - } - } - ], - "tags": [ - "RoleService" - ] - } - }, - "/api/v0/settings/bundle-get": { - "post": { - "operationId": "BundleService_GetBundle", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v0GetBundleResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v0GetBundleRequest" - } - } - ], - "tags": [ - "BundleService" - ] - } - }, - "/api/v0/settings/bundle-save": { - "post": { - "operationId": "BundleService_SaveBundle", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v0SaveBundleResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v0SaveBundleRequest" - } - } - ], - "tags": [ - "BundleService" - ] - } - }, - "/api/v0/settings/bundles-add-setting": { - "post": { - "operationId": "BundleService_AddSettingToBundle", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v0AddSettingToBundleResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v0AddSettingToBundleRequest" - } - } - ], - "tags": [ - "BundleService" - ] - } - }, - "/api/v0/settings/bundles-list": { - "post": { - "operationId": "BundleService_ListBundles", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v0ListBundlesResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v0ListBundlesRequest" - } - } - ], - "tags": [ - "BundleService" - ] - } - }, - "/api/v0/settings/bundles-remove-setting": { - "post": { - "operationId": "BundleService_RemoveSettingFromBundle", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "properties": {} - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v0RemoveSettingFromBundleRequest" - } - } - ], - "tags": [ - "BundleService" - ] - } - }, - "/api/v0/settings/permissions-get-by-id": { - "post": { - "operationId": "PermissionService_GetPermissionByID", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v0GetPermissionByIDResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v0GetPermissionByIDRequest" - } - } - ], - "tags": [ - "PermissionService" - ] - } - }, - "/api/v0/settings/permissions-list-by-resource": { - "post": { - "operationId": "PermissionService_ListPermissionsByResource", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v0ListPermissionsByResourceResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v0ListPermissionsByResourceRequest" - } - } - ], - "tags": [ - "PermissionService" - ] - } - }, - "/api/v0/settings/roles-list": { - "post": { - "operationId": "RoleService_ListRoles", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v0ListBundlesResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v0ListBundlesRequest" - } - } - ], - "tags": [ - "RoleService" - ] - } - }, - "/api/v0/settings/values-get": { - "post": { - "operationId": "ValueService_GetValue", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v0GetValueResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v0GetValueRequest" - } - } - ], - "tags": [ - "ValueService" - ] - } - }, - "/api/v0/settings/values-get-by-unique-identifiers": { - "post": { - "operationId": "ValueService_GetValueByUniqueIdentifiers", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v0GetValueResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v0GetValueByUniqueIdentifiersRequest" - } - } - ], - "tags": [ - "ValueService" - ] - } - }, - "/api/v0/settings/values-list": { - "post": { - "operationId": "ValueService_ListValues", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v0ListValuesResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v0ListValuesRequest" - } - } - ], - "tags": [ - "ValueService" - ] - } - }, - "/api/v0/settings/values-save": { - "post": { - "operationId": "ValueService_SaveValue", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v0SaveValueResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v0SaveValueRequest" - } - } - ], - "tags": [ - "ValueService" - ] - } - } - }, - "definitions": { - "PermissionConstraint": { - "type": "string", - "enum": [ - "CONSTRAINT_UNKNOWN", - "CONSTRAINT_OWN", - "CONSTRAINT_SHARED", - "CONSTRAINT_ALL" - ], - "default": "CONSTRAINT_UNKNOWN" - }, - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "settingsv0ListValue": { - "type": "object", - "properties": { - "values": { - "type": "array", - "items": { - "$ref": "#/definitions/v0ListOptionValue" - } - } - } - }, - "settingsv0Value": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "id is the id of the Value. It is generated on saving it." - }, - "bundleId": { - "type": "string" - }, - "settingId": { - "type": "string", - "description": "setting_id is the id of the setting from within its bundle." - }, - "accountUuid": { - "type": "string" - }, - "resource": { - "$ref": "#/definitions/v0Resource" - }, - "boolValue": { - "type": "boolean" - }, - "intValue": { - "type": "string", - "format": "int64" - }, - "stringValue": { - "type": "string" - }, - "listValue": { - "$ref": "#/definitions/settingsv0ListValue" - } - } - }, - "v0AddSettingToBundleRequest": { - "type": "object", - "properties": { - "bundleId": { - "type": "string" - }, - "setting": { - "$ref": "#/definitions/v0Setting" - } - } - }, - "v0AddSettingToBundleResponse": { - "type": "object", - "properties": { - "setting": { - "$ref": "#/definitions/v0Setting" - } - } - }, - "v0AssignRoleToUserRequest": { - "type": "object", - "properties": { - "accountUuid": { - "type": "string" - }, - "roleId": { - "type": "string", - "title": "the role_id is a bundle_id internally" - } - } - }, - "v0AssignRoleToUserResponse": { - "type": "object", - "properties": { - "assignment": { - "$ref": "#/definitions/v0UserRoleAssignment" - } - } - }, - "v0Bool": { - "type": "object", - "properties": { - "default": { - "type": "boolean" - }, - "label": { - "type": "string" - } - } - }, - "v0Bundle": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/v0BundleType" - }, - "extension": { - "type": "string" - }, - "displayName": { - "type": "string" - }, - "settings": { - "type": "array", - "items": { - "$ref": "#/definitions/v0Setting" - } - }, - "resource": { - "$ref": "#/definitions/v0Resource" - } - } - }, - "v0BundleType": { - "type": "string", - "enum": [ - "TYPE_UNKNOWN", - "TYPE_DEFAULT", - "TYPE_ROLE" - ], - "default": "TYPE_UNKNOWN" - }, - "v0GetBundleRequest": { - "type": "object", - "properties": { - "bundleId": { - "type": "string" - } - } - }, - "v0GetBundleResponse": { - "type": "object", - "properties": { - "bundle": { - "$ref": "#/definitions/v0Bundle" - } - } - }, - "v0GetPermissionByIDRequest": { - "type": "object", - "properties": { - "permissionId": { - "type": "string" - } - } - }, - "v0GetPermissionByIDResponse": { - "type": "object", - "properties": { - "permission": { - "$ref": "#/definitions/v0Permission" - } - } - }, - "v0GetValueByUniqueIdentifiersRequest": { - "type": "object", - "properties": { - "accountUuid": { - "type": "string" - }, - "settingId": { - "type": "string" - } - } - }, - "v0GetValueRequest": { - "type": "object", - "properties": { - "id": { - "type": "string" - } - } - }, - "v0GetValueResponse": { - "type": "object", - "properties": { - "value": { - "$ref": "#/definitions/v0ValueWithIdentifier" - } - } - }, - "v0Identifier": { - "type": "object", - "properties": { - "extension": { - "type": "string" - }, - "bundle": { - "type": "string" - }, - "setting": { - "type": "string" - } - } - }, - "v0Int": { - "type": "object", - "properties": { - "default": { - "type": "string", - "format": "int64" - }, - "min": { - "type": "string", - "format": "int64" - }, - "max": { - "type": "string", - "format": "int64" - }, - "step": { - "type": "string", - "format": "int64" - }, - "placeholder": { - "type": "string" - } - } - }, - "v0ListBundlesRequest": { - "type": "object", - "properties": { - "bundleIds": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "v0ListBundlesResponse": { - "type": "object", - "properties": { - "bundles": { - "type": "array", - "items": { - "$ref": "#/definitions/v0Bundle" - } - } - } - }, - "v0ListOption": { - "type": "object", - "properties": { - "value": { - "$ref": "#/definitions/v0ListOptionValue" - }, - "default": { - "type": "boolean" - }, - "displayValue": { - "type": "string" - } - } - }, - "v0ListOptionValue": { - "type": "object", - "properties": { - "stringValue": { - "type": "string" - }, - "intValue": { - "type": "string", - "format": "int64" - } - } - }, - "v0ListPermissionsByResourceRequest": { - "type": "object", - "properties": { - "resource": { - "$ref": "#/definitions/v0Resource" - } - } - }, - "v0ListPermissionsByResourceResponse": { - "type": "object", - "properties": { - "permissions": { - "type": "array", - "items": { - "$ref": "#/definitions/v0Permission" - } - } - } - }, - "v0ListRoleAssignmentsRequest": { - "type": "object", - "properties": { - "accountUuid": { - "type": "string" - } - } - }, - "v0ListRoleAssignmentsResponse": { - "type": "object", - "properties": { - "assignments": { - "type": "array", - "items": { - "$ref": "#/definitions/v0UserRoleAssignment" - } - } - } - }, - "v0ListValuesRequest": { - "type": "object", - "properties": { - "bundleId": { - "type": "string" - }, - "accountUuid": { - "type": "string" - } - } - }, - "v0ListValuesResponse": { - "type": "object", - "properties": { - "values": { - "type": "array", - "items": { - "$ref": "#/definitions/v0ValueWithIdentifier" - } - } - } - }, - "v0MultiChoiceList": { - "type": "object", - "properties": { - "options": { - "type": "array", - "items": { - "$ref": "#/definitions/v0ListOption" - } - } - } - }, - "v0Permission": { - "type": "object", - "properties": { - "operation": { - "$ref": "#/definitions/v0PermissionOperation" - }, - "constraint": { - "$ref": "#/definitions/PermissionConstraint" - } - } - }, - "v0PermissionOperation": { - "type": "string", - "enum": [ - "OPERATION_UNKNOWN", - "OPERATION_CREATE", - "OPERATION_READ", - "OPERATION_UPDATE", - "OPERATION_DELETE", - "OPERATION_WRITE", - "OPERATION_READWRITE" - ], - "default": "OPERATION_UNKNOWN" - }, - "v0RemoveRoleFromUserRequest": { - "type": "object", - "properties": { - "id": { - "type": "string" - } - } - }, - "v0RemoveSettingFromBundleRequest": { - "type": "object", - "properties": { - "bundleId": { - "type": "string" - }, - "settingId": { - "type": "string" - } - } - }, - "v0Resource": { - "type": "object", - "properties": { - "type": { - "$ref": "#/definitions/v0ResourceType" - }, - "id": { - "type": "string" - } - } - }, - "v0ResourceType": { - "type": "string", - "enum": [ - "TYPE_UNKNOWN", - "TYPE_SYSTEM", - "TYPE_FILE", - "TYPE_SHARE", - "TYPE_SETTING", - "TYPE_BUNDLE", - "TYPE_USER", - "TYPE_GROUP" - ], - "default": "TYPE_UNKNOWN" - }, - "v0SaveBundleRequest": { - "type": "object", - "properties": { - "bundle": { - "$ref": "#/definitions/v0Bundle" - } - }, - "title": "---\nrequests and responses for settings bundles\n---" - }, - "v0SaveBundleResponse": { - "type": "object", - "properties": { - "bundle": { - "$ref": "#/definitions/v0Bundle" - } - } - }, - "v0SaveValueRequest": { - "type": "object", - "properties": { - "value": { - "$ref": "#/definitions/settingsv0Value" - } - } - }, - "v0SaveValueResponse": { - "type": "object", - "properties": { - "value": { - "$ref": "#/definitions/v0ValueWithIdentifier" - } - } - }, - "v0Setting": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "displayName": { - "type": "string" - }, - "description": { - "type": "string" - }, - "intValue": { - "$ref": "#/definitions/v0Int" - }, - "stringValue": { - "$ref": "#/definitions/v0String" - }, - "boolValue": { - "$ref": "#/definitions/v0Bool" - }, - "singleChoiceValue": { - "$ref": "#/definitions/v0SingleChoiceList" - }, - "multiChoiceValue": { - "$ref": "#/definitions/v0MultiChoiceList" - }, - "permissionValue": { - "$ref": "#/definitions/v0Permission" - }, - "resource": { - "$ref": "#/definitions/v0Resource" - } - } - }, - "v0SingleChoiceList": { - "type": "object", - "properties": { - "options": { - "type": "array", - "items": { - "$ref": "#/definitions/v0ListOption" - } - } - } - }, - "v0String": { - "type": "object", - "properties": { - "default": { - "type": "string" - }, - "required": { - "type": "boolean" - }, - "minLength": { - "type": "integer", - "format": "int32" - }, - "maxLength": { - "type": "integer", - "format": "int32" - }, - "placeholder": { - "type": "string" - } - } - }, - "v0UserRoleAssignment": { - "type": "object", - "properties": { - "id": { - "type": "string", - "title": "id is generated upon saving the assignment" - }, - "accountUuid": { - "type": "string" - }, - "roleId": { - "type": "string", - "title": "the role_id is a bundle_id internally" - } - } - }, - "v0ValueWithIdentifier": { - "type": "object", - "properties": { - "identifier": { - "$ref": "#/definitions/v0Identifier" - }, - "value": { - "$ref": "#/definitions/settingsv0Value" - } - } - } - }, - "externalDocs": { - "description": "Developer Manual", - "url": "https://owncloud.dev/extensions/settings/" - } -} diff --git a/settings/pkg/server/grpc/server.go b/settings/pkg/server/grpc/server.go index 2b8fde170..409f44029 100644 --- a/settings/pkg/server/grpc/server.go +++ b/settings/pkg/server/grpc/server.go @@ -6,7 +6,7 @@ import ( permissions "github.com/cs3org/go-cs3apis/cs3/permissions/v1beta1" "github.com/owncloud/ocis/ocis-pkg/service/grpc" "github.com/owncloud/ocis/ocis-pkg/version" - "github.com/owncloud/ocis/settings/pkg/proto/v0" + settingssvc "github.com/owncloud/ocis/protogen/gen/ocis/services/settings/v1" svc "github.com/owncloud/ocis/settings/pkg/service/v0" "go-micro.dev/v4/api" "go-micro.dev/v4/server" @@ -27,16 +27,16 @@ func Server(opts ...Option) grpc.Service { ) handle := svc.NewService(options.Config, options.Logger) - if err := proto.RegisterBundleServiceHandler(service.Server(), handle); err != nil { + if err := settingssvc.RegisterBundleServiceHandler(service.Server(), handle); err != nil { options.Logger.Fatal().Err(err).Msg("could not register Bundle service handler") } - if err := proto.RegisterValueServiceHandler(service.Server(), handle); err != nil { + if err := settingssvc.RegisterValueServiceHandler(service.Server(), handle); err != nil { options.Logger.Fatal().Err(err).Msg("could not register Value service handler") } - if err := proto.RegisterRoleServiceHandler(service.Server(), handle); err != nil { + if err := settingssvc.RegisterRoleServiceHandler(service.Server(), handle); err != nil { options.Logger.Fatal().Err(err).Msg("could not register Role service handler") } - if err := proto.RegisterPermissionServiceHandler(service.Server(), handle); err != nil { + if err := settingssvc.RegisterPermissionServiceHandler(service.Server(), handle); err != nil { options.Logger.Fatal().Err(err).Msg("could not register Permission service handler") } diff --git a/settings/pkg/server/http/server.go b/settings/pkg/server/http/server.go index 29795d78f..1f693334b 100644 --- a/settings/pkg/server/http/server.go +++ b/settings/pkg/server/http/server.go @@ -8,8 +8,8 @@ import ( "github.com/owncloud/ocis/ocis-pkg/middleware" "github.com/owncloud/ocis/ocis-pkg/service/http" "github.com/owncloud/ocis/ocis-pkg/version" + settingssvc "github.com/owncloud/ocis/protogen/gen/ocis/services/settings/v1" "github.com/owncloud/ocis/settings/pkg/assets" - "github.com/owncloud/ocis/settings/pkg/proto/v0" svc "github.com/owncloud/ocis/settings/pkg/service/v0" "go-micro.dev/v4" ) @@ -73,10 +73,10 @@ func Server(opts ...Option) http.Service { )) mux.Route(options.Config.HTTP.Root, func(r chi.Router) { - proto.RegisterBundleServiceWeb(r, handle) - proto.RegisterValueServiceWeb(r, handle) - proto.RegisterRoleServiceWeb(r, handle) - proto.RegisterPermissionServiceWeb(r, handle) + settingssvc.RegisterBundleServiceWeb(r, handle) + settingssvc.RegisterValueServiceWeb(r, handle) + settingssvc.RegisterRoleServiceWeb(r, handle) + settingssvc.RegisterPermissionServiceWeb(r, handle) }) micro.RegisterHandler(service.Server(), mux) diff --git a/settings/pkg/service/v0/permissions.go b/settings/pkg/service/v0/permissions.go index 72bfe282b..4ed01d30d 100644 --- a/settings/pkg/service/v0/permissions.go +++ b/settings/pkg/service/v0/permissions.go @@ -1,12 +1,14 @@ package svc -import "github.com/owncloud/ocis/settings/pkg/proto/v0" +import ( + settingsmsg "github.com/owncloud/ocis/protogen/gen/ocis/messages/settings/v1" +) func (g Service) hasPermission( roleIDs []string, - resource *proto.Resource, - operations []proto.Permission_Operation, - constraint proto.Permission_Constraint, + resource *settingsmsg.Resource, + operations []settingsmsg.Permission_Operation, + constraint settingsmsg.Permission_Constraint, ) bool { permissions, err := g.manager.ListPermissionsByResource(resource, roleIDs) if err != nil { @@ -21,8 +23,8 @@ func (g Service) hasPermission( } // filterPermissionsByOperations returns the subset of the given permissions, where at least one of the given operations is fulfilled. -func getFilteredPermissionsByOperations(permissions []*proto.Permission, operations []proto.Permission_Operation) []*proto.Permission { - var filteredPermissions []*proto.Permission +func getFilteredPermissionsByOperations(permissions []*settingsmsg.Permission, operations []settingsmsg.Permission_Operation) []*settingsmsg.Permission { + var filteredPermissions []*settingsmsg.Permission for _, permission := range permissions { if isAnyOperationFulfilled(permission, operations) { filteredPermissions = append(filteredPermissions, permission) @@ -32,7 +34,7 @@ func getFilteredPermissionsByOperations(permissions []*proto.Permission, operati } // isAnyOperationFulfilled checks if the permissions is about any of the operations -func isAnyOperationFulfilled(permission *proto.Permission, operations []proto.Permission_Operation) bool { +func isAnyOperationFulfilled(permission *settingsmsg.Permission, operations []settingsmsg.Permission_Operation) bool { for _, operation := range operations { if operation == permission.Operation { return true @@ -43,13 +45,13 @@ func isAnyOperationFulfilled(permission *proto.Permission, operations []proto.Pe // isConstraintFulfilled checks if one of the permissions has the same or a parent of the constraint. // this is only a comparison on ENUM level. More sophisticated checks cannot happen here... -func isConstraintFulfilled(permissions []*proto.Permission, constraint proto.Permission_Constraint) bool { +func isConstraintFulfilled(permissions []*settingsmsg.Permission, constraint settingsmsg.Permission_Constraint) bool { for _, permission := range permissions { // comparing enum by order is not a feasible solution, because `SHARED` is not a superset of `OWN`. - if permission.Constraint == proto.Permission_CONSTRAINT_ALL { + if permission.Constraint == settingsmsg.Permission_CONSTRAINT_ALL { return true } - if permission.Constraint != proto.Permission_CONSTRAINT_UNKNOWN && permission.Constraint == constraint { + if permission.Constraint != settingsmsg.Permission_CONSTRAINT_UNKNOWN && permission.Constraint == constraint { return true } } diff --git a/settings/pkg/service/v0/service.go b/settings/pkg/service/v0/service.go index 97f6f222c..4590b2ce9 100644 --- a/settings/pkg/service/v0/service.go +++ b/settings/pkg/service/v0/service.go @@ -11,8 +11,9 @@ import ( "github.com/owncloud/ocis/ocis-pkg/log" "github.com/owncloud/ocis/ocis-pkg/middleware" "github.com/owncloud/ocis/ocis-pkg/roles" + settingsmsg "github.com/owncloud/ocis/protogen/gen/ocis/messages/settings/v1" + settingssvc "github.com/owncloud/ocis/protogen/gen/ocis/services/settings/v1" "github.com/owncloud/ocis/settings/pkg/config" - "github.com/owncloud/ocis/settings/pkg/proto/v0" "github.com/owncloud/ocis/settings/pkg/settings" store "github.com/owncloud/ocis/settings/pkg/store/filesystem" merrors "go-micro.dev/v4/errors" @@ -125,7 +126,7 @@ func (g Service) RegisterDefaultRoles() { // TODO: check permissions on every request // SaveBundle implements the BundleServiceHandler interface -func (g Service) SaveBundle(ctx context.Context, req *proto.SaveBundleRequest, res *proto.SaveBundleResponse) error { +func (g Service) SaveBundle(ctx context.Context, req *settingssvc.SaveBundleRequest, res *settingssvc.SaveBundleResponse) error { cleanUpResource(ctx, req.Bundle.Resource) if err := g.checkStaticPermissionsByBundleType(ctx, req.Bundle.Type); err != nil { return err @@ -143,7 +144,7 @@ func (g Service) SaveBundle(ctx context.Context, req *proto.SaveBundleRequest, r } // GetBundle implements the BundleServiceHandler interface -func (g Service) GetBundle(ctx context.Context, req *proto.GetBundleRequest, res *proto.GetBundleResponse) error { +func (g Service) GetBundle(ctx context.Context, req *settingssvc.GetBundleRequest, res *settingssvc.GetBundleResponse) error { if validationError := validateGetBundle(req); validationError != nil { return merrors.BadRequest(g.id, "%s", validationError) } @@ -161,19 +162,19 @@ func (g Service) GetBundle(ctx context.Context, req *proto.GetBundleRequest, res } // ListBundles implements the BundleServiceHandler interface -func (g Service) ListBundles(ctx context.Context, req *proto.ListBundlesRequest, res *proto.ListBundlesResponse) error { +func (g Service) ListBundles(ctx context.Context, req *settingssvc.ListBundlesRequest, res *settingssvc.ListBundlesResponse) error { // fetch all bundles if validationError := validateListBundles(req); validationError != nil { return merrors.BadRequest(g.id, "%s", validationError) } - bundles, err := g.manager.ListBundles(proto.Bundle_TYPE_DEFAULT, req.BundleIds) + bundles, err := g.manager.ListBundles(settingsmsg.Bundle_TYPE_DEFAULT, req.BundleIds) if err != nil { return merrors.NotFound(g.id, "%s", err) } roleIDs := g.getRoleIDs(ctx) // filter settings in bundles that are allowed according to roles - var filteredBundles []*proto.Bundle + var filteredBundles []*settingsmsg.Bundle for _, bundle := range bundles { filteredBundle := g.getFilteredBundle(roleIDs, bundle) if len(filteredBundle.Settings) > 0 { @@ -185,33 +186,33 @@ func (g Service) ListBundles(ctx context.Context, req *proto.ListBundlesRequest, return nil } -func (g Service) getFilteredBundle(roleIDs []string, bundle *proto.Bundle) *proto.Bundle { +func (g Service) getFilteredBundle(roleIDs []string, bundle *settingsmsg.Bundle) *settingsmsg.Bundle { // check if full bundle is whitelisted - bundleResource := &proto.Resource{ - Type: proto.Resource_TYPE_BUNDLE, + bundleResource := &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_BUNDLE, Id: bundle.Id, } if g.hasPermission( roleIDs, bundleResource, - []proto.Permission_Operation{proto.Permission_OPERATION_READ, proto.Permission_OPERATION_READWRITE}, - proto.Permission_CONSTRAINT_OWN, + []settingsmsg.Permission_Operation{settingsmsg.Permission_OPERATION_READ, settingsmsg.Permission_OPERATION_READWRITE}, + settingsmsg.Permission_CONSTRAINT_OWN, ) { return bundle } // filter settings based on permissions - var filteredSettings []*proto.Setting + var filteredSettings []*settingsmsg.Setting for _, setting := range bundle.Settings { - settingResource := &proto.Resource{ - Type: proto.Resource_TYPE_SETTING, + settingResource := &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_SETTING, Id: setting.Id, } if g.hasPermission( roleIDs, settingResource, - []proto.Permission_Operation{proto.Permission_OPERATION_READ, proto.Permission_OPERATION_READWRITE}, - proto.Permission_CONSTRAINT_OWN, + []settingsmsg.Permission_Operation{settingsmsg.Permission_OPERATION_READ, settingsmsg.Permission_OPERATION_READWRITE}, + settingsmsg.Permission_CONSTRAINT_OWN, ) { filteredSettings = append(filteredSettings, setting) } @@ -221,7 +222,7 @@ func (g Service) getFilteredBundle(roleIDs []string, bundle *proto.Bundle) *prot } // AddSettingToBundle implements the BundleServiceHandler interface -func (g Service) AddSettingToBundle(ctx context.Context, req *proto.AddSettingToBundleRequest, res *proto.AddSettingToBundleResponse) error { +func (g Service) AddSettingToBundle(ctx context.Context, req *settingssvc.AddSettingToBundleRequest, res *settingssvc.AddSettingToBundleResponse) error { cleanUpResource(ctx, req.Setting.Resource) if err := g.checkStaticPermissionsByBundleID(ctx, req.BundleId); err != nil { return err @@ -239,7 +240,7 @@ func (g Service) AddSettingToBundle(ctx context.Context, req *proto.AddSettingTo } // RemoveSettingFromBundle implements the BundleServiceHandler interface -func (g Service) RemoveSettingFromBundle(ctx context.Context, req *proto.RemoveSettingFromBundleRequest, _ *emptypb.Empty) error { +func (g Service) RemoveSettingFromBundle(ctx context.Context, req *settingssvc.RemoveSettingFromBundleRequest, _ *emptypb.Empty) error { if err := g.checkStaticPermissionsByBundleID(ctx, req.BundleId); err != nil { return err } @@ -255,7 +256,7 @@ func (g Service) RemoveSettingFromBundle(ctx context.Context, req *proto.RemoveS } // SaveValue implements the ValueServiceHandler interface -func (g Service) SaveValue(ctx context.Context, req *proto.SaveValueRequest, res *proto.SaveValueResponse) error { +func (g Service) SaveValue(ctx context.Context, req *settingssvc.SaveValueRequest, res *settingssvc.SaveValueResponse) error { req.Value.AccountUuid = getValidatedAccountUUID(ctx, req.Value.AccountUuid) cleanUpResource(ctx, req.Value.Resource) // TODO: we need to check, if the authenticated user has permission to write the value for the specified resource (e.g. global, file with id xy, ...) @@ -275,7 +276,7 @@ func (g Service) SaveValue(ctx context.Context, req *proto.SaveValueRequest, res } // GetValue implements the ValueServiceHandler interface -func (g Service) GetValue(ctx context.Context, req *proto.GetValueRequest, res *proto.GetValueResponse) error { +func (g Service) GetValue(ctx context.Context, req *settingssvc.GetValueRequest, res *settingssvc.GetValueResponse) error { if validationError := validateGetValue(req); validationError != nil { return merrors.BadRequest(g.id, "%s", validationError) } @@ -292,7 +293,7 @@ func (g Service) GetValue(ctx context.Context, req *proto.GetValueRequest, res * } // GetValueByUniqueIdentifiers implements the ValueService interface -func (g Service) GetValueByUniqueIdentifiers(ctx context.Context, req *proto.GetValueByUniqueIdentifiersRequest, res *proto.GetValueResponse) error { +func (g Service) GetValueByUniqueIdentifiers(ctx context.Context, req *settingssvc.GetValueByUniqueIdentifiersRequest, res *settingssvc.GetValueResponse) error { if validationError := validateGetValueByUniqueIdentifiers(req); validationError != nil { return merrors.BadRequest(g.id, "%s", validationError) } @@ -313,7 +314,7 @@ func (g Service) GetValueByUniqueIdentifiers(ctx context.Context, req *proto.Get } // ListValues implements the ValueServiceHandler interface -func (g Service) ListValues(ctx context.Context, req *proto.ListValuesRequest, res *proto.ListValuesResponse) error { +func (g Service) ListValues(ctx context.Context, req *settingssvc.ListValuesRequest, res *settingssvc.ListValuesResponse) error { req.AccountUuid = getValidatedAccountUUID(ctx, req.AccountUuid) if validationError := validateListValues(req); validationError != nil { return merrors.BadRequest(g.id, "%s", validationError) @@ -322,7 +323,7 @@ func (g Service) ListValues(ctx context.Context, req *proto.ListValuesRequest, r if err != nil { return merrors.NotFound(g.id, "%s", err) } - var result []*proto.ValueWithIdentifier + var result []*settingsmsg.ValueWithIdentifier for _, value := range r { valueWithIdentifier, err := g.getValueWithIdentifier(value) if err == nil { @@ -334,12 +335,12 @@ func (g Service) ListValues(ctx context.Context, req *proto.ListValuesRequest, r } // ListRoles implements the RoleServiceHandler interface -func (g Service) ListRoles(c context.Context, req *proto.ListBundlesRequest, res *proto.ListBundlesResponse) error { +func (g Service) ListRoles(c context.Context, req *settingssvc.ListBundlesRequest, res *settingssvc.ListBundlesResponse) error { //accountUUID := getValidatedAccountUUID(c, "me") if validationError := validateListRoles(req); validationError != nil { return merrors.BadRequest(g.id, "%s", validationError) } - r, err := g.manager.ListBundles(proto.Bundle_TYPE_ROLE, req.BundleIds) + r, err := g.manager.ListBundles(settingsmsg.Bundle_TYPE_ROLE, req.BundleIds) if err != nil { return merrors.NotFound(g.id, "%s", err) } @@ -349,7 +350,7 @@ func (g Service) ListRoles(c context.Context, req *proto.ListBundlesRequest, res } // ListRoleAssignments implements the RoleServiceHandler interface -func (g Service) ListRoleAssignments(ctx context.Context, req *proto.ListRoleAssignmentsRequest, res *proto.ListRoleAssignmentsResponse) error { +func (g Service) ListRoleAssignments(ctx context.Context, req *settingssvc.ListRoleAssignmentsRequest, res *settingssvc.ListRoleAssignmentsResponse) error { req.AccountUuid = getValidatedAccountUUID(ctx, req.AccountUuid) if validationError := validateListRoleAssignments(req); validationError != nil { return merrors.BadRequest(g.id, "%s", validationError) @@ -363,8 +364,8 @@ func (g Service) ListRoleAssignments(ctx context.Context, req *proto.ListRoleAss } // AssignRoleToUser implements the RoleServiceHandler interface -func (g Service) AssignRoleToUser(ctx context.Context, req *proto.AssignRoleToUserRequest, res *proto.AssignRoleToUserResponse) error { - if err := g.checkStaticPermissionsByBundleType(ctx, proto.Bundle_TYPE_ROLE); err != nil { +func (g Service) AssignRoleToUser(ctx context.Context, req *settingssvc.AssignRoleToUserRequest, res *settingssvc.AssignRoleToUserResponse) error { + if err := g.checkStaticPermissionsByBundleType(ctx, settingsmsg.Bundle_TYPE_ROLE); err != nil { return err } @@ -381,8 +382,8 @@ func (g Service) AssignRoleToUser(ctx context.Context, req *proto.AssignRoleToUs } // RemoveRoleFromUser implements the RoleServiceHandler interface -func (g Service) RemoveRoleFromUser(ctx context.Context, req *proto.RemoveRoleFromUserRequest, _ *emptypb.Empty) error { - if err := g.checkStaticPermissionsByBundleType(ctx, proto.Bundle_TYPE_ROLE); err != nil { +func (g Service) RemoveRoleFromUser(ctx context.Context, req *settingssvc.RemoveRoleFromUserRequest, _ *emptypb.Empty) error { + if err := g.checkStaticPermissionsByBundleType(ctx, settingsmsg.Bundle_TYPE_ROLE); err != nil { return err } @@ -396,7 +397,7 @@ func (g Service) RemoveRoleFromUser(ctx context.Context, req *proto.RemoveRoleFr } // ListPermissionsByResource implements the PermissionServiceHandler interface -func (g Service) ListPermissionsByResource(ctx context.Context, req *proto.ListPermissionsByResourceRequest, res *proto.ListPermissionsByResourceResponse) error { +func (g Service) ListPermissionsByResource(ctx context.Context, req *settingssvc.ListPermissionsByResourceRequest, res *settingssvc.ListPermissionsByResourceResponse) error { if validationError := validateListPermissionsByResource(req); validationError != nil { return merrors.BadRequest(g.id, "%s", validationError) } @@ -409,7 +410,7 @@ func (g Service) ListPermissionsByResource(ctx context.Context, req *proto.ListP } // GetPermissionByID implements the PermissionServiceHandler interface -func (g Service) GetPermissionByID(ctx context.Context, req *proto.GetPermissionByIDRequest, res *proto.GetPermissionByIDResponse) error { +func (g Service) GetPermissionByID(ctx context.Context, req *settingssvc.GetPermissionByIDRequest, res *settingssvc.GetPermissionByIDResponse) error { if validationError := validateGetPermissionByID(req); validationError != nil { return merrors.BadRequest(g.id, "%s", validationError) } @@ -425,8 +426,8 @@ func (g Service) GetPermissionByID(ctx context.Context, req *proto.GetPermission } // cleanUpResource makes sure that the account uuid of the authenticated user is injected if needed. -func cleanUpResource(ctx context.Context, resource *proto.Resource) { - if resource != nil && resource.Type == proto.Resource_TYPE_USER { +func cleanUpResource(ctx context.Context, resource *settingsmsg.Resource) { + if resource != nil && resource.Type == settingsmsg.Resource_TYPE_USER { resource.Id = getValidatedAccountUUID(ctx, resource.Id) } } @@ -454,7 +455,7 @@ func (g Service) getRoleIDs(ctx context.Context) []string { return []string{} } -func (g Service) getValueWithIdentifier(value *proto.Value) (*proto.ValueWithIdentifier, error) { +func (g Service) getValueWithIdentifier(value *settingsmsg.Value) (*settingsmsg.ValueWithIdentifier, error) { bundle, err := g.manager.ReadBundle(value.BundleId) if err != nil { return nil, err @@ -463,8 +464,8 @@ func (g Service) getValueWithIdentifier(value *proto.Value) (*proto.ValueWithIde if err != nil { return nil, err } - return &proto.ValueWithIdentifier{ - Identifier: &proto.Identifier{ + return &settingsmsg.ValueWithIdentifier{ + Identifier: &settingsmsg.Identifier{ Extension: bundle.Extension, Bundle: bundle.Name, Setting: setting.Name, @@ -499,8 +500,8 @@ func (g Service) checkStaticPermissionsByBundleID(ctx context.Context, bundleID return g.checkStaticPermissionsByBundleType(ctx, bundle.Type) } -func (g Service) checkStaticPermissionsByBundleType(ctx context.Context, bundleType proto.Bundle_Type) error { - if bundleType == proto.Bundle_TYPE_ROLE { +func (g Service) checkStaticPermissionsByBundleType(ctx context.Context, bundleType settingsmsg.Bundle_Type) error { + if bundleType == settingsmsg.Bundle_TYPE_ROLE { if !g.hasStaticPermission(ctx, RoleManagementPermissionID) { return merrors.Forbidden(g.id, "user has no role management permission") } diff --git a/settings/pkg/service/v0/settings.go b/settings/pkg/service/v0/settings.go index 38bae76e9..902dcd9a3 100644 --- a/settings/pkg/service/v0/settings.go +++ b/settings/pkg/service/v0/settings.go @@ -1,7 +1,8 @@ package svc import ( - settings "github.com/owncloud/ocis/settings/pkg/proto/v0" + settingsmsg "github.com/owncloud/ocis/protogen/gen/ocis/messages/settings/v1" + settingssvc "github.com/owncloud/ocis/protogen/gen/ocis/services/settings/v1" ) const ( @@ -56,8 +57,8 @@ const ( ) // generateBundlesDefaultRoles bootstraps the default roles. -func generateBundlesDefaultRoles() []*settings.Bundle { - return []*settings.Bundle{ +func generateBundlesDefaultRoles() []*settingsmsg.Bundle { + return []*settingsmsg.Bundle{ generateBundleAdminRole(), generateBundleUserRole(), generateBundleGuestRole(), @@ -65,70 +66,70 @@ func generateBundlesDefaultRoles() []*settings.Bundle { } } -func generateBundleAdminRole() *settings.Bundle { - return &settings.Bundle{ +func generateBundleAdminRole() *settingsmsg.Bundle { + return &settingsmsg.Bundle{ Id: BundleUUIDRoleAdmin, Name: "admin", - Type: settings.Bundle_TYPE_ROLE, + Type: settingsmsg.Bundle_TYPE_ROLE, Extension: "ocis-roles", DisplayName: "Admin", - Resource: &settings.Resource{ - Type: settings.Resource_TYPE_SYSTEM, + Resource: &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_SYSTEM, }, - Settings: []*settings.Setting{}, + Settings: []*settingsmsg.Setting{}, } } -func generateBundleUserRole() *settings.Bundle { - return &settings.Bundle{ +func generateBundleUserRole() *settingsmsg.Bundle { + return &settingsmsg.Bundle{ Id: BundleUUIDRoleUser, Name: "user", - Type: settings.Bundle_TYPE_ROLE, + Type: settingsmsg.Bundle_TYPE_ROLE, Extension: "ocis-roles", DisplayName: "User", - Resource: &settings.Resource{ - Type: settings.Resource_TYPE_SYSTEM, + Resource: &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_SYSTEM, }, - Settings: []*settings.Setting{}, + Settings: []*settingsmsg.Setting{}, } } -func generateBundleGuestRole() *settings.Bundle { - return &settings.Bundle{ +func generateBundleGuestRole() *settingsmsg.Bundle { + return &settingsmsg.Bundle{ Id: BundleUUIDRoleGuest, Name: "guest", - Type: settings.Bundle_TYPE_ROLE, + Type: settingsmsg.Bundle_TYPE_ROLE, Extension: "ocis-roles", DisplayName: "Guest", - Resource: &settings.Resource{ - Type: settings.Resource_TYPE_SYSTEM, + Resource: &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_SYSTEM, }, - Settings: []*settings.Setting{}, + Settings: []*settingsmsg.Setting{}, } } -var languageSetting = settings.Setting_SingleChoiceValue{ - SingleChoiceValue: &settings.SingleChoiceList{ - Options: []*settings.ListOption{ +var languageSetting = settingsmsg.Setting_SingleChoiceValue{ + SingleChoiceValue: &settingsmsg.SingleChoiceList{ + Options: []*settingsmsg.ListOption{ { - Value: &settings.ListOptionValue{ - Option: &settings.ListOptionValue_StringValue{ + Value: &settingsmsg.ListOptionValue{ + Option: &settingsmsg.ListOptionValue_StringValue{ StringValue: "cs", }, }, DisplayValue: "Czech", }, { - Value: &settings.ListOptionValue{ - Option: &settings.ListOptionValue_StringValue{ + Value: &settingsmsg.ListOptionValue{ + Option: &settingsmsg.ListOptionValue_StringValue{ StringValue: "de", }, }, DisplayValue: "Deutsch", }, { - Value: &settings.ListOptionValue{ - Option: &settings.ListOptionValue_StringValue{ + Value: &settingsmsg.ListOptionValue{ + Option: &settingsmsg.ListOptionValue_StringValue{ StringValue: "en", }, }, @@ -136,32 +137,32 @@ var languageSetting = settings.Setting_SingleChoiceValue{ Default: true, }, { - Value: &settings.ListOptionValue{ - Option: &settings.ListOptionValue_StringValue{ + Value: &settingsmsg.ListOptionValue{ + Option: &settingsmsg.ListOptionValue_StringValue{ StringValue: "es", }, }, DisplayValue: "Español", }, { - Value: &settings.ListOptionValue{ - Option: &settings.ListOptionValue_StringValue{ + Value: &settingsmsg.ListOptionValue{ + Option: &settingsmsg.ListOptionValue_StringValue{ StringValue: "fr", }, }, DisplayValue: "Français", }, { - Value: &settings.ListOptionValue{ - Option: &settings.ListOptionValue_StringValue{ + Value: &settingsmsg.ListOptionValue{ + Option: &settingsmsg.ListOptionValue_StringValue{ StringValue: "gl", }, }, DisplayValue: "Galego", }, { - Value: &settings.ListOptionValue{ - Option: &settings.ListOptionValue_StringValue{ + Value: &settingsmsg.ListOptionValue{ + Option: &settingsmsg.ListOptionValue_StringValue{ StringValue: "it", }, }, @@ -171,24 +172,24 @@ var languageSetting = settings.Setting_SingleChoiceValue{ }, } -func generateBundleProfileRequest() *settings.Bundle { - return &settings.Bundle{ +func generateBundleProfileRequest() *settingsmsg.Bundle { + return &settingsmsg.Bundle{ Id: "2a506de7-99bd-4f0d-994e-c38e72c28fd9", Name: "profile", Extension: "ocis-accounts", - Type: settings.Bundle_TYPE_DEFAULT, - Resource: &settings.Resource{ - Type: settings.Resource_TYPE_SYSTEM, + Type: settingsmsg.Bundle_TYPE_DEFAULT, + Resource: &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_SYSTEM, }, DisplayName: "Profile", - Settings: []*settings.Setting{ + Settings: []*settingsmsg.Setting{ { Id: settingUUIDProfileLanguage, Name: "language", DisplayName: "Language", Description: "User language", - Resource: &settings.Resource{ - Type: settings.Resource_TYPE_USER, + Resource: &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_USER, }, Value: &languageSetting, }, @@ -196,207 +197,207 @@ func generateBundleProfileRequest() *settings.Bundle { } } -func generatePermissionRequests() []*settings.AddSettingToBundleRequest { - return []*settings.AddSettingToBundleRequest{ +func generatePermissionRequests() []*settingssvc.AddSettingToBundleRequest { + return []*settingssvc.AddSettingToBundleRequest{ { BundleId: BundleUUIDRoleAdmin, - Setting: &settings.Setting{ + Setting: &settingsmsg.Setting{ Id: RoleManagementPermissionID, Name: RoleManagementPermissionName, DisplayName: "Role Management", Description: "This permission gives full access to everything that is related to role management.", - Resource: &settings.Resource{ - Type: settings.Resource_TYPE_USER, + Resource: &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_USER, Id: "all", }, - Value: &settings.Setting_PermissionValue{ - PermissionValue: &settings.Permission{ - Operation: settings.Permission_OPERATION_READWRITE, - Constraint: settings.Permission_CONSTRAINT_ALL, + Value: &settingsmsg.Setting_PermissionValue{ + PermissionValue: &settingsmsg.Permission{ + Operation: settingsmsg.Permission_OPERATION_READWRITE, + Constraint: settingsmsg.Permission_CONSTRAINT_ALL, }, }, }, }, { BundleId: BundleUUIDRoleAdmin, - Setting: &settings.Setting{ + Setting: &settingsmsg.Setting{ Id: SettingsManagementPermissionID, Name: SettingsManagementPermissionName, DisplayName: "Settings Management", Description: "This permission gives full access to everything that is related to settings management.", - Resource: &settings.Resource{ - Type: settings.Resource_TYPE_USER, + Resource: &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_USER, Id: "all", }, - Value: &settings.Setting_PermissionValue{ - PermissionValue: &settings.Permission{ - Operation: settings.Permission_OPERATION_READWRITE, - Constraint: settings.Permission_CONSTRAINT_ALL, + Value: &settingsmsg.Setting_PermissionValue{ + PermissionValue: &settingsmsg.Permission{ + Operation: settingsmsg.Permission_OPERATION_READWRITE, + Constraint: settingsmsg.Permission_CONSTRAINT_ALL, }, }, }, }, { BundleId: BundleUUIDRoleAdmin, - Setting: &settings.Setting{ + Setting: &settingsmsg.Setting{ Id: "7d81f103-0488-4853-bce5-98dcce36d649", Name: "language-readwrite", DisplayName: "Permission to read and set the language (anyone)", - Resource: &settings.Resource{ - Type: settings.Resource_TYPE_SETTING, + Resource: &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_SETTING, Id: settingUUIDProfileLanguage, }, - Value: &settings.Setting_PermissionValue{ - PermissionValue: &settings.Permission{ - Operation: settings.Permission_OPERATION_READWRITE, - Constraint: settings.Permission_CONSTRAINT_ALL, + Value: &settingsmsg.Setting_PermissionValue{ + PermissionValue: &settingsmsg.Permission{ + Operation: settingsmsg.Permission_OPERATION_READWRITE, + Constraint: settingsmsg.Permission_CONSTRAINT_ALL, }, }, }, }, { BundleId: BundleUUIDRoleUser, - Setting: &settings.Setting{ + Setting: &settingsmsg.Setting{ Id: "640e00d2-4df8-41bd-b1c2-9f30a01e0e99", Name: "language-readwrite", DisplayName: "Permission to read and set the language (self)", - Resource: &settings.Resource{ - Type: settings.Resource_TYPE_SETTING, + Resource: &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_SETTING, Id: settingUUIDProfileLanguage, }, - Value: &settings.Setting_PermissionValue{ - PermissionValue: &settings.Permission{ - Operation: settings.Permission_OPERATION_READWRITE, - Constraint: settings.Permission_CONSTRAINT_OWN, + Value: &settingsmsg.Setting_PermissionValue{ + PermissionValue: &settingsmsg.Permission{ + Operation: settingsmsg.Permission_OPERATION_READWRITE, + Constraint: settingsmsg.Permission_CONSTRAINT_OWN, }, }, }, }, { BundleId: BundleUUIDRoleGuest, - Setting: &settings.Setting{ + Setting: &settingsmsg.Setting{ Id: "ca878636-8b1a-4fae-8282-8617a4c13597", Name: "language-readwrite", DisplayName: "Permission to read and set the language (self)", - Resource: &settings.Resource{ - Type: settings.Resource_TYPE_SETTING, + Resource: &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_SETTING, Id: settingUUIDProfileLanguage, }, - Value: &settings.Setting_PermissionValue{ - PermissionValue: &settings.Permission{ - Operation: settings.Permission_OPERATION_READWRITE, - Constraint: settings.Permission_CONSTRAINT_OWN, + Value: &settingsmsg.Setting_PermissionValue{ + PermissionValue: &settingsmsg.Permission{ + Operation: settingsmsg.Permission_OPERATION_READWRITE, + Constraint: settingsmsg.Permission_CONSTRAINT_OWN, }, }, }, }, { BundleId: BundleUUIDRoleAdmin, - Setting: &settings.Setting{ + Setting: &settingsmsg.Setting{ Id: AccountManagementPermissionID, Name: AccountManagementPermissionName, DisplayName: "Account Management", Description: "This permission gives full access to everything that is related to account management.", - Resource: &settings.Resource{ - Type: settings.Resource_TYPE_USER, + Resource: &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_USER, Id: "all", }, - Value: &settings.Setting_PermissionValue{ - PermissionValue: &settings.Permission{ - Operation: settings.Permission_OPERATION_READWRITE, - Constraint: settings.Permission_CONSTRAINT_ALL, + Value: &settingsmsg.Setting_PermissionValue{ + PermissionValue: &settingsmsg.Permission{ + Operation: settingsmsg.Permission_OPERATION_READWRITE, + Constraint: settingsmsg.Permission_CONSTRAINT_ALL, }, }, }, }, { BundleId: BundleUUIDRoleAdmin, - Setting: &settings.Setting{ + Setting: &settingsmsg.Setting{ Id: GroupManagementPermissionID, Name: GroupManagementPermissionName, DisplayName: "Group Management", Description: "This permission gives full access to everything that is related to group management.", - Resource: &settings.Resource{ - Type: settings.Resource_TYPE_GROUP, + Resource: &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_GROUP, Id: "all", }, - Value: &settings.Setting_PermissionValue{ - PermissionValue: &settings.Permission{ - Operation: settings.Permission_OPERATION_READWRITE, - Constraint: settings.Permission_CONSTRAINT_ALL, + Value: &settingsmsg.Setting_PermissionValue{ + PermissionValue: &settingsmsg.Permission{ + Operation: settingsmsg.Permission_OPERATION_READWRITE, + Constraint: settingsmsg.Permission_CONSTRAINT_ALL, }, }, }, }, { BundleId: BundleUUIDRoleUser, - Setting: &settings.Setting{ + Setting: &settingsmsg.Setting{ Id: SelfManagementPermissionID, Name: SelfManagementPermissionName, DisplayName: "Self Management", Description: "This permission gives access to self management.", - Resource: &settings.Resource{ - Type: settings.Resource_TYPE_USER, + Resource: &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_USER, Id: "me", }, - Value: &settings.Setting_PermissionValue{ - PermissionValue: &settings.Permission{ - Operation: settings.Permission_OPERATION_READWRITE, - Constraint: settings.Permission_CONSTRAINT_OWN, + Value: &settingsmsg.Setting_PermissionValue{ + PermissionValue: &settingsmsg.Permission{ + Operation: settingsmsg.Permission_OPERATION_READWRITE, + Constraint: settingsmsg.Permission_CONSTRAINT_OWN, }, }, }, }, { BundleId: BundleUUIDRoleAdmin, - Setting: &settings.Setting{ + Setting: &settingsmsg.Setting{ Id: SetSpaceQuotaPermissionID, Name: SetSpaceQuotaPermissionName, DisplayName: "Set Space Quota", Description: "This permission allows to manage space quotas.", - Resource: &settings.Resource{ - Type: settings.Resource_TYPE_SYSTEM, + Resource: &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_SYSTEM, }, - Value: &settings.Setting_PermissionValue{ - PermissionValue: &settings.Permission{ - Operation: settings.Permission_OPERATION_READWRITE, - Constraint: settings.Permission_CONSTRAINT_ALL, + Value: &settingsmsg.Setting_PermissionValue{ + PermissionValue: &settingsmsg.Permission{ + Operation: settingsmsg.Permission_OPERATION_READWRITE, + Constraint: settingsmsg.Permission_CONSTRAINT_ALL, }, }, }, }, { BundleId: BundleUUIDRoleAdmin, - Setting: &settings.Setting{ + Setting: &settingsmsg.Setting{ Id: CreateSpacePermissionID, Name: CreateSpacePermissionName, DisplayName: "Create Space", Description: "This permission allows to create new spaces.", - Resource: &settings.Resource{ - Type: settings.Resource_TYPE_SYSTEM, + Resource: &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_SYSTEM, }, - Value: &settings.Setting_PermissionValue{ - PermissionValue: &settings.Permission{ - Operation: settings.Permission_OPERATION_READWRITE, - Constraint: settings.Permission_CONSTRAINT_ALL, + Value: &settingsmsg.Setting_PermissionValue{ + PermissionValue: &settingsmsg.Permission{ + Operation: settingsmsg.Permission_OPERATION_READWRITE, + Constraint: settingsmsg.Permission_CONSTRAINT_ALL, }, }, }, }, { BundleId: BundleUUIDRoleAdmin, - Setting: &settings.Setting{ + Setting: &settingsmsg.Setting{ Id: ListAllSpacesPermissionID, Name: ListAllSpacesPermissionName, DisplayName: "List All Spaces", Description: "This permission allows list all spaces.", - Resource: &settings.Resource{ - Type: settings.Resource_TYPE_SYSTEM, + Resource: &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_SYSTEM, }, - Value: &settings.Setting_PermissionValue{ - PermissionValue: &settings.Permission{ - Operation: settings.Permission_OPERATION_READ, - Constraint: settings.Permission_CONSTRAINT_ALL, + Value: &settingsmsg.Setting_PermissionValue{ + PermissionValue: &settingsmsg.Permission{ + Operation: settingsmsg.Permission_OPERATION_READ, + Constraint: settingsmsg.Permission_CONSTRAINT_ALL, }, }, }, @@ -404,8 +405,8 @@ func generatePermissionRequests() []*settings.AddSettingToBundleRequest { } } -func defaultRoleAssignments() []*settings.UserRoleAssignment { - return []*settings.UserRoleAssignment{ +func defaultRoleAssignments() []*settingsmsg.UserRoleAssignment { + return []*settingsmsg.UserRoleAssignment{ // default admin users { AccountUuid: "058bff95-6708-4fe5-91e4-9ea3d377588b", diff --git a/settings/pkg/service/v0/validator.go b/settings/pkg/service/v0/validator.go index 246b71c66..3f66e12d0 100644 --- a/settings/pkg/service/v0/validator.go +++ b/settings/pkg/service/v0/validator.go @@ -5,7 +5,8 @@ import ( validation "github.com/go-ozzo/ozzo-validation/v4" "github.com/go-ozzo/ozzo-validation/v4/is" - "github.com/owncloud/ocis/settings/pkg/proto/v0" + settingsmsg "github.com/owncloud/ocis/protogen/gen/ocis/messages/settings/v1" + settingssvc "github.com/owncloud/ocis/protogen/gen/ocis/services/settings/v1" ) var ( @@ -22,12 +23,12 @@ var ( } ) -func validateSaveBundle(req *proto.SaveBundleRequest) error { +func validateSaveBundle(req *settingssvc.SaveBundleRequest) error { if err := validation.ValidateStruct( req.Bundle, validation.Field(&req.Bundle.Id, validation.When(req.Bundle.Id != "", is.UUID)), validation.Field(&req.Bundle.Name, requireAlphanumeric...), - validation.Field(&req.Bundle.Type, validation.NotIn(proto.Bundle_TYPE_UNKNOWN)), + validation.Field(&req.Bundle.Type, validation.NotIn(settingsmsg.Bundle_TYPE_UNKNOWN)), validation.Field(&req.Bundle.Extension, requireAlphanumeric...), validation.Field(&req.Bundle.DisplayName, validation.Required), validation.Field(&req.Bundle.Settings, validation.Required), @@ -45,22 +46,22 @@ func validateSaveBundle(req *proto.SaveBundleRequest) error { return nil } -func validateGetBundle(req *proto.GetBundleRequest) error { +func validateGetBundle(req *settingssvc.GetBundleRequest) error { return validation.Validate(&req.BundleId, is.UUID) } -func validateListBundles(req *proto.ListBundlesRequest) error { +func validateListBundles(req *settingssvc.ListBundlesRequest) error { return nil } -func validateAddSettingToBundle(req *proto.AddSettingToBundleRequest) error { +func validateAddSettingToBundle(req *settingssvc.AddSettingToBundleRequest) error { if err := validation.ValidateStruct(req, validation.Field(&req.BundleId, is.UUID)); err != nil { return err } return validateSetting(req.Setting) } -func validateRemoveSettingFromBundle(req *proto.RemoveSettingFromBundleRequest) error { +func validateRemoveSettingFromBundle(req *settingssvc.RemoveSettingFromBundleRequest) error { return validation.ValidateStruct( req, validation.Field(&req.BundleId, is.UUID), @@ -68,7 +69,7 @@ func validateRemoveSettingFromBundle(req *proto.RemoveSettingFromBundleRequest) ) } -func validateSaveValue(req *proto.SaveValueRequest) error { +func validateSaveValue(req *settingssvc.SaveValueRequest) error { if err := validation.ValidateStruct( req.Value, validation.Field(&req.Value.Id, validation.When(req.Value.Id != "", is.UUID)), @@ -87,11 +88,11 @@ func validateSaveValue(req *proto.SaveValueRequest) error { return nil } -func validateGetValue(req *proto.GetValueRequest) error { +func validateGetValue(req *settingssvc.GetValueRequest) error { return validation.Validate(req.Id, is.UUID) } -func validateGetValueByUniqueIdentifiers(req *proto.GetValueByUniqueIdentifiersRequest) error { +func validateGetValueByUniqueIdentifiers(req *settingssvc.GetValueByUniqueIdentifiersRequest) error { return validation.ValidateStruct( req, validation.Field(&req.SettingId, is.UUID), @@ -99,7 +100,7 @@ func validateGetValueByUniqueIdentifiers(req *proto.GetValueByUniqueIdentifiersR ) } -func validateListValues(req *proto.ListValuesRequest) error { +func validateListValues(req *settingssvc.ListValuesRequest) error { return validation.ValidateStruct( req, validation.Field(&req.BundleId, validation.When(req.BundleId != "", is.UUID)), @@ -107,15 +108,15 @@ func validateListValues(req *proto.ListValuesRequest) error { ) } -func validateListRoles(req *proto.ListBundlesRequest) error { +func validateListRoles(req *settingssvc.ListBundlesRequest) error { return nil } -func validateListRoleAssignments(req *proto.ListRoleAssignmentsRequest) error { +func validateListRoleAssignments(req *settingssvc.ListRoleAssignmentsRequest) error { return validation.Validate(req.AccountUuid, requireAccountID...) } -func validateAssignRoleToUser(req *proto.AssignRoleToUserRequest) error { +func validateAssignRoleToUser(req *settingssvc.AssignRoleToUserRequest) error { return validation.ValidateStruct( req, validation.Field(&req.AccountUuid, requireAccountID...), @@ -123,18 +124,18 @@ func validateAssignRoleToUser(req *proto.AssignRoleToUserRequest) error { ) } -func validateRemoveRoleFromUser(req *proto.RemoveRoleFromUserRequest) error { +func validateRemoveRoleFromUser(req *settingssvc.RemoveRoleFromUserRequest) error { return validation.ValidateStruct( req, validation.Field(&req.Id, is.UUID), ) } -func validateListPermissionsByResource(req *proto.ListPermissionsByResourceRequest) error { +func validateListPermissionsByResource(req *settingssvc.ListPermissionsByResourceRequest) error { return validateResource(req.Resource) } -func validateGetPermissionByID(req *proto.GetPermissionByIDRequest) error { +func validateGetPermissionByID(req *settingssvc.GetPermissionByIDRequest) error { return validation.ValidateStruct( req, validation.Field(&req.PermissionId, requireAlphanumeric...), @@ -142,15 +143,15 @@ func validateGetPermissionByID(req *proto.GetPermissionByIDRequest) error { } // validateResource is an internal helper for validating the content of a resource. -func validateResource(resource *proto.Resource) error { +func validateResource(resource *settingsmsg.Resource) error { if err := validation.Validate(&resource, validation.Required); err != nil { return err } - return validation.Validate(&resource, validation.NotIn(proto.Resource_TYPE_UNKNOWN)) + return validation.Validate(&resource, validation.NotIn(settingsmsg.Resource_TYPE_UNKNOWN)) } // validateSetting is an internal helper for validating the content of a setting. -func validateSetting(setting *proto.Setting) error { +func validateSetting(setting *settingsmsg.Setting) error { // TODO: make sanity checks, like for int settings, min <= default <= max. if err := validation.ValidateStruct( setting, diff --git a/settings/pkg/settings/settings.go b/settings/pkg/settings/settings.go index da0ff5347..81ba4938d 100644 --- a/settings/pkg/settings/settings.go +++ b/settings/pkg/settings/settings.go @@ -3,8 +3,8 @@ package settings import ( "errors" + settingsmsg "github.com/owncloud/ocis/protogen/gen/ocis/messages/settings/v1" "github.com/owncloud/ocis/settings/pkg/config" - "github.com/owncloud/ocis/settings/pkg/proto/v0" ) var ( @@ -28,32 +28,32 @@ type Manager interface { // BundleManager is a bundle service interface for abstraction of storage implementations type BundleManager interface { - ListBundles(bundleType proto.Bundle_Type, bundleIDs []string) ([]*proto.Bundle, error) - ReadBundle(bundleID string) (*proto.Bundle, error) - WriteBundle(bundle *proto.Bundle) (*proto.Bundle, error) - ReadSetting(settingID string) (*proto.Setting, error) - AddSettingToBundle(bundleID string, setting *proto.Setting) (*proto.Setting, error) + ListBundles(bundleType settingsmsg.Bundle_Type, bundleIDs []string) ([]*settingsmsg.Bundle, error) + ReadBundle(bundleID string) (*settingsmsg.Bundle, error) + WriteBundle(bundle *settingsmsg.Bundle) (*settingsmsg.Bundle, error) + ReadSetting(settingID string) (*settingsmsg.Setting, error) + AddSettingToBundle(bundleID string, setting *settingsmsg.Setting) (*settingsmsg.Setting, error) RemoveSettingFromBundle(bundleID, settingID string) error } // ValueManager is a value service interface for abstraction of storage implementations type ValueManager interface { - ListValues(bundleID, accountUUID string) ([]*proto.Value, error) - ReadValue(valueID string) (*proto.Value, error) - ReadValueByUniqueIdentifiers(accountUUID, settingID string) (*proto.Value, error) - WriteValue(value *proto.Value) (*proto.Value, error) + ListValues(bundleID, accountUUID string) ([]*settingsmsg.Value, error) + ReadValue(valueID string) (*settingsmsg.Value, error) + ReadValueByUniqueIdentifiers(accountUUID, settingID string) (*settingsmsg.Value, error) + WriteValue(value *settingsmsg.Value) (*settingsmsg.Value, error) } // RoleAssignmentManager is a role assignment service interface for abstraction of storage implementations type RoleAssignmentManager interface { - ListRoleAssignments(accountUUID string) ([]*proto.UserRoleAssignment, error) - WriteRoleAssignment(accountUUID, roleID string) (*proto.UserRoleAssignment, error) + ListRoleAssignments(accountUUID string) ([]*settingsmsg.UserRoleAssignment, error) + WriteRoleAssignment(accountUUID, roleID string) (*settingsmsg.UserRoleAssignment, error) RemoveRoleAssignment(assignmentID string) error } // PermissionManager is a permissions service interface for abstraction of storage implementations type PermissionManager interface { - ListPermissionsByResource(resource *proto.Resource, roleIDs []string) ([]*proto.Permission, error) - ReadPermissionByID(permissionID string, roleIDs []string) (*proto.Permission, error) - ReadPermissionByName(name string, roleIDs []string) (*proto.Permission, error) + ListPermissionsByResource(resource *settingsmsg.Resource, roleIDs []string) ([]*settingsmsg.Permission, error) + ReadPermissionByID(permissionID string, roleIDs []string) (*settingsmsg.Permission, error) + ReadPermissionByName(name string, roleIDs []string) (*settingsmsg.Permission, error) } diff --git a/settings/pkg/store/filesystem/assignments.go b/settings/pkg/store/filesystem/assignments.go index c1e458c71..9ce9e0af3 100644 --- a/settings/pkg/store/filesystem/assignments.go +++ b/settings/pkg/store/filesystem/assignments.go @@ -7,12 +7,12 @@ import ( "path/filepath" "github.com/gofrs/uuid" - "github.com/owncloud/ocis/settings/pkg/proto/v0" + settingsmsg "github.com/owncloud/ocis/protogen/gen/ocis/messages/settings/v1" ) // ListRoleAssignments loads and returns all role assignments matching the given assignment identifier. -func (s Store) ListRoleAssignments(accountUUID string) ([]*proto.UserRoleAssignment, error) { - var records []*proto.UserRoleAssignment +func (s Store) ListRoleAssignments(accountUUID string) ([]*settingsmsg.UserRoleAssignment, error) { + var records []*settingsmsg.UserRoleAssignment assignmentsFolder := s.buildFolderPathForRoleAssignments(false) assignmentFiles, err := ioutil.ReadDir(assignmentsFolder) if err != nil { @@ -20,7 +20,7 @@ func (s Store) ListRoleAssignments(accountUUID string) ([]*proto.UserRoleAssignm } for _, assignmentFile := range assignmentFiles { - record := proto.UserRoleAssignment{} + record := settingsmsg.UserRoleAssignment{} err = s.parseRecordFromFile(&record, filepath.Join(assignmentsFolder, assignmentFile.Name())) if err == nil { if record.AccountUuid == accountUUID { @@ -33,7 +33,7 @@ func (s Store) ListRoleAssignments(accountUUID string) ([]*proto.UserRoleAssignm } // WriteRoleAssignment appends the given role assignment to the existing assignments of the respective account. -func (s Store) WriteRoleAssignment(accountUUID, roleID string) (*proto.UserRoleAssignment, error) { +func (s Store) WriteRoleAssignment(accountUUID, roleID string) (*settingsmsg.UserRoleAssignment, error) { // as per https://github.com/owncloud/product/issues/103 "Each user can have exactly one role" list, err := s.ListRoleAssignments(accountUUID) if err != nil { @@ -46,7 +46,7 @@ func (s Store) WriteRoleAssignment(accountUUID, roleID string) (*proto.UserRoleA } } - assignment := &proto.UserRoleAssignment{ + assignment := &settingsmsg.UserRoleAssignment{ Id: uuid.Must(uuid.NewV4()).String(), AccountUuid: accountUUID, RoleId: roleID, diff --git a/settings/pkg/store/filesystem/assignments_test.go b/settings/pkg/store/filesystem/assignments_test.go index b33782def..0051d7cc7 100644 --- a/settings/pkg/store/filesystem/assignments_test.go +++ b/settings/pkg/store/filesystem/assignments_test.go @@ -8,7 +8,7 @@ import ( "testing" olog "github.com/owncloud/ocis/ocis-pkg/log" - "github.com/owncloud/ocis/settings/pkg/proto/v0" + settingsmsg "github.com/owncloud/ocis/protogen/gen/ocis/messages/settings/v1" "github.com/stretchr/testify/assert" ) @@ -27,30 +27,30 @@ var ( olog.Level("info"), ) - bundles = []*proto.Bundle{ + bundles = []*settingsmsg.Bundle{ { Id: "f36db5e6-a03c-40df-8413-711c67e40b47", - Type: proto.Bundle_TYPE_ROLE, + Type: settingsmsg.Bundle_TYPE_ROLE, DisplayName: "test role - reads | update", Name: "TEST_ROLE", Extension: "ocis-settings", - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_BUNDLE, + Resource: &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_BUNDLE, }, - Settings: []*proto.Setting{ + Settings: []*settingsmsg.Setting{ { Name: "update", - Value: &proto.Setting_PermissionValue{ - PermissionValue: &proto.Permission{ - Operation: proto.Permission_OPERATION_UPDATE, + Value: &settingsmsg.Setting_PermissionValue{ + PermissionValue: &settingsmsg.Permission{ + Operation: settingsmsg.Permission_OPERATION_UPDATE, }, }, }, { Name: "read", - Value: &proto.Setting_PermissionValue{ - PermissionValue: &proto.Permission{ - Operation: proto.Permission_OPERATION_READ, + Value: &settingsmsg.Setting_PermissionValue{ + PermissionValue: &settingsmsg.Permission{ + Operation: settingsmsg.Permission_OPERATION_READ, }, }, }, @@ -58,19 +58,19 @@ var ( }, { Id: "44f1a664-0a7f-461a-b0be-5b59e46bbc7a", - Type: proto.Bundle_TYPE_ROLE, + Type: settingsmsg.Bundle_TYPE_ROLE, DisplayName: "another", Name: "ANOTHER_TEST_ROLE", Extension: "ocis-settings", - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_BUNDLE, + Resource: &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_BUNDLE, }, - Settings: []*proto.Setting{ + Settings: []*settingsmsg.Setting{ { Name: "read", - Value: &proto.Setting_PermissionValue{ - PermissionValue: &proto.Permission{ - Operation: proto.Permission_OPERATION_READ, + Value: &settingsmsg.Setting_PermissionValue{ + PermissionValue: &settingsmsg.Permission{ + Operation: settingsmsg.Permission_OPERATION_READ, }, }, }, diff --git a/settings/pkg/store/filesystem/bundles.go b/settings/pkg/store/filesystem/bundles.go index 33b315ed0..d1a63924f 100644 --- a/settings/pkg/store/filesystem/bundles.go +++ b/settings/pkg/store/filesystem/bundles.go @@ -8,14 +8,14 @@ import ( "sync" "github.com/gofrs/uuid" - "github.com/owncloud/ocis/settings/pkg/proto/v0" + settingsmsg "github.com/owncloud/ocis/protogen/gen/ocis/messages/settings/v1" "github.com/owncloud/ocis/settings/pkg/store/errortypes" ) var m = &sync.RWMutex{} // ListBundles returns all bundles in the dataPath folder that match the given type. -func (s Store) ListBundles(bundleType proto.Bundle_Type, bundleIDs []string) ([]*proto.Bundle, error) { +func (s Store) ListBundles(bundleType settingsmsg.Bundle_Type, bundleIDs []string) ([]*settingsmsg.Bundle, error) { // FIXME: list requests should be ran against a cache, not FS m.RLock() defer m.RUnlock() @@ -23,12 +23,12 @@ func (s Store) ListBundles(bundleType proto.Bundle_Type, bundleIDs []string) ([] bundlesFolder := s.buildFolderPathForBundles(false) bundleFiles, err := ioutil.ReadDir(bundlesFolder) if err != nil { - return []*proto.Bundle{}, nil + return []*settingsmsg.Bundle{}, nil } - records := make([]*proto.Bundle, 0, len(bundleFiles)) + records := make([]*settingsmsg.Bundle, 0, len(bundleFiles)) for _, bundleFile := range bundleFiles { - record := proto.Bundle{} + record := settingsmsg.Bundle{} err = s.parseRecordFromFile(&record, filepath.Join(bundlesFolder, bundleFile.Name())) if err != nil { s.Logger.Warn().Msgf("error reading %v", bundleFile) @@ -57,12 +57,12 @@ func containsStr(str string, strs []string) bool { } // ReadBundle tries to find a bundle by the given id within the dataPath. -func (s Store) ReadBundle(bundleID string) (*proto.Bundle, error) { +func (s Store) ReadBundle(bundleID string) (*settingsmsg.Bundle, error) { m.RLock() defer m.RUnlock() filePath := s.buildFilePathForBundle(bundleID, false) - record := proto.Bundle{} + record := settingsmsg.Bundle{} if err := s.parseRecordFromFile(&record, filePath); err != nil { return nil, err } @@ -72,11 +72,11 @@ func (s Store) ReadBundle(bundleID string) (*proto.Bundle, error) { } // ReadSetting tries to find a setting by the given id within the dataPath. -func (s Store) ReadSetting(settingID string) (*proto.Setting, error) { +func (s Store) ReadSetting(settingID string) (*settingsmsg.Setting, error) { m.RLock() defer m.RUnlock() - bundles, err := s.ListBundles(proto.Bundle_TYPE_DEFAULT, []string{}) + bundles, err := s.ListBundles(settingsmsg.Bundle_TYPE_DEFAULT, []string{}) if err != nil { return nil, err } @@ -91,7 +91,7 @@ func (s Store) ReadSetting(settingID string) (*proto.Setting, error) { } // WriteBundle writes the given record into a file within the dataPath. -func (s Store) WriteBundle(record *proto.Bundle) (*proto.Bundle, error) { +func (s Store) WriteBundle(record *settingsmsg.Bundle) (*settingsmsg.Bundle, error) { // FIXME: locking should happen on the file here, not globally. m.Lock() defer m.Unlock() @@ -108,15 +108,15 @@ func (s Store) WriteBundle(record *proto.Bundle) (*proto.Bundle, error) { } // AddSettingToBundle adds the given setting to the bundle with the given bundleID. -func (s Store) AddSettingToBundle(bundleID string, setting *proto.Setting) (*proto.Setting, error) { +func (s Store) AddSettingToBundle(bundleID string, setting *settingsmsg.Setting) (*settingsmsg.Setting, error) { bundle, err := s.ReadBundle(bundleID) if err != nil { if _, notFound := err.(errortypes.BundleNotFound); !notFound { return nil, err } - bundle = new(proto.Bundle) + bundle = new(settingsmsg.Bundle) bundle.Id = bundleID - bundle.Type = proto.Bundle_TYPE_DEFAULT + bundle.Type = settingsmsg.Bundle_TYPE_DEFAULT } if setting.Id == "" { setting.Id = uuid.Must(uuid.NewV4()).String() @@ -145,7 +145,7 @@ func (s Store) RemoveSettingFromBundle(bundleID string, settingID string) error // indexOfSetting finds the index of the given setting within the given bundle. // returns -1 if the setting was not found. -func indexOfSetting(bundle *proto.Bundle, settingID string) int { +func indexOfSetting(bundle *settingsmsg.Bundle, settingID string) int { for index := range bundle.Settings { s := bundle.Settings[index] if s.Id == settingID { @@ -156,7 +156,7 @@ func indexOfSetting(bundle *proto.Bundle, settingID string) int { } // setSetting will append or overwrite the given setting within the given bundle -func setSetting(bundle *proto.Bundle, setting *proto.Setting) { +func setSetting(bundle *settingsmsg.Bundle, setting *settingsmsg.Setting) { m.Lock() defer m.Unlock() index := indexOfSetting(bundle, setting.Id) @@ -168,7 +168,7 @@ func setSetting(bundle *proto.Bundle, setting *proto.Setting) { } // removeSetting will remove the given setting from the given bundle -func removeSetting(bundle *proto.Bundle, settingID string) bool { +func removeSetting(bundle *settingsmsg.Bundle, settingID string) bool { m.Lock() defer m.Unlock() index := indexOfSetting(bundle, settingID) diff --git a/settings/pkg/store/filesystem/bundles_test.go b/settings/pkg/store/filesystem/bundles_test.go index 6539bf6ae..096a9b3dd 100644 --- a/settings/pkg/store/filesystem/bundles_test.go +++ b/settings/pkg/store/filesystem/bundles_test.go @@ -4,36 +4,36 @@ import ( "testing" olog "github.com/owncloud/ocis/ocis-pkg/log" - "github.com/owncloud/ocis/settings/pkg/proto/v0" + settingsmsg "github.com/owncloud/ocis/protogen/gen/ocis/messages/settings/v1" "github.com/stretchr/testify/assert" ) var bundleScenarios = []struct { name string - bundle *proto.Bundle + bundle *settingsmsg.Bundle }{ { name: "generic-test-file-resource", - bundle: &proto.Bundle{ + bundle: &settingsmsg.Bundle{ Id: bundle1, - Type: proto.Bundle_TYPE_DEFAULT, + Type: settingsmsg.Bundle_TYPE_DEFAULT, Extension: extension1, DisplayName: "test1", - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_FILE, + Resource: &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_FILE, Id: "beep", }, - Settings: []*proto.Setting{ + Settings: []*settingsmsg.Setting{ { Id: setting1, Description: "test-desc-1", DisplayName: "test-displayname-1", - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_FILE, + Resource: &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_FILE, Id: "bleep", }, - Value: &proto.Setting_IntValue{ - IntValue: &proto.Int{ + Value: &settingsmsg.Setting_IntValue{ + IntValue: &settingsmsg.Int{ Min: 0, Max: 42, }, @@ -44,24 +44,24 @@ var bundleScenarios = []struct { }, { name: "generic-test-system-resource", - bundle: &proto.Bundle{ + bundle: &settingsmsg.Bundle{ Id: bundle2, - Type: proto.Bundle_TYPE_DEFAULT, + Type: settingsmsg.Bundle_TYPE_DEFAULT, Extension: extension2, DisplayName: "test1", - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_SYSTEM, + Resource: &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_SYSTEM, }, - Settings: []*proto.Setting{ + Settings: []*settingsmsg.Setting{ { Id: setting2, Description: "test-desc-2", DisplayName: "test-displayname-2", - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_SYSTEM, + Resource: &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_SYSTEM, }, - Value: &proto.Setting_IntValue{ - IntValue: &proto.Int{ + Value: &settingsmsg.Setting_IntValue{ + IntValue: &settingsmsg.Int{ Min: 0, Max: 42, }, @@ -72,27 +72,27 @@ var bundleScenarios = []struct { }, { name: "generic-test-role-bundle", - bundle: &proto.Bundle{ + bundle: &settingsmsg.Bundle{ Id: bundle3, - Type: proto.Bundle_TYPE_ROLE, + Type: settingsmsg.Bundle_TYPE_ROLE, Extension: extension1, DisplayName: "Role1", - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_SYSTEM, + Resource: &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_SYSTEM, }, - Settings: []*proto.Setting{ + Settings: []*settingsmsg.Setting{ { Id: setting3, Description: "test-desc-3", DisplayName: "test-displayname-3", - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_SETTING, + Resource: &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_SETTING, Id: setting1, }, - Value: &proto.Setting_PermissionValue{ - PermissionValue: &proto.Permission{ - Operation: proto.Permission_OPERATION_READ, - Constraint: proto.Permission_CONSTRAINT_OWN, + Value: &settingsmsg.Setting_PermissionValue{ + PermissionValue: &settingsmsg.Permission{ + Operation: settingsmsg.Permission_OPERATION_READ, + Constraint: settingsmsg.Permission_CONSTRAINT_OWN, }, }, }, @@ -124,16 +124,16 @@ func TestBundles(t *testing.T) { } // check that ListBundles only returns bundles with type DEFAULT - bundles, err := s.ListBundles(proto.Bundle_TYPE_DEFAULT, []string{}) + bundles, err := s.ListBundles(settingsmsg.Bundle_TYPE_DEFAULT, []string{}) if err != nil { t.Error(err) } for i := range bundles { - assert.Equal(t, proto.Bundle_TYPE_DEFAULT, bundles[i].Type) + assert.Equal(t, settingsmsg.Bundle_TYPE_DEFAULT, bundles[i].Type) } // check that ListBundles filtered by an id only returns that bundle - filteredBundles, err := s.ListBundles(proto.Bundle_TYPE_DEFAULT, []string{bundle2}) + filteredBundles, err := s.ListBundles(settingsmsg.Bundle_TYPE_DEFAULT, []string{bundle2}) if err != nil { t.Error(err) } @@ -143,12 +143,12 @@ func TestBundles(t *testing.T) { } // check that ListRoles only returns bundles with type ROLE - roles, err := s.ListBundles(proto.Bundle_TYPE_ROLE, []string{}) + roles, err := s.ListBundles(settingsmsg.Bundle_TYPE_ROLE, []string{}) if err != nil { t.Error(err) } for i := range roles { - assert.Equal(t, proto.Bundle_TYPE_ROLE, roles[i].Type) + assert.Equal(t, settingsmsg.Bundle_TYPE_ROLE, roles[i].Type) } burnRoot() diff --git a/settings/pkg/store/filesystem/permissions.go b/settings/pkg/store/filesystem/permissions.go index ea63c3590..49f3c097a 100644 --- a/settings/pkg/store/filesystem/permissions.go +++ b/settings/pkg/store/filesystem/permissions.go @@ -1,14 +1,14 @@ package store import ( - "github.com/owncloud/ocis/settings/pkg/proto/v0" + settingsmsg "github.com/owncloud/ocis/protogen/gen/ocis/messages/settings/v1" "github.com/owncloud/ocis/settings/pkg/settings" "github.com/owncloud/ocis/settings/pkg/util" ) // ListPermissionsByResource collects all permissions from the provided roleIDs that match the requested resource -func (s Store) ListPermissionsByResource(resource *proto.Resource, roleIDs []string) ([]*proto.Permission, error) { - records := make([]*proto.Permission, 0) +func (s Store) ListPermissionsByResource(resource *settingsmsg.Resource, roleIDs []string) ([]*settingsmsg.Permission, error) { + records := make([]*settingsmsg.Permission, 0) for _, roleID := range roleIDs { role, err := s.ReadBundle(roleID) if err != nil { @@ -21,7 +21,7 @@ func (s Store) ListPermissionsByResource(resource *proto.Resource, roleIDs []str } // ReadPermissionByID finds the permission in the roles, specified by the provided roleIDs -func (s Store) ReadPermissionByID(permissionID string, roleIDs []string) (*proto.Permission, error) { +func (s Store) ReadPermissionByID(permissionID string, roleIDs []string) (*settingsmsg.Permission, error) { for _, roleID := range roleIDs { role, err := s.ReadBundle(roleID) if err != nil { @@ -30,7 +30,7 @@ func (s Store) ReadPermissionByID(permissionID string, roleIDs []string) (*proto } for _, permission := range role.Settings { if permission.Id == permissionID { - if value, ok := permission.Value.(*proto.Setting_PermissionValue); ok { + if value, ok := permission.Value.(*settingsmsg.Setting_PermissionValue); ok { return value.PermissionValue, nil } } @@ -40,7 +40,7 @@ func (s Store) ReadPermissionByID(permissionID string, roleIDs []string) (*proto } // ReadPermissionByName finds the permission in the roles, specified by the provided roleIDs -func (s Store) ReadPermissionByName(name string, roleIDs []string) (*proto.Permission, error) { +func (s Store) ReadPermissionByName(name string, roleIDs []string) (*settingsmsg.Permission, error) { for _, roleID := range roleIDs { role, err := s.ReadBundle(roleID) if err != nil { @@ -49,7 +49,7 @@ func (s Store) ReadPermissionByName(name string, roleIDs []string) (*proto.Permi } for _, permission := range role.Settings { if permission.Name == name { - if value, ok := permission.Value.(*proto.Setting_PermissionValue); ok { + if value, ok := permission.Value.(*settingsmsg.Setting_PermissionValue); ok { return value.PermissionValue, nil } } @@ -59,10 +59,10 @@ func (s Store) ReadPermissionByName(name string, roleIDs []string) (*proto.Permi } // extractPermissionsByResource collects all permissions from the provided role that match the requested resource -func extractPermissionsByResource(resource *proto.Resource, role *proto.Bundle) []*proto.Permission { - permissions := make([]*proto.Permission, 0) +func extractPermissionsByResource(resource *settingsmsg.Resource, role *settingsmsg.Bundle) []*settingsmsg.Permission { + permissions := make([]*settingsmsg.Permission, 0) for _, setting := range role.Settings { - if value, ok := setting.Value.(*proto.Setting_PermissionValue); ok { + if value, ok := setting.Value.(*settingsmsg.Setting_PermissionValue); ok { if util.IsResourceMatched(setting.Resource, resource) { permissions = append(permissions, value.PermissionValue) } diff --git a/settings/pkg/store/filesystem/values.go b/settings/pkg/store/filesystem/values.go index 38b5ba182..89014f4d3 100644 --- a/settings/pkg/store/filesystem/values.go +++ b/settings/pkg/store/filesystem/values.go @@ -7,23 +7,23 @@ import ( "path/filepath" "github.com/gofrs/uuid" - "github.com/owncloud/ocis/settings/pkg/proto/v0" + settingsmsg "github.com/owncloud/ocis/protogen/gen/ocis/messages/settings/v1" ) // ListValues reads all values that match the given bundleId and accountUUID. // If the bundleId is empty, it's ignored for filtering. // If the accountUUID is empty, only values with empty accountUUID are returned. // If the accountUUID is not empty, values with an empty or with a matching accountUUID are returned. -func (s Store) ListValues(bundleID, accountUUID string) ([]*proto.Value, error) { +func (s Store) ListValues(bundleID, accountUUID string) ([]*settingsmsg.Value, error) { valuesFolder := s.buildFolderPathForValues(false) valueFiles, err := ioutil.ReadDir(valuesFolder) if err != nil { - return []*proto.Value{}, nil + return []*settingsmsg.Value{}, nil } - records := make([]*proto.Value, 0, len(valueFiles)) + records := make([]*settingsmsg.Value, 0, len(valueFiles)) for _, valueFile := range valueFiles { - record := proto.Value{} + record := settingsmsg.Value{} err := s.parseRecordFromFile(&record, filepath.Join(valuesFolder, valueFile.Name())) if err != nil { s.Logger.Warn().Msgf("error reading %v", valueFile) @@ -47,9 +47,9 @@ func (s Store) ListValues(bundleID, accountUUID string) ([]*proto.Value, error) } // ReadValue tries to find a value by the given valueId within the dataPath -func (s Store) ReadValue(valueID string) (*proto.Value, error) { +func (s Store) ReadValue(valueID string) (*settingsmsg.Value, error) { filePath := s.buildFilePathForValue(valueID, false) - record := proto.Value{} + record := settingsmsg.Value{} if err := s.parseRecordFromFile(&record, filePath); err != nil { return nil, err } @@ -59,7 +59,7 @@ func (s Store) ReadValue(valueID string) (*proto.Value, error) { } // ReadValueByUniqueIdentifiers tries to find a value given a set of unique identifiers -func (s Store) ReadValueByUniqueIdentifiers(accountUUID, settingID string) (*proto.Value, error) { +func (s Store) ReadValueByUniqueIdentifiers(accountUUID, settingID string) (*settingsmsg.Value, error) { valuesFolder := s.buildFolderPathForValues(false) files, err := ioutil.ReadDir(valuesFolder) if err != nil { @@ -67,11 +67,11 @@ func (s Store) ReadValueByUniqueIdentifiers(accountUUID, settingID string) (*pro } for i := range files { if !files[i].IsDir() { - r := proto.Value{} + r := settingsmsg.Value{} s.Logger.Debug().Msgf("reading contents from file: %v", filepath.Join(valuesFolder, files[i].Name())) if err := s.parseRecordFromFile(&r, filepath.Join(valuesFolder, files[i].Name())); err != nil { s.Logger.Debug().Msgf("match found: %v", filepath.Join(valuesFolder, files[i].Name())) - return &proto.Value{}, nil + return &settingsmsg.Value{}, nil } // if value saved without accountUUID, then it's a global value @@ -89,14 +89,14 @@ func (s Store) ReadValueByUniqueIdentifiers(accountUUID, settingID string) (*pro } // WriteValue writes the given value into a file within the dataPath -func (s Store) WriteValue(value *proto.Value) (*proto.Value, error) { +func (s Store) WriteValue(value *settingsmsg.Value) (*settingsmsg.Value, error) { s.Logger.Debug().Str("value", value.String()).Msg("writing value") if value.Id == "" { value.Id = uuid.Must(uuid.NewV4()).String() } // modify value depending on associated resource - if value.Resource.Type == proto.Resource_TYPE_SYSTEM { + if value.Resource.Type == settingsmsg.Resource_TYPE_SYSTEM { value.AccountUuid = "" } diff --git a/settings/pkg/store/filesystem/values_test.go b/settings/pkg/store/filesystem/values_test.go index c6dbc0df6..8464cb690 100644 --- a/settings/pkg/store/filesystem/values_test.go +++ b/settings/pkg/store/filesystem/values_test.go @@ -4,41 +4,41 @@ import ( "testing" olog "github.com/owncloud/ocis/ocis-pkg/log" - "github.com/owncloud/ocis/settings/pkg/proto/v0" + settingsmsg "github.com/owncloud/ocis/protogen/gen/ocis/messages/settings/v1" "github.com/stretchr/testify/assert" ) var valueScenarios = []struct { name string - value *proto.Value + value *settingsmsg.Value }{ { name: "generic-test-with-system-resource", - value: &proto.Value{ + value: &settingsmsg.Value{ Id: value1, BundleId: bundle1, SettingId: setting1, AccountUuid: accountUUID1, - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_SYSTEM, + Resource: &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_SYSTEM, }, - Value: &proto.Value_StringValue{ + Value: &settingsmsg.Value_StringValue{ StringValue: "lalala", }, }, }, { name: "generic-test-with-file-resource", - value: &proto.Value{ + value: &settingsmsg.Value{ Id: value2, BundleId: bundle1, SettingId: setting2, AccountUuid: accountUUID1, - Resource: &proto.Resource{ - Type: proto.Resource_TYPE_FILE, + Resource: &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_FILE, Id: "adfba82d-919a-41c3-9cd1-5a3f83b2bf76", }, - Value: &proto.Value_StringValue{ + Value: &settingsmsg.Value_StringValue{ StringValue: "tralala", }, }, diff --git a/settings/pkg/util/resource_helper.go b/settings/pkg/util/resource_helper.go index 37ec35e34..0554e7f9e 100644 --- a/settings/pkg/util/resource_helper.go +++ b/settings/pkg/util/resource_helper.go @@ -1,6 +1,8 @@ package util -import "github.com/owncloud/ocis/settings/pkg/proto/v0" +import ( + settingsmsg "github.com/owncloud/ocis/protogen/gen/ocis/messages/settings/v1" +) const ( // ResourceIDAll declares on a resource that it matches any id @@ -8,7 +10,7 @@ const ( ) // IsResourceMatched checks if the `example` resource is an exact match or a subset of `definition` -func IsResourceMatched(definition, example *proto.Resource) bool { +func IsResourceMatched(definition, example *settingsmsg.Resource) bool { if definition.Type != example.Type { return false } diff --git a/settings/pkg/util/resource_helper_test.go b/settings/pkg/util/resource_helper_test.go index 698fdf56e..8530bdb70 100644 --- a/settings/pkg/util/resource_helper_test.go +++ b/settings/pkg/util/resource_helper_test.go @@ -3,80 +3,80 @@ package util import ( "testing" - "github.com/owncloud/ocis/settings/pkg/proto/v0" + settingsmsg "github.com/owncloud/ocis/protogen/gen/ocis/messages/settings/v1" "gotest.tools/v3/assert" ) func TestIsResourceMatched(t *testing.T) { scenarios := []struct { name string - definition *proto.Resource - example *proto.Resource + definition *settingsmsg.Resource + example *settingsmsg.Resource matched bool }{ { "same resource types without ids match", - &proto.Resource{ - Type: proto.Resource_TYPE_SYSTEM, + &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_SYSTEM, }, - &proto.Resource{ - Type: proto.Resource_TYPE_SYSTEM, + &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_SYSTEM, }, true, }, { "different resource types without ids don't match", - &proto.Resource{ - Type: proto.Resource_TYPE_SYSTEM, + &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_SYSTEM, }, - &proto.Resource{ - Type: proto.Resource_TYPE_USER, + &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_USER, }, false, }, { "same resource types with different ids don't match", - &proto.Resource{ - Type: proto.Resource_TYPE_USER, + &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_USER, Id: "einstein", }, - &proto.Resource{ - Type: proto.Resource_TYPE_USER, + &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_USER, Id: "marie", }, false, }, { "same resource types with same ids match", - &proto.Resource{ - Type: proto.Resource_TYPE_USER, + &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_USER, Id: "einstein", }, - &proto.Resource{ - Type: proto.Resource_TYPE_USER, + &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_USER, Id: "einstein", }, true, }, { "same resource types with definition = ALL and without id in example is a match", - &proto.Resource{ - Type: proto.Resource_TYPE_USER, + &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_USER, Id: ResourceIDAll, }, - &proto.Resource{ - Type: proto.Resource_TYPE_USER, + &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_USER, }, true, }, { "same resource types with definition.id = ALL and with some id in example is a match", - &proto.Resource{ - Type: proto.Resource_TYPE_USER, + &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_USER, Id: ResourceIDAll, }, - &proto.Resource{ - Type: proto.Resource_TYPE_USER, + &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_USER, Id: "einstein", }, true, diff --git a/settings/proto/v0/settings.proto b/settings/proto/v0/settings.proto deleted file mode 100644 index 8ced40a98..000000000 --- a/settings/proto/v0/settings.proto +++ /dev/null @@ -1,416 +0,0 @@ -syntax = "proto3"; - -package com.owncloud.ocis.settings.v0; - -option go_package = "github.com/owncloud/ocis/settings/pkg/proto/v0;proto"; - -import "google/api/annotations.proto"; -import "google/protobuf/empty.proto"; - -import "protoc-gen-openapiv2/options/annotations.proto"; - -option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { - info: { - title: "ownCloud Infinite Scale settings"; - version: "1.0.0"; - contact: { - name: "ownCloud GmbH"; - url: "https://github.com/owncloud/ocis"; - email: "support@owncloud.com"; - }; - license: { - name: "Apache-2.0"; - url: "https://github.com/owncloud/ocis/blob/master/LICENSE"; - }; - }; - schemes: HTTP; - schemes: HTTPS; - consumes: "application/json"; - produces: "application/json"; - external_docs: { - description: "Developer Manual"; - url: "https://owncloud.dev/extensions/settings/"; - }; -}; - -service BundleService { - rpc SaveBundle(SaveBundleRequest) returns (SaveBundleResponse) { - option (google.api.http) = { - post: "/api/v0/settings/bundle-save", - body: "*" - }; - } - rpc GetBundle(GetBundleRequest) returns (GetBundleResponse) { - option (google.api.http) = { - post: "/api/v0/settings/bundle-get", - body: "*" - }; - } - rpc ListBundles(ListBundlesRequest) returns (ListBundlesResponse) { - option (google.api.http) = { - post: "/api/v0/settings/bundles-list", - body: "*" - }; - } - rpc AddSettingToBundle(AddSettingToBundleRequest) returns (AddSettingToBundleResponse) { - option (google.api.http) = { - post: "/api/v0/settings/bundles-add-setting", - body: "*" - }; - } - rpc RemoveSettingFromBundle(RemoveSettingFromBundleRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/api/v0/settings/bundles-remove-setting", - body: "*" - }; - } -} - -service ValueService { - rpc SaveValue(SaveValueRequest) returns (SaveValueResponse) { - option (google.api.http) = { - post: "/api/v0/settings/values-save", - body: "*" - }; - } - rpc GetValue(GetValueRequest) returns (GetValueResponse) { - option (google.api.http) = { - post: "/api/v0/settings/values-get", - body: "*" - }; - } - rpc ListValues(ListValuesRequest) returns (ListValuesResponse) { - option (google.api.http) = { - post: "/api/v0/settings/values-list", - body: "*" - }; - } - rpc GetValueByUniqueIdentifiers(GetValueByUniqueIdentifiersRequest) returns (GetValueResponse) { - option (google.api.http) = { - post: "/api/v0/settings/values-get-by-unique-identifiers", - body: "*" - }; - } -} - -service RoleService { - rpc ListRoles(ListBundlesRequest) returns (ListBundlesResponse) { - option (google.api.http) = { - post: "/api/v0/settings/roles-list", - body: "*" - }; - } - rpc ListRoleAssignments(ListRoleAssignmentsRequest) returns (ListRoleAssignmentsResponse) { - option (google.api.http) = { - post: "/api/v0/settings/assignments-list", - body: "*" - }; - } - rpc AssignRoleToUser(AssignRoleToUserRequest) returns (AssignRoleToUserResponse) { - option (google.api.http) = { - post: "/api/v0/settings/assignments-add", - body: "*" - }; - } - rpc RemoveRoleFromUser(RemoveRoleFromUserRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/api/v0/settings/assignments-remove", - body: "*" - }; - } -} - -service PermissionService { - rpc ListPermissionsByResource(ListPermissionsByResourceRequest) returns (ListPermissionsByResourceResponse) { - option (google.api.http) = { - post: "/api/v0/settings/permissions-list-by-resource", - body: "*" - }; - } - rpc GetPermissionByID(GetPermissionByIDRequest) returns (GetPermissionByIDResponse) { - option (google.api.http) = { - post: "/api/v0/settings/permissions-get-by-id", - body: "*" - }; - } -} - -// --- -// requests and responses for settings bundles -// --- -message SaveBundleRequest { - Bundle bundle = 1; -} - -message SaveBundleResponse { - Bundle bundle = 1; -} - -message GetBundleRequest { - string bundle_id = 1; -} - -message GetBundleResponse { - Bundle bundle = 1; -} - -message ListBundlesRequest { - repeated string bundle_ids = 1; -} - -message ListBundlesResponse { - repeated Bundle bundles = 1; -} - -message AddSettingToBundleRequest { - string bundle_id = 1; - Setting setting = 2; -} - -message AddSettingToBundleResponse { - Setting setting = 1; -} - -message RemoveSettingFromBundleRequest { - string bundle_id = 1; - string setting_id = 2; -} - -// --- -// requests and responses for settings values -// --- - -message SaveValueRequest { - Value value = 1; -} - -message SaveValueResponse { - ValueWithIdentifier value = 1; -} - -message GetValueRequest { - string id = 1; -} - -message GetValueResponse { - ValueWithIdentifier value = 1; -} - -message ListValuesRequest { - string bundle_id = 1; - string account_uuid = 2; -} - -message ListValuesResponse { - repeated ValueWithIdentifier values = 1; -} - -message GetValueByUniqueIdentifiersRequest{ - string account_uuid = 1; - string setting_id = 2; -} - -message ValueWithIdentifier { - Identifier identifier = 1; - Value value = 2; -} - -message Identifier { - string extension = 1; - string bundle = 2; - string setting = 3; -} - -// -- -// requests and responses for role assignments -// --- - -message ListRoleAssignmentsRequest { - string account_uuid = 1; -} - -message ListRoleAssignmentsResponse { - repeated UserRoleAssignment assignments = 1; -} - -message AssignRoleToUserRequest { - string account_uuid = 1; - // the role_id is a bundle_id internally - string role_id = 2; -} - -message AssignRoleToUserResponse { - UserRoleAssignment assignment = 1; -} - -message RemoveRoleFromUserRequest { - string id = 1; -} - -message UserRoleAssignment { - // id is generated upon saving the assignment - string id = 1; - string account_uuid = 2; - // the role_id is a bundle_id internally - string role_id = 3; -} - -// -- -// requests and responses for permissions -// --- - -message ListPermissionsByResourceRequest { - Resource resource = 1; -} - -message ListPermissionsByResourceResponse { - repeated Permission permissions = 1; -} - -message GetPermissionByIDRequest { - string permission_id = 1; -} - -message GetPermissionByIDResponse { - Permission permission = 1; -} - -// --- -// resource payloads -// --- - -message Resource { - enum Type { - TYPE_UNKNOWN = 0; - TYPE_SYSTEM = 1; - TYPE_FILE = 2; - TYPE_SHARE = 3; - TYPE_SETTING = 4; - TYPE_BUNDLE = 5; - TYPE_USER = 6; - TYPE_GROUP = 7; - } - Type type = 1; - string id = 2; -} - -// --- -// payloads for bundles -// --- - -message Bundle { - enum Type { - TYPE_UNKNOWN = 0; - TYPE_DEFAULT = 1; - TYPE_ROLE = 2; - } - string id = 1; - string name = 2; - Type type = 3; - string extension = 4; - string display_name = 5; - repeated Setting settings = 6; - Resource resource = 7; -} - -message Setting { - string id = 1; - string name = 2; - string display_name = 3; - string description = 4; - oneof value { - Int int_value = 5; - String string_value = 6; - Bool bool_value = 7; - SingleChoiceList single_choice_value = 8; - MultiChoiceList multi_choice_value = 9; - Permission permission_value = 10; - } - Resource resource = 11; -} - -message Int { - int64 default = 1; - int64 min = 2; - int64 max = 3; - int64 step = 4; - string placeholder = 5; -} - -message String { - string default = 1; - bool required = 2; - int32 min_length = 3; - int32 max_length = 4; - string placeholder = 5; -} - -message Bool { - bool default = 1; - string label = 2; -} - -message SingleChoiceList { - repeated ListOption options = 1; -} - -message MultiChoiceList { - repeated ListOption options = 1; -} - -message ListOption { - ListOptionValue value = 1; - bool default = 2; - string display_value = 3; -} - -message Permission { - enum Operation { - OPERATION_UNKNOWN = 0; - OPERATION_CREATE = 1; - OPERATION_READ = 2; - OPERATION_UPDATE = 3; - OPERATION_DELETE = 4; - OPERATION_WRITE = 5;// WRITE is a combination of CREATE and UPDATE - OPERATION_READWRITE = 6;// READWRITE is a combination of READ and WRITE - } - Operation operation = 1; - enum Constraint { - CONSTRAINT_UNKNOWN = 0; - CONSTRAINT_OWN = 1; - CONSTRAINT_SHARED = 2; - CONSTRAINT_ALL = 3; - } - Constraint constraint = 2; -} - -// --- -// payloads for values -// --- - -message Value { - // id is the id of the Value. It is generated on saving it. - string id = 1; - string bundle_id = 2; - // setting_id is the id of the setting from within its bundle. - string setting_id = 3; - string account_uuid = 4; - Resource resource = 5; - oneof value { - bool bool_value = 6; - int64 int_value = 7; - string string_value = 8; - ListValue list_value = 9; - } -} - -message ListValue { - repeated ListOptionValue values = 1; -} - -message ListOptionValue { - oneof option { - string string_value = 1; - int64 int_value = 2; - } -} diff --git a/settings/ui/client/settings/index.js b/settings/ui/client/settings/index.js index 3d82e0682..dbc9ea5d8 100644 --- a/settings/ui/client/settings/index.js +++ b/settings/ui/client/settings/index.js @@ -25,20 +25,20 @@ export const request = (method, url, body, queryParameters, form, config) => { } } /*========================================================== - * + * ==========================================================*/ /** - * + * * request: RoleService_AssignRoleToUser * url: RoleService_AssignRoleToUserURL * method: RoleService_AssignRoleToUser_TYPE * raw_url: RoleService_AssignRoleToUser_RAW_URL - * @param body - + * @param body - */ export const RoleService_AssignRoleToUser = function(parameters = {}) { const domain = parameters.$domain ? parameters.$domain : getDomain() const config = parameters.$config - let path = '/api/v0/settings/assignments-add' + let path = '/api/v1/settings/assignments-add' let body let queryParameters = {} let form = {} @@ -56,7 +56,7 @@ export const RoleService_AssignRoleToUser = function(parameters = {}) { return request('post', domain + path, body, queryParameters, form, config) } export const RoleService_AssignRoleToUser_RAW_URL = function() { - return '/api/v0/settings/assignments-add' + return '/api/v1/settings/assignments-add' } export const RoleService_AssignRoleToUser_TYPE = function() { return 'post' @@ -64,7 +64,7 @@ export const RoleService_AssignRoleToUser_TYPE = function() { export const RoleService_AssignRoleToUserURL = function(parameters = {}) { let queryParameters = {} const domain = parameters.$domain ? parameters.$domain : getDomain() - let path = '/api/v0/settings/assignments-add' + let path = '/api/v1/settings/assignments-add' if (parameters.$queryParameters) { Object.keys(parameters.$queryParameters).forEach(function(parameterName) { queryParameters[parameterName] = parameters.$queryParameters[parameterName] @@ -74,17 +74,17 @@ export const RoleService_AssignRoleToUserURL = function(parameters = {}) { return domain + path + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(queryParameters[key])).join('&')) : '') } /** - * + * * request: RoleService_ListRoleAssignments * url: RoleService_ListRoleAssignmentsURL * method: RoleService_ListRoleAssignments_TYPE * raw_url: RoleService_ListRoleAssignments_RAW_URL - * @param body - + * @param body - */ export const RoleService_ListRoleAssignments = function(parameters = {}) { const domain = parameters.$domain ? parameters.$domain : getDomain() const config = parameters.$config - let path = '/api/v0/settings/assignments-list' + let path = '/api/v1/settings/assignments-list' let body let queryParameters = {} let form = {} @@ -102,7 +102,7 @@ export const RoleService_ListRoleAssignments = function(parameters = {}) { return request('post', domain + path, body, queryParameters, form, config) } export const RoleService_ListRoleAssignments_RAW_URL = function() { - return '/api/v0/settings/assignments-list' + return '/api/v1/settings/assignments-list' } export const RoleService_ListRoleAssignments_TYPE = function() { return 'post' @@ -110,7 +110,7 @@ export const RoleService_ListRoleAssignments_TYPE = function() { export const RoleService_ListRoleAssignmentsURL = function(parameters = {}) { let queryParameters = {} const domain = parameters.$domain ? parameters.$domain : getDomain() - let path = '/api/v0/settings/assignments-list' + let path = '/api/v1/settings/assignments-list' if (parameters.$queryParameters) { Object.keys(parameters.$queryParameters).forEach(function(parameterName) { queryParameters[parameterName] = parameters.$queryParameters[parameterName] @@ -120,17 +120,17 @@ export const RoleService_ListRoleAssignmentsURL = function(parameters = {}) { return domain + path + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(queryParameters[key])).join('&')) : '') } /** - * + * * request: RoleService_RemoveRoleFromUser * url: RoleService_RemoveRoleFromUserURL * method: RoleService_RemoveRoleFromUser_TYPE * raw_url: RoleService_RemoveRoleFromUser_RAW_URL - * @param body - + * @param body - */ export const RoleService_RemoveRoleFromUser = function(parameters = {}) { const domain = parameters.$domain ? parameters.$domain : getDomain() const config = parameters.$config - let path = '/api/v0/settings/assignments-remove' + let path = '/api/v1/settings/assignments-remove' let body let queryParameters = {} let form = {} @@ -148,7 +148,7 @@ export const RoleService_RemoveRoleFromUser = function(parameters = {}) { return request('post', domain + path, body, queryParameters, form, config) } export const RoleService_RemoveRoleFromUser_RAW_URL = function() { - return '/api/v0/settings/assignments-remove' + return '/api/v1/settings/assignments-remove' } export const RoleService_RemoveRoleFromUser_TYPE = function() { return 'post' @@ -156,7 +156,7 @@ export const RoleService_RemoveRoleFromUser_TYPE = function() { export const RoleService_RemoveRoleFromUserURL = function(parameters = {}) { let queryParameters = {} const domain = parameters.$domain ? parameters.$domain : getDomain() - let path = '/api/v0/settings/assignments-remove' + let path = '/api/v1/settings/assignments-remove' if (parameters.$queryParameters) { Object.keys(parameters.$queryParameters).forEach(function(parameterName) { queryParameters[parameterName] = parameters.$queryParameters[parameterName] @@ -166,17 +166,17 @@ export const RoleService_RemoveRoleFromUserURL = function(parameters = {}) { return domain + path + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(queryParameters[key])).join('&')) : '') } /** - * + * * request: BundleService_GetBundle * url: BundleService_GetBundleURL * method: BundleService_GetBundle_TYPE * raw_url: BundleService_GetBundle_RAW_URL - * @param body - + * @param body - */ export const BundleService_GetBundle = function(parameters = {}) { const domain = parameters.$domain ? parameters.$domain : getDomain() const config = parameters.$config - let path = '/api/v0/settings/bundle-get' + let path = '/api/v1/settings/bundle-get' let body let queryParameters = {} let form = {} @@ -194,7 +194,7 @@ export const BundleService_GetBundle = function(parameters = {}) { return request('post', domain + path, body, queryParameters, form, config) } export const BundleService_GetBundle_RAW_URL = function() { - return '/api/v0/settings/bundle-get' + return '/api/v1/settings/bundle-get' } export const BundleService_GetBundle_TYPE = function() { return 'post' @@ -202,7 +202,7 @@ export const BundleService_GetBundle_TYPE = function() { export const BundleService_GetBundleURL = function(parameters = {}) { let queryParameters = {} const domain = parameters.$domain ? parameters.$domain : getDomain() - let path = '/api/v0/settings/bundle-get' + let path = '/api/v1/settings/bundle-get' if (parameters.$queryParameters) { Object.keys(parameters.$queryParameters).forEach(function(parameterName) { queryParameters[parameterName] = parameters.$queryParameters[parameterName] @@ -212,17 +212,17 @@ export const BundleService_GetBundleURL = function(parameters = {}) { return domain + path + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(queryParameters[key])).join('&')) : '') } /** - * + * * request: BundleService_SaveBundle * url: BundleService_SaveBundleURL * method: BundleService_SaveBundle_TYPE * raw_url: BundleService_SaveBundle_RAW_URL - * @param body - + * @param body - */ export const BundleService_SaveBundle = function(parameters = {}) { const domain = parameters.$domain ? parameters.$domain : getDomain() const config = parameters.$config - let path = '/api/v0/settings/bundle-save' + let path = '/api/v1/settings/bundle-save' let body let queryParameters = {} let form = {} @@ -240,7 +240,7 @@ export const BundleService_SaveBundle = function(parameters = {}) { return request('post', domain + path, body, queryParameters, form, config) } export const BundleService_SaveBundle_RAW_URL = function() { - return '/api/v0/settings/bundle-save' + return '/api/v1/settings/bundle-save' } export const BundleService_SaveBundle_TYPE = function() { return 'post' @@ -248,7 +248,7 @@ export const BundleService_SaveBundle_TYPE = function() { export const BundleService_SaveBundleURL = function(parameters = {}) { let queryParameters = {} const domain = parameters.$domain ? parameters.$domain : getDomain() - let path = '/api/v0/settings/bundle-save' + let path = '/api/v1/settings/bundle-save' if (parameters.$queryParameters) { Object.keys(parameters.$queryParameters).forEach(function(parameterName) { queryParameters[parameterName] = parameters.$queryParameters[parameterName] @@ -258,17 +258,17 @@ export const BundleService_SaveBundleURL = function(parameters = {}) { return domain + path + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(queryParameters[key])).join('&')) : '') } /** - * + * * request: BundleService_AddSettingToBundle * url: BundleService_AddSettingToBundleURL * method: BundleService_AddSettingToBundle_TYPE * raw_url: BundleService_AddSettingToBundle_RAW_URL - * @param body - + * @param body - */ export const BundleService_AddSettingToBundle = function(parameters = {}) { const domain = parameters.$domain ? parameters.$domain : getDomain() const config = parameters.$config - let path = '/api/v0/settings/bundles-add-setting' + let path = '/api/v1/settings/bundles-add-setting' let body let queryParameters = {} let form = {} @@ -286,7 +286,7 @@ export const BundleService_AddSettingToBundle = function(parameters = {}) { return request('post', domain + path, body, queryParameters, form, config) } export const BundleService_AddSettingToBundle_RAW_URL = function() { - return '/api/v0/settings/bundles-add-setting' + return '/api/v1/settings/bundles-add-setting' } export const BundleService_AddSettingToBundle_TYPE = function() { return 'post' @@ -294,7 +294,7 @@ export const BundleService_AddSettingToBundle_TYPE = function() { export const BundleService_AddSettingToBundleURL = function(parameters = {}) { let queryParameters = {} const domain = parameters.$domain ? parameters.$domain : getDomain() - let path = '/api/v0/settings/bundles-add-setting' + let path = '/api/v1/settings/bundles-add-setting' if (parameters.$queryParameters) { Object.keys(parameters.$queryParameters).forEach(function(parameterName) { queryParameters[parameterName] = parameters.$queryParameters[parameterName] @@ -304,17 +304,17 @@ export const BundleService_AddSettingToBundleURL = function(parameters = {}) { return domain + path + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(queryParameters[key])).join('&')) : '') } /** - * + * * request: BundleService_ListBundles * url: BundleService_ListBundlesURL * method: BundleService_ListBundles_TYPE * raw_url: BundleService_ListBundles_RAW_URL - * @param body - + * @param body - */ export const BundleService_ListBundles = function(parameters = {}) { const domain = parameters.$domain ? parameters.$domain : getDomain() const config = parameters.$config - let path = '/api/v0/settings/bundles-list' + let path = '/api/v1/settings/bundles-list' let body let queryParameters = {} let form = {} @@ -332,7 +332,7 @@ export const BundleService_ListBundles = function(parameters = {}) { return request('post', domain + path, body, queryParameters, form, config) } export const BundleService_ListBundles_RAW_URL = function() { - return '/api/v0/settings/bundles-list' + return '/api/v1/settings/bundles-list' } export const BundleService_ListBundles_TYPE = function() { return 'post' @@ -340,7 +340,7 @@ export const BundleService_ListBundles_TYPE = function() { export const BundleService_ListBundlesURL = function(parameters = {}) { let queryParameters = {} const domain = parameters.$domain ? parameters.$domain : getDomain() - let path = '/api/v0/settings/bundles-list' + let path = '/api/v1/settings/bundles-list' if (parameters.$queryParameters) { Object.keys(parameters.$queryParameters).forEach(function(parameterName) { queryParameters[parameterName] = parameters.$queryParameters[parameterName] @@ -350,17 +350,17 @@ export const BundleService_ListBundlesURL = function(parameters = {}) { return domain + path + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(queryParameters[key])).join('&')) : '') } /** - * + * * request: BundleService_RemoveSettingFromBundle * url: BundleService_RemoveSettingFromBundleURL * method: BundleService_RemoveSettingFromBundle_TYPE * raw_url: BundleService_RemoveSettingFromBundle_RAW_URL - * @param body - + * @param body - */ export const BundleService_RemoveSettingFromBundle = function(parameters = {}) { const domain = parameters.$domain ? parameters.$domain : getDomain() const config = parameters.$config - let path = '/api/v0/settings/bundles-remove-setting' + let path = '/api/v1/settings/bundles-remove-setting' let body let queryParameters = {} let form = {} @@ -378,7 +378,7 @@ export const BundleService_RemoveSettingFromBundle = function(parameters = {}) { return request('post', domain + path, body, queryParameters, form, config) } export const BundleService_RemoveSettingFromBundle_RAW_URL = function() { - return '/api/v0/settings/bundles-remove-setting' + return '/api/v1/settings/bundles-remove-setting' } export const BundleService_RemoveSettingFromBundle_TYPE = function() { return 'post' @@ -386,7 +386,7 @@ export const BundleService_RemoveSettingFromBundle_TYPE = function() { export const BundleService_RemoveSettingFromBundleURL = function(parameters = {}) { let queryParameters = {} const domain = parameters.$domain ? parameters.$domain : getDomain() - let path = '/api/v0/settings/bundles-remove-setting' + let path = '/api/v1/settings/bundles-remove-setting' if (parameters.$queryParameters) { Object.keys(parameters.$queryParameters).forEach(function(parameterName) { queryParameters[parameterName] = parameters.$queryParameters[parameterName] @@ -396,17 +396,17 @@ export const BundleService_RemoveSettingFromBundleURL = function(parameters = {} return domain + path + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(queryParameters[key])).join('&')) : '') } /** - * + * * request: PermissionService_GetPermissionByID * url: PermissionService_GetPermissionByIDURL * method: PermissionService_GetPermissionByID_TYPE * raw_url: PermissionService_GetPermissionByID_RAW_URL - * @param body - + * @param body - */ export const PermissionService_GetPermissionByID = function(parameters = {}) { const domain = parameters.$domain ? parameters.$domain : getDomain() const config = parameters.$config - let path = '/api/v0/settings/permissions-get-by-id' + let path = '/api/v1/settings/permissions-get-by-id' let body let queryParameters = {} let form = {} @@ -424,7 +424,7 @@ export const PermissionService_GetPermissionByID = function(parameters = {}) { return request('post', domain + path, body, queryParameters, form, config) } export const PermissionService_GetPermissionByID_RAW_URL = function() { - return '/api/v0/settings/permissions-get-by-id' + return '/api/v1/settings/permissions-get-by-id' } export const PermissionService_GetPermissionByID_TYPE = function() { return 'post' @@ -432,7 +432,7 @@ export const PermissionService_GetPermissionByID_TYPE = function() { export const PermissionService_GetPermissionByIDURL = function(parameters = {}) { let queryParameters = {} const domain = parameters.$domain ? parameters.$domain : getDomain() - let path = '/api/v0/settings/permissions-get-by-id' + let path = '/api/v1/settings/permissions-get-by-id' if (parameters.$queryParameters) { Object.keys(parameters.$queryParameters).forEach(function(parameterName) { queryParameters[parameterName] = parameters.$queryParameters[parameterName] @@ -442,17 +442,17 @@ export const PermissionService_GetPermissionByIDURL = function(parameters = {}) return domain + path + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(queryParameters[key])).join('&')) : '') } /** - * + * * request: PermissionService_ListPermissionsByResource * url: PermissionService_ListPermissionsByResourceURL * method: PermissionService_ListPermissionsByResource_TYPE * raw_url: PermissionService_ListPermissionsByResource_RAW_URL - * @param body - + * @param body - */ export const PermissionService_ListPermissionsByResource = function(parameters = {}) { const domain = parameters.$domain ? parameters.$domain : getDomain() const config = parameters.$config - let path = '/api/v0/settings/permissions-list-by-resource' + let path = '/api/v1/settings/permissions-list-by-resource' let body let queryParameters = {} let form = {} @@ -470,7 +470,7 @@ export const PermissionService_ListPermissionsByResource = function(parameters = return request('post', domain + path, body, queryParameters, form, config) } export const PermissionService_ListPermissionsByResource_RAW_URL = function() { - return '/api/v0/settings/permissions-list-by-resource' + return '/api/v1/settings/permissions-list-by-resource' } export const PermissionService_ListPermissionsByResource_TYPE = function() { return 'post' @@ -478,7 +478,7 @@ export const PermissionService_ListPermissionsByResource_TYPE = function() { export const PermissionService_ListPermissionsByResourceURL = function(parameters = {}) { let queryParameters = {} const domain = parameters.$domain ? parameters.$domain : getDomain() - let path = '/api/v0/settings/permissions-list-by-resource' + let path = '/api/v1/settings/permissions-list-by-resource' if (parameters.$queryParameters) { Object.keys(parameters.$queryParameters).forEach(function(parameterName) { queryParameters[parameterName] = parameters.$queryParameters[parameterName] @@ -488,17 +488,17 @@ export const PermissionService_ListPermissionsByResourceURL = function(parameter return domain + path + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(queryParameters[key])).join('&')) : '') } /** - * + * * request: RoleService_ListRoles * url: RoleService_ListRolesURL * method: RoleService_ListRoles_TYPE * raw_url: RoleService_ListRoles_RAW_URL - * @param body - + * @param body - */ export const RoleService_ListRoles = function(parameters = {}) { const domain = parameters.$domain ? parameters.$domain : getDomain() const config = parameters.$config - let path = '/api/v0/settings/roles-list' + let path = '/api/v1/settings/roles-list' let body let queryParameters = {} let form = {} @@ -516,7 +516,7 @@ export const RoleService_ListRoles = function(parameters = {}) { return request('post', domain + path, body, queryParameters, form, config) } export const RoleService_ListRoles_RAW_URL = function() { - return '/api/v0/settings/roles-list' + return '/api/v1/settings/roles-list' } export const RoleService_ListRoles_TYPE = function() { return 'post' @@ -524,7 +524,7 @@ export const RoleService_ListRoles_TYPE = function() { export const RoleService_ListRolesURL = function(parameters = {}) { let queryParameters = {} const domain = parameters.$domain ? parameters.$domain : getDomain() - let path = '/api/v0/settings/roles-list' + let path = '/api/v1/settings/roles-list' if (parameters.$queryParameters) { Object.keys(parameters.$queryParameters).forEach(function(parameterName) { queryParameters[parameterName] = parameters.$queryParameters[parameterName] @@ -534,17 +534,17 @@ export const RoleService_ListRolesURL = function(parameters = {}) { return domain + path + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(queryParameters[key])).join('&')) : '') } /** - * + * * request: ValueService_GetValue * url: ValueService_GetValueURL * method: ValueService_GetValue_TYPE * raw_url: ValueService_GetValue_RAW_URL - * @param body - + * @param body - */ export const ValueService_GetValue = function(parameters = {}) { const domain = parameters.$domain ? parameters.$domain : getDomain() const config = parameters.$config - let path = '/api/v0/settings/values-get' + let path = '/api/v1/settings/values-get' let body let queryParameters = {} let form = {} @@ -562,7 +562,7 @@ export const ValueService_GetValue = function(parameters = {}) { return request('post', domain + path, body, queryParameters, form, config) } export const ValueService_GetValue_RAW_URL = function() { - return '/api/v0/settings/values-get' + return '/api/v1/settings/values-get' } export const ValueService_GetValue_TYPE = function() { return 'post' @@ -570,7 +570,7 @@ export const ValueService_GetValue_TYPE = function() { export const ValueService_GetValueURL = function(parameters = {}) { let queryParameters = {} const domain = parameters.$domain ? parameters.$domain : getDomain() - let path = '/api/v0/settings/values-get' + let path = '/api/v1/settings/values-get' if (parameters.$queryParameters) { Object.keys(parameters.$queryParameters).forEach(function(parameterName) { queryParameters[parameterName] = parameters.$queryParameters[parameterName] @@ -580,17 +580,17 @@ export const ValueService_GetValueURL = function(parameters = {}) { return domain + path + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(queryParameters[key])).join('&')) : '') } /** - * + * * request: ValueService_GetValueByUniqueIdentifiers * url: ValueService_GetValueByUniqueIdentifiersURL * method: ValueService_GetValueByUniqueIdentifiers_TYPE * raw_url: ValueService_GetValueByUniqueIdentifiers_RAW_URL - * @param body - + * @param body - */ export const ValueService_GetValueByUniqueIdentifiers = function(parameters = {}) { const domain = parameters.$domain ? parameters.$domain : getDomain() const config = parameters.$config - let path = '/api/v0/settings/values-get-by-unique-identifiers' + let path = '/api/v1/settings/values-get-by-unique-identifiers' let body let queryParameters = {} let form = {} @@ -608,7 +608,7 @@ export const ValueService_GetValueByUniqueIdentifiers = function(parameters = {} return request('post', domain + path, body, queryParameters, form, config) } export const ValueService_GetValueByUniqueIdentifiers_RAW_URL = function() { - return '/api/v0/settings/values-get-by-unique-identifiers' + return '/api/v1/settings/values-get-by-unique-identifiers' } export const ValueService_GetValueByUniqueIdentifiers_TYPE = function() { return 'post' @@ -616,7 +616,7 @@ export const ValueService_GetValueByUniqueIdentifiers_TYPE = function() { export const ValueService_GetValueByUniqueIdentifiersURL = function(parameters = {}) { let queryParameters = {} const domain = parameters.$domain ? parameters.$domain : getDomain() - let path = '/api/v0/settings/values-get-by-unique-identifiers' + let path = '/api/v1/settings/values-get-by-unique-identifiers' if (parameters.$queryParameters) { Object.keys(parameters.$queryParameters).forEach(function(parameterName) { queryParameters[parameterName] = parameters.$queryParameters[parameterName] @@ -626,17 +626,17 @@ export const ValueService_GetValueByUniqueIdentifiersURL = function(parameters = return domain + path + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(queryParameters[key])).join('&')) : '') } /** - * + * * request: ValueService_ListValues * url: ValueService_ListValuesURL * method: ValueService_ListValues_TYPE * raw_url: ValueService_ListValues_RAW_URL - * @param body - + * @param body - */ export const ValueService_ListValues = function(parameters = {}) { const domain = parameters.$domain ? parameters.$domain : getDomain() const config = parameters.$config - let path = '/api/v0/settings/values-list' + let path = '/api/v1/settings/values-list' let body let queryParameters = {} let form = {} @@ -654,7 +654,7 @@ export const ValueService_ListValues = function(parameters = {}) { return request('post', domain + path, body, queryParameters, form, config) } export const ValueService_ListValues_RAW_URL = function() { - return '/api/v0/settings/values-list' + return '/api/v1/settings/values-list' } export const ValueService_ListValues_TYPE = function() { return 'post' @@ -662,7 +662,7 @@ export const ValueService_ListValues_TYPE = function() { export const ValueService_ListValuesURL = function(parameters = {}) { let queryParameters = {} const domain = parameters.$domain ? parameters.$domain : getDomain() - let path = '/api/v0/settings/values-list' + let path = '/api/v1/settings/values-list' if (parameters.$queryParameters) { Object.keys(parameters.$queryParameters).forEach(function(parameterName) { queryParameters[parameterName] = parameters.$queryParameters[parameterName] @@ -672,17 +672,17 @@ export const ValueService_ListValuesURL = function(parameters = {}) { return domain + path + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(queryParameters[key])).join('&')) : '') } /** - * + * * request: ValueService_SaveValue * url: ValueService_SaveValueURL * method: ValueService_SaveValue_TYPE * raw_url: ValueService_SaveValue_RAW_URL - * @param body - + * @param body - */ export const ValueService_SaveValue = function(parameters = {}) { const domain = parameters.$domain ? parameters.$domain : getDomain() const config = parameters.$config - let path = '/api/v0/settings/values-save' + let path = '/api/v1/settings/values-save' let body let queryParameters = {} let form = {} @@ -700,7 +700,7 @@ export const ValueService_SaveValue = function(parameters = {}) { return request('post', domain + path, body, queryParameters, form, config) } export const ValueService_SaveValue_RAW_URL = function() { - return '/api/v0/settings/values-save' + return '/api/v1/settings/values-save' } export const ValueService_SaveValue_TYPE = function() { return 'post' @@ -708,7 +708,7 @@ export const ValueService_SaveValue_TYPE = function() { export const ValueService_SaveValueURL = function(parameters = {}) { let queryParameters = {} const domain = parameters.$domain ? parameters.$domain : getDomain() - let path = '/api/v0/settings/values-save' + let path = '/api/v1/settings/values-save' if (parameters.$queryParameters) { Object.keys(parameters.$queryParameters).forEach(function(parameterName) { queryParameters[parameterName] = parameters.$queryParameters[parameterName] @@ -716,4 +716,4 @@ export const ValueService_SaveValueURL = function(parameters = {}) { } let keys = Object.keys(queryParameters) return domain + path + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(queryParameters[key])).join('&')) : '') -} \ No newline at end of file +}