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

Create validation logic for known metadata fields in guardian Metadata config #632

Open
alexlwn123 opened this issue Mar 6, 2025 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers guardian-ui

Comments

@alexlwn123
Copy link
Member

alexlwn123 commented Mar 6, 2025

There are some footguns with configuring federation metadata. For all core protocol metadata config options defined here, we should have validation logic to ensure the guardians inputs are properly formed.

e.g.

{
  ...
  "vetted_gateways": "31637A7863323431323361736466..."
  // Invalid - should be an array of hex encoded ids
}


{
  ...
  "vetted_gateways": [ "31637A7863323431323361736466..." ]
  // Valid!
}

In addition, there are some other metadata fields required for 3rd party clients (namely Fedi) that we should validate as well. For example, if a federation has the StabilityPool module enabled, they must update some 2 metadata fields for clients to show the feature.

e.g.

{
  ...
  "fedi:stability_pool_disabled": "false",
  // Invalid - missing "max_stable_balance_msats"
}


{
  ...
  "fedi:stability_pool_disabled": "false",
  "fedi:max_stable_balance_msats": "1000000000"
  // Valid!
}
@alexlwn123 alexlwn123 added enhancement New feature or request good first issue Good for newcomers guardian-ui labels Mar 6, 2025
@elsirion
Copy link
Contributor

elsirion commented Mar 7, 2025

These are all Fedi-specific meta fields. Can we please keep any specific logic in a separate file at least? My long-term goal is to kinda allow every integrator to bring their own extra meta field validation rules/list of fields to select from in their own namespace (e.g. here fedi:).

@alexlwn123
Copy link
Member Author

My long-term goal is to kinda allow every integrator to bring their own extra meta field validation rules/list of fields to select from in their own namespace (e.g. here fedi:).

Yeah, would be cool to have a "load metadata template" feature.

Didn't realize these were scoped to fedi. Will update the issue accordingly

@alexlwn123 alexlwn123 changed the title Validate StabilityPool related meta fields in guardian Metadata config Create validation logic for known metadata fields in guardian Metadata config Mar 7, 2025
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 guardian-ui
Projects
None yet
Development

No branches or pull requests

2 participants