@@ -120,20 +120,6 @@ func TestHandler_CreatePermission(t *testing.T) {
120120 want : nil ,
121121 wantErr : connect .NewError (connect .CodeInvalidArgument , ErrPermissionKeyNotation ),
122122 },
123- {
124- name : "should return bad request error if deprecated fields are sent without key" ,
125- setup : func (as * mocks.PermissionService , bs * mocks.BootstrapService ) {},
126- request : connect .NewRequest (& frontierv1beta1.CreatePermissionRequest {
127- Bodies : []* frontierv1beta1.PermissionRequestBody {
128- {
129- Name : testPermissions [testPermissionIdx ].Name ,
130- Namespace : testPermissions [testPermissionIdx ].NamespaceID ,
131- },
132- },
133- }),
134- want : nil ,
135- wantErr : connect .NewError (connect .CodeInvalidArgument , ErrPermissionKeyNotation ),
136- },
137123 {
138124 name : "should return success if permission service return nil error" ,
139125 setup : func (as * mocks.PermissionService , bs * mocks.BootstrapService ) {
@@ -181,16 +167,12 @@ func TestHandler_CreatePermission(t *testing.T) {
181167 Permissions : []* frontierv1beta1.Permission {
182168 {
183169 Id : testPermissions [testPermissionIdx ].ID ,
184- Name : testPermissions [testPermissionIdx ].Name + "0" ,
185- Namespace : testPermissions [testPermissionIdx ].NamespaceID ,
186170 Key : schema .PermissionKeyFromNamespaceAndName (testPermissions [testPermissionIdx ].NamespaceID , testPermissions [testPermissionIdx ].Name + "0" ),
187171 CreatedAt : timestamppb .New (testPermissions [testPermissionIdx ].CreatedAt ),
188172 UpdatedAt : timestamppb .New (testPermissions [testPermissionIdx ].UpdatedAt ),
189173 },
190174 {
191175 Id : testPermissions [testPermissionIdx ].ID ,
192- Name : testPermissions [testPermissionIdx ].Name + "1" ,
193- Namespace : testPermissions [testPermissionIdx ].NamespaceID ,
194176 Key : schema .PermissionKeyFromNamespaceAndName (testPermissions [testPermissionIdx ].NamespaceID , testPermissions [testPermissionIdx ].Name + "1" ),
195177 CreatedAt : timestamppb .New (testPermissions [testPermissionIdx ].CreatedAt ),
196178 UpdatedAt : timestamppb .New (testPermissions [testPermissionIdx ].UpdatedAt ),
@@ -233,8 +215,6 @@ func TestHandler_CreatePermission(t *testing.T) {
233215 Permissions : []* frontierv1beta1.Permission {
234216 {
235217 Id : testPermissions [testPermissionIdx ].ID ,
236- Name : testPermissions [testPermissionIdx ].Name + "0" ,
237- Namespace : testPermissions [testPermissionIdx ].NamespaceID ,
238218 Key : schema .PermissionKeyFromNamespaceAndName (testPermissions [testPermissionIdx ].NamespaceID , testPermissions [testPermissionIdx ].Name + "0" ),
239219 CreatedAt : timestamppb .New (testPermissions [testPermissionIdx ].CreatedAt ),
240220 UpdatedAt : timestamppb .New (testPermissions [testPermissionIdx ].UpdatedAt ),
@@ -452,19 +432,6 @@ func TestHandler_UpdatePermission(t *testing.T) {
452432 want : nil ,
453433 wantErr : connect .NewError (connect .CodeInvalidArgument , schema .ValidateCustomPermission ("Ab/resource" , "get" )),
454434 },
455- {
456- name : "should return bad request error if deprecated fields are sent without key" ,
457- setup : func (as * mocks.PermissionService ) {},
458- request : connect .NewRequest (& frontierv1beta1.UpdatePermissionRequest {
459- Id : testPermissions [testPermissionIdx ].ID ,
460- Body : & frontierv1beta1.PermissionRequestBody {
461- Name : testPermissions [testPermissionIdx ].Name ,
462- Namespace : testPermissions [testPermissionIdx ].NamespaceID ,
463- },
464- }),
465- want : nil ,
466- wantErr : connect .NewError (connect .CodeInvalidArgument , ErrPermissionKeyNotation ),
467- },
468435 {
469436 name : "should return success if permission service return nil error" ,
470437 setup : func (as * mocks.PermissionService ) {
@@ -483,8 +450,6 @@ func TestHandler_UpdatePermission(t *testing.T) {
483450 want : connect .NewResponse (& frontierv1beta1.UpdatePermissionResponse {
484451 Permission : & frontierv1beta1.Permission {
485452 Id : testPermissions [testPermissionIdx ].ID ,
486- Name : testPermissions [testPermissionIdx ].Name ,
487- Namespace : testPermissions [testPermissionIdx ].NamespaceID ,
488453 Key : schema .PermissionKeyFromNamespaceAndName (testPermissions [testPermissionIdx ].NamespaceID , testPermissions [testPermissionIdx ].Name ),
489454 CreatedAt : timestamppb .New (testPermissions [testPermissionIdx ].CreatedAt ),
490455 UpdatedAt : timestamppb .New (testPermissions [testPermissionIdx ].UpdatedAt ),
@@ -537,24 +502,18 @@ func TestHandler_ListPermissions(t *testing.T) {
537502 Permissions : []* frontierv1beta1.Permission {
538503 {
539504 Id : testPermissions [0 ].ID ,
540- Name : testPermissions [0 ].Name ,
541- Namespace : testPermissions [0 ].NamespaceID ,
542505 Key : schema .PermissionKeyFromNamespaceAndName (testPermissions [0 ].NamespaceID , testPermissions [0 ].Name ),
543506 CreatedAt : timestamppb .New (testPermissions [0 ].CreatedAt ),
544507 UpdatedAt : timestamppb .New (testPermissions [0 ].UpdatedAt ),
545508 },
546509 {
547510 Id : testPermissions [1 ].ID ,
548- Name : testPermissions [1 ].Name ,
549- Namespace : testPermissions [1 ].NamespaceID ,
550511 Key : schema .PermissionKeyFromNamespaceAndName (testPermissions [1 ].NamespaceID , testPermissions [1 ].Name ),
551512 CreatedAt : timestamppb .New (testPermissions [1 ].CreatedAt ),
552513 UpdatedAt : timestamppb .New (testPermissions [1 ].UpdatedAt ),
553514 },
554515 {
555516 Id : testPermissions [2 ].ID ,
556- Name : testPermissions [2 ].Name ,
557- Namespace : testPermissions [2 ].NamespaceID ,
558517 Key : schema .PermissionKeyFromNamespaceAndName (testPermissions [2 ].NamespaceID , testPermissions [2 ].Name ),
559518 CreatedAt : timestamppb .New (testPermissions [2 ].CreatedAt ),
560519 UpdatedAt : timestamppb .New (testPermissions [2 ].UpdatedAt ),
@@ -630,8 +589,6 @@ func TestHandler_GetPermission(t *testing.T) {
630589 want : connect .NewResponse (& frontierv1beta1.GetPermissionResponse {
631590 Permission : & frontierv1beta1.Permission {
632591 Id : testPermissions [testPermissionIdx ].ID ,
633- Name : testPermissions [testPermissionIdx ].Name ,
634- Namespace : testPermissions [testPermissionIdx ].NamespaceID ,
635592 Key : schema .PermissionKeyFromNamespaceAndName (testPermissions [testPermissionIdx ].NamespaceID , testPermissions [testPermissionIdx ].Name ),
636593 CreatedAt : timestamppb .New (testPermissions [testPermissionIdx ].CreatedAt ),
637594 UpdatedAt : timestamppb .New (testPermissions [testPermissionIdx ].UpdatedAt ),
0 commit comments