Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
jirwin committed Feb 6, 2024
1 parent d886bf0 commit 2234e2b
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions pkg/sync/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
//}

0 comments on commit 2234e2b

Please sign in to comment.