Skip to content

Commit

Permalink
log owner when machine auth fails
Browse files Browse the repository at this point in the history
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
  • Loading branch information
butonic committed Jul 12, 2022
1 parent 1e4d28e commit 761a092
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions services/search/pkg/search/provider/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,14 @@ func (p *Provider) getAuthContext(owner *user.User) (context.Context, error) {
ownerCtx := ctxpkg.ContextSetUser(context.Background(), owner)
authRes, err := p.gwClient.Authenticate(ownerCtx, &gateway.AuthenticateRequest{
Type: "machine",
ClientId: "userid:" + owner.Id.OpaqueId,
ClientId: "userid:" + owner.GetId().GetOpaqueId(),
ClientSecret: p.machineAuthAPIKey,
})
if err == nil && authRes.GetStatus().GetCode() != rpc.Code_CODE_OK {
err = errtypes.NewErrtypeFromStatus(authRes.Status)
}
if err != nil {
p.logger.Error().Err(err).Interface("authRes", authRes).Msg("error using machine auth")
p.logger.Error().Err(err).Interface("owner", owner).Interface("authRes", authRes).Msg("error using machine auth")
return nil, err
}
return metadata.AppendToOutgoingContext(ownerCtx, ctxpkg.TokenHeader, authRes.Token), nil
Expand Down

0 comments on commit 761a092

Please sign in to comment.