Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions api/types/accesslist/accesslist.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package accesslist

import (
"encoding/json"
"fmt"
"time"

"github.com/gravitational/trace"
Expand Down Expand Up @@ -235,17 +236,17 @@ func (a *AccessList) MatchSearch(values []string) bool {
}

func (a *Audit) UnmarshalJSON(data []byte) error {
var audit map[string]string
var audit map[string]interface{}
if err := json.Unmarshal(data, &audit); err != nil {
return trace.Wrap(err)
}

var err error
a.Frequency, err = time.ParseDuration(audit["frequency"])
a.Frequency, err = time.ParseDuration(fmt.Sprintf("%v", audit["frequency"]))
if err != nil {
return trace.Wrap(err)
}
a.NextAuditDate, err = time.Parse(time.RFC3339Nano, audit["next_audit_date"])
a.NextAuditDate, err = time.Parse(time.RFC3339Nano, fmt.Sprintf("%v", audit["next_audit_date"]))
if err != nil {
return trace.Wrap(err)
}
Expand Down