CobbleSword / NachoSpigot

NachoSpigot is a fork of TacoSpigot 1.8.9 that offers several enhancements to performance as well as bug fixes.
GNU General Public License v3.0
237 stars 86 forks source link

Authentication implementation. #321

Closed sadcenter closed 2 years ago

sadcenter commented 2 years ago

Description

Changes auth implementation from yggdrasil one to mine one. (toggleable in configuration) It uses https://github.com/Electroid/mojang-api and caches the player's texture to the file.

Fixes/Adds #127 (Not completely due it's impossible, more info in Additional comments section.)

How has this been tested?

Tested by generating skulls and toggling online-mode

Additional Comments

It's impossible to remove the delay completely in async action (sync would be even worse). However, we can try to reduce the delay by using better API, cache, etc. Default cache time is 1 day. If there's something wrong with changes, let me know.

Checklist:

Blyrex commented 2 years ago

its not a good idea to use private apis in this project

sadcenter commented 2 years ago

its not a good idea to use private apis in this project

I personally trust this API. I haven't ever met with a situation when this API is down (I'm using this in every project that needs data from Mojang). But not everyone has to trust it, that's why I added an option in the configuration to disable that. IMO it would be great to add an option that allows you to toggle between ashcon API and Mojang's API

ytnoos commented 2 years ago

its not a good idea to use private apis in this project

I personally trust this API. I haven't ever met with a situation when this API is down (I'm using this in every project that needs data from Mojang). But not everyone has to trust it, that's why I added an option in the configuration to disable that.

IMO it would be great to add an option that allows you to toggle between ashcon API and Mojang's API

I think it would be good to automatically switch to Mojang's API if any exception is caught with ashcon API

CyberFlameGO commented 2 years ago

its not a good idea to use private apis in this project

The API seems open source (as declared on the issue init message) and claims to be hosted on Cloudflare Workers

CyberFlameGO commented 2 years ago

Oh also the person running and maintaining the API works at Cloudflare

Sculas commented 2 years ago

Looks good! Awesome PR :) Since some reviews are not yet resolved, I'll wait until this is fully ready. Since I do not look at this repo often because I don't have much time, please ping me if possible so I can merge it :)

Sculas commented 2 years ago

Also, since I merged some PRs please fix the conflicts if possible :)

sadcenter commented 2 years ago

oops Intelij IDEA kinda messed up I believe

ghost commented 2 years ago

oops Intelij IDEA kinda messed up I believe

Rebasing on master should partially fix it

Sculas commented 2 years ago

Is this PR stale or not?

HowardZHY commented 2 years ago

is https://github.com/CobbleSword/NachoSpigot/issues/353 related to this?

sadcenter commented 2 years ago

is #353 related to this?

it might fix it, but it's unlikely possible since authlib wasn't touched in nacho

sadcenter commented 2 years ago

Is this PR stale or not?

yea, I will resolve the conflicts tomorrow (if tram won't hit me or smth)

sadcenter commented 2 years ago

CodeQL uses Java 11 where exceptionallyCompose and exceptionallyComposeAsync doesn't exist :/