10
45
Fork
You've already forked doipjs
28

Add support for openstreetmap claims & proofs #38

Open
opened 2023年03月09日 19:02:25 +01:00 by tyy · 4 comments
Member
Copy link

OpenStreetMap is an open mapping database editable by anyone (similar to wikipedia). This could be a nice service to have added to keyoxide/doipjs in order to link someone's edits on OpenStreetMap to other methods of contacting them.

OpenStreetMap allows you to add a user bio (where a proof could be put), and has an XML-based API to fetch users programmatically (which could be used by doip). The API URL is https://www.openstreetmap.org/api/0.6/user/:user_id, which returns XML data such as the following (for my user id):

<osm version="0.6" generator="OpenStreetMap server" copyright="OpenStreetMap and contributors" attribution="http://www.openstreetmap.org/copyright" license="http://opendatacommons.org/licenses/odbl/1-0/">
 <user id="18357498" display_name="Tyler Beckman" account_created="2023年01月25日T22:19:00Z">
 <description>
 	https://keyoxide.org/a6299c20250223dcdeba5e2c933b9437a97a56b8
 </description>
 <contributor-terms agreed="true"/>
 <img href="https://www.gravatar.com/avatar/ca2c21b7979e9a9cac03e1fccb84e8e9.jpg?s=100&d=https%3A%2F%2Fwww.openstreetmap.org%2Fassets%2Favatar_large-54d681ddaf47c4181b05dbfae378dc0201b393bbad3ff0e68143c3d5f3880ace.png"/>
 <roles> </roles>
 <changesets count="14"/>
 <traces count="1"/>
 <blocks>
 <received count="0" active="0"/>
 </blocks>
 </user>
</osm>

In this data, the <description>https://keyoxide.org/a6299c20250223dcdeba5e2c933b9437a97a56b8</description> tag is my user bio which I can set on the OpenStreetMap website.

This works, however there is the issue of claims. OpenStreetMap user IDs are not publicly displayed on the website, however there are two ways that I know of to find it:

  1. Navigate to https://www.openstreetmap.org/api/0.6/user/details in a browser, and enter login details when the browser prompts for it. The user ID is displayed in the returned XML data is very similar to the other endpoint above. This isn't super user friendly and telling users enter login data again on another page is probably not a great idea
  2. Someone in the OSM IRC channel directed me to https://whosthat.osmz.ru/ which allows you to search for a user name (in this case my real name), and it will display the user ID. This would likely be much more user friendly

However, there then is the issue of how to format the claim, because traditionally it would be something such as proof@ariadne.id=https://www.openstreetmap.org/user/Tyler%20Beckman (which is the url you can use to display it in the browser), however the API endpoint that would be used to verify claims needs the ID, not the user name. One idea I have for this is to actually use a claim like I put above, and automatically fetch the user ID using https://whosthat.osmz.ru/. If I look in devtools, there is an API at https://whosthat.osmz.ru/whosthat.php?action=names&q=:username which returns a json list of potential matches such as: [{"id":"18357498","names":["Tyler Beckman"]}]. There can only ever be one user with a specific username, so exact matching could be used to find a user ID from a specific username. This does add some reliance on an api unrelated to openstreetmap.org, so if there is a better way to represent an OSM user ID in a claim it should probably be used.

[OpenStreetMap](https://openstreetmap.org/) is an open mapping database editable by anyone (similar to wikipedia). This could be a nice service to have added to keyoxide/doipjs in order to link someone's edits on OpenStreetMap to other methods of contacting them. OpenStreetMap allows you to add a user bio (where a proof could be put), and has an XML-based API to fetch users programmatically (which could be used by doip). The API URL is `https://www.openstreetmap.org/api/0.6/user/:user_id`, which returns XML data such as the following (for my user id): ```xml <osm version="0.6" generator="OpenStreetMap server" copyright="OpenStreetMap and contributors" attribution="http://www.openstreetmap.org/copyright" license="http://opendatacommons.org/licenses/odbl/1-0/"> <user id="18357498" display_name="Tyler Beckman" account_created="2023年01月25日T22:19:00Z"> <description> https://keyoxide.org/a6299c20250223dcdeba5e2c933b9437a97a56b8 </description> <contributor-terms agreed="true"/> <img href="https://www.gravatar.com/avatar/ca2c21b7979e9a9cac03e1fccb84e8e9.jpg?s=100&d=https%3A%2F%2Fwww.openstreetmap.org%2Fassets%2Favatar_large-54d681ddaf47c4181b05dbfae378dc0201b393bbad3ff0e68143c3d5f3880ace.png"/> <roles> </roles> <changesets count="14"/> <traces count="1"/> <blocks> <received count="0" active="0"/> </blocks> </user> </osm> ``` In this data, the `<description>https://keyoxide.org/a6299c20250223dcdeba5e2c933b9437a97a56b8</description>` tag is my user bio which I can set on the OpenStreetMap website. This works, however there is the issue of claims. OpenStreetMap user IDs are not publicly displayed on the website, however there are two ways that I know of to find it: 1. Navigate to https://www.openstreetmap.org/api/0.6/user/details in a browser, and enter login details when the browser prompts for it. The user ID is displayed in the returned XML data is very similar to the other endpoint above. This isn't super user friendly and telling users enter login data again on another page is probably not a great idea 2. Someone in the OSM IRC channel directed me to https://whosthat.osmz.ru/ which allows you to search for a user name (in this case my real name), and it will display the user ID. This would likely be much more user friendly However, there then is the issue of how to format the claim, because traditionally it would be something such as `proof@ariadne.id=https://www.openstreetmap.org/user/Tyler%20Beckman` (which is the url you can use to display it in the browser), however the API endpoint that would be used to verify claims needs the ID, not the user name. One idea I have for this is to actually use a claim like I put above, and automatically fetch the user ID using https://whosthat.osmz.ru/. If I look in devtools, there is an API at `https://whosthat.osmz.ru/whosthat.php?action=names&q=:username` which returns a json list of potential matches such as: `[{"id":"18357498","names":["Tyler Beckman"]}]`. There can only ever be one user with a specific username, so exact matching could be used to find a user ID from a specific username. This does add some reliance on an api unrelated to openstreetmap.org, so if there is a better way to represent an OSM user ID in a claim it should probably be used.

I think you can go to the changelist and view changelist xml. UID would be in the changelist xml. However I am not sure if we can automate this? I would not rely on third party api like https://whosthat.osmz.ru/

<changeset id="167038651" created_at="2025年06月01日T08:02:36Z" closed_at="2025年06月01日T08:02:37Z" open="false" user="mikegao" uid="22913756"...

@tyy :
What if we use proof@ariadne.id=openstreetmap:user_id as the proof ID? Would this cause any issue? My idea is that the api endpoint version can change frequently, but we can always update the backend to point at https://www.openstreetmap.org/api/0.6/user/details

I think you can go to the changelist and view changelist xml. UID would be in the changelist xml. However I am not sure if we can automate this? I would not rely on third party api like https://whosthat.osmz.ru/ ``` <changeset id="167038651" created_at="2025年06月01日T08:02:36Z" closed_at="2025年06月01日T08:02:37Z" open="false" user="mikegao" uid="22913756"... ``` @tyy : What if we use ``proof@ariadne.id=openstreetmap:user_id`` as the proof ID? Would this cause any issue? My idea is that the api endpoint version can change frequently, but we can always update the backend to point at https://www.openstreetmap.org/api/0.6/user/details

cc: @Chimbosonic @Ryuno-Ki @yarmo

What do you guys think about a custom proof for openstreetmap? Something like
proof@ariadne.id=openstreetmap:user_id

cc: @Chimbosonic @Ryuno-Ki @yarmo What do you guys think about a custom proof for openstreetmap? Something like ``proof@ariadne.id=openstreetmap:user_id``

I do not know how openstreet maps work so don’t really have an opinion on it

I do not know how openstreet maps work so don’t really have an opinion on it

#166
I have submitted a pull request based on
proof@ariadne.id=openstreetmap:user_id

It will asynchronously grab the username from the user_id.

https://codeberg.org/keyoxide/doipjs/pulls/166 I have submitted a pull request based on ``proof@ariadne.id=openstreetmap:user_id`` It will asynchronously grab the username from the user_id.
Sign in to join this conversation.
No Branch/Tag specified
main
dev
fix-irc-fetcher
new-claim-eveonline-143
prepare-new-release
fix-jsdoc-types
yarn-to-npm
support-openpgp-aspe-claims
support-html-alias
improve-activitypub-support
v1-restructure
into-es-module
support-aspe
fix-js-lsp-issues
improve-linting
add-markers
support-opencollective-claim
support-entity-decoding
use-rome-tools
support-cloudflare-buster
support-fediverse-posts
matrix-room-verification
2.1.0
2.1.0-rc.3
2.1.0-rc.2
2.1.0-rc.1
2.0.1
2.0.0
2.0.0-rc.1
1.2.9
1.2.8
1.2.7
1.2.6
1.2.5
1.2.4
1.2.3
1.2.2
1.2.1
1.1.1
1.1.0
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0
v0.19.1-alpha.0
0.19.0
0.18.3
0.18.2
0.18.1
0.18.0
0.17.5
0.17.4
0.17.3
0.17.2
0.17.1
0.17.0
0.16.4
0.16.3
0.16.2
0.16.1
0.16.0
0.15.7
0.15.6
0.15.5
0.15.4
0.15.3
0.15.2
0.15.1
0.15.0
0.14.0
0.13.0
0.12.9
0.12.8
0.12.7
0.12.6
0.12.5
0.12.4
0.12.3
0.12.2
0.12.1
0.12.0
0.11.2
0.11.1
0.11.0
0.10.5
0.10.4
0.10.3
0.10.2
0.10.1
0.10.0
0.9.4
0.9.3
0.9.2
0.9.1
0.9.0
0.8.5
0.8.4
0.8.3
0.8.1
0.7.4
0.7.3
0.7.2
0.7.1
0.7.0
0.6.0
0.5.1
0.5.0
0.4.2
0.4.1
0.4.0
0.3.0
0.2.0
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
3 participants
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#38
Reference in a new issue
keyoxide/doipjs
No description provided.
Delete branch "%!s()"

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?