Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/httpaux upgrade #180

Merged
merged 2 commits into from
May 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]
- Add URLParse Option to auth package. [#179](https://github.com/xmidt-org/argus/pull/179)
- Use latest version of httpaux. [#180](https://github.com/xmidt-org/argus/pull/180)

## [v0.3.16]
- Allow auth package client code to pass the basculehttp.OnErrorHTTPResponse option. [#174](https://github.com/xmidt-org/argus/pull/174)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
github.com/stretchr/testify v1.7.0
github.com/xmidt-org/bascule v0.9.1-0.20210506212507-4df8762472bc
github.com/xmidt-org/candlelight v0.0.5
github.com/xmidt-org/httpaux v0.1.3
github.com/xmidt-org/httpaux v0.2.1
github.com/xmidt-org/themis v0.4.7
github.com/xmidt-org/webpa-common v1.11.7
go.uber.org/fx v1.13.1
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,8 @@ github.com/xmidt-org/candlelight v0.0.5/go.mod h1:j9Q2tzrOAywm+JvvVJjlOmlPJvdlRr
github.com/xmidt-org/httpaux v0.1.2/go.mod h1:qZnH2uObGPwHnOz8HcPNlbcd3gKEvdmxbIK3rgbQhto=
github.com/xmidt-org/httpaux v0.1.3 h1:RiA4pCwlZfu6a3CBzbvJy3F+5no1ou2UB2XLmNxzzUs=
github.com/xmidt-org/httpaux v0.1.3/go.mod h1:mviIlg5fHGb3lAv3l0sbiwVG/q9rqvXaudEYxVrzXdE=
github.com/xmidt-org/httpaux v0.2.1 h1:SFK+Bab5c6r70VxMfJcDR49aBHIUs0uQJruC+nMpAcg=
github.com/xmidt-org/httpaux v0.2.1/go.mod h1:mviIlg5fHGb3lAv3l0sbiwVG/q9rqvXaudEYxVrzXdE=
github.com/xmidt-org/themis v0.4.4 h1:KewitRxStW1xOehDBi0YyGZyRv3PjFdYUEDvQFf1Nmk=
github.com/xmidt-org/themis v0.4.4/go.mod h1:0qRYFvKdrQhwjxH/1nAiTgBGT4cegJR76gfEYF5P7so=
github.com/xmidt-org/themis v0.4.7 h1:QAbutfysHG/UhVNzPAvWsEQIdZY0oNz9KYIkAaK7aus=
Expand Down
4 changes: 2 additions & 2 deletions store/dynamodb/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"github.com/xmidt-org/argus/model"
"github.com/xmidt-org/argus/store"
"github.com/xmidt-org/argus/store/db/metric"
"github.com/xmidt-org/httpaux"
"github.com/xmidt-org/httpaux/erraux"
"github.com/xmidt-org/themis/config"
)

Expand All @@ -45,7 +45,7 @@ const (

var validate *validator.Validate

var errHTTPBadRequest = &httpaux.Error{
var errHTTPBadRequest = &erraux.Error{
Err: errors.New("bad request to dynamodb"),
Code: http.StatusBadRequest,
}
Expand Down
8 changes: 4 additions & 4 deletions store/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net/http"

"github.com/xmidt-org/argus/model"
"github.com/xmidt-org/httpaux"
"github.com/xmidt-org/httpaux/erraux"
)

// Sentinel internal errors.
Expand All @@ -19,8 +19,8 @@ var (

// Sentinel errors to be used by the HTTP response error encoder.
var (
ErrHTTPItemNotFound = &httpaux.Error{Err: errors.New("Item not found"), Code: http.StatusNotFound}
ErrHTTPOpFailed = &httpaux.Error{Err: errors.New("DB operation failed"), Code: http.StatusInternalServerError}
ErrHTTPItemNotFound = &erraux.Error{Err: errors.New("Item not found"), Code: http.StatusNotFound}
ErrHTTPOpFailed = &erraux.Error{Err: errors.New("DB operation failed"), Code: http.StatusInternalServerError}
)

type sanitizedErrorer interface {
Expand All @@ -40,7 +40,7 @@ type SanitizedError struct {
// of Err that can be safely used across API boundaries.
// Two use cases include: hiding sensitive error data and
// translating errors to better explain error events to API consumers.
ErrHTTP *httpaux.Error
ErrHTTP *erraux.Error
}

func (s SanitizedError) Unwrap() error {
Expand Down
4 changes: 2 additions & 2 deletions store/transport_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"github.com/xmidt-org/argus/auth"
"github.com/xmidt-org/argus/model"
"github.com/xmidt-org/bascule"
"github.com/xmidt-org/httpaux"
"github.com/xmidt-org/httpaux/erraux"
)

func TestEncodeError(t *testing.T) {
Expand All @@ -33,7 +33,7 @@ func TestEncodeError(t *testing.T) {
Description: "Headers and code",
InputErr: SanitizedError{
Err: errors.New("internal ignored err"),
ErrHTTP: &httpaux.Error{
ErrHTTP: &erraux.Error{
Err: errHTTPMsg,
Code: http.StatusBadRequest,
Header: http.Header{"X-Some-Header": []string{"val0", "val1"}},
Expand Down