Open pie-flavor opened 4 years ago
Thanks for the request and detailed info @pie-flavor!
There's no API key required
Are you sure that's the case? It seems like an API key is required as part of the authentication call to create the session
https://ore.spongepowered.org/api#/Authentification/authenticate
Yes, it says:
to create a public session, don't pass an Authorization header.
If you run from PowerShell:
$session = (irm https://ore.spongepowered.org/api/v2/authenticate -method post).session
$project = irm https://ore.spongepowered.org/api/v2/projects/luckperms -headers @{Authorization="OreApi session=`"$session`""}
then you will get LuckPerms's project info with no API token required.
I think if we were going to implement this, we'd want to find a way to cache the session so that we don't have to make 2 API requests to render every badge.
Sessions seem to last for three hours, so it would indeed be beneficial to cache them. Storing the session key as property in the service class and getting a new one when it expires could be a simple way of handling this!
@pie-flavor would you like to give this a go? We've got a nice little tutorial to get you going. 😉
:clipboard: Description
These badges would be for Sponge plugins via Ore. They would be in the following formats (taking LuckPerms as an example):
:link: Data
Ore's public API is documented here. There's no API key required, although it requires a session to be created.
LuckPerms's API response looks like this:
URL::microphone: Motivation
Sponge is a platform for server-side modding of Minecraft servers, and is Spigot's main competitor in that field. shields.io already has great badges for Spigot plugins via Spiget, but no such badges for Sponge plugins via Ore (the official plugin repository). This would allow Sponge plugin developers to display information in badge format about their Sponge plugins on GitHub or a documentation site.