Skip to content

Commit

Permalink
update api_test
Browse files Browse the repository at this point in the history
  • Loading branch information
karinamzalez committed Jan 25, 2024
1 parent 8370044 commit 9eb57b8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ssas/service/public/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -464,9 +464,17 @@ func (s *APITestSuite) TestTokenEmptyClientIdProduces401() {
func (s *APITestSuite) testIntrospectFlaw(flaw service.TokenFlaw, errorText string) {
var (
signingKeyPath string
origLog io.Writer
buf bytes.Buffer
)

logger := ssas.GetLogger(log.Logger)
origLog = logger.Out
logger.SetOutput(&buf)
defer func() {
logger.SetOutput(origLog)
}()

if flaw == service.BadSigner {
signingKeyPath = s.badSigningKeyPath
} else {
Expand Down Expand Up @@ -1134,7 +1142,7 @@ func mintClientAssertion(issuer, subject, aud string, issuedAt, expiresAt int64,
token.Claims = claims
token.Header["kid"] = kid
var signedString, err = token.SignedString(privateKey)
logger := log.GetCtxLogger(context.Background())
logger := ssas.GetLogger(log.Logger)
if err != nil {
logger.Error(logrus.Fields{"Event": "TokenMintingFailure", "TokenID": tokenID})
logger.Errorf("token signing error %s", err)
Expand Down

0 comments on commit 9eb57b8

Please sign in to comment.