feat(profile): implement yggdrasil profile signing
This commit is contained in:
@@ -34,3 +34,36 @@ type UserProperty struct {
|
||||
ID string `json:"id"` // UUID пользователя
|
||||
Properties []any `json:"properties"` // Обычно пустой массив
|
||||
}
|
||||
|
||||
// TextureInfo содержит URL для конкретной текстуры
|
||||
type TextureInfo struct {
|
||||
URL string `json:"url"`
|
||||
}
|
||||
|
||||
// Textures содержит ссылки на скин и плащ
|
||||
type Textures struct {
|
||||
SKIN *TextureInfo `json:"SKIN,omitempty"`
|
||||
CAPE *TextureInfo `json:"CAPE,omitempty"`
|
||||
}
|
||||
|
||||
// ProfilePropertyValue - это закодированное в Base64 значение свойства textures
|
||||
type ProfilePropertyValue struct {
|
||||
Timestamp int64 `json:"timestamp"`
|
||||
ProfileID string `json:"profileId"`
|
||||
ProfileName string `json:"profileName"`
|
||||
Textures Textures `json:"textures"`
|
||||
}
|
||||
|
||||
// ProfileProperty - это свойство 'textures' в ответе
|
||||
type ProfileProperty struct {
|
||||
Name string `json:"name"` // Всегда "textures"
|
||||
Value string `json:"value"` // Base64(ProfilePropertyValue)
|
||||
Signature string `json:"signature"` // Base64(RSA-SHA1(Value))
|
||||
}
|
||||
|
||||
// SessionProfileResponse - это ответ от /sessionserver/session/minecraft/profile/{uuid}
|
||||
type SessionProfileResponse struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Properties []ProfileProperty `json:"properties"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user