Simplify Zendesk driver and share time parsing

Drop the zendeskRole helper and use the raw API role, matching the other
drivers. Factor the duplicated RFC3339 timestamp parsing (parseZendeskTime
and parseDatadogTime were identical) into a shared parseRFC3339Ptr in
driver.go.

Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
This commit is contained in:
Aurélien Sibiril
2026-06-04 19:09:04 +02:00
parent bc53f603eb
commit b92f7511b6
4 changed files with 22 additions and 47 deletions

View File

@@ -22,7 +22,6 @@ import (
"net/url"
"strconv"
"strings"
"time"
"go.probo.inc/probo/pkg/coredata"
)
@@ -148,7 +147,7 @@ func (d *DatadogDriver) ListAccounts(ctx context.Context) ([]AccountRecord, erro
AuthMethod: coredata.AccessEntryAuthMethodUnknown,
AccountType: accountType,
ExternalID: u.ID,
CreatedAt: parseDatadogTime(u.Attributes.CreatedAt),
CreatedAt: parseRFC3339Ptr(u.Attributes.CreatedAt),
})
}
@@ -197,16 +196,3 @@ func (d *DatadogDriver) queryUsers(ctx context.Context, page int) (*datadogUsers
return &out, nil
}
func parseDatadogTime(s string) *time.Time {
if s == "" {
return nil
}
t, err := time.Parse(time.RFC3339, s)
if err != nil {
return nil
}
return &t
}