1
0
mirror of https://github.com/raseels-repos/golang-saas-starter-kit.git synced 2025-06-15 00:15:15 +02:00

checkpoint for api handler tests

This commit is contained in:
Lee Brown
2019-06-26 01:16:57 -08:00
parent d6b6b605a4
commit b68bcf2c2c
16 changed files with 424 additions and 283 deletions

View File

@ -295,6 +295,11 @@ func generateToken(ctx context.Context, dbConn *sqlx.DB, tknGen TokenGenerator,
return tkn, nil
}
// AuthorizationHeader returns the header authorization value.
func (t Token) AuthorizationHeader() string {
return "Bearer " + t.AccessToken
}
// mockTokenGenerator is used for testing that Authenticate calls its provided
// token generator in a specific way.
type MockTokenGenerator struct {