10
45
Fork
You've already forked doipjs
28

Add marker logic #43

Closed
yarmo wants to merge 2 commits from add-markers into dev
pull from: add-markers
merge into: keyoxide:dev
keyoxide:main
keyoxide:dev
keyoxide:fix-irc-fetcher
keyoxide:new-claim-eveonline-143
keyoxide:prepare-new-release
keyoxide:fix-jsdoc-types
keyoxide:yarn-to-npm
keyoxide:support-openpgp-aspe-claims
keyoxide:support-html-alias
keyoxide:improve-activitypub-support
keyoxide:v1-restructure
keyoxide:into-es-module
keyoxide:support-aspe
keyoxide:fix-js-lsp-issues
keyoxide:improve-linting
keyoxide:support-opencollective-claim
keyoxide:support-entity-decoding
keyoxide:use-rome-tools
keyoxide:support-cloudflare-buster
keyoxide:support-fediverse-posts
keyoxide:matrix-room-verification
Owner
Copy link

Overview

This PR aims to introduce a new mechanic for matching service providers to claims. Service providers can now specify so-called markers which are used as additional tests before attempting to verify a claim. For now, markers are only HTTP endpoints and can only be tested for their existence — or lack of.

Rationale

Currently, when an identity claim is parsed, it is matched to candidate service providers before attempting to verify the claim. This matching is done solely based on the URI of the claim.

Some service providers are not ambiguous: IRC claims always start with irc:, lichess claims will always use the lichess.org domain.

Most service providers are ambiguous: https://domain.org/username/post could refer to a forem account, a forgejo/gitea account, an owncast instance...

Currently, doip-js simply attempts each of these service providers until one is able to verify the claim.

This worked fine until gitea was forked and forgejo was created. Due to their identical roots, both gitea and forgejo use the same verification mechanism and are thus indistinguishable from doip-js point of view.

Markers are one way of solving this issue. This PR adds a marker to the forgejo service provider that the gitea service provider does not have: the /api/forgejo/v1/version HTTP endpoint.

Note: for this to work, it is important that forgejo gets attempted BEFORE gitea, since gitea does not have a marker that forgejo does not have. doip-js does this.

Thanks to markers, doip-js will perfectly handle the following two scenarios.

Scenario 1: a forgejo claim is asked to be verified. It gets matched to both forgejo and gitea. Forgejo is attempted. doip-js finds that the /api/forgejo/v1/version endpoint exists and continues. It attempts the actual verification which succeeds. This claim is now a verified forgejo account.

Scenario 2: a gitea claim is asked to be verified. It gets matched to both forgejo and gitea. Forgejo is attempted. doip-js finds that the /api/forgejo/v1/version endpoint does not exist and skips forgejo. Gitea is attempted. It attempts the actual verification which succeeds. This claim is now a verified gitea account.

Note: in scenario 1, the gitea service provider is never even attempted, preventing this gitea verification — which would succeed! — to "confuse" doip-js.

## Overview This PR aims to introduce a new mechanic for matching service providers to claims. Service providers can now specify so-called markers which are used as additional tests before attempting to verify a claim. For now, markers are only HTTP endpoints and can only be tested for their existence — or lack of. ## Rationale Currently, when an identity claim is parsed, it is matched to candidate service providers before attempting to verify the claim. This matching is done solely based on the URI of the claim. Some service providers are not ambiguous: IRC claims always start with `irc:`, lichess claims will always use the `lichess.org` domain. Most service providers are ambiguous: `https://domain.org/username/post` could refer to a forem account, a forgejo/gitea account, an owncast instance... Currently, doip-js simply attempts each of these service providers until one is able to verify the claim. This worked fine until gitea was forked and forgejo was created. Due to their identical roots, both gitea and forgejo use the same verification mechanism and are thus indistinguishable from doip-js point of view. Markers are one way of solving this issue. This PR adds a marker to the forgejo service provider that the gitea service provider does not have: the `/api/forgejo/v1/version` HTTP endpoint. Note: for this to work, it is important that forgejo gets attempted BEFORE gitea, since gitea does not have a marker that forgejo does not have. doip-js does this. Thanks to markers, doip-js will perfectly handle the following two scenarios. Scenario 1: a forgejo claim is asked to be verified. It gets matched to both forgejo and gitea. Forgejo is attempted. doip-js finds that the `/api/forgejo/v1/version` endpoint exists and continues. It attempts the actual verification which succeeds. This claim is now a verified forgejo account. Scenario 2: a gitea claim is asked to be verified. It gets matched to both forgejo and gitea. Forgejo is attempted. doip-js finds that the `/api/forgejo/v1/version` endpoint does not exist and skips forgejo. Gitea is attempted. It attempts the actual verification which succeeds. This claim is now a verified gitea account. Note: in scenario 1, the gitea service provider is never even attempted, preventing this gitea verification — which would succeed! — to "confuse" doip-js.
feat: Add markers to service provider configs
All checks were successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/push/publish-npm Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/publish-npm Pipeline was successful
334446cee2
Author
Owner
Copy link

As per suggestions in the Matrix channel, I will divide this PR in smaller PRs and create an overarching issue.

As per suggestions in the Matrix channel, I will divide this PR in smaller PRs and create an overarching issue.
yarmo closed this pull request 2023年03月30日 10:57:27 +02:00
All checks were successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/push/publish-npm Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/publish-npm Pipeline was successful

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No reviewers
Labels
Clear labels
bug
Something is not working

Archived

enhancement
New feature

Archived

Contribution welcome
Get started contributing here
Good first issue
Good if you are new to the project or to open source contributions
Impact
External
Affects the people using the project
Impact
Internal
Affects on the people working on the project
Priority
Critical
Work on right now
Priority
High
Work on at earliest convenience
Priority
Low
Work on in spare time
Priority
Medium
Work on regularly
Review
Duplicate
Already exists
Review
Off Topic
Does not fall within the scope of the repo/project
Status
Backlog
Is not being worked on yet
Status
Blocked
Is waiting on something or someone
Status
Completed
Is done
Status
In Progress
Is being worked on
Status
Investigating
Is waiting on research or questions
Status
Needs Decision
Is waiting on a decision by the devs/contributors
Status
Needs Info
Is waiting on additional information before it can be solved
Status
Needs Triage
Is new issue that needs reviewing
Status
Testing
Is being checked and verified
Status
Waiting For Review
Is waiting on reviewers to approve
Status
Won't Fix
Won't be fixed
Type
Bug
Related to something not working as intended
Type
CI
Related to continuous integration
Type
Documentation
Related to documentation
Type
Enhancement
Related to a new feature or an improved one
Type
New Claim
Related to a new identity claim/proof
Type
Security
Related to security
Type
Tests
Related to code tests
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
keyoxide/doipjs!43
Reference in a new issue
keyoxide/doipjs
No description provided.
Delete branch "add-markers"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?