Skip to content

Commit

Permalink
feat(revoke): add revoke param skip nofitication and revoke in provider
Browse files Browse the repository at this point in the history
  • Loading branch information
idilhaq committed Nov 7, 2024
1 parent 8f8b145 commit de31e06
Show file tree
Hide file tree
Showing 4 changed files with 1,015 additions and 980 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ COMMIT := $(shell git rev-parse --short HEAD)
TAG := "$(shell git rev-list --tags --max-count=1)"
VERSION := "$(shell git describe --tags ${TAG})-next"
BUILD_DIR=dist
PROTON_COMMIT := "3e2516714cd9d1ae239fba1ce70c2b9a9f754240"
PROTON_COMMIT := "526e657b03d243a4c9f880e6c4ffbe15b116afd5"

.PHONY: all build clean test tidy vet proto setup format generate

Expand Down
9 changes: 8 additions & 1 deletion api/handler/v1beta1/grant.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,14 @@ func (s *GRPCServer) RevokeGrant(ctx context.Context, req *guardianv1beta1.Revok
return nil, status.Error(codes.Unauthenticated, "failed to get metadata: actor")
}

a, err := s.grantService.Revoke(ctx, req.GetId(), actor, req.GetReason())
var revokeOptions []grant.Option
if req.GetSkipNotification() {
revokeOptions = append(revokeOptions, grant.SkipNotifications())
}
if req.GetSkipRevokeInProvider() {
revokeOptions = append(revokeOptions, grant.SkipRevokeAccessInProvider())
}
a, err := s.grantService.Revoke(ctx, req.GetId(), actor, req.GetReason(), revokeOptions...)
if err != nil {
if errors.Is(err, grant.ErrGrantNotFound) {
return nil, status.Error(codes.NotFound, "grant not found")
Expand Down
Loading

0 comments on commit de31e06

Please sign in to comment.