Skip to content

Commit

Permalink
custom HTTP capabilities moved to their own subpackage
Browse files Browse the repository at this point in the history
  • Loading branch information
johnabass committed Aug 20, 2024
1 parent 92ae145 commit caaa627
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 261 deletions.
243 changes: 0 additions & 243 deletions basculehttp/capabilities.go

This file was deleted.

18 changes: 0 additions & 18 deletions basculehttp/middleware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,6 @@ type MiddlewareTestSuite struct {
TestSuite
}

// newAuthenticator creates a bascule.Authenticator that is expected to be valid.
// Assertions as to validity are made prior to returning.
func (suite *MiddlewareTestSuite) newAuthenticator(opts ...bascule.AuthenticatorOption[*http.Request]) *bascule.Authenticator[*http.Request] {
a, err := NewAuthenticator(opts...)
suite.Require().NoError(err)
suite.Require().NotNil(a)
return a
}

// newAuthorizer creates a bascule.Authorizer that is expected to be valid.
// Assertions as to validity are made prior to returning.
func (suite *MiddlewareTestSuite) newAuthorizer(opts ...bascule.AuthorizerOption[*http.Request]) *bascule.Authorizer[*http.Request] {
a, err := NewAuthorizer(opts...)
suite.Require().NoError(err)
suite.Require().NotNil(a)
return a
}

// newMiddleware creates a Middleware that is expected to be valid.
// Assertions as to validity are made prior to returning.
func (suite *MiddlewareTestSuite) newMiddleware(opts ...MiddlewareOption) *Middleware {
Expand Down
18 changes: 18 additions & 0 deletions basculehttp/testSuite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,21 @@ func (suite *TestSuite) newAuthorizationParser(opts ...AuthorizationParserOption
suite.Require().NotNil(ap)
return ap
}

// newAuthenticator creates a bascule.Authenticator that is expected to be valid.
// Assertions as to validity are made prior to returning.
func (suite *MiddlewareTestSuite) newAuthenticator(opts ...bascule.AuthenticatorOption[*http.Request]) *bascule.Authenticator[*http.Request] {
a, err := NewAuthenticator(opts...)
suite.Require().NoError(err)
suite.Require().NotNil(a)
return a
}

// newAuthorizer creates a bascule.Authorizer that is expected to be valid.
// Assertions as to validity are made prior to returning.
func (suite *MiddlewareTestSuite) newAuthorizer(opts ...bascule.AuthorizerOption[*http.Request]) *bascule.Authorizer[*http.Request] {
a, err := NewAuthorizer(opts...)
suite.Require().NoError(err)
suite.Require().NotNil(a)
return a
}

0 comments on commit caaa627

Please sign in to comment.