Skip to content

Commit

Permalink
Update x/crypto
Browse files Browse the repository at this point in the history
  • Loading branch information
gregoryv committed Dec 19, 2023
1 parent 35a16a7 commit d8503e5
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 17 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [unreleased]

- Update x/crypto

## [0.2.0] - 2023-07-24

- Support hash algorithm names starting with SHA-
Expand Down
31 changes: 16 additions & 15 deletions digest.go
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
/* Package provides header generator for digest authentication.
/*
Package provides header generator for digest authentication.
The Auth object can be reused for subsequent requests.
Example:
req, _ := http.NewRequest("GET", "/", nil)
resp, _ := http.DefaultClient.Do(req)
if resp.StatusCode == http.StatusUnauthorized {
auth := NewAuth("john.doe", "secret")
err := auth.Parse(resp.Header.Get("www-authenticate"))
if err != nil {
// cannot authenticate using this package
}
auth.Authorize(req)
}
resp, _ := http.DefaultClient.Do(req)
// and for the next request just authorize it before sending
auth.Authorize(req2)
req, _ := http.NewRequest("GET", "/", nil)
resp, _ := http.DefaultClient.Do(req)
if resp.StatusCode == http.StatusUnauthorized {
auth := NewAuth("john.doe", "secret")
err := auth.Parse(resp.Header.Get("www-authenticate"))
if err != nil {
// cannot authenticate using this package
}
auth.Authorize(req)
}
resp, _ := http.DefaultClient.Do(req)
// and for the next request just authorize it before sending
auth.Authorize(req2)
*/
package digest

Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ go 1.19
require (
github.com/gregoryv/asserter v0.4.2
github.com/gregoryv/logger v0.2.0
golang.org/x/crypto v0.6.0
golang.org/x/crypto v0.17.0
)

require (
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/sys v0.15.0 // indirect
)
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,9 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc=
golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k=
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=

0 comments on commit d8503e5

Please sign in to comment.