devlooped / SponsorLink

SponsorLink: an attempt at OSS sustainability
https://www.devlooped.com/SponsorLink
MIT License
38 stars 4 forks source link

Add tier as sponsor claim #234

Closed kzu closed 3 days ago

kzu commented 3 months ago

In order to activate different features at different sponsoring levels, we might want to introduce a way to surface tier-related claims in the sponsor manifest claims (JWT).

One way to achieve this would be to process hidden comments in tier definitions by the sponsorable, like:

☕ You want to buy me a Nespresso capsule, and everyone should be allowed to do that 🤗
<!-- tier: basic -->

By adding the <!-- claim: value -->, the sponsorable would introduce arbitrary claims into sponsor manifests.

Claims should be cumulative and overridable, though: a tier of $100 should override a tier claim specified by the $2 tier, but should also inherit a foo claim specified at the $2 level too. So, the closest tier to the actual user amount defines the claims that "win", and all other claims are inherited in turn (also overriding lower tier claims in turn).

This sounds a bit complicated, but editing and manually repeating hidden claims in tier descriptions isn't fun, so inheritance makes sense if we introduce this feature.

Back this issue Back this issue