go-oidc icon indicating copy to clipboard operation
go-oidc copied to clipboard

Log the entire body if non-OK fills up disk quickly

Open jqmichael opened this issue 4 years ago • 2 comments
trafficstars

If OIDC page return non-OK status, the current behavior would log the body, which may fill up the disk if it's large enough.

https://github.com/coreos/go-oidc/blob/v3/oidc/oidc.go#L244-L246

Would it be OK not to log the body?

func (p *Provider) UserInfo
       ...
	if resp.StatusCode != http.StatusOK {		
              return nil, fmt.Errorf("%s: %s", resp.Status, body)	
       }
}

jqmichael avatar Jun 08 '21 02:06 jqmichael

If you'd like to send a PR to limit the amount of information read, happy to take it!

ericchiang avatar Jun 10 '21 17:06 ericchiang

@ericchiang Any suggestion for the limit? Or if the body size reaches out threshold just ignore the body?

mason-liu avatar Apr 22 '22 09:04 mason-liu