Skip to content

should also search on advanced WKD url + use policy file #3003

@tomholub

Description

@tomholub

Currently, the Wkd class only searches using the direct WKD method.

To fix: add the advanced method which should be tried first, only after which the basic WKD method should be attempted.
Further, before trying any WKD lookup, should pull WKD policy file first.

The spec is at https://tools.ietf.org/html/draft-koch-openpgp-webkey-service-10

relevant code

    // todo - could also search on `https://openpgpkey.{domain}/.well-known/openpgpkey/{domain}/hu/{hu}?l={user}`
    const url = `https://${recipientDomain}/.well-known/openpgpkey/hu/${hu}?l=${encodeURIComponent(user)}`;

Need to add tests for the WKD class. This can be done by adding all of these expected WKD endpoints to the mock, and testing lookup using browser unit tests.

For the mock, you will want to add one more set of endpoints here:

  const api = new LoggedApi<{ query: { [k: string]: string }, body?: unknown }, unknown>('google-mock', {
    ...mockGoogleEndpoints,
    ...mockBackendEndpoints,
    ...mockAttesterEndpoints,
    ...mockKeyManagerEndpoints,
    '/favicon.ico': async () => '',
  });

that could maybe be called mockWkdEndpoints where you add a couple of WKD paths. To create these test paths, use https://metacode.biz/openpgp/web-key-directory where you input a test email and it will give you the paths where the policy files and public keys should be.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions