Skip to content

Commit f9157db

Browse files
committed
Update Readme
1 parent 3cf99ed commit f9157db

File tree

1 file changed

+72
-18
lines changed

1 file changed

+72
-18
lines changed

README.md

+72-18
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![GoDoc](https://godoc.org/github.com/studio-b12/gowebdav?status.svg)](https://godoc.org/github.com/studio-b12/gowebdav)
66
[![Go Report Card](https://goreportcard.com/badge/github.com/studio-b12/gowebdav)](https://goreportcard.com/report/github.com/studio-b12/gowebdav)
77

8-
A pure Golang WebDAV client library that comes with a reference implementation.
8+
A pure Golang WebDAV client library that comes with a [reference implementation](https://github.com/studio-b12/gowebdav/tree/master/cmd/gowebdav).
99

1010
## Features at a glance
1111

@@ -23,12 +23,13 @@ Our `gowebdav` library allows to perform following actions on the remote WebDAV
2323
It also provides an [authentication API](#type-authenticator) that makes it easy to encapsulate and control complex authentication challenges.
2424
The default implementation negotiates the algorithm based on the user's preferences and the methods offered by the remote server.
2525

26-
Out-of-box support for:
26+
Out-of-box authentication support for:
2727

2828
* [BasicAuth](https://en.wikipedia.org/wiki/Basic_access_authentication)
2929
* [DigestAuth](https://en.wikipedia.org/wiki/Digest_access_authentication)
30-
* [Kerberos comming](https://github.com/studio-b12/gowebdav/pull/71#issuecomment-1416465334)
31-
30+
* [MS-PASS](https://github.com/studio-b12/gowebdav/pull/70#issuecomment-1421713726)
31+
* [WIP Kerberos](https://github.com/studio-b12/gowebdav/pull/71#issuecomment-1416465334)
32+
* [WIP Bearer Token](https://github.com/studio-b12/gowebdav/issues/61)
3233

3334
## Usage
3435

@@ -189,6 +190,7 @@ included.
189190
* [type AuthFactory](#AuthFactory)
190191
* [type Authenticator](#Authenticator)
191192
* [func NewDigestAuth(login, secret string, rs *http.Response) (Authenticator, error)](#NewDigestAuth)
193+
* [func NewPassportAuth(c *http.Client, user, pw, partnerURL string, header *http.Header) (Authenticator, error)](#NewPassportAuth)
192194
* [type Authorizer](#Authorizer)
193195
* [func NewAutoAuth(login string, secret string) Authorizer](#NewAutoAuth)
194196
* [func NewEmptyAuth() Authorizer](#NewEmptyAuth)
@@ -238,14 +240,20 @@ included.
238240
* [func (f File) Size() int64](#File.Size)
239241
* [func (f File) String() string](#File.String)
240242
* [func (f File) Sys() interface{}](#File.Sys)
243+
* [type PassportAuth](#PassportAuth)
244+
* [func (p *PassportAuth) Authorize(c *http.Client, rq *http.Request, path string) error](#PassportAuth.Authorize)
245+
* [func (p *PassportAuth) Clone() Authenticator](#PassportAuth.Clone)
246+
* [func (p *PassportAuth) Close() error](#PassportAuth.Close)
247+
* [func (p *PassportAuth) String() string](#PassportAuth.String)
248+
* [func (p *PassportAuth) Verify(c *http.Client, rs *http.Response, path string) (redo bool, err error)](#PassportAuth.Verify)
241249
* [type StatusError](#StatusError)
242250
* [func (se StatusError) Error() string](#StatusError.Error)
243251

244252
##### <a name="pkg-examples">Examples</a>
245253
* [PathEscape](#example_PathEscape)
246254

247255
##### <a name="pkg-files">Package files</a>
248-
[auth.go](https://github.com/studio-b12/gowebdav/blob/master/auth.go) [basicAuth.go](https://github.com/studio-b12/gowebdav/blob/master/basicAuth.go) [client.go](https://github.com/studio-b12/gowebdav/blob/master/client.go) [digestAuth.go](https://github.com/studio-b12/gowebdav/blob/master/digestAuth.go) [doc.go](https://github.com/studio-b12/gowebdav/blob/master/doc.go) [errors.go](https://github.com/studio-b12/gowebdav/blob/master/errors.go) [file.go](https://github.com/studio-b12/gowebdav/blob/master/file.go) [netrc.go](https://github.com/studio-b12/gowebdav/blob/master/netrc.go) [requests.go](https://github.com/studio-b12/gowebdav/blob/master/requests.go) [utils.go](https://github.com/studio-b12/gowebdav/blob/master/utils.go)
256+
[auth.go](https://github.com/studio-b12/gowebdav/blob/master/auth.go) [basicAuth.go](https://github.com/studio-b12/gowebdav/blob/master/basicAuth.go) [client.go](https://github.com/studio-b12/gowebdav/blob/master/client.go) [digestAuth.go](https://github.com/studio-b12/gowebdav/blob/master/digestAuth.go) [doc.go](https://github.com/studio-b12/gowebdav/blob/master/doc.go) [errors.go](https://github.com/studio-b12/gowebdav/blob/master/errors.go) [file.go](https://github.com/studio-b12/gowebdav/blob/master/file.go) [netrc.go](https://github.com/studio-b12/gowebdav/blob/master/netrc.go) [passportAuth.go](https://github.com/studio-b12/gowebdav/blob/master/passportAuth.go) [requests.go](https://github.com/studio-b12/gowebdav/blob/master/requests.go) [utils.go](https://github.com/studio-b12/gowebdav/blob/master/utils.go)
249257

250258
### <a name="pkg-constants">Constants</a>
251259
``` go
@@ -382,6 +390,13 @@ func NewDigestAuth(login, secret string, rs *http.Response) (Authenticator, erro
382390
```
383391
NewDigestAuth creates a new instance of our Digest Authenticator
384392

393+
#### <a name="NewPassportAuth">func</a> [NewPassportAuth](https://github.com/studio-b12/gowebdav/blob/master/passportAuth.go?s=386:495#L21)
394+
``` go
395+
func NewPassportAuth(c *http.Client, user, pw, partnerURL string, header *http.Header) (Authenticator, error)
396+
```
397+
constructor for PassportAuth creates a new PassportAuth object and
398+
automatically authenticates against the given partnerURL
399+
385400
### <a name="Authorizer">type</a> [Authorizer](https://github.com/studio-b12/gowebdav/blob/master/auth.go?s=349:764#L17)
386401
``` go
387402
type Authorizer interface {
@@ -407,7 +422,7 @@ based on the order of the registered Authenticators
407422
and the remotely offered authentication methods.
408423
First In, First Out.
409424

410-
#### <a name="NewEmptyAuth">func</a> [NewEmptyAuth](https://github.com/studio-b12/gowebdav/blob/master/auth.go?s=4486:4516#L128)
425+
#### <a name="NewEmptyAuth">func</a> [NewEmptyAuth](https://github.com/studio-b12/gowebdav/blob/master/auth.go?s=4694:4724#L132)
411426
``` go
412427
func NewEmptyAuth() Authorizer
413428
```
@@ -416,7 +431,7 @@ The order of adding the Authenticator matters.
416431
First In, First Out.
417432
It offers the `NewAutoAuth` features.
418433

419-
#### <a name="NewPreemptiveAuth">func</a> [NewPreemptiveAuth](https://github.com/studio-b12/gowebdav/blob/master/auth.go?s=5092:5145#L144)
434+
#### <a name="NewPreemptiveAuth">func</a> [NewPreemptiveAuth](https://github.com/studio-b12/gowebdav/blob/master/auth.go?s=5300:5353#L148)
420435
``` go
421436
func NewPreemptiveAuth(auth Authenticator) Authorizer
422437
```
@@ -497,25 +512,25 @@ func (c *Client) Connect() error
497512
```
498513
Connect connects to our dav server
499514

500-
#### <a name="Client.Copy">func</a> (\*Client) [Copy](https://github.com/studio-b12/gowebdav/blob/master/client.go?s=6804:6872#L310)
515+
#### <a name="Client.Copy">func</a> (\*Client) [Copy](https://github.com/studio-b12/gowebdav/blob/master/client.go?s=6815:6883#L310)
501516
``` go
502517
func (c *Client) Copy(oldpath, newpath string, overwrite bool) error
503518
```
504519
Copy copies a file from A to B
505520

506-
#### <a name="Client.Mkdir">func</a> (\*Client) [Mkdir](https://github.com/studio-b12/gowebdav/blob/master/client.go?s=5779:5841#L259)
521+
#### <a name="Client.Mkdir">func</a> (\*Client) [Mkdir](https://github.com/studio-b12/gowebdav/blob/master/client.go?s=5790:5852#L259)
507522
``` go
508523
func (c *Client) Mkdir(path string, _ os.FileMode) (err error)
509524
```
510525
Mkdir makes a directory
511526

512-
#### <a name="Client.MkdirAll">func</a> (\*Client) [MkdirAll](https://github.com/studio-b12/gowebdav/blob/master/client.go?s=6054:6119#L273)
527+
#### <a name="Client.MkdirAll">func</a> (\*Client) [MkdirAll](https://github.com/studio-b12/gowebdav/blob/master/client.go?s=6065:6130#L273)
513528
``` go
514529
func (c *Client) MkdirAll(path string, _ os.FileMode) (err error)
515530
```
516531
MkdirAll like mkdir -p, but for webdav
517532

518-
#### <a name="Client.Read">func</a> (\*Client) [Read](https://github.com/studio-b12/gowebdav/blob/master/client.go?s=6978:7028#L315)
533+
#### <a name="Client.Read">func</a> (\*Client) [Read](https://github.com/studio-b12/gowebdav/blob/master/client.go?s=6989:7039#L315)
519534
``` go
520535
func (c *Client) Read(path string) ([]byte, error)
521536
```
@@ -527,13 +542,13 @@ func (c *Client) ReadDir(path string) ([]os.FileInfo, error)
527542
```
528543
ReadDir reads the contents of a remote directory
529544

530-
#### <a name="Client.ReadStream">func</a> (\*Client) [ReadStream](https://github.com/studio-b12/gowebdav/blob/master/client.go?s=7339:7402#L333)
545+
#### <a name="Client.ReadStream">func</a> (\*Client) [ReadStream](https://github.com/studio-b12/gowebdav/blob/master/client.go?s=7350:7413#L333)
531546
``` go
532547
func (c *Client) ReadStream(path string) (io.ReadCloser, error)
533548
```
534549
ReadStream reads the stream for a given path
535550

536-
#### <a name="Client.ReadStreamRange">func</a> (\*Client) [ReadStreamRange](https://github.com/studio-b12/gowebdav/blob/master/client.go?s=8151:8241#L355)
551+
#### <a name="Client.ReadStreamRange">func</a> (\*Client) [ReadStreamRange](https://github.com/studio-b12/gowebdav/blob/master/client.go?s=8162:8252#L355)
537552
``` go
538553
func (c *Client) ReadStreamRange(path string, offset, length int64) (io.ReadCloser, error)
539554
```
@@ -546,19 +561,19 @@ If the server does not support partial content requests and returns full content
546561
this function will emulate the behavior by skipping `offset` bytes and limiting the result
547562
to `length`.
548563

549-
#### <a name="Client.Remove">func</a> (\*Client) [Remove](https://github.com/studio-b12/gowebdav/blob/master/client.go?s=5285:5327#L236)
564+
#### <a name="Client.Remove">func</a> (\*Client) [Remove](https://github.com/studio-b12/gowebdav/blob/master/client.go?s=5296:5338#L236)
550565
``` go
551566
func (c *Client) Remove(path string) error
552567
```
553568
Remove removes a remote file
554569

555-
#### <a name="Client.RemoveAll">func</a> (\*Client) [RemoveAll](https://github.com/studio-b12/gowebdav/blob/master/client.go?s=5393:5438#L241)
570+
#### <a name="Client.RemoveAll">func</a> (\*Client) [RemoveAll](https://github.com/studio-b12/gowebdav/blob/master/client.go?s=5404:5449#L241)
556571
``` go
557572
func (c *Client) RemoveAll(path string) error
558573
```
559574
RemoveAll removes remote files
560575

561-
#### <a name="Client.Rename">func</a> (\*Client) [Rename](https://github.com/studio-b12/gowebdav/blob/master/client.go?s=6638:6708#L305)
576+
#### <a name="Client.Rename">func</a> (\*Client) [Rename](https://github.com/studio-b12/gowebdav/blob/master/client.go?s=6649:6719#L305)
562577
``` go
563578
func (c *Client) Rename(oldpath, newpath string, overwrite bool) error
564579
```
@@ -600,13 +615,13 @@ func (c *Client) Stat(path string) (os.FileInfo, error)
600615
```
601616
Stat returns the file stats for a specified path
602617

603-
#### <a name="Client.Write">func</a> (\*Client) [Write](https://github.com/studio-b12/gowebdav/blob/master/client.go?s=9261:9336#L389)
618+
#### <a name="Client.Write">func</a> (\*Client) [Write](https://github.com/studio-b12/gowebdav/blob/master/client.go?s=9272:9347#L389)
604619
``` go
605620
func (c *Client) Write(path string, data []byte, _ os.FileMode) (err error)
606621
```
607622
Write writes data to a given path
608623

609-
#### <a name="Client.WriteStream">func</a> (\*Client) [WriteStream](https://github.com/studio-b12/gowebdav/blob/master/client.go?s=9760:9846#L419)
624+
#### <a name="Client.WriteStream">func</a> (\*Client) [WriteStream](https://github.com/studio-b12/gowebdav/blob/master/client.go?s=9771:9857#L419)
610625
``` go
611626
func (c *Client) WriteStream(path string, stream io.Reader, _ os.FileMode) (err error)
612627
```
@@ -720,6 +735,45 @@ func (f File) Sys() interface{}
720735
```
721736
Sys ????
722737

738+
### <a name="PassportAuth">type</a> [PassportAuth](https://github.com/studio-b12/gowebdav/blob/master/passportAuth.go?s=125:254#L12)
739+
``` go
740+
type PassportAuth struct {
741+
// contains filtered or unexported fields
742+
}
743+
744+
```
745+
PassportAuth structure holds our credentials
746+
747+
#### <a name="PassportAuth.Authorize">func</a> (\*PassportAuth) [Authorize](https://github.com/studio-b12/gowebdav/blob/master/passportAuth.go?s=690:775#L32)
748+
``` go
749+
func (p *PassportAuth) Authorize(c *http.Client, rq *http.Request, path string) error
750+
```
751+
Authorize the current request
752+
753+
#### <a name="PassportAuth.Clone">func</a> (\*PassportAuth) [Clone](https://github.com/studio-b12/gowebdav/blob/master/passportAuth.go?s=1701:1745#L69)
754+
``` go
755+
func (p *PassportAuth) Clone() Authenticator
756+
```
757+
Clone creates a Copy of itself
758+
759+
#### <a name="PassportAuth.Close">func</a> (\*PassportAuth) [Close](https://github.com/studio-b12/gowebdav/blob/master/passportAuth.go?s=1613:1649#L64)
760+
``` go
761+
func (p *PassportAuth) Close() error
762+
```
763+
Close cleans up all resources
764+
765+
#### <a name="PassportAuth.String">func</a> (\*PassportAuth) [String](https://github.com/studio-b12/gowebdav/blob/master/passportAuth.go?s=2048:2086#L83)
766+
``` go
767+
func (p *PassportAuth) String() string
768+
```
769+
String toString
770+
771+
#### <a name="PassportAuth.Verify">func</a> (\*PassportAuth) [Verify](https://github.com/studio-b12/gowebdav/blob/master/passportAuth.go?s=1075:1175#L46)
772+
``` go
773+
func (p *PassportAuth) Verify(c *http.Client, rs *http.Response, path string) (redo bool, err error)
774+
```
775+
Verify verifies if the authentication is good
776+
723777
### <a name="StatusError">type</a> [StatusError](https://github.com/studio-b12/gowebdav/blob/master/errors.go?s=499:538#L18)
724778
``` go
725779
type StatusError struct {

0 commit comments

Comments
 (0)