Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Helper for Did Parsing #8

Open
drasticactions opened this issue Nov 13, 2023 · 2 comments
Open

Add Helper for Did Parsing #8

drasticactions opened this issue Nov 13, 2023 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@drasticactions
Copy link
Owner

When using ATDid for ATProtocol Methods, it may not be obvious what each part of the did does and where it can go. For example GetRecords takes an rkey, which is the last element of the did URL. Having a parser or extending ATDid to allow getting each element and validating them could help expose these fields.

@drasticactions drasticactions added enhancement New feature or request good first issue Good for newcomers labels Nov 13, 2023
@TimBurga
Copy link

Is this still worth pursuing? My current level of understanding of ATproto is that everything requires either the whole 3 part DID string or just the rkey (is rkey the official name for that last part?) Looking to contribute somewhere but just want to make sure it's useful.

@drasticactions
Copy link
Owner Author

https://github.com/drasticactions/FishyFlip/blob/main/src/FishyFlip/Models/ATUri.cs#L74-L87

https://github.com/drasticactions/FishyFlip/blob/main/src/FishyFlip/Models/ATUri.cs#L108-L120

I added a TryCreate and some helper properties for getting those values. I'm not sure if we need anything more specific beyond that now, but there could be more tests exercising the parsing code specifically to make sure it doesn't blow up when given a valid ATUri (or does blow up with a FormatException if given an invalid one). I should probably write some docs for how the tests work...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants