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 tier as sponsor claim #234

Closed
kzu opened this issue Jun 14, 2024 · 0 comments · Fixed by #359
Closed

Add tier as sponsor claim #234

kzu opened this issue Jun 14, 2024 · 0 comments · Fixed by #359
Labels
enhancement New feature or request

Comments

@kzu
Copy link
Member

kzu commented Jun 14, 2024

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

@kzu kzu added the enhancement New feature or request label Jun 14, 2024
kzu added a commit that referenced this issue Oct 1, 2024
As part of the tier description, sponsorables can add arbitrary yaml metadata such as:

```
<!-- tier: basic -->
```

Multiple values are supported in standard yaml format.

These claims are cumulative (i.e. tier 3 gets tier 2 and tier 1 metadata, with the closest tier to the actual sponsoring tier wins).

This now allows client code to selectively enable functionality based on GH sponsorship tier metadata.

Fixes #234
kzu added a commit that referenced this issue Oct 1, 2024
As part of the tier description, sponsorables can add arbitrary yaml metadata such as:

```
<!-- tier: basic -->
```

Multiple values are supported in standard yaml format.

These claims are cumulative (i.e. tier 3 gets tier 2 and tier 1 metadata, with the closest tier to the actual sponsoring tier wins).

This now allows client code to selectively enable functionality based on GH sponsorship tier metadata.

Fixes #234
@kzu kzu closed this as completed in #359 Oct 1, 2024
@kzu kzu closed this as completed in 8da7b38 Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant