hpke: compress query string (#4147)

* hpke: compress query string

* only use v2 in authenticate if v2 was used for the initial request

* fix comment
This commit is contained in:
Caleb Doxsey 2023-05-02 14:12:34 -06:00 committed by GitHub
parent 69713d38af
commit facf9ab093
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 184 additions and 52 deletions

View file

@ -218,7 +218,12 @@ func (a *Authenticate) SignIn(w http.ResponseWriter, r *http.Request) error {
a.logAuthenticateEvent(r, profile)
redirectTo, err := urlutil.CallbackURL(state.hpkePrivateKey, proxyPublicKey, requestParams, profile)
encryptURLValues := hpke.EncryptURLValuesV1
if hpke.IsEncryptedURLV2(r.Form) {
encryptURLValues = hpke.EncryptURLValuesV2
}
redirectTo, err := urlutil.CallbackURL(state.hpkePrivateKey, proxyPublicKey, requestParams, profile, encryptURLValues)
if err != nil {
return httputil.NewError(http.StatusInternalServerError, err)
}