From a037eeeeeea14d7841588e652fb77ed5d6953074 Mon Sep 17 00:00:00 2001 From: Martin Albert Date: Fri, 11 Aug 2023 09:50:53 +0200 Subject: [PATCH] Add user annotations for skipping ents and grants --- pkg/connector/connector.go | 1 + pkg/connector/helpers.go | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/pkg/connector/connector.go b/pkg/connector/connector.go index 23cb001..f2b1060 100644 --- a/pkg/connector/connector.go +++ b/pkg/connector/connector.go @@ -20,6 +20,7 @@ var ( Traits: []v2.ResourceType_Trait{ v2.ResourceType_TRAIT_USER, }, + Annotations: annotationsForUserResourceType(), } resourceTypeTeam = &v2.ResourceType{ Id: "team", diff --git a/pkg/connector/helpers.go b/pkg/connector/helpers.go index b41a44c..f600443 100644 --- a/pkg/connector/helpers.go +++ b/pkg/connector/helpers.go @@ -3,6 +3,7 @@ package connector import ( "github.com/conductorone/baton-hubspot/pkg/hubspot" v2 "github.com/conductorone/baton-sdk/pb/c1/connector/v2" + "github.com/conductorone/baton-sdk/pkg/annotations" "github.com/conductorone/baton-sdk/pkg/pagination" "golang.org/x/text/cases" "golang.org/x/text/language" @@ -11,6 +12,12 @@ import ( var ResourcesPageSize = 50 var titleCaser = cases.Title(language.English) +func annotationsForUserResourceType() annotations.Annotations { + annos := annotations.Annotations{} + annos.Update(&v2.SkipEntitlementsAndGrants{}) + return annos +} + func parsePageToken(i string, resourceID *v2.ResourceId) (*pagination.Bag, error) { b := &pagination.Bag{} err := b.Unmarshal(i)