feat: add yggdrasil metadata endpoint and support authlib-injector
This commit is contained in:
1 parent
a1e022e966
commit
f1d763e056
4 files changed
+88
-2
No files matched your search
@@ -158,3 +158,19 @@ func (s *ProfileService) UpdateUserSkin(ctx context.Context, userID int, file mu
|
||||
|
||||
return s.UserRepo.UpdateSkinHash(ctx, userID, hash)
|
||||
}
|
||||
|
||||
// GetPublicKey возвращает публичный ключ в формате PEM
|
||||
func (s *ProfileService) GetPublicKey() (string, error) {
|
||||
pubKey := &s.privateKey.PublicKey
|
||||
pubASN1, err := x509.MarshalPKIXPublicKey(pubKey)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
pubBytes := pem.EncodeToMemory(&pem.Block{
|
||||
Type: "PUBLIC KEY",
|
||||
Bytes: pubASN1,
|
||||
})
|
||||
|
||||
return string(pubBytes), nil
|
||||
}
|
||||
Reference in new issue
Block a user