-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limit signature duration based on max_age_secs. #348
Conversation
packager/signer/signer.go
Outdated
@@ -477,11 +477,17 @@ func (this *Signer) serveSignedExchange(resp http.ResponseWriter, fetchResp *htt | |||
if err != nil { | |||
util.NewHTTPError(http.StatusInternalServerError, "Error building validity href: ", err).LogAndRespond(resp) | |||
} | |||
// Expires - Date must be <= 604800 seconds, per | |||
// https://tools.ietf.org/html/draft-yasskin-httpbis-origin-signed-exchanges-impl-00#section-3.5. | |||
duration := 7*24*time.Hour |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggest spaces around * for readability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, ran go fmt on these two files, which fixed this.
packager/signer/signer.go
Outdated
// Expires - Date must be <= 604800 seconds, per | ||
// https://tools.ietf.org/html/draft-yasskin-httpbis-origin-signed-exchanges-impl-00#section-3.5. | ||
duration := 7*24*time.Hour | ||
println("max-age=", metadata.MaxAgeSecs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debug statement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, removed.
This uses the new metadata field returned from the transformer library, which is based on the presence of any inline amp-scripts.
75cb14d
to
f5a144e
Compare
This uses the new metadata field returned from the transformer library, which is based on the presence of any inline amp-scripts.
This uses the new metadata field returned from the transformer library,
which is based on the presence of any inline amp-scripts.
@Gregable Note for review to ignore the first commit; it's merely the "diffbase" of #347.
cc @choumx