2020-01-02 02:12:45 +05:30
|
|
|
package http
|
|
|
|
|
|
|
|
import (
|
2024-02-07 06:06:18 +05:30
|
|
|
"context"
|
2021-02-26 07:15:45 +05:30
|
|
|
"encoding/base64"
|
2020-01-02 02:12:45 +05:30
|
|
|
"encoding/json"
|
2024-02-07 18:54:41 +05:30
|
|
|
"fmt"
|
2024-03-05 17:37:54 +05:30
|
|
|
"io"
|
2020-01-02 02:12:45 +05:30
|
|
|
"net/http"
|
|
|
|
"strings"
|
2021-02-26 07:15:45 +05:30
|
|
|
"time"
|
2020-01-02 02:12:45 +05:30
|
|
|
|
|
|
|
"github.com/gorilla/mux"
|
2024-03-13 05:59:26 +05:30
|
|
|
"go.opentelemetry.io/otel/metric"
|
|
|
|
"go.uber.org/multierr"
|
2020-01-02 02:12:45 +05:30
|
|
|
|
2024-02-01 12:42:34 +05:30
|
|
|
"ely.by/chrly/internal/db"
|
|
|
|
"ely.by/chrly/internal/mojang"
|
2024-03-13 05:59:26 +05:30
|
|
|
"ely.by/chrly/internal/otel"
|
2024-02-01 12:42:34 +05:30
|
|
|
"ely.by/chrly/internal/utils"
|
2020-01-02 02:12:45 +05:30
|
|
|
)
|
|
|
|
|
2021-02-26 07:15:45 +05:30
|
|
|
var timeNow = time.Now
|
|
|
|
|
2024-01-30 13:35:04 +05:30
|
|
|
type ProfilesProvider interface {
|
2024-02-07 06:06:18 +05:30
|
|
|
FindProfileByUsername(ctx context.Context, username string, allowProxy bool) (*db.Profile, error)
|
2020-01-02 02:12:45 +05:30
|
|
|
}
|
|
|
|
|
2024-03-05 17:37:54 +05:30
|
|
|
// SignerService uses context because in the future we may separate this logic as an external microservice
|
|
|
|
type SignerService interface {
|
|
|
|
Sign(ctx context.Context, data string) (string, error)
|
|
|
|
GetPublicKey(ctx context.Context, format string) (string, error)
|
2021-02-26 07:15:45 +05:30
|
|
|
}
|
|
|
|
|
2024-03-13 05:59:26 +05:30
|
|
|
func NewSkinsystemApi(
|
|
|
|
profilesProvider ProfilesProvider,
|
|
|
|
signerService SignerService,
|
|
|
|
texturesExtraParamName string,
|
|
|
|
texturesExtraParamValue string,
|
|
|
|
) (*Skinsystem, error) {
|
|
|
|
metrics, err := newSkinsystemMetrics(otel.GetMeter())
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return &Skinsystem{
|
|
|
|
ProfilesProvider: profilesProvider,
|
|
|
|
SignerService: signerService,
|
|
|
|
TexturesExtraParamName: texturesExtraParamName,
|
|
|
|
TexturesExtraParamValue: texturesExtraParamValue,
|
|
|
|
metrics: metrics,
|
|
|
|
}, nil
|
|
|
|
}
|
|
|
|
|
2020-01-02 02:12:45 +05:30
|
|
|
type Skinsystem struct {
|
2024-01-30 13:35:04 +05:30
|
|
|
ProfilesProvider
|
2024-03-05 17:37:54 +05:30
|
|
|
SignerService
|
2020-04-19 05:01:09 +05:30
|
|
|
TexturesExtraParamName string
|
|
|
|
TexturesExtraParamValue string
|
2024-03-13 05:59:26 +05:30
|
|
|
metrics *skinsystemApiMetrics
|
2020-01-02 02:12:45 +05:30
|
|
|
}
|
|
|
|
|
2024-03-05 17:37:54 +05:30
|
|
|
func (s *Skinsystem) Handler() *mux.Router {
|
2020-01-02 02:12:45 +05:30
|
|
|
router := mux.NewRouter().StrictSlash(true)
|
|
|
|
|
2024-03-05 17:37:54 +05:30
|
|
|
router.HandleFunc("/skins/{username}", s.skinHandler).Methods(http.MethodGet)
|
|
|
|
router.HandleFunc("/cloaks/{username}", s.capeHandler).Methods(http.MethodGet)
|
2024-01-30 13:35:04 +05:30
|
|
|
// TODO: alias /capes/{username}?
|
2024-03-05 17:37:54 +05:30
|
|
|
router.HandleFunc("/textures/{username}", s.texturesHandler).Methods(http.MethodGet)
|
|
|
|
router.HandleFunc("/textures/signed/{username}", s.signedTexturesHandler).Methods(http.MethodGet)
|
|
|
|
router.HandleFunc("/profile/{username}", s.profileHandler).Methods(http.MethodGet)
|
2020-01-02 02:12:45 +05:30
|
|
|
// Legacy
|
2024-03-13 05:59:26 +05:30
|
|
|
router.HandleFunc("/skins", s.legacySkinHandler).Methods(http.MethodGet)
|
|
|
|
router.HandleFunc("/cloaks", s.legacyCapeHandler).Methods(http.MethodGet)
|
2021-02-26 07:15:45 +05:30
|
|
|
// Utils
|
2024-03-05 17:37:54 +05:30
|
|
|
router.HandleFunc("/signature-verification-key.{format:(?:pem|der)}", s.signatureVerificationKeyHandler).Methods(http.MethodGet)
|
2020-01-02 02:12:45 +05:30
|
|
|
|
|
|
|
return router
|
|
|
|
}
|
|
|
|
|
2024-03-05 17:37:54 +05:30
|
|
|
func (s *Skinsystem) skinHandler(response http.ResponseWriter, request *http.Request) {
|
2024-03-13 05:59:26 +05:30
|
|
|
s.metrics.SkinRequest.Add(request.Context(), 1)
|
2020-01-02 02:12:45 +05:30
|
|
|
|
2024-03-13 05:59:26 +05:30
|
|
|
s.skinHandlerWithUsername(response, request, mux.Vars(request)["username"])
|
2020-01-02 02:12:45 +05:30
|
|
|
}
|
|
|
|
|
2024-03-13 05:59:26 +05:30
|
|
|
func (s *Skinsystem) legacySkinHandler(response http.ResponseWriter, request *http.Request) {
|
|
|
|
s.metrics.LegacySkinRequest.Add(request.Context(), 1)
|
|
|
|
|
2020-01-02 02:12:45 +05:30
|
|
|
username := request.URL.Query().Get("name")
|
|
|
|
if username == "" {
|
|
|
|
response.WriteHeader(http.StatusBadRequest)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2024-03-13 05:59:26 +05:30
|
|
|
s.skinHandlerWithUsername(response, request, username)
|
2020-01-02 02:12:45 +05:30
|
|
|
}
|
|
|
|
|
2024-03-13 05:59:26 +05:30
|
|
|
func (s *Skinsystem) skinHandlerWithUsername(resp http.ResponseWriter, req *http.Request, username string) {
|
|
|
|
profile, err := s.ProfilesProvider.FindProfileByUsername(req.Context(), parseUsername(username), true)
|
2021-02-26 07:15:45 +05:30
|
|
|
if err != nil {
|
2024-03-13 05:59:26 +05:30
|
|
|
apiServerError(resp, req, fmt.Errorf("unable to retrieve a profile: %w", err))
|
2024-01-30 13:35:04 +05:30
|
|
|
return
|
2020-01-02 02:12:45 +05:30
|
|
|
}
|
|
|
|
|
2024-03-13 05:59:26 +05:30
|
|
|
if profile == nil || profile.SkinUrl == "" {
|
|
|
|
resp.WriteHeader(http.StatusNotFound)
|
2020-04-30 00:24:40 +05:30
|
|
|
}
|
|
|
|
|
2024-03-13 05:59:26 +05:30
|
|
|
http.Redirect(resp, req, profile.SkinUrl, http.StatusMovedPermanently)
|
2020-01-02 02:12:45 +05:30
|
|
|
}
|
|
|
|
|
2024-03-13 05:59:26 +05:30
|
|
|
func (s *Skinsystem) capeHandler(response http.ResponseWriter, request *http.Request) {
|
|
|
|
s.metrics.CapeRequest.Add(request.Context(), 1)
|
|
|
|
|
|
|
|
s.capeHandlerWithUsername(response, request, mux.Vars(request)["username"])
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Skinsystem) legacyCapeHandler(response http.ResponseWriter, request *http.Request) {
|
|
|
|
s.metrics.CapeRequest.Add(request.Context(), 1)
|
|
|
|
|
2020-01-02 02:12:45 +05:30
|
|
|
username := request.URL.Query().Get("name")
|
|
|
|
if username == "" {
|
|
|
|
response.WriteHeader(http.StatusBadRequest)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2024-03-13 05:59:26 +05:30
|
|
|
s.capeHandlerWithUsername(response, request, username)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Skinsystem) capeHandlerWithUsername(resp http.ResponseWriter, req *http.Request, username string) {
|
|
|
|
profile, err := s.ProfilesProvider.FindProfileByUsername(req.Context(), parseUsername(username), true)
|
|
|
|
if err != nil {
|
|
|
|
apiServerError(resp, req, fmt.Errorf("unable to retrieve a profile: %w", err))
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
if profile == nil || profile.CapeUrl == "" {
|
|
|
|
resp.WriteHeader(http.StatusNotFound)
|
|
|
|
}
|
2020-01-02 02:12:45 +05:30
|
|
|
|
2024-03-13 05:59:26 +05:30
|
|
|
http.Redirect(resp, req, profile.CapeUrl, http.StatusMovedPermanently)
|
2020-01-02 02:12:45 +05:30
|
|
|
}
|
|
|
|
|
2024-03-13 05:59:26 +05:30
|
|
|
func (s *Skinsystem) texturesHandler(resp http.ResponseWriter, req *http.Request) {
|
|
|
|
s.metrics.TexturesRequest.Add(req.Context(), 1)
|
|
|
|
|
|
|
|
profile, err := s.ProfilesProvider.FindProfileByUsername(req.Context(), mux.Vars(req)["username"], true)
|
2021-02-26 07:15:45 +05:30
|
|
|
if err != nil {
|
2024-03-13 05:59:26 +05:30
|
|
|
apiServerError(resp, req, fmt.Errorf("unable to retrieve a profile: %w", err))
|
2024-01-30 13:35:04 +05:30
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
if profile == nil {
|
2024-03-13 05:59:26 +05:30
|
|
|
resp.WriteHeader(http.StatusNotFound)
|
2024-01-30 13:35:04 +05:30
|
|
|
return
|
2021-02-26 07:15:45 +05:30
|
|
|
}
|
|
|
|
|
2024-01-30 13:35:04 +05:30
|
|
|
if profile.SkinUrl == "" && profile.CapeUrl == "" {
|
2024-03-13 05:59:26 +05:30
|
|
|
resp.WriteHeader(http.StatusNoContent)
|
2021-02-26 07:15:45 +05:30
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2024-01-30 13:35:04 +05:30
|
|
|
textures := texturesFromProfile(profile)
|
|
|
|
|
|
|
|
responseData, _ := json.Marshal(textures)
|
2024-03-13 05:59:26 +05:30
|
|
|
resp.Header().Set("Content-Type", "application/json")
|
|
|
|
_, _ = resp.Write(responseData)
|
2021-02-26 07:15:45 +05:30
|
|
|
}
|
|
|
|
|
2024-03-13 05:59:26 +05:30
|
|
|
func (s *Skinsystem) signedTexturesHandler(resp http.ResponseWriter, req *http.Request) {
|
|
|
|
s.metrics.SignedTexturesRequest.Add(req.Context(), 1)
|
|
|
|
|
2024-03-05 17:37:54 +05:30
|
|
|
profile, err := s.ProfilesProvider.FindProfileByUsername(
|
2024-03-13 05:59:26 +05:30
|
|
|
req.Context(),
|
|
|
|
mux.Vars(req)["username"],
|
|
|
|
getToBool(req.URL.Query().Get("proxy")),
|
2024-01-30 13:35:04 +05:30
|
|
|
)
|
2021-02-26 07:15:45 +05:30
|
|
|
if err != nil {
|
2024-03-13 05:59:26 +05:30
|
|
|
apiServerError(resp, req, fmt.Errorf("unable to retrieve a profile: %w", err))
|
2024-01-30 13:35:04 +05:30
|
|
|
return
|
2021-02-26 07:15:45 +05:30
|
|
|
}
|
|
|
|
|
2024-01-30 13:35:04 +05:30
|
|
|
if profile == nil {
|
2024-03-13 05:59:26 +05:30
|
|
|
resp.WriteHeader(http.StatusNotFound)
|
2024-01-30 13:35:04 +05:30
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
if profile.MojangTextures == "" {
|
2024-03-13 05:59:26 +05:30
|
|
|
resp.WriteHeader(http.StatusNoContent)
|
2021-02-26 07:15:45 +05:30
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2024-01-30 13:35:04 +05:30
|
|
|
profileResponse := &mojang.ProfileResponse{
|
|
|
|
Id: profile.Uuid,
|
2021-02-26 07:15:45 +05:30
|
|
|
Name: profile.Username,
|
|
|
|
Props: []*mojang.Property{
|
|
|
|
{
|
|
|
|
Name: "textures",
|
|
|
|
Signature: profile.MojangSignature,
|
|
|
|
Value: profile.MojangTextures,
|
|
|
|
},
|
|
|
|
{
|
2024-03-05 17:37:54 +05:30
|
|
|
Name: s.TexturesExtraParamName,
|
|
|
|
Value: s.TexturesExtraParamValue,
|
2021-02-26 07:15:45 +05:30
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
responseJson, _ := json.Marshal(profileResponse)
|
2024-03-13 05:59:26 +05:30
|
|
|
resp.Header().Set("Content-Type", "application/json")
|
|
|
|
_, _ = resp.Write(responseJson)
|
2021-02-26 07:15:45 +05:30
|
|
|
}
|
|
|
|
|
2024-03-13 05:59:26 +05:30
|
|
|
func (s *Skinsystem) profileHandler(resp http.ResponseWriter, req *http.Request) {
|
|
|
|
s.metrics.ProfileRequest.Add(req.Context(), 1)
|
|
|
|
|
|
|
|
profile, err := s.ProfilesProvider.FindProfileByUsername(req.Context(), mux.Vars(req)["username"], true)
|
2021-02-26 07:15:45 +05:30
|
|
|
if err != nil {
|
2024-03-13 05:59:26 +05:30
|
|
|
apiServerError(resp, req, fmt.Errorf("unable to retrieve a profile: %w", err))
|
2024-01-30 13:35:04 +05:30
|
|
|
return
|
2021-02-26 07:15:45 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
if profile == nil {
|
2024-03-13 05:59:26 +05:30
|
|
|
resp.WriteHeader(http.StatusNotFound)
|
2021-02-26 07:15:45 +05:30
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
texturesPropContent := &mojang.TexturesProp{
|
|
|
|
Timestamp: utils.UnixMillisecond(timeNow()),
|
2024-01-30 13:35:04 +05:30
|
|
|
ProfileID: profile.Uuid,
|
2021-02-26 07:15:45 +05:30
|
|
|
ProfileName: profile.Username,
|
2024-01-30 13:35:04 +05:30
|
|
|
Textures: texturesFromProfile(profile),
|
2021-02-26 07:15:45 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
texturesPropValueJson, _ := json.Marshal(texturesPropContent)
|
|
|
|
texturesPropEncodedValue := base64.StdEncoding.EncodeToString(texturesPropValueJson)
|
|
|
|
|
|
|
|
texturesProp := &mojang.Property{
|
|
|
|
Name: "textures",
|
|
|
|
Value: texturesPropEncodedValue,
|
|
|
|
}
|
|
|
|
|
2024-03-13 05:59:26 +05:30
|
|
|
if req.URL.Query().Has("unsigned") && !getToBool(req.URL.Query().Get("unsigned")) {
|
|
|
|
signature, err := s.SignerService.Sign(req.Context(), texturesProp.Value)
|
2021-02-26 07:15:45 +05:30
|
|
|
if err != nil {
|
2024-03-13 05:59:26 +05:30
|
|
|
apiServerError(resp, req, fmt.Errorf("unable to sign textures: %w", err))
|
2024-01-30 13:35:04 +05:30
|
|
|
return
|
2021-02-26 07:15:45 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
texturesProp.Signature = signature
|
|
|
|
}
|
|
|
|
|
2024-01-30 13:35:04 +05:30
|
|
|
profileResponse := &mojang.ProfileResponse{
|
|
|
|
Id: profile.Uuid,
|
2021-02-26 07:15:45 +05:30
|
|
|
Name: profile.Username,
|
|
|
|
Props: []*mojang.Property{
|
|
|
|
texturesProp,
|
|
|
|
{
|
2024-03-05 17:37:54 +05:30
|
|
|
Name: s.TexturesExtraParamName,
|
|
|
|
Value: s.TexturesExtraParamValue,
|
2021-02-26 07:15:45 +05:30
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
responseJson, _ := json.Marshal(profileResponse)
|
2024-03-13 05:59:26 +05:30
|
|
|
resp.Header().Set("Content-Type", "application/json")
|
|
|
|
_, _ = resp.Write(responseJson)
|
2021-02-26 07:15:45 +05:30
|
|
|
}
|
|
|
|
|
2024-03-13 05:59:26 +05:30
|
|
|
func (s *Skinsystem) signatureVerificationKeyHandler(resp http.ResponseWriter, req *http.Request) {
|
|
|
|
s.metrics.SigningKeyRequest.Add(req.Context(), 1)
|
|
|
|
|
|
|
|
format := mux.Vars(req)["format"]
|
|
|
|
publicKey, err := s.SignerService.GetPublicKey(req.Context(), format)
|
2021-02-26 07:15:45 +05:30
|
|
|
if err != nil {
|
2024-03-13 05:59:26 +05:30
|
|
|
apiServerError(resp, req, fmt.Errorf("unable to retrieve public key: %w", err))
|
2024-03-05 17:37:54 +05:30
|
|
|
return
|
2021-02-26 07:15:45 +05:30
|
|
|
}
|
|
|
|
|
2024-03-05 17:37:54 +05:30
|
|
|
if format == "pem" {
|
2024-03-13 05:59:26 +05:30
|
|
|
resp.Header().Set("Content-Type", "application/x-pem-file")
|
|
|
|
resp.Header().Set("Content-Disposition", `attachment; filename="yggdrasil_session_pubkey.pem"`)
|
2021-03-03 18:03:56 +05:30
|
|
|
} else {
|
2024-03-13 05:59:26 +05:30
|
|
|
resp.Header().Set("Content-Type", "application/octet-stream")
|
|
|
|
resp.Header().Set("Content-Disposition", `attachment; filename="yggdrasil_session_pubkey.der"`)
|
2021-03-03 18:03:56 +05:30
|
|
|
}
|
2024-03-05 17:37:54 +05:30
|
|
|
|
2024-03-13 05:59:26 +05:30
|
|
|
_, _ = io.WriteString(resp, publicKey)
|
2021-02-26 07:15:45 +05:30
|
|
|
}
|
|
|
|
|
2024-01-30 13:35:04 +05:30
|
|
|
func parseUsername(username string) string {
|
|
|
|
return strings.TrimSuffix(username, ".png")
|
|
|
|
}
|
2020-01-02 02:12:45 +05:30
|
|
|
|
2024-01-30 13:35:04 +05:30
|
|
|
func getToBool(v string) bool {
|
2024-03-13 05:59:26 +05:30
|
|
|
return v == "1" || v == "true" || v == "yes"
|
2024-01-30 13:35:04 +05:30
|
|
|
}
|
2020-01-02 02:12:45 +05:30
|
|
|
|
2024-01-30 13:35:04 +05:30
|
|
|
func texturesFromProfile(profile *db.Profile) *mojang.TexturesResponse {
|
|
|
|
var skin *mojang.SkinTexturesResponse
|
|
|
|
if profile.SkinUrl != "" {
|
|
|
|
skin = &mojang.SkinTexturesResponse{
|
|
|
|
Url: profile.SkinUrl,
|
2021-02-26 07:15:45 +05:30
|
|
|
}
|
2024-01-30 13:35:04 +05:30
|
|
|
if profile.SkinModel != "" {
|
|
|
|
skin.Metadata = &mojang.SkinTexturesMetadata{
|
|
|
|
Model: profile.SkinModel,
|
2021-02-26 07:15:45 +05:30
|
|
|
}
|
2020-01-02 02:12:45 +05:30
|
|
|
}
|
2024-01-30 13:35:04 +05:30
|
|
|
}
|
2021-02-26 07:15:45 +05:30
|
|
|
|
2024-01-30 13:35:04 +05:30
|
|
|
var cape *mojang.CapeTexturesResponse
|
|
|
|
if profile.CapeUrl != "" {
|
|
|
|
cape = &mojang.CapeTexturesResponse{
|
|
|
|
Url: profile.CapeUrl,
|
2021-02-26 07:15:45 +05:30
|
|
|
}
|
2020-01-02 02:12:45 +05:30
|
|
|
}
|
|
|
|
|
2024-01-30 13:35:04 +05:30
|
|
|
return &mojang.TexturesResponse{
|
|
|
|
Skin: skin,
|
|
|
|
Cape: cape,
|
|
|
|
}
|
2020-01-02 02:12:45 +05:30
|
|
|
}
|
2024-03-13 05:59:26 +05:30
|
|
|
|
|
|
|
func newSkinsystemMetrics(meter metric.Meter) (*skinsystemApiMetrics, error) {
|
|
|
|
m := &skinsystemApiMetrics{}
|
|
|
|
var errors, err error
|
|
|
|
|
|
|
|
m.SkinRequest, err = meter.Int64Counter("chrly.app.skinsystem.skin.request", metric.WithUnit("{request}"))
|
|
|
|
errors = multierr.Append(errors, err)
|
|
|
|
|
|
|
|
m.LegacySkinRequest, err = meter.Int64Counter("chrly.app.skinsystem.legacy_skin.request", metric.WithUnit("{request}"))
|
|
|
|
errors = multierr.Append(errors, err)
|
|
|
|
|
|
|
|
m.CapeRequest, err = meter.Int64Counter("chrly.app.skinsystem.cape.request", metric.WithUnit("{request}"))
|
|
|
|
errors = multierr.Append(errors, err)
|
|
|
|
|
|
|
|
m.LegacyCapeRequest, err = meter.Int64Counter("chrly.app.skinsystem.legacy_cape.request", metric.WithUnit("{request}"))
|
|
|
|
errors = multierr.Append(errors, err)
|
|
|
|
|
|
|
|
m.TexturesRequest, err = meter.Int64Counter("chrly.app.skinsystem.textures.request", metric.WithUnit("{request}"))
|
|
|
|
errors = multierr.Append(errors, err)
|
|
|
|
|
|
|
|
m.SignedTexturesRequest, err = meter.Int64Counter("chrly.app.skinsystem.signed_textures.request", metric.WithUnit("{request}"))
|
|
|
|
errors = multierr.Append(errors, err)
|
|
|
|
|
|
|
|
m.ProfileRequest, err = meter.Int64Counter("chrly.app.skinsystem.profile.request", metric.WithUnit("{request}"))
|
|
|
|
errors = multierr.Append(errors, err)
|
|
|
|
|
|
|
|
m.SigningKeyRequest, err = meter.Int64Counter("chrly.app.skinsystem.signing_key.request", metric.WithUnit("{request}"))
|
|
|
|
errors = multierr.Append(errors, err)
|
|
|
|
|
|
|
|
return m, errors
|
|
|
|
}
|
|
|
|
|
|
|
|
type skinsystemApiMetrics struct {
|
|
|
|
SkinRequest metric.Int64Counter
|
|
|
|
LegacySkinRequest metric.Int64Counter
|
|
|
|
CapeRequest metric.Int64Counter
|
|
|
|
LegacyCapeRequest metric.Int64Counter
|
|
|
|
TexturesRequest metric.Int64Counter
|
|
|
|
SignedTexturesRequest metric.Int64Counter
|
|
|
|
ProfileRequest metric.Int64Counter
|
|
|
|
SigningKeyRequest metric.Int64Counter
|
|
|
|
}
|