I agree, +1 on the library approach and the one recommended. Michael
On 12/4/19, 2:34 PM, "Rawlin Peters" <[email protected]> wrote: +1, looks like a pretty good repo, and that sounds much better than shelling out to openssl or using CGO. - Rawlin On Wed, Dec 4, 2019 at 10:13 AM Williams, Adam <[email protected]> wrote: > > The Perl `/isos` endpoint handler uses the `crypt` function [0]. This is a built-in function that creates a digest string, like the crypt(3) function in the C library [1]. The endpoint is being re-written in Go. > > The Go standard library does not provide this algorithm. The following ideas were considered (and rejected) for how to generate the digest in Go: > - Shell out to the “openssl passwd” executable. > - Use CGO to call the C library’s crypt function. > > Instead, I’m proposing adding a vendored library, github.com/GehirnInc/crypt [2], that provides this same algorithm in pure Go. The library is BSD 2-Clause licensed. This will be included as part of the upcoming `/isos` re-write Pull Request, barring any objections. > > [0] https://urldefense.com/v3/__https://github.com/apache/trafficcontrol/blob/2cfa466479cfe777618f6489d7013251c8828607/traffic_ops/app/lib/API/Iso.pm*L194__;Iw!rx_L75ITgOQ!VwbB1ENztH__ZYFyxLZ1H1MtVbsmy3J-TfRCXnayAlCYJ1UQ8h7aiImOOUGddYEQccNNoQ$ > [1] https://urldefense.com/v3/__https://perldoc.perl.org/functions/crypt.html__;!rx_L75ITgOQ!VwbB1ENztH__ZYFyxLZ1H1MtVbsmy3J-TfRCXnayAlCYJ1UQ8h7aiImOOUGddYHzG4_yrA$ > [2] https://urldefense.com/v3/__https://github.com/GehirnInc/crypt__;!rx_L75ITgOQ!VwbB1ENztH__ZYFyxLZ1H1MtVbsmy3J-TfRCXnayAlCYJ1UQ8h7aiImOOUGddYFR4scl4g$
