Skip to content

Commit

Permalink
fix auth middleware for app open
Browse files Browse the repository at this point in the history
  • Loading branch information
wkloucek committed Oct 7, 2021
1 parent 56bb05a commit 7e7e3fc
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pkg/auth/scope/publicshare.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,16 @@ func publicshareScope(ctx context.Context, scope *authpb.Scope, resource interfa
case *provider.InitiateFileUploadRequest:
return checkStorageRef(ctx, &share, v.GetRef(), client, mgr), nil
case *appregistry.GetAppProvidersRequest:
return utils.ResourceIDEqual(share.ResourceId, v.ResourceInfo.Id), nil
return checkStorageRef(ctx, &share, &provider.Reference{ResourceId: v.ResourceInfo.Id}, client, mgr), nil
case *appregistry.GetDefaultAppProviderForMimeTypeRequest:
return true, nil
case *appprovider.OpenInAppRequest:
return utils.ResourceIDEqual(share.ResourceId, v.ResourceInfo.Id), nil
return checkStorageRef(ctx, &share, &provider.Reference{ResourceId: v.ResourceInfo.Id}, client, mgr), nil
case *gatewayv1beta1.OpenInAppRequest:
return checkStorageRef(ctx, &share, v.GetRef(), client, mgr), nil

case *userv1beta1.GetUserByClaimRequest:
return true, nil

case *link.GetPublicShareRequest:
return checkPublicShareRef(&share, v.GetRef()), nil
Expand Down

0 comments on commit 7e7e3fc

Please sign in to comment.