auth: send LSAT and L402 Authorization headers

Again, as with WWW-Authenticate header, existing aperture instances
expect LSAT, and the protocol defines it is L402, so send both, LSAT
first, to maintain backward compatibility.

The header "Authorization: LSAT..." can be removed in the future,
when all aperture instances are upgraded.
This commit is contained in:
Boris Nagaev
2024-04-16 16:56:59 -03:00
parent 709463fe5b
commit fb02e3f030
2 changed files with 55 additions and 18 deletions

View File

@@ -100,11 +100,33 @@ func TestL402Authenticator(t *testing.T) {
result: false,
},
{
id: "valid auth header",
id: "valid auth header (both LSAT and L402)",
header: &http.Header{
l402.HeaderAuthorization: []string{
"LSAT " + testMacBase64 + ":" +
testPreimage,
"L402 " + testMacBase64 + ":" +
testPreimage,
},
},
result: true,
},
{
id: "valid auth header (LSAT only)",
header: &http.Header{
l402.HeaderAuthorization: []string{
"LSAT " + testMacBase64 + ":" +
testPreimage,
},
},
result: true,
},
{
id: "valid auth header (L402 only)",
header: &http.Header{
l402.HeaderAuthorization: []string{
"L402 " + testMacBase64 + ":" +
testPreimage,
},
},
result: true,