Documentation
¶
Overview ¶
Package dav integrates IServ RFC 4918 WebDAV, RFC 4791 CalDAV/iCal, and RFC 6352 CardDAV/vCard endpoints using github.com/emersion/go-webdav, go-ical, and go-vcard with XXE and bounded-body hardening.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrUnsafeXML = errors.New("xml contains disallowed doctype or entity declaration")
ErrUnsafeXML is returned when an XML document contains disallowed DOCTYPE or ENTITY declarations.
Functions ¶
func CheckSafeXML ¶
CheckSafeXML rejects XML payloads containing DOCTYPE or ENTITY declarations to guard against XXE and entity-expansion attacks.
func DownloadWebDAV ¶
func DownloadWebDAV( ctx context.Context, sess *session.Session, filePath string, ) (io.ReadCloser, string, int64, string, error)
DownloadWebDAV opens a live download stream for filePath from IServ WebDAV. Callers must close the returned io.ReadCloser.
Types ¶
type CardDAVContact ¶
type CardDAVContact struct {
UID string
FullName string
FirstName string
LastName string
Email string
Role string
Department string
Groups []string
}
CardDAVContact represents a contact entry parsed from vCard / CardDAV responses.
func ParseVCardContacts ¶
func ParseVCardContacts(raw string) []CardDAVContact
ParseVCardContacts parses one or more RFC 2426 / 6350 VCARD blocks using github.com/emersion/go-vcard.
func SearchCardDAVContacts ¶
func SearchCardDAVContacts(ctx context.Context, sess *session.Session, query string) ([]CardDAVContact, error)
SearchCardDAVContacts discovers IServ CardDAV addressbooks and queries contacts using github.com/emersion/go-webdav/carddav and github.com/emersion/go-vcard.
type ICalEvent ¶
type ICalEvent struct {
UID string
Summary string
Description string
Location string
Start time.Time
End time.Time
AllDay bool
Categories []string
}
ICalEvent represents a parsed VEVENT component from RFC 5545 iCalendar data.
func FetchCalDAVEvents ¶
func FetchCalDAVEvents( ctx context.Context, sess *session.Session, caldavPath string, start, end time.Time, ) ([]ICalEvent, error)
FetchCalDAVEvents queries an IServ CalDAV endpoint using emersion/go-webdav/caldav and returns VEVENT items overlapping [start, end].
func ParseICalEvents ¶
ParseICalEvents parses RFC 5545 iCalendar text using github.com/emersion/go-ical.
type WebDAVEntry ¶
type WebDAVEntry struct {
Href string
Path string
Name string
IsDir bool
Size int64
ContentType string
ModifiedAt *time.Time
ETag string
}
WebDAVEntry describes a single file or directory returned by IServ WebDAV PROPFIND.
func ListWebDAV ¶
ListWebDAV performs a Depth: 1 PROPFIND against /webdav/<dirPath> via emersion/go-webdav.