Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upsso-proxy: sign upstream requests with a verifiable digital signature #106
Conversation
f0942e8
to
4a86464
3dd156b
to
1a37db1
| // used to sign each request. | ||
| func (p *OAuthProxy) Certs(rw http.ResponseWriter, _ *http.Request) { | ||
| rw.WriteHeader(http.StatusOK) | ||
| fmt.Fprint(rw, p.publicCertsJSON) |
This comment has been minimized.
This comment has been minimized.
jphines
Nov 16, 2018
Contributor
We don't need to convert this to a string to use it here, nor do we have to call WriteHeader, we could just:
rw.Write(p.RawPublicCerts)Which will default to 200 and write our string as bytes.
This comment has been minimized.
This comment has been minimized.
| // hash value received through the `Octoboi-Signature` of the request. | ||
| // | ||
| // Any requests failing this check should be considered tampered with, and rejected. | ||
| func (signer RequestSigner) Sign(req *http.Request) error { |
This comment has been minimized.
This comment has been minimized.
jphines
Nov 16, 2018
Contributor
Since this isn't a function pointer, does this create a new object when called?
Is that why we don't have to worry about concurrent and/or racey writes to the hasher object below, since it's a new object on each Sign invocation?
This comment has been minimized.
This comment has been minimized.
jphines
Nov 16, 2018
Contributor
Or should this be a pointer handler and we do have worry about concurrent and racey writes to the hasher?
This comment has been minimized.
This comment has been minimized.
katzdm
Nov 19, 2018
Author
Contributor
Right, this creates a new object, which I believe ought to avoid racey writes to the hasher and signingKey fields.
993e32d
to
e5f71c5
|
LGTM |
|
one nit but otherwise this looks great! |
4deead6
to
443a712

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

katzdm commentedOct 31, 2018
Enable the signing of upstream requests using a digital signature, instead of requiring a shared secret for each upstream service. Work in progress.