Skip to content

Commit 993467b

Browse files
authored
refactor: Rename ListCurrentUserPATs to SearchCurrentUserPATs (#1476)
1 parent 9dba632 commit 993467b

6 files changed

Lines changed: 1508 additions & 1506 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ TAG := $(shell git rev-list --tags --max-count=1)
44
VERSION := $(shell git describe --tags ${TAG})
55
.PHONY: build check fmt lint test test-race vet test-cover-html help install proto admin-app compose-up-dev
66
.DEFAULT_GOAL := build
7-
PROTON_COMMIT := "3acffc58e07cdfdc080d041f4a1bdb5e8545bbd5"
7+
PROTON_COMMIT := "b891167da54d774968538c9261091899026e1825"
88

99
admin-app:
1010
@echo " > generating admin build"

internal/api/v1beta1connect/user_pat.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ func transformPATToPB(pat models.PAT, patValue string) *frontierv1beta1.PAT {
333333
return pbPAT
334334
}
335335

336-
func (h *ConnectHandler) ListCurrentUserPATs(ctx context.Context, request *connect.Request[frontierv1beta1.ListCurrentUserPATsRequest]) (*connect.Response[frontierv1beta1.ListCurrentUserPATsResponse], error) {
336+
func (h *ConnectHandler) SearchCurrentUserPATs(ctx context.Context, request *connect.Request[frontierv1beta1.SearchCurrentUserPATsRequest]) (*connect.Response[frontierv1beta1.SearchCurrentUserPATsResponse], error) {
337337
errorLogger := NewErrorLogger()
338338

339339
principal, err := h.GetLoggedInPrincipal(ctx)
@@ -356,7 +356,7 @@ func (h *ConnectHandler) ListCurrentUserPATs(ctx context.Context, request *conne
356356

357357
result, err := h.userPATService.List(ctx, userID, request.Msg.GetOrgId(), rqlQuery)
358358
if err != nil {
359-
errorLogger.LogServiceError(ctx, request, "ListCurrentUserPATs", err,
359+
errorLogger.LogServiceError(ctx, request, "SearchCurrentUserPATs", err,
360360
zap.String("user_id", userID),
361361
zap.String("org_id", request.Msg.GetOrgId()))
362362

@@ -373,7 +373,7 @@ func (h *ConnectHandler) ListCurrentUserPATs(ctx context.Context, request *conne
373373
pbPATs = append(pbPATs, transformPATToPB(pat, ""))
374374
}
375375

376-
return connect.NewResponse(&frontierv1beta1.ListCurrentUserPATsResponse{
376+
return connect.NewResponse(&frontierv1beta1.SearchCurrentUserPATsResponse{
377377
Pats: pbPATs,
378378
Pagination: &frontierv1beta1.RQLQueryPaginationResponse{
379379
Offset: uint32(result.Page.Offset),

pkg/server/connect_interceptors/authorization.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -714,8 +714,8 @@ var authorizationValidationMap = map[string]func(ctx context.Context, handler *v
714714
pbreq := req.(*connect.Request[frontierv1beta1.CreateCurrentUserPATRequest])
715715
return handler.IsAuthorized(ctx, relation.Object{Namespace: schema.OrganizationNamespace, ID: pbreq.Msg.GetOrgId()}, schema.GetPermission, req)
716716
},
717-
frontierv1beta1connect.FrontierServiceListCurrentUserPATsProcedure: func(ctx context.Context, handler *v1beta1connect.ConnectHandler, req connect.AnyRequest) error {
718-
pbreq := req.(*connect.Request[frontierv1beta1.ListCurrentUserPATsRequest])
717+
frontierv1beta1connect.FrontierServiceSearchCurrentUserPATsProcedure: func(ctx context.Context, handler *v1beta1connect.ConnectHandler, req connect.AnyRequest) error {
718+
pbreq := req.(*connect.Request[frontierv1beta1.SearchCurrentUserPATsRequest])
719719
return handler.IsAuthorized(ctx, relation.Object{Namespace: schema.OrganizationNamespace, ID: pbreq.Msg.GetOrgId()}, schema.GetPermission, req)
720720
},
721721

0 commit comments

Comments
 (0)