carddav: add current-user-principal to server

This commit is contained in:
Simon Ser
2020-01-20 10:56:25 +01:00
parent d8ce7d353d
commit 3a61646ab4
4 changed files with 28 additions and 23 deletions

View File

@@ -11,6 +11,17 @@ import (
const Namespace = "DAV:"
var (
ResourceTypeName = xml.Name{"DAV:", "resourcetype"}
DisplayNameName = xml.Name{"DAV:", "displayname"}
GetContentLengthName = xml.Name{"DAV:", "getcontentlength"}
GetContentTypeName = xml.Name{"DAV:", "getcontenttype"}
GetLastModifiedName = xml.Name{"DAV:", "getlastmodified"}
GetETagName = xml.Name{"DAV:", "getetag"}
CurrentUserPrincipalName = xml.Name{"DAV:", "current-user-principal"}
)
type Status struct {
Code int
Text string
@@ -302,15 +313,6 @@ type GetLastModified struct {
LastModified Time `xml:",chardata"`
}
var (
ResourceTypeName = xml.Name{"DAV:", "resourcetype"}
DisplayNameName = xml.Name{"DAV:", "displayname"}
GetContentLengthName = xml.Name{"DAV:", "getcontentlength"}
GetContentTypeName = xml.Name{"DAV:", "getcontenttype"}
GetLastModifiedName = xml.Name{"DAV:", "getlastmodified"}
GetETagName = xml.Name{"DAV:", "getetag"}
)
// https://tools.ietf.org/html/rfc4918#section-14.5
type Error struct {
XMLName xml.Name `xml:"DAV: error"`
@@ -322,3 +324,10 @@ type DisplayName struct {
XMLName xml.Name `xml:"DAV: displayname"`
Name string `xml:",chardata"`
}
// https://tools.ietf.org/html/rfc5397#section-3
type CurrentUserPrincipal struct {
XMLName xml.Name `xml:"DAV: current-user-principal"`
Href string `xml:"href,omitempty"`
Unauthenticated *struct{} `xml:"unauthenticated,omitempty"`
}