{"id":17024044,"url":"https://github.com/mackuba/didkit","last_synced_at":"2025-03-22T17:31:04.925Z","repository":{"id":207204382,"uuid":"718702017","full_name":"mackuba/didkit","owner":"mackuba","description":"A library for handling DID identifiers used in Bluesky AT Protocol","archived":false,"fork":false,"pushed_at":"2025-01-27T21:43:22.000Z","size":71,"stargazers_count":14,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-16T02:15:05.886Z","etag":null,"topics":["atproto","atprotocol","bluesky","bluesky-api","did","identity"],"latest_commit_sha":null,"homepage":"https://blue.mackuba.eu","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"zlib","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mackuba.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-14T16:16:38.000Z","updated_at":"2025-02-03T12:13:25.000Z","dependencies_parsed_at":"2023-11-14T16:36:27.595Z","dependency_job_id":"eb8806a1-9cf3-495a-ae66-2df69e596972","html_url":"https://github.com/mackuba/didkit","commit_stats":null,"previous_names":["mackuba/didkit"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mackuba%2Fdidkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mackuba%2Fdidkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mackuba%2Fdidkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mackuba%2Fdidkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mackuba","download_url":"https://codeload.github.com/mackuba/didkit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244994960,"owners_count":20544248,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["atproto","atprotocol","bluesky","bluesky-api","did","identity"],"created_at":"2024-10-14T07:24:14.166Z","updated_at":"2025-03-22T17:31:04.471Z","avatar_url":"https://github.com/mackuba.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DIDKit 🪪\n\nA small Ruby gem for handling Distributed Identifiers (DIDs) in Bluesky / AT Protocol.\n\n\u003e [!NOTE]\n\u003e ATProto Ruby gems collection: [skyfall](https://github.com/mackuba/skyfall) | [blue_factory](https://github.com/mackuba/blue_factory) | [minisky](https://github.com/mackuba/minisky) | [didkit](https://github.com/mackuba/didkit)\n\n\n## What does it do\n\nAccounts on Bluesky use identifiers like [did:plc:oio4hkxaop4ao4wz2pp3f4cr](https://plc.directory/did:plc:oio4hkxaop4ao4wz2pp3f4cr) as unique IDs, and they also have assigned human-readable handles like [@mackuba.eu](https://bsky.app/profile/mackuba.eu), which are verified either through a DNS TXT entry or a `/.well-known/atproto-did` file. This library allows you to look up any account's assigned handle using a DID string or vice versa, load the account's DID JSON document that specifies the handles and the PDS server hosting user's repo, and check if the assigned handle verifies correctly.\n\n\n## Installation\n\n    gem install didkit\n\n\n## Usage\n\nUse the `DIDKit::Resolver` class to look up DIDs and handles.\n\nTo look up a handle:\n\n```rb\nresolver = DIDKit::Resolver.new\nresolver.resolve_handle('nytimes.com')\n # =\u003e #\u003cDIDKit::DID:0x00000001035956b0 @did=\"did:plc:eclio37ymobqex2ncko63h4r\", @type=:plc, @resolved_by=:dns\u003e\n```\n\nThis returns an object of `DIDKit::DID` class (aliased as just `DID`), which tells you:\n\n- the DID as a string (`#to_s` or `#did`)\n- the DID type (`#type`, `:plc` or `:web`)\n- if the handle was resolved via a DNS entry or a `.well-known` file (`#resolved_by`, `:dns` or `:http`)\n\nTo go in the other direction – to find an assigned and verified handle given a DID – use `get_validated_handle` (pass DID as a string or an object):\n\n```rb\nresolver.get_validated_handle('did:plc:ewvi7nxzyoun6zhxrhs64oiz')\n # =\u003e \"atproto.com\" \n```\n\nYou can also load the DID document using `resolve_did`:\n\n```rb\ndoc = resolver.resolve_did('did:plc:ragtjsm2j2vknwkz3zp4oxrd')\n # =\u003e #\u003cDIDKit::Document:0x0000000105d751f8 @did=#\u003cDIDKit::DID:...\u003e, @json={...}\u003e\n\ndoc.handles\n # =\u003e [\"pfrazee.com\"] \n\ndoc.pds_endpoint\n # =\u003e \"https://morel.us-east.host.bsky.network\" \n```\n\nThere are also some helper methods in the `DID` class that create a `Resolver` for you to save you some typing:\n\n```rb\ndid = DID.resolve_handle('jay.bsky.team')\n #  =\u003e #\u003cDIDKit::DID:0x000000010615ed28 @did=\"did:plc:oky5czdrnfjpqslsw2a5iclo\", @type=:plc, @resolved_by=:dns\u003e\n\ndid.to_s\n # =\u003e \"did:plc:oky5czdrnfjpqslsw2a5iclo\" \n\ndid.get_document\n # =\u003e #\u003cDIDKit::Document:0x00000001066d4898 @did=#\u003cDIDKit::DID:...\u003e, @json={...}\u003e\n\ndid.get_validated_handle\n # =\u003e \"jay.bsky.team\" \n```\n\n\n### Configuration\n\nYou can override the nameserver used for DNS lookups by setting the `nameserver` property in `Resolver`, e.g. to use Google's or CloudFlare's global DNS:\n\n```\nresolver.nameserver = '8.8.8.8'\n```\n\n\n## Credits\n\nCopyright © 2024 Kuba Suder ([@mackuba.eu](https://bsky.app/profile/mackuba.eu)).\n\nThe code is available under the terms of the [zlib license](https://choosealicense.com/licenses/zlib/) (permissive, similar to MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmackuba%2Fdidkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmackuba%2Fdidkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmackuba%2Fdidkit/lists"}