Rename the signature key param.

Rename the signature verification key endpoint.
Update CHANGELOG and README files
This commit is contained in:
ErickSkrauch
2021-02-27 02:37:59 +01:00
parent 6f148a8791
commit 2bc9f8eb57
5 changed files with 87 additions and 23 deletions

View File

@@ -71,7 +71,7 @@ func (ctx *Skinsystem) Handler() *mux.Router {
router.HandleFunc("/skins", ctx.skinGetHandler).Methods(http.MethodGet)
router.HandleFunc("/cloaks", ctx.capeGetHandler).Methods(http.MethodGet)
// Utils
router.HandleFunc("/signing-key", ctx.signingKeyHandler).Methods(http.MethodGet)
router.HandleFunc("/signature-verification-key", ctx.signatureVerificationKeyHandler).Methods(http.MethodGet)
return router
}
@@ -102,7 +102,6 @@ func (ctx *Skinsystem) skinGetHandler(response http.ResponseWriter, request *htt
ctx.skinHandler(response, request)
}
// TODO: write CHANGELOG about breaking change in this method
func (ctx *Skinsystem) capeHandler(response http.ResponseWriter, request *http.Request) {
profile, err := ctx.getProfile(request, true)
if err != nil {
@@ -182,7 +181,6 @@ func (ctx *Skinsystem) signedTexturesHandler(response http.ResponseWriter, reque
_, _ = response.Write(responseJson)
}
// TODO: add README entry about this method
func (ctx *Skinsystem) profileHandler(response http.ResponseWriter, request *http.Request) {
profile, err := ctx.getProfile(request, true)
if err != nil {
@@ -235,8 +233,7 @@ func (ctx *Skinsystem) profileHandler(response http.ResponseWriter, request *htt
_, _ = response.Write(responseJson)
}
// TODO: add README entry about this method
func (ctx *Skinsystem) signingKeyHandler(response http.ResponseWriter, request *http.Request) {
func (ctx *Skinsystem) signatureVerificationKeyHandler(response http.ResponseWriter, request *http.Request) {
publicKey, err := ctx.TexturesSigner.GetPublicKey()
if err != nil {
panic(err)

View File

@@ -1108,12 +1108,12 @@ var signingKeyTestsCases = []*skinsystemTestCase{
},
}
func (suite *skinsystemTestSuite) TestSigningKey() {
func (suite *skinsystemTestSuite) TestSignatureVerificationKey() {
for _, testCase := range signingKeyTestsCases {
suite.RunSubTest(testCase.Name, func() {
testCase.BeforeTest(suite)
req := httptest.NewRequest("GET", "http://chrly/signing-key", nil)
req := httptest.NewRequest("GET", "http://chrly/signature-verification-key", nil)
w := httptest.NewRecorder()
if testCase.PanicErr != "" {