Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A set of Swift utilities for resolving and validating DIDs and handles in the AT Protocol.

License

NotificationsYou must be signed in to change notification settings

ATProtoKit/ATIdentityTools

An icon for ATIdentityTools, which contains three stacks of rounded rectangles in an isometric top view. At the top stack, there's an icon of a card with lines on the right side to signify information. On the left side, the at symbol is in a thick weight, with a pointed arrow at the tip, is displayed. The three stacks are, from top to bottom, blue, then two shades of purple.

ATIdentityTools

Decentralized Identity (DID) and handle utilities for the AT Protocol, written in Swift.

GitHub Repo stars

Static BadgeGitHub Sponsors

ATIdentityTools is a Swift library to utilize identities in the AT Protocol. Given the importance of identities in the protocol, this package is needed to handle them. It includes finding, resolving, and validation for a given identity.

This Swift package handles the following parts with an user account:

  • The handle.
  • The Decentralized identifier (DID).
  • The DID Document.

A child package namedDIDCore has additional features specific to DIDs.

This is a lightweight package that shouldn't take much in your project, but its importance shouldn't be understated. This works best with the ATProtoKit family of Swift packages, but you can also use it alongside any ATProto packages unrelated to ATProtoKit.

This package relates to identity resolution and validation. This, andDIDCore, are based on theidentity anddid packages from the officialatproto TypeScript repository, respectively.

Quick Example

do{    // Create instances of the handle and DID resolvers.lethandleResolver=HandleResolver()vardidResolver=DIDResolver()    // Add the handle and resolve it.lethandle="atproto.com"letdid=tryawait handleResolver.resolve(handle: handle)iflet did= did{        // Now you can view the DID...print("Handle resolved to:\(did)") // did:plc:ewvi7nxzyoun6zhxrhs64oiz        // ... and resolve that to get the DID Document.letdidDocument=tryawait didResolver.resolve(did: did)print("DID Document:\(didDocument)")        // Additional retries of the same DID will be cached for a period of time.        // You can disable this by force refreshing.letsecondDIDDocument=tryawait didResolver.resolve(did: did, willForceRefresh:true)print("Second DID Document:\(secondDIDDocument)")        // Helper methods can also use the same cache.letdata=tryawait didResolver.resolveATProtocolData(for: did)print("Resolved AT Protocol Data:\(data)")if data.handle== handle{print("Handle mismatch.")}}else{print("No DID found for handle.")}}catch{print(error)}

Installation

You can use the Swift Package Manager to download and import the library into your project:

dependencies:[.package(url:"https://github.com/ATProtoKit/ATIdentityTools.git", from:"0.1.0")]

Then undertargets:

targets:[.target(        // name: "[name of target]",        dependencies:[.product(name:"ATIdentityTools",package:"atidentitytools"),.product(name:"DIDCore",package:"didcore")])]

Requirements

To use ATIdentityTools in your apps, your app should target the specific version numbers:

  • iOS andiPadOS 14 or later.
  • macOS 13 or later.
  • tvOS 14 or later.
  • visionOS 1 or later.
  • watchOS 9 or later.

For Linux, you need to use Swift 6.0 or later. On Linux, the minimum requirements include:

  • Amazon Linux 2
  • Debian 12
  • Fedora 39
  • Red Hat UBI 9
  • Ubuntu 20.04

You can also use this project for any programs you make using Swift and running onDocker.

Warning

As of right now, Windows support is theoretically possible, but not has not been tested to work. Contributions and feedback on making it fully compatible for Windows and Windows Server are welcomed. WebAssembly and Android are currently not supported, but will be in the future.

Submitting Contributions and Feedback

While this project will change significantly, feedback, issues, and contributions are highly welcomed and encouraged. If you'd like to contribute to this project, please be sure to read both theAPI Guidelines as well as theContributor Guidelines before submitting a pull request. Any issues (such as bug reports or feedback) can be submitted in theIssues tab. Finally, if there are any security vulnerabilities, please readSECURITY.md for how to report it.

If you have any questions, you can ask me on Bluesky (@cjrriley.ca). And while you're at it, give me a follow! I'm also active on theBluesky API Touchers Discord server.

License

This Swift package is using the Apache 2.0 License. Please viewLICENSE.md for more details.

About

A set of Swift utilities for resolving and validating DIDs and handles in the AT Protocol.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp