diff --git a/pkg/sync/syncer.go b/pkg/sync/syncer.go index 8699fd31..32306333 100644 --- a/pkg/sync/syncer.go +++ b/pkg/sync/syncer.go @@ -1420,32 +1420,3 @@ func NewSyncer(ctx context.Context, c types.ConnectorClient, opts ...SyncOpt) (S return s, nil } - -// SyncEntitlementsForResource fetches the entitlements for a specific resource from the connector. -// TODO(jirwin): This commented out for lint, but we should revisit this method and fix it to use traits properly. -//func (s *syncer) ensurePrincipalExistence(ctx context.Context, principal *v2.Resource) error { -// l := ctxzap.Extract(ctx) -// // Check if the principal of the grant already exists as a resource. If it does not, we should jit the resource. -// _, err := s.store.GetResource(ctx, &reader_v2.ResourcesReaderServiceGetResourceRequest{ -// ResourceId: &v2.ResourceId{ -// ResourceType: principal.Id.ResourceType, -// Resource: principal.Id.Resource, -// }, -// }) -// if err != nil && errors.Is(err, sql.ErrNoRows) { -// // If the principal does not have a display name, we should set it to the resource ID -// if principal.DisplayName == "" { -// principal.DisplayName = fmt.Sprintf("%s:%s", principal.Id.ResourceType, principal.Id.Resource) -// } -// principal.CreationSource = v2.Resource_CREATION_SOURCE_CONNECTOR_LIST_GRANTS_PRINCIPAL_JIT -// l.Debug("putting principal resource", zap.String("resource_id", principal.Id.Resource), zap.String("resource_type_id", principal.Id.ResourceType)) -// err = s.store.PutResource(ctx, principal) -// if err != nil { -// return err -// } -// return nil -// } else if err != nil { -// return err -// } -// return nil -//}