Skip to content

Commit

Permalink
♻️Don't fetch crypto signature verifier in no-signing (#36187)
Browse files Browse the repository at this point in the history
  • Loading branch information
calebcordry committed Sep 30, 2021
1 parent 30bcfe9 commit 2dab872
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions extensions/amp-a4a/0.1/amp-a4a.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,14 +408,18 @@ export class AmpA4A extends AMP.BaseElement {
this.uiHandler = new AMP.AmpAdUIHandler(this);
this.uiHandler.validateStickyAd();

const verifier = signatureVerifierFor(this.win);
this.keysetPromise_ = this.getAmpDoc()
.whenFirstVisible()
.then(() => {
this.getSigningServiceNames().forEach((signingServiceName) => {
verifier.loadKeyset(signingServiceName);
// Disable crypto key fetching if we are not going to use it in no-signing path.
// TODO(ccordry): clean up with no-signing launch.
if (!this.isInNoSigningExp()) {
const verifier = signatureVerifierFor(this.win);
this.keysetPromise_ = this.getAmpDoc()
.whenFirstVisible()
.then(() => {
this.getSigningServiceNames().forEach((signingServiceName) => {
verifier.loadKeyset(signingServiceName);
});
});
});
}

this.a4aAnalyticsConfig_ = this.getA4aAnalyticsConfig();
if (this.a4aAnalyticsConfig_) {
Expand Down

0 comments on commit 2dab872

Please sign in to comment.