Commit Graph

192 Commits

Author SHA1 Message Date
shoopea f073d3021d remove all debug 2024-01-20 12:33:07 +01:00
shoopea d8c0f204df test 2024-01-20 12:18:22 +01:00
shoopea 45e36d9254 details 2024-01-20 12:11:08 +01:00
shoopea 526c74ad21 fix 2024-01-20 12:06:08 +01:00
shoopea 1dc1a2b378 still more debug 2024-01-20 12:05:02 +01:00
shoopea e3bd2a5fb2 even more debug 2024-01-20 11:59:18 +01:00
shoopea 331e1f8e16 more debug 2024-01-20 11:43:26 +01:00
shoopea d59e787694 debug 2024-01-20 11:27:24 +01:00
shoopea 42ddb5a83e migrate 2024-01-20 11:02:25 +01:00
Christoph Polcin f9157dbec1 Update Readme 2023-06-22 14:01:37 +02:00
Yuriy Zaytsev 3cf99ede06 Fix missing last modified time on Stat() 2023-06-22 13:42:44 +02:00
Julian Imhof ea9c8490dd feat(auth): add support for MS-PASS
typo: fix comment


fix: fix verify flow and precompile cookies


fix: implement requested changes


fix: implement requested changes


fix: implement requested changes


test(auth): add test for MS-PASS


fix: remove pointless return
2023-06-22 13:37:18 +02:00
Christoph Polcin 036581a6c8 io.Discard is already handeld by Body.Close() 2023-06-22 13:32:03 +02:00
Christoph Polcin 11f0c10ed2 Runs test on go 1.18, 1.19 and 1.20 2023-06-22 13:32:03 +02:00
Christoph Polcin b601d4bcbf Update preemtiveAuthorizer documentation 2023-06-22 13:32:03 +02:00
Christoph Polcin 9c049da1f7 Updates API 2023-06-22 13:32:03 +02:00
Christoph Polcin fcd6cac508 Removes panic from authShim 2023-06-22 13:32:03 +02:00
Christoph Polcin a4cd839b8a Adds len checks to negoAuth 2023-06-22 13:32:03 +02:00
Christoph Polcin d59c1705b2 Explicit assignment of struct fields 2023-06-22 13:32:03 +02:00
Christoph Polcin ad27fc07a7 Adds interface documentation 2023-06-22 13:32:03 +02:00
Steffen Brüheim 5fd8037a63 Add multiple auth test 2023-06-22 13:32:03 +02:00
Christoph Polcin ca40e2802e Feat: Authentication API
The changes simplify the `req` method by moving the
authentication-related code into the API.
This makes it easy to add additional authentication methods.

The API introduces an `Authorizer` that acts as an
authenticator factory. The authentication flow itself
is divided down into `Authorize` and `Verify` steps in order
to encapsulate and control complex authentication challenges.

The default `NewAutoAuth` negotiates the algorithms.
Under the hood, it creates an authenticator shim per request,
which delegates the authentication flow to our authenticators.

The `NewEmptyAuth` and `NewPreemptiveAuth` authorizers
allow you to have more control over algorithms and resources.

The API also allows interception of the redirect mechanism by setting
the `XInhibitRedirect` header.

This closes: #15 #24 #38
2023-06-22 13:32:03 +02:00
Christoph Polcin 3282f94193 Feat: Makefile adds target dependencies 2023-02-03 21:22:12 +01:00
yyeltsyn cd21842fb6
fix: Allow concurrent use for DigestAuth (#69)
fix: Allow concurrent use for DigestAuth
2023-02-03 18:59:54 +01:00
Steffen Brüheim 60ec5ad560 Fixes #64 Support for cookies
expose a SetJar method to set a http.CookieJar to the http client
2022-11-09 18:19:24 +01:00
Christoph Polcin 200a600c02 Add TestWriteStreamFromPipe 2022-11-02 16:54:56 +01:00
Christoph Polcin 17255f2e74 Updates badges 2022-10-16 01:27:16 +02:00
Christoph Polcin 937a18c9a3 removes travis-ci 2022-10-16 01:22:06 +02:00
Christoph Polcin d2a480ffa9 updates workflows 2022-10-16 01:13:50 +02:00
Christoph Polcin 8528c01163 updates API 2022-10-16 01:02:00 +02:00
Christoph Polcin bf6102194f fix: Write creates parent collections on 404 2022-10-16 00:59:14 +02:00
Christoph Polcin 2c20e7e763 Revert "feat: handle 404 on propfind (#57)"
This reverts commit 8190232c06.
2022-10-16 00:59:14 +02:00
Christoph Polcin fbeb69f25b Add client tests 2022-10-16 00:59:05 +02:00
Christoph Polcin 4adca27344 uses log instead of fmt 2022-10-15 14:44:49 +02:00
Felipe Martin Garcia 8190232c06
feat: handle 404 on propfind (#57)
Client.Stat was not returning a proper Go err for not found files, the
ideal way to check this is using `errors.Is(err, fs.ErrNotExist)` but
the client was returning a generic error.

I've updated the `propfind` to take 404 errors into account, retuning
the above error making easier to evaluate that kind of situations.
2022-10-13 23:11:52 +02:00
zhijian e70a598e94
supports get range offset with unkown length (#58)
https://www.rfc-editor.org/rfc/rfc9110.html#name-byte-ranges
2022-10-12 18:09:28 +02:00
Ringo Hoffmann c7b1ff8a5e
Improve Error Handling (#54)
* bubble up request errors [#28]

* inhibit stream close on request

* add `StatusError`

* `PUT`: check if given target is a directory

* Revert "inhibit stream close on request"

Cherry-picked into branch dev-bodyclosing.

This reverts commit 2889239999.

Co-authored-by: Christoph Polcin <coco@miconoco.de>
2022-01-28 17:20:35 +01:00
Christoph Polcin a047320e42 Updates README 2022-01-27 16:33:26 +01:00
Christoph Polcin b5bd04e2b5 Escapes destination path on copy and move #42 2022-01-27 16:32:05 +01:00
Ringo Hoffmann 3f8721cd4b fix crash when req is called with no body 2021-11-09 09:32:28 +01:00
Ringo Hoffmann adba8dc051 add .vscode directory 2021-11-09 09:32:28 +01:00
Ringo Hoffmann 2f2cda4122 use seeker when available on request 2021-11-08 09:54:01 +01:00
Ringo Hoffmann 73a7f0bf37 add artifacts workflow 2021-11-07 22:37:54 +01:00
Ringo Hoffmann aff231de53 add github workflow for unit tests 2021-11-07 22:36:17 +01:00
Ringo Hoffmann e5dd1e70b1 create go module 2021-11-07 22:35:47 +01:00
Christoph Polcin 29e74efa70
Merge pull request #46 from jkowalski/read-stream-range
added ReadStreamRange() method to efficiently read a range of data
2021-11-06 10:05:35 +01:00
Jarek Kowalski 741fdbda3d added ReadStreamRange() method to efficiently read a range of data
It passes "Range: bytes=X-Y" and if the server returns HTTP 206,
we know it complied with the request.

For servers that don't understand range and return HTTP 200 instead we
discard some bytes and limit the result to emulate this behavior.

This will greatly help https://github.com/kopia/kopia which relies on
partial reads from pack blobs.
2021-11-04 23:32:32 -07:00
Christoph Polcin a3a86976a1
Merge pull request #45 from marcelblijleven/master
Fix index out of range runtime error when empty string is provided to FixSlashes
2021-09-17 15:32:50 +02:00
Marcel Blijleven a2cbdfa976 Fix index out of range runtime error when provided string is empty 2021-09-17 13:24:28 +02:00
Marcel Blijleven 9a1ba21162 Fix typo in description 2021-09-17 13:23:09 +02:00